/** * @pattern-x/gemini-viewer-threejs v0.2.19 build Sat Feb 04 2023 * https://pattern-x.github.io/gemini-viewer-examples/ * Copyright 2023 gemini * @license UNLICENSED */ var isStructurallyValidLanguageTag,canonicalizeLocaleList,defaultLocale,getType,__create=Object.create,__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__reflectGet=Reflect.get,__pow=Math.pow,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__require=(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')})),__esm=(e,t)=>function(){return e&&(t=(0,e[__getOwnPropNames(e)[0]])(e=0)),t},__commonJS=(e,t)=>function(){return t||(0,e[__getOwnPropNames(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of __getOwnPropNames(t))__hasOwnProp.call(e,n)||n===r||__defProp(e,n,{get:()=>t[n],enumerable:!(i=__getOwnPropDesc(t,n))||i.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?__create(__getProtoOf(e)):{},__copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !t&&e&&e.__esModule?r:__defProp(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__superGet=(e,t,r)=>__reflectGet(__getProtoOf(e),r,t),__async=(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{o(r.next(e))}catch(e){n(e)}},a=e=>{try{o(r.throw(e))}catch(e){n(e)}},o=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,a);o((r=r.apply(e,t)).next())})),factory_exports={};function _typeof(e){return(_typeof="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 _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,s),this._locale=n(r),this._select=t(this._locale),this._type=getType(i.type),this._nf=new e("en",i)}return _createClass(s,[{key:"resolvedOptions",value:function(){var e=this._nf.resolvedOptions(),t=e.minimumIntegerDigits,i=e.minimumFractionDigits,n=e.maximumFractionDigits,s=e.minimumSignificantDigits,a=e.maximumSignificantDigits,o={locale:this._locale,minimumIntegerDigits:t,minimumFractionDigits:i,maximumFractionDigits:n,pluralCategories:r(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 s))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 canonicalizeLocaleList(e).filter(i)}}]),s}();return Object.defineProperty(s,"prototype",{writable:!1}),s}__export(factory_exports,{default:()=>getPluralRules});var init_factory=__esm({"node_modules/intl-pluralrules/factory.mjs"(){isStructurallyValidLanguageTag=function(e){return e.split("-").every((function(e){return/[a-z0-9]+/i.test(e)}))},canonicalizeLocaleList=function(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(var t={},r=0;r="0"&&n<="9"&&++r}return rthis._maxSD?e.toPrecision(this._maxSD):t}return this._minFD>0?e.toFixed(this._minFD):0===this._maxFD?e.toFixed(0):String(e)}}],i&&r(t.prototype,i),n&&r(t,n),e}();t.exports=i}}),require_plural_rules=__commonJS({"node_modules/intl-pluralrules/plural-rules.js"(e,t){"use strict";var r=(init_factory(),__toCommonJS(factory_exports)),i=require_pseudo_number_format();function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(r),a=n(i);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)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c,u,h,p,d,m,f,g,_={exports:{}};c=_,u={_in:f=function(e,t){return"other"},af:h=function(e,t){return t?"other":1==e?"one":"other"},ak:p=function(e,t){return t?"other":0==e||1==e?"one":"other"},am:d=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},an:h,ar:function(e,t){var r=String(e).split("."),i=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":i>=3&&i<=10?"few":i>=11&&i<=99?"many":"other"},ars:function(e,t){var r=String(e).split("."),i=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":i>=3&&i<=10?"few":i>=11&&i<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:h,ast:m=function(e,t){var r=!String(e).split(".")[1];return t?"other":1==e&&r?"one":"other"},az:function(e,t){var r=String(e).split(".")[0],i=r.slice(-1),n=r.slice(-2),s=r.slice(-3);return t?1==i||2==i||5==i||7==i||8==i||20==n||50==n||70==n||80==n?"one":3==i||4==i||100==s||200==s||300==s||400==s||500==s||600==s||700==s||800==s||900==s?"few":0==r||6==i||40==n||60==n||90==n?"many":"other":1==e?"one":"other"},be:function(e,t){var r=String(e).split("."),i=Number(r[0])==e,n=i&&r[0].slice(-1),s=i&&r[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":i&&0==n||n>=5&&n<=9||s>=11&&s<=14?"many":"other"},bem:h,bez:h,bg:h,bho:p,bm:f,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:f,br:function(e,t){var r=String(e).split("."),i=Number(r[0])==e,n=i&&r[0].slice(-1),s=i&&r[0].slice(-2),a=i&&r[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&&i&&0==a?"many":"other"},brx:h,bs:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=i.slice(-2),l=n.slice(-1),c=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=c?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ca:function(e,t){var r=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&r?"one":"other"},ce:h,ceb:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=n.slice(-1);return t?"other":s&&(1==i||2==i||3==i)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},cgg:h,chr:h,ckb:h,cs:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1];return t?"other":1==e&&n?"one":i>=2&&i<=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 r=String(e).split("."),i=r[0],n=Number(r[0])==e;return t||1!=e&&(n||0!=i&&1!=i)?"other":"one"},de:m,doi:d,dsb:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.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:h,dz:f,ee:h,el:h,en:function(e,t){var r=String(e).split("."),i=!r[1],n=Number(r[0])==e,s=n&&r[0].slice(-1),a=n&&r[0].slice(-2);return t?1==s&&11!=a?"one":2==s&&12!=a?"two":3==s&&13!=a?"few":"other":1==e&&i?"one":"other"},eo:h,es:h,et:m,eu:h,fa:d,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:m,fil:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=n.slice(-1);return t?1==e?"one":"other":s&&(1==i||2==i||3==i)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},fo:h,fr:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=i.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=i&&0==s&&n?"many":"other"},fur:h,fy:m,ga:function(e,t){var r=String(e).split("."),i=Number(r[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":i&&e>=3&&e<=6?"few":i&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var r=String(e).split("."),i=Number(r[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":i&&e>=3&&e<=10||i&&e>=13&&e<=19?"few":"other"},gl:m,gsw:h,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 r=String(e).split("."),i=r[0],n=!r[1],s=i.slice(-1),a=i.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:h,haw:h,he:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=Number(r[0])==e,a=s&&r[0].slice(-1);return t?"other":1==e&&n?"one":2==i&&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 r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=i.slice(-2),l=n.slice(-1),c=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=c?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},hsb:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.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:m,id:f,ig:f,ii:f,io:m,is:function(e,t){var r=String(e).split("."),i=r[0],n=Number(r[0])==e,s=i.slice(-1),a=i.slice(-2);return t?"other":n&&1==s&&11!=a||!n?"one":"other"},it:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},iu:g=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"},iw:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=Number(r[0])==e,a=s&&r[0].slice(-1);return t?"other":1==e&&n?"one":2==i&&n?"two":n&&(e<0||e>10)&&s&&0==a?"many":"other"},ja:f,jbo:f,jgo:h,ji:m,jmc:h,jv:f,jw:f,ka:function(e,t){var r=String(e).split(".")[0],i=r.slice(-2);return t?1==r?"one":0==r||i>=2&&i<=20||40==i||60==i||80==i?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:h,kcg:h,kde:f,kea:f,kk:function(e,t){var r=String(e).split("."),i=Number(r[0])==e,n=i&&r[0].slice(-1);return t?6==n||9==n||i&&0==n&&0!=e?"many":"other":1==e?"one":"other"},kkj:h,kl:h,km:f,kn:d,ko:f,ks:h,ksb:h,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:h,kw:function(e,t){var r=String(e).split("."),i=Number(r[0])==e,n=i&&r[0].slice(-2),s=i&&r[0].slice(-3),a=i&&r[0].slice(-5),o=i&&r[0].slice(-6);return t?i&&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||i&&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:h,lag:function(e,t){var r=String(e).split(".")[0];return t?"other":0==e?"zero":0!=r&&1!=r||0==e?"other":"one"},lb:h,lg:h,lij:function(e,t){var r=String(e).split("."),i=!r[1],n=Number(r[0])==e;return t?11==e||8==e||n&&e>=80&&e<=89||n&&e>=800&&e<=899?"many":"other":1==e&&i?"one":"other"},lkt:f,ln:p,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var r=String(e).split("."),i=r[1]||"",n=Number(r[0])==e,s=n&&r[0].slice(-1),a=n&&r[0].slice(-2);return t?"other":1==s&&(a<11||a>19)?"one":s>=2&&s<=9&&(a<11||a>19)?"few":0!=i?"many":"other"},lv:function(e,t){var r=String(e).split("."),i=r[1]||"",n=i.length,s=Number(r[0])==e,a=s&&r[0].slice(-1),o=s&&r[0].slice(-2),l=i.slice(-2),c=i.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==c&&11!=l||2!=n&&1==c?"one":"other"},mas:h,mg:p,mgo:h,mk:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=i.slice(-2),l=n.slice(-1),c=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!=c?"one":"other"},ml:h,mn:h,mo:function(e,t){var r=String(e).split("."),i=!r[1],n=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&i?"one":!i||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 r=String(e).split("."),i=Number(r[0])==e&&r[0].slice(-2);return t?"other":1==e?"one":0==e||i>=2&&i<=10?"few":i>=11&&i<=19?"many":"other"},my:f,nah:h,naq:g,nb:h,nd:h,ne:function(e,t){var r=String(e).split("."),i=Number(r[0])==e;return t?i&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:m,nn:h,nnh:h,no:h,nqo:f,nr:h,nso:p,ny:h,nyn:h,om:h,or:function(e,t){var r=String(e).split("."),i=Number(r[0])==e;return t?1==e||5==e||i&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:h,osa:f,pa:p,pap:h,pcm:d,pl:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=i.slice(-1),a=i.slice(-2);return t?"other":1==e&&n?"one":n&&s>=2&&s<=4&&(a<12||a>14)?"few":n&&1!=i&&(0==s||1==s)||n&&s>=5&&s<=9||n&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var r=String(e).split("."),i=r[1]||"",n=i.length,s=Number(r[0])==e,a=s&&r[0].slice(-1),o=s&&r[0].slice(-2),l=i.slice(-2),c=i.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==c&&11!=l||2!=n&&1==c?"one":"other"},ps:h,pt:function(e,t){var r=String(e).split(".")[0];return t?"other":0==r||1==r?"one":"other"},pt_PT:m,rm:h,ro:function(e,t){var r=String(e).split("."),i=!r[1],n=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&i?"one":!i||0==e||n>=2&&n<=19?"few":"other"},rof:h,root:f,ru:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=i.slice(-1),a=i.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:h,sah:f,saq:h,sat:g,sc:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},scn:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},sd:h,sdh:h,se:g,seh:h,ses:f,sg:f,sh:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=i.slice(-2),l=n.slice(-1),c=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=c?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},shi:function(e,t){var r=String(e).split("."),i=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":i&&e>=2&&e<=10?"few":"other"},si:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"";return t?"other":0==e||1==e||0==i&&1==n?"one":"other"},sk:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1];return t?"other":1==e&&n?"one":i>=2&&i<=4&&n?"few":n?"other":"many"},sl:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=i.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:h,so:h,sq:function(e,t){var r=String(e).split("."),i=Number(r[0])==e,n=i&&r[0].slice(-1),s=i&&r[0].slice(-2);return t?1==e?"one":4==n&&14!=s?"many":"other":1==e?"one":"other"},sr:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=i.slice(-2),l=n.slice(-1),c=n.slice(-2);return t?"other":s&&1==a&&11!=o||1==l&&11!=c?"one":s&&a>=2&&a<=4&&(o<12||o>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ss:h,ssy:h,st:h,su:f,sv:function(e,t){var r=String(e).split("."),i=!r[1],n=Number(r[0])==e,s=n&&r[0].slice(-1),a=n&&r[0].slice(-2);return t?1!=s&&2!=s||11==a||12==a?"other":"one":1==e&&i?"one":"other"},sw:m,syr:h,ta:h,te:h,teo:h,th:f,ti:p,tig:h,tk:function(e,t){var r=String(e).split("."),i=Number(r[0])==e&&r[0].slice(-1);return t?6==i||9==i||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var r=String(e).split("."),i=r[0],n=r[1]||"",s=!r[1],a=i.slice(-1),o=n.slice(-1);return t?1==e?"one":"other":s&&(1==i||2==i||3==i)||s&&4!=a&&6!=a&&9!=a||!s&&4!=o&&6!=o&&9!=o?"one":"other"},tn:h,to:f,tr:h,ts:h,tzm:function(e,t){var r=String(e).split("."),i=Number(r[0])==e;return t?"other":0==e||1==e||i&&e>=11&&e<=99?"one":"other"},ug:h,uk:function(e,t){var r=String(e).split("."),i=r[0],n=!r[1],s=Number(r[0])==e,a=s&&r[0].slice(-1),o=s&&r[0].slice(-2),l=i.slice(-1),c=i.slice(-2);return t?3==a&&13!=o?"few":"other":n&&1==l&&11!=c?"one":n&&l>=2&&l<=4&&(c<12||c>14)?"few":n&&0==l||n&&l>=5&&l<=9||n&&c>=11&&c<=14?"many":"other"},ur:m,uz:h,ve:h,vi:function(e,t){return t&&1==e?"one":"other"},vo:h,vun:h,wa:p,wae:h,wo:f,xh:h,xog:h,yi:m,yo:f,yue:f,zh:f,zu:d},Object.defineProperty(u,"__esModule",{value:!0}),c.exports=u;var y=l(_.exports),T=Object.freeze(Object.assign(Object.create(null),_.exports,{default:y})),v={exports:{}};!function(e,t){var r,i="zero",n="one",s="two",a="few",o="many",l="other",c={cardinal:[n,l],ordinal:[l]},u={cardinal:[l],ordinal:[l]},h={cardinal:[n,a,o,l],ordinal:[l]},p={cardinal:[n,l],ordinal:[n,l]},d={cardinal:[n,s,l],ordinal:[l]};r={_in:u,af:c,ak:c,am:c,an:c,ar:{cardinal:[i,n,s,a,o,l],ordinal:[l]},ars:{cardinal:[i,n,s,a,o,l],ordinal:[l]},as:{cardinal:[n,l],ordinal:[n,s,a,o,l]},asa:c,ast:c,az:{cardinal:[n,l],ordinal:[n,a,o,l]},be:{cardinal:[n,a,o,l],ordinal:[a,l]},bem:c,bez:c,bg:c,bho:c,bm:u,bn:{cardinal:[n,l],ordinal:[n,s,a,o,l]},bo:u,br:{cardinal:[n,s,a,o,l],ordinal:[l]},brx:c,bs:{cardinal:[n,a,l],ordinal:[l]},ca:{cardinal:[n,l],ordinal:[n,s,a,l]},ce:c,ceb:c,cgg:c,chr:c,ckb:c,cs:h,cy:{cardinal:[i,n,s,a,o,l],ordinal:[i,n,s,a,o,l]},da:c,de:c,doi:c,dsb:{cardinal:[n,s,a,l],ordinal:[l]},dv:c,dz:u,ee:c,el:c,en:{cardinal:[n,l],ordinal:[n,s,a,l]},eo:c,es:c,et:c,eu:c,fa:c,ff:c,fi:c,fil:p,fo:c,fr:{cardinal:[n,o,l],ordinal:[n,l]},fur:c,fy:c,ga:{cardinal:[n,s,a,o,l],ordinal:[n,l]},gd:{cardinal:[n,s,a,l],ordinal:[n,s,a,l]},gl:c,gsw:c,gu:{cardinal:[n,l],ordinal:[n,s,a,o,l]},guw:c,gv:{cardinal:[n,s,a,o,l],ordinal:[l]},ha:c,haw:c,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:c,id:u,ig:u,ii:u,io:c,is:c,it:{cardinal:[n,l],ordinal:[o,l]},iu:d,iw:{cardinal:[n,s,o,l],ordinal:[l]},ja:u,jbo:u,jgo:c,ji:c,jmc:c,jv:u,jw:u,ka:{cardinal:[n,l],ordinal:[n,o,l]},kab:c,kaj:c,kcg:c,kde:u,kea:u,kk:{cardinal:[n,l],ordinal:[o,l]},kkj:c,kl:c,km:u,kn:c,ko:u,ks:c,ksb:c,ksh:{cardinal:[i,n,l],ordinal:[l]},ku:c,kw:{cardinal:[i,n,s,a,o,l],ordinal:[n,o,l]},ky:c,lag:{cardinal:[i,n,l],ordinal:[l]},lb:c,lg:c,lij:{cardinal:[n,l],ordinal:[o,l]},lkt:u,ln:c,lo:{cardinal:[l],ordinal:[n,l]},lt:h,lv:{cardinal:[i,n,l],ordinal:[l]},mas:c,mg:c,mgo:c,mk:{cardinal:[n,l],ordinal:[n,s,o,l]},ml:c,mn:c,mo:{cardinal:[n,a,l],ordinal:[n,l]},mr:{cardinal:[n,l],ordinal:[n,s,a,l]},ms:{cardinal:[l],ordinal:[n,l]},mt:h,my:u,nah:c,naq:d,nb:c,nd:c,ne:p,nl:c,nn:c,nnh:c,no:c,nqo:u,nr:c,nso:c,ny:c,nyn:c,om:c,or:{cardinal:[n,l],ordinal:[n,s,a,o,l]},os:c,osa:u,pa:c,pap:c,pcm:c,pl:h,prg:{cardinal:[i,n,l],ordinal:[l]},ps:c,pt:c,pt_PT:c,rm:c,ro:{cardinal:[n,a,l],ordinal:[n,l]},rof:c,root:u,ru:h,rwk:c,sah:u,saq:c,sat:d,sc:{cardinal:[n,l],ordinal:[o,l]},scn:{cardinal:[n,l],ordinal:[o,l]},sd:c,sdh:c,se:d,seh:c,ses:u,sg:u,sh:{cardinal:[n,a,l],ordinal:[l]},shi:{cardinal:[n,a,l],ordinal:[l]},si:c,sk:h,sl:{cardinal:[n,s,a,l],ordinal:[l]},sma:d,smi:d,smj:d,smn:d,sms:d,sn:c,so:c,sq:{cardinal:[n,l],ordinal:[n,o,l]},sr:{cardinal:[n,a,l],ordinal:[l]},ss:c,ssy:c,st:c,su:u,sv:p,sw:c,syr:c,ta:c,te:c,teo:c,th:u,ti:c,tig:c,tk:{cardinal:[n,l],ordinal:[a,l]},tl:p,tn:c,to:u,tr:c,ts:c,tzm:c,ug:c,uk:{cardinal:[n,a,o,l],ordinal:[a,l]},ur:c,uz:c,ve:c,vi:{cardinal:[l],ordinal:[n,l]},vo:c,vun:c,wa:c,wae:c,wo:u,xh:c,xog:c,yi:c,yo:u,yue:u,zh:u,zu:c},Object.defineProperty(r,"__esModule",{value:!0}),e.exports=r}(v);var E=l(v.exports),I=y||T,b=E||Object.freeze(Object.assign(Object.create(null),v.exports,{default:E})),x="object"===("undefined"==typeof Intl?"undefined":o(Intl))&&Intl.NumberFormat||a.default,S=function(e){return"in"===e?"_in":"pt-PT"===e?"pt_PT":e},w=s.default(x,(function(e){return I[S(e)]}),(function(e,t){return b[S(e)][t?"ordinal":"cardinal"]}));t.exports=w}}),require_polyfill=__commonJS({"node_modules/intl-pluralrules/polyfill.js"(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,i=t(require_plural_rules());"undefined"==typeof Intl?("undefined"!=typeof global?global.Intl={PluralRules:i.default}:"undefined"!=typeof window?window.Intl={PluralRules:i.default}:e.Intl={PluralRules:i.default},i.default.polyfill=!0):Intl.PluralRules?(r=["en","es","ru","zh"],Intl.PluralRules.supportedLocalesOf(r).length0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i}}),require_symbol_constructor_detection=__commonJS({"node_modules/core-js/internals/symbol-constructor-detection.js"(e,t){var r=require_engine_v8_version(),i=require_fails();t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham&&r&&r<41}))}}),require_use_symbol_as_uid=__commonJS({"node_modules/core-js/internals/use-symbol-as-uid.js"(e,t){var r=require_symbol_constructor_detection();t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}}),require_is_symbol=__commonJS({"node_modules/core-js/internals/is-symbol.js"(e,t){var r=require_get_built_in(),i=require_is_callable(),n=require_object_is_prototype_of(),s=require_use_symbol_as_uid(),a=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&n(t.prototype,a(e))}}}),require_try_to_string=__commonJS({"node_modules/core-js/internals/try-to-string.js"(e,t){var r=String;t.exports=function(e){try{return r(e)}catch(e){return"Object"}}}}),require_a_callable=__commonJS({"node_modules/core-js/internals/a-callable.js"(e,t){var r=require_is_callable(),i=require_try_to_string(),n=TypeError;t.exports=function(e){if(r(e))return e;throw n(i(e)+" is not a function")}}}),require_get_method=__commonJS({"node_modules/core-js/internals/get-method.js"(e,t){var r=require_a_callable(),i=require_is_null_or_undefined();t.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}}}),require_ordinary_to_primitive=__commonJS({"node_modules/core-js/internals/ordinary-to-primitive.js"(e,t){var r=require_function_call(),i=require_is_callable(),n=require_is_object(),s=TypeError;t.exports=function(e,t){var a,o;if("string"===t&&i(a=e.toString)&&!n(o=r(a,e)))return o;if(i(a=e.valueOf)&&!n(o=r(a,e)))return o;if("string"!==t&&i(a=e.toString)&&!n(o=r(a,e)))return o;throw s("Can't convert object to primitive value")}}}),require_is_pure=__commonJS({"node_modules/core-js/internals/is-pure.js"(e,t){t.exports=!1}}),require_define_global_property=__commonJS({"node_modules/core-js/internals/define-global-property.js"(e,t){var r=require_global(),i=Object.defineProperty;t.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(i){r[e]=t}return t}}}),require_shared_store=__commonJS({"node_modules/core-js/internals/shared-store.js"(e,t){var r=require_global(),i=require_define_global_property(),n="__core-js_shared__",s=r[n]||i(n,{});t.exports=s}}),require_shared=__commonJS({"node_modules/core-js/internals/shared.js"(e,t){var r=require_is_pure(),i=require_shared_store();(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.27.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE",source:"https://github.com/zloirock/core-js"})}}),require_to_object=__commonJS({"node_modules/core-js/internals/to-object.js"(e,t){var r=require_require_object_coercible(),i=Object;t.exports=function(e){return i(r(e))}}}),require_has_own_property=__commonJS({"node_modules/core-js/internals/has-own-property.js"(e,t){var r=require_function_uncurry_this(),i=require_to_object(),n=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return n(i(e),t)}}}),require_uid=__commonJS({"node_modules/core-js/internals/uid.js"(e,t){var r=require_function_uncurry_this(),i=0,n=Math.random(),s=r(1..toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+n,36)}}}),require_well_known_symbol=__commonJS({"node_modules/core-js/internals/well-known-symbol.js"(e,t){var r=require_global(),i=require_shared(),n=require_has_own_property(),s=require_uid(),a=require_symbol_constructor_detection(),o=require_use_symbol_as_uid(),l=i("wks"),c=r.Symbol,u=c&&c.for,h=o?c:c&&c.withoutSetter||s;t.exports=function(e){if(!n(l,e)||!a&&"string"!=typeof l[e]){var t="Symbol."+e;a&&n(c,e)?l[e]=c[e]:l[e]=o&&u?u(t):h(t)}return l[e]}}}),require_to_primitive=__commonJS({"node_modules/core-js/internals/to-primitive.js"(e,t){var r=require_function_call(),i=require_is_object(),n=require_is_symbol(),s=require_get_method(),a=require_ordinary_to_primitive(),o=require_well_known_symbol(),l=TypeError,c=o("toPrimitive");t.exports=function(e,t){if(!i(e)||n(e))return e;var o,u=s(e,c);if(u){if(void 0===t&&(t="default"),o=r(u,e,t),!i(o)||n(o))return o;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}}}),require_to_property_key=__commonJS({"node_modules/core-js/internals/to-property-key.js"(e,t){var r=require_to_primitive(),i=require_is_symbol();t.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}}}),require_document_create_element=__commonJS({"node_modules/core-js/internals/document-create-element.js"(e,t){var r=require_global(),i=require_is_object(),n=r.document,s=i(n)&&i(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}}}),require_ie8_dom_define=__commonJS({"node_modules/core-js/internals/ie8-dom-define.js"(e,t){var r=require_descriptors(),i=require_fails(),n=require_document_create_element();t.exports=!r&&!i((function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}}),require_object_get_own_property_descriptor=__commonJS({"node_modules/core-js/internals/object-get-own-property-descriptor.js"(e){var t=require_descriptors(),r=require_function_call(),i=require_object_property_is_enumerable(),n=require_create_property_descriptor(),s=require_to_indexed_object(),a=require_to_property_key(),o=require_has_own_property(),l=require_ie8_dom_define(),c=Object.getOwnPropertyDescriptor;e.f=t?c:function(e,t){if(e=s(e),t=a(t),l)try{return c(e,t)}catch(e){}if(o(e,t))return n(!r(i.f,e,t),e[t])}}}),require_v8_prototype_define_bug=__commonJS({"node_modules/core-js/internals/v8-prototype-define-bug.js"(e,t){var r=require_descriptors(),i=require_fails();t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}}),require_an_object=__commonJS({"node_modules/core-js/internals/an-object.js"(e,t){var r=require_is_object(),i=String,n=TypeError;t.exports=function(e){if(r(e))return e;throw n(i(e)+" is not an object")}}}),require_object_define_property=__commonJS({"node_modules/core-js/internals/object-define-property.js"(e){var t=require_descriptors(),r=require_ie8_dom_define(),i=require_v8_prototype_define_bug(),n=require_an_object(),s=require_to_property_key(),a=TypeError,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",h="writable";e.f=t?i?function(e,t,r){if(n(e),t=s(t),n(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var i=l(e,t);i&&i[h]&&(e[t]=r.value,r={configurable:u in r?r[u]:i[u],enumerable:c in r?r[c]:i[c],writable:!1})}return o(e,t,r)}:o:function(e,t,i){if(n(e),t=s(t),n(i),r)try{return o(e,t,i)}catch(e){}if("get"in i||"set"in i)throw a("Accessors not supported");return"value"in i&&(e[t]=i.value),e}}}),require_create_non_enumerable_property=__commonJS({"node_modules/core-js/internals/create-non-enumerable-property.js"(e,t){var r=require_descriptors(),i=require_object_define_property(),n=require_create_property_descriptor();t.exports=r?function(e,t,r){return i.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}}}),require_function_name=__commonJS({"node_modules/core-js/internals/function-name.js"(e,t){var r=require_descriptors(),i=require_has_own_property(),n=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(n,"name"),o=a&&"something"===function(){}.name,l=a&&(!r||r&&s(n,"name").configurable);t.exports={EXISTS:a,PROPER:o,CONFIGURABLE:l}}}),require_inspect_source=__commonJS({"node_modules/core-js/internals/inspect-source.js"(e,t){var r=require_function_uncurry_this(),i=require_is_callable(),n=require_shared_store(),s=r(Function.toString);i(n.inspectSource)||(n.inspectSource=function(e){return s(e)}),t.exports=n.inspectSource}}),require_weak_map_basic_detection=__commonJS({"node_modules/core-js/internals/weak-map-basic-detection.js"(e,t){var r=require_global(),i=require_is_callable(),n=r.WeakMap;t.exports=i(n)&&/native code/.test(String(n))}}),require_shared_key=__commonJS({"node_modules/core-js/internals/shared-key.js"(e,t){var r=require_shared(),i=require_uid(),n=r("keys");t.exports=function(e){return n[e]||(n[e]=i(e))}}}),require_hidden_keys=__commonJS({"node_modules/core-js/internals/hidden-keys.js"(e,t){t.exports={}}}),require_internal_state=__commonJS({"node_modules/core-js/internals/internal-state.js"(e,t){var r,i,n,s,a,o=require_weak_map_basic_detection(),l=require_global(),c=require_is_object(),u=require_create_non_enumerable_property(),h=require_has_own_property(),p=require_shared_store(),d=require_shared_key(),m=require_hidden_keys(),f="Object already initialized",g=l.TypeError,_=l.WeakMap;o||p.state?((s=p.state||(p.state=new _)).get=s.get,s.has=s.has,s.set=s.set,r=function(e,t){if(s.has(e))throw g(f);return t.facade=e,s.set(e,t),t},i=function(e){return s.get(e)||{}},n=function(e){return s.has(e)}):(m[a=d("state")]=!0,r=function(e,t){if(h(e,a))throw g(f);return t.facade=e,u(e,a,t),t},i=function(e){return h(e,a)?e[a]:{}},n=function(e){return h(e,a)}),t.exports={set:r,get:i,has:n,enforce:function(e){return n(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return r}}}}}),require_make_built_in=__commonJS({"node_modules/core-js/internals/make-built-in.js"(e,t){var r=require_fails(),i=require_is_callable(),n=require_has_own_property(),s=require_descriptors(),a=require_function_name().CONFIGURABLE,o=require_inspect_source(),l=require_internal_state(),c=l.enforce,u=l.get,h=Object.defineProperty,p=s&&!r((function(){return 8!==h((function(){}),"length",{value:8}).length})),d=String(String).split("String"),m=t.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!n(e,"name")||a&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),p&&r&&n(r,"arity")&&e.length!==r.arity&&h(e,"length",{value:r.arity});try{r&&n(r,"constructor")&&r.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=c(e);return n(i,"source")||(i.source=d.join("string"==typeof t?t:"")),e};Function.prototype.toString=m((function(){return i(this)&&u(this).source||o(this)}),"toString")}}),require_define_built_in=__commonJS({"node_modules/core-js/internals/define-built-in.js"(e,t){var r=require_is_callable(),i=require_object_define_property(),n=require_make_built_in(),s=require_define_global_property();t.exports=function(e,t,a,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:t;if(r(a)&&n(a,c,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:i.f(e,t,{value:a,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}}}),require_math_trunc=__commonJS({"node_modules/core-js/internals/math-trunc.js"(e,t){var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}}}),require_to_integer_or_infinity=__commonJS({"node_modules/core-js/internals/to-integer-or-infinity.js"(e,t){var r=require_math_trunc();t.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}}}),require_to_absolute_index=__commonJS({"node_modules/core-js/internals/to-absolute-index.js"(e,t){var r=require_to_integer_or_infinity(),i=Math.max,n=Math.min;t.exports=function(e,t){var s=r(e);return s<0?i(s+t,0):n(s,t)}}}),require_to_length=__commonJS({"node_modules/core-js/internals/to-length.js"(e,t){var r=require_to_integer_or_infinity(),i=Math.min;t.exports=function(e){return e>0?i(r(e),9007199254740991):0}}}),require_length_of_array_like=__commonJS({"node_modules/core-js/internals/length-of-array-like.js"(e,t){var r=require_to_length();t.exports=function(e){return r(e.length)}}}),require_array_includes=__commonJS({"node_modules/core-js/internals/array-includes.js"(e,t){var r=require_to_indexed_object(),i=require_to_absolute_index(),n=require_length_of_array_like(),s=function(e){return function(t,s,a){var o,l=r(t),c=n(l),u=i(a,c);if(e&&s!=s){for(;c>u;)if((o=l[u++])!=o)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===s)return e||u||0;return!e&&-1}};t.exports={ // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes:s(!0), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf:s(!1)}}}),require_object_keys_internal=__commonJS({"node_modules/core-js/internals/object-keys-internal.js"(e,t){var r=require_function_uncurry_this(),i=require_has_own_property(),n=require_to_indexed_object(),s=require_array_includes().indexOf,a=require_hidden_keys(),o=r([].push);t.exports=function(e,t){var r,l=n(e),c=0,u=[];for(r in l)!i(a,r)&&i(l,r)&&o(u,r);for(;t.length>c;)i(l,r=t[c++])&&(~s(u,r)||o(u,r));return u}}}),require_enum_bug_keys=__commonJS({"node_modules/core-js/internals/enum-bug-keys.js"(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}}),require_object_get_own_property_names=__commonJS({"node_modules/core-js/internals/object-get-own-property-names.js"(e){var t=require_object_keys_internal(),r=require_enum_bug_keys().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,r)}}}),require_object_get_own_property_symbols=__commonJS({"node_modules/core-js/internals/object-get-own-property-symbols.js"(e){e.f=Object.getOwnPropertySymbols}}),require_own_keys=__commonJS({"node_modules/core-js/internals/own-keys.js"(e,t){var r=require_get_built_in(),i=require_function_uncurry_this(),n=require_object_get_own_property_names(),s=require_object_get_own_property_symbols(),a=require_an_object(),o=i([].concat);t.exports=r("Reflect","ownKeys")||function(e){var t=n.f(a(e)),r=s.f;return r?o(t,r(e)):t}}}),require_copy_constructor_properties=__commonJS({"node_modules/core-js/internals/copy-constructor-properties.js"(e,t){var r=require_has_own_property(),i=require_own_keys(),n=require_object_get_own_property_descriptor(),s=require_object_define_property();t.exports=function(e,t,a){for(var o=i(t),l=s.f,c=n.f,u=0;uu;)i.f(e,r=l[u++],o[r]);return e}}}),require_html=__commonJS({"node_modules/core-js/internals/html.js"(e,t){var r=require_get_built_in();t.exports=r("document","documentElement")}}),require_object_create=__commonJS({"node_modules/core-js/internals/object-create.js"(e,t){var r,i=require_an_object(),n=require_object_define_properties(),s=require_enum_bug_keys(),a=require_hidden_keys(),o=require_html(),l=require_document_create_element(),c=require_shared_key(),u="prototype",h="script",p=c("IE_PROTO"),d=function(){},m=function(e){return"<"+h+">"+e+""},f=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;g="undefined"!=typeof document?document.domain&&r?f(r):(t=l("iframe"),i="java"+h+":",t.style.display="none",o.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):f(r);for(var n=s.length;n--;)delete g[u][s[n]];return g()};a[p]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(d[u]=i(e),r=new d,d[u]=null,r[p]=e):r=g(),void 0===t?r:n.f(r,t)}}}),require_create_property=__commonJS({"node_modules/core-js/internals/create-property.js"(e,t){"use strict";var r=require_to_property_key(),i=require_object_define_property(),n=require_create_property_descriptor();t.exports=function(e,t,s){var a=r(t);a in e?i.f(e,a,n(0,s)):e[a]=s}}}),require_array_slice_simple=__commonJS({"node_modules/core-js/internals/array-slice-simple.js"(e,t){var r=require_to_absolute_index(),i=require_length_of_array_like(),n=require_create_property(),s=Array,a=Math.max;t.exports=function(e,t,o){for(var l=i(e),c=r(t,l),u=r(void 0===o?l:o,l),h=s(a(u-c,0)),p=0;cx;x++)if((d||x in E)&&(T=I(y=E[x],x,v),e))if(t)w[x]=T;else if(T)switch(e){case 3:return!0;case 5:return y;case 6:return x;case 2:l(w,y)}else switch(e){case 4:return!1;case 7:l(w,y)}return h?-1:c||u?u:w}};t.exports={ // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach:c(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map:c(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter:c(2), // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some some:c(3), // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every every:c(4), // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find find:c(5), // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex:c(6), // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering filterReject:c(7)}}}),require_es_symbol_constructor=__commonJS({"node_modules/core-js/modules/es.symbol.constructor.js"(){"use strict";var e=require_export(),t=require_global(),r=require_function_call(),i=require_function_uncurry_this(),n=require_is_pure(),s=require_descriptors(),a=require_symbol_constructor_detection(),o=require_fails(),l=require_has_own_property(),c=require_object_is_prototype_of(),u=require_an_object(),h=require_to_indexed_object(),p=require_to_property_key(),d=require_to_string(),m=require_create_property_descriptor(),f=require_object_create(),g=require_object_keys(),_=require_object_get_own_property_names(),y=require_object_get_own_property_names_external(),T=require_object_get_own_property_symbols(),v=require_object_get_own_property_descriptor(),E=require_object_define_property(),I=require_object_define_properties(),b=require_object_property_is_enumerable(),x=require_define_built_in(),S=require_shared(),w=require_shared_key(),C=require_hidden_keys(),M=require_uid(),R=require_well_known_symbol(),A=require_well_known_symbol_wrapped(),D=require_well_known_symbol_define(),O=require_symbol_define_to_primitive(),L=require_set_to_string_tag(),P=require_internal_state(),N=require_array_iteration().forEach,F=w("hidden"),U="Symbol",B="prototype",k=P.set,G=P.getterFor(U),V=Object[B],H=t.Symbol,j=H&&H[B],z=t.TypeError,q=t.QObject,W=v.f,Y=E.f,X=y.f,J=b.f,$=i([].push),Z=S("symbols"),K=S("op-symbols"),Q=S("wks"),ee=!q||!q[B]||!q[B].findChild,te=s&&o((function(){return 7!=f(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,r){var i=W(V,t);i&&delete V[t],Y(e,t,r),i&&e!==V&&Y(V,t,i)}:Y,re=function(e,t){var r=Z[e]=f(j);return k(r,{type:U,tag:e,description:t}),s||(r.description=t),r},ie=function(e,t,r){e===V&&ie(K,t,r),u(e);var i=p(t);return u(r),l(Z,i)?(r.enumerable?(l(e,F)&&e[F][i]&&(e[F][i]=!1),r=f(r,{enumerable:m(0,!1)})):(l(e,F)||Y(e,F,m(1,{})),e[F][i]=!0),te(e,i,r)):Y(e,i,r)},ne=function(e,t){u(e);var i=h(t),n=g(i).concat(le(i));return N(n,(function(t){s&&!r(se,i,t)||ie(e,t,i[t])})),e},se=function(e){var t=p(e),i=r(J,this,t);return!(this===V&&l(Z,t)&&!l(K,t))&&(!(i||!l(this,t)||!l(Z,t)||l(this,F)&&this[F][t])||i)},ae=function(e,t){var r=h(e),i=p(t);if(r!==V||!l(Z,i)||l(K,i)){var n=W(r,i);return!n||!l(Z,i)||l(r,F)&&r[F][i]||(n.enumerable=!0),n}},oe=function(e){var t=X(h(e)),r=[];return N(t,(function(e){l(Z,e)||l(C,e)||$(r,e)})),r},le=function(e){var t=e===V,r=X(t?K:h(e)),i=[];return N(r,(function(e){!l(Z,e)||t&&!l(V,e)||$(i,Z[e])})),i};a||(H=function(){if(c(j,this))throw z("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?d(arguments[0]):void 0,t=M(e),i=function(e){this===V&&r(i,K,e),l(this,F)&&l(this[F],t)&&(this[F][t]=!1),te(this,t,m(1,e))};return s&&ee&&te(V,t,{configurable:!0,set:i}),re(t,e)},x(j=H[B],"toString",(function(){return G(this).tag})),x(H,"withoutSetter",(function(e){return re(M(e),e)})),b.f=se,E.f=ie,I.f=ne,v.f=ae,_.f=y.f=oe,T.f=le,A.f=function(e){return re(R(e),e)},s&&(Y(j,"description",{configurable:!0,get:function(){return G(this).description}}),n||x(V,"propertyIsEnumerable",se,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!a,sham:!a},{Symbol:H}),N(g(Q),(function(e){D(e)})),e({target:U,stat:!0,forced:!a},{useSetter:function(){ee=!0},useSimple:function(){ee=!1}}),e({target:"Object",stat:!0,forced:!a,sham:!s},{ // `Object.create` method // https://tc39.es/ecma262/#sec-object.create create:function(e,t){return void 0===t?f(e):ne(f(e),t)}, // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty defineProperty:ie, // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties defineProperties:ne, // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor:ae}),e({target:"Object",stat:!0,forced:!a},{ // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames:oe}),O(),L(H,U),C[F]=!0}}),require_symbol_registry_detection=__commonJS({"node_modules/core-js/internals/symbol-registry-detection.js"(e,t){var r=require_symbol_constructor_detection();t.exports=r&&!!Symbol.for&&!!Symbol.keyFor}}),require_es_symbol_for=__commonJS({"node_modules/core-js/modules/es.symbol.for.js"(){var e=require_export(),t=require_get_built_in(),r=require_has_own_property(),i=require_to_string(),n=require_shared(),s=require_symbol_registry_detection(),a=n("string-to-symbol-registry"),o=n("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!s},{for:function(e){var n=i(e);if(r(a,n))return a[n];var s=t("Symbol")(n);return a[n]=s,o[s]=n,s}})}}),require_es_symbol_key_for=__commonJS({"node_modules/core-js/modules/es.symbol.key-for.js"(){var e=require_export(),t=require_has_own_property(),r=require_is_symbol(),i=require_try_to_string(),n=require_shared(),s=require_symbol_registry_detection(),a=n("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!s},{keyFor:function(e){if(!r(e))throw TypeError(i(e)+" is not a symbol");if(t(a,e))return a[e]}})}}),require_function_apply=__commonJS({"node_modules/core-js/internals/function-apply.js"(e,t){var r=require_function_bind_native(),i=Function.prototype,n=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(n):function(){return s.apply(n,arguments)})}}),require_array_slice=__commonJS({"node_modules/core-js/internals/array-slice.js"(e,t){var r=require_function_uncurry_this();t.exports=r([].slice)}}),require_es_json_stringify=__commonJS({"node_modules/core-js/modules/es.json.stringify.js"(){var e=require_export(),t=require_get_built_in(),r=require_function_apply(),i=require_function_call(),n=require_function_uncurry_this(),s=require_fails(),a=require_is_array(),o=require_is_callable(),l=require_is_object(),c=require_is_symbol(),u=require_array_slice(),h=require_symbol_constructor_detection(),p=t("JSON","stringify"),d=n(/./.exec),m=n("".charAt),f=n("".charCodeAt),g=n("".replace),_=n(1..toString),y=/[\uD800-\uDFFF]/g,T=/^[\uD800-\uDBFF]$/,v=/^[\uDC00-\uDFFF]$/,E=!h||s((function(){var e=t("Symbol")();return"[null]"!=p([e])||"{}"!=p({a:e})||"{}"!=p(Object(e))})),I=s((function(){return'"\\udf06\\ud834"'!==p("\udf06\ud834")||'"\\udead"'!==p("\udead")})),b=function(e,t){var n=u(arguments),s=t;if((l(t)||void 0!==e)&&!c(e))return a(t)||(t=function(e,t){if(o(s)&&(t=i(s,this,e,t)),!c(t))return t}),n[1]=t,r(p,null,n)},x=function(e,t,r){var i=m(r,t-1),n=m(r,t+1);return d(T,e)&&!d(v,n)||d(v,e)&&!d(T,i)?"\\u"+_(f(e,0),16):e};p&&e({target:"JSON",stat:!0,arity:3,forced:E||I},{ // eslint-disable-next-line no-unused-vars -- required for `.length` stringify:function(e,t,i){var n=u(arguments),s=r(E?b:p,null,n);return I&&"string"==typeof s?g(s,y,x):s}})}}),require_es_object_get_own_property_symbols=__commonJS({"node_modules/core-js/modules/es.object.get-own-property-symbols.js"(){var e=require_export(),t=require_symbol_constructor_detection(),r=require_fails(),i=require_object_get_own_property_symbols(),n=require_to_object();e({target:"Object",stat:!0,forced:!t||r((function(){i.f(1)}))},{getOwnPropertySymbols:function(e){var t=i.f;return t?t(n(e)):[]}})}}),require_es_symbol=__commonJS({"node_modules/core-js/modules/es.symbol.js"(){require_es_symbol_constructor(),require_es_symbol_for(),require_es_symbol_key_for(),require_es_json_stringify(),require_es_object_get_own_property_symbols()}}),require_es_symbol_description=__commonJS({"node_modules/core-js/modules/es.symbol.description.js"(){"use strict";var e,t,r,i,n,s,a,o,l=require_export(),c=require_descriptors(),u=require_global(),h=require_function_uncurry_this(),p=require_has_own_property(),d=require_is_callable(),m=require_object_is_prototype_of(),f=require_to_string(),g=require_object_define_property().f,_=require_copy_constructor_properties(),y=u.Symbol,T=y&&y.prototype;!c||!d(y)||"description"in T&&// Safari 12 bug void 0===y().description||(e={},t=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),r=m(T,this)?new y(t):void 0===t?y():y(t);return""===t&&(e[r]=!0),r},_(t,y),t.prototype=T,T.constructor=t,r="Symbol(test)"==String(y("test")),i=h(T.valueOf),n=h(T.toString),s=/^Symbol\((.*)\)[^)]+$/,a=h("".replace),o=h("".slice),g(T,"description",{configurable:!0,get:function(){var t=i(this);if(p(e,t))return"";var l=n(t),c=r?o(l,7,-1):a(l,s,"$1");return""===c?void 0:c}}),l({global:!0,constructor:!0,forced:!0},{Symbol:t}))}}),require_es_symbol_async_iterator=__commonJS({"node_modules/core-js/modules/es.symbol.async-iterator.js"(){require_well_known_symbol_define()("asyncIterator")}}),require_es_symbol_has_instance=__commonJS({"node_modules/core-js/modules/es.symbol.has-instance.js"(){require_well_known_symbol_define()("hasInstance")}}),require_es_symbol_is_concat_spreadable=__commonJS({"node_modules/core-js/modules/es.symbol.is-concat-spreadable.js"(){require_well_known_symbol_define()("isConcatSpreadable")}}),require_es_symbol_iterator=__commonJS({"node_modules/core-js/modules/es.symbol.iterator.js"(){require_well_known_symbol_define()("iterator")}}),require_es_symbol_match=__commonJS({"node_modules/core-js/modules/es.symbol.match.js"(){require_well_known_symbol_define()("match")}}),require_es_symbol_match_all=__commonJS({"node_modules/core-js/modules/es.symbol.match-all.js"(){require_well_known_symbol_define()("matchAll")}}),require_es_symbol_replace=__commonJS({"node_modules/core-js/modules/es.symbol.replace.js"(){require_well_known_symbol_define()("replace")}}),require_es_symbol_search=__commonJS({"node_modules/core-js/modules/es.symbol.search.js"(){require_well_known_symbol_define()("search")}}),require_es_symbol_species=__commonJS({"node_modules/core-js/modules/es.symbol.species.js"(){require_well_known_symbol_define()("species")}}),require_es_symbol_split=__commonJS({"node_modules/core-js/modules/es.symbol.split.js"(){require_well_known_symbol_define()("split")}}),require_es_symbol_to_primitive=__commonJS({"node_modules/core-js/modules/es.symbol.to-primitive.js"(){var e=require_well_known_symbol_define(),t=require_symbol_define_to_primitive();e("toPrimitive"),t()}}),require_es_symbol_to_string_tag=__commonJS({"node_modules/core-js/modules/es.symbol.to-string-tag.js"(){var e=require_get_built_in(),t=require_well_known_symbol_define(),r=require_set_to_string_tag();t("toStringTag"),r(e("Symbol"),"Symbol")}}),require_es_symbol_unscopables=__commonJS({"node_modules/core-js/modules/es.symbol.unscopables.js"(){require_well_known_symbol_define()("unscopables")}}),require_a_possible_prototype=__commonJS({"node_modules/core-js/internals/a-possible-prototype.js"(e,t){var r=require_is_callable(),i=String,n=TypeError;t.exports=function(e){if("object"==typeof e||r(e))return e;throw n("Can't set "+i(e)+" as a prototype")}}}),require_object_set_prototype_of=__commonJS({"node_modules/core-js/internals/object-set-prototype-of.js"(e,t){var r=require_function_uncurry_this(),i=require_an_object(),n=require_a_possible_prototype();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(s,[]),t=s instanceof Array}catch(e){}return function(r,s){return i(r),n(s),t?e(r,s):r.__proto__=s,r}}():void 0)}}),require_proxy_accessor=__commonJS({"node_modules/core-js/internals/proxy-accessor.js"(e,t){var r=require_object_define_property().f;t.exports=function(e,t,i){i in e||r(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}}}),require_inherit_if_required=__commonJS({"node_modules/core-js/internals/inherit-if-required.js"(e,t){var r=require_is_callable(),i=require_is_object(),n=require_object_set_prototype_of();t.exports=function(e,t,s){var a,o;// it can work only with native `setPrototypeOf` return n&&// we haven't completely correct pre-ES6 way for getting `new.target`, so use this r(a=t.constructor)&&a!==s&&i(o=a.prototype)&&o!==s.prototype&&n(e,o),e}}}),require_normalize_string_argument=__commonJS({"node_modules/core-js/internals/normalize-string-argument.js"(e,t){var r=require_to_string();t.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}}}),require_install_error_cause=__commonJS({"node_modules/core-js/internals/install-error-cause.js"(e,t){var r=require_is_object(),i=require_create_non_enumerable_property();t.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}}}),require_error_stack_clear=__commonJS({"node_modules/core-js/internals/error-stack-clear.js"(e,t){var r=require_function_uncurry_this(),i=Error,n=r("".replace),s=String(i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(s);t.exports=function(e,t){if(o&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=n(e,a,"");return e}}}),require_error_stack_installable=__commonJS({"node_modules/core-js/internals/error-stack-installable.js"(e,t){var r=require_fails(),i=require_create_property_descriptor();t.exports=!r((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))}}),require_wrap_error_constructor_with_cause=__commonJS({"node_modules/core-js/internals/wrap-error-constructor-with-cause.js"(e,t){"use strict";var r=require_get_built_in(),i=require_has_own_property(),n=require_create_non_enumerable_property(),s=require_object_is_prototype_of(),a=require_object_set_prototype_of(),o=require_copy_constructor_properties(),l=require_proxy_accessor(),c=require_inherit_if_required(),u=require_normalize_string_argument(),h=require_install_error_cause(),p=require_error_stack_clear(),d=require_error_stack_installable(),m=require_descriptors(),f=require_is_pure();t.exports=function(e,t,g,_){var y="stackTraceLimit",T=_?2:1,v=e.split("."),E=v[v.length-1],I=r.apply(null,v);if(I){var b=I.prototype;if(!f&&i(b,"cause")&&delete b.cause,!g)return I;var x=r("Error"),S=t((function(e,t){var r=u(_?t:e,void 0),i=_?new I(e):new I;return void 0!==r&&n(i,"message",r),d&&n(i,"stack",p(i.stack,2)),this&&s(b,this)&&c(i,this,S),arguments.length>T&&h(i,arguments[T]),i}));if(S.prototype=b,"Error"!==E?a?a(S,x):o(S,x,{name:!0}):m&&y in I&&(l(S,I,y),l(S,I,"prepareStackTrace")),o(S,I),!f)try{b.name!==E&&n(b,"name",E),b.constructor=S}catch(e){}return S}}}}),require_es_error_cause=__commonJS({"node_modules/core-js/modules/es.error.cause.js"(){var e=require_export(),t=require_global(),r=require_function_apply(),i=require_wrap_error_constructor_with_cause(),n="WebAssembly",s=t[n],a=7!==Error("e",{cause:7}).cause,o=function(t,r){var n={};n[t]=i(t,r,a),e({global:!0,constructor:!0,arity:1,forced:a},n)},l=function(t,r){if(s&&s[t]){var o={};o[t]=i(n+"."+t,r,a),e({target:n,stat:!0,constructor:!0,arity:1,forced:a},o)}};o("Error",(function(e){return function(t){return r(e,this,arguments)}})),o("EvalError",(function(e){return function(t){return r(e,this,arguments)}})),o("RangeError",(function(e){return function(t){return r(e,this,arguments)}})),o("ReferenceError",(function(e){return function(t){return r(e,this,arguments)}})),o("SyntaxError",(function(e){return function(t){return r(e,this,arguments)}})),o("TypeError",(function(e){return function(t){return r(e,this,arguments)}})),o("URIError",(function(e){return function(t){return r(e,this,arguments)}})),l("CompileError",(function(e){return function(t){return r(e,this,arguments)}})),l("LinkError",(function(e){return function(t){return r(e,this,arguments)}})),l("RuntimeError",(function(e){return function(t){return r(e,this,arguments)}}))}}),require_error_to_string=__commonJS({"node_modules/core-js/internals/error-to-string.js"(e,t){"use strict";var r=require_descriptors(),i=require_fails(),n=require_an_object(),s=require_object_create(),a=require_normalize_string_argument(),o=Error.prototype.toString,l=i((function(){if(r){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"),r=a(e.message);return t?r?t+": "+r:t:r}:o}}),require_es_error_to_string=__commonJS({"node_modules/core-js/modules/es.error.to-string.js"(){var e=require_define_built_in(),t=require_error_to_string(),r=Error.prototype;r.toString!==t&&e(r,"toString",t)}}),require_correct_prototype_getter=__commonJS({"node_modules/core-js/internals/correct-prototype-getter.js"(e,t){var r=require_fails();t.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}}),require_object_get_prototype_of=__commonJS({"node_modules/core-js/internals/object-get-prototype-of.js"(e,t){var r=require_has_own_property(),i=require_is_callable(),n=require_to_object(),s=require_shared_key(),a=require_correct_prototype_getter(),o=s("IE_PROTO"),l=Object,c=l.prototype;t.exports=a?l.getPrototypeOf:function(e){var t=n(e);if(r(t,o))return t[o];var s=t.constructor;return i(s)&&t instanceof s?s.prototype:t instanceof l?c:null}}}),require_iterators=__commonJS({"node_modules/core-js/internals/iterators.js"(e,t){t.exports={}}}),require_is_array_iterator_method=__commonJS({"node_modules/core-js/internals/is-array-iterator-method.js"(e,t){var r=require_well_known_symbol(),i=require_iterators(),n=r("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||s[n]===e)}}}),require_get_iterator_method=__commonJS({"node_modules/core-js/internals/get-iterator-method.js"(e,t){var r=require_classof(),i=require_get_method(),n=require_is_null_or_undefined(),s=require_iterators(),a=require_well_known_symbol()("iterator");t.exports=function(e){if(!n(e))return i(e,a)||i(e,"@@iterator")||s[r(e)]}}}),require_get_iterator=__commonJS({"node_modules/core-js/internals/get-iterator.js"(e,t){var r=require_function_call(),i=require_a_callable(),n=require_an_object(),s=require_try_to_string(),a=require_get_iterator_method(),o=TypeError;t.exports=function(e,t){var l=arguments.length<2?a(e):t;if(i(l))return n(r(l,e));throw o(s(e)+" is not iterable")}}}),require_iterator_close=__commonJS({"node_modules/core-js/internals/iterator-close.js"(e,t){var r=require_function_call(),i=require_an_object(),n=require_get_method();t.exports=function(e,t,s){var a,o;i(e);try{if(!(a=n(e,"return"))){if("throw"===t)throw s;return s}a=r(a,e)}catch(e){o=!0,a=e}if("throw"===t)throw s;if(o)throw a;return i(a),s}}}),require_iterate=__commonJS({"node_modules/core-js/internals/iterate.js"(e,t){var r=require_function_bind_context(),i=require_function_call(),n=require_an_object(),s=require_try_to_string(),a=require_is_array_iterator_method(),o=require_length_of_array_like(),l=require_object_is_prototype_of(),c=require_get_iterator(),u=require_get_iterator_method(),h=require_iterator_close(),p=TypeError,d=function(e,t){this.stopped=e,this.result=t},m=d.prototype;t.exports=function(e,t,f){var g,_,y,T,v,E,I,b=f&&f.that,x=!(!f||!f.AS_ENTRIES),S=!(!f||!f.IS_RECORD),w=!(!f||!f.IS_ITERATOR),C=!(!f||!f.INTERRUPTED),M=r(t,b),R=function(e){return g&&h(g,"normal",e),new d(!0,e)},A=function(e){return x?(n(e),C?M(e[0],e[1],R):M(e[0],e[1])):C?M(e,R):M(e)};if(S)g=e.iterator;else if(w)g=e;else{if(!(_=u(e)))throw p(s(e)+" is not iterable");if(a(_)){for(y=0,T=o(e);T>y;y++)if((v=A(e[y]))&&l(m,v))return v;return new d(!1)}g=c(e,_)}for(E=S?e.next:g.next;!(I=i(E,g)).done;){try{v=A(I.value)}catch(e){h(g,"throw",e)}if("object"==typeof v&&v&&l(m,v))return v}return new d(!1)}}}),require_es_aggregate_error_constructor=__commonJS({"node_modules/core-js/modules/es.aggregate-error.constructor.js"(){"use strict";var e=require_export(),t=require_object_is_prototype_of(),r=require_object_get_prototype_of(),i=require_object_set_prototype_of(),n=require_copy_constructor_properties(),s=require_object_create(),a=require_create_non_enumerable_property(),o=require_create_property_descriptor(),l=require_error_stack_clear(),c=require_install_error_cause(),u=require_iterate(),h=require_normalize_string_argument(),p=require_well_known_symbol(),d=require_error_stack_installable(),m=p("toStringTag"),f=Error,g=[].push,_=function(e,n){var o,p=arguments.length>2?arguments[2]:void 0,_=t(y,this);i?o=i(f(),_?r(this):y):(o=_?this:s(y),a(o,m,"Error")),void 0!==n&&a(o,"message",h(n)),d&&a(o,"stack",l(o.stack,1)),c(o,p);var T=[];return u(e,g,{that:T}),a(o,"errors",T),o};i?i(_,f):n(_,f,{name:!0});var y=_.prototype=s(f.prototype,{constructor:o(1,_),message:o(1,""),name:o(1,"AggregateError")});e({global:!0,constructor:!0,arity:2},{AggregateError:_})}}),require_es_aggregate_error=__commonJS({"node_modules/core-js/modules/es.aggregate-error.js"(){require_es_aggregate_error_constructor()}}),require_es_aggregate_error_cause=__commonJS({"node_modules/core-js/modules/es.aggregate-error.cause.js"(){var e=require_export(),t=require_get_built_in(),r=require_function_apply(),i=require_fails(),n=require_wrap_error_constructor_with_cause(),s="AggregateError",a=t(s),o=!i((function(){return 1!==a([1]).errors[0]}))&&i((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,i){return r(e,this,arguments)}}),o,!0)})}}),require_add_to_unscopables=__commonJS({"node_modules/core-js/internals/add-to-unscopables.js"(e,t){var r=require_well_known_symbol(),i=require_object_create(),n=require_object_define_property().f,s=r("unscopables"),a=Array.prototype;null==a[s]&&n(a,s,{configurable:!0,value:i(null)}),t.exports=function(e){a[s][e]=!0}}}),require_es_array_at=__commonJS({"node_modules/core-js/modules/es.array.at.js"(){"use strict";var e=require_export(),t=require_to_object(),r=require_length_of_array_like(),i=require_to_integer_or_infinity(),n=require_add_to_unscopables();e({target:"Array",proto:!0},{at:function(e){var n=t(this),s=r(n),a=i(e),o=a>=0?a:s+a;return o<0||o>=s?void 0:n[o]}}),n("at")}}),require_does_not_exceed_safe_integer=__commonJS({"node_modules/core-js/internals/does-not-exceed-safe-integer.js"(e,t){var r=TypeError;t.exports=function(e){if(e>9007199254740991)throw r("Maximum allowed index exceeded");return e}}}),require_array_method_has_species_support=__commonJS({"node_modules/core-js/internals/array-method-has-species-support.js"(e,t){var r=require_fails(),i=require_well_known_symbol(),n=require_engine_v8_version(),s=i("species");t.exports=function(e){return n>=51||!r((function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}}}),require_es_array_concat=__commonJS({"node_modules/core-js/modules/es.array.concat.js"(){"use strict";var e=require_export(),t=require_fails(),r=require_is_array(),i=require_is_object(),n=require_to_object(),s=require_length_of_array_like(),a=require_does_not_exceed_safe_integer(),o=require_create_property(),l=require_array_species_create(),c=require_array_method_has_species_support(),u=require_well_known_symbol(),h=require_engine_v8_version(),p=u("isConcatSpreadable"),d=h>=51||!t((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),m=c("concat"),f=function(e){if(!i(e))return!1;var t=e[p];return void 0!==t?!!t:r(e)};e({target:"Array",proto:!0,arity:1,forced:!d||!m},{ // eslint-disable-next-line no-unused-vars -- required for `.length` concat:function(e){var t,r,i,c,u,h=n(this),p=l(h,0),d=0;for(t=-1,i=arguments.length;t2?arguments[2]:void 0,p=a((void 0===h?l:i(h,l))-u,l-c),d=1;for(u0;)u in o?o[c]=o[u]:s(o,c),c+=d,u+=d;return o}}}),require_es_array_copy_within=__commonJS({"node_modules/core-js/modules/es.array.copy-within.js"(){var e=require_export(),t=require_array_copy_within(),r=require_add_to_unscopables();e({target:"Array",proto:!0},{copyWithin:t}),r("copyWithin")}}),require_array_method_is_strict=__commonJS({"node_modules/core-js/internals/array-method-is-strict.js"(e,t){"use strict";var r=require_fails();t.exports=function(e,t){var i=[][e];return!!i&&r((function(){i.call(null,t||function(){return 1},1)}))}}}),require_es_array_every=__commonJS({"node_modules/core-js/modules/es.array.every.js"(){"use strict";var e=require_export(),t=require_array_iteration().every;e({target:"Array",proto:!0,forced:!require_array_method_is_strict()("every")},{every:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}}),require_array_fill=__commonJS({"node_modules/core-js/internals/array-fill.js"(e,t){"use strict";var r=require_to_object(),i=require_to_absolute_index(),n=require_length_of_array_like();t.exports=function(e){for(var t=r(this),s=n(t),a=arguments.length,o=i(a>1?arguments[1]:void 0,s),l=a>2?arguments[2]:void 0,c=void 0===l?s:i(l,s);c>o;)t[o++]=e;return t}}}),require_es_array_fill=__commonJS({"node_modules/core-js/modules/es.array.fill.js"(){var e=require_export(),t=require_array_fill(),r=require_add_to_unscopables();e({target:"Array",proto:!0},{fill:t}),r("fill")}}),require_es_array_filter=__commonJS({"node_modules/core-js/modules/es.array.filter.js"(){"use strict";var e=require_export(),t=require_array_iteration().filter;e({target:"Array",proto:!0,forced:!require_array_method_has_species_support()("filter")},{filter:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}}),require_es_array_find=__commonJS({"node_modules/core-js/modules/es.array.find.js"(){"use strict";var e=require_export(),t=require_array_iteration().find,r=require_add_to_unscopables(),i="find",n=!0;i in[]&&Array(1)[i]((function(){n=!1})),e({target:"Array",proto:!0,forced:n},{find:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r(i)}}),require_es_array_find_index=__commonJS({"node_modules/core-js/modules/es.array.find-index.js"(){"use strict";var e=require_export(),t=require_array_iteration().findIndex,r=require_add_to_unscopables(),i="findIndex",n=!0;i in[]&&Array(1)[i]((function(){n=!1})),e({target:"Array",proto:!0,forced:n},{findIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r(i)}}),require_array_iteration_from_last=__commonJS({"node_modules/core-js/internals/array-iteration-from-last.js"(e,t){var r=require_function_bind_context(),i=require_indexed_object(),n=require_to_object(),s=require_length_of_array_like(),a=function(e){var t=1==e;return function(a,o,l){for(var c,u=n(a),h=i(u),p=r(o,l),d=s(h);d-- >0;)if(p(c=h[d],d,u))switch(e){case 0:return c;case 1:return d}return t?-1:void 0}};t.exports={ // `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last findLast:a(0), // `Array.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last findLastIndex:a(1)}}}),require_es_array_find_last=__commonJS({"node_modules/core-js/modules/es.array.find-last.js"(){"use strict";var e=require_export(),t=require_array_iteration_from_last().findLast,r=require_add_to_unscopables();e({target:"Array",proto:!0},{findLast:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r("findLast")}}),require_es_array_find_last_index=__commonJS({"node_modules/core-js/modules/es.array.find-last-index.js"(){"use strict";var e=require_export(),t=require_array_iteration_from_last().findLastIndex,r=require_add_to_unscopables();e({target:"Array",proto:!0},{findLastIndex:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),r("findLastIndex")}}),require_flatten_into_array=__commonJS({"node_modules/core-js/internals/flatten-into-array.js"(e,t){"use strict";var r=require_is_array(),i=require_length_of_array_like(),n=require_does_not_exceed_safe_integer(),s=require_function_bind_context(),a=function(e,t,o,l,c,u,h,p){for(var d,m,f=c,g=0,_=!!h&&s(h,p);g0&&r(d)?(m=i(d),f=a(e,t,d,m,f,u-1)-1):(n(f+1),e[f]=d),f++),g++;return f};t.exports=a}}),require_es_array_flat=__commonJS({"node_modules/core-js/modules/es.array.flat.js"(){"use strict";var e=require_export(),t=require_flatten_into_array(),r=require_to_object(),i=require_length_of_array_like(),n=require_to_integer_or_infinity(),s=require_array_species_create();e({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,a=r(this),o=i(a),l=s(a,0);return l.length=t(l,a,a,o,0,void 0===e?1:n(e)),l}})}}),require_es_array_flat_map=__commonJS({"node_modules/core-js/modules/es.array.flat-map.js"(){"use strict";var e=require_export(),t=require_flatten_into_array(),r=require_a_callable(),i=require_to_object(),n=require_length_of_array_like(),s=require_array_species_create();e({target:"Array",proto:!0},{flatMap:function(e){var a,o=i(this),l=n(o);return r(e),(a=s(o,0)).length=t(a,o,o,l,0,1,e,arguments.length>1?arguments[1]:void 0),a}})}}),require_array_for_each=__commonJS({"node_modules/core-js/internals/array-for-each.js"(e,t){"use strict";var r=require_array_iteration().forEach,i=require_array_method_is_strict()("forEach");t.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}}),require_es_array_for_each=__commonJS({"node_modules/core-js/modules/es.array.for-each.js"(){"use strict";var e=require_export(),t=require_array_for_each();e({target:"Array",proto:!0,forced:[].forEach!=t},{forEach:t})}}),require_call_with_safe_iteration_closing=__commonJS({"node_modules/core-js/internals/call-with-safe-iteration-closing.js"(e,t){var r=require_an_object(),i=require_iterator_close();t.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}}}),require_array_from=__commonJS({"node_modules/core-js/internals/array-from.js"(e,t){"use strict";var r=require_function_bind_context(),i=require_function_call(),n=require_to_object(),s=require_call_with_safe_iteration_closing(),a=require_is_array_iterator_method(),o=require_is_constructor(),l=require_length_of_array_like(),c=require_create_property(),u=require_get_iterator(),h=require_get_iterator_method(),p=Array;t.exports=function(e){var t=n(e),d=o(this),m=arguments.length,f=m>1?arguments[1]:void 0,g=void 0!==f;g&&(f=r(f,m>2?arguments[2]:void 0));var _,y,T,v,E,I,b=h(t),x=0;if(!b||this===p&&a(b))for(_=l(t),y=d?new this(_):p(_);_>x;x++)I=g?f(t[x],x):t[x],c(y,x,I);else for(E=(v=u(t,b)).next,y=d?new this:[];!(T=i(E,v)).done;x++)I=g?s(v,f,[T.value,x],!0):T.value,c(y,x,I);return y.length=x,y}}}),require_check_correctness_of_iteration=__commonJS({"node_modules/core-js/internals/check-correctness-of-iteration.js"(e,t){var r,i,n=require_well_known_symbol()("iterator"),s=!1;try{r=0,(i={next:function(){return{done:!!r++}},return:function(){s=!0}})[n]=function(){return this},Array.from(i,(function(){throw 2}))}catch(e){}t.exports=function(e,t){if(!t&&!s)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}}}),require_es_array_from=__commonJS({"node_modules/core-js/modules/es.array.from.js"(){var e=require_export(),t=require_array_from();e({target:"Array",stat:!0,forced:!require_check_correctness_of_iteration()((function(e){Array.from(e)}))},{from:t})}}),require_es_array_includes=__commonJS({"node_modules/core-js/modules/es.array.includes.js"(){"use strict";var e=require_export(),t=require_array_includes().includes,r=require_fails(),i=require_add_to_unscopables();e({target:"Array",proto:!0,forced:r((function(){return!Array(1).includes()}))},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")}}),require_es_array_index_of=__commonJS({"node_modules/core-js/modules/es.array.index-of.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this_clause(),r=require_array_includes().indexOf,i=require_array_method_is_strict(),n=t([].indexOf),s=!!n&&1/n([1],1,-0)<0,a=i("indexOf");e({target:"Array",proto:!0,forced:s||!a},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s?n(this,e,t)||0:r(this,e,t)}})}}),require_es_array_is_array=__commonJS({"node_modules/core-js/modules/es.array.is-array.js"(){require_export()({target:"Array",stat:!0},{isArray:require_is_array()})}}),require_iterators_core=__commonJS({"node_modules/core-js/internals/iterators-core.js"(e,t){"use strict";var r,i,n,s=require_fails(),a=require_is_callable(),o=require_is_object(),l=require_object_create(),c=require_object_get_prototype_of(),u=require_define_built_in(),h=require_well_known_symbol(),p=require_is_pure(),d=h("iterator"),m=!1;[].keys&&("next"in(n=[].keys())?(i=c(c(n)))!==Object.prototype&&(r=i):m=!0),!o(r)||s((function(){var e={};return r[d].call(e)!==e}))?r={}:p&&(r=l(r)),a(r[d])||u(r,d,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}}}),require_iterator_create_constructor=__commonJS({"node_modules/core-js/internals/iterator-create-constructor.js"(e,t){"use strict";var r=require_iterators_core().IteratorPrototype,i=require_object_create(),n=require_create_property_descriptor(),s=require_set_to_string_tag(),a=require_iterators(),o=function(){return this};t.exports=function(e,t,l,c){var u=t+" Iterator";return e.prototype=i(r,{next:n(+!c,l)}),s(e,u,!1,!0),a[u]=o,e}}}),require_iterator_define=__commonJS({"node_modules/core-js/internals/iterator-define.js"(e,t){"use strict";var r=require_export(),i=require_function_call(),n=require_is_pure(),s=require_function_name(),a=require_is_callable(),o=require_iterator_create_constructor(),l=require_object_get_prototype_of(),c=require_object_set_prototype_of(),u=require_set_to_string_tag(),h=require_create_non_enumerable_property(),p=require_define_built_in(),d=require_well_known_symbol(),m=require_iterators(),f=require_iterators_core(),g=s.PROPER,_=s.CONFIGURABLE,y=f.IteratorPrototype,T=f.BUGGY_SAFARI_ITERATORS,v=d("iterator"),E="keys",I="values",b="entries",x=function(){return this};t.exports=function(e,t,s,d,f,S,w){o(s,t,d);var C,M,R,A=function(e){if(e===f&&N)return N;if(!T&&e in L)return L[e];switch(e){case E:case I:case b:return function(){return new s(this,e)}}return function(){return new s(this)}},D=t+" Iterator",O=!1,L=e.prototype,P=L[v]||L["@@iterator"]||f&&L[f],N=!T&&P||A(f),F="Array"==t&&L.entries||P;if(F&&(C=l(F.call(new e)))!==Object.prototype&&C.next&&(n||l(C)===y||(c?c(C,y):a(C[v])||p(C,v,x)),u(C,D,!0,!0),n&&(m[D]=x)),g&&f==I&&P&&P.name!==I&&(!n&&_?h(L,"name",I):(O=!0,N=function(){return i(P,this)})),f)if(M={values:A(I),keys:S?N:A(E),entries:A(b)},w)for(R in M)(T||O||!(R in L))&&p(L,R,M[R]);else r({target:t,proto:!0,forced:T||O},M);return n&&!w||L[v]===N||p(L,v,N,{name:f}),m[t]=N,M}}}),require_create_iter_result_object=__commonJS({"node_modules/core-js/internals/create-iter-result-object.js"(e,t){t.exports=function(e,t){return{value:e,done:t}}}}),require_es_array_iterator=__commonJS({"node_modules/core-js/modules/es.array.iterator.js"(e,t){"use strict";var r=require_to_indexed_object(),i=require_add_to_unscopables(),n=require_iterators(),s=require_internal_state(),a=require_object_define_property().f,o=require_iterator_define(),l=require_create_iter_result_object(),c=require_is_pure(),u=require_descriptors(),h="Array Iterator",p=s.set,d=s.getterFor(h);t.exports=o(Array,"Array",(function(e,t){p(this,{type:h,target:r(e), // target index:0, // next index kind:t})}),(function(){var e=d(this),t=e.target,r=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,l(void 0,!0)):l("keys"==r?i:"values"==r?t[i]:[i,t[i]],!1)}),"values");var m=n.Arguments=n.Array;if(i("keys"),i("values"),i("entries"),!c&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(e){}}}),require_es_array_join=__commonJS({"node_modules/core-js/modules/es.array.join.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_indexed_object(),i=require_to_indexed_object(),n=require_array_method_is_strict(),s=t([].join),a=r!=Object,o=n("join",",");e({target:"Array",proto:!0,forced:a||!o},{join:function(e){return s(i(this),void 0===e?",":e)}})}}),require_array_last_index_of=__commonJS({"node_modules/core-js/internals/array-last-index-of.js"(e,t){"use strict";var r=require_function_apply(),i=require_to_indexed_object(),n=require_to_integer_or_infinity(),s=require_length_of_array_like(),a=require_array_method_is_strict(),o=Math.min,l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),h=c||!u;t.exports=h?function(e){if(c)return r(l,this,arguments)||0;var t=i(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}}),require_es_array_last_index_of=__commonJS({"node_modules/core-js/modules/es.array.last-index-of.js"(){var e=require_export(),t=require_array_last_index_of();e({target:"Array",proto:!0,forced:t!==[].lastIndexOf},{lastIndexOf:t})}}),require_es_array_map=__commonJS({"node_modules/core-js/modules/es.array.map.js"(){"use strict";var e=require_export(),t=require_array_iteration().map;e({target:"Array",proto:!0,forced:!require_array_method_has_species_support()("map")},{map:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}}),require_es_array_of=__commonJS({"node_modules/core-js/modules/es.array.of.js"(){"use strict";var e=require_export(),t=require_fails(),r=require_is_constructor(),i=require_create_property(),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(r(this)?this:n)(t);t>e;)i(s,e,arguments[e++]);return s.length=t,s}})}}),require_array_set_length=__commonJS({"node_modules/core-js/internals/array-set-length.js"(e,t){"use strict";var r=require_descriptors(),i=require_is_array(),n=TypeError,s=Object.getOwnPropertyDescriptor,a=r&&!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(i(e)&&!s(e,"length").writable)throw n("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}}}),require_es_array_push=__commonJS({"node_modules/core-js/modules/es.array.push.js"(){"use strict";var e=require_export(),t=require_to_object(),r=require_length_of_array_like(),i=require_array_set_length(),n=require_does_not_exceed_safe_integer(),s=require_fails()((function(){return 4294967297!==[].push.call({length:4294967296},1)})),a=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}();e({target:"Array",proto:!0,arity:1,forced:s||a},{ // eslint-disable-next-line no-unused-vars -- required for `.length` push:function(e){var s=t(this),a=r(s),o=arguments.length;n(a+o);for(var l=0;l=0:p>d;d+=m)d in h&&(c=o(c,h[d],d,u));return c}};t.exports={ // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce left:o(!1), // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright right:o(!0)}}}),require_engine_is_node=__commonJS({"node_modules/core-js/internals/engine-is-node.js"(e,t){var r=require_classof_raw(),i=require_global();t.exports="process"==r(i.process)}}),require_es_array_reduce=__commonJS({"node_modules/core-js/modules/es.array.reduce.js"(){"use strict";var e=require_export(),t=require_array_reduce().left,r=require_array_method_is_strict(),i=require_engine_v8_version(),n=require_engine_is_node();e({target:"Array",proto:!0,forced:!r("reduce")||!n&&i>79&&i<83},{reduce:function(e){var r=arguments.length;return t(this,e,r,r>1?arguments[1]:void 0)}})}}),require_es_array_reduce_right=__commonJS({"node_modules/core-js/modules/es.array.reduce-right.js"(){"use strict";var e=require_export(),t=require_array_reduce().right,r=require_array_method_is_strict(),i=require_engine_v8_version(),n=require_engine_is_node();e({target:"Array",proto:!0,forced:!r("reduceRight")||!n&&i>79&&i<83},{reduceRight:function(e){return t(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})}}),require_es_array_reverse=__commonJS({"node_modules/core-js/modules/es.array.reverse.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_is_array(),i=t([].reverse),n=[1,2];e({target:"Array",proto:!0,forced:String(n)===String(n.reverse())},{reverse:function(){return r(this)&&(this.length=this.length),i(this)}})}}),require_es_array_slice=__commonJS({"node_modules/core-js/modules/es.array.slice.js"(){"use strict";var e=require_export(),t=require_is_array(),r=require_is_constructor(),i=require_is_object(),n=require_to_absolute_index(),s=require_length_of_array_like(),a=require_to_indexed_object(),o=require_create_property(),l=require_well_known_symbol(),c=require_array_method_has_species_support(),u=require_array_slice(),h=c("slice"),p=l("species"),d=Array,m=Math.max;e({target:"Array",proto:!0,forced:!h},{slice:function(e,l){var c,h,f,g=a(this),_=s(g),y=n(e,_),T=n(void 0===l?_:l,_);if(t(g)&&(c=g.constructor,(r(c)&&(c===d||t(c.prototype))||i(c)&&null===(c=c[p]))&&(c=void 0),c===d||void 0===c))return u(g,y,T);for(h=new(void 0===c?d:c)(m(T-y,0)),f=0;y1?arguments[1]:void 0)}})}}),require_array_sort=__commonJS({"node_modules/core-js/internals/array-sort.js"(e,t){var r=require_array_slice_simple(),i=Math.floor,n=function(e,t){var o=e.length,l=i(o/2);return o<8?s(e,t):a(e,n(r(e,0,l),t),n(r(e,l),t),t)},s=function(e,t){for(var r,i,n=e.length,s=1;s0;)e[i]=e[--i];i!==s++&&(e[i]=r)}return e},a=function(e,t,r,i){for(var n=t.length,s=r.length,a=0,o=0;a3)){if(h)return!0;if(d)return d<603;var e,t,r,i,n="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)m.push({k:t+i,v:r})}for(m.sort((function(e,t){return t.v-e.v})),i=0;ia(r)?1:-1}}(e)),o=n(u),c=0;cv-m+d;g--)c(T,g-1)}else if(d>m)for(g=v-m;g>E;g--)y=g+d-1,(_=g+m-1)in T?T[y]=T[_]:c(T,y);for(g=0;g>1,g=23===t?n(2,-24)-n(2,-77):0,_=e<0||0===e&&1/e<0?1:0,y=0;for((e=i(e))!=e||e===1/0?(u=e!=e?1:0,c=m):(c=s(a(e)/o),e*(h=n(2,-c))<1&&(c--,h*=2),(e+=c+f>=1?g/h:g*n(2,1-f))*h>=2&&(c++,h/=2),c+f>=m?(u=0,c=m):c+f>=1?(u=(e*h-1)*n(2,t),c+=f):(u=e*n(2,f-1)*n(2,t),c=0));t>=8;)p[y++]=255&u,u/=256,t-=8;for(c=c<0;)p[y++]=255&c,c/=256,d-=8;return p[--y]|=128*_,p},unpack:function(e,t){var r,i=e.length,s=8*i-t-1,a=(1<>1,l=s-7,c=i-1,u=e[c--],h=127&u;for(u>>=7;l>0;)h=256*h+e[c--],l-=8;for(r=h&(1<<-l)-1,h>>=-l,l+=t;l>0;)r=256*r+e[c--],l-=8;if(0===h)h=1-o;else{if(h===a)return r?NaN:u?-1/0:1/0;r+=n(2,t),h-=o}return(u?-1:1)*r*n(2,h-t)}}}}),require_array_buffer=__commonJS({"node_modules/core-js/internals/array-buffer.js"(e,t){"use strict";var r,i,n,s,a,o,l=require_global(),c=require_function_uncurry_this(),u=require_descriptors(),h=require_array_buffer_basic_detection(),p=require_function_name(),d=require_create_non_enumerable_property(),m=require_define_built_ins(),f=require_fails(),g=require_an_instance(),_=require_to_integer_or_infinity(),y=require_to_length(),T=require_to_index(),v=require_ieee754(),E=require_object_get_prototype_of(),I=require_object_set_prototype_of(),b=require_object_get_own_property_names().f,x=require_object_define_property().f,S=require_array_fill(),w=require_array_slice_simple(),C=require_set_to_string_tag(),M=require_internal_state(),R=p.PROPER,A=p.CONFIGURABLE,D=M.get,O=M.set,L="ArrayBuffer",P="DataView",N="prototype",F="Wrong index",U=l[L],B=U,k=B&&B[N],G=l[P],V=G&&G[N],H=Object.prototype,j=l.Array,z=l.RangeError,q=c(S),W=c([].reverse),Y=v.pack,X=v.unpack,J=function(e){return[255&e]},$=function(e){return[255&e,e>>8&255]},Z=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},K=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Q=function(e){return Y(e,23,4)},ee=function(e){return Y(e,52,8)},te=function(e,t){x(e[N],t,{get:function(){return D(this)[t]}})},re=function(e,t,r,i){var n=T(r),s=D(e);if(n+t>s.byteLength)throw z(F);var a=D(s.buffer).bytes,o=n+s.byteOffset,l=w(a,o,o+t);return i?l:W(l)},ie=function(e,t,r,i,n,s){var a=T(r),o=D(e);if(a+t>o.byteLength)throw z(F);for(var l=D(o.buffer).bytes,c=a+o.byteOffset,u=i(+n),h=0;hn;)(s=i[n++])in B||d(B,s,U[s]);k.constructor=B}I&&E(V)!==H&&I(V,H),a=new G(new B(2)),o=c(V.setInt8),a.setInt8(0,2147483648),a.setInt8(1,2147483649),!a.getInt8(0)&&a.getInt8(1)||m(V,{setInt8:function(e,t){o(this,e,t<<24>>24)},setUint8:function(e,t){o(this,e,t<<24>>24)}},{unsafe:!0})}else k=(B=function(e){g(this,k);var t=T(e);O(this,{bytes:q(j(t),0),byteLength:t}),u||(this.byteLength=t)})[N],V=(G=function(e,t,r){g(this,V),g(e,k);var i=D(e).byteLength,n=_(t);if(n<0||n>i)throw z("Wrong offset");if(n+(r=void 0===r?i-n:y(r))>i)throw z("Wrong length");O(this,{buffer:e,byteLength:r,byteOffset:n}),u||(this.buffer=e,this.byteLength=r,this.byteOffset=n)})[N],u&&(te(B,"byteLength"),te(G,"buffer"),te(G,"byteLength"),te(G,"byteOffset")),m(V,{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 K(re(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return K(re(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return X(re(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return X(re(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){ie(this,1,e,J,t)},setUint8:function(e,t){ie(this,1,e,J,t)},setInt16:function(e,t){ie(this,2,e,$,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){ie(this,2,e,$,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){ie(this,4,e,Z,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){ie(this,4,e,Z,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){ie(this,4,e,Q,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){ie(this,8,e,ee,t,arguments.length>2?arguments[2]:void 0)}});C(B,L),C(G,P),t.exports={ArrayBuffer:B,DataView:G}}}),require_es_array_buffer_constructor=__commonJS({"node_modules/core-js/modules/es.array-buffer.constructor.js"(){"use strict";var e=require_export(),t=require_global(),r=require_array_buffer(),i=require_set_species(),n="ArrayBuffer",s=r[n];e({global:!0,constructor:!0,forced:t[n]!==s},{ArrayBuffer:s}),i(n)}}),require_array_buffer_view_core=__commonJS({"node_modules/core-js/internals/array-buffer-view-core.js"(e,t){"use strict";var r,i,n,s=require_array_buffer_basic_detection(),a=require_descriptors(),o=require_global(),l=require_is_callable(),c=require_is_object(),u=require_has_own_property(),h=require_classof(),p=require_try_to_string(),d=require_create_non_enumerable_property(),m=require_define_built_in(),f=require_object_define_property().f,g=require_object_is_prototype_of(),_=require_object_get_prototype_of(),y=require_object_set_prototype_of(),T=require_well_known_symbol(),v=require_uid(),E=require_internal_state(),I=E.enforce,b=E.get,x=o.Int8Array,S=x&&x.prototype,w=o.Uint8ClampedArray,C=w&&w.prototype,M=x&&_(x),R=S&&_(S),A=Object.prototype,D=o.TypeError,O=T("toStringTag"),L=v("TYPED_ARRAY_TAG"),P="TypedArrayConstructor",N=s&&!!y&&"Opera"!==h(o.opera),F=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},k=function(e){var t=_(e);if(c(t)){var r=b(t);return r&&u(r,P)?r[P]:k(t)}},G=function(e){if(!c(e))return!1;var t=h(e);return u(U,t)||u(B,t)};for(r in U)(n=(i=o[r])&&i.prototype)?I(n)[P]=i:N=!1;for(r in B)(n=(i=o[r])&&i.prototype)&&(I(n)[P]=i);if((!N||!l(M)||M===Function.prototype)&&(M=function(){throw D("Incorrect invocation")},N))for(r in U)o[r]&&y(o[r],M);if((!N||!R||R===A)&&(R=M.prototype,N))for(r in U)o[r]&&y(o[r].prototype,R);if(N&&_(C)!==R&&y(C,R),a&&!u(R,O))for(r in F=!0,f(R,O,{get:function(){return c(this)?this[L]:void 0}}),U)o[r]&&d(o[r],L,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:F&&L,aTypedArray:function(e){if(G(e))return e;throw D("Target is not a typed array")},aTypedArrayConstructor:function(e){if(l(e)&&(!y||g(M,e)))return e;throw D(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,i){if(a){if(r)for(var n in U){var s=o[n];if(s&&u(s.prototype,e))try{delete s.prototype[e]}catch(r){try{s.prototype[e]=t}catch(e){}}}R[e]&&!r||m(R,e,r?t:N&&S[e]||t,i)}},exportTypedArrayStaticMethod:function(e,t,r){var i,n;if(a){if(y){if(r)for(i in U)if((n=o[i])&&u(n,e))try{delete n[e]}catch(e){}if(M[e]&&!r)return;try{return m(M,e,r?t:N&&M[e]||t)}catch(e){}}for(i in U)!(n=o[i])||n[e]&&!r||m(n,e,t)}},getTypedArrayConstructor:k,isView:function(e){if(!c(e))return!1;var t=h(e);return"DataView"===t||u(U,t)||u(B,t)},isTypedArray:G,TypedArray:M,TypedArrayPrototype:R}}}),require_es_array_buffer_is_view=__commonJS({"node_modules/core-js/modules/es.array-buffer.is-view.js"(){var e=require_export(),t=require_array_buffer_view_core();e({target:"ArrayBuffer",stat:!0,forced:!t.NATIVE_ARRAY_BUFFER_VIEWS},{isView:t.isView})}}),require_a_constructor=__commonJS({"node_modules/core-js/internals/a-constructor.js"(e,t){var r=require_is_constructor(),i=require_try_to_string(),n=TypeError;t.exports=function(e){if(r(e))return e;throw n(i(e)+" is not a constructor")}}}),require_species_constructor=__commonJS({"node_modules/core-js/internals/species-constructor.js"(e,t){var r=require_an_object(),i=require_a_constructor(),n=require_is_null_or_undefined(),s=require_well_known_symbol()("species");t.exports=function(e,t){var a,o=r(e).constructor;return void 0===o||n(a=r(o)[s])?t:i(a)}}}),require_es_array_buffer_slice=__commonJS({"node_modules/core-js/modules/es.array-buffer.slice.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this_clause(),r=require_fails(),i=require_array_buffer(),n=require_an_object(),s=require_to_absolute_index(),a=require_to_length(),o=require_species_constructor(),l=i.ArrayBuffer,c=i.DataView,u=c.prototype,h=t(l.prototype.slice),p=t(u.getUint8),d=t(u.setUint8);e({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:r((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(h&&void 0===t)return h(n(this),e);for(var r=n(this).byteLength,i=s(e,r),u=s(void 0===t?r:t,r),m=new(o(this,l))(a(u-i)),f=new c(this),g=new c(m),_=0;i0;(o>>>=1)&&(t+=t))1&o&&(a+=t);return a}}}),require_string_pad=__commonJS({"node_modules/core-js/internals/string-pad.js"(e,t){var r=require_function_uncurry_this(),i=require_to_length(),n=require_to_string(),s=require_string_repeat(),a=require_require_object_coercible(),o=r(s),l=r("".slice),c=Math.ceil,u=function(e){return function(t,r,s){var u,h,p=n(a(t)),d=i(r),m=p.length,f=void 0===s?" ":n(s);return d<=m||""==f?p:((h=o(f,c((u=d-m)/f.length))).length>u&&(h=l(h,0,u)),e?p+h:h+p)}};t.exports={ // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart start:u(!1), // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend end:u(!0)}}}),require_date_to_iso_string=__commonJS({"node_modules/core-js/internals/date-to-iso-string.js"(e,t){"use strict";var r=require_function_uncurry_this(),i=require_fails(),n=require_string_pad().start,s=RangeError,a=isFinite,o=Math.abs,l=Date.prototype,c=l.toISOString,u=r(l.getTime),h=r(l.getUTCDate),p=r(l.getUTCFullYear),d=r(l.getUTCHours),m=r(l.getUTCMilliseconds),f=r(l.getUTCMinutes),g=r(l.getUTCMonth),_=r(l.getUTCSeconds);t.exports=i((function(){return"0385-07-25T07:06:39.999Z"!=c.call(new Date(-50000000000001))}))||!i((function(){c.call(new Date(NaN))}))?function(){if(!a(u(this)))throw s("Invalid time value");var e=this,t=p(e),r=m(e),i=t<0?"-":t>9999?"+":"";return i+n(o(t),i?6:4,0)+"-"+n(g(e)+1,2,0)+"-"+n(h(e),2,0)+"T"+n(d(e),2,0)+":"+n(f(e),2,0)+":"+n(_(e),2,0)+"."+n(r,3,0)+"Z"}:c}}),require_es_date_to_iso_string=__commonJS({"node_modules/core-js/modules/es.date.to-iso-string.js"(){var e=require_export(),t=require_date_to_iso_string();e({target:"Date",proto:!0,forced:Date.prototype.toISOString!==t},{toISOString:t})}}),require_es_date_to_json=__commonJS({"node_modules/core-js/modules/es.date.to-json.js"(){"use strict";var e=require_export(),t=require_fails(),r=require_to_object(),i=require_to_primitive();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}})}))},{ // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON:function(e){var t=r(this),n=i(t,"number");return"number"!=typeof n||isFinite(n)?t.toISOString():null}})}}),require_date_to_primitive=__commonJS({"node_modules/core-js/internals/date-to-primitive.js"(e,t){"use strict";var r=require_an_object(),i=require_ordinary_to_primitive(),n=TypeError;t.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw n("Incorrect hint");return i(this,e)}}}),require_es_date_to_primitive=__commonJS({"node_modules/core-js/modules/es.date.to-primitive.js"(){var e=require_has_own_property(),t=require_define_built_in(),r=require_date_to_primitive(),i=require_well_known_symbol()("toPrimitive"),n=Date.prototype;e(n,i)||t(n,i,r)}}),require_es_date_to_string=__commonJS({"node_modules/core-js/modules/es.date.to-string.js"(){var e=require_function_uncurry_this(),t=require_define_built_in(),r=Date.prototype,i="Invalid Date",n="toString",s=e(r[n]),a=e(r.getTime);String(new Date(NaN))!=i&&t(r,n,(function(){var e=a(this);return e==e?s(this):i}))}}),require_es_escape=__commonJS({"node_modules/core-js/modules/es.escape.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_to_string(),i=t("".charAt),n=t("".charCodeAt),s=t(/./.exec),a=t(1..toString),o=t("".toUpperCase),l=/[\w*+\-./@]/,c=function(e,t){for(var r=a(e,16);r.length1?arguments[1]:void 0);t=t?t.next:r.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous}, // `{ Map, Set}.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.has // https://tc39.es/ecma262/#sec-set.prototype.has has:function(e){return!!T(this,e)}}),n(m,c?{ // `Map.prototype.get(key)` method // https://tc39.es/ecma262/#sec-map.prototype.get get:function(e){var t=T(this,e);return t&&t.value}, // `Map.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-map.prototype.set set:function(e,t){return y(this,0===e?0:e,t)}}:{ // `Set.prototype.add(value)` method // https://tc39.es/ecma262/#sec-set.prototype.add add:function(e){return y(this,e=0===e?0:e,e)}}),p&&r(m,"size",{get:function(){return _(this).size}}),h},setStrong:function(e,t,r){var i=t+" Iterator",n=g(t),s=g(i);c(e,t,(function(e,t){f(this,{type:i,target:e,state:n(e),kind:t,last:void 0})}),(function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?u("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1):(e.target=void 0,u(void 0,!0))}),r?"entries":"values",!r,!0),h(t)}}}}),require_es_map_constructor=__commonJS({"node_modules/core-js/modules/es.map.constructor.js"(){"use strict";require_collection()("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),require_collection_strong())}}),require_es_map=__commonJS({"node_modules/core-js/modules/es.map.js"(){require_es_map_constructor()}}),require_math_log1p=__commonJS({"node_modules/core-js/internals/math-log1p.js"(e,t){var r=Math.log;t.exports=Math.log1p||function(e){var t=+e;return t>-1e-8&&t<1e-8?t-t*t/2:r(1+t)}}}),require_es_math_acosh=__commonJS({"node_modules/core-js/modules/es.math.acosh.js"(){var e=require_export(),t=require_math_log1p(),r=Math.acosh,i=Math.log,n=Math.sqrt,s=Math.LN2;e({target:"Math",stat:!0,forced:!r||710!=Math.floor(r(Number.MAX_VALUE))||r(1/0)!=1/0},{acosh:function(e){var r=+e;return r<1?NaN:r>94906265.62425156?i(r)+s:t(r-1+n(r-1)*n(r+1))}})}}),require_es_math_asinh=__commonJS({"node_modules/core-js/modules/es.math.asinh.js"(){var e=require_export(),t=Math.asinh,r=Math.log,i=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):r(n+i(n*n+1)):n}})}}),require_es_math_atanh=__commonJS({"node_modules/core-js/modules/es.math.atanh.js"(){var e=require_export(),t=Math.atanh,r=Math.log;e({target:"Math",stat:!0,forced:!(t&&1/t(-0)<0)},{atanh:function(e){var t=+e;return 0==t?t:r((1+t)/(1-t))/2}})}}),require_math_sign=__commonJS({"node_modules/core-js/internals/math-sign.js"(e,t){t.exports=Math.sign||function(e){var t=+e;return 0==t||t!=t?t:t<0?-1:1}}}),require_es_math_cbrt=__commonJS({"node_modules/core-js/modules/es.math.cbrt.js"(){var e=require_export(),t=require_math_sign(),r=Math.abs,i=Math.pow;e({target:"Math",stat:!0},{cbrt:function(e){var n=+e;return t(n)*i(r(n),1/3)}})}}),require_es_math_clz32=__commonJS({"node_modules/core-js/modules/es.math.clz32.js"(){var e=require_export(),t=Math.floor,r=Math.log,i=Math.LOG2E;e({target:"Math",stat:!0},{clz32:function(e){var n=e>>>0;return n?31-t(r(n+.5)*i):32}})}}),require_math_expm1=__commonJS({"node_modules/core-js/internals/math-expm1.js"(e,t){var r=Math.expm1,i=Math.exp;t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(e){var t=+e;return 0==t?t:t>-1e-6&&t<1e-6?t+t*t/2:i(t)-1}:r}}),require_es_math_cosh=__commonJS({"node_modules/core-js/modules/es.math.cosh.js"(){var e=require_export(),t=require_math_expm1(),r=Math.cosh,i=Math.abs,n=Math.E;e({target:"Math",stat:!0,forced:!r||r(710)===1/0},{cosh:function(e){var r=t(i(e)-1)+1;return(r+1/(r*n*n))*(n/2)}})}}),require_es_math_expm1=__commonJS({"node_modules/core-js/modules/es.math.expm1.js"(){var e=require_export(),t=require_math_expm1();e({target:"Math",stat:!0,forced:t!=Math.expm1},{expm1:t})}}),require_math_fround=__commonJS({"node_modules/core-js/internals/math-fround.js"(e,t){var r=require_math_sign(),i=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,c=+e,u=i(c),h=r(c);return uo||n!=n?h*(1/0):h*n}}}),require_es_math_fround=__commonJS({"node_modules/core-js/modules/es.math.fround.js"(){require_export()({target:"Math",stat:!0},{fround:require_math_fround()})}}),require_es_math_hypot=__commonJS({"node_modules/core-js/modules/es.math.hypot.js"(){var e=require_export(),t=Math.hypot,r=Math.abs,i=Math.sqrt;e({target:"Math",stat:!0,arity:2,forced:!!t&&t(1/0,NaN)!==1/0},{ // eslint-disable-next-line no-unused-vars -- required for `.length` hypot:function(e,t){for(var n,s,a=0,o=0,l=arguments.length,c=0;o0?(s=n/c)*s:n;return c===1/0?1/0:c*i(a)}})}}),require_es_math_imul=__commonJS({"node_modules/core-js/modules/es.math.imul.js"(){var e=require_export(),t=require_fails(),r=Math.imul;e({target:"Math",stat:!0,forced:t((function(){return-5!=r(4294967295,5)||2!=r.length}))},{imul:function(e,t){var r=65535,i=+e,n=+t,s=r&i,a=r&n;return 0|s*a+((r&i>>>16)*a+s*(r&n>>>16)<<16>>>0)}})}}),require_math_log10=__commonJS({"node_modules/core-js/internals/math-log10.js"(e,t){var r=Math.log,i=Math.LOG10E;t.exports=Math.log10||function(e){return r(e)*i}}}),require_es_math_log10=__commonJS({"node_modules/core-js/modules/es.math.log10.js"(){require_export()({target:"Math",stat:!0},{log10:require_math_log10()})}}),require_es_math_log1p=__commonJS({"node_modules/core-js/modules/es.math.log1p.js"(){require_export()({target:"Math",stat:!0},{log1p:require_math_log1p()})}}),require_es_math_log2=__commonJS({"node_modules/core-js/modules/es.math.log2.js"(){var e=require_export(),t=Math.log,r=Math.LN2;e({target:"Math",stat:!0},{log2:function(e){return t(e)/r}})}}),require_es_math_sign=__commonJS({"node_modules/core-js/modules/es.math.sign.js"(){require_export()({target:"Math",stat:!0},{sign:require_math_sign()})}}),require_es_math_sinh=__commonJS({"node_modules/core-js/modules/es.math.sinh.js"(){var e=require_export(),t=require_fails(),r=require_math_expm1(),i=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 i(t)<1?(r(t)-r(-t))/2:(n(t-1)-n(-t-1))*(s/2)}})}}),require_es_math_tanh=__commonJS({"node_modules/core-js/modules/es.math.tanh.js"(){var e=require_export(),t=require_math_expm1(),r=Math.exp;e({target:"Math",stat:!0},{tanh:function(e){var i=+e,n=t(i),s=t(-i);return n==1/0?1:s==1/0?-1:(n-s)/(r(i)+r(-i))}})}}),require_es_math_to_string_tag=__commonJS({"node_modules/core-js/modules/es.math.to-string-tag.js"(){require_set_to_string_tag()(Math,"Math",!0)}}),require_es_math_trunc=__commonJS({"node_modules/core-js/modules/es.math.trunc.js"(){require_export()({target:"Math",stat:!0},{trunc:require_math_trunc()})}}),require_this_number_value=__commonJS({"node_modules/core-js/internals/this-number-value.js"(e,t){var r=require_function_uncurry_this();t.exports=r(1..valueOf)}}),require_whitespaces=__commonJS({"node_modules/core-js/internals/whitespaces.js"(e,t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"}}),require_string_trim=__commonJS({"node_modules/core-js/internals/string-trim.js"(e,t){var r=require_function_uncurry_this(),i=require_require_object_coercible(),n=require_to_string(),s=require_whitespaces(),a=r("".replace),o="["+s+"]",l=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),u=function(e){return function(t){var r=n(i(t));return 1&e&&(r=a(r,l,"")),2&e&&(r=a(r,c,"")),r}};t.exports={ // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart start:u(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimend end:u(2), // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim trim:u(3)}}}),require_es_number_constructor=__commonJS({"node_modules/core-js/modules/es.number.constructor.js"(){"use strict";var e=require_export(),t=require_is_pure(),r=require_descriptors(),i=require_global(),n=require_path(),s=require_function_uncurry_this(),a=require_is_forced(),o=require_has_own_property(),l=require_inherit_if_required(),c=require_object_is_prototype_of(),u=require_is_symbol(),h=require_to_primitive(),p=require_fails(),d=require_object_get_own_property_names().f,m=require_object_get_own_property_descriptor().f,f=require_object_define_property().f,g=require_this_number_value(),_=require_string_trim().trim,y="Number",T=i[y],v=n[y],E=T.prototype,I=i.TypeError,b=s("".slice),x=s("".charCodeAt),S=function(e){var t=h(e,"number");return"bigint"==typeof t?t:w(t)},w=function(e){var t,r,i,n,s,a,o,l,c=h(e,"number");if(u(c))throw I("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=_(c),43===(t=x(c,0))||45===t){if(88===(r=x(c,2))||120===r)return NaN}else if(48===t){switch(x(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(a=(s=b(c,2)).length,o=0;on)return NaN;return parseInt(s,i)}return+c},C=a(y,!T(" 0o1")||!T("0b1")||T("+0x1")),M=function(e){return c(E,e)&&p((function(){g(e)}))},R=function(e){var t=arguments.length<1?0:T(S(e));return M(this)?l(Object(t),this,R):t};R.prototype=E,C&&!t&&(E.constructor=R),e({global:!0,constructor:!0,wrap:!0,forced:C},{Number:R});var A=function(e,t){for(var i,n=r?d(t): // ES3: "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,i=n[s])&&!o(e,i)&&f(e,i,m(t,i))};t&&v&&A(n[y],v),(C||t)&&A(n[y],T)}}),require_es_number_epsilon=__commonJS({"node_modules/core-js/modules/es.number.epsilon.js"(){require_export()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})}}),require_number_is_finite=__commonJS({"node_modules/core-js/internals/number-is-finite.js"(e,t){var r=require_global().isFinite;t.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}}}),require_es_number_is_finite=__commonJS({"node_modules/core-js/modules/es.number.is-finite.js"(){require_export()({target:"Number",stat:!0},{isFinite:require_number_is_finite()})}}),require_is_integral_number=__commonJS({"node_modules/core-js/internals/is-integral-number.js"(e,t){var r=require_is_object(),i=Math.floor;t.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&i(e)===e}}}),require_es_number_is_integer=__commonJS({"node_modules/core-js/modules/es.number.is-integer.js"(){require_export()({target:"Number",stat:!0},{isInteger:require_is_integral_number()})}}),require_es_number_is_nan=__commonJS({"node_modules/core-js/modules/es.number.is-nan.js"(){require_export()({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})}}),require_es_number_is_safe_integer=__commonJS({"node_modules/core-js/modules/es.number.is-safe-integer.js"(){var e=require_export(),t=require_is_integral_number(),r=Math.abs;e({target:"Number",stat:!0},{isSafeInteger:function(e){return t(e)&&r(e)<=9007199254740991}})}}),require_es_number_max_safe_integer=__commonJS({"node_modules/core-js/modules/es.number.max-safe-integer.js"(){require_export()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})}}),require_es_number_min_safe_integer=__commonJS({"node_modules/core-js/modules/es.number.min-safe-integer.js"(){require_export()({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})}}),require_number_parse_float=__commonJS({"node_modules/core-js/internals/number-parse-float.js"(e,t){var r=require_global(),i=require_fails(),n=require_function_uncurry_this(),s=require_to_string(),a=require_string_trim().trim,o=require_whitespaces(),l=n("".charAt),c=r.parseFloat,u=r.Symbol,h=u&&u.iterator,p=1/c(o+"-0")!=-1/0||h&&!i((function(){c(Object(h))}));t.exports=p?function(e){var t=a(s(e)),r=c(t);return 0===r&&"-"==l(t,0)?-0:r}:c}}),require_es_number_parse_float=__commonJS({"node_modules/core-js/modules/es.number.parse-float.js"(){var e=require_export(),t=require_number_parse_float();e({target:"Number",stat:!0,forced:Number.parseFloat!=t},{parseFloat:t})}}),require_number_parse_int=__commonJS({"node_modules/core-js/internals/number-parse-int.js"(e,t){var r=require_global(),i=require_fails(),n=require_function_uncurry_this(),s=require_to_string(),a=require_string_trim().trim,o=require_whitespaces(),l=r.parseInt,c=r.Symbol,u=c&&c.iterator,h=/^[+-]?0x/i,p=n(h.exec),d=8!==l(o+"08")||22!==l(o+"0x16")||u&&!i((function(){l(Object(u))}));t.exports=d?function(e,t){var r=a(s(e));return l(r,t>>>0||(p(h,r)?16:10))}:l}}),require_es_number_parse_int=__commonJS({"node_modules/core-js/modules/es.number.parse-int.js"(){var e=require_export(),t=require_number_parse_int();e({target:"Number",stat:!0,forced:Number.parseInt!=t},{parseInt:t})}}),require_es_number_to_exponential=__commonJS({"node_modules/core-js/modules/es.number.to-exponential.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_to_integer_or_infinity(),i=require_this_number_value(),n=require_string_repeat(),s=require_math_log10(),a=require_fails(),o=RangeError,l=String,c=isFinite,u=Math.abs,h=Math.floor,p=Math.pow,d=Math.round,m=t(1..toExponential),f=t(n),g=t("".slice),_="-6.9000e-11"===m(-69e-12,4)&&"1.25e+0"===m(1.255,2)&&"1.235e+4"===m(12345,3)&&"3e+1"===m(25,0),y=a((function(){m(1,1/0)}))&&a((function(){m(1,-1/0)})),T=!a((function(){m(1/0,1/0)}))&&!a((function(){m(NaN,1/0)}));e({target:"Number",proto:!0,forced:!_||!y||!T},{toExponential:function(e){var t=i(this);if(void 0===e)return m(t);var n=r(e);if(!c(t))return String(t);if(n<0||n>20)throw o("Incorrect fraction digits");if(_)return m(t,n);var a="",y="",T=0,v="",E="";if(t<0&&(a="-",t=-t),0===t)T=0,y=f("0",n+1);else{var I=s(t);T=h(I);var b=0,x=p(10,T-n);2*t>=(2*(b=d(t/x))+1)*x&&(b+=1),b>=p(10,n+1)&&(b/=10,T+=1),y=l(b)}return 0!==n&&(y=g(y,0,1)+"."+g(y,1)),0===T?(v="+",E="0"):(v=T>0?"+":"-",E=l(u(T))),a+(y+="e"+v+E)}})}}),require_es_number_to_fixed=__commonJS({"node_modules/core-js/modules/es.number.to-fixed.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_to_integer_or_infinity(),i=require_this_number_value(),n=require_string_repeat(),s=require_fails(),a=RangeError,o=String,l=Math.floor,c=t(n),u=t("".slice),h=t(1..toFixed),p=function(e,t,r){return 0===t?r:t%2==1?p(e,t-1,r*e):p(e*e,t/2,r)},d=function(e,t,r){for(var i=-1,n=r;++i<6;)n+=t*e[i],e[i]=n%1e7,n=l(n/1e7)},m=function(e,t){for(var r=6,i=0;--r>=0;)i+=e[r],e[r]=l(i/t),i=i%t*1e7},f=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var i=o(e[t]);r=""===r?i:r+c("0",7-i.length)+i}return r};e({target:"Number",proto:!0,forced:s((function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)}))||!s((function(){h({})}))},{toFixed:function(e){var t,n,s,l,h=i(this),g=r(e),_=[0,0,0,0,0,0],y="",T="0";if(g<0||g>20)throw a("Incorrect fraction digits");if(h!=h)return"NaN";if(h<=-1e21||h>=1e21)return o(h);if(h<0&&(y="-",h=-h),h>1e-21)if(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(h*p(2,69,1))-69,n=t<0?h*p(2,-t,1):h/p(2,t,1),n*=4503599627370496,(t=52-t)>0){for(d(_,0,n),s=g;s>=7;)d(_,1e7,0),s-=7;for(d(_,p(10,s,1),0),s=t-1;s>=23;)m(_,1<<23),s-=23;m(_,1<0?y+((l=T.length)<=g?"0."+c("0",g-l)+T:u(T,0,l-g)+"."+u(T,l-g)):y+T}})}}),require_es_number_to_precision=__commonJS({"node_modules/core-js/modules/es.number.to-precision.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_fails(),i=require_this_number_value(),n=t(1..toPrecision);e({target:"Number",proto:!0,forced:r((function(){return"1"!==n(1,void 0)}))||!r((function(){n({})}))},{toPrecision:function(e){return void 0===e?n(i(this)):n(i(this),e)}})}}),require_object_assign=__commonJS({"node_modules/core-js/internals/object-assign.js"(e,t){"use strict";var r=require_descriptors(),i=require_function_uncurry_this(),n=require_function_call(),s=require_fails(),a=require_object_keys(),o=require_object_get_own_property_symbols(),l=require_object_property_is_enumerable(),c=require_to_object(),u=require_indexed_object(),h=Object.assign,p=Object.defineProperty,d=i([].concat);t.exports=!h||s((function(){if(r&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=h({},e)[i]||a(h({},t)).join("")!=n}))?function(e,t){for(var i=c(e),s=arguments.length,h=1,p=o.f,m=l.f;s>h;)for(var f,g=u(arguments[h++]),_=p?d(a(g),p(g)):a(g),y=_.length,T=0;y>T;)f=_[T++],r&&!n(m,g,f)||(i[f]=g[f]);return i}:h}}),require_es_object_assign=__commonJS({"node_modules/core-js/modules/es.object.assign.js"(){var e=require_export(),t=require_object_assign();e({target:"Object",stat:!0,arity:2,forced:Object.assign!==t},{assign:t})}}),require_es_object_create=__commonJS({"node_modules/core-js/modules/es.object.create.js"(){require_export()({target:"Object",stat:!0,sham:!require_descriptors()},{create:require_object_create()})}}),require_object_prototype_accessors_forced=__commonJS({"node_modules/core-js/internals/object-prototype-accessors-forced.js"(e,t){"use strict";var r=require_is_pure(),i=require_global(),n=require_fails(),s=require_engine_webkit_version();t.exports=r||!n((function(){if(!(s&&s<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete i[e]}}))}}),require_es_object_define_getter=__commonJS({"node_modules/core-js/modules/es.object.define-getter.js"(){"use strict";var e=require_export(),t=require_descriptors(),r=require_object_prototype_accessors_forced(),i=require_a_callable(),n=require_to_object(),s=require_object_define_property();t&&e({target:"Object",proto:!0,forced:r},{__defineGetter__:function(e,t){s.f(n(this),e,{get:i(t),enumerable:!0,configurable:!0})}})}}),require_es_object_define_properties=__commonJS({"node_modules/core-js/modules/es.object.define-properties.js"(){var e=require_export(),t=require_descriptors(),r=require_object_define_properties().f;e({target:"Object",stat:!0,forced:Object.defineProperties!==r,sham:!t},{defineProperties:r})}}),require_es_object_define_property=__commonJS({"node_modules/core-js/modules/es.object.define-property.js"(){var e=require_export(),t=require_descriptors(),r=require_object_define_property().f;e({target:"Object",stat:!0,forced:Object.defineProperty!==r,sham:!t},{defineProperty:r})}}),require_es_object_define_setter=__commonJS({"node_modules/core-js/modules/es.object.define-setter.js"(){"use strict";var e=require_export(),t=require_descriptors(),r=require_object_prototype_accessors_forced(),i=require_a_callable(),n=require_to_object(),s=require_object_define_property();t&&e({target:"Object",proto:!0,forced:r},{__defineSetter__:function(e,t){s.f(n(this),e,{set:i(t),enumerable:!0,configurable:!0})}})}}),require_object_to_array=__commonJS({"node_modules/core-js/internals/object-to-array.js"(e,t){var r=require_descriptors(),i=require_function_uncurry_this(),n=require_object_keys(),s=require_to_indexed_object(),a=i(require_object_property_is_enumerable().f),o=i([].push),l=function(e){return function(t){for(var i,l=s(t),c=n(l),u=c.length,h=0,p=[];u>h;)i=c[h++],r&&!a(l,i)||o(p,e?[i,l[i]]:l[i]);return p}};t.exports={ // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries entries:l(!0), // `Object.values` method // https://tc39.es/ecma262/#sec-object.values values:l(!1)}}}),require_es_object_entries=__commonJS({"node_modules/core-js/modules/es.object.entries.js"(){var e=require_export(),t=require_object_to_array().entries;e({target:"Object",stat:!0},{entries:function(e){return t(e)}})}}),require_es_object_freeze=__commonJS({"node_modules/core-js/modules/es.object.freeze.js"(){var e=require_export(),t=require_freezing(),r=require_fails(),i=require_is_object(),n=require_internal_metadata().onFreeze,s=Object.freeze;e({target:"Object",stat:!0,forced:r((function(){s(1)})),sham:!t},{freeze:function(e){return s&&i(e)?s(n(e)):e}})}}),require_es_object_from_entries=__commonJS({"node_modules/core-js/modules/es.object.from-entries.js"(){var e=require_export(),t=require_iterate(),r=require_create_property();e({target:"Object",stat:!0},{fromEntries:function(e){var i={};return t(e,(function(e,t){r(i,e,t)}),{AS_ENTRIES:!0}),i}})}}),require_es_object_get_own_property_descriptor=__commonJS({"node_modules/core-js/modules/es.object.get-own-property-descriptor.js"(){var e=require_export(),t=require_fails(),r=require_to_indexed_object(),i=require_object_get_own_property_descriptor().f,n=require_descriptors(),s=t((function(){i(1)}));e({target:"Object",stat:!0,forced:!n||s,sham:!n},{getOwnPropertyDescriptor:function(e,t){return i(r(e),t)}})}}),require_es_object_get_own_property_descriptors=__commonJS({"node_modules/core-js/modules/es.object.get-own-property-descriptors.js"(){var e=require_export(),t=require_descriptors(),r=require_own_keys(),i=require_to_indexed_object(),n=require_object_get_own_property_descriptor(),s=require_create_property();e({target:"Object",stat:!0,sham:!t},{getOwnPropertyDescriptors:function(e){for(var t,a,o=i(e),l=n.f,c=r(o),u={},h=0;c.length>h;)void 0!==(a=l(o,t=c[h++]))&&s(u,t,a);return u}})}}),require_es_object_get_own_property_names=__commonJS({"node_modules/core-js/modules/es.object.get-own-property-names.js"(){var e=require_export(),t=require_fails(),r=require_object_get_own_property_names_external().f;e({target:"Object",stat:!0,forced:t((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:r})}}),require_es_object_get_prototype_of=__commonJS({"node_modules/core-js/modules/es.object.get-prototype-of.js"(){var e=require_export(),t=require_fails(),r=require_to_object(),i=require_object_get_prototype_of(),n=require_correct_prototype_getter();e({target:"Object",stat:!0,forced:t((function(){i(1)})),sham:!n},{getPrototypeOf:function(e){return i(r(e))}})}}),require_es_object_has_own=__commonJS({"node_modules/core-js/modules/es.object.has-own.js"(){require_export()({target:"Object",stat:!0},{hasOwn:require_has_own_property()})}}),require_same_value=__commonJS({"node_modules/core-js/internals/same-value.js"(e,t){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}}}),require_es_object_is=__commonJS({"node_modules/core-js/modules/es.object.is.js"(){require_export()({target:"Object",stat:!0},{is:require_same_value()})}}),require_es_object_is_extensible=__commonJS({"node_modules/core-js/modules/es.object.is-extensible.js"(){var e=require_export(),t=require_object_is_extensible();e({target:"Object",stat:!0,forced:Object.isExtensible!==t},{isExtensible:t})}}),require_es_object_is_frozen=__commonJS({"node_modules/core-js/modules/es.object.is-frozen.js"(){var e=require_export(),t=require_fails(),r=require_is_object(),i=require_classof_raw(),n=require_array_buffer_non_extensible(),s=Object.isFrozen;e({target:"Object",stat:!0,forced:t((function(){s(1)}))||n},{isFrozen:function(e){return!r(e)||(!(!n||"ArrayBuffer"!=i(e))||!!s&&s(e))}})}}),require_es_object_is_sealed=__commonJS({"node_modules/core-js/modules/es.object.is-sealed.js"(){var e=require_export(),t=require_fails(),r=require_is_object(),i=require_classof_raw(),n=require_array_buffer_non_extensible(),s=Object.isSealed;e({target:"Object",stat:!0,forced:t((function(){s(1)}))||n},{isSealed:function(e){return!r(e)||(!(!n||"ArrayBuffer"!=i(e))||!!s&&s(e))}})}}),require_es_object_keys=__commonJS({"node_modules/core-js/modules/es.object.keys.js"(){var e=require_export(),t=require_to_object(),r=require_object_keys();e({target:"Object",stat:!0,forced:require_fails()((function(){r(1)}))},{keys:function(e){return r(t(e))}})}}),require_es_object_lookup_getter=__commonJS({"node_modules/core-js/modules/es.object.lookup-getter.js"(){"use strict";var e=require_export(),t=require_descriptors(),r=require_object_prototype_accessors_forced(),i=require_to_object(),n=require_to_property_key(),s=require_object_get_prototype_of(),a=require_object_get_own_property_descriptor().f;t&&e({target:"Object",proto:!0,forced:r},{__lookupGetter__:function(e){var t,r=i(this),o=n(e);do{if(t=a(r,o))return t.get}while(r=s(r))}})}}),require_es_object_lookup_setter=__commonJS({"node_modules/core-js/modules/es.object.lookup-setter.js"(){"use strict";var e=require_export(),t=require_descriptors(),r=require_object_prototype_accessors_forced(),i=require_to_object(),n=require_to_property_key(),s=require_object_get_prototype_of(),a=require_object_get_own_property_descriptor().f;t&&e({target:"Object",proto:!0,forced:r},{__lookupSetter__:function(e){var t,r=i(this),o=n(e);do{if(t=a(r,o))return t.set}while(r=s(r))}})}}),require_es_object_prevent_extensions=__commonJS({"node_modules/core-js/modules/es.object.prevent-extensions.js"(){var e=require_export(),t=require_is_object(),r=require_internal_metadata().onFreeze,i=require_freezing(),n=require_fails(),s=Object.preventExtensions;e({target:"Object",stat:!0,forced:n((function(){s(1)})),sham:!i},{preventExtensions:function(e){return s&&t(e)?s(r(e)):e}})}}),require_define_built_in_accessor=__commonJS({"node_modules/core-js/internals/define-built-in-accessor.js"(e,t){var r=require_make_built_in(),i=require_object_define_property();t.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}}}),require_es_object_proto=__commonJS({"node_modules/core-js/modules/es.object.proto.js"(){"use strict";var e=require_descriptors(),t=require_define_built_in_accessor(),r=require_is_object(),i=require_to_object(),n=require_require_object_coercible(),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(i(this))},set:function(e){var t=n(this);(r(e)||null===e)&&r(t)&&a(t,e)}})}catch(e){}}}),require_es_object_seal=__commonJS({"node_modules/core-js/modules/es.object.seal.js"(){var e=require_export(),t=require_is_object(),r=require_internal_metadata().onFreeze,i=require_freezing(),n=require_fails(),s=Object.seal;e({target:"Object",stat:!0,forced:n((function(){s(1)})),sham:!i},{seal:function(e){return s&&t(e)?s(r(e)):e}})}}),require_es_object_set_prototype_of=__commonJS({"node_modules/core-js/modules/es.object.set-prototype-of.js"(){require_export()({target:"Object",stat:!0},{setPrototypeOf:require_object_set_prototype_of()})}}),require_object_to_string=__commonJS({"node_modules/core-js/internals/object-to-string.js"(e,t){"use strict";var r=require_to_string_tag_support(),i=require_classof();t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}}}),require_es_object_to_string=__commonJS({"node_modules/core-js/modules/es.object.to-string.js"(){var e=require_to_string_tag_support(),t=require_define_built_in(),r=require_object_to_string();e||t(Object.prototype,"toString",r,{unsafe:!0})}}),require_es_object_values=__commonJS({"node_modules/core-js/modules/es.object.values.js"(){var e=require_export(),t=require_object_to_array().values;e({target:"Object",stat:!0},{values:function(e){return t(e)}})}}),require_es_parse_float=__commonJS({"node_modules/core-js/modules/es.parse-float.js"(){var e=require_export(),t=require_number_parse_float();e({global:!0,forced:parseFloat!=t},{parseFloat:t})}}),require_es_parse_int=__commonJS({"node_modules/core-js/modules/es.parse-int.js"(){var e=require_export(),t=require_number_parse_int();e({global:!0,forced:parseInt!=t},{parseInt:t})}}),require_validate_arguments_length=__commonJS({"node_modules/core-js/internals/validate-arguments-length.js"(e,t){var r=TypeError;t.exports=function(e,t){if(eb)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))}}),require_es_regexp_constructor=__commonJS({"node_modules/core-js/modules/es.regexp.constructor.js"(){var e,t,r,i=require_descriptors(),n=require_global(),s=require_function_uncurry_this(),a=require_is_forced(),o=require_inherit_if_required(),l=require_create_non_enumerable_property(),c=require_object_get_own_property_names().f,u=require_object_is_prototype_of(),h=require_is_regexp(),p=require_to_string(),d=require_regexp_get_flags(),m=require_regexp_sticky_helpers(),f=require_proxy_accessor(),g=require_define_built_in(),_=require_fails(),y=require_has_own_property(),T=require_internal_state().enforce,v=require_set_species(),E=require_well_known_symbol(),I=require_regexp_unsupported_dot_all(),b=require_regexp_unsupported_ncg(),x=E("match"),S=n.RegExp,w=S.prototype,C=n.SyntaxError,M=s(w.exec),R=s("".charAt),A=s("".replace),D=s("".indexOf),O=s("".slice),L=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,P=/a/g,N=/a/g,F=new S(P)!==P,U=m.MISSED_STICKY,B=m.UNSUPPORTED_Y,k=i&&(!F||U||I||b||_((function(){return N[x]=!1,S(P)!=P||S(N)==N||"/a/i"!=S(P,"i")})));if(a("RegExp",k)){for(e=function(t,r){var i,n,s,a,c,m,f=u(w,this),g=h(t),_=void 0===r,v=[],E=t;if(!f&&g&&_&&t.constructor===e)return t;if((g||u(w,t))&&(t=t.source,_&&(r=d(E))),t=void 0===t?"":p(t),r=void 0===r?"":p(r),E=t,I&&"dotAll"in P&&(n=!!r&&D(r,"s")>-1)&&(r=A(r,/s/g,"")),i=r,U&&"sticky"in P&&(s=!!r&&D(r,"y")>-1)&&B&&(r=A(r,/y/g,"")),b&&(a=function(e){for(var t,r=e.length,i=0,n="",s=[],a={},o=!1,l=!1,c=0,u="";i<=r;i++){if("\\"===(t=R(e,i)))t+=R(e,++i);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:M(L,O(e,i+1))&&(i+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||y(a,u))throw new C("Invalid capture group name");a[u]=!0,s[s.length]=[u,c],l=!1,u="";continue}l?u+=t:n+=t}return[n,s]}(t),t=a[0],v=a[1]),c=o(S(t,r),f?this:w,e),(n||s||v.length)&&(m=T(c),n&&(m.dotAll=!0,m.raw=e(function(e){for(var t,r=e.length,i=0,n="",s=!1;i<=r;i++)"\\"!==(t=R(e,i))?s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),n+=t):n+="[\\s\\S]":n+=t+R(e,++i);return n}(t),i)),s&&(m.sticky=!0),v.length&&(m.groups=v)),t!==E)try{l(c,"source",""===E?"(?:)":E)}catch(e){}return c},t=c(S),r=0;t.length>r;)f(e,S,t[r++]);w.constructor=e,e.prototype=w,g(n,"RegExp",e,{constructor:!0})}v("RegExp")}}),require_es_regexp_dot_all=__commonJS({"node_modules/core-js/modules/es.regexp.dot-all.js"(){var e=require_descriptors(),t=require_regexp_unsupported_dot_all(),r=require_classof_raw(),i=require_define_built_in_accessor(),n=require_internal_state().get,s=RegExp.prototype,a=TypeError;e&&t&&i(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if("RegExp"===r(this))return!!n(this).dotAll;throw a("Incompatible receiver, RegExp required")}}})}}),require_regexp_exec=__commonJS({"node_modules/core-js/internals/regexp-exec.js"(e,t){"use strict";var r,i,n=require_function_call(),s=require_function_uncurry_this(),a=require_to_string(),o=require_regexp_flags(),l=require_regexp_sticky_helpers(),c=require_shared(),u=require_object_create(),h=require_internal_state().get,p=require_regexp_unsupported_dot_all(),d=require_regexp_unsupported_ncg(),m=c("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,g=f,_=s("".charAt),y=s("".indexOf),T=s("".replace),v=s("".slice),E=(i=/b*/g,n(f,r=/a/,"a"),n(f,i,"a"),0!==r.lastIndex||0!==i.lastIndex),I=l.BROKEN_CARET,b=void 0!==/()??/.exec("")[1];(E||b||I||p||d)&&(g=function(e){var t,r,i,s,l,c,p,d=this,x=h(d),S=a(e),w=x.raw;if(w)return w.lastIndex=d.lastIndex,t=n(g,w,S),d.lastIndex=w.lastIndex,t;var C=x.groups,M=I&&d.sticky,R=n(o,d),A=d.source,D=0,O=S;if(M&&(R=T(R,"y",""),-1===y(R,"g")&&(R+="g"),O=v(S,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==_(S,d.lastIndex-1))&&(A="(?: "+A+")",O=" "+O,D++),r=new RegExp("^(?:"+A+")",R)),b&&(r=new RegExp("^"+A+"$(?!\\s)",R)),E&&(i=d.lastIndex),s=n(f,M?r:d,O),M?s?(s.input=v(s.input,D),s[0]=v(s[0],D),s.index=d.lastIndex,d.lastIndex+=s[0].length):d.lastIndex=0:E&&s&&(d.lastIndex=d.global?s.index+s[0].length:i),b&&s&&s.length>1&&n(m,s[0],r,(function(){for(l=1;l=0?o:s+o;return l<0||l>=s?void 0:a(t,l)}})}}),require_string_multibyte=__commonJS({"node_modules/core-js/internals/string-multibyte.js"(e,t){var r=require_function_uncurry_this(),i=require_to_integer_or_infinity(),n=require_to_string(),s=require_require_object_coercible(),a=r("".charAt),o=r("".charCodeAt),l=r("".slice),c=function(e){return function(t,r){var c,u,h=n(s(t)),p=i(r),d=h.length;return p<0||p>=d?e?"":void 0:(c=o(h,p))<55296||c>56319||p+1===d||(u=o(h,p+1))<56320||u>57343?e?a(h,p):c:e?l(h,p,p+2):u-56320+(c-55296<<10)+65536}};t.exports={ // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt:c(!1), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt:c(!0)}}}),require_es_string_code_point_at=__commonJS({"node_modules/core-js/modules/es.string.code-point-at.js"(){"use strict";var e=require_export(),t=require_string_multibyte().codeAt;e({target:"String",proto:!0},{codePointAt:function(e){return t(this,e)}})}}),require_not_a_regexp=__commonJS({"node_modules/core-js/internals/not-a-regexp.js"(e,t){var r=require_is_regexp(),i=TypeError;t.exports=function(e){if(r(e))throw i("The method doesn't accept regular expressions");return e}}}),require_correct_is_regexp_logic=__commonJS({"node_modules/core-js/internals/correct-is-regexp-logic.js"(e,t){var r=require_well_known_symbol()("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}}}),require_es_string_ends_with=__commonJS({"node_modules/core-js/modules/es.string.ends-with.js"(){"use strict";var e,t=require_export(),r=require_function_uncurry_this_clause(),i=require_object_get_own_property_descriptor().f,n=require_to_length(),s=require_to_string(),a=require_not_a_regexp(),o=require_require_object_coercible(),l=require_correct_is_regexp_logic(),c=require_is_pure(),u=r("".endsWith),h=r("".slice),p=Math.min,d=l("endsWith");t({target:"String",proto:!0,forced:!!(c||d||(e=i(String.prototype,"endsWith"),!e||e.writable))&&!d},{endsWith:function(e){var t=s(o(this));a(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,l=void 0===r?i:p(n(r),i),c=s(e);return u?u(t,c,l):h(t,l-c.length,l)===c}})}}),require_es_string_from_code_point=__commonJS({"node_modules/core-js/modules/es.string.from-code-point.js"(){var e=require_export(),t=require_function_uncurry_this(),r=require_to_absolute_index(),i=RangeError,n=String.fromCharCode,s=String.fromCodePoint,a=t([].join);e({target:"String",stat:!0,arity:1,forced:!!s&&1!=s.length},{ // eslint-disable-next-line no-unused-vars -- required for `.length` fromCodePoint:function(e){for(var t,s=[],o=arguments.length,l=0;o>l;){if(t=+arguments[l++],r(t,1114111)!==t)throw i(t+" is not a valid code point");s[l]=t<65536?n(t):n(55296+((t-=65536)>>10),t%1024+56320)}return a(s,"")}})}}),require_es_string_includes=__commonJS({"node_modules/core-js/modules/es.string.includes.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_not_a_regexp(),i=require_require_object_coercible(),n=require_to_string(),s=require_correct_is_regexp_logic(),a=t("".indexOf);e({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~a(n(i(this)),n(r(e)),arguments.length>1?arguments[1]:void 0)}})}}),require_es_string_iterator=__commonJS({"node_modules/core-js/modules/es.string.iterator.js"(){"use strict";var e=require_string_multibyte().charAt,t=require_to_string(),r=require_internal_state(),i=require_iterator_define(),n=require_create_iter_result_object(),s="String Iterator",a=r.set,o=r.getterFor(s);i(String,"String",(function(e){a(this,{type:s,string:t(e),index:0})}),(function(){var t,r=o(this),i=r.string,s=r.index;return s>=i.length?n(void 0,!0):(t=e(i,s),r.index+=t.length,n(t,!1))}))}}),require_fix_regexp_well_known_symbol_logic=__commonJS({"node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"(e,t){"use strict";require_es_regexp_exec();var r=require_function_uncurry_this_clause(),i=require_define_built_in(),n=require_regexp_exec(),s=require_fails(),a=require_well_known_symbol(),o=require_create_non_enumerable_property(),l=a("species"),c=RegExp.prototype;t.exports=function(e,t,u,h){var p=a(e),d=!s((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),m=d&&!s((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[l]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!d||!m||u){var f=r(/./[p]),g=t(p,""[e],(function(e,t,i,s,a){var o=r(e),l=t.exec;return l===n||l===c.exec?d&&!a?{done:!0,value:f(t,i,s)}:{done:!0,value:o(i,t,s)}:{done:!1}}));i(String.prototype,e,g[0]),i(c,p,g[1])}h&&o(c[p],"sham",!0)}}}),require_advance_string_index=__commonJS({"node_modules/core-js/internals/advance-string-index.js"(e,t){"use strict";var r=require_string_multibyte().charAt;t.exports=function(e,t,i){return t+(i?r(e,t).length:1)}}}),require_regexp_exec_abstract=__commonJS({"node_modules/core-js/internals/regexp-exec-abstract.js"(e,t){var r=require_function_call(),i=require_an_object(),n=require_is_callable(),s=require_classof_raw(),a=require_regexp_exec(),o=TypeError;t.exports=function(e,t){var l=e.exec;if(n(l)){var c=r(l,e,t);return null!==c&&i(c),c}if("RegExp"===s(e))return r(a,e,t);throw o("RegExp#exec called on incompatible receiver")}}}),require_es_string_match=__commonJS({"node_modules/core-js/modules/es.string.match.js"(){"use strict";var e=require_function_call(),t=require_fix_regexp_well_known_symbol_logic(),r=require_an_object(),i=require_is_null_or_undefined(),n=require_to_length(),s=require_to_string(),a=require_require_object_coercible(),o=require_get_method(),l=require_advance_string_index(),c=require_regexp_exec_abstract();t("match",(function(t,u,h){return[ // `String.prototype.match` method // https://tc39.es/ecma262/#sec-string.prototype.match function(r){var n=a(this),l=i(r)?void 0:o(r,t);return l?e(l,r,n):new RegExp(r)[t](s(n))}, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function(e){var t=r(this),i=s(e),a=h(u,t,i);if(a.done)return a.value;if(!t.global)return c(t,i);var o=t.unicode;t.lastIndex=0;for(var p,d=[],m=0;null!==(p=c(t,i));){var f=s(p[0]);d[m]=f,""===f&&(t.lastIndex=l(i,n(t.lastIndex),o)),m++}return 0===m?null:d}]}))}}),require_es_string_match_all=__commonJS({"node_modules/core-js/modules/es.string.match-all.js"(){"use strict";var e=require_export(),t=require_function_call(),r=require_function_uncurry_this_clause(),i=require_iterator_create_constructor(),n=require_create_iter_result_object(),s=require_require_object_coercible(),a=require_to_length(),o=require_to_string(),l=require_an_object(),c=require_is_null_or_undefined(),u=require_classof_raw(),h=require_is_regexp(),p=require_regexp_get_flags(),d=require_get_method(),m=require_define_built_in(),f=require_fails(),g=require_well_known_symbol(),_=require_species_constructor(),y=require_advance_string_index(),T=require_regexp_exec_abstract(),v=require_internal_state(),E=require_is_pure(),I=g("matchAll"),b="RegExp String",x=b+" Iterator",S=v.set,w=v.getterFor(x),C=RegExp.prototype,M=TypeError,R=r("".indexOf),A=r("".matchAll),D=!!A&&!f((function(){A("a",/./)})),O=i((function(e,t,r,i){S(this,{type:x,regexp:e,string:t,global:r,unicode:i,done:!1})}),b,(function(){var e=w(this);if(e.done)return n(void 0,!0);var t=e.regexp,r=e.string,i=T(t,r);return null===i?(e.done=!0,n(void 0,!0)):e.global?(""===o(i[0])&&(t.lastIndex=y(r,a(t.lastIndex),e.unicode)),n(i,!1)):(e.done=!0,n(i,!1))})),L=function(e){var t,r,i,n=l(this),s=o(e),c=_(n,RegExp),u=o(p(n));return t=new c(c===RegExp?n.source:n,u),r=!!~R(u,"g"),i=!!~R(u,"u"),t.lastIndex=a(n.lastIndex),new O(t,s,r,i)};e({target:"String",proto:!0,forced:D},{matchAll:function(e){var r,i,n,a,l=s(this);if(c(e)){if(D)return A(l,e)}else{if(h(e)&&(r=o(s(p(e))),!~R(r,"g")))throw M("`.matchAll` does not allow non-global regexes");if(D)return A(l,e);if(void 0===(n=d(e,I))&&E&&"RegExp"==u(e)&&(n=L),n)return t(n,e,l)}return i=o(l),a=new RegExp(e,"g"),E?t(L,a,i):a[I](i)}}),E||I in C||m(C,I,L)}}),require_string_pad_webkit_bug=__commonJS({"node_modules/core-js/internals/string-pad-webkit-bug.js"(e,t){var r=require_engine_user_agent();t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)}}),require_es_string_pad_end=__commonJS({"node_modules/core-js/modules/es.string.pad-end.js"(){"use strict";var e=require_export(),t=require_string_pad().end;e({target:"String",proto:!0,forced:require_string_pad_webkit_bug()},{padEnd:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}}),require_es_string_pad_start=__commonJS({"node_modules/core-js/modules/es.string.pad-start.js"(){"use strict";var e=require_export(),t=require_string_pad().start;e({target:"String",proto:!0,forced:require_string_pad_webkit_bug()},{padStart:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}})}}),require_es_string_raw=__commonJS({"node_modules/core-js/modules/es.string.raw.js"(){var e=require_export(),t=require_function_uncurry_this(),r=require_to_indexed_object(),i=require_to_object(),n=require_to_string(),s=require_length_of_array_like(),a=t([].push),o=t([].join);e({target:"String",stat:!0},{raw:function(e){for(var t=r(i(e).raw),l=s(t),c=arguments.length,u=[],h=0;l>h;){if(a(u,n(t[h++])),h===l)return o(u,"");h]*>)/g,c=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,r,u,h,p){var d=r+e.length,m=u.length,f=c;return void 0!==h&&(h=i(h),f=l),a(p,f,(function(i,a){var l;switch(s(a,0)){case"$":return"$";case"&":return e;case"`":return o(t,0,r);case"'":return o(t,d);case"<":l=h[o(a,1,-1)];break;default:var c=+a;if(0===c)return i;if(c>m){var p=n(c/10);return 0===p?i:p<=m?void 0===u[p-1]?s(a,1):u[p-1]+s(a,1):i}l=u[c-1]}return void 0===l?"":l}))}}}),require_es_string_replace=__commonJS({"node_modules/core-js/modules/es.string.replace.js"(){"use strict";var e=require_function_apply(),t=require_function_call(),r=require_function_uncurry_this(),i=require_fix_regexp_well_known_symbol_logic(),n=require_fails(),s=require_an_object(),a=require_is_callable(),o=require_is_null_or_undefined(),l=require_to_integer_or_infinity(),c=require_to_length(),u=require_to_string(),h=require_require_object_coercible(),p=require_advance_string_index(),d=require_get_method(),m=require_get_substitution(),f=require_regexp_exec_abstract(),g=require_well_known_symbol()("replace"),_=Math.max,y=Math.min,T=r([].concat),v=r([].push),E=r("".indexOf),I=r("".slice),b="$0"==="a".replace(/./,"$0"),x=!!/./[g]&&""===/./[g]("a","$0");i("replace",(function(r,i,n){var b=x?"$":"$0";return[ // `String.prototype.replace` method // https://tc39.es/ecma262/#sec-string.prototype.replace function(e,r){var n=h(this),s=o(e)?void 0:d(e,g);return s?t(s,e,n,r):t(i,u(n),e,r)}, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function(t,r){var o=s(this),h=u(t);if("string"==typeof r&&-1===E(r,b)&&-1===E(r,"$<")){var d=n(i,o,h,r);if(d.done)return d.value}var g=a(r);g||(r=u(r));var x=o.global;if(x){var S=o.unicode;o.lastIndex=0}for(var w=[];;){var C=f(o,h);if(null===C)break;if(v(w,C),!x)break;""===u(C[0])&&(o.lastIndex=p(h,c(o.lastIndex),S))}for(var M,R="",A=0,D=0;D=A&&(R+=I(h,A,L)+B,A=L+O.length)}return R+I(h,A)}]}),!!n((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}))||!b||x)}}),require_es_string_replace_all=__commonJS({"node_modules/core-js/modules/es.string.replace-all.js"(){"use strict";var e=require_export(),t=require_function_call(),r=require_function_uncurry_this(),i=require_require_object_coercible(),n=require_is_callable(),s=require_is_null_or_undefined(),a=require_is_regexp(),o=require_to_string(),l=require_get_method(),c=require_regexp_get_flags(),u=require_get_substitution(),h=require_well_known_symbol(),p=require_is_pure(),d=h("replace"),m=TypeError,f=r("".indexOf),g=r("".replace),_=r("".slice),y=Math.max,T=function(e,t,r){return r>e.length?-1:""===t?r:f(e,t,r)};e({target:"String",proto:!0},{replaceAll:function(e,r){var h,v,E,I,b,x,S,w,C,M=i(this),R=0,A=0,D="";if(!s(e)){if((h=a(e))&&(v=o(i(c(e))),!~f(v,"g")))throw m("`.replaceAll` does not allow non-global regexes");if(E=l(e,d))return t(E,e,M,r);if(p&&h)return g(o(M),e,r)}for(I=o(M),b=o(e),(x=n(r))||(r=o(r)),S=b.length,w=y(1,S),R=T(I,b,0);-1!==R;)C=x?o(r(b,R,I)):u(b,I,R,[],void 0,r),D+=_(I,A,R)+C,A=R+S,R=T(I,b,R+w);return A1||"".split(/.?/).length?function(r,n){var s=h(o(this)),l=void 0===n?T:n>>>0;if(0===l)return[];if(void 0===r)return[s];if(!a(r))return t(i,s,r,l);for(var c,u,p,m=[],g=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),_=0,y=new RegExp(r.source,g+"g");(c=t(f,y,s))&&!((u=y.lastIndex)>_&&(b(m,x(s,_,c.index)),c.length>1&&c.index=l));)y.lastIndex===c.index&&y.lastIndex++;return _===s.length?!p&&I(y,"")||b(m,""):b(m,x(s,_)),m.length>l?d(m,0,l):m}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t(i,this,e,r)}:i,[ // `String.prototype.split` method // https://tc39.es/ecma262/#sec-string.prototype.split function(e,i){var n=o(this),a=s(e)?void 0:p(e,r);return a?t(a,e,n,i):t(_,h(n),e,i)}, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function(e,t){var r=n(this),s=h(e),a=g(_,r,s,t,_!==i);if(a.done)return a.value;var o=l(r,RegExp),p=r.unicode,d=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(y?"g":"y"),f=new o(y?"^(?:"+r.source+")":r,d),E=void 0===t?T:t>>>0;if(0===E)return[];if(0===s.length)return null===m(f,s)?[s]:[];for(var I=0,S=0,w=[];S1?arguments[1]:void 0,t.length)),i=s(e);return u?u(t,i,r):h(t,r,r+i.length)===i}})}}),require_es_string_substr=__commonJS({"node_modules/core-js/modules/es.string.substr.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_require_object_coercible(),i=require_to_integer_or_infinity(),n=require_to_string(),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,c,u=n(r(this)),h=u.length,p=i(e);return p===1/0&&(p=0),p<0&&(p=a(h+p,0)),(l=void 0===t?h:i(t))<=0||l===1/0||p>=(c=o(p+l,h))?"":s(u,p,c)}})}}),require_string_trim_forced=__commonJS({"node_modules/core-js/internals/string-trim-forced.js"(e,t){var r=require_function_name().PROPER,i=require_fails(),n=require_whitespaces();t.exports=function(e){return i((function(){return!!n[e]()||"​…᠎"!=="​…᠎"[e]()||r&&n[e].name!==e}))}}}),require_es_string_trim=__commonJS({"node_modules/core-js/modules/es.string.trim.js"(){"use strict";var e=require_export(),t=require_string_trim().trim;e({target:"String",proto:!0,forced:require_string_trim_forced()("trim")},{trim:function(){return t(this)}})}}),require_string_trim_end=__commonJS({"node_modules/core-js/internals/string-trim-end.js"(e,t){"use strict";var r=require_string_trim().end,i=require_string_trim_forced();t.exports=i("trimEnd")?function(){return r(this)}:"".trimEnd}}),require_es_string_trim_right=__commonJS({"node_modules/core-js/modules/es.string.trim-right.js"(){var e=require_export(),t=require_string_trim_end();e({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==t},{trimRight:t})}}),require_es_string_trim_end=__commonJS({"node_modules/core-js/modules/es.string.trim-end.js"(){require_es_string_trim_right();var e=require_export(),t=require_string_trim_end();e({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==t},{trimEnd:t})}}),require_string_trim_start=__commonJS({"node_modules/core-js/internals/string-trim-start.js"(e,t){"use strict";var r=require_string_trim().start,i=require_string_trim_forced();t.exports=i("trimStart")?function(){return r(this)}:"".trimStart}}),require_es_string_trim_left=__commonJS({"node_modules/core-js/modules/es.string.trim-left.js"(){var e=require_export(),t=require_string_trim_start();e({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==t},{trimLeft:t})}}),require_es_string_trim_start=__commonJS({"node_modules/core-js/modules/es.string.trim-start.js"(){require_es_string_trim_left();var e=require_export(),t=require_string_trim_start();e({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==t},{trimStart:t})}}),require_create_html=__commonJS({"node_modules/core-js/internals/create-html.js"(e,t){var r=require_function_uncurry_this(),i=require_require_object_coercible(),n=require_to_string(),s=/"/g,a=r("".replace);t.exports=function(e,t,r,o){var l=n(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+a(n(o),s,""")+'"'),c+">"+l+""}}}),require_string_html_forced=__commonJS({"node_modules/core-js/internals/string-html-forced.js"(e,t){var r=require_fails();t.exports=function(e){return r((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}}}),require_es_string_anchor=__commonJS({"node_modules/core-js/modules/es.string.anchor.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("anchor")},{anchor:function(e){return t(this,"a","name",e)}})}}),require_es_string_big=__commonJS({"node_modules/core-js/modules/es.string.big.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("big")},{big:function(){return t(this,"big","","")}})}}),require_es_string_blink=__commonJS({"node_modules/core-js/modules/es.string.blink.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("blink")},{blink:function(){return t(this,"blink","","")}})}}),require_es_string_bold=__commonJS({"node_modules/core-js/modules/es.string.bold.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("bold")},{bold:function(){return t(this,"b","","")}})}}),require_es_string_fixed=__commonJS({"node_modules/core-js/modules/es.string.fixed.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("fixed")},{fixed:function(){return t(this,"tt","","")}})}}),require_es_string_fontcolor=__commonJS({"node_modules/core-js/modules/es.string.fontcolor.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("fontcolor")},{fontcolor:function(e){return t(this,"font","color",e)}})}}),require_es_string_fontsize=__commonJS({"node_modules/core-js/modules/es.string.fontsize.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("fontsize")},{fontsize:function(e){return t(this,"font","size",e)}})}}),require_es_string_italics=__commonJS({"node_modules/core-js/modules/es.string.italics.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("italics")},{italics:function(){return t(this,"i","","")}})}}),require_es_string_link=__commonJS({"node_modules/core-js/modules/es.string.link.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("link")},{link:function(e){return t(this,"a","href",e)}})}}),require_es_string_small=__commonJS({"node_modules/core-js/modules/es.string.small.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("small")},{small:function(){return t(this,"small","","")}})}}),require_es_string_strike=__commonJS({"node_modules/core-js/modules/es.string.strike.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("strike")},{strike:function(){return t(this,"strike","","")}})}}),require_es_string_sub=__commonJS({"node_modules/core-js/modules/es.string.sub.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("sub")},{sub:function(){return t(this,"sub","","")}})}}),require_es_string_sup=__commonJS({"node_modules/core-js/modules/es.string.sup.js"(){"use strict";var e=require_export(),t=require_create_html();e({target:"String",proto:!0,forced:require_string_html_forced()("sup")},{sup:function(){return t(this,"sup","","")}})}}),require_typed_array_constructors_require_wrappers=__commonJS({"node_modules/core-js/internals/typed-array-constructors-require-wrappers.js"(e,t){var r=require_global(),i=require_fails(),n=require_check_correctness_of_iteration(),s=require_array_buffer_view_core().NATIVE_ARRAY_BUFFER_VIEWS,a=r.ArrayBuffer,o=r.Int8Array;t.exports=!s||!i((function(){o(1)}))||!i((function(){new o(-1)}))||!n((function(e){new o,new o(null),new o(1.5),new o(e)}),!0)||i((function(){return 1!==new o(new a(2),1,void 0).length}))}}),require_to_positive_integer=__commonJS({"node_modules/core-js/internals/to-positive-integer.js"(e,t){var r=require_to_integer_or_infinity(),i=RangeError;t.exports=function(e){var t=r(e);if(t<0)throw i("The argument can't be less than 0");return t}}}),require_to_offset=__commonJS({"node_modules/core-js/internals/to-offset.js"(e,t){var r=require_to_positive_integer(),i=RangeError;t.exports=function(e,t){var n=r(e);if(n%t)throw i("Wrong offset");return n}}}),require_is_big_int_array=__commonJS({"node_modules/core-js/internals/is-big-int-array.js"(e,t){var r=require_classof(),i=require_function_uncurry_this()("".slice);t.exports=function(e){return"Big"===i(r(e),0,3)}}}),require_to_big_int=__commonJS({"node_modules/core-js/internals/to-big-int.js"(e,t){var r=require_to_primitive(),i=TypeError;t.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw i("Can't convert number to bigint");return BigInt(t)}}}),require_typed_array_from=__commonJS({"node_modules/core-js/internals/typed-array-from.js"(e,t){var r=require_function_bind_context(),i=require_function_call(),n=require_a_constructor(),s=require_to_object(),a=require_length_of_array_like(),o=require_get_iterator(),l=require_get_iterator_method(),c=require_is_array_iterator_method(),u=require_is_big_int_array(),h=require_array_buffer_view_core().aTypedArrayConstructor,p=require_to_big_int();t.exports=function(e){var t,d,m,f,g,_,y,T,v=n(this),E=s(e),I=arguments.length,b=I>1?arguments[1]:void 0,x=void 0!==b,S=l(E);if(S&&!c(S))for(T=(y=o(E,S)).next,E=[];!(_=i(T,y)).done;)E.push(_.value);for(x&&I>2&&(b=r(b,arguments[2])),d=a(E),m=new(h(v))(d),f=u(m),t=0;d>t;t++)g=x?b(E[t],t):E[t],m[t]=f?p(g):+g;return m}}}),require_typed_array_constructor=__commonJS({"node_modules/core-js/internals/typed-array-constructor.js"(e,t){"use strict";var r=require_export(),i=require_global(),n=require_function_call(),s=require_descriptors(),a=require_typed_array_constructors_require_wrappers(),o=require_array_buffer_view_core(),l=require_array_buffer(),c=require_an_instance(),u=require_create_property_descriptor(),h=require_create_non_enumerable_property(),p=require_is_integral_number(),d=require_to_length(),m=require_to_index(),f=require_to_offset(),g=require_to_property_key(),_=require_has_own_property(),y=require_classof(),T=require_is_object(),v=require_is_symbol(),E=require_object_create(),I=require_object_is_prototype_of(),b=require_object_set_prototype_of(),x=require_object_get_own_property_names().f,S=require_typed_array_from(),w=require_array_iteration().forEach,C=require_set_species(),M=require_object_define_property(),R=require_object_get_own_property_descriptor(),A=require_internal_state(),D=require_inherit_if_required(),O=A.get,L=A.set,P=A.enforce,N=M.f,F=R.f,U=Math.round,B=i.RangeError,k=l.ArrayBuffer,G=k.prototype,V=l.DataView,H=o.NATIVE_ARRAY_BUFFER_VIEWS,j=o.TYPED_ARRAY_TAG,z=o.TypedArray,q=o.TypedArrayPrototype,W=o.aTypedArrayConstructor,Y=o.isTypedArray,X="BYTES_PER_ELEMENT",J="Wrong length",$=function(e,t){W(e);for(var r=0,i=t.length,n=new e(i);i>r;)n[r]=t[r++];return n},Z=function(e,t){N(e,t,{get:function(){return O(this)[t]}})},K=function(e){var t;return I(G,e)||"ArrayBuffer"==(t=y(e))||"SharedArrayBuffer"==t},Q=function(e,t){return Y(e)&&!v(t)&&t in e&&p(+t)&&t>=0},ee=function(e,t){return t=g(t),Q(e,t)?u(2,e[t]):F(e,t)},te=function(e,t,r){return t=g(t),!(Q(e,t)&&T(r)&&_(r,"value"))||_(r,"get")||_(r,"set")||r.configurable||_(r,"writable")&&!r.writable||_(r,"enumerable")&&!r.enumerable?N(e,t,r):(e[t]=r.value,e)};s?(H||(R.f=ee,M.f=te,Z(q,"buffer"),Z(q,"byteOffset"),Z(q,"byteLength"),Z(q,"length")),r({target:"Object",stat:!0,forced:!H},{getOwnPropertyDescriptor:ee,defineProperty:te}),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=i[l],_=g,y=_&&_.prototype,v={},I=function(e,t){N(e,t,{get:function(){return function(e,t){var r=O(e);return r.view[u](t*o+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=O(e);s&&(r=(r=U(r))<0?0:r>255?255:255&r),i.view[p](t*o+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};H?a&&(_=t((function(e,t,r,i){return c(e,y),D(T(t)?K(t)?void 0!==i?new g(t,f(r,o),i):void 0!==r?new g(t,f(r,o)):new g(t):Y(t)?$(_,t):n(S,_,t):new g(m(t)),e,_)})),b&&b(_,z),w(x(g),(function(e){e in _||h(_,e,g[e])})),_.prototype=y):(_=t((function(e,t,r,i){c(e,y);var s,a,l,u=0,h=0;if(T(t)){if(!K(t))return Y(t)?$(_,t):n(S,_,t);s=t,h=f(r,o);var p=t.byteLength;if(void 0===i){if(p%o)throw B(J);if((a=p-h)<0)throw B(J)}else if((a=d(i)*o)+h>p)throw B(J);l=a/o}else l=m(t),s=new k(a=l*o);for(L(e,{buffer:s,byteOffset:h,byteLength:a,length:l,view:new V(s)});u=0?a:s+a;return o<0||o>=s?void 0:n[o]}))}}),require_es_typed_array_copy_within=__commonJS({"node_modules/core-js/modules/es.typed-array.copy-within.js"(){"use strict";var e=require_function_uncurry_this(),t=require_array_buffer_view_core(),r=e(require_array_copy_within()),i=t.aTypedArray;(0,t.exportTypedArrayMethod)("copyWithin",(function(e,t){return r(i(this),e,t,arguments.length>2?arguments[2]:void 0)}))}}),require_es_typed_array_every=__commonJS({"node_modules/core-js/modules/es.typed-array.every.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().every,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("every",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_fill=__commonJS({"node_modules/core-js/modules/es.typed-array.fill.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_fill(),r=require_to_big_int(),i=require_classof(),n=require_function_call(),s=require_function_uncurry_this(),a=require_fails(),o=e.aTypedArray,l=e.exportTypedArrayMethod,c=s("".slice);l("fill",(function(e){var s=arguments.length;o(this);var a="Big"===c(i(this),0,3)?r(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})))}}),require_array_from_constructor_and_list=__commonJS({"node_modules/core-js/internals/array-from-constructor-and-list.js"(e,t){var r=require_length_of_array_like();t.exports=function(e,t){for(var i=0,n=r(t),s=new e(n);n>i;)s[i]=t[i++];return s}}}),require_typed_array_species_constructor=__commonJS({"node_modules/core-js/internals/typed-array-species-constructor.js"(e,t){var r=require_array_buffer_view_core(),i=require_species_constructor(),n=r.aTypedArrayConstructor,s=r.getTypedArrayConstructor;t.exports=function(e){return n(i(e,s(e)))}}}),require_typed_array_from_species_and_list=__commonJS({"node_modules/core-js/internals/typed-array-from-species-and-list.js"(e,t){var r=require_array_from_constructor_and_list(),i=require_typed_array_species_constructor();t.exports=function(e,t){return r(i(e),t)}}}),require_es_typed_array_filter=__commonJS({"node_modules/core-js/modules/es.typed-array.filter.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().filter,r=require_typed_array_from_species_and_list(),i=e.aTypedArray;(0,e.exportTypedArrayMethod)("filter",(function(e){var n=t(i(this),e,arguments.length>1?arguments[1]:void 0);return r(this,n)}))}}),require_es_typed_array_find=__commonJS({"node_modules/core-js/modules/es.typed-array.find.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().find,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("find",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_find_index=__commonJS({"node_modules/core-js/modules/es.typed-array.find-index.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().findIndex,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("findIndex",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_find_last=__commonJS({"node_modules/core-js/modules/es.typed-array.find-last.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration_from_last().findLast,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLast",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_find_last_index=__commonJS({"node_modules/core-js/modules/es.typed-array.find-last-index.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration_from_last().findLastIndex,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("findLastIndex",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_for_each=__commonJS({"node_modules/core-js/modules/es.typed-array.for-each.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().forEach,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("forEach",(function(e){t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_from=__commonJS({"node_modules/core-js/modules/es.typed-array.from.js"(){"use strict";var e=require_typed_array_constructors_require_wrappers();(0,require_array_buffer_view_core().exportTypedArrayStaticMethod)("from",require_typed_array_from(),e)}}),require_es_typed_array_includes=__commonJS({"node_modules/core-js/modules/es.typed-array.includes.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_includes().includes,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("includes",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_index_of=__commonJS({"node_modules/core-js/modules/es.typed-array.index-of.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_includes().indexOf,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("indexOf",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_iterator=__commonJS({"node_modules/core-js/modules/es.typed-array.iterator.js"(){"use strict";var e=require_global(),t=require_fails(),r=require_function_uncurry_this(),i=require_array_buffer_view_core(),n=require_es_array_iterator(),s=require_well_known_symbol()("iterator"),a=e.Uint8Array,o=r(n.values),l=r(n.keys),c=r(n.entries),u=i.aTypedArray,h=i.exportTypedArrayMethod,p=a&&a.prototype,d=!t((function(){p[s].call([1])})),m=!!p&&p.values&&p[s]===p.values&&"values"===p.values.name,f=function(){return o(u(this))};h("entries",(function(){return c(u(this))}),d),h("keys",(function(){return l(u(this))}),d),h("values",f,d||!m,{name:"values"}),h(s,f,d||!m,{name:"values"})}}),require_es_typed_array_join=__commonJS({"node_modules/core-js/modules/es.typed-array.join.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_function_uncurry_this(),r=e.aTypedArray,i=e.exportTypedArrayMethod,n=t([].join);i("join",(function(e){return n(r(this),e)}))}}),require_es_typed_array_last_index_of=__commonJS({"node_modules/core-js/modules/es.typed-array.last-index-of.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_function_apply(),r=require_array_last_index_of(),i=e.aTypedArray;(0,e.exportTypedArrayMethod)("lastIndexOf",(function(e){var n=arguments.length;return t(r,i(this),n>1?[e,arguments[1]]:[e])}))}}),require_es_typed_array_map=__commonJS({"node_modules/core-js/modules/es.typed-array.map.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().map,r=require_typed_array_species_constructor(),i=e.aTypedArray;(0,e.exportTypedArrayMethod)("map",(function(e){return t(i(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(r(e))(t)}))}))}}),require_es_typed_array_of=__commonJS({"node_modules/core-js/modules/es.typed-array.of.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_typed_array_constructors_require_wrappers(),r=e.aTypedArrayConstructor;(0,e.exportTypedArrayStaticMethod)("of",(function(){for(var e=0,t=arguments.length,i=new(r(this))(t);t>e;)i[e]=arguments[e++];return i}),t)}}),require_es_typed_array_reduce=__commonJS({"node_modules/core-js/modules/es.typed-array.reduce.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_reduce().left,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduce",(function(e){var i=arguments.length;return t(r(this),e,i,i>1?arguments[1]:void 0)}))}}),require_es_typed_array_reduce_right=__commonJS({"node_modules/core-js/modules/es.typed-array.reduce-right.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_reduce().right,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("reduceRight",(function(e){var i=arguments.length;return t(r(this),e,i,i>1?arguments[1]:void 0)}))}}),require_es_typed_array_reverse=__commonJS({"node_modules/core-js/modules/es.typed-array.reverse.js"(){"use strict";var e=require_array_buffer_view_core(),t=e.aTypedArray,r=e.exportTypedArrayMethod,i=Math.floor;r("reverse",(function(){for(var e,r=this,n=t(r).length,s=i(n/2),a=0;a1?arguments[1]:void 0,1),a=s(e);if(d)return t(u,this,a,r);var l=this.length,c=i(a),p=0;if(c+r>l)throw o("Wrong length");for(;po;)c[o]=s[o++];return c}),r((function(){new Int8Array(1).slice()})))}}),require_es_typed_array_some=__commonJS({"node_modules/core-js/modules/es.typed-array.some.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_array_iteration().some,r=e.aTypedArray;(0,e.exportTypedArrayMethod)("some",(function(e){return t(r(this),e,arguments.length>1?arguments[1]:void 0)}))}}),require_es_typed_array_sort=__commonJS({"node_modules/core-js/modules/es.typed-array.sort.js"(){"use strict";var e=require_global(),t=require_function_uncurry_this_clause(),r=require_fails(),i=require_a_callable(),n=require_array_sort(),s=require_array_buffer_view_core(),a=require_engine_ff_version(),o=require_engine_is_ie_or_edge(),l=require_engine_v8_version(),c=require_engine_webkit_version(),u=s.aTypedArray,h=s.exportTypedArrayMethod,p=e.Uint16Array,d=p&&t(p.prototype.sort),m=!(!d||r((function(){d(new p(2),null)}))&&r((function(){d(new p(2),{})}))),f=!!d&&!r((function(){if(l)return l<74;if(a)return a<67;if(o)return!0;if(c)return c<602;var e,t,r=new p(516),i=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,i[e]=e-2*t+3;for(d(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==i[e])return!0}));h("sort",(function(e){return void 0!==e&&i(e),f?d(this,e):n(u(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!f||m)}}),require_es_typed_array_subarray=__commonJS({"node_modules/core-js/modules/es.typed-array.subarray.js"(){"use strict";var e=require_array_buffer_view_core(),t=require_to_length(),r=require_to_absolute_index(),i=require_typed_array_species_constructor(),n=e.aTypedArray;(0,e.exportTypedArrayMethod)("subarray",(function(e,s){var a=n(this),o=a.length,l=r(e,o);return new(i(a))(a.buffer,a.byteOffset+l*a.BYTES_PER_ELEMENT,t((void 0===s?o:r(s,o))-l))}))}}),require_es_typed_array_to_locale_string=__commonJS({"node_modules/core-js/modules/es.typed-array.to-locale-string.js"(){"use strict";var e=require_global(),t=require_function_apply(),r=require_array_buffer_view_core(),i=require_fails(),n=require_array_slice(),s=e.Int8Array,a=r.aTypedArray,o=r.exportTypedArrayMethod,l=[].toLocaleString,c=!!s&&i((function(){l.call(new s(1))}));o("toLocaleString",(function(){return t(l,c?n(a(this)):a(this),n(arguments))}),i((function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()}))||!i((function(){s.prototype.toLocaleString.call([1,2])})))}}),require_es_typed_array_to_string=__commonJS({"node_modules/core-js/modules/es.typed-array.to-string.js"(){"use strict";var e=require_array_buffer_view_core().exportTypedArrayMethod,t=require_fails(),r=require_global(),i=require_function_uncurry_this(),n=r.Uint8Array,s=n&&n.prototype||{},a=[].toString,o=i([].join);t((function(){a.call({})}))&&(a=function(){return o(this)});var l=s.toString!=a;e("toString",a,l)}}),require_es_unescape=__commonJS({"node_modules/core-js/modules/es.unescape.js"(){"use strict";var e=require_export(),t=require_function_uncurry_this(),r=require_to_string(),i=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,c,u=r(e),h="",p=u.length,d=0;d>(-2*E&6))));return _}})}}),require_web_btoa=__commonJS({"node_modules/core-js/modules/web.btoa.js"(){var e=require_export(),t=require_get_built_in(),r=require_function_uncurry_this(),i=require_fails(),n=require_to_string(),s=require_validate_arguments_length(),a=require_base64_map().itoc,o=t("btoa"),l=r("".charAt),c=r("".charCodeAt),u=!!o&&!i((function(){o()})),h=!!o&&i((function(){return"bnVsbA=="!==o(null)})),p=!!o&&1!==o.length;e({global:!0,enumerable:!0,forced:u||h||p},{btoa:function(e){if(s(arguments.length,1),u||h||p)return o(n(e));for(var r,i,d=n(e),m="",f=0,g=a;l(d,f)||(g="=",f%1);){if((i=c(d,f+=3/4))>255)throw new(t("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");m+=l(g,63&(r=r<<8|i)>>8-f%1*8)}return m}})}}),require_dom_iterables=__commonJS({"node_modules/core-js/internals/dom-iterables.js"(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}}}),require_dom_token_list_prototype=__commonJS({"node_modules/core-js/internals/dom-token-list-prototype.js"(e,t){var r=require_document_create_element()("span").classList,i=r&&r.constructor&&r.constructor.prototype;t.exports=i===Object.prototype?void 0:i}}),require_web_dom_collections_for_each=__commonJS({"node_modules/core-js/modules/web.dom-collections.for-each.js"(){var e,t=require_global(),r=require_dom_iterables(),i=require_dom_token_list_prototype(),n=require_array_for_each(),s=require_create_non_enumerable_property(),a=function(e){if(e&&e.forEach!==n)try{s(e,"forEach",n)}catch(t){e.forEach=n}};for(e in r)r[e]&&a(t[e]&&t[e].prototype);a(i)}}),require_web_dom_collections_iterator=__commonJS({"node_modules/core-js/modules/web.dom-collections.iterator.js"(){var e,t=require_global(),r=require_dom_iterables(),i=require_dom_token_list_prototype(),n=require_es_array_iterator(),s=require_create_non_enumerable_property(),a=require_well_known_symbol(),o=a("iterator"),l=a("toStringTag"),c=n.values,u=function(e,t){if(e){if(e[o]!==c)try{s(e,o,c)}catch(t){e[o]=c}if(e[l]||s(e,l,t),r[t])for(var i in n)if(e[i]!==n[i])try{s(e,i,n[i])}catch(t){e[i]=n[i]}}};for(e in r)u(t[e]&&t[e].prototype,e);u(i,"DOMTokenList")}}),require_try_node_require=__commonJS({"node_modules/core-js/internals/try-node-require.js"(e,t){var r=require_engine_is_node();t.exports=function(e){try{if(r)return Function('return require("'+e+'")')()}catch(e){}}}}),require_dom_exception_constants=__commonJS({"node_modules/core-js/internals/dom-exception-constants.js"(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}}}}),require_web_dom_exception_constructor=__commonJS({"node_modules/core-js/modules/web.dom-exception.constructor.js"(){"use strict";var e=require_export(),t=require_try_node_require(),r=require_get_built_in(),i=require_fails(),n=require_object_create(),s=require_create_property_descriptor(),a=require_object_define_property().f,o=require_define_built_in(),l=require_define_built_in_accessor(),c=require_has_own_property(),u=require_an_instance(),h=require_an_object(),p=require_error_to_string(),d=require_normalize_string_argument(),m=require_dom_exception_constants(),f=require_error_stack_clear(),g=require_internal_state(),_=require_descriptors(),y=require_is_pure(),T="DOMException",v="DATA_CLONE_ERR",E=r("Error"),I=r(T)||function(){try{(new(r("MessageChannel")||t("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name==v&&25==e.code)return e.constructor}}(),b=I&&I.prototype,x=E.prototype,S=g.set,w=g.getterFor(T),C="stack"in E(T),M=function(e){return c(m,e)&&m[e].m?m[e].c:0},R=function(){u(this,A);var e=arguments.length,t=d(e<1?void 0:arguments[0]),r=d(e<2?void 0:arguments[1],"Error"),i=M(r);if(S(this,{type:T,name:r,message:t,code:i}),_||(this.name=r,this.message=t,this.code=i),C){var n=E(t);n.name=T,a(this,"stack",s(1,f(n.stack,1)))}},A=R.prototype=n(x),D=function(e){return{enumerable:!0,configurable:!0,get:e}},O=function(e){return D((function(){return w(this)[e]}))};_&&(l(A,"code",O("code")),l(A,"message",O("message")),l(A,"name",O("name"))),a(A,"constructor",s(1,R));var L=i((function(){return!(new I instanceof E)})),P=L||i((function(){return x.toString!==p||"2: 1"!==String(new I(1,2))})),N=L||i((function(){return 25!==new I(1,"DataCloneError").code})),F=L||25!==I[v]||25!==b[v],U=y?P||N||F:L;e({global:!0,constructor:!0,forced:U},{DOMException:U?R:I});var B,k,G,V,H=r(T),j=H.prototype;for(V in P&&(y||I===H)&&o(j,"toString",p),N&&_&&I===H&&l(j,"code",D((function(){return M(h(this).name)}))),m)c(m,V)&&(k=(B=m[V]).s,G=s(6,B.c),c(H,k)||a(H,k,G),c(j,k)||a(j,k,G))}}),require_web_dom_exception_stack=__commonJS({"node_modules/core-js/modules/web.dom-exception.stack.js"(){"use strict";var e=require_export(),t=require_global(),r=require_get_built_in(),i=require_create_property_descriptor(),n=require_object_define_property().f,s=require_has_own_property(),a=require_an_instance(),o=require_inherit_if_required(),l=require_normalize_string_argument(),c=require_dom_exception_constants(),u=require_error_stack_clear(),h=require_descriptors(),p=require_is_pure(),d="DOMException",m=r("Error"),f=r(d),g=function(){a(this,_);var e=arguments.length,t=l(e<1?void 0:arguments[0]),r=l(e<2?void 0:arguments[1],"Error"),s=new f(t,r),c=m(t);return c.name=d,n(s,"stack",i(1,u(c.stack,1))),o(s,this,g),s},_=g.prototype=f.prototype,y="stack"in m(d),T="stack"in new f(1,2),v=f&&h&&Object.getOwnPropertyDescriptor(t,d),E=!(!v||v.writable&&v.configurable),I=y&&!E&&!T;e({global:!0,constructor:!0,forced:p||I},{ // TODO: fix export logic DOMException:I?g:f});var b,x,S,w=r(d),C=w.prototype;if(C.constructor!==w)for(S in p||n(C,"constructor",i(1,w)),c)s(c,S)&&(s(w,x=(b=c[S]).s)||n(w,x,i(6,b.c)))}}),require_web_dom_exception_to_string_tag=__commonJS({"node_modules/core-js/modules/web.dom-exception.to-string-tag.js"(){var e=require_get_built_in(),t="DOMException";require_set_to_string_tag()(e(t),t)}}),require_web_clear_immediate=__commonJS({"node_modules/core-js/modules/web.clear-immediate.js"(){var e=require_export(),t=require_global(),r=require_task().clear;e({global:!0,bind:!0,enumerable:!0,forced:t.clearImmediate!==r},{clearImmediate:r})}}),require_engine_is_bun=__commonJS({"node_modules/core-js/internals/engine-is-bun.js"(e,t){t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version}}),require_schedulers_fix=__commonJS({"node_modules/core-js/internals/schedulers-fix.js"(e,t){"use strict";var r,i=require_global(),n=require_function_apply(),s=require_is_callable(),a=require_engine_is_bun(),o=require_engine_user_agent(),l=require_array_slice(),c=require_validate_arguments_length(),u=i.Function,h=/MSIE .\./.test(o)||a&&((r=i.Bun.version.split(".")).length<3||0==r[0]&&(r[1]<3||3==r[1]&&0==r[2]));t.exports=function(e,t){var r=t?2:1;return h?function(i,a){var o=c(arguments.length,1)>r,h=s(i)?i:u(i),p=o?l(arguments,r):[],d=o?function(){n(h,this,p)}:h;return t?e(d,a):e(d)}:e}}}),require_web_set_immediate=__commonJS({"node_modules/core-js/modules/web.set-immediate.js"(){var e=require_export(),t=require_global(),r=require_task().set,i=require_schedulers_fix(),n=t.setImmediate?i(r,!1):r;e({global:!0,bind:!0,enumerable:!0,forced:t.setImmediate!==n},{setImmediate:n})}}),require_web_immediate=__commonJS({"node_modules/core-js/modules/web.immediate.js"(){require_web_clear_immediate(),require_web_set_immediate()}}),require_web_queue_microtask=__commonJS({"node_modules/core-js/modules/web.queue-microtask.js"(){var e=require_export(),t=require_global(),r=require_microtask(),i=require_a_callable(),n=require_validate_arguments_length(),s=require_engine_is_node(),a=t.process;e({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){n(arguments.length,1),i(e);var t=s&&a.domain;r(t?t.bind(e):e)}})}}),require_web_self=__commonJS({"node_modules/core-js/modules/web.self.js"(){"use strict";var e,t=require_export(),r=require_global(),i=require_define_built_in_accessor(),n=require_descriptors(),s=TypeError,a=Object.defineProperty,o=r.self!==r;try{n?(e=Object.getOwnPropertyDescriptor(r,"self"),!o&&e&&e.get&&e.enumerable||i(r,"self",{get:function(){return r},set:function(e){if(this!==r)throw s("Illegal invocation");a(r,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})):t({global:!0,simple:!0,forced:o},{self:r})}catch(e){}}}),require_map_helpers=__commonJS({"node_modules/core-js/internals/map-helpers.js"(e,t){var r=require_function_uncurry_this(),i=Map.prototype;t.exports={ // eslint-disable-next-line es/no-map -- safe Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}}}),require_set_helpers=__commonJS({"node_modules/core-js/internals/set-helpers.js"(e,t){var r=require_function_uncurry_this(),i=Set.prototype;t.exports={ // eslint-disable-next-line es/no-set -- safe Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i,$has:i.has,$keys:i.keys}}}),require_web_structured_clone=__commonJS({"node_modules/core-js/modules/web.structured-clone.js"(){var e,t=require_is_pure(),r=require_export(),i=require_global(),n=require_get_built_in(),s=require_function_uncurry_this(),a=require_fails(),o=require_uid(),l=require_is_callable(),c=require_is_constructor(),u=require_is_null_or_undefined(),h=require_is_object(),p=require_is_symbol(),d=require_iterate(),m=require_an_object(),f=require_classof(),g=require_has_own_property(),_=require_create_property(),y=require_create_non_enumerable_property(),T=require_length_of_array_like(),v=require_validate_arguments_length(),E=require_regexp_get_flags(),I=require_map_helpers(),b=require_set_helpers(),x=require_error_stack_installable(),S=require_engine_v8_version(),w=require_engine_is_browser(),C=require_engine_is_deno(),M=require_engine_is_node(),R=i.Object,A=i.Array,D=i.Date,O=i.Error,L=i.EvalError,P=i.RangeError,N=i.ReferenceError,F=i.SyntaxError,U=i.TypeError,B=i.URIError,k=i.PerformanceMark,G=i.WebAssembly,V=G&&G.CompileError||O,H=G&&G.LinkError||O,j=G&&G.RuntimeError||O,z=n("DOMException"),q=I.Map,W=I.has,Y=I.get,X=I.set,J=b.Set,$=b.add,Z=n("Object","keys"),K=s([].push),Q=s((!0).valueOf),ee=s(1..valueOf),te=s("".valueOf),re=s(D.prototype.getTime),ie=o("structuredClone"),ne="DataCloneError",se="Transferring",ae=function(e){return!a((function(){var t=new i.Set([7]),r=e(t),n=e(R(7));return r==t||!r.has(7)||"object"!=typeof n||7!=n}))&&e},oe=function(e,t){return!a((function(){var r=new t,i=e({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof t&&i.a.stack===r.stack)}))},le=i.structuredClone,ce=t||!oe(le,O)||!oe(le,z)||(e=le,!!a((function(){var t=e(new i.AggregateError([1],ie,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=ie||3!=t.cause}))),ue=!le&&ae((function(e){return new k(ie,{detail:e}).detail})),he=ae(le)||ue,pe=function(e){throw new z("Uncloneable type: "+e,ne)},de=function(e,t){throw new z((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",ne)},me=function(e,t){if(p(e)&&pe("Symbol"),!h(e))return e;if(t){if(W(t,e))return Y(t,e)}else t=new q;var r,s,a,o,c,u,d,m,v,I,b=f(e),S=!1;switch(b){case"Array":a=A(T(e)),S=!0;break;case"Object":a={},S=!0;break;case"Map":a=new q,S=!0;break;case"Set":a=new J,S=!0;break;case"RegExp":a=new RegExp(e.source,E(e));break;case"Error":switch(s=e.name){case"AggregateError":a=n("AggregateError")([]);break;case"EvalError":a=L();break;case"RangeError":a=P();break;case"ReferenceError":a=N();break;case"SyntaxError":a=F();break;case"TypeError":a=U();break;case"URIError":a=B();break;case"CompileError":a=V();break;case"LinkError":a=H();break;case"RuntimeError":a=j();break;default:a=O()}S=!0;break;case"DOMException":a=new z(e.message,e.name),S=!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":r=i[b],h(r)||de(b),a=new r( // this is safe, since arraybuffer cannot have circular references me(e.buffer,t),e.byteOffset,"DataView"===b?e.byteLength:e.length);break;case"DOMQuad":try{a=new DOMQuad(me(e.p1,t),me(e.p2,t),me(e.p3,t),me(e.p4,t))}catch(t){he?a=he(e):de(b)}break;case"FileList":if(o=function(){var e;try{e=new i.DataTransfer}catch(t){try{e=new i.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(c=0,u=T(e);c92||M&&S>94||w&&S>97)return!1;var e=new ArrayBuffer(8),t=le(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),ge=function(e,t){if(!h(e))throw U("Transfer option cannot be converted to a sequence");var r=[];d(e,(function(e){K(r,m(e))}));var n,s,a,o,u,p,g=0,_=T(r);if(fe)for(o=le(r,{transfer:r});g<_;)X(t,r[g],o[g++]);else for(;g<_;){if(n=r[g++],W(t,n))throw new z("Duplicate transferable",ne);switch(s=f(n)){case"ImageBitmap":a=i.OffscreenCanvas,c(a)||de(s,se);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)||de(s,se);try{u=n.clone(),n.close()}catch(e){}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":de(s,se)}if(void 0===u)throw new z("This object cannot be transferred: "+s,ne);X(t,n,u)}};r({global:!0,enumerable:!0,sham:!fe,forced:ce},{structuredClone:function(e){var t,r=v(arguments.length,1)>1&&!u(arguments[1])?m(arguments[1]):void 0,i=r?r.transfer:void 0;return void 0!==i&&(t=new q,ge(i,t)),me(e,t)}})}}),require_web_set_interval=__commonJS({"node_modules/core-js/modules/web.set-interval.js"(){var e=require_export(),t=require_global(),r=require_schedulers_fix()(t.setInterval,!0);e({global:!0,bind:!0,forced:t.setInterval!==r},{setInterval:r})}}),require_web_set_timeout=__commonJS({"node_modules/core-js/modules/web.set-timeout.js"(){var e=require_export(),t=require_global(),r=require_schedulers_fix()(t.setTimeout,!0);e({global:!0,bind:!0,forced:t.setTimeout!==r},{setTimeout:r})}}),require_web_timers=__commonJS({"node_modules/core-js/modules/web.timers.js"(){require_web_set_interval(),require_web_set_timeout()}}),require_url_constructor_detection=__commonJS({"node_modules/core-js/internals/url-constructor-detection.js"(e,t){var r=require_fails(),i=require_well_known_symbol(),n=require_is_pure(),s=i("iterator");t.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),r+=i+e})),n&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))}}),require_string_punycode_to_ascii=__commonJS({"node_modules/core-js/internals/string-punycode-to-ascii.js"(e,t){"use strict";var r=require_function_uncurry_this(),i=2147483647,n=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=RangeError,l=r(s.exec),c=Math.floor,u=String.fromCharCode,h=r("".charCodeAt),p=r([].join),d=r([].push),m=r("".replace),f=r("".split),g=r("".toLowerCase),_=function(e){return e+22+75*(e<26)},y=function(e,t,r){var i=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;)e=c(e/35),i+=36;return c(i+36*e/(e+38))},T=function(e){var t=[];e=function(e){for(var t=[],r=0,i=e.length;r=55296&&n<=56319&&r=l&&nc((i-m)/E))throw o(a);for(m+=(v-l)*E,l=v,r=0;ri)throw o(a);if(n==l){for(var I=m,b=36;;){var x=b<=f?1:b>=f+26?26:b-f;if(I0?arguments[0]:void 0;D(this,new ce(e))},fe=me.prototype;c(fe,{ // `URLSearchParams.prototype.append` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append:function(e,t){S(arguments.length,2);var r=O(this);Y(r.entries,{key:v(e),value:v(t)}),r.updateURL()}, // `URLSearchParams.prototype.delete` method // https://url.spec.whatwg.org/#dom-urlsearchparams-delete delete:function(e){S(arguments.length,1);for(var t=O(this),r=t.entries,i=v(e),n=0;nt.key?1:-1})),e.updateURL()}, // `URLSearchParams.prototype.forEach` method forEach:function(e){for(var t,r=O(this).entries,i=g(e,arguments.length>1?arguments[1]:void 0),n=0;n1?pe(arguments[1]):{})}}),m(U)&&(de=function(e){return d(this,k),new U(e,arguments.length>1?pe(arguments[1]):{})},k.constructor=de,de.prototype=k,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:de}))),t.exports={URLSearchParams:me,getState:O}}}),require_web_url_constructor=__commonJS({"node_modules/core-js/modules/web.url.constructor.js"(){"use strict";require_es_string_iterator();var e,t=require_export(),r=require_descriptors(),i=require_url_constructor_detection(),n=require_global(),s=require_function_bind_context(),a=require_function_uncurry_this(),o=require_define_built_in(),l=require_define_built_in_accessor(),c=require_an_instance(),u=require_has_own_property(),h=require_object_assign(),p=require_array_from(),d=require_array_slice_simple(),m=require_string_multibyte().codeAt,f=require_string_punycode_to_ascii(),g=require_to_string(),_=require_set_to_string_tag(),y=require_validate_arguments_length(),T=require_web_url_search_params_constructor(),v=require_internal_state(),E=v.set,I=v.getterFor("URL"),b=T.URLSearchParams,x=T.getState,S=n.URL,w=n.TypeError,C=n.parseInt,M=Math.floor,R=Math.pow,A=a("".charAt),D=a(/./.exec),O=a([].join),L=a(1..toString),P=a([].pop),N=a([].push),F=a("".replace),U=a([].shift),B=a("".split),k=a("".slice),G=a("".toLowerCase),V=a([].unshift),H="Invalid scheme",j="Invalid host",z="Invalid port",q=/[a-z]/i,W=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,J=/^[0-7]+$/,$=/^\d+$/,Z=/^[\da-f]+$/i,K=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Q=/[\0\t\n\r #/:<>?@[\\\]^|]/,ee=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,te=/[\t\n\r]/g,re=function(e){var t,r,i,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)V(t,e%256),e=M(e/256);return O(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,r=1,i=null,n=0,s=0;s<8;s++)0!==e[s]?(n>r&&(t=i,r=n),i=null,n=0):(null===i&&(i=s),++n);return n>r&&(t=i,r=n),t}(e),r=0;r<8;r++)n&&0===e[r]||(n&&(n=!1),i===r?(t+=r?":":"::",n=!0):(t+=L(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},ie={},ne=h({},ie,{" ":1,'"':1,"<":1,">":1,"`":1}),se=h({},ne,{"#":1,"?":1,"{":1,"}":1}),ae=h({},se,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),oe=function(e,t){var r=m(e,0);return r>32&&r<127&&!u(t,e)?e:encodeURIComponent(e)},le={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ce=function(e,t){var r;return 2==e.length&&D(q,A(e,0))&&(":"==(r=A(e,1))||!t&&"|"==r)},ue=function(e){var t;return e.length>1&&ce(k(e,0,2))&&(2==e.length||"/"===(t=A(e,2))||"\\"===t||"?"===t||"#"===t)},he=function(e){return"."===e||"%2e"===G(e)},pe={},de={},me={},fe={},ge={},_e={},ye={},Te={},ve={},Ee={},Ie={},be={},xe={},Se={},we={},Ce={},Me={},Re={},Ae={},De={},Oe={},Le=function(e,t,r){var i,n,s,a=g(e);if(t){if(n=this.parse(a))throw w(n);this.searchParams=null}else{if(void 0!==r&&(i=new Le(r,!0)),n=this.parse(a,null,i))throw w(n);(s=x(new b)).bindURL(this),this.searchParams=s}};Le.prototype={type:"URL", // https://url.spec.whatwg.org/#url-parsing // eslint-disable-next-line max-statements -- TODO parse:function(t,r,i){var n,s,a,o,l,c=this,h=r||pe,m=0,f="",_=!1,y=!1,T=!1;for(t=g(t),r||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,ee,"")),t=F(t,te,""),n=p(t);m<=n.length;){switch(s=n[m],h){case pe:if(!s||!D(q,s)){if(r)return H;h=me;continue}f+=G(s),h=de;break;case de:if(s&&(D(W,s)||"+"==s||"-"==s||"."==s))f+=G(s);else{if(":"!=s){if(r)return H;f="",h=me,m=0;continue}if(r&&(c.isSpecial()!=u(le,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,r)return void(c.isSpecial()&&le[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?h=Se:c.isSpecial()&&i&&i.scheme==c.scheme?h=fe:c.isSpecial()?h=Te:"/"==n[m+1]?(h=ge,m++):(c.cannotBeABaseURL=!0,N(c.path,""),h=Ae)}break;case me:if(!i||i.cannotBeABaseURL&&"#"!=s)return H;if(i.cannotBeABaseURL&&"#"==s){c.scheme=i.scheme,c.path=d(i.path),c.query=i.query,c.fragment="",c.cannotBeABaseURL=!0,h=Oe;break}h="file"==i.scheme?Se:_e;continue;case fe:if("/"!=s||"/"!=n[m+1]){h=_e;continue}h=ve,m++;break;case ge:if("/"==s){h=Ee;break}h=Re;continue;case _e:if(c.scheme=i.scheme,s==e)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=d(i.path),c.query=i.query;else if("/"==s||"\\"==s&&c.isSpecial())h=ye;else if("?"==s)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=d(i.path),c.query="",h=De;else{if("#"!=s){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=d(i.path),c.path.length--,h=Re;continue}c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=d(i.path),c.query=i.query,c.fragment="",h=Oe}break;case ye:if(!c.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,h=Re;continue}h=Ee}else h=ve;break;case Te:if(h=ve,"/"!=s||"/"!=A(f,m+1))continue;m++;break;case ve:if("/"!=s&&"\\"!=s){h=Ee;continue}break;case Ee:if("@"==s){_&&(f="%40"+f),_=!0,a=p(f);for(var v=0;v65535)return z;c.port=c.isSpecial()&&b===le[c.scheme]?null:b,f=""}if(r)return;h=Me;continue}return z}f+=s;break;case Se:if(c.scheme="file","/"==s||"\\"==s)h=we;else{if(!i||"file"!=i.scheme){h=Re;continue}if(s==e)c.host=i.host,c.path=d(i.path),c.query=i.query;else if("?"==s)c.host=i.host,c.path=d(i.path),c.query="",h=De;else{if("#"!=s){ue(O(d(n,m),""))||(c.host=i.host,c.path=d(i.path),c.shortenPath()),h=Re;continue}c.host=i.host,c.path=d(i.path),c.query=i.query,c.fragment="",h=Oe}}break;case we:if("/"==s||"\\"==s){h=Ce;break}i&&"file"==i.scheme&&!ue(O(d(n,m),""))&&(ce(i.path[0],!0)?N(c.path,i.path[0]):c.host=i.host),h=Re;continue;case Ce:if(s==e||"/"==s||"\\"==s||"?"==s||"#"==s){if(!r&&ce(f))h=Re;else if(""==f){if(c.host="",r)return;h=Me}else{if(o=c.parseHost(f))return o;if("localhost"==c.host&&(c.host=""),r)return;f="",h=Me}continue}f+=s;break;case Me:if(c.isSpecial()){if(h=Re,"/"!=s&&"\\"!=s)continue}else if(r||"?"!=s)if(r||"#"!=s){if(s!=e&&(h=Re,"/"!=s))continue}else c.fragment="",h=Oe;else c.query="",h=De;break;case Re:if(s==e||"/"==s||"\\"==s&&c.isSpecial()||!r&&("?"==s||"#"==s)){if(".."===(l=G(l=f))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"==s||"\\"==s&&c.isSpecial()||N(c.path,"")):he(f)?"/"==s||"\\"==s&&c.isSpecial()||N(c.path,""):("file"==c.scheme&&!c.path.length&&ce(f)&&(c.host&&(c.host=""),f=A(f,0)+":"),N(c.path,f)),f="","file"==c.scheme&&(s==e||"?"==s||"#"==s))for(;c.path.length>1&&""===c.path[0];)U(c.path);"?"==s?(c.query="",h=De):"#"==s&&(c.fragment="",h=Oe)}else f+=oe(s,se);break;case Ae:"?"==s?(c.query="",h=De):"#"==s?(c.fragment="",h=Oe):s!=e&&(c.path[0]+=oe(s,ie));break;case De:r||"#"!=s?s!=e&&("'"==s&&c.isSpecial()?c.query+="%27":c.query+="#"==s?"%23":oe(s,ie)):(c.fragment="",h=Oe);break;case Oe:s!=e&&(c.fragment+=oe(s,ne))}m++}}, // https://url.spec.whatwg.org/#host-parsing parseHost:function(e){var t,r,i;if("["==A(e,0)){if("]"!=A(e,e.length-1))return j;if(t=function(e){var t,r,i,n,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,p=function(){return A(e,h)};if(":"==p()){if(":"!=A(e,1))return;h+=2,u=++c}for(;p();){if(8==c)return;if(":"!=p()){for(t=r=0;r<4&&D(Z,p());)t=16*t+C(p(),16),h++,r++;if("."==p()){if(0==r)return;if(h-=r,c>6)return;for(i=0;p();){if(n=null,i>0){if(!("."==p()&&i<4))return;h++}if(!D(Y,p()))return;for(;D(Y,p());){if(s=C(p(),10),null===n)n=s;else{if(0==n)return;n=10*n+s}if(n>255)return;h++}l[c]=256*l[c]+n,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==p()){if(h++,!p())return}else if(p())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!=c)return;return l}(k(e,1,-1)),!t)return j;this.host=t}else if(this.isSpecial()){if(e=f(e),D(K,e))return j;if(t=function(e){var t,r,i,n,s,a,o,l=B(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],i=0;i1&&"0"==A(n,0)&&(s=D(X,n)?16:8,n=k(n,8==s?1:2)),""===n)a=0;else{if(!D(10==s?$:8==s?J:Z,n))return e;a=C(n,s)}N(r,a)}for(i=0;i=R(256,5-t))return null}else if(a>255)return null;for(o=P(r),i=0;i1?arguments[1]:void 0,n=E(t,new Le(e,!1,i));r||(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())},Ue=Fe.prototype,Be=function(e,t){return{get:function(){return I(this)[e]()},set:t&&function(e){return I(this)[t](e)},configurable:!0,enumerable:!0}};r&&(l(Ue,"href",Be("serialize","setHref")),l(Ue,"origin",Be("getOrigin")),l(Ue,"protocol",Be("getProtocol","setProtocol")),l(Ue,"username",Be("getUsername","setUsername")),l(Ue,"password",Be("getPassword","setPassword")),l(Ue,"host",Be("getHost","setHost")),l(Ue,"hostname",Be("getHostname","setHostname")),l(Ue,"port",Be("getPort","setPort")),l(Ue,"pathname",Be("getPathname","setPathname")),l(Ue,"search",Be("getSearch","setSearch")),l(Ue,"searchParams",Be("getSearchParams")),l(Ue,"hash",Be("getHash","setHash"))),o(Ue,"toJSON",(function(){return I(this).serialize()}),{enumerable:!0}),o(Ue,"toString",(function(){return I(this).serialize()}),{enumerable:!0}),S&&(Pe=S.createObjectURL,Ne=S.revokeObjectURL,Pe&&o(Fe,"createObjectURL",s(Pe,S)),Ne&&o(Fe,"revokeObjectURL",s(Ne,S))),_(Fe,"URL"),t({global:!0,constructor:!0,forced:!i,sham:!r},{URL:Fe})}}),require_web_url=__commonJS({"node_modules/core-js/modules/web.url.js"(){require_web_url_constructor()}}),require_web_url_to_json=__commonJS({"node_modules/core-js/modules/web.url.to-json.js"(){"use strict";var e=require_export(),t=require_function_call();e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return t(URL.prototype.toString,this)}})}}),require_web_url_search_params=__commonJS({"node_modules/core-js/modules/web.url-search-params.js"(){require_web_url_search_params_constructor()}}),require_stable=__commonJS({"node_modules/core-js/stable/index.js"(e,t){require_es_symbol(),require_es_symbol_description(),require_es_symbol_async_iterator(),require_es_symbol_has_instance(),require_es_symbol_is_concat_spreadable(),require_es_symbol_iterator(),require_es_symbol_match(),require_es_symbol_match_all(),require_es_symbol_replace(),require_es_symbol_search(),require_es_symbol_species(),require_es_symbol_split(),require_es_symbol_to_primitive(),require_es_symbol_to_string_tag(),require_es_symbol_unscopables(),require_es_error_cause(),require_es_error_to_string(),require_es_aggregate_error(),require_es_aggregate_error_cause(),require_es_array_at(),require_es_array_concat(),require_es_array_copy_within(),require_es_array_every(),require_es_array_fill(),require_es_array_filter(),require_es_array_find(),require_es_array_find_index(),require_es_array_find_last(),require_es_array_find_last_index(),require_es_array_flat(),require_es_array_flat_map(),require_es_array_for_each(),require_es_array_from(),require_es_array_includes(),require_es_array_index_of(),require_es_array_is_array(),require_es_array_iterator(),require_es_array_join(),require_es_array_last_index_of(),require_es_array_map(),require_es_array_of(),require_es_array_push(),require_es_array_reduce(),require_es_array_reduce_right(),require_es_array_reverse(),require_es_array_slice(),require_es_array_some(),require_es_array_sort(),require_es_array_species(),require_es_array_splice(),require_es_array_unscopables_flat(),require_es_array_unscopables_flat_map(),require_es_array_unshift(),require_es_array_buffer_constructor(),require_es_array_buffer_is_view(),require_es_array_buffer_slice(),require_es_data_view(),require_es_date_get_year(),require_es_date_now(),require_es_date_set_year(),require_es_date_to_gmt_string(),require_es_date_to_iso_string(),require_es_date_to_json(),require_es_date_to_primitive(),require_es_date_to_string(),require_es_escape(),require_es_function_bind(),require_es_function_has_instance(),require_es_function_name(),require_es_global_this(),require_es_json_stringify(),require_es_json_to_string_tag(),require_es_map(),require_es_math_acosh(),require_es_math_asinh(),require_es_math_atanh(),require_es_math_cbrt(),require_es_math_clz32(),require_es_math_cosh(),require_es_math_expm1(),require_es_math_fround(),require_es_math_hypot(),require_es_math_imul(),require_es_math_log10(),require_es_math_log1p(),require_es_math_log2(),require_es_math_sign(),require_es_math_sinh(),require_es_math_tanh(),require_es_math_to_string_tag(),require_es_math_trunc(),require_es_number_constructor(),require_es_number_epsilon(),require_es_number_is_finite(),require_es_number_is_integer(),require_es_number_is_nan(),require_es_number_is_safe_integer(),require_es_number_max_safe_integer(),require_es_number_min_safe_integer(),require_es_number_parse_float(),require_es_number_parse_int(),require_es_number_to_exponential(),require_es_number_to_fixed(),require_es_number_to_precision(),require_es_object_assign(),require_es_object_create(),require_es_object_define_getter(),require_es_object_define_properties(),require_es_object_define_property(),require_es_object_define_setter(),require_es_object_entries(),require_es_object_freeze(),require_es_object_from_entries(),require_es_object_get_own_property_descriptor(),require_es_object_get_own_property_descriptors(),require_es_object_get_own_property_names(),require_es_object_get_prototype_of(),require_es_object_has_own(),require_es_object_is(),require_es_object_is_extensible(),require_es_object_is_frozen(),require_es_object_is_sealed(),require_es_object_keys(),require_es_object_lookup_getter(),require_es_object_lookup_setter(),require_es_object_prevent_extensions(),require_es_object_proto(),require_es_object_seal(),require_es_object_set_prototype_of(),require_es_object_to_string(),require_es_object_values(),require_es_parse_float(),require_es_parse_int(),require_es_promise(),require_es_promise_all_settled(),require_es_promise_any(),require_es_promise_finally(),require_es_reflect_apply(),require_es_reflect_construct(),require_es_reflect_define_property(),require_es_reflect_delete_property(),require_es_reflect_get(),require_es_reflect_get_own_property_descriptor(),require_es_reflect_get_prototype_of(),require_es_reflect_has(),require_es_reflect_is_extensible(),require_es_reflect_own_keys(),require_es_reflect_prevent_extensions(),require_es_reflect_set(),require_es_reflect_set_prototype_of(),require_es_reflect_to_string_tag(),require_es_regexp_constructor(),require_es_regexp_dot_all(),require_es_regexp_exec(),require_es_regexp_flags(),require_es_regexp_sticky(),require_es_regexp_test(),require_es_regexp_to_string(),require_es_set(),require_es_string_at_alternative(),require_es_string_code_point_at(),require_es_string_ends_with(),require_es_string_from_code_point(),require_es_string_includes(),require_es_string_iterator(),require_es_string_match(),require_es_string_match_all(),require_es_string_pad_end(),require_es_string_pad_start(),require_es_string_raw(),require_es_string_repeat(),require_es_string_replace(),require_es_string_replace_all(),require_es_string_search(),require_es_string_split(),require_es_string_starts_with(),require_es_string_substr(),require_es_string_trim(),require_es_string_trim_end(),require_es_string_trim_start(),require_es_string_anchor(),require_es_string_big(),require_es_string_blink(),require_es_string_bold(),require_es_string_fixed(),require_es_string_fontcolor(),require_es_string_fontsize(),require_es_string_italics(),require_es_string_link(),require_es_string_small(),require_es_string_strike(),require_es_string_sub(),require_es_string_sup(),require_es_typed_array_float32_array(),require_es_typed_array_float64_array(),require_es_typed_array_int8_array(),require_es_typed_array_int16_array(),require_es_typed_array_int32_array(),require_es_typed_array_uint8_array(),require_es_typed_array_uint8_clamped_array(),require_es_typed_array_uint16_array(),require_es_typed_array_uint32_array(),require_es_typed_array_at(),require_es_typed_array_copy_within(),require_es_typed_array_every(),require_es_typed_array_fill(),require_es_typed_array_filter(),require_es_typed_array_find(),require_es_typed_array_find_index(),require_es_typed_array_find_last(),require_es_typed_array_find_last_index(),require_es_typed_array_for_each(),require_es_typed_array_from(),require_es_typed_array_includes(),require_es_typed_array_index_of(),require_es_typed_array_iterator(),require_es_typed_array_join(),require_es_typed_array_last_index_of(),require_es_typed_array_map(),require_es_typed_array_of(),require_es_typed_array_reduce(),require_es_typed_array_reduce_right(),require_es_typed_array_reverse(),require_es_typed_array_set(),require_es_typed_array_slice(),require_es_typed_array_some(),require_es_typed_array_sort(),require_es_typed_array_subarray(),require_es_typed_array_to_locale_string(),require_es_typed_array_to_string(),require_es_unescape(),require_es_weak_map(),require_es_weak_set(),require_web_atob(),require_web_btoa(),require_web_dom_collections_for_each(),require_web_dom_collections_iterator(),require_web_dom_exception_constructor(),require_web_dom_exception_stack(),require_web_dom_exception_to_string_tag(),require_web_immediate(),require_web_queue_microtask(),require_web_self(),require_web_structured_clone(),require_web_timers(),require_web_url(),require_web_url_to_json(),require_web_url_search_params(),t.exports=require_path()}}),require_runtime=__commonJS({"node_modules/regenerator-runtime/runtime.js"(e,t){var r=function(e){"use strict";var t,r=Object.prototype,i=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},s=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var n=t&&t.prototype instanceof g?t:g,s=Object.create(n.prototype),a=new M(i||[]);return s._invoke=function(e,t,r){var i=h;return function(n,s){if(i===d)throw new Error("Generator is already running");if(i===m){if("throw"===n)throw s;return A()}for(r.method=n,r.arg=s;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===f)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var l=u(e,t,r);if("normal"===l.type){if(i=r.done?m:p,l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=m,r.method="throw",r.arg=l.arg)}}}(e,r,a),s}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",f={};function g(){}function _(){}function y(){}var T={};l(T,s,(function(){return this}));var v=Object.getPrototypeOf,E=v&&v(v(R([])));E&&E!==r&&i.call(E,s)&&(T=E);var I=y.prototype=g.prototype=Object.create(T);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(n,s,a,o){var l=u(e[n],e,s);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(l.arg)}var n;this._invoke=function(e,i){function s(){return new t((function(t,n){r(e,i,t,n)}))}return n=// If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. n?n.then(s, // Avoid propagating failures to Promises returned by later // invocations of the iterator. s):s()}}function S(e,r){var i=e.iterator[r.method];if(i===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(i,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;var s=n.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,f):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function w(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function R(e){if(e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var n=i.arg;C(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:R(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),f}},e}( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. "object"==typeof t?t.exports:{});try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}}),require_loglevel=__commonJS({"node_modules/loglevel/lib/loglevel.js"(e,t){!function(e,r){"use strict";"function"==typeof define&&define.amd?define(r):"object"==typeof t&&t.exports?t.exports=r():e.log=r()}(e,(function(){"use strict";var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function n(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[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(i){return"debug"===i&&(i="log"),typeof console!==t&&("trace"===i&&r?s:void 0!==console[i]?n(console,i):void 0!==console.log?n(console,"log"):e)}function o(t,r){for(var n=0;n=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(s=r,!1!==n&&function(e){var r=(i[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}}(r),o.call(a,r,e),typeof console===t&&rt?1:e0))break;if(null===t.right)break;if(r(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,r,n){var a=new i(e,t);if(null===r)return a.left=a.right=null,a;var o=n(e,(r=s(e,r,n)).key);return o<0?(a.left=r.left,a.right=r,r.left=null):o>=0&&(a.right=r.right,a.left=r,r.right=null),a}function o(e,t,r){var i=null,n=null;if(t){var a=r((t=s(e,t,r)).key,e);0===a?(i=t.left,n=t.right):a<0?(n=t.right,t.right=null,i=t):(i=t.left,t.left=null,n=t)}return{left:i,right:n}}function l(e,t,r,i,n){if(e){i(t+(r?"└── ":"├── ")+n(e)+"\n");var s=t+(r?" ":"│ ");e.left&&l(e.left,s,!1,i,n),e.right&&l(e.right,s,!0,i,n)}}var c= /** @class */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 r=new i(e,t);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var n=this._comparator,a=s(e,this._root,n),o=n(e,a.key);return 0===o?this._root=a:(o<0?(r.left=a.left,r.right=a,a.left=null):o>0&&(r.right=a.right,r.left=a,a.right=null),this._size++,this._root=r),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,r){var i;return null===t?null:0===r(e,(t=s(e,t,r)).key)?(null===t.left?i=t.right:(i=s(e,t.left,r)).right=t.right,this._size--,i):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,r=this._comparator;t;){var i=r(e,t.key);if(0===i)return t;t=i<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,r=this._comparator;t;){var i=r(e,t.key);if(0===i)return!0;t=i<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var r=this._root,i=[],n=!1;!n;)null!==r?(i.push(r),r=r.left):0!==i.length?(r=i.pop(),e.call(t,r),r=r.right):n=!0;return this},e.prototype.range=function(e,t,r,i){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&&r.call(i,a))return this;a=a.right}return this},e.prototype.keys=function(){var e=[];return this.forEach((function(t){var r=t.key;return e.push(r)})),e},e.prototype.values=function(){var e=[];return this.forEach((function(t){var r=t.data;return e.push(r)})),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,r=!1,i=0,n=[];!r;)if(t)n.push(t),t=t.left;else if(n.length>0){if(t=n.pop(),i===e)return t;i++,t=t.right}else r=!0;return null},e.prototype.next=function(e){var t=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var i=this._comparator;t;){var n=i(e.key,t.key);if(0===n)break;n<0?(r=t,t=t.left):t=t.right}return r},e.prototype.prev=function(e){var t=this._root,r=null;if(null!==e.left){for(r=e.left;r.right;)r=r.right;return r}for(var i=this._comparator;t;){var n=i(e.key,t.key);if(0===n)break;n<0?t=t.left:(r=t,t=t.right)}return r},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return function(e){for(var t=e,r=[],n=!1,s=new i(null,null),a=s;!n;)t?(r.push(t),t=t.left):r.length>0?t=(t=a=a.next=r.pop()).right:n=!0;return a.next=null,s.next}(this._root)},e.prototype.load=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=!1);var n=e.length,s=this._comparator;if(r&&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,r){for(var n=new i(null,null),s=n,a=e,o=t;null!==a&&null!==o;)r(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 r=new i(null,null),n=r,s=0;s0){var a=r+Math.floor(s/2),o=e[a],l=t[a],c=new i(o,l);return c.left=u(e,t,r,a),c.right=u(e,t,a+1,n),c}return null}function h(e,t,r){var i=r-t;if(i>0){var n=t+Math.floor(i/2),s=h(e,t,n),a=e.head;return a.left=s,e.head=e.head.next,a.right=h(e,n+1,r),a}return null}function p(e,t,r,i,n){if(!(r>=i)){for(var s=e[r+i>>1],a=r-1,o=i+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,r,o,n),p(e,t,o+1,i,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},m=function(e,t){if(t.ur.xt.x?1:e.yt.y?1:0} // Warning: 'point' input will be modified and re-used (for performance) }]),r(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,r=0,i=t.length;r=0&&l>=0?ac?-1:0:s<0&&l<0?ac?1:0:ls?1:0}}}]),t}(),R=0,A=function(){function t(r,i,n,s){e(this,t),this.id=++R,this.leftSE=r,r.segment=this,r.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=r,this.rings=n,this.windings=s}return r(t,null,[{key:"compare", /* This compare() function is for ordering segments in the sweep * line tree, and does so according to the following criteria: * * Consider the vertical line that lies an infinestimal step to the * right of the right-more of the two left endpoints of the input * segments. Imagine slowly moving a point up from negative infinity * in the increasing y direction. Which of the two segments will that * point intersect first? That segment comes 'before' the other one. * * If neither segment would be intersected by such a line, (if one * or more of the segments are vertical) then the line to be considered * is directly on the right-more of the two left inputs. */ value:function(e,t){var r=e.leftSE.point.x,i=t.leftSE.point.x,n=e.rightSE.point.x,s=t.rightSE.point.x;if(sa&&o>l)return-1;var u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return-1;var h=t.comparePoint(e.rightSE.point);return 0!==h?h:-1}if(r>i){if(ao&&a>c)return 1;var p=t.comparePoint(e.leftSE.point);if(0!==p)return p;var d=e.comparePoint(t.rightSE.point);return d<0?1:d>0?-1:1}if(ao)return 1;if(ns){var f=e.comparePoint(t.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(n!==s){var g=l-a,_=n-r,y=c-o,T=s-i;if(g>_&&yT)return-1}return n>s?1:nc?1:e.idt.id?1:0} /* Warning: a reference to ringWindings input will be stored, * and possibly will be later modified */}]),r(t,[{key:"replaceRightSE", /* When a segment is split, the rightSE is replaced with a new sweep event */ 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:et?e:t}}} /* A vector from the left point to the right */},{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} /* Compare this segment with a point. * * A point P is considered to be colinear to a segment if there * exists a distance D such that if we travel along the segment * from one * endpoint towards the other a distance D, we find * ourselves at point P. * * Return value indicates: * * 1: point lies above the segment (to the left of vertical) * 0: point is colinear to segment * -1: point lies below the segment (to the right of vertical) */},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(t.x===r.x)return e.x===t.x?0:e.x trivial * * endpoint of segA with point along segB --> non-trivial * * endpoint of segB with point along segA --> non-trivial * * point along segA with point along segB --> non-trivial * * If no non-trivial intersection exists, return null * Else, return null. */},{key:"getIntersection",value:function(e){var t=this.bbox(),r=e.bbox(),i=m(t,r);if(null===i)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),c=d(r,n)&&0===e.comparePoint(n),u=d(t,o)&&0===this.comparePoint(o),h=d(r,s)&&0===e.comparePoint(s);if(c&&l)return h&&!u?s:!h&&u?o:null;if(c)return u&&n.x===o.x&&n.y===o.y?null:n;if(l)return h&&s.x===a.x&&s.y===a.y?null:a;if(h&&u)return null;if(h)return s;if(u)return o;var p=function(e,t,r,i){if(0===t.x)return C(r,i,e.x);if(0===i.x)return C(e,t,r.x);if(0===t.y)return w(r,i,e.y);if(0===i.y)return w(e,t,r.y);var n=E(t,i);if(0==n)return null;var s={x:r.x-e.x,y:r.y-e.y},a=E(s,t)/n,o=E(s,i)/n;return{x:(e.x+o*t.x+(r.x+a*i.x))/2,y:(e.y+o*t.y+(r.y+a*i.y))/2}}(n,this.vector(),a,e.vector());return null===p?null:d(i,p)?v.round(p.x,p.y):null} /** * Split the given segment into multiple segments on the given points. * * Each existing segment will retain its leftSE and a new rightSE will be * generated for it. * * A new segment will be generated which will adopt the original segment's * rightSE, and a new leftSE will be generated for it. * * If there are more than two points given to split on, new segments * in the middle will be generated with new leftSE and rightSE's. * * An array of the newly generated SweepEvents will be returned. * * Warning: input array of points is modified */},{key:"split",value:function(e){var r=[],i=void 0!==e.events,n=new M(e,!0),s=new M(e,!1),a=this.rightSE;this.replaceRightSE(s),r.push(s),r.push(n);var o=new t(n,a,this.rings.slice(),this.windings.slice());return M.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),M.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(n.checkForConsuming(),s.checkForConsuming()),r} /* Swap which event is left and right */},{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,r=this.windings.length;t0){var s=r;r=i,i=s}if(r.prev===i){var a=r;r=i,i=a}for(var o=0,l=i.rings.length;o0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=r,s=e,a=-1}return new t(new M(n,!0),new M(s,!1),[i],[a])}}]),t}(),D=function(){function t(r,i,n){if(e(this,t),!Array.isArray(r)||0===r.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof r[0][0]||"number"!=typeof r[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=v.round(r[0][0],r[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=r.length;othis.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),a=c)}s.x===a.x&&s.y===a.y||this.segments.push(A.fromRing(a,s,this))}return r(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,r=this.segments.length;tthis.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=i}return r(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,r=this.interiorRings.length;tthis.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=i}return r(t,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,r=this.polys.length;t0&&(e=i)}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}(),N=function(){function t(r){e(this,t),this.exteriorRing=r,r.poly=this,this.interiorRings=[]}return r(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,r=this.interiorRings.length;t1&&void 0!==arguments[1]?arguments[1]:A.compare;e(this,t),this.queue=r,this.tree=new c(i),this.segments=[]}return r(t,[{key:"process",value:function(e){var t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),r;var i=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!i)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=i,s=i,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 c=a.getIntersection(t);if(null!==c&&(t.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c)))for(var u=this._splitSafely(a,c),h=0,p=u.length;h0?(this.tree.remove(t),r.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&o){var I=a.getIntersection(o);if(null!==I){if(!a.isAnEndpoint(I))for(var b=this._splitSafely(a,I),x=0,S=b.length;xB)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var I=new U(f),b=f.size,x=f.pop();x;){var S=x.key;if(f.size===b){var w=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(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(I.segments.length>k)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=I.process(S),R=0,A=C.length;R1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?(i=r.x,n=r.y):o>0&&(i+=s*o,n+=a*o)}return(s=e.x-i)*s+(a=e.y-n)*a}function r(t,i,n,s,a){for(var o,l=s,c=i+1;cl&&(o=c,l=u)}l>s&&(o-i>1&&r(t,i,o,s,a),a.push(t[o]),n-o>1&&r(t,o,n,s,a))}function i(e,t){var i=e.length-1,n=[e[0]];return r(e,0,i,t,n),n.push(e[i]),n}function n(e,t,r){if(e.length<=2)return e;var n=void 0!==t?t*t:1;return e=r?e:function(e,t){for(var r,i,n,s,a,o=e[0],l=[o],c=1,u=e.length;ct&&(l.push(r),o=r);return o!==r&&l.push(r),l}(e,n),e=i(e,n)}"function"==typeof define&&define.amd?define((function(){return n})):void 0!==t?(t.exports=n,t.exports.default=n):"undefined"!=typeof self?self.simplify=n:window.simplify=n}()}}),require_lodash=__commonJS({"node_modules/lodash/lodash.js"(e,t){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",a=16,o=32,l=64,c=128,u=256,h=1/0,p=9007199254740991,d=NaN,m=4294967295,f=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",o],["partialRight",l],["rearg",u]],g="[object Arguments]",_="[object Array]",y="[object Boolean]",T="[object Date]",v="[object Error]",E="[object Function]",I="[object GeneratorFunction]",b="[object Map]",x="[object Number]",S="[object Object]",w="[object Promise]",C="[object RegExp]",M="[object Set]",R="[object String]",A="[object Symbol]",D="[object WeakMap]",O="[object ArrayBuffer]",L="[object DataView]",P="[object Float32Array]",N="[object Float64Array]",F="[object Int8Array]",U="[object Int16Array]",B="[object Int32Array]",k="[object Uint8Array]",G="[object Uint8ClampedArray]",V="[object Uint16Array]",H="[object Uint32Array]",j=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,X=RegExp(W.source),J=RegExp(Y.source),$=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(re.source),ne=/^\s+/,se=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,Te=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Ie="\\ud800-\\udfff",be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",we="A-Z\\xc0-\\xd6\\xd8-\\xde",Ce="\\ufe0e\\ufe0f",Me="\\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",Re="['’]",Ae="["+Ie+"]",De="["+Me+"]",Oe="["+be+"]",Le="\\d+",Pe="["+xe+"]",Ne="["+Se+"]",Fe="[^"+Ie+Me+Le+xe+Se+we+"]",Ue="\\ud83c[\\udffb-\\udfff]",Be="[^"+Ie+"]",ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Ge="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+we+"]",He="\\u200d",je="(?:"+Ne+"|"+Fe+")",ze="(?:"+Ve+"|"+Fe+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Oe+"|"+Ue+")"+"?",Xe="["+Ce+"]?",Je=Xe+Ye+("(?:"+He+"(?:"+[Be,ke,Ge].join("|")+")"+Xe+Ye+")*"),$e="(?:"+[Pe,ke,Ge].join("|")+")"+Je,Ze="(?:"+[Be+Oe+"?",Oe,ke,Ge,Ae].join("|")+")",Ke=RegExp(Re,"g"),Qe=RegExp(Oe,"g"),et=RegExp(Ue+"(?="+Ue+")|"+Ze+Je,"g"),tt=RegExp([Ve+"?"+Ne+"+"+qe+"(?="+[De,Ve,"$"].join("|")+")",ze+"+"+We+"(?="+[De,Ve+je,"$"].join("|")+")",Ve+"?"+je+"+"+qe,Ve+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,$e].join("|"),"g"),rt=RegExp("["+He+Ie+be+Ce+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["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"],st=-1,at={};at[P]=at[N]=at[F]=at[U]=at[B]=at[k]=at[G]=at[V]=at[H]=!0,at[g]=at[_]=at[O]=at[y]=at[L]=at[T]=at[v]=at[E]=at[b]=at[x]=at[S]=at[C]=at[M]=at[R]=at[D]=!1;var ot={};ot[g]=ot[_]=ot[O]=ot[L]=ot[y]=ot[T]=ot[P]=ot[N]=ot[F]=ot[U]=ot[B]=ot[b]=ot[x]=ot[S]=ot[C]=ot[M]=ot[R]=ot[A]=ot[k]=ot[G]=ot[V]=ot[H]=!0,ot[v]=ot[E]=ot[D]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ut=parseInt,ht="object"==typeof global&&global&&global.Object===Object&&global,pt="object"==typeof self&&self&&self.Object===Object&&self,dt=ht||pt||Function("return this")(),mt="object"==typeof e&&e&&!e.nodeType&&e,ft=mt&&"object"==typeof t&&t&&!t.nodeType&&t,gt=ft&&ft.exports===mt,_t=gt&&ht.process,yt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),Tt=yt&&yt.isArrayBuffer,vt=yt&&yt.isDate,Et=yt&&yt.isMap,It=yt&&yt.isRegExp,bt=yt&&yt.isSet,xt=yt&&yt.isTypedArray;function St(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function wt(e,t,r,i){for(var n=-1,s=null==e?0:e.length;++n-1}function Ot(e,t,r){for(var i=-1,n=null==e?0:e.length;++i-1;);return r}function tr(e,t){for(var r=e.length;r--&&Vt(t,e[r],0)>-1;);return r}function rr(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}var ir=Wt({ // Latin-1 Supplement block. "À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss", // Latin Extended-A block. "Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(e){return"\\"+lt[e]}function ar(e){return rt.test(e)}function or(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,i=e.length,n=0,a=[];++r",""":'"',"'":"'"});var fr=function e(t){var se,Ie=(t=null==t?dt:fr.defaults(dt.Object(),t,fr.pick(dt,nt))).Array,be=t.Date,xe=t.Error,Se=t.Function,we=t.Math,Ce=t.Object,Me=t.RegExp,Re=t.String,Ae=t.TypeError,De=Ie.prototype,Oe=Se.prototype,Le=Ce.prototype,Pe=t["__core-js_shared__"],Ne=Oe.toString,Fe=Le.hasOwnProperty,Ue=0,Be=(se=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+se:"",ke=Le.toString,Ge=Ne.call(Ce),Ve=dt._,He=Me("^"+Ne.call(Fe).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=gt?t.Buffer:r,ze=t.Symbol,qe=t.Uint8Array,We=je?je.allocUnsafe:r,Ye=lr(Ce.getPrototypeOf,Ce),Xe=Ce.create,Je=Le.propertyIsEnumerable,$e=De.splice,Ze=ze?ze.isConcatSpreadable:r,et=ze?ze.iterator:r,rt=ze?ze.toStringTag:r,lt=function(){try{var e=ps(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),ht=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,pt=be&&be.now!==dt.Date.now&&be.now,mt=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=we.ceil,_t=we.floor,yt=Ce.getOwnPropertySymbols,Bt=je?je.isBuffer:r,Wt=t.isFinite,gr=De.join,_r=lr(Ce.keys,Ce),yr=we.max,Tr=we.min,vr=be.now,Er=t.parseInt,Ir=we.random,br=De.reverse,xr=ps(t,"DataView"),Sr=ps(t,"Map"),wr=ps(t,"Promise"),Cr=ps(t,"Set"),Mr=ps(t,"WeakMap"),Rr=ps(Ce,"create"),Ar=Mr&&new Mr,Dr={},Or=Hs(xr),Lr=Hs(Sr),Pr=Hs(wr),Nr=Hs(Cr),Fr=Hs(Mr),Ur=ze?ze.prototype:r,Br=Ur?Ur.valueOf:r,kr=Ur?Ur.toString:r;function Gr(e){if(so(e)&&!Xa(e)&&!(e instanceof zr)){if(e instanceof jr)return e;if(Fe.call(e,"__wrapped__"))return js(e)}return new jr(e)}var Vr=function(){function e(){}return function(t){if(!no(t))return{};if(Xe)return Xe(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function Hr(){}function jr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function li(e,t,i,n,s,a){var o,l=1&t,c=2&t,u=4&t;if(i&&(o=s?i(e,n,s,a):i(e)),o!==r)return o;if(!no(e))return e;var h=Xa(e);if(h){if(o=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Fe.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return An(e,o)}else{var p=fs(e),d=p==E||p==I;if(Ka(e))return xn(e,l);if(p==S||p==g||d&&!s){if(o=c||d?{}:_s(e),!l)return c?function(e,t){return Dn(e,ms(e),t)}(e,function(e,t){return e&&Dn(t,Uo(t),e)}(o,e)):function(e,t){return Dn(e,ds(e),t)}(e,ni(o,e))}else{if(!ot[p])return s?e:{};o=function(e,t,r){var i=e.constructor;switch(t){case O:return Sn(e);case y:case T:return new i(+e);case L:return function(e,t){var r=t?Sn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case N:case F:case U:case B:case k:case G:case V:case H:return wn(e,r);case b:return new i;case x:case R:return new i(e);case C:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new i;case A:return n=e,Br?Ce(Br.call(n)):{}}var n}(e,p,l)}}a||(a=new Jr);var m=a.get(e);if(m)return m;a.set(e,o),uo(e)?e.forEach((function(r){o.add(li(r,t,i,r,e,a))})):ao(e)&&e.forEach((function(r,n){o.set(n,li(r,t,i,n,e,a))}));var f=h?r:(u?c?ss:ns:c?Uo:Fo)(e);return Ct(f||e,(function(r,n){f&&(r=e[n=r]),ti(o,n,li(r,t,i,n,e,a))})),o}function ci(e,t,i){var n=i.length;if(null==e)return!n;for(e=Ce(e);n--;){var s=i[n],a=t[s],o=e[s];if(o===r&&!(s in e)||!a(o))return!1}return!0}function ui(e,t,n){if("function"!=typeof e)throw new Ae(i);return Os((function(){e.apply(r,n)}),t)}function hi(e,t,r,i){var n=-1,s=Dt,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;r&&(t=Lt(t,Zt(r))),i?(s=Ot,a=!1):t.length>=200&&(s=Qt,a=!1,t=new Xr(t));e:for(;++n-1},Wr.prototype.set=function(e,t){var r=this.__data__,i=ri(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new qr,map:new(Sr||Wr),string:new qr}},Yr.prototype.delete=function(e){var t=us(this,e).delete(e);return this.size-=t?1:0,t},Yr.prototype.get=function(e){return us(this,e).get(e)},Yr.prototype.has=function(e){return us(this,e).has(e)},Yr.prototype.set=function(e,t){var r=us(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},Xr.prototype.add=Xr.prototype.push=function(e){return this.__data__.set(e,n),this},Xr.prototype.has=function(e){return this.__data__.has(e)},Jr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Jr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Jr.prototype.get=function(e){return this.__data__.get(e)},Jr.prototype.has=function(e){return this.__data__.has(e)},Jr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!Sr||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Yr(i)}return r.set(e,t),this.size=r.size,this};var pi=Pn(vi),di=Pn(Ei,!0);function mi(e,t){var r=!0;return pi(e,(function(e,i,n){return r=!!t(e,i,n)})),r}function fi(e,t,i){for(var n=-1,s=e.length;++n0&&r(o)?t>1?_i(o,t-1,r,i,n):Pt(n,o):i||(n[n.length]=o)}return n}var yi=Nn(),Ti=Nn(!0);function vi(e,t){return e&&yi(e,t,Fo)}function Ei(e,t){return e&&Ti(e,t,Fo)}function Ii(e,t){return At(t,(function(t){return to(e[t])}))}function bi(e,t){for(var i=0,n=(t=vn(t,e)).length;null!=e&&it}function Ci(e,t){return null!=e&&Fe.call(e,t)}function Mi(e,t){return null!=e&&t in Ce(e)}function Ri(e,t,i){for(var n=i?Ot:Dt,s=e[0].length,a=e.length,o=a,l=Ie(a),c=1/0,u=[];o--;){var h=e[o];o&&t&&(h=Lt(h,Zt(t))),c=Tr(h.length,c),l[o]=!i&&(t||s>=120&&h.length>=120)?new Xr(o&&h):r}h=e[0];var p=-1,d=l[0];e:for(;++p=o?l:l*("desc"==r[i]?-1:1)}return e.index-t.index}(e,t,r)}))}function qi(e,t,r){for(var i=-1,n=t.length,s={};++i-1;)o!==e&&$e.call(o,l,1),$e.call(e,l,1);return e}function Yi(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==s){var s=n;Ts(n)?$e.call(e,n,1):pn(e,n)}}return e}function Xi(e,t){return e+_t(Ir()*(t-e+1))}function Ji(e,t){var r="";if(!e||t<1||t>p)return r;do{t%2&&(r+=e),(t=_t(t/2))&&(e+=e)}while(t);return r}function $i(e,t){return Ls(Cs(e,t,ll),e+"")}function Zi(e){return Zr(qo(e))}function Ki(e,t){var r=qo(e);return Fs(r,oi(t,0,r.length))}function Qi(e,t,i,n){if(!no(e))return e;for(var s=-1,a=(t=vn(t,e)).length,o=a-1,l=e;null!=l&&++sn?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var s=Ie(n);++i>>1,a=e[s];null!==a&&!po(a)&&(r?a<=t:a=200){var c=t?null:$n(e);if(c)return ur(c);a=!1,n=Qt,l=new Xr}else l=t?[]:o;e:for(;++i=n?e:nn(e,t,i)}var bn=ht||function(e){return dt.clearTimeout(e)};function xn(e,t){if(t)return e.slice();var r=e.length,i=We?We(r):new e.constructor(r);return e.copy(i),i}function Sn(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function wn(e,t){var r=t?Sn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Cn(e,t){if(e!==t){var i=e!==r,n=null===e,s=e==e,a=po(e),o=t!==r,l=null===t,c=t==t,u=po(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||n&&o&&c||!i&&c||!s)return 1;if(!n&&!a&&!u&&e1?i[s-1]:r,o=s>2?i[2]:r;for(a=e.length>3&&"function"==typeof a?(s--,a):r,o&&vs(i[0],i[1],o)&&(a=s<3?r:a,s=1),t=Ce(t);++n-1?s[a?t[o]:o]:r}}function Gn(e){return is((function(t){var n=t.length,s=n,a=jr.prototype.thru;for(e&&t.reverse();s--;){var o=t[s];if("function"!=typeof o)throw new Ae(i);if(a&&!l&&"wrapper"==os(o))var l=new jr([],!0)}for(s=l?s:n;++s1&&y.reverse(),p&&ul))return!1;var u=a.get(e),h=a.get(t);if(u&&h)return u==t&&h==e;var p=-1,d=!0,m=2&i?new Xr:r;for(a.set(e,t),a.set(t,e);++p-1&&e%1==0&&e1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return Ct(f,(function(r){var i="_."+r[0];t&r[1]&&!Dt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(le):[]}(i),r)))}function Ns(e){var t=0,i=0;return function(){var n=vr(),s=16-(n-i);if(i=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Fs(e,t){var i=-1,n=e.length,s=n-1;for(t=t===r?n:t;++i1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,ca(e,i)}));function ga(e){var t=Gr(e);return t.__chain__=!0,t}function _a(e,t){return t(e)}var ya=is((function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,s=function(t){return ai(t,e)};return!(t>1||this.__actions__.length)&&n instanceof zr&&Ts(i)?((n=n.slice(i,+i+(t?1:0))).__actions__.push({func:_a,args:[s],thisArg:r}),new jr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(s)}));var Ta=On((function(e,t,r){Fe.call(e,r)?++e[r]:si(e,r,1)}));var va=kn(Ys),Ea=kn(Xs);function Ia(e,t){return(Xa(e)?Ct:pi)(e,cs(t,3))}function ba(e,t){return(Xa(e)?Mt:di)(e,cs(t,3))}var xa=On((function(e,t,r){Fe.call(e,r)?e[r].push(t):si(e,r,[t])}));var Sa=$i((function(e,t,r){var i=-1,n="function"==typeof t,s=$a(e)?Ie(e.length):[];return pi(e,(function(e){s[++i]=n?St(t,e,r):Ai(e,t,r)})),s})),wa=On((function(e,t,r){si(e,r,t)}));function Ca(e,t){return(Xa(e)?Lt:ki)(e,cs(t,3))}var Ma=On((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ra=$i((function(e,t){if(null==e)return[];var r=t.length;return r>1&&vs(e,t[0],t[1])?t=[]:r>2&&vs(t[0],t[1],t[2])&&(t=[t[0]]),zi(e,_i(t,1),[])})),Aa=pt||function(){return dt.Date.now()};function Da(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,Kn(e,c,r,r,r,r,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Ae(i);return e=To(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var La=$i((function(e,t,r){var i=1;if(r.length){var n=cr(r,ls(La));i|=o}return Kn(e,i,t,r,n)})),Pa=$i((function(e,t,r){var i=3;if(r.length){var n=cr(r,ls(Pa));i|=o}return Kn(t,i,e,r,n)}));function Na(e,t,n){var s,a,o,l,c,u,h=0,p=!1,d=!1,m=!0;if("function"!=typeof e)throw new Ae(i);function f(t){var i=s,n=a;return s=a=r,h=t,l=e.apply(n,i)}function g(e){return h=e,c=Os(y,t),p?f(e):l}function _(e){var i=e-u;return u===r||i>=t||i<0||d&&e-h>=o}function y(){var e=Aa();if(_(e))return T(e);c=Os(y,function(e){var r=t-(e-u);return d?Tr(r,o-(e-h)):r}(e))}function T(e){return c=r,m&&s?f(e):(s=a=r,l)}function v(){var e=Aa(),i=_(e);if(s=arguments,a=this,u=e,i){if(c===r)return g(u);if(d)return bn(c),c=Os(y,t),f(u)}return c===r&&(c=Os(y,t)),l}return t=Eo(t)||0,no(n)&&(p=!!n.leading,o=(d="maxWait"in n)?yr(Eo(n.maxWait)||0,t):o,m="trailing"in n?!!n.trailing:m),v.cancel=function(){c!==r&&bn(c),h=0,s=u=a=c=r},v.flush=function(){return c===r?l:T(Aa())},v}var Fa=$i((function(e,t){return ui(e,1,t)})),Ua=$i((function(e,t,r){return ui(e,Eo(t)||0,r)}));function Ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(i);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=e.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(Ba.Cache||Yr),r}function ka(e){if("function"!=typeof e)throw new Ae(i);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)}}Ba.Cache=Yr;var Ga=En((function(e,t){var r=(t=1==t.length&&Xa(t[0])?Lt(t[0],Zt(cs())):Lt(_i(t,1),Zt(cs()))).length;return $i((function(i){for(var n=-1,s=Tr(i.length,r);++n=t})),Ya=Di(function(){return arguments}())?Di:function(e){return so(e)&&Fe.call(e,"callee")&&!Je.call(e,"callee")},Xa=Ie.isArray,Ja=Tt?Zt(Tt):function(e){return so(e)&&Si(e)==O};function $a(e){return null!=e&&io(e.length)&&!to(e)}function Za(e){return so(e)&&$a(e)}var Ka=Bt||El,Qa=vt?Zt(vt):function(e){return so(e)&&Si(e)==T};function eo(e){if(!so(e))return!1;var t=Si(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!lo(e)}function to(e){if(!no(e))return!1;var t=Si(e);return t==E||t==I||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ro(e){return"number"==typeof e&&e==To(e)}function io(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function no(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function so(e){return null!=e&&"object"==typeof e}var ao=Et?Zt(Et):function(e){return so(e)&&fs(e)==b};function oo(e){return"number"==typeof e||so(e)&&Si(e)==x}function lo(e){if(!so(e)||Si(e)!=S)return!1;var t=Ye(e);if(null===t)return!0;var r=Fe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ne.call(r)==Ge}var co=It?Zt(It):function(e){return so(e)&&Si(e)==C};var uo=bt?Zt(bt):function(e){return so(e)&&fs(e)==M};function ho(e){return"string"==typeof e||!Xa(e)&&so(e)&&Si(e)==R}function po(e){return"symbol"==typeof e||so(e)&&Si(e)==A}var mo=xt?Zt(xt):function(e){return so(e)&&io(e.length)&&!!at[Si(e)]};var fo=Yn(Bi),go=Yn((function(e,t){return e<=t}));function _o(e){if(!e)return[];if($a(e))return ho(e)?pr(e):An(e);if(et&&e[et])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[et]());var t=fs(e);return(t==b?or:t==M?ur:qo)(e)}function yo(e){return e?(e=Eo(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function To(e){var t=yo(e),r=t%1;return t==t?r?t-r:t:0}function vo(e){return e?oi(To(e),0,m):0}function Eo(e){if("number"==typeof e)return e;if(po(e))return d;if(no(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=no(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var r=fe.test(e);return r||_e.test(e)?ut(e.slice(2),r?2:8):me.test(e)?d:+e}function Io(e){return Dn(e,Uo(e))}function bo(e){return null==e?"":un(e)}var xo=Ln((function(e,t){if(xs(t)||$a(t))Dn(t,Fo(t),e);else for(var r in t)Fe.call(t,r)&&ti(e,r,t[r])})),So=Ln((function(e,t){Dn(t,Uo(t),e)})),wo=Ln((function(e,t,r,i){Dn(t,Uo(t),e,i)})),Co=Ln((function(e,t,r,i){Dn(t,Fo(t),e,i)})),Mo=is(ai);var Ro=$i((function(e,t){e=Ce(e);var i=-1,n=t.length,s=n>2?t[2]:r;for(s&&vs(t[0],t[1],s)&&(n=1);++i1),t})),Dn(e,ss(e),r),i&&(r=li(r,7,ts));for(var n=t.length;n--;)pn(r,t[n]);return r}));var Vo=is((function(e,t){return null==e?{}:function(e,t){return qi(e,t,(function(t,r){return Oo(e,r)}))}(e,t)}));function Ho(e,t){if(null==e)return{};var r=Lt(ss(e),(function(e){return[e]}));return t=cs(t),qi(e,r,(function(e,r){return t(e,r[0])}))}var jo=Zn(Fo),zo=Zn(Uo);function qo(e){return null==e?[]:Kt(e,Fo(e))}var Wo=Un((function(e,t,r){return t=t.toLowerCase(),e+(r?Yo(t):t)}));function Yo(e){return tl(bo(e).toLowerCase())}function Xo(e){return(e=bo(e))&&e.replace(Te,ir).replace(Qe,"")}var Jo=Un((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),$o=Un((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Zo=Fn("toLowerCase");var Ko=Un((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Qo=Un((function(e,t,r){return e+(r?" ":"")+tl(t)}));var el=Un((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),tl=Fn("toUpperCase");function rl(e,t,i){return e=bo(e),(t=i?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var il=$i((function(e,t){try{return St(e,r,t)}catch(e){return eo(e)?e:new xe(e)}})),nl=is((function(e,t){return Ct(t,(function(t){t=Vs(t),si(e,t,La(e[t],e))})),e}));function sl(e){return function(){return e}}var al=Gn(),ol=Gn(!0);function ll(e){return e}function cl(e){return Ni("function"==typeof e?e:li(e,1))}var ul=$i((function(e,t){return function(r){return Ai(r,e,t)}})),hl=$i((function(e,t){return function(r){return Ai(e,r,t)}}));function pl(e,t,r){var i=Fo(t),n=Ii(t,i);null!=r||no(t)&&(n.length||!i.length)||(r=t,t=e,e=this,n=Ii(t,Fo(t)));var s=!(no(r)&&"chain"in r&&!r.chain),a=to(e);return Ct(n,(function(r){var i=t[r];e[r]=i,a&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__),n=r.__actions__=An(this.__actions__);return n.push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,Pt([this.value()],arguments))})})),e}function dl(){}var ml=zn(Lt),fl=zn(Rt),gl=zn(Ut);function _l(e){return Es(e)?qt(Vs(e)):function(e){return function(t){return bi(t,e)}}(e)}var yl=Wn(),Tl=Wn(!0);function vl(){return[]}function El(){return!1}var Il=jn((function(e,t){return e+t}),0),bl=Jn("ceil"),xl=jn((function(e,t){return e/t}),1),Sl=Jn("floor");var wl,Cl=jn((function(e,t){return e*t}),1),Ml=Jn("round"),Rl=jn((function(e,t){return e-t}),0);return Gr.after=function(e,t){if("function"!=typeof t)throw new Ae(i);return e=To(e),function(){if(--e<1)return t.apply(this,arguments)}},Gr.ary=Da,Gr.assign=xo,Gr.assignIn=So,Gr.assignInWith=wo,Gr.assignWith=Co,Gr.at=Mo,Gr.before=Oa,Gr.bind=La,Gr.bindAll=nl,Gr.bindKey=Pa,Gr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Xa(e)?e:[e]},Gr.chain=ga,Gr.chunk=function(e,t,i){t=(i?vs(e,t,i):t===r)?1:yr(To(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var s=0,a=0,o=Ie(ft(n/t));ss?0:s+i),(n=n===r||n>s?s:To(n))<0&&(n+=s),n=i>n?0:vo(n);i>>0)?(e=bo(e))&&("string"==typeof t||null!=t&&!co(t))&&!(t=un(t))&&ar(e)?In(pr(e),0,i):e.split(t,i):[]},Gr.spread=function(e,t){if("function"!=typeof e)throw new Ae(i);return t=null==t?0:yr(To(t),0),$i((function(r){var i=r[t],n=In(r,0,t);return i&&Pt(n,i),St(e,this,n)}))},Gr.tail=function(e){var t=null==e?0:e.length;return t?nn(e,1,t):[]},Gr.take=function(e,t,i){return e&&e.length?nn(e,0,(t=i||t===r?1:To(t))<0?0:t):[]},Gr.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,(t=n-(t=i||t===r?1:To(t)))<0?0:t,n):[]},Gr.takeRightWhile=function(e,t){return e&&e.length?mn(e,cs(t,3),!1,!0):[]},Gr.takeWhile=function(e,t){return e&&e.length?mn(e,cs(t,3)):[]},Gr.tap=function(e,t){return t(e),e},Gr.throttle=function(e,t,r){var n=!0,s=!0;if("function"!=typeof e)throw new Ae(i);return no(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),Na(e,t,{leading:n,maxWait:t,trailing:s})},Gr.thru=_a,Gr.toArray=_o,Gr.toPairs=jo,Gr.toPairsIn=zo,Gr.toPath=function(e){return Xa(e)?Lt(e,Vs):po(e)?[e]:An(Gs(bo(e)))},Gr.toPlainObject=Io,Gr.transform=function(e,t,r){var i=Xa(e),n=i||Ka(e)||mo(e);if(t=cs(t,4),null==r){var s=e&&e.constructor;r=n?i?new s:[]:no(e)&&to(s)?Vr(Ye(e)):{}}return(n?Ct:vi)(e,(function(e,i,n){return t(r,e,i,n)})),r},Gr.unary=function(e){return Da(e,1)},Gr.union=sa,Gr.unionBy=aa,Gr.unionWith=oa,Gr.uniq=function(e){return e&&e.length?hn(e):[]},Gr.uniqBy=function(e,t){return e&&e.length?hn(e,cs(t,2)):[]},Gr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hn(e,r,t):[]},Gr.unset=function(e,t){return null==e||pn(e,t)},Gr.unzip=la,Gr.unzipWith=ca,Gr.update=function(e,t,r){return null==e?e:dn(e,t,Tn(r))},Gr.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:dn(e,t,Tn(i),n)},Gr.values=qo,Gr.valuesIn=function(e){return null==e?[]:Kt(e,Uo(e))},Gr.without=ua,Gr.words=rl,Gr.wrap=function(e,t){return Va(Tn(t),e)},Gr.xor=ha,Gr.xorBy=pa,Gr.xorWith=da,Gr.zip=ma,Gr.zipObject=function(e,t){return _n(e||[],t||[],ti)},Gr.zipObjectDeep=function(e,t){return _n(e||[],t||[],Qi)},Gr.zipWith=fa,Gr.entries=jo,Gr.entriesIn=zo,Gr.extend=So,Gr.extendWith=wo,pl(Gr,Gr),Gr.add=Il,Gr.attempt=il,Gr.camelCase=Wo,Gr.capitalize=Yo,Gr.ceil=bl,Gr.clamp=function(e,t,i){return i===r&&(i=t,t=r),i!==r&&(i=(i=Eo(i))==i?i:0),t!==r&&(t=(t=Eo(t))==t?t:0),oi(Eo(e),t,i)},Gr.clone=function(e){return li(e,4)},Gr.cloneDeep=function(e){return li(e,5)},Gr.cloneDeepWith=function(e,t){return li(e,5,t="function"==typeof t?t:r)},Gr.cloneWith=function(e,t){return li(e,4,t="function"==typeof t?t:r)},Gr.conformsTo=function(e,t){return null==t||ci(e,t,Fo(t))},Gr.deburr=Xo,Gr.defaultTo=function(e,t){return null==e||e!=e?t:e},Gr.divide=xl,Gr.endsWith=function(e,t,i){e=bo(e),t=un(t);var n=e.length,s=i=i===r?n:oi(To(i),0,n);return(i-=t.length)>=0&&e.slice(i,s)==t},Gr.eq=za,Gr.escape=function(e){return(e=bo(e))&&J.test(e)?e.replace(Y,nr):e},Gr.escapeRegExp=function(e){return(e=bo(e))&&ie.test(e)?e.replace(re,"\\$&"):e},Gr.every=function(e,t,i){var n=Xa(e)?Rt:mi;return i&&vs(e,t,i)&&(t=r),n(e,cs(t,3))},Gr.find=va,Gr.findIndex=Ys,Gr.findKey=function(e,t){return kt(e,cs(t,3),vi)},Gr.findLast=Ea,Gr.findLastIndex=Xs,Gr.findLastKey=function(e,t){return kt(e,cs(t,3),Ei)},Gr.floor=Sl,Gr.forEach=Ia,Gr.forEachRight=ba,Gr.forIn=function(e,t){return null==e?e:yi(e,cs(t,3),Uo)},Gr.forInRight=function(e,t){return null==e?e:Ti(e,cs(t,3),Uo)},Gr.forOwn=function(e,t){return e&&vi(e,cs(t,3))},Gr.forOwnRight=function(e,t){return e&&Ei(e,cs(t,3))},Gr.get=Do,Gr.gt=qa,Gr.gte=Wa,Gr.has=function(e,t){return null!=e&&gs(e,t,Ci)},Gr.hasIn=Oo,Gr.head=$s,Gr.identity=ll,Gr.includes=function(e,t,r,i){e=$a(e)?e:qo(e),r=r&&!i?To(r):0;var n=e.length;return r<0&&(r=yr(n+r,0)),ho(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&Vt(e,t,r)>-1},Gr.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:To(r);return n<0&&(n=yr(i+n,0)),Vt(e,t,n)},Gr.inRange=function(e,t,i){return t=yo(t),i===r?(i=t,t=0):i=yo(i),function(e,t,r){return e>=Tr(t,r)&&e=-9007199254740991&&e<=p},Gr.isSet=uo,Gr.isString=ho,Gr.isSymbol=po,Gr.isTypedArray=mo,Gr.isUndefined=function(e){return e===r},Gr.isWeakMap=function(e){return so(e)&&fs(e)==D},Gr.isWeakSet=function(e){return so(e)&&"[object WeakSet]"==Si(e)},Gr.join=function(e,t){return null==e?"":gr.call(e,t)},Gr.kebabCase=Jo,Gr.last=ea,Gr.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var s=n;return i!==r&&(s=(s=To(i))<0?yr(n+s,0):Tr(s,n-1)),t==t?function(e,t,r){for(var i=r+1;i--;)if(e[i]===t)return i;return i}(e,t,s):Gt(e,jt,s,!0)},Gr.lowerCase=$o,Gr.lowerFirst=Zo,Gr.lt=fo,Gr.lte=go,Gr.max=function(e){return e&&e.length?fi(e,ll,wi):r},Gr.maxBy=function(e,t){return e&&e.length?fi(e,cs(t,2),wi):r},Gr.mean=function(e){return zt(e,ll)},Gr.meanBy=function(e,t){return zt(e,cs(t,2))},Gr.min=function(e){return e&&e.length?fi(e,ll,Bi):r},Gr.minBy=function(e,t){return e&&e.length?fi(e,cs(t,2),Bi):r},Gr.stubArray=vl,Gr.stubFalse=El,Gr.stubObject=function(){return{}},Gr.stubString=function(){return""},Gr.stubTrue=function(){return!0},Gr.multiply=Cl,Gr.nth=function(e,t){return e&&e.length?ji(e,To(t)):r},Gr.noConflict=function(){return dt._===this&&(dt._=Ve),this},Gr.noop=dl,Gr.now=Aa,Gr.pad=function(e,t,r){e=bo(e);var i=(t=To(t))?hr(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return qn(_t(n),r)+e+qn(ft(n),r)},Gr.padEnd=function(e,t,r){e=bo(e);var i=(t=To(t))?hr(e):0;return t&&it){var n=e;e=t,t=n}if(i||e%1||t%1){var s=Ir();return Tr(e+s*(t-e+ct("1e-"+((s+"").length-1))),t)}return Xi(e,t)},Gr.reduce=function(e,t,r){var i=Xa(e)?Nt:Yt,n=arguments.length<3;return i(e,cs(t,4),r,n,pi)},Gr.reduceRight=function(e,t,r){var i=Xa(e)?Ft:Yt,n=arguments.length<3;return i(e,cs(t,4),r,n,di)},Gr.repeat=function(e,t,i){return t=(i?vs(e,t,i):t===r)?1:To(t),Ji(bo(e),t)},Gr.replace=function(){var e=arguments,t=bo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Gr.result=function(e,t,i){var n=-1,s=(t=vn(t,e)).length;for(s||(s=1,e=r);++np)return[];var r=m,i=Tr(e,m);t=cs(t),e-=m;for(var n=Jt(i,t);++r=a)return e;var l=i-hr(n);if(l<1)return n;var c=o?In(o,0,l).join(""):e.slice(0,l);if(s===r)return c+n;if(o&&(l+=c.length-l),co(s)){if(e.slice(l).search(s)){var u,h=c;for(s.global||(s=Me(s.source,bo(de.exec(s))+"g")),s.lastIndex=0;u=s.exec(h);)var p=u.index;c=c.slice(0,p===r?l:p)}}else if(e.indexOf(un(s),l)!=l){var d=c.lastIndexOf(s);d>-1&&(c=c.slice(0,d))}return c+n},Gr.unescape=function(e){return(e=bo(e))&&X.test(e)?e.replace(W,mr):e},Gr.uniqueId=function(e){var t=++Ue;return bo(e)+t},Gr.upperCase=el,Gr.upperFirst=tl,Gr.each=Ia,Gr.eachRight=ba,Gr.first=$s,pl(Gr,(wl={},vi(Gr,(function(e,t){Fe.call(Gr.prototype,t)||(wl[t]=e)})),wl),{chain:!1}),Gr.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Gr[e].placeholder=Gr})),Ct(["drop","take"],(function(e,t){zr.prototype[e]=function(i){i=i===r?1:yr(To(i),0);var n=this.__filtered__&&!t?new zr(this):this.clone();return n.__filtered__?n.__takeCount__=Tr(i,n.__takeCount__):n.__views__.push({size:Tr(i,m),type:e+(n.__dir__<0?"Right":"")}),n},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var r=t+1,i=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:cs(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}})),Ct(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(ll)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=$i((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return Ai(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(ka(cs(e)))},zr.prototype.slice=function(e,t){e=To(e);var i=this;return i.__filtered__&&(e>0||t<0)?new zr(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(i=(t=To(t))<0?i.dropRight(-t):i.take(t-e)),i)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(m)},vi(zr.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),s=Gr[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);s&&(Gr.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,l=t instanceof zr,c=o[0],u=l||Xa(t),h=function(e){var t=s.apply(Gr,Pt([e],o));return n&&p?t[0]:t};u&&i&&"function"==typeof c&&1!=c.length&&(l=u=!1);var p=this.__chain__,d=!!this.__actions__.length,m=a&&!p,f=l&&!d;if(!a&&u){t=f?t:new zr(this);var g=e.apply(t,o);return g.__actions__.push({func:_a,args:[h],thisArg:r}),new jr(g,p)}return m&&f?e.apply(this,o):(g=this.thru(h),m?n?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=De[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Gr.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(Xa(n)?n:[],e)}return this[r]((function(r){return t.apply(Xa(r)?r:[],e)}))}})),vi(zr.prototype,(function(e,t){var r=Gr[t];if(r){var i=r.name+"";Fe.call(Dr,i)||(Dr[i]=[]),Dr[i].push({name:t,func:r})}})),Dr[Vn(r,2).name]=[{name:"wrapper",func:r}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=An(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=An(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=An(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Xa(e),i=t<0,n=r?e.length:0,s=function(e,t,r){var i=-1,n=r.length;for(;++i=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Gr.prototype.plant=function(e){for(var t,i=this;i instanceof Hr;){var n=js(i);n.__index__=0,n.__values__=r,t?s.__wrapped__=n:t=n;var s=n;i=i.__wrapped__}return s.__wrapped__=e,t},Gr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:_a,args:[na],thisArg:r}),new jr(t,this.__chain__)}return this.thru(na)},Gr.prototype.toJSON=Gr.prototype.valueOf=Gr.prototype.value=function(){return fn(this.__wrapped__,this.__actions__)},Gr.prototype.first=Gr.prototype.head,et&&(Gr.prototype[et]=function(){return this}),Gr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(dt._=fr,define((function(){return fr}))):ft?((ft.exports=fr)._=fr,mt._=fr):dt._=fr}).call(e)}}),require_emitter_component=__commonJS({"node_modules/emitter-component/index.js"(e,t){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){var r=this;function i(){r.off(e,i),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var n=0;ne.length)&&(t=e.length);for(var r=0,i=Array(t);rd.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return r}!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)}(d,e);var m=function(e){var t=a();return function(){var r,i=n(e);if(t){var s=n(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return u(this,r)}}(d);return function(e,t,r){t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(d,[{key:"toDebugString",value:function(){var e,t=["BigInt["],r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw s}}}}(this);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.push((i?(i>>>0).toString(16):i)+", ")}}catch(e){r.e(e)}finally{r.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=0e||36this.length&&(r=this.length);for(var i=32767&e,n=e>>>15,s=0,a=t,o=0;o>>15,h=d.__imul(c,i),p=d.__imul(c,n),m=d.__imul(u,i),f=a+h+s;s=f>>>30,f&=1073741823,s+=(f+=((32767&p)<<15)+((32767&m)<<15))>>>30,a=d.__imul(u,n)+(p>>>15)+(m>>>15),this.__setDigit(o,1073741823&f)}if(0!==s||0!==a)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,r){for(var i,n=0,s=0;s>>15,this.__setHalfDigit(t+s,32767&i);return n}},{key:"__inplaceSub",value:function(e,t,r){var i=0;if(1&t){t>>=1;for(var n=this.__digit(t),s=32767&n,a=0;a>>1;a++){var o=e.__digit(a),l=(n>>>15)-(32767&o)-i;i=1&l>>>15,this.__setDigit(t+a,(32767&l)<<15|32767&s),i=1&(s=(32767&(n=this.__digit(t+a+1)))-(o>>>15)-i)>>>15}var c=e.__digit(a),u=(n>>>15)-(32767&c)-i;if(i=1&u>>>15,this.__setDigit(t+a,(32767&u)<<15|32767&s),t+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=1&(s=(32767&(n=this.__digit(t+a+1)))-(c>>>15)-i)>>>15,this.__setDigit(t+e.length,1073709056&n|32767&s))}else{t>>=1;for(var h=0;h>>15)-(d>>>15)-(i=1&m>>>15);i=1&f>>>15,this.__setDigit(t+h,(32767&f)<<15|32767&m)}var g=this.__digit(t+h),_=e.__digit(h),y=(32767&g)-(32767&_)-i;i=1&y>>>15;var T=0;0==(1&r)&&(i=1&(T=(g>>>15)-(_>>>15)-i)>>>15),this.__setDigit(t+h,(32767&T)<<15|32767&y)}return i}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t,r=this.__digit(0)>>>e,i=this.length-1,n=0;n>>e;this.__setDigit(i,r)}}},{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 r=e>>>1,i=this.__digit(r),n=1&e?32767&i|t<<15:1073709056&i|32767&t;this.__setDigit(r,n)}}],[{key:"BigInt",value:function(e){var t=Number.isFinite;if("number"==typeof e){if(0===e)return d.__zero();if(d.__isOneDigitInt(e))return 0>e?d.__oneDigit(-e,!0):d.__oneDigit(e,!1);if(!t(e)||l(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return d.__fromDouble(e)}if("string"==typeof e){var i=d.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?d.__oneDigit(1,!1):d.__zero();if("object"===r(e)){if(e.constructor===d)return e;var n=d.__toPrimitive(e);return d.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 r=e.__unsignedDigit(0);return e.sign?-r:r}var i=e.__digit(t-1),n=d.__clz30(i),s=30*t-n;if(1024>>=12;var h=c-12,p=12<=c?0:o<<20+c,m=20+c;for(0>>30-h,p=o<>>30-m,m-=30;var f=d.__decideRounding(e,m,l,o);if((1===f||0===f&&1==(1&p))&&0==(p=p+1>>>0)&&0!=++u>>>20&&(u=0,1023<++a))return e.sign?-1/0:1/0;var g=e.sign?-2147483648:0;return a=a+1023<<20,d.__kBitConversionInts[1]=g|a|u,d.__kBitConversionInts[0]=p,d.__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?d.__absoluteSubOne(e).__trim():d.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return d.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?d.unaryMinus(e):e;if(1=d.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var i=1+(0|r/30),n=new d(i,e.sign&&0!=(1&r));n.__initializeDigits();var s=1<>=1;0!==r;r>>=1)o=d.multiply(o,o),0!=(1&r)&&(a=null===a?o:d.multiply(a,o));return a}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var r=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&r--;var i=new d(r,e.sign!==t.sign);i.__initializeDigits();for(var n=0;nd.__absoluteCompare(e,t))return d.__zero();var r,i=e.sign!==t.sign,n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return i===e.sign?e:d.unaryMinus(e);r=d.__absoluteDivSmall(e,n,null)}else r=d.__absoluteDivLarge(e,t,!0,!1);return r.sign=i,r.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>d.__absoluteCompare(e,t))return e;var r=t.__unsignedDigit(0);if(1===t.length&&32767>=r){if(1===r)return d.__zero();var i=d.__absoluteModSmall(e,r);return 0===i?d.__zero():d.__oneDigit(i,e.sign)}var n=d.__absoluteDivLarge(e,t,!1,!0);return n.sign=e.sign,n.__trim()}},{key:"add",value:function(e,t){var r=e.sign;return r===t.sign?d.__absoluteAdd(e,t,r):0<=d.__absoluteCompare(e,t)?d.__absoluteSub(e,t,r):d.__absoluteSub(t,e,!r)}},{key:"subtract",value:function(e,t){var r=e.sign;return r===t.sign?0<=d.__absoluteCompare(e,t)?d.__absoluteSub(e,t,r):d.__absoluteSub(t,e,!r):d.__absoluteAdd(e,t,r)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?d.__rightShiftByAbsolute(e,t):d.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?d.__leftShiftByAbsolute(e,t):d.__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>d.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=d.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0(e=l(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return d.__zero();if(e>=d.__kMaxLengthBits)return t;var r=0|(e+29)/30;if(t.length(e=l(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return d.__zero();if(t.sign){if(e>d.__kMaxLengthBits)throw new RangeError("BigInt too big");return d.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=d.__kMaxLengthBits)return t;var r=0|(e+29)/30;if(t.length>>i)return t}return d.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=d.__toPrimitive(e),t=d.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=d.__toNumeric(e),t=d.__toNumeric(t),d.__isBigInt(e)&&d.__isBigInt(t))return d.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 d.__compare(e,t,0)}},{key:"LE",value:function(e,t){return d.__compare(e,t,1)}},{key:"GT",value:function(e,t){return d.__compare(e,t,2)}},{key:"GE",value:function(e,t){return d.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(d.__isBigInt(e))return d.__isBigInt(t)?d.equal(e,t):d.EQ(t,e);if("number"==typeof e){if(d.__isBigInt(t))return d.__equalToNumber(t,e);if("object"!==r(t))return e==t;t=d.__toPrimitive(t)}else if("string"==typeof e){if(d.__isBigInt(t))return null!==(e=d.__fromString(e))&&d.equal(e,t);if("object"!==r(t))return e==t;t=d.__toPrimitive(t)}else if("boolean"==typeof e){if(d.__isBigInt(t))return d.__equalToNumber(t,+e);if("object"!==r(t))return e==t;t=d.__toPrimitive(t)}else if("symbol"===r(e)){if(d.__isBigInt(t))return!1;if("object"!==r(t))return e==t;t=d.__toPrimitive(t)}else{if("object"!==r(e))return e==t;if("object"===r(t)&&t.constructor!==d)return e==t;e=d.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!d.EQ(e,t)}},{key:"DataViewGetBigInt64",value:function(e,t){var r=!!(2>>30),c.__setDigit(2,o>>>28),c.__trim()}},{key:"DataViewSetBigInt64",value:function(e,t,r){var i=!!(3>>2,2t)n=-t-1;else{if(0===r)return-1;r--,i=e.__digit(r),n=29}var s=1<>>20)-1023,i=1+(0|r/30),n=new d(i,0>e),s=1048575&d.__kBitConversionInts[1]|1048576,a=d.__kBitConversionInts[0],o=r%30,l=0;if(o<20){var c=20-o;l=c+32,t=s>>>c,s=s<<32-c|a>>>c,a<<=32-c}else if(20===o)l=32,t=s,s=a,a=0;else{var u=o-20;l=32-u,t=s<>>32-u,s=a<>>2,s=s<<30|a>>>2,a<<=30):t=0,n.__setDigit(h,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=11073741824/o)return null;var c=o*a+l>>>d.__kBitsPerCharTableShift,u=new d(0|(c+29)/30,!1),h=10>t?t:10,p=10>=d.__kBitsPerCharTableShift;var m=[],f=[],g=!1;do{for(var _,y=0,T=0;;){if(_=void 0,s-48>>>0>>0>>0>>0>>d.__kBitsPerCharTableShift)/30;u.__inplaceMultiplyAdd(x,b,w)}while(!v)}if(n!==i){if(!d.__isWhitespace(s))return null;for(n++;n>>l-(s-=30))}if(0!==n){if(i>=e.length)throw new Error("implementation bug");e.__setDigit(i++,n)}for(;i>>1)+(85&i))>>>2)+(51&i))>>>4)+(15&i),s=t-1,a=e.__digit(r-1),o=0|(30*r-d.__clz30(a)+n-1)/n;if(e.sign&&o++,268435456>>g,h=30-g;h>=n;)l[c--]=d.__kConversionChars[u&s],u>>>=n,h-=n}var _=(u|a<>>n-h;0!==u;)l[c--]=d.__kConversionChars[u&s],u>>>=n;if(e.sign&&(l[c--]="-"),-1!==c)throw new Error("implementation bug");return l.join("")}},{key:"__toStringGeneric",value:function(e,t,r){var i=e.length;if(0===i)return"";if(1===i){var n=e.__unsignedDigit(0).toString(t);return!1===r&&e.sign&&(n="-"+n),n}var s,a,o=30*i-d.__clz30(e.__digit(i-1)),l=d.__kMaxBitsPerChar[t]-1,c=o*d.__kBitsPerCharTableMultiplier,u=1+(c=0|(c+=l-1)/l)>>1,h=d.exponentiate(d.__oneDigit(t,!1),d.__oneDigit(u,!1)),p=h.__unsignedDigit(0);if(1===h.length&&32767>=p){(s=new d(e.length,!1)).__initializeDigits();for(var m,f=0,g=2*e.length-1;0<=g;g--)m=f<<15|e.__halfDigit(g),s.__setHalfDigit(g,0|m/p),f=0|m%p;a=f.toString(t)}else{var _=d.__absoluteDivLarge(e,h,!0,!0);s=_.quotient;var y=_.remainder.__trim();a=d.__toStringGeneric(y,t,!0)}s.__trim();for(var T=d.__toStringGeneric(s,t,!0);a.lengthi?d.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(e,r){if(d.__isOneDigitInt(r)){var i=e.sign,n=0>r;if(i!==n)return d.__unequalSign(i);if(0===e.length){if(n)throw new Error("implementation bug");return 0===r?0:-1}if(1s?d.__absoluteGreater(i):at)return d.__unequalSign(r);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;d.__kBitConversionDouble[0]=t;var i=2047&d.__kBitConversionInts[1]>>>20;if(2047==i)throw new Error("implementation bug: handled elsewhere");var n=i-1023;if(0>n)return d.__absoluteGreater(r);var s=e.length,a=e.__digit(s-1),o=d.__clz30(a),l=30*s-o,c=n+1;if(lc)return d.__absoluteGreater(r);var u=1048576|1048575&d.__kBitConversionInts[1],h=d.__kBitConversionInts[0],p=29-o;if(p!==(0|(l-1)%30))throw new Error("implementation bug");var m,f=0;if(p<20){var g=20-p;f=g+32,m=u>>>g,u=u<<32-g|h>>>g,h<<=32-g}else if(20===p)f=32,m=u,u=h,h=0;else{var _=p-20;f=32-_,m=u<<_|h>>>32-_,u=h<<_,h=0}if((a>>>=0)>(m>>>=0))return d.__absoluteGreater(r);if(a>>2,u=u<<30|h>>>2,h<<=30):m=0;var T=e.__unsignedDigit(y);if(T>m)return d.__absoluteGreater(r);if(Tr&&e.__unsignedDigit(0)===t(r):0===d.__compareToDouble(e,r)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0t;case 3:return e>=t}if(d.__isBigInt(e)&&"string"==typeof t)return null!==(t=d.__fromString(t))&&d.__comparisonResultToBool(d.__compareToBigInt(e,t),r);if("string"==typeof e&&d.__isBigInt(t))return null!==(e=d.__fromString(e))&&d.__comparisonResultToBool(d.__compareToBigInt(e,t),r);if(e=d.__toNumeric(e),t=d.__toNumeric(t),d.__isBigInt(e)){if(d.__isBigInt(t))return d.__comparisonResultToBool(d.__compareToBigInt(e,t),r);if("number"!=typeof t)throw new Error("implementation bug");return d.__comparisonResultToBool(d.__compareToNumber(e,t),r)}if("number"!=typeof e)throw new Error("implementation bug");if(d.__isBigInt(t))return d.__comparisonResultToBool(d.__compareToNumber(t,e),2^r);if("number"!=typeof t)throw new Error("implementation bug");return 0===r?et:3===r?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,r){if(e.length>>30,s.__setDigit(o,1073741823&n);for(;o>>30,s.__setDigit(o,1073741823&l)}return o>>30,n.__setDigit(a,1073741823&i);for(;a>>30,n.__setDigit(a,1073741823&o)}return n.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var r=2>>30,r.__setDigit(a,1073741823&n);return 0!==s&&r.__setDigitGrow(i,1),r}},{key:"__absoluteSubOne",value:function(e,t){for(var r,i=e.length,n=new d(t=t||i,!1),s=1,a=0;a>>30,n.__setDigit(a,1073741823&r);if(0!==s)throw new Error("implementation bug");for(var o=i;oi?0:e.__unsignedDigit(i)>t.__unsignedDigit(i)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,r,i){if(0!==t){for(var n=32767&t,s=t>>>15,a=0,o=0,l=0;l>>15,m=d.__imul(h,n),f=d.__imul(h,s),g=d.__imul(p,n);a=(c+=o+m+a)>>>30,c&=1073741823,a+=(c+=((32767&f)<<15)+((32767&g)<<15))>>>30,o=d.__imul(p,s)+(f>>>15)+(g>>>15),r.__setDigit(i,1073741823&c)}for(;0!==a||0!==o;i++){var _=r.__digit(i);_+=a+o,o=0,a=_>>>30,r.__setDigit(i,1073741823&_)}}}},{key:"__internalMultiplyAdd",value:function(e,t,r,i,n){for(var s=r,a=0,o=0;o>>15,t),h=c+((32767&u)<<15)+a+s;s=h>>>30,a=u>>>15,n.__setDigit(o,1073741823&h)}if(n.length>i)for(n.__setDigit(i++,s+a);i>>0,a=0|s/t,o=0|(s=((i=0|s%t)<<15|e.__halfDigit(n-1))>>>0)/t;i=0|s%t,r.__setDigit(n>>>1,a<<15|o)}return r}},{key:"__absoluteModSmall",value:function(e,t){for(var r=0,i=2*e.length-1;0<=i;i--)r=0|((r<<15|e.__halfDigit(i))>>>0)%t;return r}},{key:"__absoluteDivLarge",value:function(e,t,r,i){var n=t.__halfDigitLength(),s=t.length,a=e.__halfDigitLength()-n,o=null;r&&(o=new d(a+2>>>1,!1)).__initializeDigits();var l=new d(n+2>>>1,!1);l.__initializeDigits();var c=d.__clz15(t.__halfDigit(n-1));0>>0;f=0|_/h;for(var y=0|_%h,T=t.__halfDigit(n-2),v=u.__halfDigit(m+n-2);d.__imul(f,T)>>>0>(y<<16|v)>>>0&&(f--,!(32767<(y+=h))););}d.__internalMultiplyAdd(t,f,0,s,l);var E=u.__inplaceSub(l,m,n+1);0!==E&&(E=u.__inplaceAdd(t,m,n),u.__setHalfDigit(m+n,32767&u.__halfDigit(m+n)+E),f--),r&&(1&m?p=f<<15:o.__setDigit(m>>>1,p|f))}if(i)return u.__inplaceRightShift(c),r?{quotient:o,remainder:u}:u;if(r)return o;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return d.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,r){var i=e.length,n=new d(i+r,!1);if(0===t){for(var s=0;s>>30-t;return 0r)throw new RangeError("BigInt too big");var i=0|r/30,n=r%30,s=e.length,a=0!==n&&0!=e.__digit(s-1)>>>30-n,o=s+i+(a?1:0),l=new d(o,e.sign);if(0===n){for(var c=0;c>>30-n;if(a)l.__setDigit(s+i,u);else if(0!==u)throw new Error("implementation bug")}return l.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var r=e.length,i=e.sign,n=d.__toShiftAmount(t);if(0>n)return d.__rightShiftByMaximum(i);var s=0|n/30,a=n%30,o=r-s;if(0>=o)return d.__rightShiftByMaximum(i);var l=!1;if(i)if(0!=(e.__digit(s)&(1<>>a,f=r-s-1,g=0;g>>a;u.__setDigit(f,m)}return l&&(u=d.__absoluteAddOne(u,!0,u)),u.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?d.__oneDigit(1,!0):d.__zero()}},{key:"__toShiftAmount",value:function(e){if(1d.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=1>>o}return i.__setDigit(n,a),i.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,r){for(var i,n=Math.min,s=0|(e+29)/30,a=new d(s,r),o=0,l=s-1,c=0,u=n(l,t.length);o>>30,a.__setDigit(o,1073741823&i);for(;o>>f)-c,h&=g-1}return a.__setDigit(l,h),a.__trim()}},{key:"__digitPow",value:function(e,t){for(var r=1;0>>=1,e*=e;return r}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),d}(l(Array));return m.__kMaxLength=33554432,m.__kMaxLengthBits=m.__kMaxLength<<5,m.__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],m.__kBitsPerCharTableShift=5,m.__kBitsPerCharTableMultiplier=1<>>0)/t)},m.__imul=e||function(e,t){return 0|e*t},m},"object"==typeof e&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).JSBI=i()}}),require_rbush_min=__commonJS({"node_modules/rbush/rbush.min.js"(e,t){!function(r,i){"object"==typeof e&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).RBush=i()}(e,(function(){"use strict";function e(e,i,n,s,a){!function e(r,i,n,s,a){for(;s>n;){if(s-n>600){var o=s-n+1,l=i-n+1,c=Math.log(o),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(o-u)/o)*(l-o/2<0?-1:1);e(r,i,Math.max(n,Math.floor(i-l*u/o+h)),Math.min(s,Math.floor(i+(o-l)*u/o+h)),a)}var p=r[i],d=n,m=s;for(t(r,n,i),a(r[s],p)>0&&t(r,n,s);d0;)m--}0===a(r[n],p)?t(r,n,m):t(r,++m,s),m<=i&&(n=m+1),i<=m&&(s=m-1)}}(e,i,n||0,s||e.length-1,a||r)}function t(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function r(e,t){return et?1:0}var i=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,r){if(!r)return t.indexOf(e);for(var i=0;i=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(t,r,i,n,s){for(var a=[r,i];a.length;)if(!((i=a.pop())-(r=a.pop())<=n)){var o=r+Math.ceil((i-r)/n/2)*n;e(t,o,r,i,s),a.push(r,o,o,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(e){var t=this.data,r=[];if(!d(e,t))return r;for(var i=this.toBBox,n=[];t;){for(var s=0;s=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},i.prototype._split=function(e,t){var r=e[t],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);var a=this._chooseSplitIndex(r,n,i),o=m(r.children.splice(a,r.children.length-a));o.height=r.height,o.leaf=r.leaf,s(r,this.toBBox),s(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(r,o)},i.prototype._splitRoot=function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(e,t,r){for(var i,n,s,o,l,c,h,p=1/0,d=1/0,m=t;m<=r-t;m++){var f=a(e,0,m,this.toBBox),g=a(e,m,r,this.toBBox),_=(n=f,s=g,void 0,void 0,void 0,void 0,o=Math.max(n.minX,s.minX),l=Math.max(n.minY,s.minY),c=Math.min(n.maxX,s.maxX),h=Math.min(n.maxY,s.maxY),Math.max(0,c-o)*Math.max(0,h-l)),y=u(f)+u(g);_=t;d--){var m=e.children[d];o(l,e.leaf?n(m):m),c+=h(l)}return c},i.prototype._adjustParentBBoxes=function(e,t,r){for(var i=r;i>=0;i--)o(t[i],e)},i.prototype._condense=function(e){for(var t=e.length-1,r=void 0;t>=0;t--)0===e[t].children.length?t>0?(r=e[t-1].children).splice(r.indexOf(e[t]),1):this.clear():s(e[t],this.toBBox)},i}))}}),require_tinyqueue=__commonJS({"node_modules/tinyqueue/tinyqueue.js"(e,t){var r,i;r=e,i=function(){"use strict";var e=function(e,r){if(void 0===e&&(e=[]),void 0===r&&(r=t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};function t(e,t){return et?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,r=this.compare,i=t[e];e>0;){var n=e-1>>1,s=t[n];if(r(i,s)>=0)break;t[e]=s,e=n}t[e]=i},e.prototype._down=function(e){for(var t=this.data,r=this.compare,i=this.length>>1,n=t[e];e=0)break;t[e]=a,e=s}t[e]=n},e},"object"==typeof e&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).TinyQueue=i()}}),require_flat=__commonJS({"node_modules/point-in-polygon/flat.js"(e,t){t.exports=function(e,t,r,i){var n=e[0],s=e[1],a=!1;void 0===r&&(r=0),void 0===i&&(i=t.length);for(var o=(i-r)/2,l=0,c=o-1;ls!=d>s&&n<(p-u)*(s-h)/(d-h)+u&&(a=!a)}return a}}}),require_nested=__commonJS({"node_modules/point-in-polygon/nested.js"(e,t){t.exports=function(e,t,r,i){var n=e[0],s=e[1],a=!1;void 0===r&&(r=0),void 0===i&&(i=t.length);for(var o=i-r,l=0,c=o-1;ls!=d>s&&n<(p-u)*(s-h)/(d-h)+u&&(a=!a)}return a}}}),require_point_in_polygon=__commonJS({"node_modules/point-in-polygon/index.js"(e,t){var r=require_flat(),i=require_nested();t.exports=function(e,t,n,s){return t.length>0&&Array.isArray(t[0])?i(e,t,n,s):r(e,t,n,s)},t.exports.nested=i,t.exports.flat=r}}),require_orient2d_min=__commonJS({"node_modules/robust-predicates/umd/orient2d.min.js"(e,t){var r,i;r=e,i=function(e){"use strict";const t=134217729;function r(e,t,r,i,n){let s,a,o,l,c=t[0],u=i[0],h=0,p=0;u>c==u>-c?(s=c,c=t[++h]):(s=u,u=i[++p]);let d=0;if(hc==u>-c?(o=s-((a=c+s)-c),c=t[++h]):(o=s-((a=u+s)-u),u=i[++p]),s=a,0!==o&&(n[d++]=o);hc==u>-c?(o=s-((a=s+c)-(l=a-s))+(c-l),c=t[++h]):(o=s-((a=s+u)-(l=a-s))+(u-l),u=i[++p]),s=a,0!==o&&(n[d++]=o);for(;h0!=m>0)return f;const g=Math.abs(d+m);return Math.abs(f)>=33306690738754716e-32*g?f:-function(e,i,c,u,h,p,d){let m,f,g,_,y,T,v,E,I,b,x,S,w,C,M,R,A,D;const O=e-h,L=c-h,P=i-p,N=u-p;y=(M=(E=O-(v=(T=t*O)-(T-O)))*(b=N-(I=(T=t*N)-(T-N)))-((C=O*N)-v*I-E*I-v*b))-(x=M-(A=(E=P-(v=(T=t*P)-(T-P)))*(b=L-(I=(T=t*L)-(T-L)))-((R=P*L)-v*I-E*I-v*b))),n[0]=M-(x+y)+(y-A),y=(w=C-((S=C+x)-(y=S-C))+(x-y))-(x=w-R),n[1]=w-(x+y)+(y-R),y=(D=S+x)-S,n[2]=S-(D-y)+(x-y),n[3]=D;let F=function(e,t){let r=t[0];for(let e=1;e<4;e++)r+=t[e];return r}(0,n),U=22204460492503146e-32*d;if(F>=U||-F>=U)return F;if(m=e-(O+(y=e-O))+(y-h),g=c-(L+(y=c-L))+(y-h),f=i-(P+(y=i-P))+(y-p),_=u-(N+(y=u-N))+(y-p),0===m&&0===f&&0===g&&0===_)return F;if(U=11093356479670487e-47*d+33306690738754706e-32*Math.abs(F),(F+=O*_+N*m-(P*g+L*f))>=U||-F>=U)return F;y=(M=(E=m-(v=(T=t*m)-(T-m)))*(b=N-(I=(T=t*N)-(T-N)))-((C=m*N)-v*I-E*I-v*b))-(x=M-(A=(E=f-(v=(T=t*f)-(T-f)))*(b=L-(I=(T=t*L)-(T-L)))-((R=f*L)-v*I-E*I-v*b))),l[0]=M-(x+y)+(y-A),y=(w=C-((S=C+x)-(y=S-C))+(x-y))-(x=w-R),l[1]=w-(x+y)+(y-R),y=(D=S+x)-S,l[2]=S-(D-y)+(x-y),l[3]=D;const B=r(4,n,4,l,s);y=(M=(E=O-(v=(T=t*O)-(T-O)))*(b=_-(I=(T=t*_)-(T-_)))-((C=O*_)-v*I-E*I-v*b))-(x=M-(A=(E=P-(v=(T=t*P)-(T-P)))*(b=g-(I=(T=t*g)-(T-g)))-((R=P*g)-v*I-E*I-v*b))),l[0]=M-(x+y)+(y-A),y=(w=C-((S=C+x)-(y=S-C))+(x-y))-(x=w-R),l[1]=w-(x+y)+(y-R),y=(D=S+x)-S,l[2]=S-(D-y)+(x-y),l[3]=D;const k=r(B,s,4,l,a);y=(M=(E=m-(v=(T=t*m)-(T-m)))*(b=_-(I=(T=t*_)-(T-_)))-((C=m*_)-v*I-E*I-v*b))-(x=M-(A=(E=f-(v=(T=t*f)-(T-f)))*(b=g-(I=(T=t*g)-(T-g)))-((R=f*g)-v*I-E*I-v*b))),l[0]=M-(x+y)+(y-A),y=(w=C-((S=C+x)-(y=S-C))+(x-y))-(x=w-R),l[1]=w-(x+y)+(y-R),y=(D=S+x)-S,l[2]=S-(D-y)+(x-y),l[3]=D;const G=r(k,a,4,l,o);return o[G-1]}(e,i,c,u,h,p,g)},e.orient2dfast=function(e,t,r,i,n,s){return(t-s)*(r-n)-(e-n)*(i-s)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?i(e):"function"==typeof define&&define.amd?define(["exports"],i):i((r=r||self).predicates={})}}),require_concaveman=__commonJS({"node_modules/concaveman/index.js"(e,t){"use strict";var r=require_rbush_min(),i=require_tinyqueue(),n=require_point_in_polygon(),s=require_orient2d_min().orient2d;function a(e,t,i){t=Math.max(0,void 0===t?2:t),i=i||0;var s=function(e){for(var t=e[0],r=e[0],i=e[0],s=e[0],a=0;ai[0]&&(i=o),o[1]s[1]&&(s=o)}var l=[t,r,i,s],c=l.slice();for(a=0;a=2&&p(t[t.length-2],t[t.length-1],e[r])<=0;)t.pop();t.push(e[r])}for(var i=[],n=e.length-1;n>=0;n--){for(;i.length>=2&&p(i[i.length-2],i[i.length-1],e[n])<=0;)i.pop();i.push(e[n])}return i.pop(),t.pop(),t.concat(i)}(c)}(e),a=new r(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,c=[],u=0;ua||u.push({node:m,dist:f})}for(;u.length&&!u.peek().node.children;){var _=u.pop(),y=_.node,T=g(y,t,r),v=g(y,n,s);if(_.dist=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function h(e,t,r){for(var i,n,s,a,o=Math.min(e[0],t[0]),l=Math.min(e[1],t[1]),c=Math.max(e[0],t[0]),u=Math.max(e[1],t[1]),h=r.search({minX:o,minY:l,maxX:c,maxY:u}),d=0;d0!=p(i,n,a)>0&&p(s,a,i)>0!=p(s,a,n)>0)return!1;return!0}function p(e,t,r){return s(e[0],e[1],t[0],t[1],r[0],r[1])}function d(e){var t=e.p,r=e.next.p;return e.minX=Math.min(t[0],r[0]),e.minY=Math.min(t[1],r[1]),e.maxX=Math.max(t[0],r[0]),e.maxY=Math.max(t[1],r[1]),e}function m(e,t){var r={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(r.next=t.next,r.prev=t,t.next.prev=r,t.next=r):(r.prev=r,r.next=r),r}function f(e,t){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i}function g(e,t,r){var i=t[0],n=t[1],s=r[0]-i,a=r[1]-n;if(0!==s||0!==a){var o=((e[0]-i)*s+(e[1]-n)*a)/(s*s+a*a);o>1?(i=r[0],n=r[1]):o>0&&(i+=s*o,n+=a*o)}return(s=e[0]-i)*s+(a=e[1]-n)*a}function _(e,t,r,i,n,s,a,o){var l,c,u,h,p=r-e,d=i-t,m=a-n,f=o-s,g=e-n,_=t-s,y=p*p+d*d,T=p*m+d*f,v=m*m+f*f,E=p*g+d*_,I=m*g+f*_,b=y*v-T*T,x=b,S=b;0===b?(c=0,x=1,h=I,S=v):(h=y*I-T*E,(c=T*I-v*E)<0?(c=0,h=I,S=v):c>x&&(c=x,h=I+T,S=v)),h<0?(h=0,-E<0?c=0:-E>y?c=x:(c=-E,x=y)):h>S&&(h=S,-E+T<0?c=0:-E+T>y?c=x:(c=-E+T,x=y));var w=(1-(u=0===h?0:h/S))*n+u*a-((1-(l=0===c?0:c/x))*e+l*r),C=(1-u)*s+u*o-((1-l)*t+l*i);return w*w+C*C}function y(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}i.default&&(i=i.default),t.exports=a,t.exports.default=a}}),require_build_log=__commonJS({"node_modules/polybooljs/lib/build-log.js"(e,t){t.exports=function(){var e,t=0,r=!1;function i(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return i("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return i("div_seg",{seg:e,pt:t}),i("chop",{seg:e,pt:t})},statusRemove:function(e){return i("pop_seg",{seg:e})},segmentUpdate:function(e){return i("seg_update",{seg:e})},segmentNew:function(e,t){return i("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return i("rem_seg",{seg:e})},tempStatus:function(e,t,r){return i("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return i("rewind",{seg:e})},status:function(e,t,r){return i("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,i("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),i("log",{txt:e})},reset:function(){return i("reset")},selected:function(e){return i("selected",{segs:e})},chainStart:function(e){return i("chain_start",{seg:e})},chainRemoveHead:function(e,t){return i("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return i("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return i("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return i("chain_match",{index:e})},chainClose:function(e){return i("chain_close",{index:e})},chainAddHead:function(e,t){return i("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return i("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return i("chain_con",{index1:e,index2:t})},chainReverse:function(e){return i("chain_rev",{index:e})},chainJoin:function(e,t){return i("chain_join",{index1:e,index2:t})},done:function(){return i("done")}},e}}}),require_epsilon=__commonJS({"node_modules/polybooljs/lib/epsilon.js"(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,r,i){var n=r[0],s=r[1],a=i[0],o=i[1],l=t[0];return(a-n)*(t[1]-s)-(o-s)*(l-n)>=-e},pointBetween:function(t,r,i){var n=t[1]-r[1],s=i[0]-r[0],a=t[0]-r[0],o=i[1]-r[1],l=a*s+n*o;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=a-n>e&&(s-c)*(n-u)/(a-u)+c-i>e&&(o=!o),s=c,a=u}return o}};return t}}}),require_linked_list=__commonJS({"node_modules/polybooljs/lib/linked-list.js"(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,r){for(var i=e.root,n=e.root.next;null!==n;){if(r(n))return t.prev=n.prev,t.next=n,n.prev.next=t,void(n.prev=t);i=n,n=n.next}i.next=t,t.prev=i,t.next=null},findTransition:function(t){for(var r=e.root,i=e.root.next;null!==i&&!t(i);)r=i,i=i.next;return{before:r===e.root?null:r,after:i,insert:function(e){return e.prev=r,e.next=i,r.next=e,null!==i&&(i.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}}}}),require_intersecter=__commonJS({"node_modules/polybooljs/lib/intersecter.js"(e,t){var r=require_linked_list();t.exports=function(e,t,i){function n(e,t,r){return{id:i?i.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var s=r.create();function a(e,r){s.insertBefore(e,(function(i){return function(e,r,i,n,s,a){var o=t.pointsCompare(r,s);return 0!==o?o:t.pointsSame(i,a)?0:e!==n?e?1:-1:t.pointAboveOrOnLine(i,n?s:a, // order matters n?a:s)?1:-1}(e.isStart,e.pt,r,i.isStart,i.pt,i.other.pt)<0}))}function o(e,t){var i=function(e,t){var i=r.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return a(i,e.end),i}(e,t);return function(e,t,i){var n=r.node({isStart:!1,pt:t.end,seg:t,primary:i,other:e,status:null});e.other=n,a(n,e.pt)}(i,e,t),i}function l(e,t){var r=n(t,e.seg.end,e.seg);return function(e,t){i&&i.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,a(e.other,e.pt)}(e,t),o(r,e.primary)}function c(n,a){var o=r.create();function c(e){return o.findTransition((function(r){var i=function(e,r){var i=e.seg.start,n=e.seg.end,s=r.seg.start,a=r.seg.end;return t.pointsCollinear(i,s,a)?t.pointsCollinear(n,s,a)||t.pointAboveOrOnLine(n,s,a)?1:-1:t.pointAboveOrOnLine(i,s,a)?1:-1}(e,r.ev);return i>0}))}function u(e,r){var n=e.seg,s=r.seg,a=n.start,o=n.end,c=s.start,u=s.end;i&&i.checkIntersection(n,s);var h=t.linesIntersect(a,o,c,u);if(!1===h){if(!t.pointsCollinear(a,o,c))return!1;if(t.pointsSame(a,u)||t.pointsSame(o,c))return!1;var p=t.pointsSame(a,c),d=t.pointsSame(o,u);if(p&&d)return r;var m=!p&&t.pointBetween(a,c,u),f=!d&&t.pointBetween(o,c,u);if(p)return f?l(r,o):l(e,u),r;m&&(d||(f?l(r,o):l(e,u)),l(r,a))}else 0===h.alongA&&(-1===h.alongB?l(e,c):0===h.alongB?l(e,h.pt):1===h.alongB&&l(e,u)),0===h.alongB&&(-1===h.alongA?l(r,a):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,o));return!1}for(var h=[];!s.isEmpty();){var p=s.getHead();if(i&&i.vert(p.pt[0]),p.isStart){let t=function(){if(m){var e=u(p,m);if(e)return e}return!!f&&u(p,f)};i&&i.segmentNew(p.seg,p.primary);var d=c(p),m=d.before?d.before.ev:null,f=d.after?d.after.ev:null;i&&i.tempStatus(p.seg,!!m&&m.seg,!!f&&f.seg);var g,_=t();if(_){var y;if(e)(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(_.seg.myFill.above=!_.seg.myFill.above);else _.seg.otherFill=p.seg.myFill;i&&i.segmentUpdate(_.seg),p.other.remove(),p.remove()}if(s.getHead()!==p){i&&i.rewind(p.seg);continue}if(e)y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=f?f.seg.myFill.above:n,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill)g=f?p.primary===f.primary?f.seg.otherFill.above:f.seg.myFill.above:p.primary?a:n,p.seg.otherFill={above:g,below:g};i&&i.status(p.seg,!!m&&m.seg,!!f&&f.seg),p.other.status=d.insert(r.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),i&&i.statusRemove(T.ev.seg),T.remove(),!p.primary){var v=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=v}h.push(p.seg)}s.getHead().remove()}return i&&i.done(),h}return e?{addRegion:function(e){for(var r,n,s,a=e[e.length-1],l=0;l=i?(n=h,(l+=1)=0;--n){var s=r;(l=(o=e[n])-((r=s+o)-s))&&(e[--i]=r,r=l)}var a=0;for(n=i;n=i?(n=h,(l+=1)0){if(s<=0)return a;i=n+s}else{if(!(n<0))return a;if(s>=0)return a;i=-(n+s)}var o=33306690738754716e-32*i;return a>=o||a<=-o?a:u(e,t,r)},function(e,t,r,i){var n=e[0]-i[0],s=t[0]-i[0],a=r[0]-i[0],o=e[1]-i[1],l=t[1]-i[1],c=r[1]-i[1],u=e[2]-i[2],p=t[2]-i[2],d=r[2]-i[2],m=s*c,f=a*l,g=a*o,_=n*c,y=n*l,T=s*o,v=u*(m-f)+p*(g-_)+d*(y-T),E=7771561172376103e-31*((Math.abs(m)+Math.abs(f))*Math.abs(u)+(Math.abs(g)+Math.abs(_))*Math.abs(p)+(Math.abs(y)+Math.abs(T))*Math.abs(d));return v>E||-v>E?v:h(e,t,r,i)}];function d(e){var t=p[e.length];return t||(t=p[e.length]=c(e.length)),t.apply(void 0,e)}function m(e,t,r,i,n,s,a){return function(t,r,o,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return i(t,r);case 3:return n(t,r,o);case 4:return s(t,r,o,l);case 5:return a(t,r,o,l,c)}for(var u=new Array(arguments.length),h=0;h0&&a>0||s<0&&a<0)return!1;var o=r(i,e,t),l=r(n,e,t);if(o>0&&l>0||o<0&&l<0)return!1;if(0===s&&0===a&&0===o&&0===l)return function(e,t,r,i){for(var n=0;n<2;++n){var s=e[n],a=t[n],o=Math.min(s,a),l=Math.max(s,a),c=r[n],u=i[n],h=Math.min(c,u);if(Math.max(c,u)div{font-size:3rem;animation:spin 1s infinite linear;color:#2c7be5}.bim-viewer-spinner.hidden{display:none}.svg-renderer{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}.spinner{position:absolute;display:flex;width:100%;height:100%;opacity:.8;background-color:#fff;justify-content:center;align-items:center;z-index:10}.spinner>div{font-size:3rem;animation:spin 1s infinite linear;color:#2c7be5}.spinner.hidden{display:none}.compare-markups-canvas{position:absolute;top:0;left:0;pointer-events:none;user-select:none}.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)}}(); // src/fetch-polyfill.ts var _fetch=fetch;window.fetch=(...e)=>Promise.resolve(_fetch(...e)) // src/index.ts; var import_intl_pluralrules=__toESM(require_polyfill(),1),import_stable=__toESM(require_stable(),1),import_runtime36=__toESM(require_runtime(),1),three_module_exports={};__export(three_module_exports,{ACESFilmicToneMapping:()=>ACESFilmicToneMapping,AddEquation:()=>AddEquation,AddOperation:()=>AddOperation,AdditiveAnimationBlendMode:()=>AdditiveAnimationBlendMode,AdditiveBlending:()=>AdditiveBlending,AlphaFormat:()=>AlphaFormat,AlwaysDepth:()=>AlwaysDepth,AlwaysStencilFunc:()=>AlwaysStencilFunc,AmbientLight:()=>AmbientLight,AmbientLightProbe:()=>AmbientLightProbe,AnimationClip:()=>AnimationClip,AnimationLoader:()=>AnimationLoader,AnimationMixer:()=>AnimationMixer,AnimationObjectGroup:()=>AnimationObjectGroup,AnimationUtils:()=>AnimationUtils,ArcCurve:()=>ArcCurve,ArrayCamera:()=>ArrayCamera,ArrowHelper:()=>ArrowHelper,Audio:()=>Audio,AudioAnalyser:()=>AudioAnalyser,AudioContext:()=>AudioContext,AudioListener:()=>AudioListener,AudioLoader:()=>AudioLoader,AxesHelper:()=>AxesHelper,BackSide:()=>BackSide,BasicDepthPacking:()=>BasicDepthPacking,BasicShadowMap:()=>BasicShadowMap,Bone:()=>Bone,BooleanKeyframeTrack:()=>BooleanKeyframeTrack,Box2:()=>Box2,Box3:()=>Box3,Box3Helper:()=>Box3Helper,BoxBufferGeometry:()=>BoxBufferGeometry,BoxGeometry:()=>BoxGeometry,BoxHelper:()=>BoxHelper,BufferAttribute:()=>BufferAttribute,BufferGeometry:()=>BufferGeometry,BufferGeometryLoader:()=>BufferGeometryLoader,ByteType:()=>ByteType,Cache:()=>Cache,Camera:()=>Camera,CameraHelper:()=>CameraHelper,CanvasTexture:()=>CanvasTexture,CapsuleBufferGeometry:()=>CapsuleBufferGeometry,CapsuleGeometry:()=>CapsuleGeometry,CatmullRomCurve3:()=>CatmullRomCurve3,CineonToneMapping:()=>CineonToneMapping,CircleBufferGeometry:()=>CircleBufferGeometry,CircleGeometry:()=>CircleGeometry,ClampToEdgeWrapping:()=>ClampToEdgeWrapping,Clock:()=>Clock,Color:()=>Color,ColorKeyframeTrack:()=>ColorKeyframeTrack,ColorManagement:()=>ColorManagement,CompressedArrayTexture:()=>CompressedArrayTexture,CompressedTexture:()=>CompressedTexture,CompressedTextureLoader:()=>CompressedTextureLoader,ConeBufferGeometry:()=>ConeBufferGeometry,ConeGeometry:()=>ConeGeometry,CubeCamera:()=>CubeCamera,CubeReflectionMapping:()=>CubeReflectionMapping,CubeRefractionMapping:()=>CubeRefractionMapping,CubeTexture:()=>CubeTexture,CubeTextureLoader:()=>CubeTextureLoader,CubeUVReflectionMapping:()=>CubeUVReflectionMapping,CubicBezierCurve:()=>CubicBezierCurve,CubicBezierCurve3:()=>CubicBezierCurve3,CubicInterpolant:()=>CubicInterpolant,CullFaceBack:()=>CullFaceBack,CullFaceFront:()=>CullFaceFront,CullFaceFrontBack:()=>CullFaceFrontBack,CullFaceNone:()=>CullFaceNone,Curve:()=>Curve,CurvePath:()=>CurvePath,CustomBlending:()=>CustomBlending,CustomToneMapping:()=>CustomToneMapping,CylinderBufferGeometry:()=>CylinderBufferGeometry,CylinderGeometry:()=>CylinderGeometry,Cylindrical:()=>Cylindrical,Data3DTexture:()=>Data3DTexture,DataArrayTexture:()=>DataArrayTexture,DataTexture:()=>DataTexture,DataTexture2DArray:()=>DataTexture2DArray,DataTexture3D:()=>DataTexture3D,DataTextureLoader:()=>DataTextureLoader,DataUtils:()=>DataUtils,DecrementStencilOp:()=>DecrementStencilOp,DecrementWrapStencilOp:()=>DecrementWrapStencilOp,DefaultLoadingManager:()=>DefaultLoadingManager,DepthFormat:()=>DepthFormat,DepthStencilFormat:()=>DepthStencilFormat,DepthTexture:()=>DepthTexture,DirectionalLight:()=>DirectionalLight,DirectionalLightHelper:()=>DirectionalLightHelper,DiscreteInterpolant:()=>DiscreteInterpolant,DodecahedronBufferGeometry:()=>DodecahedronBufferGeometry,DodecahedronGeometry:()=>DodecahedronGeometry,DoubleSide:()=>DoubleSide,DstAlphaFactor:()=>DstAlphaFactor,DstColorFactor:()=>DstColorFactor,DynamicCopyUsage:()=>DynamicCopyUsage,DynamicDrawUsage:()=>DynamicDrawUsage,DynamicReadUsage:()=>DynamicReadUsage,EdgesGeometry:()=>EdgesGeometry,EllipseCurve:()=>EllipseCurve,EqualDepth:()=>EqualDepth,EqualStencilFunc:()=>EqualStencilFunc,EquirectangularReflectionMapping:()=>EquirectangularReflectionMapping,EquirectangularRefractionMapping:()=>EquirectangularRefractionMapping,Euler:()=>Euler,EventDispatcher:()=>EventDispatcher,ExtrudeBufferGeometry:()=>ExtrudeBufferGeometry,ExtrudeGeometry:()=>ExtrudeGeometry,FileLoader:()=>FileLoader,Float16BufferAttribute:()=>Float16BufferAttribute,Float32BufferAttribute:()=>Float32BufferAttribute,Float64BufferAttribute:()=>Float64BufferAttribute,FloatType:()=>FloatType,Fog:()=>Fog,FogExp2:()=>FogExp2,FramebufferTexture:()=>FramebufferTexture,FrontSide:()=>FrontSide,Frustum:()=>Frustum,GLBufferAttribute:()=>GLBufferAttribute,GLSL1:()=>GLSL1,GLSL3:()=>GLSL3,GreaterDepth:()=>GreaterDepth,GreaterEqualDepth:()=>GreaterEqualDepth,GreaterEqualStencilFunc:()=>GreaterEqualStencilFunc,GreaterStencilFunc:()=>GreaterStencilFunc,GridHelper:()=>GridHelper,Group:()=>Group,HalfFloatType:()=>HalfFloatType,HemisphereLight:()=>HemisphereLight,HemisphereLightHelper:()=>HemisphereLightHelper,HemisphereLightProbe:()=>HemisphereLightProbe,IcosahedronBufferGeometry:()=>IcosahedronBufferGeometry,IcosahedronGeometry:()=>IcosahedronGeometry,ImageBitmapLoader:()=>ImageBitmapLoader,ImageLoader:()=>ImageLoader,ImageUtils:()=>ImageUtils,ImmediateRenderObject:()=>ImmediateRenderObject,IncrementStencilOp:()=>IncrementStencilOp,IncrementWrapStencilOp:()=>IncrementWrapStencilOp,InstancedBufferAttribute:()=>InstancedBufferAttribute,InstancedBufferGeometry:()=>InstancedBufferGeometry,InstancedInterleavedBuffer:()=>InstancedInterleavedBuffer,InstancedMesh:()=>InstancedMesh,Int16BufferAttribute:()=>Int16BufferAttribute,Int32BufferAttribute:()=>Int32BufferAttribute,Int8BufferAttribute:()=>Int8BufferAttribute,IntType:()=>IntType,InterleavedBuffer:()=>InterleavedBuffer,InterleavedBufferAttribute:()=>InterleavedBufferAttribute,Interpolant:()=>Interpolant,InterpolateDiscrete:()=>InterpolateDiscrete,InterpolateLinear:()=>InterpolateLinear,InterpolateSmooth:()=>InterpolateSmooth,InvertStencilOp:()=>InvertStencilOp,KeepStencilOp:()=>KeepStencilOp,KeyframeTrack:()=>KeyframeTrack,LOD:()=>LOD,LatheBufferGeometry:()=>LatheBufferGeometry,LatheGeometry:()=>LatheGeometry,Layers:()=>Layers,LessDepth:()=>LessDepth,LessEqualDepth:()=>LessEqualDepth,LessEqualStencilFunc:()=>LessEqualStencilFunc,LessStencilFunc:()=>LessStencilFunc,Light:()=>Light,LightProbe:()=>LightProbe,Line:()=>Line,Line3:()=>Line3,LineBasicMaterial:()=>LineBasicMaterial,LineCurve:()=>LineCurve,LineCurve3:()=>LineCurve3,LineDashedMaterial:()=>LineDashedMaterial,LineLoop:()=>LineLoop,LineSegments:()=>LineSegments,LinearEncoding:()=>LinearEncoding,LinearFilter:()=>LinearFilter,LinearInterpolant:()=>LinearInterpolant,LinearMipMapLinearFilter:()=>LinearMipMapLinearFilter,LinearMipMapNearestFilter:()=>LinearMipMapNearestFilter,LinearMipmapLinearFilter:()=>LinearMipmapLinearFilter,LinearMipmapNearestFilter:()=>LinearMipmapNearestFilter,LinearSRGBColorSpace:()=>LinearSRGBColorSpace,LinearToneMapping:()=>LinearToneMapping,Loader:()=>Loader,LoaderUtils:()=>LoaderUtils,LoadingManager:()=>LoadingManager,LoopOnce:()=>LoopOnce,LoopPingPong:()=>LoopPingPong,LoopRepeat:()=>LoopRepeat,LuminanceAlphaFormat:()=>LuminanceAlphaFormat,LuminanceFormat:()=>LuminanceFormat,MOUSE:()=>MOUSE,Material:()=>Material,MaterialLoader:()=>MaterialLoader,MathUtils:()=>MathUtils,Matrix3:()=>Matrix3,Matrix4:()=>Matrix4,MaxEquation:()=>MaxEquation,Mesh:()=>Mesh,MeshBasicMaterial:()=>MeshBasicMaterial,MeshDepthMaterial:()=>MeshDepthMaterial,MeshDistanceMaterial:()=>MeshDistanceMaterial,MeshLambertMaterial:()=>MeshLambertMaterial,MeshMatcapMaterial:()=>MeshMatcapMaterial,MeshNormalMaterial:()=>MeshNormalMaterial,MeshPhongMaterial:()=>MeshPhongMaterial,MeshPhysicalMaterial:()=>MeshPhysicalMaterial,MeshStandardMaterial:()=>MeshStandardMaterial,MeshToonMaterial:()=>MeshToonMaterial,MinEquation:()=>MinEquation,MirroredRepeatWrapping:()=>MirroredRepeatWrapping,MixOperation:()=>MixOperation,MultiplyBlending:()=>MultiplyBlending,MultiplyOperation:()=>MultiplyOperation,NearestFilter:()=>NearestFilter,NearestMipMapLinearFilter:()=>NearestMipMapLinearFilter,NearestMipMapNearestFilter:()=>NearestMipMapNearestFilter,NearestMipmapLinearFilter:()=>NearestMipmapLinearFilter,NearestMipmapNearestFilter:()=>NearestMipmapNearestFilter,NeverDepth:()=>NeverDepth,NeverStencilFunc:()=>NeverStencilFunc,NoBlending:()=>NoBlending,NoColorSpace:()=>NoColorSpace,NoToneMapping:()=>NoToneMapping,NormalAnimationBlendMode:()=>NormalAnimationBlendMode,NormalBlending:()=>NormalBlending,NotEqualDepth:()=>NotEqualDepth,NotEqualStencilFunc:()=>NotEqualStencilFunc,NumberKeyframeTrack:()=>NumberKeyframeTrack,Object3D:()=>Object3D,ObjectLoader:()=>ObjectLoader,ObjectSpaceNormalMap:()=>ObjectSpaceNormalMap,OctahedronBufferGeometry:()=>OctahedronBufferGeometry,OctahedronGeometry:()=>OctahedronGeometry,OneFactor:()=>OneFactor,OneMinusDstAlphaFactor:()=>OneMinusDstAlphaFactor,OneMinusDstColorFactor:()=>OneMinusDstColorFactor,OneMinusSrcAlphaFactor:()=>OneMinusSrcAlphaFactor,OneMinusSrcColorFactor:()=>OneMinusSrcColorFactor,OrthographicCamera:()=>OrthographicCamera,PCFShadowMap:()=>PCFShadowMap,PCFSoftShadowMap:()=>PCFSoftShadowMap,PMREMGenerator:()=>PMREMGenerator,Path:()=>Path,PerspectiveCamera:()=>PerspectiveCamera,Plane:()=>Plane,PlaneBufferGeometry:()=>PlaneBufferGeometry,PlaneGeometry:()=>PlaneGeometry,PlaneHelper:()=>PlaneHelper,PointLight:()=>PointLight,PointLightHelper:()=>PointLightHelper,Points:()=>Points,PointsMaterial:()=>PointsMaterial,PolarGridHelper:()=>PolarGridHelper,PolyhedronBufferGeometry:()=>PolyhedronBufferGeometry,PolyhedronGeometry:()=>PolyhedronGeometry,PositionalAudio:()=>PositionalAudio,PropertyBinding:()=>PropertyBinding,PropertyMixer:()=>PropertyMixer,QuadraticBezierCurve:()=>QuadraticBezierCurve,QuadraticBezierCurve3:()=>QuadraticBezierCurve3,Quaternion:()=>Quaternion,QuaternionKeyframeTrack:()=>QuaternionKeyframeTrack,QuaternionLinearInterpolant:()=>QuaternionLinearInterpolant,REVISION:()=>REVISION,RGBADepthPacking:()=>RGBADepthPacking,RGBAFormat:()=>RGBAFormat,RGBAIntegerFormat:()=>RGBAIntegerFormat,RGBA_ASTC_10x10_Format:()=>RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format:()=>RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format:()=>RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format:()=>RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format:()=>RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format:()=>RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format:()=>RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format:()=>RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format:()=>RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format:()=>RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format:()=>RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format:()=>RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format:()=>RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format:()=>RGBA_ASTC_8x8_Format,RGBA_BPTC_Format:()=>RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:()=>RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format:()=>RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format:()=>RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:()=>RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format:()=>RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format:()=>RGBA_S3TC_DXT5_Format,RGBFormat:()=>RGBFormat,RGB_ETC1_Format:()=>RGB_ETC1_Format,RGB_ETC2_Format:()=>RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format:()=>RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format:()=>RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:()=>RGB_S3TC_DXT1_Format,RGFormat:()=>RGFormat,RGIntegerFormat:()=>RGIntegerFormat,RawShaderMaterial:()=>RawShaderMaterial,Ray:()=>Ray,Raycaster:()=>Raycaster,RectAreaLight:()=>RectAreaLight,RedFormat:()=>RedFormat,RedIntegerFormat:()=>RedIntegerFormat,ReinhardToneMapping:()=>ReinhardToneMapping,RepeatWrapping:()=>RepeatWrapping,ReplaceStencilOp:()=>ReplaceStencilOp,ReverseSubtractEquation:()=>ReverseSubtractEquation,RingBufferGeometry:()=>RingBufferGeometry,RingGeometry:()=>RingGeometry,SRGBColorSpace:()=>SRGBColorSpace,Scene:()=>Scene,ShaderChunk:()=>ShaderChunk,ShaderLib:()=>ShaderLib,ShaderMaterial:()=>ShaderMaterial,ShadowMaterial:()=>ShadowMaterial,Shape:()=>Shape,ShapeBufferGeometry:()=>ShapeBufferGeometry,ShapeGeometry:()=>ShapeGeometry,ShapePath:()=>ShapePath,ShapeUtils:()=>ShapeUtils,ShortType:()=>ShortType,Skeleton:()=>Skeleton,SkeletonHelper:()=>SkeletonHelper,SkinnedMesh:()=>SkinnedMesh,Source:()=>Source,Sphere:()=>Sphere,SphereBufferGeometry:()=>SphereBufferGeometry,SphereGeometry:()=>SphereGeometry,Spherical:()=>Spherical,SphericalHarmonics3:()=>SphericalHarmonics3,SplineCurve:()=>SplineCurve,SpotLight:()=>SpotLight,SpotLightHelper:()=>SpotLightHelper,Sprite:()=>Sprite,SpriteMaterial:()=>SpriteMaterial,SrcAlphaFactor:()=>SrcAlphaFactor,SrcAlphaSaturateFactor:()=>SrcAlphaSaturateFactor,SrcColorFactor:()=>SrcColorFactor,StaticCopyUsage:()=>StaticCopyUsage,StaticDrawUsage:()=>StaticDrawUsage,StaticReadUsage:()=>StaticReadUsage,StereoCamera:()=>StereoCamera,StreamCopyUsage:()=>StreamCopyUsage,StreamDrawUsage:()=>StreamDrawUsage,StreamReadUsage:()=>StreamReadUsage,StringKeyframeTrack:()=>StringKeyframeTrack,SubtractEquation:()=>SubtractEquation,SubtractiveBlending:()=>SubtractiveBlending,TOUCH:()=>TOUCH,TangentSpaceNormalMap:()=>TangentSpaceNormalMap,TetrahedronBufferGeometry:()=>TetrahedronBufferGeometry,TetrahedronGeometry:()=>TetrahedronGeometry,Texture:()=>Texture,TextureLoader:()=>TextureLoader,TorusBufferGeometry:()=>TorusBufferGeometry,TorusGeometry:()=>TorusGeometry,TorusKnotBufferGeometry:()=>TorusKnotBufferGeometry,TorusKnotGeometry:()=>TorusKnotGeometry,Triangle:()=>Triangle,TriangleFanDrawMode:()=>TriangleFanDrawMode,TriangleStripDrawMode:()=>TriangleStripDrawMode,TrianglesDrawMode:()=>TrianglesDrawMode,TubeBufferGeometry:()=>TubeBufferGeometry,TubeGeometry:()=>TubeGeometry,UVMapping:()=>UVMapping,Uint16BufferAttribute:()=>Uint16BufferAttribute,Uint32BufferAttribute:()=>Uint32BufferAttribute,Uint8BufferAttribute:()=>Uint8BufferAttribute,Uint8ClampedBufferAttribute:()=>Uint8ClampedBufferAttribute,Uniform:()=>Uniform,UniformsGroup:()=>UniformsGroup,UniformsLib:()=>UniformsLib,UniformsUtils:()=>UniformsUtils,UnsignedByteType:()=>UnsignedByteType,UnsignedInt248Type:()=>UnsignedInt248Type,UnsignedIntType:()=>UnsignedIntType,UnsignedShort4444Type:()=>UnsignedShort4444Type,UnsignedShort5551Type:()=>UnsignedShort5551Type,UnsignedShortType:()=>UnsignedShortType,VSMShadowMap:()=>VSMShadowMap,Vector2:()=>Vector2,Vector3:()=>Vector3,Vector4:()=>Vector4,VectorKeyframeTrack:()=>VectorKeyframeTrack,VideoTexture:()=>VideoTexture,WebGL1Renderer:()=>WebGL1Renderer,WebGL3DRenderTarget:()=>WebGL3DRenderTarget,WebGLArrayRenderTarget:()=>WebGLArrayRenderTarget,WebGLCubeRenderTarget:()=>WebGLCubeRenderTarget,WebGLMultipleRenderTargets:()=>WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget:()=>WebGLMultisampleRenderTarget,WebGLRenderTarget:()=>WebGLRenderTarget,WebGLRenderer:()=>WebGLRenderer,WebGLUtils:()=>WebGLUtils,WireframeGeometry:()=>WireframeGeometry,WrapAroundEnding:()=>WrapAroundEnding,ZeroCurvatureEnding:()=>ZeroCurvatureEnding,ZeroFactor:()=>ZeroFactor,ZeroSlopeEnding:()=>ZeroSlopeEnding,ZeroStencilOp:()=>ZeroStencilOp,_SRGBAFormat:()=>_SRGBAFormat,sRGBEncoding:()=>sRGBEncoding});var REVISION="146",MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},CullFaceNone=0,CullFaceBack=1,CullFaceFront=2,CullFaceFrontBack=3,BasicShadowMap=0,PCFShadowMap=1,PCFSoftShadowMap=2,VSMShadowMap=3,FrontSide=0,BackSide=1,DoubleSide=2,NoBlending=0,NormalBlending=1,AdditiveBlending=2,SubtractiveBlending=3,MultiplyBlending=4,CustomBlending=5,AddEquation=100,SubtractEquation=101,ReverseSubtractEquation=102,MinEquation=103,MaxEquation=104,ZeroFactor=200,OneFactor=201,SrcColorFactor=202,OneMinusSrcColorFactor=203,SrcAlphaFactor=204,OneMinusSrcAlphaFactor=205,DstAlphaFactor=206,OneMinusDstAlphaFactor=207,DstColorFactor=208,OneMinusDstColorFactor=209,SrcAlphaSaturateFactor=210,NeverDepth=0,AlwaysDepth=1,LessDepth=2,LessEqualDepth=3,EqualDepth=4,GreaterEqualDepth=5,GreaterDepth=6,NotEqualDepth=7,MultiplyOperation=0,MixOperation=1,AddOperation=2,NoToneMapping=0,LinearToneMapping=1,ReinhardToneMapping=2,CineonToneMapping=3,ACESFilmicToneMapping=4,CustomToneMapping=5,UVMapping=300,CubeReflectionMapping=301,CubeRefractionMapping=302,EquirectangularReflectionMapping=303,EquirectangularRefractionMapping=304,CubeUVReflectionMapping=306,RepeatWrapping=1e3,ClampToEdgeWrapping=1001,MirroredRepeatWrapping=1002,NearestFilter=1003,NearestMipmapNearestFilter=1004,NearestMipMapNearestFilter=1004,NearestMipmapLinearFilter=1005,NearestMipMapLinearFilter=1005,LinearFilter=1006,LinearMipmapNearestFilter=1007,LinearMipMapNearestFilter=1007,LinearMipmapLinearFilter=1008,LinearMipMapLinearFilter=1008,UnsignedByteType=1009,ByteType=1010,ShortType=1011,UnsignedShortType=1012,IntType=1013,UnsignedIntType=1014,FloatType=1015,HalfFloatType=1016,UnsignedShort4444Type=1017,UnsignedShort5551Type=1018,UnsignedInt248Type=1020,AlphaFormat=1021,RGBFormat=1022,RGBAFormat=1023,LuminanceFormat=1024,LuminanceAlphaFormat=1025,DepthFormat=1026,DepthStencilFormat=1027,RedFormat=1028,RedIntegerFormat=1029,RGFormat=1030,RGIntegerFormat=1031,RGBAIntegerFormat=1033,RGB_S3TC_DXT1_Format=33776,RGBA_S3TC_DXT1_Format=33777,RGBA_S3TC_DXT3_Format=33778,RGBA_S3TC_DXT5_Format=33779,RGB_PVRTC_4BPPV1_Format=35840,RGB_PVRTC_2BPPV1_Format=35841,RGBA_PVRTC_4BPPV1_Format=35842,RGBA_PVRTC_2BPPV1_Format=35843,RGB_ETC1_Format=36196,RGB_ETC2_Format=37492,RGBA_ETC2_EAC_Format=37496,RGBA_ASTC_4x4_Format=37808,RGBA_ASTC_5x4_Format=37809,RGBA_ASTC_5x5_Format=37810,RGBA_ASTC_6x5_Format=37811,RGBA_ASTC_6x6_Format=37812,RGBA_ASTC_8x5_Format=37813,RGBA_ASTC_8x6_Format=37814,RGBA_ASTC_8x8_Format=37815,RGBA_ASTC_10x5_Format=37816,RGBA_ASTC_10x6_Format=37817,RGBA_ASTC_10x8_Format=37818,RGBA_ASTC_10x10_Format=37819,RGBA_ASTC_12x10_Format=37820,RGBA_ASTC_12x12_Format=37821,RGBA_BPTC_Format=36492,LoopOnce=2200,LoopRepeat=2201,LoopPingPong=2202,InterpolateDiscrete=2300,InterpolateLinear=2301,InterpolateSmooth=2302,ZeroCurvatureEnding=2400,ZeroSlopeEnding=2401,WrapAroundEnding=2402,NormalAnimationBlendMode=2500,AdditiveAnimationBlendMode=2501,TrianglesDrawMode=0,TriangleStripDrawMode=1,TriangleFanDrawMode=2,LinearEncoding=3e3,sRGBEncoding=3001,BasicDepthPacking=3200,RGBADepthPacking=3201,TangentSpaceNormalMap=0,ObjectSpaceNormalMap=1,NoColorSpace="",SRGBColorSpace="srgb",LinearSRGBColorSpace="srgb-linear",ZeroStencilOp=0,KeepStencilOp=7680,ReplaceStencilOp=7681,IncrementStencilOp=7682,DecrementStencilOp=7683,IncrementWrapStencilOp=34055,DecrementWrapStencilOp=34056,InvertStencilOp=5386,NeverStencilFunc=512,LessStencilFunc=513,EqualStencilFunc=514,LessEqualStencilFunc=515,GreaterStencilFunc=516,NotEqualStencilFunc=517,GreaterEqualStencilFunc=518,AlwaysStencilFunc=519,StaticDrawUsage=35044,DynamicDrawUsage=35048,StreamDrawUsage=35040,StaticReadUsage=35045,DynamicReadUsage=35049,StreamReadUsage=35041,StaticCopyUsage=35046,DynamicCopyUsage=35050,StreamCopyUsage=35042,GLSL1="100",GLSL3="300 es",_SRGBAFormat=1035,EventDispatcher=class{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,i=r.length;t>8&255]+_lut[e>>16&255]+_lut[e>>24&255]+"-"+_lut[255&t]+_lut[t>>8&255]+"-"+_lut[t>>16&15|64]+_lut[t>>24&255]+"-"+_lut[63&r|128]+_lut[r>>8&255]+"-"+_lut[r>>16&255]+_lut[r>>24&255]+_lut[255&i]+_lut[i>>8&255]+_lut[i>>16&255]+_lut[i>>24&255]).toLowerCase()}function clamp(e,t,r){return Math.max(t,Math.min(r,e))}function euclideanModulo(e,t){return(e%t+t)%t}function mapLinear(e,t,r,i,n){return i+(e-t)*(n-i)/(r-t)}function inverseLerp(e,t,r){return e!==t?(r-e)/(t-e):0}function lerp(e,t,r){return(1-r)*e+r*t}function damp(e,t,r,i){return lerp(e,t,1-Math.exp(-r*i))}function pingpong(e,t=1){return t-Math.abs(euclideanModulo(e,2*t)-t)}function smoothstep(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)}function smootherstep(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)}function randInt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function randFloat(e,t){return e+Math.random()*(t-e)}function randFloatSpread(e){return e*(.5-Math.random())}function seededRandom(e){void 0!==e&&(_seed=e);let t=_seed+=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 degToRad(e){return e*DEG2RAD}function radToDeg(e){return e*RAD2DEG}function isPowerOfTwo(e){return 0==(e&e-1)&&0!==e}function ceilPowerOfTwo(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function floorPowerOfTwo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function setQuaternionFromProperEuler(e,t,r,i,n){const s=Math.cos,a=Math.sin,o=s(r/2),l=a(r/2),c=s((t+i)/2),u=a((t+i)/2),h=s((t-i)/2),p=a((t-i)/2),d=s((i-t)/2),m=a((i-t)/2);switch(n){case"XYX":e.set(o*u,l*h,l*p,o*c);break;case"YZY":e.set(l*p,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*p,o*u,o*c);break;case"XZX":e.set(o*u,l*m,l*d,o*c);break;case"YXY":e.set(l*d,o*u,l*m,o*c);break;case"ZYZ":e.set(l*m,l*d,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function denormalize(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 normalize(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 MathUtils=Object.freeze({__proto__:null,DEG2RAD:DEG2RAD,RAD2DEG:RAD2DEG,generateUUID:generateUUID,clamp:clamp,euclideanModulo:euclideanModulo,mapLinear:mapLinear,inverseLerp:inverseLerp,lerp:lerp,damp:damp,pingpong:pingpong,smoothstep:smoothstep,smootherstep:smootherstep,randInt:randInt,randFloat:randFloat,randFloatSpread:randFloatSpread,seededRandom:seededRandom,degToRad:degToRad,radToDeg:radToDeg,isPowerOfTwo:isPowerOfTwo,ceilPowerOfTwo:ceilPowerOfTwo,floorPowerOfTwo:floorPowerOfTwo,setQuaternionFromProperEuler:setQuaternionFromProperEuler,normalize:normalize,denormalize:denormalize}),Vector2=class{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),n=this.x-e.x,s=this.y-e.y;return this.x=n*r-s*i+e.x,this.y=n*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Matrix3=class{constructor(){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,i,n,s,a,o,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=t,c[4]=n,c[5]=o,c[6]=r,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,n=this.elements,s=r[0],a=r[3],o=r[6],l=r[1],c=r[4],u=r[7],h=r[2],p=r[5],d=r[8],m=i[0],f=i[3],g=i[6],_=i[1],y=i[4],T=i[7],v=i[2],E=i[5],I=i[8];return n[0]=s*m+a*_+o*v,n[3]=s*f+a*y+o*E,n[6]=s*g+a*T+o*I,n[1]=l*m+c*_+u*v,n[4]=l*f+c*y+u*E,n[7]=l*g+c*T+u*I,n[2]=h*m+p*_+d*v,n[5]=h*f+p*y+d*E,n[8]=h*g+p*T+d*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-r*n*c+r*a*o+i*n*l-i*s*o}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=c*s-a*l,h=a*o-c*n,p=l*n-s*o,d=t*u+r*h+i*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const m=1/d;return e[0]=u*m,e[1]=(i*l-c*r)*m,e[2]=(a*r-i*s)*m,e[3]=h*m,e[4]=(c*t-i*o)*m,e[5]=(i*n-a*t)*m,e[6]=p*m,e[7]=(r*o-l*t)*m,e[8]=(s*t-r*n)*m,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,n,s,a){const o=Math.cos(n),l=Math.sin(n);return this.set(r*o,r*l,-r*(o*s+l*a)+s+e,-i*l,i*o,-i*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),i=this.elements,n=i[0],s=i[3],a=i[6],o=i[1],l=i[4],c=i[7];return i[0]=t*n+r*o,i[3]=t*s+r*l,i[6]=t*a+r*c,i[1]=-r*n+t*o,i[4]=-r*s+t*l,i[7]=-r*a+t*c,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<9;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return(new this.constructor).fromArray(this.elements)}};function arrayNeedsUint32(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function getTypedArray(e,t){return new TYPED_ARRAYS[e](t)}function createElementNS(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function SRGBToLinear(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function LinearToSRGB(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var FN={[SRGBColorSpace]:{[LinearSRGBColorSpace]:SRGBToLinear},[LinearSRGBColorSpace]:{[SRGBColorSpace]:LinearToSRGB}},ColorManagement={legacyMode:!0,get workingColorSpace(){return LinearSRGBColorSpace},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,r){if(this.legacyMode||t===r||!t||!r)return e;if(FN[t]&&void 0!==FN[t][r]){const i=FN[t][r];return e.r=i(e.r),e.g=i(e.g),e.b=i(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)}},_colorKeywords={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},_rgb={r:0,g:0,b:0},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function toComponents(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}var _canvas,Color=class{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)}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=SRGBColorSpace){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ColorManagement.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=LinearSRGBColorSpace){return this.r=e,this.g=t,this.b=r,ColorManagement.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=LinearSRGBColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),r=clamp(r,0,1),0===t)this.r=this.g=this.b=r;else{const i=r<=.5?r*(1+t):r+t-r*t,n=2*r-i;this.r=hue2rgb(n,i,e+1/3),this.g=hue2rgb(n,i,e),this.b=hue2rgb(n,i,e-1/3)}return ColorManagement.toWorkingColorSpace(this,i),this}setStyle(e,t=SRGBColorSpace){function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const n=i[1],s=i[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,ColorManagement.toWorkingColorSpace(this,t),r(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,ColorManagement.toWorkingColorSpace(this,t),r(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const i=parseFloat(e[1])/360,n=parseFloat(e[2])/100,s=parseFloat(e[3])/100;return r(e[4]),this.setHSL(i,n,s,t)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=i[1],r=e.length;if(3===r)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,ColorManagement.toWorkingColorSpace(this,t),this;if(6===r)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,ColorManagement.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=SRGBColorSpace){const r=_colorKeywords[e.toLowerCase()];return void 0!==r?this.setHex(r,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=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=SRGBColorSpace){return ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),e),clamp(255*_rgb.r,0,255)<<16^clamp(255*_rgb.g,0,255)<<8^clamp(255*_rgb.b,0,255)<<0}getHexString(e=SRGBColorSpace){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=LinearSRGBColorSpace){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),t);const r=_rgb.r,i=_rgb.g,n=_rgb.b,s=Math.max(r,i,n),a=Math.min(r,i,n);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=c<=.5?e/(s+a):e/(2-s-a),s){case r:o=(i-n)/e+(i2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),n=i.data;for(let e=0;e1)switch(this.wrapS){case RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case MirroredRepeatWrapping: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 RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case MirroredRepeatWrapping: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)}};Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=UVMapping;var Vector4=class{constructor(e=0,t=0,r=0,i=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}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,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,n=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i+s[12]*n,this.y=s[1]*t+s[5]*r+s[9]*i+s[13]*n,this.z=s[2]*t+s[6]*r+s[10]*i+s[14]*n,this.w=s[3]*t+s[7]*r+s[11]*i+s[15]*n,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,n;const s=.01,a=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],p=o[5],d=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-h)o&&e>_?e_?o=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const n=Math.sqrt(i),s=Math.atan2(n,t*r);e=Math.sin(e*s)/n,a=Math.sin(a*s)/n}const n=a*r;if(o=o*e+h*n,l=l*e+p*n,c=c*e+d*n,u=u*e+m*n,e===1-a){const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,r,i,n,s){const a=r[i],o=r[i+1],l=r[i+2],c=r[i+3],u=n[s],h=n[s+1],p=n[s+2],d=n[s+3];return e[t]=a*d+c*u+o*p-l*h,e[t+1]=o*d+c*h+l*u-a*p,e[t+2]=l*d+c*p+a*h-o*u,e[t+3]=c*d-a*u-o*h-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const r=e._x,i=e._y,n=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(r/2),c=a(i/2),u=a(n/2),h=o(r/2),p=o(i/2),d=o(n/2);switch(s){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],n=t[8],s=t[1],a=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=r+a+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(n-l)*e,this._z=(s-i)*e}else if(r>a&&r>u){const e=2*Math.sqrt(1+r-a-u);this._w=(c-o)/e,this._x=.25*e,this._y=(i+s)/e,this._z=(n+l)/e}else if(a>u){const e=2*Math.sqrt(1+a-r-u);this._w=(n-l)/e,this._x=(i+s)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-r-a);this._w=(s-i)/e,this._x=(n+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(0===r)return this;const i=Math.min(1,t/r);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,i=e._y,n=e._z,s=e._w,a=t._x,o=t._y,l=t._z,c=t._w;return this._x=r*c+s*a+i*l-n*o,this._y=i*c+s*o+n*a-r*l,this._z=n*c+s*l+r*o-i*a,this._w=s*c-r*a-i*o-n*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const r=this._x,i=this._y,n=this._z,s=this._w;let a=s*e._w+r*e._x+i*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=r,this._y=i,this._z=n,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*r+t*this._x,this._y=e*i+t*this._y,this._z=e*n+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=s*u+this._w*h,this._x=r*u+this._x*h,this._y=i*u+this._y*h,this._z=n*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),n=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(n),r*Math.cos(n),t*Math.sin(i))}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}},Vector3=class{constructor(e=0,t=0,r=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return void 0===r&&(r=this.z),this.x=e,this.y=t,this.z=r,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(_quaternion$4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6]*i,this.y=n[1]*t+n[4]*r+n[7]*i,this.z=n[2]*t+n[5]*r+n[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,n=e.elements,s=1/(n[3]*t+n[7]*r+n[11]*i+n[15]);return this.x=(n[0]*t+n[4]*r+n[8]*i+n[12])*s,this.y=(n[1]*t+n[5]*r+n[9]*i+n[13])*s,this.z=(n[2]*t+n[6]*r+n[10]*i+n[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,n=e.x,s=e.y,a=e.z,o=e.w,l=o*t+s*i-a*r,c=o*r+a*t-n*i,u=o*i+n*r-s*t,h=-n*t-s*r-a*i;return this.x=l*o+h*-n+c*-a-u*-s,this.y=c*o+h*-s+u*-n-l*-a,this.z=u*o+h*-a+l*-s-c*-n,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[4]*r+n[8]*i,this.y=n[1]*t+n[5]*r+n[9]*i,this.z=n[2]*t+n[6]*r+n[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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} // TODO lengthSquared? 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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,n=e.z,s=t.x,a=t.y,o=t.z;return this.x=i*o-n*a,this.y=n*s-r*o,this.z=r*a-i*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return _vector$c.copy(this).projectOnVector(e),this.sub(_vector$c)}reflect(e){return this.sub(_vector$c.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(clamp(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}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,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,r=Math.sqrt(1-__pow(e,2));return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},_vector$c=new Vector3,_quaternion$4=new Quaternion,Box3=class{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-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,r=1/0,i=1/0,n=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.length;on&&(n=l),c>s&&(s=c),u>a&&(a=u)}return this.min.set(t,r,i),this.max.set(n,s,a),this}setFromBufferAttribute(e){let t=1/0,r=1/0,i=1/0,n=-1/0,s=-1/0,a=-1/0;for(let o=0,l=e.count;on&&(n=l),c>s&&(s=c),u>a&&(a=u)}return this.min.set(t,r,i),this.max.set(n,s,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,_vector$b),_vector$b.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(e.a,_center),_v1$7.subVectors(e.b,_center),_v2$4.subVectors(e.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$4,_v1$7),_f2.subVectors(_v0$2,_v2$4);let t=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents)&&(t=[1,0,0,0,1,0,0,0,1],!!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents)&&(_triangleNormal.crossVectors(_f0,_f1),t=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(t,_v0$2,_v1$7,_v2$4,_extents)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return _vector$b.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(_vector$b).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()||(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_points)),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)}},_points=[ new Vector3, new Vector3, new Vector3, new Vector3, new Vector3, new Vector3, new Vector3, new Vector3],_vector$b=new Vector3,_box$3=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$4=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(e,t,r,i,n){for(let s=0,a=e.length-3;s<=a;s+=3){_testAxis.fromArray(e,s);const a=n.x*Math.abs(_testAxis.x)+n.y*Math.abs(_testAxis.y)+n.z*Math.abs(_testAxis.z),o=t.dot(_testAxis),l=r.dot(_testAxis),c=i.dot(_testAxis);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}var _box$2=new Box3,_v1$6=new Vector3,_v2$3=new Vector3,Sphere=class{constructor(e=new Vector3,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;void 0!==t?r.copy(t):_box$2.setFromPoints(e).getCenter(r);let i=0;for(let t=0,n=e.length;tthis.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;_v1$6.subVectors(e,this.center);const t=_v1$6.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),r=.5*(e-this.radius);this.center.addScaledVector(_v1$6,r/e),this.radius+=r}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):(_v2$3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_v1$6.copy(e.center).add(_v2$3)),this.expandByPoint(_v1$6.copy(e.center).sub(_v2$3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}},_vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3,Ray=class{constructor(e=new Vector3,t=new Vector3(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,_vector$a)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=_vector$a.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_vector$a.copy(this.direction).multiplyScalar(t).add(this.origin),_vector$a.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){_segCenter.copy(e).add(t).multiplyScalar(.5),_segDir.copy(t).sub(e).normalize(),_diff.copy(this.origin).sub(_segCenter);const n=.5*e.distanceTo(t),s=-this.direction.dot(_segDir),a=_diff.dot(this.direction),o=-_diff.dot(_segDir),l=_diff.lengthSq(),c=Math.abs(1-s*s);let u,h,p,d;if(c>0)if(u=s*o-a,h=s*a-o,d=n*c,u>=0)if(h>=-d)if(h<=d){const e=1/c;u*=e,h*=e,p=u*(u+s*h+2*a)+h*(s*u+h+2*o)+l}else h=n,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;else h=-n,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;else h<=-d?(u=Math.max(0,-(-s*n+a)),h=u>0?-n:Math.min(Math.max(-n,-o),n),p=-u*u+h*(h+2*o)+l):h<=d?(u=0,h=Math.min(Math.max(-n,-o),n),p=h*(h+2*o)+l):(u=Math.max(0,-(s*n+a)),h=u>0?n:Math.min(Math.max(-n,-o),n),p=-u*u+h*(h+2*o)+l);else h=s>0?-n:n,u=Math.max(0,-(s*h+a)),p=-u*u+h*(h+2*o)+l;return r&&r.copy(this.direction).multiplyScalar(u).add(this.origin),i&&i.copy(_segDir).multiplyScalar(h).add(_segCenter),p}intersectSphere(e,t){_vector$a.subVectors(e.center,this.origin);const r=_vector$a.dot(this.direction),i=_vector$a.dot(_vector$a)-r*r,n=e.radius*e.radius;if(i>n)return null;const s=Math.sqrt(n-i),a=r-s,o=r+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){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return null===r?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,n,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(r=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(r=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(n=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(n=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),r>s||n>i?null:((n>r||isNaN(r))&&(r=n),(s=0?(a=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),r>o||a>i?null:((a>r||r!=r)&&(r=a),(o=0?r:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,_vector$a)}intersectTriangle(e,t,r,i,n){_edge1.subVectors(t,e),_edge2.subVectors(r,e),_normal$1.crossVectors(_edge1,_edge2);let s,a=this.direction.dot(_normal$1);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}_diff.subVectors(this.origin,e);const o=s*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(o<0)return null;const l=s*this.direction.dot(_edge1.cross(_diff));if(l<0)return null;if(o+l>a)return null;const c=-s*_diff.dot(_normal$1);return c<0?null:this.at(c/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)}},Matrix4=class{constructor(){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=i,g[1]=n,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/_v1$5.setFromMatrixColumn(e,0).length(),n=1/_v1$5.setFromMatrixColumn(e,1).length(),s=1/_v1$5.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*n,t[5]=r[5]*n,t[6]=r[6]*n,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,n=e.z,s=Math.cos(r),a=Math.sin(r),o=Math.cos(i),l=Math.sin(i),c=Math.cos(n),u=Math.sin(n);if("XYZ"===e.order){const e=s*c,r=s*u,i=a*c,n=a*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=r+i*l,t[5]=e-n*l,t[9]=-a*o,t[2]=n-e*l,t[6]=i+r*l,t[10]=s*o}else if("YXZ"===e.order){const e=o*c,r=o*u,i=l*c,n=l*u;t[0]=e+n*a,t[4]=i*a-r,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-a,t[2]=r*a-i,t[6]=n+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*c,r=o*u,i=l*c,n=l*u;t[0]=e-n*a,t[4]=-s*u,t[8]=i+r*a,t[1]=r+i*a,t[5]=s*c,t[9]=n-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*c,r=s*u,i=a*c,n=a*u;t[0]=o*c,t[4]=i*l-r,t[8]=e*l+n,t[1]=o*u,t[5]=n*l+e,t[9]=r*l-i,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,r=s*l,i=a*o,n=a*l;t[0]=o*c,t[4]=n-e*u,t[8]=i*u+r,t[1]=u,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=r*u+i,t[10]=e-n*u}else if("XZY"===e.order){const e=s*o,r=s*l,i=a*o,n=a*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+n,t[5]=s*c,t[9]=r*u-i,t[2]=i*u-r,t[6]=a*c,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(_zero,e,_one)}lookAt(e,t,r){const i=this.elements;return _z.subVectors(e,t),0===_z.lengthSq()&&(_z.z=1),_z.normalize(),_x.crossVectors(r,_z),0===_x.lengthSq()&&(1===Math.abs(r.z)?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(r,_z)),_x.normalize(),_y.crossVectors(_z,_x),i[0]=_x.x,i[4]=_y.x,i[8]=_z.x,i[1]=_x.y,i[5]=_y.y,i[9]=_z.y,i[2]=_x.z,i[6]=_y.z,i[10]=_z.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,n=this.elements,s=r[0],a=r[4],o=r[8],l=r[12],c=r[1],u=r[5],h=r[9],p=r[13],d=r[2],m=r[6],f=r[10],g=r[14],_=r[3],y=r[7],T=r[11],v=r[15],E=i[0],I=i[4],b=i[8],x=i[12],S=i[1],w=i[5],C=i[9],M=i[13],R=i[2],A=i[6],D=i[10],O=i[14],L=i[3],P=i[7],N=i[11],F=i[15];return n[0]=s*E+a*S+o*R+l*L,n[4]=s*I+a*w+o*A+l*P,n[8]=s*b+a*C+o*D+l*N,n[12]=s*x+a*M+o*O+l*F,n[1]=c*E+u*S+h*R+p*L,n[5]=c*I+u*w+h*A+p*P,n[9]=c*b+u*C+h*D+p*N,n[13]=c*x+u*M+h*O+p*F,n[2]=d*E+m*S+f*R+g*L,n[6]=d*I+m*w+f*A+g*P,n[10]=d*b+m*C+f*D+g*N,n[14]=d*x+m*M+f*O+g*F,n[3]=_*E+y*S+T*R+v*L,n[7]=_*I+y*w+T*A+v*P,n[11]=_*b+y*C+T*D+v*N,n[15]=_*x+y*M+T*O+v*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],n=e[12],s=e[1],a=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+n*o*u-i*l*u-n*a*h+r*l*h+i*a*p-r*o*p)+e[7]*(+t*o*p-t*l*h+n*s*h-i*s*p+i*l*c-n*o*c)+e[11]*(+t*l*u-t*a*p-n*s*u+r*s*p+n*a*c-r*l*c)+e[15]*(-i*a*c-t*o*u+t*a*h+i*s*u-r*s*h+r*o*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],m=e[13],f=e[14],g=e[15],_=u*f*l-m*h*l+m*o*p-a*f*p-u*o*g+a*h*g,y=d*h*l-c*f*l-d*o*p+s*f*p+c*o*g-s*h*g,T=c*m*l-d*u*l+d*a*p-s*m*p-c*a*g+s*u*g,v=d*u*o-c*m*o-d*a*h+s*m*h+c*a*f-s*u*f,E=t*_+r*y+i*T+n*v;if(0===E)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/E;return e[0]=_*I,e[1]=(m*h*n-u*f*n-m*i*p+r*f*p+u*i*g-r*h*g)*I,e[2]=(a*f*n-m*o*n+m*i*l-r*f*l-a*i*g+r*o*g)*I,e[3]=(u*o*n-a*h*n-u*i*l+r*h*l+a*i*p-r*o*p)*I,e[4]=y*I,e[5]=(c*f*n-d*h*n+d*i*p-t*f*p-c*i*g+t*h*g)*I,e[6]=(d*o*n-s*f*n-d*i*l+t*f*l+s*i*g-t*o*g)*I,e[7]=(s*h*n-c*o*n+c*i*l-t*h*l-s*i*p+t*o*p)*I,e[8]=T*I,e[9]=(d*u*n-c*m*n-d*r*p+t*m*p+c*r*g-t*u*g)*I,e[10]=(s*m*n-d*a*n+d*r*l-t*m*l-s*r*g+t*a*g)*I,e[11]=(c*a*n-s*u*n-c*r*l+t*u*l+s*r*p-t*a*p)*I,e[12]=v*I,e[13]=(c*m*i-d*u*i+d*r*h-t*m*h-c*r*f+t*u*f)*I,e[14]=(d*a*i-s*m*i-d*r*o+t*m*o+s*r*f-t*a*f)*I,e[15]=(s*u*i-c*a*i+c*r*o-t*u*o-s*r*h+t*a*h)*I,this}scale(e){const t=this.elements,r=e.x,i=e.y,n=e.z;return t[0]*=r,t[4]*=i,t[8]*=n,t[1]*=r,t[5]*=i,t[9]*=n,t[2]*=r,t[6]*=i,t[10]*=n,t[3]*=r,t[7]*=i,t[11]*=n,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),n=1-r,s=e.x,a=e.y,o=e.z,l=n*s,c=n*a;return this.set(l*s+r,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+r,c*o-i*s,0,l*o-i*a,c*o+i*s,n*o*o+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,n,s){return this.set(1,r,n,0,e,1,s,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,n=t._x,s=t._y,a=t._z,o=t._w,l=n+n,c=s+s,u=a+a,h=n*l,p=n*c,d=n*u,m=s*c,f=s*u,g=a*u,_=o*l,y=o*c,T=o*u,v=r.x,E=r.y,I=r.z;return i[0]=(1-(m+g))*v,i[1]=(p+T)*v,i[2]=(d-y)*v,i[3]=0,i[4]=(p-T)*E,i[5]=(1-(h+g))*E,i[6]=(f+_)*E,i[7]=0,i[8]=(d+y)*I,i[9]=(f-_)*I,i[10]=(1-(h+m))*I,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let n=_v1$5.set(i[0],i[1],i[2]).length();const s=_v1$5.set(i[4],i[5],i[6]).length(),a=_v1$5.set(i[8],i[9],i[10]).length();this.determinant()<0&&(n=-n),e.x=i[12],e.y=i[13],e.z=i[14],_m1$2.copy(this);const o=1/n,l=1/s,c=1/a;return _m1$2.elements[0]*=o,_m1$2.elements[1]*=o,_m1$2.elements[2]*=o,_m1$2.elements[4]*=l,_m1$2.elements[5]*=l,_m1$2.elements[6]*=l,_m1$2.elements[8]*=c,_m1$2.elements[9]*=c,_m1$2.elements[10]*=c,t.setFromRotationMatrix(_m1$2),r.x=n,r.y=s,r.z=a,this}makePerspective(e,t,r,i,n,s){const a=this.elements,o=2*n/(t-e),l=2*n/(r-i),c=(t+e)/(t-e),u=(r+i)/(r-i),h=-(s+n)/(s-n),p=-2*s*n/(s-n);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,i,n,s){const a=this.elements,o=1/(t-e),l=1/(r-i),c=1/(s-n),u=(t+e)*o,h=(r+i)*l,p=(s+n)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let e=0;e<16;e++)if(t[e]!==r[e])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}},_v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$1=new Matrix4,_quaternion$3=new Quaternion,Euler=class{constructor(e=0,t=0,r=0,i=Euler.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}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,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,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,r=!0){const i=e.elements,n=i[0],s=i[4],a=i[8],o=i[1],l=i[5],c=i[9],u=i[2],h=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin(clamp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(c,-1,1)),Math.abs(c)<.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(clamp(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,n));break;case"ZYX":this._y=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(o,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,n)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-clamp(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,n)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===r&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return _matrix$1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_matrix$1,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,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} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53 toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}};Euler.DefaultOrder="XYZ",Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Layers=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0){i.children=[];for(let t=0;t0){i.animations=[];for(let t=0;t0&&(r.geometries=t),i.length>0&&(r.materials=i),n.length>0&&(r.textures=n),a.length>0&&(r.images=a),o.length>0&&(r.shapes=o),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),u.length>0&&(r.nodes=u)}return r.object=i,r;function s(e){const t=[];for(const r in e){const i=e[r];delete i.metadata,t.push(i)}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 t=0;t0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)} // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html static getBarycoord(e,t,r,i,n){_v0$1.subVectors(i,t),_v1$3.subVectors(r,t),_v2$2.subVectors(e,t);const s=_v0$1.dot(_v0$1),a=_v0$1.dot(_v1$3),o=_v0$1.dot(_v2$2),l=_v1$3.dot(_v1$3),c=_v1$3.dot(_v2$2),u=s*l-a*a;if(0===u)return n.set(-2,-1,-1);const h=1/u,p=(l*o-a*c)*h,d=(s*c-a*o)*h;return n.set(1-p-d,d,p)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,_v3$1),_v3$1.x>=0&&_v3$1.y>=0&&_v3$1.x+_v3$1.y<=1}static getUV(e,t,r,i,n,s,a,o){return this.getBarycoord(e,t,r,i,_v3$1),o.set(0,0),o.addScaledVector(n,_v3$1.x),o.addScaledVector(s,_v3$1.y),o.addScaledVector(a,_v3$1.z),o}static isFrontFacing(e,t,r,i){return _v0$1.subVectors(r,t),_v1$3.subVectors(e,t),_v0$1.cross(_v1$3).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),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 _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),.5*_v0$1.cross(_v1$3).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,i,n){return Triangle.getUV(e,this.a,this.b,this.c,t,r,i,n)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,n=this.c;let s,a;_vab.subVectors(i,r),_vac.subVectors(n,r),_vap.subVectors(e,r);const o=_vab.dot(_vap),l=_vac.dot(_vap);if(o<=0&&l<=0)return t.copy(r);_vbp.subVectors(e,i);const c=_vab.dot(_vbp),u=_vac.dot(_vbp);if(c>=0&&u<=c)return t.copy(i);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return s=o/(o-c),t.copy(r).addScaledVector(_vab,s);_vcp.subVectors(e,n);const p=_vab.dot(_vcp),d=_vac.dot(_vcp);if(d>=0&&p<=d)return t.copy(n);const m=p*l-o*d;if(m<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(r).addScaledVector(_vac,a);const f=c*d-p*u;if(f<=0&&u-c>=0&&p-d>=0)return _vbc.subVectors(n,i),a=(u-c)/(u-c+(p-d)),t.copy(i).addScaledVector(_vbc,a);const g=1/(f+m+h);return s=m*g,a=h*g,t.copy(r).addScaledVector(_vab,s).addScaledVector(_vac,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},materialId=0,Material=class extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:materialId++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const r=e[t];if(void 0===r){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(e){const t=[];for(const r in e){const i=e[r];delete i.metadata,t.push(i)}return t}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(r.blending=this.blending),this.side!==FrontSide&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(r.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=this.flatShading),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){const t=i(e.textures),n=i(e.images);t.length>0&&(r.textures=t),n.length>0&&(r.images=n)}return r}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(null!==t){const e=t.length;r=new Array(e);for(let i=0;i!==e;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}},MeshBasicMaterial=class extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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=MultiplyOperation,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}},_vector$9=new Vector3,_vector2$1=new Vector2,BufferAttribute=class{constructor(e,t,r){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=!0===r,this.usage=StaticDrawUsage,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,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,n=this.itemSize;i0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const t in r){const i=r[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let n=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],s=[];for(let t=0,i=r.length;t0&&(i[t]=s,n=!0)}n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;null!==r&&this.setIndex(r.clone(t));const i=e.attributes;for(const e in i){const r=i[e];this.setAttribute(e,r.clone(t))}const n=e.morphAttributes;for(const e in n){const r=[],i=n[e];for(let e=0,n=i.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;er.far?null:{distance:c,point:_intersectionPointWorld.clone(),object:e}}function checkBufferGeometryIntersection(e,t,r,i,n,s,a,o,l,c,u,h){_vA$1.fromBufferAttribute(n,c),_vB$1.fromBufferAttribute(n,u),_vC$1.fromBufferAttribute(n,h);const p=e.morphTargetInfluences;if(s&&p){_morphA.set(0,0,0),_morphB.set(0,0,0),_morphC.set(0,0,0);for(let e=0,t=s.length;e0?1:-1,c.push(C.x,C.y,C.z),u.push(o/f),u.push(1-s/g),S+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}},Camera=class extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}},PerspectiveCamera=class extends Camera{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,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} /** * Sets the FOV by focal length in respect to the current .filmGauge. * * The default film gauge is 35, so that the focal length can be specified for * a 35mm (full frame) camera. * * Values for focal length and film gauge must have the same unit. */setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*RAD2DEG*Math.atan(t),this.updateProjectionMatrix()} /** * Calculates the focal length from the current .fov and .filmGauge. */getFocalLength(){const e=Math.tan(.5*DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*RAD2DEG*Math.atan(Math.tan(.5*DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)} /** * Sets an offset in a larger frustum. This is useful for multi-window or * multi-monitor/multi-machine setups. * * For example, if you have 3x2 monitors and each monitor is 1920x1080 and * the monitors are in grid like this * * +---+---+---+ * | A | B | C | * +---+---+---+ * | D | E | F | * +---+---+---+ * * then for each monitor you would call it like this * * const w = 1920; * const h = 1080; * const fullWidth = w * 3; * const fullHeight = h * 2; * * --A-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); * --B-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); * --C-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); * --D-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); * --E-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); * --F-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); * * Note there is no reason monitors have to be the same size or in a grid. */setViewOffset(e,t,r,i,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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*DEG2RAD*this.fov)/this.zoom,r=2*t,i=this.aspect*r,n=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;n+=s.offsetX*i/e,t-=s.offsetY*r/a,i*=s.width/e,r*=s.height/a}const a=this.filmOffset;0!==a&&(n+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},fov=90,aspect=1,CubeCamera=class extends Object3D{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new PerspectiveCamera(fov,aspect,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Vector3(1,0,0)),this.add(i);const n=new PerspectiveCamera(fov,aspect,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Vector3(-1,0,0)),this.add(n);const s=new PerspectiveCamera(fov,aspect,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Vector3(0,1,0)),this.add(s);const a=new PerspectiveCamera(fov,aspect,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Vector3(0,-1,0)),this.add(a);const o=new PerspectiveCamera(fov,aspect,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Vector3(0,0,1)),this.add(o);const l=new PerspectiveCamera(fov,aspect,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Vector3(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const r=this.renderTarget,[i,n,s,a,o,l]=this.children,c=e.getRenderTarget(),u=e.toneMapping,h=e.xr.enabled;e.toneMapping=NoToneMapping,e.xr.enabled=!1;const p=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,n),e.setRenderTarget(r,2),e.render(t,s),e.setRenderTarget(r,3),e.render(t,a),e.setRenderTarget(r,4),e.render(t,o),r.texture.generateMipmaps=p,e.setRenderTarget(r,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=u,e.xr.enabled=h,r.texture.needsPMREMUpdate=!0}},CubeTexture=class extends Texture{constructor(e,t,r,i,n,s,a,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:CubeReflectionMapping,r,i,n,s,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},WebGLCubeRenderTarget=class extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new CubeTexture(i,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:LinearFilter}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader: /* glsl */ "\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader: /* glsl */ "\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \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 BoxGeometry(5,5,5),n=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:BackSide,blending:NoBlending});n.uniforms.tEquirect.value=t;const s=new Mesh(i,n),a=t.minFilter;t.minFilter===LinearMipmapLinearFilter&&(t.minFilter=LinearFilter);return new CubeCamera(1,10,this).update(e,s),t.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,r,i){const n=e.getRenderTarget();for(let n=0;n<6;n++)e.setRenderTarget(this,n),e.clear(t,r,i);e.setRenderTarget(n)}},_vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3,Plane=class{constructor(e=new Vector3(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,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=_vector1.subVectors(r,t).cross(_vector2.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const r=e.delta(_vector1),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const n=-(e.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:t.copy(r).multiplyScalar(n).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||_normalMatrix.getNormalMatrix(e),i=this.coplanarPoint(_vector1).applyMatrix4(e),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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)}},_sphere$2=new Sphere,_vector$7=new Vector3,Frustum=class{constructor(e=new Plane,t=new Plane,r=new Plane,i=new Plane,n=new Plane,s=new Plane){this.planes=[e,t,r,i,n,s]}set(e,t,r,i,n,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(n),a[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,i=r[0],n=r[1],s=r[2],a=r[3],o=r[4],l=r[5],c=r[6],u=r[7],h=r[8],p=r[9],d=r[10],m=r[11],f=r[12],g=r[13],_=r[14],y=r[15];return t[0].setComponents(a-i,u-o,m-h,y-f).normalize(),t[1].setComponents(a+i,u+o,m+h,y+f).normalize(),t[2].setComponents(a+n,u+l,m+p,y+g).normalize(),t[3].setComponents(a-n,u-l,m-p,y-g).normalize(),t[4].setComponents(a-s,u-c,m-d,y-_).normalize(),t[5].setComponents(a+s,u+c,m+d,y+_).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),_sphere$2.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$2)}intersectsSprite(e){return _sphere$2.center.set(0,0,0),_sphere$2.radius=.7071067811865476,_sphere$2.applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$2)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(r)0?e.max.x:e.min.x,_vector$7.y=i.normal.y>0?e.max.y:e.min.y,_vector$7.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(_vector$7)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function WebGLAnimation(){let e=null,t=!1,r=null,i=null;function n(t,s){r(t,s),i=e.requestAnimationFrame(n)}return{start:function(){!0!==t&&null!==r&&(i=e.requestAnimationFrame(n),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function WebGLAttributes(e,t){const r=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const r=i.get(t);r&&(e.deleteBuffer(r.buffer),i.delete(t))},update:function(t,n){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.version0?r:t).get(f)}const g=e.xr,_=g.getSession&&g.getSession();_&&"additive"===_.environmentBlendMode&&(f=null),null===f?m(o,u):f&&f.isColor&&(m(f,1),a=!0),(e.autoClear||a)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.mapping===CubeUVReflectionMapping)?(void 0===c&&(c=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=f,c.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,h===f&&p===f.version&&d===e.toneMapping||(c.material.needsUpdate=!0,h=f,p=f.version,d=e.toneMapping),c.layers.enableAll(),i.unshift(c,c.geometry,c.material,0,0,null)):f&&f.isTexture&&(void 0===l&&(l=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),l.material.uniforms.uvTransform.value.copy(f.matrix),h===f&&p===f.version&&d===e.toneMapping||(l.material.needsUpdate=!0,h=f,p=f.version,d=e.toneMapping),l.layers.enableAll(),i.unshift(l,l.geometry,l.material,0,0,null))}}}function WebGLBindingStates(e,t,r,i){const n=e.getParameter(34921),s=i.isWebGL2?null:t.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=d(null);let c=l,u=!1;function h(t){return i.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function p(t){return i.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){const t=[],r=[],i=[];for(let e=0;e=0){const r=n[t];let i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===r)return!0;if(r.attribute!==i)return!0;if(i&&r.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(n,T,p,v),E&&function(e,t,r,i){const n={},s=t.attributes;let a=0;const o=r.getAttributes();for(const t in o){if(o[t].location>=0){let r=s[t];void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor));const i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[t]=i,a++}}c.attributes=n,c.attributesNum=a,c.index=i}(n,T,p,v)}else{const e=!0===l.wireframe;c.geometry===T.id&&c.program===p.id&&c.wireframe===e||(c.geometry=T.id,c.program=p.id,c.wireframe=e,E=!0)}null!==v&&r.update(v,34963),(E||u)&&(u=!1,function(n,s,a,o){if(!1===i.isWebGL2&&(n.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),u=s.defaultAttributeValues;for(const t in c){const i=c[t];if(i.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){const t=s.normalized,a=s.itemSize,l=r.get(s);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const r=s.data,l=r.stride,p=s.offset;if(r.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==r.precision?r.precision:"highp";const o=n(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||t.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),p=e.getParameter(3379),d=e.getParameter(34076),m=e.getParameter(34921),f=e.getParameter(36347),g=e.getParameter(36348),_=e.getParameter(36349),y=h>0,T=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:n,precision:a,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:T,floatVertexTextures:y&&T,maxSamples:s?e.getParameter(36183):0}}function WebGLClipping(e){const t=this;let r=null,i=0,n=!1,s=!1;const a=new Plane,o=new Matrix3,l={value:null,needsUpdate:!1};function c(){l.value!==r&&(l.value=r,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(e,r,i,n){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==n||null===c){const t=i+4*s,n=r.matrixWorldInverse;o.getNormalMatrix(n),(null===c||c.length0){const a=new WebGLCubeRenderTarget(s.height/2);return a.fromEquirectangularTexture(e,n),t.set(n,a),n.addEventListener("dispose",i),r(a.texture,n.mapping)}return null}}}return n},dispose:function(){t=new WeakMap}}}ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};var OrthographicCamera=class extends Camera{constructor(e=-1,t=1,r=1,i=-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=r,this.bottom=i,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,r,i,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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=r-e,s=r+e,a=i+t,o=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;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){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}},LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color,_oldTarget=null,PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[ new Vector3(1,1,1), new Vector3(-1,1,1), new Vector3(1,1,-1), new Vector3(-1,1,-1), new Vector3(0,PHI,INV_PHI), new Vector3(0,PHI,-INV_PHI), new Vector3(INV_PHI,0,PHI), new Vector3(-INV_PHI,0,PHI), new Vector3(PHI,INV_PHI,0), new Vector3(-PHI,INV_PHI,0)],PMREMGenerator=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)} /** * Generates a PMREM from a supplied Scene, which can be faster than using an * image if networking bandwidth is low. Optional sigma specifies a blur radius * in radians to be applied to the scene before PMREM generation. Optional near * and far planes ensure the scene is rendered in its entirety (the cubeCamera * is placed at the origin). */fromScene(e,t=0,r=.1,i=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(e,r,i,n),t>0&&this._blur(n,0,0,t),this._applyPMREM(n),this._cleanup(n),n} /** * Generates a PMREM from an equirectangular texture, which can be either LDR * or HDR. The ideal input image size is 1k (1024 x 512), * as this matches best with the 256 x 256 cubemap output. */fromEquirectangular(e,t=null){return this._fromTexture(e,t)} /** * Generates a PMREM from an cubemap texture, which can be either LDR * or HDR. The ideal input cube size is 256 x 256, * as this matches best with the 256 x 256 cubemap output. */fromCubemap(e,t=null){return this._fromTexture(e,t)} /** * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))} /** * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))} /** * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on * one of them will cause any others to also become unusable. */dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()} // private interface _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;e2?l:0,l,l),o.setRenderTarget(i),p&&o.render(h,n),o.render(e,n)}h.geometry.dispose(),h.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=d}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===CubeReflectionMapping||e.mapping===CubeRefractionMapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const n=i?this._cubemapMaterial:this._equirectMaterial,s=new Mesh(this._lodPlanes[0],n);n.uniforms.envMap.value=e;const a=this._cubeSize;_setViewport(t,0,0,3*a,2*a),r.setRenderTarget(t),r.render(s,_flatCamera)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let t=1;tMAX_SAMPLES&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${MAX_SAMPLES}`);const f=[];let g=0;for(let e=0;e_-LOD_MIN?i-_+LOD_MIN:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(t),o.render(c,_flatCamera)}};function _createPlanes(e){const t=[],r=[],i=[];let n=e;const s=e-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let a=0;ae-LOD_MIN?o=EXTRA_LOD_SIGMA[a-e+LOD_MIN-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],p=6,d=6,m=3,f=2,g=1,_=new Float32Array(m*d*p),y=new Float32Array(f*d*p),T=new Float32Array(g*d*p);for(let e=0;e2?0:-1,i=[t,r,0,t+2/3,r,0,t+2/3,r+1,0,t,r,0,t+2/3,r+1,0,t,r+1,0];_.set(i,m*d*e),y.set(h,f*d*e);const n=[e,e,e,e,e,e];T.set(n,g*d*e)}const v=new BufferGeometry;v.setAttribute("position",new BufferAttribute(_,m)),v.setAttribute("uv",new BufferAttribute(y,f)),v.setAttribute("faceIndex",new BufferAttribute(T,g)),t.push(v),n>LOD_MIN&&n--}return{lodPlanes:t,sizeLods:r,sigmas:i}}function _createRenderTarget(e,t,r){const i=new WebGLRenderTarget(e,t,r);return i.texture.mapping=CubeUVReflectionMapping,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function _setViewport(e,t,r,i,n){e.viewport.set(t,r,i,n),e.scissor.set(t,r,i,n)}function _getBlurShader(e,t,r){const i=new Float32Array(MAX_SAMPLES),n=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:_getCommonVertexShader(),fragmentShader: /* glsl */ "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:NoBlending,depthTest:!1,depthWrite:!1})}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader: /* glsl */ "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:NoBlending,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader: /* glsl */ "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:NoBlending,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){ /* glsl */ 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 WebGLCubeUVMaps(e){let t=new WeakMap,r=null;function i(e){const r=e.target;r.removeEventListener("dispose",i);const n=t.get(r);void 0!==n&&(t.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping,a=s===EquirectangularReflectionMapping||s===EquirectangularRefractionMapping,o=s===CubeReflectionMapping||s===CubeRefractionMapping;if(a||o){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let i=t.get(n);return null===r&&(r=new PMREMGenerator(e)),i=a?r.fromEquirectangular(n,i):r.fromCubemap(n,i),t.set(n,i),i.texture}if(t.has(n))return t.get(n).texture;{const s=n.image;if(a&&s&&s.height>0||o&&s&&function(e){let t=0;const r=6;for(let i=0;it.maxTextureSize&&(f=Math.ceil(m/t.maxTextureSize),m=t.maxTextureSize);const g=new Float32Array(m*f*4*n),_=new DataArrayTexture(g,m,f,n);_.type=FloatType,_.needsUpdate=!0;const y=4*d;for(let e=0;e0)return e;const n=t*r;let s=arrayCacheF32[n];if(void 0===s&&(s=new Float32Array(n),arrayCacheF32[n]=s),0!==t){i.toArray(s,0);for(let i=1,n=0;i!==t;++i)n+=r,e[i].toArray(s,n)}return s}function arraysEqual(e,t){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r":" "} ${n}: ${r[e]}`)}return i.join("\n")}function getEncodingComponents(e){switch(e){case LinearEncoding:return["Linear","( value )"];case sRGBEncoding:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function getShaderErrors(e,t,r){const i=e.getShaderParameter(t,35713),n=e.getShaderInfoLog(t).trim();if(i&&""===n)return"";const s=/ERROR: 0:(\d+)/.exec(n);if(s){const i=parseInt(s[1]);return r.toUpperCase()+"\n\n"+n+"\n\n"+handleSource(e.getShaderSource(t),i)}return n}function getTexelEncodingFunction(e,t){const r=getEncodingComponents(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function getToneMappingFunction(e,t){let r;switch(t){case LinearToneMapping:r="Linear";break;case ReinhardToneMapping:r="Reinhard";break;case CineonToneMapping:r="OptimizedCineon";break;case ACESFilmicToneMapping:r="ACESFilmic";break;case CustomToneMapping:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),r="Linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function generateExtensions(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(filterEmptyLine).join("\n")}function generateDefines(e){const t=[];for(const r in e){const i=e[r];!1!==i&&t.push("#define "+r+" "+i)}return t.join("\n")}function fetchAttributeLocations(e,t){const r={},i=e.getProgramParameter(t,35721);for(let n=0;n/gm;function resolveIncludes(e){return e.replace(includePattern,includeReplacer)}function includeReplacer(e,t){const r=ShaderChunk[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return resolveIncludes(r)}var unrollLoopPattern=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function unrollLoops(e){return e.replace(unrollLoopPattern,loopReplacer)}function loopReplacer(e,t,r,i){let n="";for(let e=parseInt(t);e0&&(g+="\n"),_=[d,m].filter(filterEmptyLine).join("\n"),_.length>0&&(_+="\n")):(g=[generatePrecision(r),"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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(filterEmptyLine).join("\n"),_=[d,generatePrecision(r),"#define SHADER_NAME "+r.shaderName,m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+u:"",r.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==NoToneMapping?"#define TONE_MAPPING":"",r.toneMapping!==NoToneMapping?ShaderChunk.tonemapping_pars_fragment:"",r.toneMapping!==NoToneMapping?getToneMappingFunction("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",ShaderChunk.encodings_pars_fragment, // this code is required here because it is used by the various encoding/decoding function defined below getTexelEncodingFunction("linearToOutputTexel",r.outputEncoding),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),a=resolveIncludes(a),a=replaceLightNums(a,r),a=replaceClippingPlaneNums(a,r),o=resolveIncludes(o),o=replaceLightNums(o,r),o=replaceClippingPlaneNums(o,r),a=unrollLoops(a),o=unrollLoops(o),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(y="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,_=["#define varying in",r.glslVersion===GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===GLSL3?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_);const T=y+_+o,v=WebGLShader(n,35633,y+g+a),E=WebGLShader(n,35632,T);if(n.attachShader(f,v),n.attachShader(f,E),void 0!==r.index0AttributeName?n.bindAttribLocation(f,0,r.index0AttributeName):!0===r.morphTargets&&n.bindAttribLocation(f,0,"position"),n.linkProgram(f),e.debug.checkShaderErrors){const e=n.getProgramInfoLog(f).trim(),t=n.getShaderInfoLog(v).trim(),r=n.getShaderInfoLog(E).trim();let i=!0,s=!0;if(!1===n.getProgramParameter(f,35714)){i=!1;const t=getShaderErrors(n,v,"vertex"),r=getShaderErrors(n,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+r)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==r||(s=!1);s&&(this.diagnostics={runnable:i,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:r,prefix:_}})}let I,b;return n.deleteShader(v),n.deleteShader(E),this.getUniforms=function(){return void 0===I&&(I=new WebGLUniforms(n,f)),I},this.getAttributes=function(){return void 0===b&&(b=fetchAttributeLocations(n,f)),b},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(f),this.program=void 0},this.name=r.shaderName,this.id=programIdCount++,this.cacheKey=t,this.usedTimes=1,this.program=f,this.vertexShader=v,this.fragmentShader=E,this}var _id=0,WebGLShaderCache=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),n=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return!1===s.has(i)&&(s.add(i),i.usedTimes++),!1===s.has(n)&&(s.add(n),n.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return void 0===r&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return void 0===r&&(r=new WebGLShaderStage(e),t.set(e,r)),r}},WebGLShaderStage=class{constructor(e){this.id=_id++,this.code=e,this.usedTimes=0}};function WebGLPrograms(e,t,r,i,n,s,a){const o=new Layers,l=new WebGLShaderCache,c=[],u=n.isWebGL2,h=n.logarithmicDepthBuffer,p=n.vertexTextures;let d=n.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(s,o,c,f,g){const _=f.fog,y=g.geometry,T=s.isMeshStandardMaterial?f.environment:null,v=(s.isMeshStandardMaterial?r:t).get(s.envMap||T),E=v&&v.mapping===CubeUVReflectionMapping?v.image.height:null,I=m[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."));const b=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,x=void 0!==b?b.length:0;let S,w,C,M,R=0;if(void 0!==y.morphAttributes.position&&(R=1),void 0!==y.morphAttributes.normal&&(R=2),void 0!==y.morphAttributes.color&&(R=3),I){const e=ShaderLib[I];S=e.vertexShader,w=e.fragmentShader}else S=s.vertexShader,w=s.fragmentShader,l.update(s),C=l.getVertexShaderID(s),M=l.getFragmentShaderID(s);const A=e.getRenderTarget(),D=s.alphaTest>0,O=s.clearcoat>0,L=s.iridescence>0;return{isWebGL2:u,shaderID:I,shaderName:s.type,vertexShader:S,fragmentShader:w,defines:s.defines,customVertexShaderID:C,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===A?e.outputEncoding:!0===A.isXRRenderTarget?A.texture.encoding:LinearEncoding,map:!!s.map,matcap:!!s.matcap,envMap:!!v,envMapMode:v&&v.mapping,envMapCubeUVHeight:E,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:s.normalMapType===ObjectSpaceNormalMap,tangentSpaceNormalMap:s.normalMapType===TangentSpaceNormalMap,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===sRGBEncoding,clearcoat:O,clearcoatMap:O&&!!s.clearcoatMap,clearcoatRoughnessMap:O&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!s.clearcoatNormalMap,iridescence:L,iridescenceMap:L&&!!s.iridescenceMap,iridescenceThicknessMap:L&&!!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===NormalBlending,alphaMap:!!s.alphaMap,alphaTest:D,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&&!!y.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!y.attributes.color&&4===y.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:!!_,useFog:!0===s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===g.isSkinnedMesh,morphTargets:void 0!==y.morphAttributes.position,morphNormals:void 0!==y.morphAttributes.normal,morphColors:void 0!==y.morphAttributes.color,morphTargetsCount:x,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:NoToneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===DoubleSide,flipSided:s.side===BackSide,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||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.customVertexShaderID),r.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)r.push(e),r.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)}(r,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)}(r,t),r.push(e.outputEncoding)),r.push(t.customProgramCacheKey),r.join()},getUniforms:function(e){const t=m[e.type];let r;if(t){const e=ShaderLib[t];r=UniformsUtils.clone(e.uniforms)}else r=e.uniforms;return r},acquireProgram:function(t,r){let i;for(let e=0,t=c.length;e0?i.push(u):!0===a.transparent?n.push(u):r.push(u)},unshift:function(e,t,a,o,l,c){const u=s(e,t,a,o,l,c);a.transmission>0?i.unshift(u):!0===a.transparent?n.unshift(u):r.unshift(u)},finish:function(){for(let r=t,i=e.length;r1&&r.sort(e||painterSortStable),i.length>1&&i.sort(t||reversePainterSortStable),n.length>1&&n.sort(t||reversePainterSortStable)}}}function WebGLRenderLists(){let e=new WeakMap;return{get:function(t,r){const i=e.get(t);let n;return void 0===i?(n=new WebGLRenderList,e.set(t,[n])):r>=i.length?(n=new WebGLRenderList,i.push(n)):n=i[r],n},dispose:function(){e=new WeakMap}}}function UniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":r={direction:new Vector3,color:new Color};break;case"SpotLight":r={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":r={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return e[t.id]=r,r}}}function ShadowUniformsCache(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}var nextVersion=0;function shadowCastingAndTexturingLightsFirst(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function WebGLLights(e,t){const r=new UniformsCache,i=ShadowUniformsCache(),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 e=0;e<9;e++)n.probe.push(new Vector3);const s=new Vector3,a=new Matrix4,o=new Matrix4;return{setup:function(s,a){let o=0,l=0,c=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let u=0,h=0,p=0,d=0,m=0,f=0,g=0,_=0,y=0,T=0;s.sort(shadowCastingAndTexturingLightsFirst);const v=!0!==a?Math.PI:1;for(let e=0,t=s.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(n.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,n.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=UniformsLib.LTC_HALF_1,n.rectAreaLTC2=UniformsLib.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]=c;const E=n.hash;E.directionalLength===u&&E.pointLength===h&&E.spotLength===p&&E.rectAreaLength===d&&E.hemiLength===m&&E.numDirectionalShadows===f&&E.numPointShadows===g&&E.numSpotShadows===_&&E.numSpotMaps===y||(n.directional.length=u,n.spot.length=p,n.rectArea.length=d,n.point.length=h,n.hemi.length=m,n.directionalShadow.length=f,n.directionalShadowMap.length=f,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=_,n.spotShadowMap.length=_,n.directionalShadowMatrix.length=f,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=_+y-T,n.spotLightMap.length=y,n.numSpotLightShadowsWithMaps=T,E.directionalLength=u,E.pointLength=h,E.spotLength=p,E.rectAreaLength=d,E.hemiLength=m,E.numDirectionalShadows=f,E.numPointShadows=g,E.numSpotShadows=_,E.numSpotMaps=y,n.version=nextVersion++)},setupView:function(e,t){let r=0,i=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,p=e.length;t=s.length?(a=new WebGLRenderState(e,t),s.push(a)):a=s[n],a},dispose:function(){r=new WeakMap}}}var MeshDepthMaterial=class extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,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}},MeshDistanceMaterial=class extends Material{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Vector3,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}},vertex="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragment="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function WebGLShadowMap(e,t,r){let i=new Frustum;const n=new Vector2,s=new Vector2,a=new Vector4,o=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),l=new MeshDistanceMaterial,c={},u=r.maxTextureSize,h={0:BackSide,1:FrontSide,2:DoubleSide},p=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),d=p.clone();d.defines.HORIZONTAL_PASS=1;const m=new BufferGeometry;m.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new Mesh(m,p),g=this;function _(r,i){const s=t.update(f);p.defines.VSM_SAMPLES!==r.blurSamples&&(p.defines.VSM_SAMPLES=r.blurSamples,d.defines.VSM_SAMPLES=r.blurSamples,p.needsUpdate=!0,d.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new WebGLRenderTarget(n.x,n.y)),p.uniforms.shadow_pass.value=r.map.texture,p.uniforms.resolution.value=r.mapSize,p.uniforms.radius.value=r.radius,e.setRenderTarget(r.mapPass),e.clear(),e.renderBufferDirect(i,null,s,p,f,null),d.uniforms.shadow_pass.value=r.mapPass.texture,d.uniforms.resolution.value=r.mapSize,d.uniforms.radius.value=r.radius,e.setRenderTarget(r.map),e.clear(),e.renderBufferDirect(i,null,s,d,f,null)}function y(t,r,i,n,s,a){let u=null;const p=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(u=void 0!==p?p:!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0){const e=u.uuid,t=r.uuid;let i=c[e];void 0===i&&(i={},c[e]=i);let n=i[t];void 0===n&&(n=u.clone(),i[t]=n),u=n}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=a===VSMShadowMap?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],u.alphaMap=r.alphaMap,u.alphaTest=r.alphaTest,u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.displacementMap=r.displacementMap,u.displacementScale=r.displacementScale,u.displacementBias=r.displacementBias,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=n,u.farDistance=s),u}function T(r,n,s,a,o){if(!1===r.visible)return;if(r.layers.test(n.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&o===VSMShadowMap)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const i=t.update(r),n=r.material;if(Array.isArray(n)){const t=i.groups;for(let l=0,c=t.length;lu||n.y>u)&&(n.x>u&&(s.x=Math.floor(u/d.x),n.x=s.x*d.x,h.mapSize.x=s.x),n.y>u&&(s.y=Math.floor(u/d.y),n.y=s.y*d.y,h.mapSize.y=s.y)),null===h.map){const e=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};h.map=new WebGLRenderTarget(n.x,n.y,e),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const m=h.getViewportCount();for(let e=0;e=1):-1!==D.indexOf("OpenGL ES")&&(A=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),R=A>=2);let O=null,L={};const P=e.getParameter(3088),N=e.getParameter(2978),F=(new Vector4).fromArray(P),U=(new Vector4).fromArray(N);function B(t,r,i){const n=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;ti||e.height>i)&&(n=i/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){const i=t?floorPowerOfTwo:Math.floor,s=i(n*e.width),a=i(n*e.height);void 0===f&&(f=y(s,a));const o=r?y(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(e,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return isPowerOfTwo(e.width)&&isPowerOfTwo(e.height)}function E(e,t){return e.generateMipmaps&&t&&e.minFilter!==NearestFilter&&e.minFilter!==LinearFilter}function I(t){e.generateMipmap(t)}function b(r,i,n,s,a=!1){if(!1===o)return i;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;return 6403===i&&(5126===n&&(l=33326),5131===n&&(l=33325),5121===n&&(l=33321)),33319===i&&(5126===n&&(l=33328),5131===n&&(l=33327),5121===n&&(l=33323)),6408===i&&(5126===n&&(l=34836),5131===n&&(l=34842),5121===n&&(l=s===sRGBEncoding&&!1===a?35907:32856),32819===n&&(l=32854),32820===n&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||t.get("EXT_color_buffer_float"),l}function x(e,t,r){return!0===E(e,r)||e.isFramebufferTexture&&e.minFilter!==NearestFilter&&e.minFilter!==LinearFilter?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===NearestFilter||e===NearestMipmapNearestFilter||e===NearestMipmapLinearFilter?9728:9729}function w(e){const t=e.target;t.removeEventListener("dispose",w),function(e){const t=i.get(e);if(void 0===t.__webglInit)return;const r=e.source,n=g.get(r);if(n){const i=n[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&M(e),0===Object.keys(n).length&&g.delete(r)}i.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function C(t){const r=t.target;r.removeEventListener("dispose",C),function(t){const r=t.texture,n=i.get(t),s=i.get(r);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else{if(e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t0&&n.__version!==e.version){const r=e.image;if(null===r)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==r.complete)return void N(n,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(3553,n.__webglTexture,33984+t)}const D={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},O={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function L(r,s,a){if(a?(e.texParameteri(r,10242,D[s.wrapS]),e.texParameteri(r,10243,D[s.wrapT]),32879!==r&&35866!==r||e.texParameteri(r,32882,D[s.wrapR]),e.texParameteri(r,10240,O[s.magFilter]),e.texParameteri(r,10241,O[s.minFilter])):(e.texParameteri(r,10242,33071),e.texParameteri(r,10243,33071),32879!==r&&35866!==r||e.texParameteri(r,32882,33071),s.wrapS===ClampToEdgeWrapping&&s.wrapT===ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(r,10240,S(s.magFilter)),e.texParameteri(r,10241,S(s.minFilter)),s.minFilter!==NearestFilter&&s.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const a=t.get("EXT_texture_filter_anisotropic");if(s.type===FloatType&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&s.type===HalfFloatType&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(e.texParameterf(r,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function P(t,r){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",w));const n=r.source;let s=g.get(n);void 0===s&&(s={},g.set(n,s));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(r);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const n=s[t.__cacheKey];void 0!==n&&(s[t.__cacheKey].usedTimes--,0===n.usedTimes&&M(r)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return i}function N(t,n,a){let l=3553;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(l=35866),n.isData3DTexture&&(l=32879);const c=P(t,n),h=n.source;r.bindTexture(l,t.__webglTexture,33984+a);const p=i.get(h);if(h.version!==p.__version||!0===c){r.activeTexture(33984+a),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const t=function(e){return!o&&(e.wrapS!==ClampToEdgeWrapping||e.wrapT!==ClampToEdgeWrapping||e.minFilter!==NearestFilter&&e.minFilter!==LinearFilter)}(n)&&!1===v(n.image);let i=T(n.image,t,!1,u);i=V(n,i);const d=v(i)||o,m=s.convert(n.format,n.encoding);let f,g=s.convert(n.type),_=b(n.internalFormat,m,g,n.encoding,n.isVideoTexture);L(l,n,d);const y=n.mipmaps,S=o&&!0!==n.isVideoTexture,w=void 0===p.__version||!0===c,C=x(n,i,d);if(n.isDepthTexture)_=6402,o?_=n.type===FloatType?36012:n.type===UnsignedIntType?33190:n.type===UnsignedInt248Type?35056:33189:n.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===DepthFormat&&6402===_&&n.type!==UnsignedShortType&&n.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=UnsignedIntType,g=s.convert(n.type)),n.format===DepthStencilFormat&&6402===_&&(_=34041,n.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=UnsignedInt248Type,g=s.convert(n.type))),w&&(S?r.texStorage2D(3553,1,_,i.width,i.height):r.texImage2D(3553,0,_,i.width,i.height,0,m,g,null));else if(n.isDataTexture)if(y.length>0&&d){S&&w&&r.texStorage2D(3553,C,_,y[0].width,y[0].height);for(let e=0,t=y.length;e>=1,t>>=1}}else if(y.length>0&&d){S&&w&&r.texStorage2D(3553,C,_,y[0].width,y[0].height);for(let e=0,t=y.length;e=34069&&l<=34074)&&e.framebufferTexture2D(36160,o,l,i.get(a).__webglTexture,0),r.bindFramebuffer(36160,null)}function U(t,r,i){if(e.bindRenderbuffer(36161,t),r.depthBuffer&&!r.stencilBuffer){let n=33189;if(i||G(r)){const t=r.depthTexture;t&&t.isDepthTexture&&(t.type===FloatType?n=36012:t.type===UnsignedIntType&&(n=33190));const i=k(r);G(r)?p.renderbufferStorageMultisampleEXT(36161,i,n,r.width,r.height):e.renderbufferStorageMultisample(36161,i,n,r.width,r.height)}else e.renderbufferStorage(36161,n,r.width,r.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(r.depthBuffer&&r.stencilBuffer){const n=k(r);i&&!1===G(r)?e.renderbufferStorageMultisample(36161,n,35056,r.width,r.height):G(r)?p.renderbufferStorageMultisampleEXT(36161,n,35056,r.width,r.height):e.renderbufferStorage(36161,34041,r.width,r.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let n=0;n0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function V(e,r){const i=e.encoding,n=e.format,s=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===_SRGBAFormat||i!==LinearEncoding&&(i===sRGBEncoding?!1===o?!0===t.has("EXT_sRGB")&&n===RGBAFormat?(e.format=_SRGBAFormat,e.minFilter=LinearFilter,e.generateMipmaps=!1):r=ImageUtils.sRGBToLinear(r):n===RGBAFormat&&s===UnsignedByteType||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",i)),r}this.allocateTextureUnit=function(){const e=R;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),R+=1,e},this.resetTextureUnits=function(){R=0},this.setTexture2D=A,this.setTexture2DArray=function(e,t){const n=i.get(e);e.version>0&&n.__version!==e.version?N(n,e,t):r.bindTexture(35866,n.__webglTexture,33984+t)},this.setTexture3D=function(e,t){const n=i.get(e);e.version>0&&n.__version!==e.version?N(n,e,t):r.bindTexture(32879,n.__webglTexture,33984+t)},this.setTextureCube=function(t,n){const a=i.get(t);t.version>0&&a.__version!==t.version?function(t,n,a){if(6!==n.image.length)return;const l=P(t,n),u=n.source;r.bindTexture(34067,t.__webglTexture,33984+a);const h=i.get(u);if(u.version!==h.__version||!0===l){r.activeTexture(33984+a),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);const t=n.isCompressedTexture||n.image[0].isCompressedTexture,i=n.image[0]&&n.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=t||i?i?n.image[e].image:n.image[e]:T(n.image[e],!1,!0,c),p[e]=V(n,p[e]);const d=p[0],m=v(d)||o,f=s.convert(n.format,n.encoding),g=s.convert(n.type),_=b(n.internalFormat,f,g,n.encoding),y=o&&!0!==n.isVideoTexture,S=void 0===h.__version||!0===l;let w,C=x(n,d,m);if(L(34067,n,m),t){y&&S&&r.texStorage2D(34067,C,_,d.width,d.height);for(let e=0;e<6;e++){w=p[e].mipmaps;for(let t=0;t0&&C++,r.texStorage2D(34067,C,_,p[0].width,p[0].height));for(let e=0;e<6;e++)if(i){y?r.texSubImage2D(34069+e,0,0,0,p[e].width,p[e].height,f,g,p[e].data):r.texImage2D(34069+e,0,_,p[e].width,p[e].height,0,f,g,p[e].data);for(let t=0;t0&&!1===G(t)){const i=p?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let r=0;r0&&!1===G(t)){const n=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,a=t.height;let o=16384;const l=[],c=t.stencilBuffer?33306:36096,u=i.get(t),h=!0===t.isWebGLMultipleRenderTargets;if(h)for(let t=0;to+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(n=t.getPose(e.gripSpace,r),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&&(i=t.getPose(e.targetRaySpace,r),null===i&&null!==n&&(i=n),null!==i&&(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(_moveEvent)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==n),null!==l&&(l.visible=null!==s),this}},DepthTexture=class extends Texture{constructor(e,t,r,i,n,s,a,o,l,c){if((c=void 0!==c?c:DepthFormat)!==DepthFormat&&c!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&c===DepthFormat&&(r=UnsignedIntType),void 0===r&&c===DepthStencilFormat&&(r=UnsignedInt248Type),super(null,i,n,s,a,o,c,r,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:NearestFilter,this.minFilter=void 0!==o?o:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}},WebXRManager=class extends EventDispatcher{constructor(e,t){super();const r=this;let i=null,n=1,s=null,a="local-floor",o=null,l=null,c=null,u=null,h=null,p=null;const d=t.getContextAttributes();let m=null,f=null;const g=[],_=[],y=new PerspectiveCamera;y.layers.enable(1),y.viewport=new Vector4;const T=new PerspectiveCamera;T.layers.enable(2),T.viewport=new Vector4;const v=[y,T],E=new ArrayCamera;E.layers.enable(1),E.layers.enable(2);let I=null,b=null;function x(e){const t=_.indexOf(e.inputSource);if(-1===t)return;const r=g[t];void 0!==r&&r.dispatchEvent({type:e.type,data:e.inputSource})}function S(){i.removeEventListener("select",x),i.removeEventListener("selectstart",x),i.removeEventListener("selectend",x),i.removeEventListener("squeeze",x),i.removeEventListener("squeezestart",x),i.removeEventListener("squeezeend",x),i.removeEventListener("end",S),i.removeEventListener("inputsourceschange",w);for(let e=0;e=0&&(_[i]=null,g[i].dispatchEvent({type:"disconnected",data:r}))}for(let t=0;t=_.length){_.push(r),i=e;break}if(null===_[e]){_[e]=r,i=e;break}}if(-1===i)break}const n=g[i];n&&n.dispatchEvent({type:"connected",data:r})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=g[e];return void 0===t&&(t=new WebXRController,g[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=g[e];return void 0===t&&(t=new WebXRController,g[e]=t),t.getGripSpace()},this.getHand=function(e){let t=g[e];return void 0===t&&(t=new WebXRController,g[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){n=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o||s},this.setReferenceSpace=function(e){o=e},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=function(l){return __async(this,null,(function*(){if(i=l,null!==i){if(m=e.getRenderTarget(),i.addEventListener("select",x),i.addEventListener("selectstart",x),i.addEventListener("selectend",x),i.addEventListener("squeeze",x),i.addEventListener("squeezestart",x),i.addEventListener("squeezeend",x),i.addEventListener("end",S),i.addEventListener("inputsourceschange",w),!0!==d.xrCompatible&&(yield t.makeXRCompatible()),void 0===i.renderState.layers||!1===e.capabilities.isWebGL2){const r={antialias:void 0!==i.renderState.layers||d.antialias,alpha:d.alpha,depth:d.depth,stencil:d.stencil,framebufferScaleFactor:n};h=new XRWebGLLayer(i,t,r),i.updateRenderState({baseLayer:h}),f=new WebGLRenderTarget(h.framebufferWidth,h.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,encoding:e.outputEncoding,stencilBuffer:d.stencil})}else{let r=null,s=null,a=null;d.depth&&(a=d.stencil?35056:33190,r=d.stencil?DepthStencilFormat:DepthFormat,s=d.stencil?UnsignedInt248Type:UnsignedIntType);const o={colorFormat:32856,depthFormat:a,scaleFactor:n};c=new XRWebGLBinding(i,t),u=c.createProjectionLayer(o),i.updateRenderState({layers:[u]}),f=new WebGLRenderTarget(u.textureWidth,u.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:d.stencil,encoding:e.outputEncoding,samples:d.antialias?4:0});e.properties.get(f).__ignoreDepthValues=u.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),o=null,s=yield i.requestReferenceSpace(a),D.setContext(i),D.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}}))};const C=new Vector3,M=new Vector3;function R(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===i)return;E.near=T.near=y.near=e.near,E.far=T.far=y.far=e.far,I===E.near&&b===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),I=E.near,b=E.far);const t=e.parent,r=E.cameras;R(E,t);for(let e=0;e0&&(r.alphaTest.value=i.alphaTest);const n=t.get(i).envMap;if(n&&(r.envMap.value=n,r.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const t=!0!==e.physicallyCorrectLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*t}let s,a;i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity),i.map?s=i.map:i.specularMap?s=i.specularMap:i.displacementMap?s=i.displacementMap:i.normalMap?s=i.normalMap:i.bumpMap?s=i.bumpMap:i.roughnessMap?s=i.roughnessMap:i.metalnessMap?s=i.metalnessMap:i.alphaMap?s=i.alphaMap:i.emissiveMap?s=i.emissiveMap:i.clearcoatMap?s=i.clearcoatMap:i.clearcoatNormalMap?s=i.clearcoatNormalMap:i.clearcoatRoughnessMap?s=i.clearcoatRoughnessMap:i.iridescenceMap?s=i.iridescenceMap:i.iridescenceThicknessMap?s=i.iridescenceThicknessMap:i.specularIntensityMap?s=i.specularIntensityMap:i.specularColorMap?s=i.specularColorMap:i.transmissionMap?s=i.transmissionMap:i.thicknessMap?s=i.thicknessMap:i.sheenColorMap?s=i.sheenColorMap:i.sheenRoughnessMap&&(s=i.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),r.uvTransform.value.copy(s.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),r.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,i,n,s,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,r){e.roughness.value=r.roughness,e.metalness.value=r.metalness,r.roughnessMap&&(e.roughnessMap.value=r.roughnessMap);r.metalnessMap&&(e.metalnessMap.value=r.metalnessMap);const i=t.get(r).envMap;i&&(e.envMapIntensity.value=r.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){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===BackSide&&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=r.texture,e.transmissionSamplerSize.value.set(r.width,r.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,i,a)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let n;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,i,n,s):i.isSpriteMaterial?function(e,t){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);let r;t.map?r=t.map:t.alphaMap&&(r=t.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(e,t,r,i){let n={},s={},a=[];const o=r.isWebGL2?e.getParameter(35375):0;function l(e,t,r){const i=e.value;if(void 0===r[t])return r[t]="number"==typeof i?i:i.clone(),!0;if("number"==typeof i){if(r[t]!==i)return r[t]=i,!0}else{const e=r[t];if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t=e.value,r={boundary:0, // bytes storage:0};return"number"==typeof t?(r.boundary=4,r.storage=4):t.isVector2?(r.boundary=8,r.storage=8):t.isVector3||t.isColor?(r.boundary=16,r.storage=12):t.isVector4?(r.boundary=16,r.storage=16):t.isMatrix3?(r.boundary=48,r.storage=48):t.isMatrix4?(r.boundary=64,r.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),r}function u(t){const r=t.target;r.removeEventListener("dispose",u);const i=a.indexOf(r.__bindingPointIndex);a.splice(i,1),e.deleteBuffer(n[r.id]),delete n[r.id],delete s[r.id]}return{bind:function(e,t){const r=t.program;i.uniformBlockBinding(e,r)},update:function(r,h){let p=n[r.id];void 0===p&&(!function(e){const t=e.uniforms;let r=0;const i=16;let n=0;for(let e=0,s=t.length;e0){n=r%i;0!==n&&i-n-a.boundary<0&&(r+=i-n,s.__offset=r)}r+=a.storage}n=r%i,n>0&&(r+=i-n);e.__size=r,e.__cache={}}(r),p=function(t){const r=function(){for(let e=0;e0&&function(e,t,r){const i=j.isWebGL2;null===F&&(F=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:H.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:i&&!0===s?4:0}));f.getDrawingBufferSize(B),i?F.setSize(B.x,B.y):F.setSize(floorPowerOfTwo(B.x),floorPowerOfTwo(B.y));const n=f.getRenderTarget();f.setRenderTarget(F),f.clear();const a=f.toneMapping;f.toneMapping=NoToneMapping,we(e,t,r),f.toneMapping=a,Y.updateMultisampleRenderTarget(F),Y.updateRenderTargetMipmap(F),f.setRenderTarget(n)}(n,t,r),i&&z.viewport(I.copy(i)),n.length>0&&we(n,t,r),a.length>0&&we(a,t,r),o.length>0&&we(o,t,r),z.buffers.depth.setTest(!0),z.buffers.depth.setMask(!0),z.buffers.color.setMask(!0),z.setPolygonOffset(!1)}function we(e,t,r){const i=!0===t.isScene?t.overrideMaterial:null;for(let n=0,s=e.length;n0?m[m.length-1]:null,d.pop(),h=d.length>0?d[d.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(e,t,r){W.get(e.texture).__webglTexture=t,W.get(e.depthTexture).__webglTexture=r;const i=W.get(e);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0===H.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const r=W.get(e);r.__webglFramebuffer=t,r.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,r=0){T=e,_=t,y=r;let i=!0,n=null,s=!1,a=!1;if(e){const r=W.get(e);void 0!==r.__useDefaultFramebuffer?(z.bindFramebuffer(36160,null),i=!1):void 0===r.__webglFramebuffer?Y.setupRenderTarget(e):r.__hasExternalTextures&&Y.rebindTextures(e,W.get(e.texture).__webglTexture,W.get(e.depthTexture).__webglTexture);const o=e.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=W.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(n=l[t],s=!0):n=j.isWebGL2&&e.samples>0&&!1===Y.useMultisampledRTT(e)?W.get(e).__webglMultisampledFramebuffer:l,I.copy(e.viewport),b.copy(e.scissor),x=e.scissorTest}else I.copy(A).multiplyScalar(C).floor(),b.copy(D).multiplyScalar(C).floor(),x=O;if(z.bindFramebuffer(36160,n)&&j.drawBuffers&&i&&z.drawBuffers(e,n),z.viewport(I),z.scissor(b),z.setScissorTest(x),s){const i=W.get(e.texture);pe.framebufferTexture2D(36160,36064,34069+t,i.__webglTexture,r)}else if(a){const i=W.get(e.texture),n=t||0;pe.framebufferTextureLayer(36160,36064,i.__webglTexture,r||0,n)}v=-1},this.readRenderTargetPixels=function(e,t,r,i,n,s,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=W.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){z.bindFramebuffer(36160,o);try{const a=e.texture,o=a.format,l=a.type;if(o!==RGBAFormat&&ce.convert(o)!==pe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===HalfFloatType&&(H.has("EXT_color_buffer_half_float")||j.isWebGL2&&H.has("EXT_color_buffer_float"));if(!(l===UnsignedByteType||ce.convert(l)===pe.getParameter(35738)||l===FloatType&&(j.isWebGL2||H.has("OES_texture_float")||H.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-i&&r>=0&&r<=e.height-n&&pe.readPixels(t,r,i,n,ce.convert(o),ce.convert(l),s)}finally{const e=null!==T?W.get(T).__webglFramebuffer:null;z.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,r=0){const i=Math.pow(2,-r),n=Math.floor(t.image.width*i),s=Math.floor(t.image.height*i);Y.setTexture2D(t,0),pe.copyTexSubImage2D(3553,r,0,0,e.x,e.y,n,s),z.unbindTexture()},this.copyTextureToTexture=function(e,t,r,i=0){const n=t.image.width,s=t.image.height,a=ce.convert(r.format),o=ce.convert(r.type);Y.setTexture2D(r,0),pe.pixelStorei(37440,r.flipY),pe.pixelStorei(37441,r.premultiplyAlpha),pe.pixelStorei(3317,r.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,i,e.x,e.y,n,s,a,o,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):pe.texSubImage2D(3553,i,e.x,e.y,a,o,t.image),0===i&&r.generateMipmaps&&pe.generateMipmap(3553),z.unbindTexture()},this.copyTextureToTexture3D=function(e,t,r,i,n=0){if(f.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=ce.convert(i.format),c=ce.convert(i.type);let u;if(i.isData3DTexture)Y.setTexture3D(i,0),u=32879;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Y.setTexture2DArray(i,0),u=35866}pe.pixelStorei(37440,i.flipY),pe.pixelStorei(37441,i.premultiplyAlpha),pe.pixelStorei(3317,i.unpackAlignment);const h=pe.getParameter(3314),p=pe.getParameter(32878),d=pe.getParameter(3316),m=pe.getParameter(3315),g=pe.getParameter(32877),_=r.isCompressedTexture?r.mipmaps[0]:r.image;pe.pixelStorei(3314,_.width),pe.pixelStorei(32878,_.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),r.isDataTexture||r.isData3DTexture?pe.texSubImage3D(u,n,t.x,t.y,t.z,s,a,o,l,c,_.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(u,n,t.x,t.y,t.z,s,a,o,l,_.data)):pe.texSubImage3D(u,n,t.x,t.y,t.z,s,a,o,l,c,_),pe.pixelStorei(3314,h),pe.pixelStorei(32878,p),pe.pixelStorei(3316,d),pe.pixelStorei(3315,m),pe.pixelStorei(32877,g),0===n&&i.generateMipmaps&&pe.generateMipmap(u),z.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Y.setTextureCube(e,0):e.isData3DTexture?Y.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Y.setTexture2DArray(e,0):Y.setTexture2D(e,0),z.unbindTexture()},this.resetState=function(){_=0,y=0,T=null,z.reset(),ue.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var WebGL1Renderer=class extends WebGLRenderer{};WebGL1Renderer.prototype.isWebGL1Renderer=!0;var _geometry,FogExp2=class{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(e),this.density=t}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}},Fog=class{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Color(e),this.near=t,this.far=r}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}},Scene=class extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.backgroundBlurriness=this.backgroundBlurriness),t} // @deprecated 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}},InterleavedBuffer=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID()}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,r){e*=this.stride,r*=t.stride;for(let i=0,n=this.stride;ie.far||t.push({distance:o,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),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 transformVertex(e,t,r,i,n,s){_alignedPosition.subVectors(e,r).addScalar(.5).multiply(i),void 0!==n?(_rotatedPosition.x=s*_alignedPosition.x-n*_alignedPosition.y,_rotatedPosition.y=n*_alignedPosition.x+s*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),e.copy(t),e.x+=_rotatedPosition.x,e.y+=_rotatedPosition.y,e.applyMatrix4(_viewWorldMatrix)}var _v1$2=new Vector3,_v2$1=new Vector3,LOD=class extends Object3D{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);const t=e.levels;for(let e=0,r=t.length;e0){let r,i;for(r=1,i=t.length;r0){_v1$2.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){_v1$2.setFromMatrixPosition(e.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const r=_v1$2.distanceTo(_v2$1)/e.zoom;let i,n;for(t[0].object.visible=!0,i=1,n=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;io)continue;h.applyMatrix4(this.matrixWorld);const s=e.ray.origin.distanceTo(h);se.far||t.push({distance:s, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{for(let r=Math.max(0,s.start),i=Math.min(m.count,s.start+s.count)-1;ro)continue;h.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(h);ie.far||t.push({distance:i, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;e0){const r=e[t[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=r.length;en.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:r,index:t,face:null,object:a})}}var VideoTexture=class extends Texture{constructor(e,t,r,i,n,s,a,o,l){super(e,t,r,i,n,s,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:LinearFilter,this.magFilter=void 0!==n?n:LinearFilter,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},FramebufferTexture=class extends Texture{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}},CompressedTexture=class extends Texture{constructor(e,t,r,i,n,s,a,o,l,c,u,h){super(null,s,a,o,l,c,i,n,u,h),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},CompressedArrayTexture=class extends CompressedTexture{constructor(e,t,r,i,n,s){super(e,t,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=ClampToEdgeWrapping}},CanvasTexture=class extends Texture{constructor(e,t,r,i,n,s,a,o,l){super(e,t,r,i,n,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},Curve=class{constructor(){this.type="Curve",this.arcLengthDivisions=200} // Virtual base class method to overwrite and implement in subclasses // - t [0 .. 1] getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null} // Get point at relative position in curve according to arc length // - u [0 .. 1] getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)} // Get sequence of points using getPoint( t ) getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t} // Get sequence of points using getPointAt( u ) getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t} // Get total curve arc length getLength(){const e=this.getLengths();return e[e.length-1]} // Get list of cumulative segment lengths getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),n=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),n+=r.distanceTo(i),t.push(n),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()} // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant getUtoTmapping(e,t){const r=this.getLengths();let i=0;const n=r.length;let s;s=t||e*r[n-1];let a,o=0,l=n-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=r[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,r[i]===s)return i/(n-1);const c=r[i];return(i+(s-c)/(r[i+1]-c))/(n-1)} // Returns a unit vector tangent at t // In case any sub curve does not implement its tangent derivation, // 2 points a small delta apart will be used to find its gradient // which seems to give a reasonable approximation getTangent(e,t){const r=1e-4;let i=e-r,n=e+r;i<0&&(i=0),n>1&&(n=1);const s=this.getPoint(i),a=this.getPoint(n),o=t||(s.isVector2?new Vector2:new Vector3);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new Vector3,i=[],n=[],s=[],a=new Vector3,o=new Matrix4;for(let t=0;t<=e;t++){const r=t/e;i[t]=this.getTangentAt(r,new Vector3)}n[0]=new Vector3,s[0]=new Vector3;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),u<=l&&(l=u,r.set(0,1,0)),h<=l&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],a),s[0].crossVectors(i[0],n[0]);for(let t=1;t<=e;t++){if(n[t]=n[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(i[t-1],i[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(clamp(i[t-1].dot(i[t]),-1,1));n[t].applyMatrix4(o.makeRotationAxis(a,e))}s[t].crossVectors(i[t],n[t])}if(!0===t){let t=Math.acos(clamp(n[0].dot(n[e]),-1,1));t/=e,i[0].dot(a.crossVectors(n[0],n[e]))>0&&(t=-t);for(let r=1;r<=e;r++)n[r].applyMatrix4(o.makeRotationAxis(i[r],t*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},EllipseCurve=class extends Curve{constructor(e=0,t=0,r=1,i=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=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t){const r=t||new Vector2,i=2*Math.PI;let n=this.aEndAngle-this.aStartAngle;const s=Math.abs(n)i;)n-=i;n0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===c&&l===n-1&&(l=n-2,c=1),this.closed||l>0?a=i[(l-1)%n]:(tmp.subVectors(i[0],i[1]).add(i[0]),a=tmp);const u=i[l%n],h=i[(l+1)%n];if(this.closed||l+2i.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return r.set(CatmullRom(a,o.x,l.x,c.x,u.x),CatmullRom(a,o.y,l.y,c.y,u.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const e=i[n]-r,s=this.curves[n],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}n++}return null} // We cannot use the default THREE.Curve getPoint() with getLength() because in // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath // getPoint() depends on getLength getLength(){const e=this.getCurveLengths();return e[e.length-1]} // cacheLengths must be recalculated. updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()} // Compute lengths and cache them // We cannot overwrite getLengths() because UtoT mapping uses it. getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},LatheGeometry=class extends BufferGeometry{constructor(e=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],t=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=clamp(i,0,2*Math.PI);const n=[],s=[],a=[],o=[],l=[],c=1/t,u=new Vector3,h=new Vector2,p=new Vector3,d=new Vector3,m=new Vector3;let f=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,p.x=1*g,p.y=-f,p.z=0*g,m.copy(p),p.normalize(),o.push(p.x,p.y,p.z);break;case e.length-1:o.push(m.x,m.y,m.z);break;default:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,p.x=1*g,p.y=-f,p.z=0*g,d.copy(p),p.x+=m.x,p.y+=m.y,p.z+=m.z,p.normalize(),o.push(p.x,p.y,p.z),m.copy(d)}for(let n=0;n<=t;n++){const p=r+n*c*i,d=Math.sin(p),m=Math.cos(p);for(let r=0;r<=e.length-1;r++){u.x=e[r].x*d,u.y=e[r].y,u.z=e[r].x*m,s.push(u.x,u.y,u.z),h.x=n/t,h.y=r/(e.length-1),a.push(h.x,h.y);const i=o[3*r+0]*d,c=o[3*r+1],p=o[3*r+0]*m;l.push(i,c,p)}}for(let r=0;r0&&_(!0),t>0&&_(!1)),this.setIndex(c),this.setAttribute("position",new Float32BufferAttribute(u,3)),this.setAttribute("normal",new Float32BufferAttribute(h,3)),this.setAttribute("uv",new Float32BufferAttribute(p,2))}static fromJSON(e){return new CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},ConeGeometry=class extends CylinderGeometry{constructor(e=1,t=1,r=8,i=1,n=!1,s=0,a=2*Math.PI){super(0,e,t,r,i,n,s,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:a}}static fromJSON(e){return new ConeGeometry(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},PolyhedronGeometry=class extends BufferGeometry{constructor(e=[],t=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:i};const n=[],s=[];function a(e,t,r,i){const n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];const a=e.clone().lerp(r,i/n),o=t.clone().lerp(r,i/n),l=n-i;for(let e=0;e<=l;e++)s[i][e]=0===e&&i===n?a:a.clone().lerp(o,e/l)}for(let e=0;e.9&&a<.1&&(t<.2&&(s[e+0]+=1),r<.2&&(s[e+2]+=1),i<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new Float32BufferAttribute(n,3)),this.setAttribute("normal",new Float32BufferAttribute(n.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new PolyhedronGeometry(e.vertices,e.indices,e.radius,e.details)}},DodecahedronGeometry=class extends PolyhedronGeometry{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=1/r;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,1,1,1, // (0, ±1/φ, ±φ) 0,-i,-r,0,-i,r,0,i,-r,0,i,r, // (±1/φ, ±φ, 0) -i,-r,0,-i,r,0,i,-r,0,i,r,0, // (±φ, 0, ±1/φ) -r,0,-i,r,0,-i,-r,0,i,r,0,i],[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 DodecahedronGeometry(e.radius,e.detail)}},_v0=new Vector3,_v1$1=new Vector3,_normal=new Vector3,_triangle=new Triangle,EdgesGeometry=class extends BufferGeometry{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const r=4,i=Math.pow(10,r),n=Math.cos(DEG2RAD*t),s=e.getIndex(),a=e.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},p=[];for(let e=0;e80*r){o=c=e[0],l=u=e[1];for(let t=r;tc&&(c=h),p>u&&(u=p);d=Math.max(c-o,u-l),d=0!==d?32767/d:0}return earcutLinked(s,a,r,o,l,d,0),a}};function linkedList(e,t,r,i,n){let s,a;if(n===signedArea(e,t,r,i)>0)for(s=t;s=t;s-=i)a=insertNode(s,e[s],e[s+1],a);return a&&equals(a,a.next)&&(removeNode(a),a=a.next),a}function filterPoints(e,t){if(!e)return e;t||(t=e);let r,i=e;do{if(r=!1,i.steiner||!equals(i,i.next)&&0!==area(i.prev,i,i.next))i=i.next;else{if(removeNode(i),i=t=i.prev,i===i.next)break;r=!0}}while(r||i!==t);return t}function earcutLinked(e,t,r,i,n,s,a){if(!e)return;!a&&s&&indexCurve(e,i,n,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?isEarHashed(e,i,n,s):isEar(e))t.push(o.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),removeNode(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?earcutLinked(e=cureLocalIntersections(filterPoints(e),t,r),t,r,i,n,s,2):2===a&&splitEarcut(e,t,r,i,n,s):earcutLinked(filterPoints(e),t,r,i,n,s,1);break}}function isEar(e){const t=e.prev,r=e,i=e.next;if(area(t,r,i)>=0)return!1;const n=t.x,s=r.x,a=i.x,o=t.y,l=r.y,c=i.y,u=ns?n>a?n:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&pointInTriangle(n,o,s,l,a,c,m.x,m.y)&&area(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function isEarHashed(e,t,r,i){const n=e.prev,s=e,a=e.next;if(area(n,s,a)>=0)return!1;const o=n.x,l=s.x,c=a.x,u=n.y,h=s.y,p=a.y,d=ol?o>c?o:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,_=zOrder(d,m,t,r,i),y=zOrder(f,g,t,r,i);let T=e.prevZ,v=e.nextZ;for(;T&&T.z>=_&&v&&v.z<=y;){if(T.x>=d&&T.x<=f&&T.y>=m&&T.y<=g&&T!==n&&T!==a&&pointInTriangle(o,u,l,h,c,p,T.x,T.y)&&area(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,v.x>=d&&v.x<=f&&v.y>=m&&v.y<=g&&v!==n&&v!==a&&pointInTriangle(o,u,l,h,c,p,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;T&&T.z>=_;){if(T.x>=d&&T.x<=f&&T.y>=m&&T.y<=g&&T!==n&&T!==a&&pointInTriangle(o,u,l,h,c,p,T.x,T.y)&&area(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=m&&v.y<=g&&v!==n&&v!==a&&pointInTriangle(o,u,l,h,c,p,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function cureLocalIntersections(e,t,r){let i=e;do{const n=i.prev,s=i.next.next;!equals(n,s)&&intersects(n,i,i.next,s)&&locallyInside(n,s)&&locallyInside(s,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(s.i/r|0),removeNode(i),removeNode(i.next),i=e=s),i=i.next}while(i!==e);return filterPoints(i)}function splitEarcut(e,t,r,i,n,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&isValidDiagonal(a,e)){let o=splitPolygon(a,e);return a=filterPoints(a,a.next),o=filterPoints(o,o.next),earcutLinked(a,t,r,i,n,s,0),void earcutLinked(o,t,r,i,n,s,0)}e=e.next}a=a.next}while(a!==e)}function eliminateHoles(e,t,r,i){const n=[];let s,a,o,l,c;for(s=0,a=t.length;s=i.next.y&&i.next.y!==i.y){const e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=s&&e>n&&(n=e,r=i.x=i.x&&i.x>=l&&s!==i.x&&pointInTriangle(ar.x||i.x===r.x&§orContainsSector(r,i)))&&(r=i,h=u)),i=i.next}while(i!==o);return r}function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}function indexCurve(e,t,r,i){let n=e;do{0===n.z&&(n.z=zOrder(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,sortLinked(n)}function sortLinked(e){let t,r,i,n,s,a,o,l,c=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,i=r,o=0,t=0;t0||l>0&&i;)0!==o&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(a>1);return e}function zOrder(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function getLeftmost(e){let t=e,r=e;do{(t.x=(e-a)*(s-o)&&(e-a)*(i-o)>=(r-a)*(t-o)&&(r-a)*(s-o)>=(n-a)*(i-o)}function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!intersectsPolygon(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&middleInside(e,t)&&(area(e.prev,e,t.prev)||area(e,t.prev,t))||// does not create opposite-facing sectors equals(e,t)&&area(e.prev,e,e.next)>0&&area(t.prev,t,t.next)>0)}function area(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function equals(e,t){return e.x===t.x&&e.y===t.y}function intersects(e,t,r,i){const n=sign(area(e,t,r)),s=sign(area(e,t,i)),a=sign(area(r,i,e)),o=sign(area(r,i,t));return n!==s&&a!==o||(!(0!==n||!onSegment(e,r,t))||(!(0!==s||!onSegment(e,i,t))||(!(0!==a||!onSegment(r,e,i))||!(0!==o||!onSegment(r,t,i)))))}function onSegment(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function sign(e){return e>0?1:e<0?-1:0}function intersectsPolygon(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&intersects(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function locallyInside(e,t){return area(e.prev,e,e.next)<0?area(e,t,e.next)>=0&&area(e,e.prev,t)>=0:area(e,t,e.prev)<0||area(e,e.next,t)<0}function middleInside(e,t){let r=e,i=!1;const n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function splitPolygon(e,t){const r=new Node2(e.i,e.x,e.y),i=new Node2(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function insertNode(e,t,r,i){const n=new Node2(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function removeNode(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 Node2(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,r,i){let n=0;for(let s=t,a=r-i;s2&&e[t-1].equals(e[0])&&e.pop()}function addContour(e,t){for(let r=0;rNumber.EPSILON){const h=Math.sqrt(u),p=Math.sqrt(l*l+c*c),d=t.x-o/h,m=t.y+a/h,f=((r.x-c/p-d)*c-(r.y+l/p-m)*l)/(a*c-o*l);i=d+a*f-e.x,n=m+o*f-e.y;const g=i*i+n*n;if(g<=2)return new Vector2(i,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(c)&&(e=!0),e?(i=-o,n=a,s=Math.sqrt(u)):(i=a,n=o,s=Math.sqrt(u/2))}return new Vector2(i/s,n/s)}const D=[];for(let e=0,t=w.length,r=t-1,i=e+1;e=0;e--){const t=e/d,r=u*Math.cos(t*Math.PI/2),i=h*Math.sin(t*Math.PI/2)+p;for(let e=0,t=w.length;e=0;){const i=r;let n=r-1;n<0&&(n=e.length-1);for(let e=0,r=o+2*d;e0)&&p.push(t,n,l),(e!==r-1||o0!=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}},MeshPhongMaterial=class extends Material{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color(16777215),this.specular=new Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.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}},MeshToonMaterial=class extends Material{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!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}},MeshNormalMaterial=class extends Material{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!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}},MeshLambertMaterial=class extends Material{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.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}},MeshMatcapMaterial=class extends Material{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!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}},LineDashedMaterial=class extends LineBasicMaterial{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 arraySlice(e,t,r){return isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==r?r:e.length)):e.slice(t,r)}function convertArray(e,t,r){return!e||// let 'undefined' and 'null' pass !r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function getKeyframeOrder(e){const t=e.length,r=new Array(t);for(let e=0;e!==t;++e)r[e]=e;return r.sort((function(t,r){return e[t]-e[r]})),r}function sortedArray(e,t,r){const i=e.length,n=new e.constructor(i);for(let s=0,a=0;a!==i;++s){const i=r[s]*t;for(let r=0;r!==t;++r)n[a++]=e[i+r]}return n}function flattenJSON(e,t,r,i){let n=1,s=e[0];for(;void 0!==s&&void 0===s[i];)s=e[n++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(t.push(s.time),r.push.apply(r,a)),s=e[n++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(t.push(s.time),a.toArray(r,r.length)),s=e[n++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(t.push(s.time),r.push(a)),s=e[n++]}while(void 0!==s)}function subclip(e,t,r,i,n=30){const s=e.clone();s.name=t;const a=[];for(let e=0;e=i)){l.push(t.times[e]);for(let r=0;rs.tracks[e].times[0]&&(o=s.tracks[e].times[0]);for(let e=0;e=i.times[h]){const e=h*l+o,t=e+l-o;p=arraySlice(i.values,e,t)}else{const e=i.createInterpolant(),t=o,r=l-o;e.evaluate(s),p=arraySlice(e.resultBuffer,t,r)}if("quaternion"===n){(new Quaternion).fromArray(p).normalize().conjugate().toArray(p)}const d=a.times.length;for(let e=0;e=n)break e;{const a=t[1];e=n)break t}s=r,r=0}}for(;r>>1;e seconds conversions) scale(e){if(1!==e){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this} // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values trim(e,t){const r=this.times,i=r.length;let n=0,s=i-1;for(;n!==i&&r[n]t;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const e=this.getValueSize();this.times=arraySlice(r,n,s),this.values=arraySlice(this.values,n*e,s*e)}return this} // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,n=r.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==n;t++){const i=r[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,s),e=!1;break}s=i}if(void 0!==i&&isTypedArray(i))for(let t=0,r=i.length;t!==r;++t){const r=i[t];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,r),e=!1;break}}return e} // removes equivalent sequential keys as common in morph target sequences // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) optimize(){const e=arraySlice(this.times),t=arraySlice(this.values),r=this.getValueSize(),i=this.getInterpolation()===InterpolateSmooth,n=e.length-1;let s=1;for(let a=1;a0){e[s]=e[n];for(let e=n*r,i=s*r,a=0;a!==r;++a)t[i+a]=t[e+a];++s}return s!==e.length?(this.times=arraySlice(e,0,s),this.values=arraySlice(t,0,s*r)):(this.times=e,this.values=t),this}clone(){const e=arraySlice(this.times,0),t=arraySlice(this.values,0),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;var BooleanKeyframeTrack=class extends KeyframeTrack{};BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var ColorKeyframeTrack=class extends KeyframeTrack{};ColorKeyframeTrack.prototype.ValueTypeName="color";var NumberKeyframeTrack=class extends KeyframeTrack{};NumberKeyframeTrack.prototype.ValueTypeName="number";var QuaternionLinearInterpolant=class extends Interpolant{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(r-t)/(i-t);let l=e*a;for(let e=l+a;l!==e;l+=4)Quaternion.slerpFlat(n,0,s,l-a,s,l,o);return n}},QuaternionKeyframeTrack=class extends KeyframeTrack{InterpolantFactoryMethodLinear(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)}};QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear,QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var StringKeyframeTrack=class extends KeyframeTrack{};StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;var VectorKeyframeTrack=class extends KeyframeTrack{};VectorKeyframeTrack.prototype.ValueTypeName="vector";var AnimationClip=class{constructor(e,t=-1,r,i=NormalAnimationBlendMode){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let e=0,n=r.length;e!==n;++e)t.push(parseKeyframeTrack(r[e]).scale(i));const n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=r.length;e!==i;++e)t.push(KeyframeTrack.toJSON(r[e]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const n=t.length,s=[];for(let e=0;e1){const e=s[1];let t=i[e];t||(i[e]=t=[]),t.push(r)}}const s=[];for(const e in i)s.push(this.CreateFromMorphTargetSequence(e,i[e],t,r));return s} // parse the animation.hierarchy format static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(e,t,r,i,n){if(0!==r.length){const s=[],a=[];flattenJSON(r,s,a,i),0!==s.length&&n.push(new e(t,s,a))}},i=[],n=e.name||"default",s=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let e=0;e{t&&t(n),this.manager.itemEnd(e)}),0),n;if(void 0!==loading[e])return void loading[e].push({onLoad:t,onProgress:r,onError:i});loading[e]=[],loading[e].push({onLoad:t,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const r=loading[e],i=t.body.getReader(),n=t.headers.get("Content-Length"),s=n?parseInt(n):0,a=0!==s;let o=0;const l=new ReadableStream({start(e){!function t(){i.read().then((({done:i,value:n})=>{if(i)e.close();else{o+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let e=0,t=r.length;e{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),r=t&&t[1]?t[1].toLowerCase():void 0,i=new TextDecoder(r);return e.arrayBuffer().then((e=>i.decode(e)))}}})).then((t=>{Cache.add(e,t);const r=loading[e];delete loading[e];for(let e=0,i=r.length;e{const r=loading[e];if(void 0===r)throw this.manager.itemError(e),t;delete loading[e];for(let e=0,i=r.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},AnimationLoader=class extends Loader{constructor(e){super(e)}load(e,t,r,i){const n=this,s=new FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(n.parse(JSON.parse(r)))}catch(t){i?i(t):console.error(t),n.manager.itemError(e)}}),r,i)}parse(e){const t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const n=e.uniforms[t];switch(i.uniforms[t]={},n.type){case"t":i.uniforms[t].value=r(n.value);break;case"c":i.uniforms[t].value=(new Color).setHex(n.value);break;case"v2":i.uniforms[t].value=(new Vector2).fromArray(n.value);break;case"v3":i.uniforms[t].value=(new Vector3).fromArray(n.value);break;case"v4":i.uniforms[t].value=(new Vector4).fromArray(n.value);break;case"m3":i.uniforms[t].value=(new Matrix3).fromArray(n.value);break;case"m4":i.uniforms[t].value=(new Matrix4).fromArray(n.value);break;default:i.uniforms[t].value=n.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(i.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=r(e.map)),void 0!==e.matcap&&(i.matcap=r(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=(new Vector2).fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=r(e.specularMap)),void 0!==e.specularIntensityMap&&(i.specularIntensityMap=r(e.specularIntensityMap)),void 0!==e.specularColorMap&&(i.specularColorMap=r(e.specularColorMap)),void 0!==e.envMap&&(i.envMap=r(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Vector2).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(i.iridescenceMap=r(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(i.transmissionMap=r(e.transmissionMap)),void 0!==e.thicknessMap&&(i.thicknessMap=r(e.thicknessMap)),void 0!==e.sheenColorMap&&(i.sheenColorMap=r(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,MeshMatcapMaterial:MeshMatcapMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}[e]}},LoaderUtils=class{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let r=0,i=e.length;r0){const r=new LoadingManager(t);n=new ImageLoader(r),n.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t0){i=new ImageLoader(this.manager),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e' accumulate(e,t){const r=this.buffer,i=this.valueSize,n=e*i+i;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==i;++e)r[n+e]=r[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(r,n,0,e,i)}this.cumulativeWeight=s} // accumulate data in the 'incoming' region into 'add' accumulateAdditive(e){const t=this.buffer,r=this.valueSize,i=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,r),this.cumulativeWeightAdditive+=e} // apply the state of 'accu' to the binding when accus differ apply(e){const t=this.valueSize,r=this.buffer,i=e*t+t,n=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){const e=t*this._origIndex;this._mixBufferRegion(r,i,e,1-n,t)}s>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let e=t,n=t+t;e!==n;++e)if(r[e]!==r[e+t]){a.setValue(r,i);break}} // remember the state of the bound property and copy it to both accus saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let e=r,n=i;e!==n;++e)t[e]=t[i+e%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0} // apply the state previously taken via 'saveOriginalState' to the binding restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let i=0;i!==n;++i)e[t+i]=e[r+i]}_slerp(e,t,r,i){Quaternion.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,n){const s=this._workIndex*n;Quaternion.multiplyQuaternionsFlat(e,s,e,t,e,r),Quaternion.slerpFlat(e,t,e,t,e,s,i)}_lerp(e,t,r,i,n){const s=1-i;for(let a=0;a!==n;++a){const n=t+a;e[n]=e[n]*s+e[r+a]*i}}_lerpAdditive(e,t,r,i,n){for(let s=0;s!==n;++s){const n=t+s;e[n]=e[n]+e[r+s]*i}}},_RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones","map"],Composite=class{constructor(e,t,r){const i=r||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},PropertyBinding=class{constructor(e,t,r){this.path=t,this.parsedPath=r||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,r):new PropertyBinding(e,t,r)} /** * Replaces spaces with underscores and removes unsupported characters from * node names, to ensure compatibility with parseTrackName(). * * @param {string} name Node name to be sanitized. * @return {string} */static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(e){const t=_trackRe.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={ // directoryName: matches[ 1 ], // (tschw) currently unused nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5], // required propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=r.nodeName.substring(i+1);-1!==_supportedObjectNames.indexOf(e)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=e)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(void 0!==r)return r}if(e.children){const r=function(e){for(let i=0;i=n){const s=n++,c=e[s];t[c.uuid]=l,e[l]=c,t[o]=s,e[s]=a;for(let e=0,t=i;e!==t;++e){const t=r[e],i=t[s],n=t[l];t[l]=i,t[s]=n}}}this.nCachedObjects_=n} // remove & forget uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let n=this.nCachedObjects_,s=e.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=t[o];if(void 0!==l)if(delete t[o],l0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=i;e!==t;++e){const t=r[e];t[l]=t[n],t.pop()}}}this.nCachedObjects_=n} // Internal interface used by befriended PropertyBinding.Composite: subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const n=this._bindings;if(void 0!==i)return n[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,u=new Array(l);i=n.length,r[e]=i,s.push(e),a.push(t),n.push(u);for(let r=c,i=o.length;r!==i;++r){const i=o[r];u[r]=new PropertyBinding(i,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(void 0!==r){const i=this._paths,n=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];t[e[a]]=r,s[r]=o,s.pop(),n[r]=n[a],n.pop(),i[r]=i[a],i.pop()}}},AnimationAction=class{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const n=t.tracks,s=n.length,a=new Array(s),o={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let e=0;e!==s;++e){const t=n[e].createInterpolant(null);a[e]=t,t.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=LoopRepeat,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} // State & Scheduling 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)} // return true when play has been called isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this} // Weight // set the weight stopping any scheduled fading // although .enabled = false yields an effective weight of zero, this // method does *not* change .enabled, because it would be confusing setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()} // return the weight considering fading and .enabled getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const r=this._clip.duration,i=e._clip.duration,n=i/r,s=r/i;e.warp(1,n,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this} // Time Scale Control // set the time scale stopping any scheduled warping // although .paused = true yields an effective time scale of zero, this // method does *not* change .paused, because it would be confusing setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()} // return the time scale considering warping and .paused 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,r){const i=this._mixer,n=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=n,o[1]=n+r,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this} // Object Accessors getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root} // Interna _update(e,t,r,i){if(!this.enabled)return void this._updateWeight(e);const n=this._startTime;if(null!==n){const i=(e-n)*r;i<0||0===r?t=0:(this._startTime=null,t=r*i)}t*=this._updateTimeScale(e);const s=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===AdditiveAnimationBlendMode)for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(s),t[r].accumulateAdditive(a);else for(let r=0,n=e.length;r!==n;++r)e[r].evaluate(s),t[r].accumulate(i,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(null!==r){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(null!==r){t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,n=this._loopCount;const s=r===LoopPingPong;if(0===e)return-1===n?i:s&&1==(1&n)?t-i:i;if(r===LoopOnce){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===n&&(e>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=t||i<0){const r=Math.floor(i/t);i-=t*r,n+=Math.abs(r);const a=this.repetitions-n;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(s&&1==(1&n))return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=ZeroSlopeEnding,i.endingEnd=ZeroSlopeEnding):(i.endingStart=e?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,i.endingEnd=t?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)}_scheduleFading(e,t,r){const i=this._mixer,n=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=n,o[0]=t,a[1]=n+e,o[1]=r,this}},_controlInterpolantsResultBuffer=new Float32Array(1),AnimationMixer=class extends EventDispatcher{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,n=i.length,s=e._propertyBindings,a=e._interpolants,o=r.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let e=0;e!==n;++e){const n=i[e],l=n.name;let u=c[l];if(void 0!==u)++u.referenceCount,s[e]=u;else{if(u=s[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,l));continue}const i=t&&t._propertyBindings[e].binding.parsedPath;u=new PropertyMixer(PropertyBinding.create(r,l,i),n.ValueTypeName,n.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,l),s[e]=u}a[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,r=e._clip.uuid,i=this._actionsByClip[r];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,r,t)}const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,r=t.length;e!==r;++e){const r=t[e];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}} // Memory manager _initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const 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}}}} // Memory management for AnimationAction objects _isActiveAction(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this} // advance the time and update apply the animation update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,n=Math.sign(e),s=this._accuIndex^=1;for(let a=0;a!==r;++a){t[a]._update(i,e,n,s)}const a=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)a[e].apply(s);return this} // Allows you to seek to a specific time in an animation. setTime(e){this.time=0;for(let e=0;ethis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return _vector$4.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)}},_startP=new Vector3,_startEnd=new Vector3,Line3=class{constructor(e=new Vector3,t=new Vector3){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){_startP.subVectors(e,this.start),_startEnd.subVectors(this.end,this.start);const r=_startEnd.dot(_startEnd);let i=_startEnd.dot(_startP)/r;return t&&(i=clamp(i,0,1)),i}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).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)}},_vector$3=new Vector3,SpotLightHelper=class extends Object3D{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const r=new BufferGeometry,i=[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 e=0,t=1,r=32;e1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(_axis,t)}}setLength(e,t=.2*e,r=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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()}},AxesHelper=class extends LineSegments{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute(t,3)),r.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(r,new LineBasicMaterial({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,r){const i=new Color,n=this.geometry.attributes.color.array;return i.set(e),i.toArray(n,0),i.toArray(n,3),i.set(t),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},ShapePath=class{constructor(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,n,s){return this.currentPath.bezierCurveTo(e,t,r,i,n,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const r=t.length;let i=!1;for(let n=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=t[s],o=-o,a=t[n],l=-l),e.ya.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{const t=l*(e.x-r.x)-o*(e.y-r.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==r.y)continue;if(a.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=a.x)return!0}}return i}const r=ShapeUtils.isClockWise,i=this.subPaths;if(0===i.length)return[];let n,s,a;const o=[];if(1===i.length)return s=i[0],a=new Shape,a.curves=s.curves,o.push(a),o;let l=!r(i[0].getPoints());l=e?!l:l;const c=[],u=[];let h,p,d=[],m=0;u[m]=void 0,d[m]=[];for(let t=0,a=i.length;t1){let e=!1,r=0;for(let e=0,t=u.length;e0&&!1===e&&(d=c)}for(let e=0,t=u.length;e>-t-14,i[256|e]=1024>>-t-14|32768,n[e]=-t-1,n[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,n[e]=13,n[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,n[e]=24,n[256|e]=24):(i[e]=31744,i[256|e]=64512,n[e]=13,n[256|e]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;0==(8388608&t);)t<<=1,r-=8388608;t&=-8388609,r+=947912704,s[e]=t|r}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:a,offsetTable:o}}function toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=clamp(e,-65504,65504),_tables.floatView[0]=e;const t=_tables.uint32View[0],r=t>>23&511;return _tables.baseTable[r]+((8388607&t)>>_tables.shiftTable[r])}function fromHalfFloat(e){const t=e>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[t]+(1023&e)]+_tables.exponentTable[t],_tables.floatView[0]}var DataUtils=Object.freeze({__proto__:null,toHalfFloat:toHalfFloat,fromHalfFloat:fromHalfFloat});function ImmediateRenderObject(){console.error("THREE.ImmediateRenderObject has been removed.")}var WebGLMultisampleRenderTarget=class extends WebGLRenderTarget{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}},DataTexture2DArray=class extends DataArrayTexture{constructor(e,t,r,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,i)}},DataTexture3D=class extends Data3DTexture{constructor(e,t,r,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,i)}},BoxBufferGeometry=class extends BoxGeometry{constructor(e,t,r,i,n,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,r,i,n,s)}},CapsuleBufferGeometry=class extends CapsuleGeometry{constructor(e,t,r,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,r,i)}},CircleBufferGeometry=class extends CircleGeometry{constructor(e,t,r,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,r,i)}},ConeBufferGeometry=class extends ConeGeometry{constructor(e,t,r,i,n,s,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,r,i,n,s,a)}},CylinderBufferGeometry=class extends CylinderGeometry{constructor(e,t,r,i,n,s,a,o){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,r,i,n,s,a,o)}},DodecahedronBufferGeometry=class extends DodecahedronGeometry{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}},ExtrudeBufferGeometry=class extends ExtrudeGeometry{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}},IcosahedronBufferGeometry=class extends IcosahedronGeometry{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}},LatheBufferGeometry=class extends LatheGeometry{constructor(e,t,r,i){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,r,i)}},OctahedronBufferGeometry=class extends OctahedronGeometry{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}},PlaneBufferGeometry=class extends PlaneGeometry{constructor(e,t,r,i){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,r,i)}},PolyhedronBufferGeometry=class extends PolyhedronGeometry{constructor(e,t,r,i){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,r,i)}},RingBufferGeometry=class extends RingGeometry{constructor(e,t,r,i,n,s){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,r,i,n,s)}},ShapeBufferGeometry=class extends ShapeGeometry{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}},SphereBufferGeometry=class extends SphereGeometry{constructor(e,t,r,i,n,s,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,r,i,n,s,a)}},TetrahedronBufferGeometry=class extends TetrahedronGeometry{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}},TorusBufferGeometry=class extends TorusGeometry{constructor(e,t,r,i,n){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,r,i,n)}},TorusKnotBufferGeometry=class extends TorusKnotGeometry{constructor(e,t,r,i,n,s){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,r,i,n,s)}},TubeBufferGeometry=class extends TubeGeometry{constructor(e,t,r,i,n){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,r,i,n)}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION); // src/core/patches/Constants.ts var MAX_RAYCAST_INTERSECTION_COUNT=1,_sphere2=new Sphere,_vStart=new Vector3,_vEnd=new Vector3,_interSegment=new Vector3,_interRay=new Vector3; // src/core/patches/Line.ts function checkBufferGeometryIntersection2(e,t,r,i,n,s,a){_vStart.fromBufferAttribute(t,i).applyMatrix4(e.matrixWorld),_vEnd.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld);if(r.ray.distanceSqToSegment(_vStart,_vEnd,_interRay,_interSegment)>s)return!1;const o=r.ray.origin.distanceTo(_interRay);return!(or.far)&&(a.push({distance:o, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point:_interSegment.clone(),index:i,object:e}),!0)} // node_modules/three-mesh-bvh/src/core/Constants.js Line.prototype.raycast=function(e,t){const r=this.geometry,i=this.matrixWorld,n=e.params.Line.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),_sphere2.copy(r.boundingSphere),_sphere2.applyMatrix4(i),_sphere2.radius+=n,!1===e.ray.intersectsSphere(_sphere2))return;const a=n*n,o=this.isLineSegments?2:1,l=r.index,c=r.attributes.position,u=t.length;if(null!==l){const r=this.userData.batches;if(r&&r.length>0&&r[0].boundingSphere)for(let n=0;n=MAX_RAYCAST_INTERSECTION_COUNT))return}}else{for(let r=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count)-1;r=MAX_RAYCAST_INTERSECTION_COUNT))return}}}else{const r=this.userData.batches;if(r&&r.length>0&&r[0].boundingSphere)for(let n=0;n=MAX_RAYCAST_INTERSECTION_COUNT)return}else{for(let r=Math.max(0,s.start),i=Math.min(c.count,s.start+s.count)-1;r=MAX_RAYCAST_INTERSECTION_COUNT)return}}};var CENTER=0,AVERAGE=1,SAH=2,CONTAINED=2,TRIANGLE_INTERSECT_COST=1.25,TRAVERSAL_COST=1,BYTES_PER_NODE=32,IS_LEAFNODE_FLAG=65535,FLOAT32_EPSILON=Math.pow(2,-24),MeshBVHNode=class{constructor(){}}; // node_modules/three-mesh-bvh/src/utils/ArrayBoxUtilities.js function arrayToBox(e,t,r){return r.min.x=t[e],r.min.y=t[e+1],r.min.z=t[e+2],r.max.x=t[e+3],r.max.y=t[e+4],r.max.z=t[e+5],r}function getLongestEdgeIndex(e){let t=-1,r=-1/0;for(let i=0;i<3;i++){const n=e[i+3]-e[i];n>r&&(r=n,t=i)}return t}function copyBounds(e,t){t.set(e)}function unionBounds(e,t,r){let i,n;for(let s=0;s<3;s++){const a=s+3;i=e[s],n=t[s],r[s]=in?i:n}}function expandByTriangleBounds(e,t,r){for(let i=0;i<3;i++){const n=t[e+2*i],s=t[e+2*i+1],a=n-s,o=n+s;ar[i+3]&&(r[i+3]=o)}}function computeSurfaceArea(e){const t=e[3]-e[0],r=e[4]-e[1],i=e[5]-e[2];return 2*(t*r+r*i+i*t)} // node_modules/three-mesh-bvh/src/core/buildFunctions.js function ensureIndex(e,t){if(!e.index){const r=e.attributes.position.count,i=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let n;n=r>65535?new Uint32Array(new i(4*r)):new Uint16Array(new i(2*r)),e.setIndex(new BufferAttribute(n,1));for(let e=0;ee-t));for(let e=0;el&&(l=y),_&&tm&&(m=t);const T=e[i+2],v=e[i+3],E=T-v,I=T+v;Ec&&(c=I),_&&Tf&&(f=T);const b=e[i+4],x=e[i+5],S=b-x,w=b+x;Su&&(u=w),_&&bg&&(g=b)}i[0]=s,i[1]=a,i[2]=o,i[3]=l,i[4]=c,i[5]=u,_&&(n[0]=h,n[1]=p,n[2]=d,n[3]=m,n[4]=f,n[5]=g)}function getCentroidBounds(e,t,r,i){let n=1/0,s=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;for(let i=6*t,u=6*(t+r);io&&(o=t);const r=e[i+2];rl&&(l=r);const u=e[i+4];uc&&(c=u)}i[0]=n,i[1]=s,i[2]=a,i[3]=o,i[4]=l,i[5]=c}function partition(e,t,r,i,n){let s=r,a=r+i-1;const o=n.pos,l=2*n.axis;for(;;){for(;s<=a&&t[6*s+l]=o;)a--;if(!(se.candidate-t.candidate,sahBins=new Array(BIN_COUNT).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),leftBounds=new Float32Array(6);function getOptimalSplit(e,t,r,i,n,s){let a=-1,o=0;if(s===CENTER)a=getLongestEdgeIndex(t),-1!==a&&(o=(t[a]+t[a+3])/2);else if(s===AVERAGE)a=getLongestEdgeIndex(e),-1!==a&&(o=getAverage(r,i,n,a));else if(s===SAH){const s=computeSurfaceArea(e);let l=TRIANGLE_INTERSECT_COST*n;const c=6*i,u=6*(i+n);for(let e=0;e<3;e++){const i=t[e],h=(t[e+3]-i)/BIN_COUNT;if(n=s.candidate?expandByTriangleBounds(i,r,s.rightCacheBounds):(expandByTriangleBounds(i,r,s.leftCacheBounds),s.count++)}}for(let r=0;r=BIN_COUNT&&(n=BIN_COUNT-1);const s=sahBins[n];s.count++,expandByTriangleBounds(t,r,s.bounds)}const t=sahBins[BIN_COUNT-1];copyBounds(t.bounds,t.rightCacheBounds);for(let e=BIN_COUNT-2;e>=0;e--){const t=sahBins[e],r=sahBins[e+1];unionBounds(t.bounds,r.rightCacheBounds,t.rightCacheBounds)}let p=0;for(let t=0;tf&&(f=n),l>f&&(f=l);const g=(f-c)/2,_=2*e;s[h+_+0]=c+g,s[h+_+1]=g+(Math.abs(c)+g)*FLOAT32_EPSILON,ct[e+3]&&(t[e+3]=f)}}return s}function buildTree(e,t){function r(e){p&&p(e/d)}function i(t,n,p,d=null,f=0){if(!m&&f>=l&&(m=!0,c&&(console.warn(`MeshBVH: Max depth of ${l} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),p<=u||f>=l)return r(n+p),t.offset=n,t.count=p,t;const g=getOptimalSplit(t.boundingData,d,a,n,p,h);if(-1===g.axis)return r(n+p),t.offset=n,t.count=p,t;const _=partition(o,a,n,p,g);if(_===n||_===n+p)r(n+p),t.offset=n,t.count=p;else{t.splitAxis=g.axis;const e=new MeshBVHNode,r=n,o=_-n;t.left=e,e.boundingData=new Float32Array(6),getBounds(a,r,o,e.boundingData,s),i(e,r,o,s,f+1);const l=new MeshBVHNode,c=_,u=p-o;t.right=l,l.boundingData=new Float32Array(6),getBounds(a,c,u,l.boundingData,s),i(l,c,u,s,f+1)}return t}ensureIndex(e,t);const n=new Float32Array(6),s=new Float32Array(6),a=computeTriangleBounds(e,n),o=e.index.array,l=t.maxDepth,c=t.verbose,u=t.maxLeafTris,h=t.strategy,p=t.onProgress,d=e.index.count/3;let m=!1;const f=[],g=getRootIndexRanges(e);if(1===g.length){const e=g[0],t=new MeshBVHNode;t.boundingData=n,getCentroidBounds(a,e.offset,e.count,s),i(t,e.offset,e.count,s),f.push(t)}else for(let e of g){const t=new MeshBVHNode;t.boundingData=new Float32Array(6),getBounds(a,e.offset,e.count,t.boundingData,s),i(t,e.offset,e.count,s),f.push(t)}return f}function buildPackedTree(e,t){const r=buildTree(e,t);let i,n,s;const a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let e=0;eMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[r+6]=o/4,o=c(o,s),n[r+7]=a,o}}} // node_modules/three-mesh-bvh/src/math/SeparatingAxisBounds.js var SeparatingAxisBounds=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let r=1/0,i=-1/0;for(let n=0,s=e.length;ni?s:i}this.min=r,this.max=i}setFromPoints(e,t){let r=1/0,i=-1/0;for(let n=0,s=t.length;ni?a:i}this.min=r,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}};SeparatingAxisBounds.prototype.setFromBox=function(){const e=new Vector3;return function(t,r){const i=r.min,n=r.max;let s=1/0,a=-1/0;for(let r=0;r<=1;r++)for(let o=0;o<=1;o++)for(let l=0;l<=1;l++){e.x=i.x*r+n.x*(1-r),e.y=i.y*o+n.y*(1-o),e.z=i.z*l+n.z*(1-l);const c=t.dot(e);s=Math.min(c,s),a=Math.max(c,a)}this.min=s,this.max=a}}();var areIntersecting=function(){const e=new SeparatingAxisBounds;return function(t,r){const i=t.points,n=t.satAxes,s=t.satBounds,a=r.points,o=r.satAxes,l=r.satBounds;for(let t=0;t<3;t++){const r=s[t],i=n[t];if(e.setFromPoints(i,a),r.isSeparated(e))return!1}for(let t=0;t<3;t++){const r=l[t],n=o[t];if(e.setFromPoints(n,i),r.isSeparated(e))return!1}}}(),closestPointLineToLine=function(){const e=new Vector3,t=new Vector3,r=new Vector3;return function(i,n,s){const a=i.start,o=e,l=n.start,c=t;r.subVectors(a,l),e.subVectors(i.end,i.start),t.subVectors(n.end,n.start);const u=r.dot(c),h=c.dot(o),p=c.dot(c),d=r.dot(o),m=o.dot(o)*p-h*h;let f,g;f=0!==m?(u*h-d*p)/m:0,g=(u+f*h)/p,s.x=f,s.y=g}}(),closestPointsSegmentToSegment=function(){const e=new Vector2,t=new Vector3,r=new Vector3;return function(i,n,s,a){closestPointLineToLine(i,n,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return i.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 i.closestPointToPoint(a,!0,s);if(l>=0&&l<=1)return o<0?i.at(0,s):i.at(1,s),void n.closestPointToPoint(s,!0,a);{let e,c;e=o<0?i.start:i.end,c=l<0?n.start:n.end;const u=t,h=r;return i.closestPointToPoint(c,!0,t),n.closestPointToPoint(e,!0,r),u.distanceToSquared(c)<=h.distanceToSquared(e)?(s.copy(u),void a.copy(c)):(s.copy(e),void a.copy(h))}}}(),sphereIntersectTriangle=function(){const e=new Vector3,t=new Vector3,r=new Plane,i=new Line3;return function(n,s){const{radius:a,center:o}=n,{a:l,b:c,c:u}=s;i.start=l,i.end=c;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;i.start=l,i.end=u;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;i.start=c,i.end=u;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;const h=s.getPlane(r);if(Math.abs(h.distanceToPoint(o))<=a){const e=h.projectPoint(o,t);if(s.containsPoint(e))return!0}return!1}}(),DIST_EPSILON=1e-15; // node_modules/three-mesh-bvh/src/math/MathUtilities.js function isNearZero(e){return Math.abs(e)new Vector3)),this.satBounds=new Array(4).fill().map((()=>new SeparatingAxisBounds)),this.points=[this.a,this.b,this.c],this.sphere=new Sphere,this.plane=new Plane,this.needsUpdate=!0}intersectsSphere(e){return sphereIntersectTriangle(e,this)}update(){const e=this.a,t=this.b,r=this.c,i=this.points,n=this.satAxes,s=this.satBounds,a=n[0],o=s[0];this.getNormal(a),o.setFromPoints(a,i);const l=n[1],c=s[1];l.subVectors(e,t),c.setFromPoints(l,i);const u=n[2],h=s[2];u.subVectors(t,r),h.setFromPoints(u,i);const p=n[3],d=s[3];p.subVectors(r,e),d.setFromPoints(p,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}};ExtendedTriangle.prototype.closestPointToSegment=function(){const e=new Vector3,t=new Vector3,r=new Line3;return function(i,n=null,s=null){const{start:a,end:o}=i,l=this.points;let c,u=1/0;for(let a=0;a<3;a++){const o=(a+1)%3;r.start.copy(l[a]),r.end.copy(l[o]),closestPointsSegmentToSegment(r,i,e,t),c=e.distanceToSquared(t),c1-1e-10){const e=this.satBounds,a=this.satAxes;r[0]=p.a,r[1]=p.b,r[2]=p.c;for(let t=0;t<4;t++){const n=e[t],s=a[t];if(i.setFromPoints(s,r),n.isSeparated(i))return!1}const o=p.satBounds,l=p.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let e=0;e<4;e++){const r=o[e],n=l[e];if(i.setFromPoints(n,t),r.isSeparated(i))return!1}for(let e=0;e<4;e++){const o=a[e];for(let e=0;e<4;e++){const a=l[e];if(s.crossVectors(o,a),i.setFromPoints(s,t),n.setFromPoints(s,r),i.isSeparated(n))return!1}}return d&&(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}{const e=this.points;let t=!1,r=0;for(let i=0;i<3;i++){const n=e[i],s=e[(i+1)%3];c.start.copy(n),c.end.copy(s),c.delta(a);const o=t?u.start:u.end,l=isNearZero(f.distanceToPoint(n));if(isNearZero(f.normal.dot(a))&&l){u.copy(c),r=2;break}if((f.intersectLine(c,o)||l)&&!isNearZero(o.distanceTo(s))){if(r++,t)break;t=!0}}if(1===r&&p.containsPoint(u.end))return d&&(d.start.copy(u.end),d.end.copy(u.end)),!0;if(2!==r)return!1;const i=p.points;let n=!1,s=0;for(let e=0;e<3;e++){const t=i[e],r=i[(e+1)%3];c.start.copy(t),c.end.copy(r),c.delta(o);const a=n?h.start:h.end,l=isNearZero(m.distanceToPoint(t));if(isNearZero(m.normal.dot(o))&&l){h.copy(c),s=2;break}if((m.intersectLine(c,a)||l)&&!isNearZero(a.distanceTo(r))){if(s++,n)break;n=!0}}if(1===s&&this.containsPoint(h.end))return d&&(d.start.copy(h.end),d.end.copy(h.end)),!0;if(2!==s)return!1;if(u.delta(a),h.delta(o),a.dot(o)<0){let e=h.start;h.start=h.end,h.end=e}const g=u.start.dot(a),_=u.end.dot(a),y=h.start.dot(a),T=h.end.dot(a);return(g===T||y===_||_0?d.start.copy(u.start):d.start.copy(h.start),l.subVectors(u.end,h.end),l.dot(a)<0?d.end.copy(u.end):d.end.copy(h.end)),!0)}}}(),ExtendedTriangle.prototype.distanceToPoint=function(){const e=new Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),ExtendedTriangle.prototype.distanceToTriangle=function(){const e=new Vector3,t=new Vector3,r=["a","b","c"],i=new Line3,n=new Line3;return function(s,a=null,o=null){const l=a||o?i:null;if(this.intersectsTriangle(s,l))return(a||o)&&(a&&l.getCenter(a),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let i;const n=r[t],l=s[n];this.closestPointToPoint(l,e),i=l.distanceToSquared(e),inew Vector3)),this.satAxes=new Array(3).fill().map((()=>new Vector3)),this.satBounds=new Array(3).fill().map((()=>new SeparatingAxisBounds)),this.alignedSatBounds=new Array(3).fill().map((()=>new SeparatingAxisBounds)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),r&&this.matrix.copy(r)}set(e,t,r){this.min.copy(e),this.max.copy(t),this.matrix.copy(r),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}};OrientedBox.prototype.update=function(){const e=this.matrix,t=this.min,r=this.max,i=this.points;for(let n=0;n<=1;n++)for(let s=0;s<=1;s++)for(let a=0;a<=1;a++){const o=i[1*n|2*s|4*a];o.x=n?r.x:t.x,o.y=s?r.y:t.y,o.z=a?r.z:t.z,o.applyMatrix4(e)}const n=this.satBounds,s=this.satAxes,a=i[0];for(let e=0;e<3;e++){const t=s[e],r=n[e],o=i[1<new Line3)),r=new Array(12).fill().map((()=>new Line3)),i=new Vector3,n=new Vector3;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,i),s.closestPointToPoint(i,n),o&&o.copy(i),l&&l.copy(n)),0;const c=a*a,u=s.min,h=s.max,p=this.points;let d=1/0;for(let e=0;e<8;e++){const t=p[e];n.copy(t).clamp(u,h);const r=t.distanceToSquared(n);if(rr.far?null:e)} // node_modules/three-mesh-bvh/src/utils/TriangleUtilities.js function setTriangle(e,t,r,i){const n=e.a,s=e.b,a=e.c;let o=t,l=t+1,c=t+2;r&&(o=r.getX(t),l=r.getX(t+1),c=r.getX(t+2)),n.x=i.getX(o),n.y=i.getY(o),n.z=i.getZ(o),s.x=i.getX(l),s.y=i.getY(l),s.z=i.getZ(l),a.x=i.getX(c),a.y=i.getY(c),a.z=i.getZ(c)}function iterateOverTriangles(e,t,r,i,n,s,a){const o=r.index,l=r.attributes.position;for(let r=e,c=t+e;r=0;let c,u;l?(c=LEFT_NODE(e),u=RIGHT_NODE(e,o)):(c=RIGHT_NODE(e,o),u=LEFT_NODE(e));const h=intersectRay(c,s,i,boxIntersection)?raycastFirst(c,t,r,i):null;if(h){const e=h.point[a];if(l?e<=s[u+n]: // min bounding data e>=s[u+n+3])return h}const p=intersectRay(u,s,i,boxIntersection)?raycastFirst(u,t,r,i):null;return h&&p?h.distance<=p.distance?h:p:h||p||null}}var shapecast=function(){let e,t;const r=[],i=new PrimitivePool((()=>new Box3));return function(...s){e=i.getPrimitive(),t=i.getPrimitive(),r.push(e,t);const a=n(...s);i.releasePrimitive(e),i.releasePrimitive(t),r.pop(),r.pop();const o=r.length;return o>0&&(t=r[o-1],e=r[o-2]),a};function n(r,i,s,a,o=null,l=0,c=0){function u(e){let t=2*e,r=_uint16Array,i=_uint32Array;for(;!IS_LEAF(t,r);)t=2*(e=LEFT_NODE(e));return OFFSET(e,i)}function h(e){let t=2*e,r=_uint16Array,i=_uint32Array;for(;!IS_LEAF(t,r);)t=2*(e=RIGHT_NODE(e,i));return OFFSET(e,i)+COUNT(t,r)}let p=2*r,d=_float32Array,m=_uint16Array,f=_uint32Array;if(IS_LEAF(p,m)){const t=OFFSET(r,f),i=COUNT(p,m);return arrayToBox(BOUNDING_DATA_INDEX(r),d,e),a(t,i,!1,c,l+r,e)}{const p=LEFT_NODE(r),g=RIGHT_NODE(r,f);let _,y,T,v,E=p,I=g;if(o&&(T=e,v=t,arrayToBox(BOUNDING_DATA_INDEX(E),d,T),arrayToBox(BOUNDING_DATA_INDEX(I),d,v),_=o(T),y=o(v),y<_)){E=g,I=p;const e=_;_=y,y=e,T=v}T||(T=e,arrayToBox(BOUNDING_DATA_INDEX(E),d,T));const b=s(T,IS_LEAF(2*E,m),_,c+1,l+E);let x;if(b===CONTAINED){const e=u(E);x=a(e,h(E)-e,!0,c+1,l+E,T)}else x=b&&n(E,i,s,a,o,l,c+1);if(x)return!0;v=t,arrayToBox(BOUNDING_DATA_INDEX(I),d,v);const S=s(v,IS_LEAF(2*I,m),y,c+1,l+I);let w;if(S===CONTAINED){const e=u(I);w=a(e,h(I)-e,!0,c+1,l+I,v)}else w=S&&n(I,i,s,a,o,l,c+1);return!!w}}}(),intersectsGeometry=function(){const e=new ExtendedTriangle,t=new ExtendedTriangle,r=new Matrix4,i=new OrientedBox,n=new OrientedBox;return function s(a,o,l,c,u=null){let h=2*a,p=_float32Array,d=_uint16Array,m=_uint32Array;null===u&&(l.boundingBox||l.computeBoundingBox(),i.set(l.boundingBox.min,l.boundingBox.max,c),u=i);if(!IS_LEAF(h,d)){const e=a+8,t=m[a+6];arrayToBox(BOUNDING_DATA_INDEX(e),p,boundingBox);if(u.intersectsBox(boundingBox)&&s(e,o,l,c,u))return!0;arrayToBox(BOUNDING_DATA_INDEX(t),p,boundingBox);return!!(u.intersectsBox(boundingBox)&&s(t,o,l,c,u))}{const i=o,s=i.index,u=i.attributes.position,f=l.index,g=l.attributes.position,_=OFFSET(a,m),y=COUNT(h,d);if(r.copy(c).invert(),l.boundsTree){arrayToBox(BOUNDING_DATA_INDEX(a),p,n),n.matrix.copy(r),n.needsUpdate=!0;const e=l.boundsTree.shapecast({intersectsBounds:e=>n.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let r=3*_,i=3*(y+_);rnew ExtendedTriangle)),MeshBVH=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."),MeshBVH.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t=__spreadValues({cloneBuffers:!0},t);const r=e.geometry,i=e._roots,n=r.getIndex();let s;return s=t.cloneBuffers?{roots:i.map((e=>e.slice())),index:n.array.slice()}:{roots:i,index:n.array},s}static deserialize(e,t,r={}){if("boolean"==typeof r)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),MeshBVH.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});r=__spreadValues({setIndex:!0},r);const{index:i,roots:n}=e,s=new MeshBVH(t,__spreadProps(__spreadValues({},r),{[SKIP_GENERATION]:!0}));if(s._roots=n,r.setIndex){const r=t.getIndex();if(null===r){const r=new BufferAttribute(e.index,1,!1);t.setIndex(r)}else r.array!==i&&(r.array.set(i),r.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:CENTER,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null, // undocumented options // Whether to skip generating the tree. Used for deserialization. [SKIP_GENERATION]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[SKIP_GENERATION]||(this._roots=buildPackedTree(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Box3))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,r=t.index.array,i=t.attributes.position;let n,s,a,o,l=0;const c=this._roots;for(let e=0,t=c.length;eh&&(h=s),ap&&(p=a),od&&(d=o)}return(o[t+0]!==n||o[t+1]!==l||o[t+2]!==u||o[t+3]!==h||o[t+4]!==p||o[t+5]!==d)&&(o[t+0]=n,o[t+1]=l,o[t+2]=u,o[t+3]=h,o[t+4]=p,o[t+5]=d,!0)}{const r=t+8,i=s[t+6],a=r+n,c=i+n;let h=l,p=!1,d=!1;e?h||(p=e.has(a),d=e.has(c),h=!p&&!d):(p=!0,d=!0);const m=h||d;let f=!1;(h||p)&&(f=u(r,n,h));let g=!1;m&&(g=u(i,n,h));const _=f||g;if(_)for(let e=0;e<3;e++){const n=r+e,s=i+e,a=o[n],l=o[n+3],c=o[s],u=o[s+3];o[t+e]=au?l:u}return _}}}traverse(e,t=0){const r=this._roots[t],i=new Uint32Array(r),n=new Uint16Array(r);!function t(s,a=0){const o=2*s,l=n[o+15]===IS_LEAFNODE_FLAG;if(l){const t=i[s+6],c=n[o+14];e(a,l,new Float32Array(r,4*s,6),t,c)}else{const n=s+BYTES_PER_NODE/4,o=i[s+6],c=i[s+7];e(a,l,new Float32Array(r,4*s,6),c)||(t(n,a+1),t(o,a+1))}}(0)} /* Core Cast Functions */raycast(e,t=FrontSide){const r=this._roots,i=this.geometry,n=[],s=t.isMaterial,a=Array.isArray(t),o=i.groups,l=s?t.side:t;for(let s=0,c=r.length;s{const s=3*r;return e(t,s,s+1,s+2,i,n)}}e={boundsTraverseOrder:r,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.")}const n=trianglePool.getPrimitive();let{boundsTraverseOrder:s,intersectsBounds:a,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const e=o;o=(t,r,s,a,o)=>!!e(t,r,s,a,o)||iterateOverTriangles(t,r,i,l,s,a,n)}else o||(o=l?(e,t,r,s)=>iterateOverTriangles(e,t,i,l,r,s,n):(e,t,r)=>r);let c=!1,u=0;for(const e of this._roots){if(setBuffer(e),c=shapecast(0,i,a,o,s,u),clearBuffer(),c)break;u+=e.byteLength}return trianglePool.releasePrimitive(n),c}bvhcast(e,t,r){let{intersectsRanges:i,intersectsTriangles:n}=r;const s=this.geometry.index,a=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;tempMatrix.copy(t).invert();const c=trianglePool.getPrimitive(),u=trianglePool.getPrimitive();if(n){let e=function(e,r,i,h,p,d,m,f){for(let g=i,_=i+h;g<_;g++){setTriangle(u,3*g,o,l),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let t=e,i=e+r;taabb2.intersectsBox(e),intersectsRange:(t,r,n,s,a,o)=>(aabb.copy(o),aabb.applyMatrix4(tempMatrix),e.shapecast({intersectsBounds:e=>aabb.intersectsBox(e),intersectsRange:(e,n,o,l,c)=>i(t,r,e,n,s,a,l,c)}))});return trianglePool.releasePrimitive(c),trianglePool.releasePrimitive(u),h} /* Derived Cast Functions */intersectsBox(e,t){return obb.set(e.min,e.max,t),obb.needsUpdate=!0,this.shapecast({intersectsBounds:e=>obb.intersectsBox(e),intersectsTriangle:e=>obb.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,r={},i={},n=0,s=1/0){e.boundingBox||e.computeBoundingBox(),obb.set(e.boundingBox.min,e.boundingBox.max,t),obb.needsUpdate=!0;const a=this.geometry,o=a.attributes.position,l=a.index,c=e.attributes.position,u=e.index,h=trianglePool.getPrimitive(),p=trianglePool.getPrimitive();let d=temp1,m=temp2,f=null,g=null;i&&(f=temp3,g=temp4);let _=1/0,y=null,T=null;return tempMatrix.copy(t).invert(),obb2.matrix.copy(tempMatrix),this.shapecast({boundsTraverseOrder:e=>obb.distanceToBox(e),intersectsBounds:(e,t,r)=>r<_&&r{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>obb2.distanceToBox(e),intersectsBounds:(e,t,r)=>r<_&&r{for(let a=3*e,v=3*(e+s);a(temp.copy(e).clamp(t.min,t.max),temp.distanceToSquared(e)),intersectsBounds:(e,t,r)=>r{t.closestPointToPoint(e,temp);const i=e.distanceToSquared(temp);return i{arrayToBox(0,new Float32Array(t),tempBox),e.union(tempBox)})),e}},ray=new Ray,tmpInverseMatrix=new Matrix4,origMeshRaycastFunc=Mesh.prototype.raycast;function acceleratedRaycast(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;tmpInverseMatrix.copy(this.matrixWorld).invert(),ray.copy(e.ray).applyMatrix4(tmpInverseMatrix);const r=this.geometry.boundsTree;if(!0===e.firstHitOnly){const i=convertRaycastIntersect(r.raycastFirst(ray,this.material),this,e);i&&t.push(i)}else{const i=r.raycast(ray,this.material);for(let r=0,n=i.length;rr.far?null:{distance:c,point:_intersectionPointWorld2.clone(),object:e}}function checkBufferGeometryIntersection4(e,t,r,i,n,s,a,o,l,c,u,h){_vA2.fromBufferAttribute(n,c),_vB2.fromBufferAttribute(n,u),_vC2.fromBufferAttribute(n,h);const p=e.morphTargetInfluences;if(s&&p){_morphA2.set(0,0,0),_morphB2.set(0,0,0),_morphC2.set(0,0,0);for(let e=0,t=s.length;e=MAX_RAYCAST_INTERSECTION_COUNT)return}}else{for(let r=Math.max(0,d.start),n=Math.min(a.count,d.start+d.count);r=MAX_RAYCAST_INTERSECTION_COUNT)return}}else if(void 0!==o)if(Array.isArray(i))for(let r=0,n=p.length;r=MAX_RAYCAST_INTERSECTION_COUNT)return}}else{for(let r=Math.max(0,d.start),n=Math.min(o.count,d.start+d.count);r=MAX_RAYCAST_INTERSECTION_COUNT)return}}},Mesh.prototype.raycast=acceleratedRaycast;var _sphere4=new Sphere,_position2=new Vector3;function testPoint2(e,t,r,i,n,s){const a=i.ray.distanceSqToPoint(e);if(ai.far)return;n.push({distance:o,distanceToRay:Math.sqrt(a),point:r,index:t,face:null,object:s})}} // node_modules/three/examples/jsm/renderers/Projector.js Points.prototype.raycast=function(e,t){const r=this.geometry,i=this.matrixWorld,n=e.params.Points.threshold,s=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),_sphere4.copy(r.boundingSphere),_sphere4.applyMatrix4(i),_sphere4.radius+=n,!1===e.ray.intersectsSphere(_sphere4))return;const a=n*n,o=r.index,l=r.attributes.position,c=t.length;if(null!==o){for(let r=Math.max(0,s.start),n=Math.min(o.count,s.start+s.count);r=MAX_RAYCAST_INTERSECTION_COUNT)return}}else{for(let r=Math.max(0,s.start),n=Math.min(l.count,s.start+s.count);r=MAX_RAYCAST_INTERSECTION_COUNT)return}};var RenderableObject=class{constructor(){this.id=0,this.object=null,this.z=0,this.renderOrder=0}},RenderableFace=class{constructor(){this.id=0,this.v1=new RenderableVertex,this.v2=new RenderableVertex,this.v3=new RenderableVertex,this.normalModel=new Vector3,this.vertexNormalsModel=[new Vector3,new Vector3,new Vector3],this.vertexNormalsLength=0,this.color=new Color,this.material=null,this.uvs=[new Vector2,new Vector2,new Vector2],this.z=0,this.renderOrder=0}},RenderableVertex=class{constructor(){this.position=new Vector3,this.positionWorld=new Vector3,this.positionScreen=new Vector4,this.visible=!0}copy(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)}},RenderableLine=class{constructor(){this.id=0,this.v1=new RenderableVertex,this.v2=new RenderableVertex,this.vertexColors=[new Color,new Color],this.material=null,this.z=0,this.renderOrder=0}},RenderableSprite=class{constructor(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new Vector2,this.material=null,this.renderOrder=0}},Projector=class{constructor(){let e,t,r,i,n,s,a,o,l,c,u,h=0,p=0,d=0,m=0,f=0;const g={objects:[],lights:[],elements:[]},_=new Vector3,y=new Vector4,T=new Box3(new Vector3(-1,-1,-1),new Vector3(1,1,1)),v=new Box3,E=new Array(3),I=new Matrix4,b=new Matrix4,x=new Matrix4,S=new Frustum,w=[],C=[],M=[],R=[],A=[];const D=new function(){const e=[],t=[],s=[];let l=null;const c=new Matrix3;function h(e){const t=e.position,r=e.positionWorld,i=e.positionScreen;r.copy(t).applyMatrix4(u),i.copy(r).applyMatrix4(b);const n=1/i.w;i.x*=n,i.y*=n,i.z*=n,e.visible=i.x>=-1&&i.x<=1&&i.y>=-1&&i.y<=1&&i.z>=-1&&i.z<=1}function d(e,t,r){return!0===e.visible||!0===t.visible||!0===r.visible||(E[0]=e.positionScreen,E[1]=t.positionScreen,E[2]=r.positionScreen,T.intersectsBox(v.setFromPoints(E)))}function f(e,t,r){return(r.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(r.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}return{setObject:function(r){l=r,c.getNormalMatrix(l.matrixWorld),e.length=0,t.length=0,s.length=0},projectVertex:h,checkTriangleVisibility:d,checkBackfaceCulling:f,pushVertex:function(e,t,n){r=function(){if(i===p){const e=new RenderableVertex;return C.push(e),p++,i++,e}return C[i++]}(),r.position.set(e,t,n),h(r)},pushNormal:function(t,r,i){e.push(t,r,i)},pushColor:function(e,r,i){t.push(e,r,i)},pushUv:function(e,t){s.push(e,t)},pushLine:function(e,r){const i=C[e],n=C[r];i.positionScreen.copy(i.position).applyMatrix4(x),n.positionScreen.copy(n.position).applyMatrix4(x),!0===function(e,t){let r=0,i=1;const 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?r=Math.max(r,n/(n-s)):s<0&&(i=Math.min(i,n/(n-s))),a<0?r=Math.max(r,a/(a-o)):o<0&&(i=Math.min(i,a/(a-o))),!(i=-1&&e.z<=1&&(l=function(){if(c===f){const e=new RenderableSprite;return A.push(e),f++,c++,e}return A[c++]}(),l.id=t.id,l.x=e.x*i,l.y=e.y*i,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+r.projectionMatrix.elements[0])/(e.w+r.projectionMatrix.elements[12])),l.scale.y=t.scale.y*Math.abs(l.y-(e.y+r.projectionMatrix.elements[5])/(e.w+r.projectionMatrix.elements[13])),l.material=t.material,g.elements.push(l))}function N(){if(s===d){const e=new RenderableFace;return M.push(e),d++,s++,e}return M[s++]}function F(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}this.projectScene=function(e,r,n,a){s=0,o=0,c=0,g.elements.length=0,!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===r.parent&&!0===r.matrixWorldAutoUpdate&&r.updateMatrixWorld(),I.copy(r.matrixWorldInverse),b.multiplyMatrices(r.projectionMatrix,I),S.setFromProjectionMatrix(b),t=0,g.objects.length=0,g.lights.length=0,O(e),!0===n&&g.objects.sort(F);const l=g.objects;for(let e=0,t=l.length;e0)for(let n=0;n0)for(let i=0;i0;)P.removeChild(P.childNodes[0])}function F(e){return null!==g?e.toFixed(g):e}function U(e,t,r){let i=t.scale.x*s,n=t.scale.y*a;r.isPointsMaterial&&(i*=r.size,n*=r.size);const o="M"+F(e.x-.5*i)+","+F(e.y-.5*n)+"h"+F(i)+"v"+F(n)+"h"+F(-i)+"z";let l="";(r.isSpriteMaterial||r.isPointsMaterial)&&(l="fill:"+r.color.getStyle()+";fill-opacity:"+r.opacity),V(l,o)}function B(e,t,r){const i="M"+F(e.positionScreen.x)+","+F(e.positionScreen.y)+"L"+F(t.positionScreen.x)+","+F(t.positionScreen.y);if(r.isLineBasicMaterial){let e="fill:none;stroke:"+r.color.getStyle()+";stroke-opacity:"+r.opacity+";stroke-width:"+r.linewidth+";stroke-linecap:"+r.linecap;r.isLineDashedMaterial&&(e=e+";stroke-dasharray:"+r.dashSize+","+r.gapSize),V(e,i)}}function k(e,t,i,n,s){y.info.render.vertices+=3,y.info.render.faces++;const a="M"+F(e.positionScreen.x)+","+F(e.positionScreen.y)+"L"+F(t.positionScreen.x)+","+F(t.positionScreen.y)+"L"+F(i.positionScreen.x)+","+F(i.positionScreen.y)+"z";let o="";s.isMeshBasicMaterial?(E.copy(s.color),s.vertexColors&&E.multiply(n.color)):s.isMeshLambertMaterial||s.isMeshPhongMaterial||s.isMeshStandardMaterial?(I.copy(s.color),s.vertexColors&&I.multiply(n.color),E.copy(b),C.copy(e.positionWorld).add(t.positionWorld).add(i.positionWorld).divideScalar(3),function(e,t,r,i){for(let n=0,s=e.length;n1)continue;if(l.positionScreen.z<-1||l.positionScreen.z>1)continue;if(c.positionScreen.z<-1||c.positionScreen.z>1)continue;o.positionScreen.x*=s,o.positionScreen.y*=-a,l.positionScreen.x*=s,l.positionScreen.y*=-a,c.positionScreen.x*=s,c.positionScreen.y*=-a,this.overdraw>0&&(G(o.positionScreen,l.positionScreen,this.overdraw),G(l.positionScreen,c.positionScreen,this.overdraw),G(c.positionScreen,o.positionScreen,this.overdraw)),v.setFromPoints([o.positionScreen,l.positionScreen,c.positionScreen]),!0===T.intersectsBox(v)&&k(o,l,c,r,i)}}H(),i.traverseVisible((function(e){if(e.isSVGObject){if(w.setFromMatrixPosition(e.matrixWorld),w.applyMatrix4(D),w.z<-1||w.z>1)return;const t=w.x*s,r=-w.y*a,i=e.node;i.setAttribute("transform",`translate(${t}, ${r}) rotate(${e.rotation.z})`),P.appendChild(i)}}))}}};function convertHexToThreeColor(e){const t={};return t.r=(e>>16&255)/255,t.g=(e>>8&255)/255,t.b=(255&e)/255,t} // src/core/utils/LogUtils.ts var loglevel=__toESM(require_loglevel(),1),log=loglevel;log.setLevel("info"); // node_modules/three/examples/jsm/renderers/SVGRenderer.js var SVGObject2=class extends Object3D{constructor(e){super(),this.isSVGObject=!0,this.node=e}},SNAP_ICON_COLOR="#7fffbf",SNAP_ICON_SIZE=10,DEFAULT_LABEL_FONT_SIZE=14,DEFAULT_LINE_WIDTH=2.5,SVGObjectUtils=class{static createSVGObject(e){return new SVGObject2(e)}static createPointMarker(e=SNAP_ICON_SIZE){return SVGObjectUtils.createSnapIcon("Dot"/* Dot */,SNAP_ICON_COLOR,e,"#ffffff","2")}static createSnapIcon(e,t="none",r=SNAP_ICON_SIZE,i=SNAP_ICON_COLOR,n="2"){const s=document.createElementNS("http://www.w3.org/2000/svg","path");let a=r,o="";switch(e){case"Dot"/* Dot */:a=r/3,o=`\n M ${-a}, 0\n a ${a}, ${a} 0 1, 0 ${2*a}, 0\n a ${a}, ${a} 0 1, 0 -${2*a}, 0\n `;break;case"Square"/* Square */:a=r/1.2,o=`\n M ${-a/2}, ${-a/2}\n h ${a}\n v ${a}\n h ${-a}\n z\n `;break;case"Triangle"/* Triangle */:a=r/2,o=`\n M 0, ${-a}\n L ${-.87*a}, ${a/2}\n L ${.87*a}, ${a/2}\n z\n `;break;case"Cross"/* Cross */:a=r/1.2,o=`\n M ${-a/2}, ${-a/2}\n L ${a/2}, ${a/2}\n M ${a/2}, ${-a/2}\n L ${-a/2}, ${a/2}\n `;break;case"Perpendicular"/* Perpendicular */:a=r,o=`\n M 0, 0\n L ${-a/2}, 0\n M 0, 0\n L 0, ${a/2}\n M ${a/2}, ${a/2}\n L ${-a/2}, ${a/2}\n M ${-a/2}, ${a/2}\n L ${-a/2}, ${-a/2}\n `}s.setAttribute("d",o);const l=`fill: ${t}; stroke: ${i}; stroke-width: ${n};`;return s.setAttribute("style",l),this.createSVGObject(s)}static createLine(e=6,t="#fff000",r=DEFAULT_LINE_WIDTH){const i=document.createElementNS("http://www.w3.org/2000/svg","line");i.setAttribute("x1",""+-e),i.setAttribute("y1","0"),i.setAttribute("x2",`${e}`),i.setAttribute("y2","0");const n=`stroke: ${t}; stroke-width: ${r};`;return i.setAttribute("style",n),this.createSVGObject(i)}static createLabel(e,t="#ffffff",r=DEFAULT_LABEL_FONT_SIZE,i=DEFAULT_LABEL_FONT_SIZE/2){const n=document.createElementNS("http://www.w3.org/2000/svg","text");n.innerHTML=e,n.setAttribute("x","0"),n.setAttribute("y",`${i}`);const s=`font-size: ${r}; text-anchor: middle; fill: ${t};`;return n.setAttribute("style",s),this.createSVGObject(n)}},CommonUtils=class{ /** * Checks full screen mode */ static isFullScreen(){return!!(document.fullscreenElement||document.mozFullScreenElement)} /** * Enters full screen mode */static fullScreen(e=document.documentElement){(e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen||e.msRequestFullscreen).call(e)} /** * Exits full screen mode */static exitFullscreen(){(document.exitFullscreen||document.mozCancelFullscreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)} /** * Displays a pointer marker in a period of time. * @param duration display time in ms. 0/null/undefined means always display. */ // TODO: need to be rewrite using svg static displayPointMarker(e,t,r=1e3,i=10){const n=SVGObjectUtils.createPointMarker(i);return n.position.set(t.x,t.y,t.z),e.add(n),r&&setTimeout((()=>{e.remove(n)}),r),n} /** * Join strings * @param args * @returns */static joinStrings(...e){return e.join("")} /** * Converts a number to a string with proper fraction digits */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(""))} /** * Converts vector to a string with proper fraction digits */static vectorToString(e){return e instanceof Vector3?`(${this.numberToString(e.x)}, ${this.numberToString(e.y)}, ${this.numberToString(e.z)})`:`(${this.numberToString(e.x)}, ${this.numberToString(e.y)})`} /** * Converts number array to THREE.Vector2 */static arrayToVector2(e){return e?e instanceof Vector2?e:Array.isArray(e)&&e.length>=2?new Vector2(e[0],e[1]):void 0:e} /** * Converts number array to THREE.Vector3 * If length of arr is 2, will assign z value to 0 */static arrayToVector3(e){return e?e instanceof Vector3?e:Array.isArray(e)&&e.length>=2?new Vector3(e[0],e[1],e.length>2?e[2]:0):void 0:e} /** * Converts number array to THREE.Euler */static arrayToEuler(e){return e?e instanceof Euler?e:Array.isArray(e)&&e.length>=3?new Euler(e[0],e[1],e[2]):void 0:e} /** * Converts number array to THREE.Vector3 */static arrayOrObjectToVector3(e){if(!e)return e;if(e instanceof Vector3)return e;if(e instanceof Vector2)return new Vector3(e.x,e.y,0);if(Array.isArray(e)&&e.length>=2)return new Vector3(e[0],e[1],e[2]||0);const t=e;return null!=t.x&&null!=t.y?new Vector3(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 Vector3&&(t=!isNaN(e.z)&&isFinite(e.z)),t}static isBoxValid(e){return e&&!e.isEmpty()&&this.isVectorValid(e.min)&&this.isVectorValid(e.max)}static isMatrixValid(e){const t=e&&e.elements;if(!t||t.length<16)return!1;for(let e=0;e<16;++e){const r=t[e];if(Number.isNaN(r))return!1}return!0}static guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))} /** * Expands given box by a scale factor */static expandBoxByScale(e,t){const r=new Vector3;e.getCenter(r);const i=(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 Vector3(r.x-i/2,r.y-n/2,r.z-s/2),o=new Vector3(r.x+i/2,r.y+n/2,r.z+s/2);e.set(a,o)} /** * Expands given box by a min size */static expandBoxByMinSize(e,t){const r=new Vector3;e.getCenter(r);const i=e.max.x-e.min.x,n=e.max.y-e.min.y,s=e.max.z-e.min.z;i{r.onload=function(){e(r)}}))} /** * Prints memory usage */static printMemory(e){const t=performance.memory;if(!t)return void log.warn("[CommonUtils] performance.memory is not available in this browser");const r=(t.jsHeapSizeLimit/1048576).toFixed(2),i=(t.totalJSHeapSize/1048576).toFixed(2),n=(t.usedJSHeapSize/1048576).toFixed(2);log.info(`[CommonUtils] ${e}. jsHeapSizeLimit: ${r}M , totalJSHeapSize: ${i}M , usedJSHeapSize: ${n}M `)}static printGpuInfo(e){const t=e.getExtension("webgl_debug_renderer_info"),r=e.getParameter(t.UNMASKED_RENDERER_WEBGL);log.info("[CommonUtils] gpu:",r)}},setIcon=(e,t,r)=>{const{default:i,active:n}=t;r?(e.remove(i),e.add(n||i)):(n&&e.remove(n),e.add(i))},CoordinateConversionUtils=class{static getScreenPointByEvent(e,t){const r=new Vector2,{left:i,top:n}=t.getBoundingClientRect();return r.x=e.clientX-i,r.y=e.clientY-n,r}static getScreenPointByTouchEvent(e,t){const r=new Vector2,{left:i,top:n}=t.getBoundingClientRect();return r.x=e.touches[0].clientX-i,r.y=e.touches[0].clientY-n,r}static worldPosition2ScreenPoint(e,t,r){const{clientWidth:i,clientHeight:n}=r,s=e.clone(),a=new Vector2;return s.project(t),a.x=Math.round((.5+s.x/2)*i),a.y=Math.round((.5-s.y/2)*n),a}static screenPoint2worldPosition(e,t,r){const i=CoordinateConversionUtils.screenPoint2NdcPoint(e,t,r);return new Vector3(i.x,i.y,1).unproject(t)}static screenPoint2NdcPoint(e,t,r){const{clientWidth:i,clientHeight:n}=r,s=new Vector2;return s.x=e.x/i*2-1,s.y=-e.y/n*2+1,s}},defaultSettings={unit:"file",decimalPrecision:99,camera:{near:.1,far:3e4},mouse:{sensitivity:3},keyboard:{sensitivity:3}},decimalPrecisionRange={"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},showPrecisionValue=(e,t)=>e.toFixed(t===decimalPrecisionRange["Precision from file"]?2:t),DeviceUtils=class{ /** * Checks if it is opened in touch screen device, like iphone, ipad, etc. */ static isTouchScreenDevice(){return!!("ontouchstart"in window)}static printDeviceInfo(){const e=navigator.userAgent,t=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),i=/(?:Chrome|CriOS)/.test(e),n=/(?:iPad|PlayBook)/.test(e)||t&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!n,a=!s&&!t,o=DeviceUtils.isTouchScreenDevice();t&&log.debug("[DI] is android"),r&&log.debug("[DI] is fireFox"),i&&log.debug("[DI] is chrome"),n&&log.debug("[DI] is tablet"),s&&log.debug("[DI] is iPhone"),a&&log.debug("[DI] is PC"),o&&log.debug("[DI] is touch device")}},DRACOExporter=class{parse(e,t={decodeSpeed:5,encodeSpeed:5,encoderMethod:DRACOExporter.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1}){if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");const r=e.geometry,i=DracoEncoderModule(),n=new i.Encoder;let s,a;if(!0===e.isMesh){s=new i.MeshBuilder,a=new i.Mesh;const e=r.getAttribute("position");s.AddFloatAttributeToMesh(a,i.POSITION,e.count,e.itemSize,e.array);const n=r.getIndex();if(null!==n)s.AddFacesToMesh(a,n.count/3,n.array);else{const t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e4?r=e.array[n*e.itemSize+t]:0===t?r=e.getX(n):1===t?r=e.getY(n):2===t?r=e.getZ(n):3===t&&(r=e.getW(n)),i.min[t]=Math.min(i.min[t],r),i.max[t]=Math.max(i.max[t],r)}return i}function getPaddedBufferSize(e){return 4*Math.ceil(e/4)}function getPaddedArrayBuffer(e,t=0){const r=getPaddedBufferSize(e.byteLength);if(r!==e.byteLength){const i=new Uint8Array(r);if(i.set(new Uint8Array(e)),0!==t)for(let n=e.byteLength;ne.toBlob(r,t)));let r;return"image/jpeg"===t?r=.92:"image/webp"===t&&(r=.8),e.convertToBlob({type:t,quality:r})}var GLTFWriter=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} /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */write(e,t,r){return __async(this,null,(function*(){this.options=Object.assign({},{ // default options binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),yield Promise.all(this.pending);const i=this,n=i.buffers,s=i.json;r=i.options;const a=i.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===r.binary){const e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){const r=getPaddedArrayBuffer(e.result),i=new DataView(new ArrayBuffer(GLB_CHUNK_PREFIX_BYTES));i.setUint32(0,r.byteLength,!0),i.setUint32(4,GLB_CHUNK_TYPE_BIN,!0);const n=getPaddedArrayBuffer(stringToArrayBuffer(JSON.stringify(s)),32),a=new DataView(new ArrayBuffer(GLB_CHUNK_PREFIX_BYTES));a.setUint32(0,n.byteLength,!0),a.setUint32(4,GLB_CHUNK_TYPE_JSON,!0);const o=new ArrayBuffer(GLB_HEADER_BYTES),l=new DataView(o);l.setUint32(0,GLB_HEADER_MAGIC,!0),l.setUint32(4,GLB_VERSION,!0);const c=GLB_HEADER_BYTES+a.byteLength+n.byteLength+i.byteLength+r.byteLength;l.setUint32(8,c,!0);const u=new Blob([o,a,n,i,r],{type:"application/octet-stream"}),h=new FileReader;h.readAsArrayBuffer(u),h.onloadend=function(){t(h.result)}}}else if(s.buffers&&s.buffers.length>0){const e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){const r=e.result;s.buffers[0].uri=r,t(s)}}else t(s)}))} /** * Serializes a userData. * * @param {THREE.Object3D|THREE.Material} object * @param {Object} objectDef */serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;const r=this.options,i=this.extensionsUsed;try{const n=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&n.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in n.gltfExtensions)t.extensions[e]=n.gltfExtensions[e],i[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)}} /** * Returns ids for buffer attributes. * @param {Object} object * @return {Integer} */getUID(e,t=!1){if(!1===this.uids.has(e)){const 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)} /** * Checks if normal attribute values are normalized. * * @param {BufferAttribute} normal * @returns {Boolean} */isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new Vector3;for(let r=0,i=e.count;r5e-4)return!1;return!0} /** * Creates normalized normal buffer attribute. * * @param {BufferAttribute} normal * @returns {BufferAttribute} * */createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const r=e.clone(),i=new Vector3;for(let e=0,t=r.count;e4?i=e.array[n*e.itemSize+r]:0===r?i=e.getX(n):1===r?i=e.getY(n):2===r?i=e.getZ(n):3===r&&(i=e.getW(n)),t===WEBGL_CONSTANTS.FLOAT?l.setFloat32(c,i,!0):t===WEBGL_CONSTANTS.UNSIGNED_INT?l.setUint32(c,i,!0):t===WEBGL_CONSTANTS.UNSIGNED_SHORT?l.setUint16(c,i,!0):t===WEBGL_CONSTANTS.UNSIGNED_BYTE&&l.setUint8(c,i),c+=a}const u={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};void 0!==n&&(u.target=n),n===WEBGL_CONSTANTS.ARRAY_BUFFER&&(u.byteStride=e.itemSize*a),this.byteOffset+=o,s.bufferViews.push(u);return{id:s.bufferViews.length-1,byteLength:0}} /** * Process and generate a BufferView from an image Blob. * @param {Blob} blob * @return {Promise} */processBufferViewImage(e){const t=this,r=t.json;return r.bufferViews||(r.bufferViews=[]),new Promise((function(i){const n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){const e=getPaddedArrayBuffer(n.result),s={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,i(r.bufferViews.push(s)-1)}}))} /** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process * @param {THREE.BufferGeometry} geometry (Optional) Geometry used for truncated draw range * @param {Integer} start (Optional) * @param {Integer} count (Optional) * @return {Integer|null} Index of the processed accessor on the "accessors" array */processAccessor(e,t,r,i){const n=this.json;let s;if(e.array.constructor===Float32Array)s=WEBGL_CONSTANTS.FLOAT;else if(e.array.constructor===Uint32Array)s=WEBGL_CONSTANTS.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)s=WEBGL_CONSTANTS.UNSIGNED_SHORT;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");s=WEBGL_CONSTANTS.UNSIGNED_BYTE}if(void 0===r&&(r=0),void 0===i&&(i=e.count),0===i)return null;const a=getMinMax(e,r,i);let o;void 0!==t&&(o=e===t.index?WEBGL_CONSTANTS.ELEMENT_ARRAY_BUFFER:WEBGL_CONSTANTS.ARRAY_BUFFER);const l=this.processBufferView(e,s,r,i,o),c={bufferView:l.id,byteOffset:l.byteOffset,componentType:s,count:i,max:a.max,min:a.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(c.normalized=!0),n.accessors||(n.accessors=[]),n.accessors.push(c)-1} /** * Process image * @param {Image} image to process * @param {Integer} format of the image (RGBAFormat) * @param {Boolean} flipY before writing out the image * @param {String} mimeType export format * @return {Integer} Index of the processed texture in the "images" array */processImage(e,t,r,i="image/png"){const n=this,s=n.cache,a=n.json,o=n.options,l=n.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),u=i+":flipY/"+r.toString();if(void 0!==c[u])return c[u];a.images||(a.images=[]);const h={mimeType:i},p=getCanvas();p.width=Math.min(e.width,o.maxTextureSize),p.height=Math.min(e.height,o.maxTextureSize);const d=p.getContext("2d");if(!0===r&&(d.translate(0,p.height),d.scale(1,-1)),void 0!==e.data){t!==RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const r=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;tn.processBufferViewImage(e))).then((e=>{h.bufferView=e}))):void 0!==p.toDataURL?h.uri=p.toDataURL(i):l.push(getToBlobPromise(p,i).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{h.uri=e})));const m=a.images.push(h)-1;return c[u]=m,m} /** * Process sampler * @param {Texture} map Texture to process * @return {Integer} Index of the processed texture in the "samplers" array */processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const r={magFilter:THREE_TO_WEBGL[e.magFilter],minFilter:THREE_TO_WEBGL[e.minFilter],wrapS:THREE_TO_WEBGL[e.wrapS],wrapT:THREE_TO_WEBGL[e.wrapT]};return t.samplers.push(r)-1} /** * Process texture * @param {Texture} map Map to process * @return {Integer} Index of the processed texture in the "textures" array */processTexture(e){const t=this.cache,r=this.json;if(t.textures.has(e))return t.textures.get(e);r.textures||(r.textures=[]);let i=e.userData.mimeType;"image/webp"===i&&(i="image/png");const n={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};e.name&&(n.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,n)}));const s=r.textures.push(n)-1;return t.textures.set(e,s),s} /** * Process material * @param {THREE.Material} material Material to process * @return {Integer|null} Index of the processed material in the "materials" array */processMaterial(e){const t=this.cache,r=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const n=e.color.toArray().concat([e.opacity]);if(equalArray(n,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),r={index:this.processTexture(t)};this.applyTextureTransform(r,t),i.pbrMetallicRoughness.metallicRoughnessTexture=r}if(e.map){const t={index:this.processTexture(e.map)};this.applyTextureTransform(t,e.map),i.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){const t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),r=Math.max(t.r,t.g,t.b);if(r>1&&(t.multiplyScalar(1/r),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),r>0&&(i.emissiveFactor=t.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if(e.normalMap){const t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if(e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===DoubleSide&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,i)}));const s=r.materials.push(i)-1;return t.materials.set(e,s),s} /** * Process mesh * @param {THREE.Mesh} mesh Mesh to process * @return {Integer|null} Index of the processed mesh in the "meshes" array */processMesh(e){const t=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,r=e.material.length;t0){const r=[],i=[],n={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)n[e.morphTargetDictionary[t]]=t;for(let a=0;a0&&(o.extras={},o.extras.targetNames=i)}const m=Array.isArray(e.material);if(m&&0===s.groups.length)return null;const f=m?e.material:[e.material],g=m?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,r=g.length;e0&&(r.targets=u),null!==s.index){let i=this.getUID(s.index);void 0===g[e].start&&void 0===g[e].count||(i+=":"+g[e].start+":"+g[e].count),t.attributes.has(i)?r.indices=t.attributes.get(i):(r.indices=this.processAccessor(s.index,s,g[e].start,g[e].count),t.attributes.set(i,r.indices)),null===r.indices&&delete r.indices}const i=this.processMaterial(f[g[e].materialIndex]);null!==i&&(r.material=i),c.push(r)}o.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));const _=r.meshes.push(o)-1;return t.meshes.set(n,_),_} /** * Process camera * @param {THREE.Camera} camera Camera to process * @return {Integer} Index of the processed mesh in the "camera" array */processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(i.name=e.type),t.cameras.push(i)-1} /** * Creates glTF animation entry from AnimationClip object. * * Status: * - Only properties listed in PATH_PROPERTIES may be animated. * * @param {THREE.AnimationClip} clip * @param {THREE.Object3D} root * @return {number|null} */processAnimation(e,t){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]);const n=(e=GLTFExporter.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,s=[],a=[];for(let e=0;e0){const t=[];for(let i=0,n=e.children.length;i0&&(n.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,n)}));const s=t.nodes.push(n)-1;return i.set(e,s),s} /** * Process Scene * @param {Scene} node Scene to process */processScene(e){const t=this.json,r=this.options;t.scenes||(t.scenes=[],t.scene=0);const i={};""!==e.name&&(i.name=e.name),t.scenes.push(i);const n=[];for(let t=0,i=e.children.length;t0&&(i.nodes=n),this.serializeUserData(e,i)} /** * Creates a Scene to hold a list of objects and parse it * @param {Array} objects List of objects to process */processObjects(e){const t=new Scene;t.name="AuxScene";for(let r=0;r} input */processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const r=[];for(let t=0;t0&&this.processObjects(r);for(let e=0;e0&&(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]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},n[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},GLTFMaterialsUnlitExtension=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const r=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},r[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},GLTFMaterialsPBRSpecularGlossiness=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;const r=this.writer,i=r.extensionsUsed,n={};t.pbrMetallicRoughness.baseColorFactor&&(n.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);const s=[1,1,1];if(e.specular.toArray(s,0),n.specularFactor=s,n.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(n.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){const t={index:r.processTexture(e.specularMap)};r.applyTextureTransform(t,e.specularMap),n.specularGlossinessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}},GLTFMaterialsClearcoatExtension=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const r=this.writer,i=r.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){const t={index:r.processTexture(e.clearcoatMap)};r.applyTextureTransform(t,e.clearcoatMap),n.clearcoatTexture=t}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const t={index:r.processTexture(e.clearcoatRoughnessMap)};r.applyTextureTransform(t,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){const t={index:r.processTexture(e.clearcoatNormalMap)};r.applyTextureTransform(t,e.clearcoatNormalMap),n.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}},GLTFMaterialsIridescenceExtension=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const r=this.writer,i=r.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){const t={index:r.processTexture(e.iridescenceMap)};r.applyTextureTransform(t,e.iridescenceMap),n.iridescenceTexture=t}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const t={index:r.processTexture(e.iridescenceThicknessMap)};r.applyTextureTransform(t,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}},GLTFMaterialsTransmissionExtension=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const r=this.writer,i=r.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){const t={index:r.processTexture(e.transmissionMap)};r.applyTextureTransform(t,e.transmissionMap),n.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}},GLTFMaterialsVolumeExtension=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const r=this.writer,i=r.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){const t={index:r.processTexture(e.thicknessMap)};r.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,i[this.name]=!0}};GLTFExporter.Utils={insertKeyframe:function(e,t){const r=.001,i=e.getValueSize(),n=new e.TimeBufferType(e.times.length+1),s=new e.ValueBufferType(e.values.length+i),a=e.createInterpolant(new e.ValueBufferType(i));let o;if(0===e.times.length){n[0]=t;for(let e=0;ee.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)t){n.set(e.times.slice(0,l+1),0),n[l+1]=t,n.set(e.times.slice(l+1),l+2),s.set(e.values.slice(0,(l+1)*i),0),s.set(a.evaluate(t),(l+1)*i),s.set(e.values.slice((l+1)*i),(l+2)*i),o=l+1;break}}return e.times=n,e.values=s,o},mergeMorphTargetTracks:function(e,t){const r=[],i={},n=e.tracks;for(let e=0;e{if(r.binary){t=_ExportUtils.addExtention(t,_ExportUtils.EXTENSION_GLB);const r=e;_ExportUtils.saveArrayBuffer(r,t)}else t=_ExportUtils.addExtention(t,_ExportUtils.EXTENSION_GLTF),_ExportUtils.saveJson(e,t)}),(e=>console.log(e)),r)} /** * Exports given object to obj file */static exportToObj(e,t){if(!e||!t)throw new Error("Invalid input or filename!");t=_ExportUtils.addExtention(t,_ExportUtils.EXTENSION_OBJ);const r=(new OBJExporter).parse(e);_ExportUtils.saveString(r,t)} /** * Exports given object to draco(drc) file */static exportToDraco(e,t,r={}){if(!e||!t)throw new Error("Invalid input or filename!");t=_ExportUtils.addExtention(t,_ExportUtils.EXTENSION_DRACO);const i=new DRACOExporter;r=Object.assign({},{encodeSpeed:5},r);const n=i.parse(e,r);_ExportUtils.saveArrayBuffer(n,t)} /** * Exports to threejs json * @param input * @param filename */static exportToThreeJsJson(e,t){const r=e.toJSON();t.toLowerCase().endsWith(_ExportUtils.EXTENSION_JSON)||(t+=_ExportUtils.EXTENSION_JSON),_ExportUtils.saveJson(r,t)} /** * Saves blob as file */static save(e,t){let r=_ExportUtils.downloadLink;r||(r=document.createElement("a"),r.style.display="none",document.body.appendChild(r),_ExportUtils.downloadLink=r),r.href=URL.createObjectURL(e),r.download=t,r.click()}static saveArrayBuffer(e,t){_ExportUtils.save(new Blob([e],{type:"application/octet-stream"}),t)}static saveJson(e,t){_ExportUtils.saveJsonString(JSON.stringify(e),t)}static saveJsonString(e,t){_ExportUtils.save(new Blob([e],{type:"application/json"}),t)}static saveString(e,t){_ExportUtils.save(new Blob([e],{type:"text/csv"}),t)} /** * Adds extention if missing */static addExtention(e,t){return e.toLowerCase().endsWith(t.toLowerCase())||(e+=t),e}},ExportUtils=_ExportUtils; // src/core/utils/ExportUtils.ts ExportUtils.EXTENSION_GLTF=".gltf",ExportUtils.EXTENSION_GLB=".glb",ExportUtils.EXTENSION_OBJ=".obj",ExportUtils.EXTENSION_DRACO=".drc",ExportUtils.EXTENSION_JSON=".json"; // src/core/utils/Event.ts var Event=class{constructor(){this.eventList=new Map} /** * @internal */addEventListener(e,t){const r=this.eventList.get(e);r?r.push(t):this.eventList.set(e,[t])} /** * @internal */dispatchEvent(e,t){const r=this.eventList.get(e);r&&r.forEach((e=>e(t)))}removeEventListener(e,t){const r=this.eventList.get(e);if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}clearEventListeners(e){this.eventList.delete(e)}clearAllEventListener(){this.eventList.clear()}},FpsUtils=class{ // eslint-disable-next-line @typescript-eslint/no-empty-function 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++;const 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()}},import_polygon_clipping=__toESM(require_polygon_clipping_umd(),1),Edge=class{constructor(e,t){this.current=e,this.next=t,this.inNormal=this.inwardsNormal(),this.outNormal=this.outwardsNormal()} /** * Creates outwards normal */outwardsNormal(){const e=this.inwardsNormal();return[-e[0],-e[1]]} /** * Creates inwards normal */inwardsNormal(){const e=this.next[0]-this.current[0],t=this.next[1]-this.current[1],r=Math.sqrt(e*e+t*t);if(0===r)throw new Error("Vertices overlap");return[-t/r,e/r]} /** * Offsets the edge by dx, dy */offset(e,t){return Edge.offsetEdge(this.current,this.next,e,t)}inverseOffset(e,t){return Edge.offsetEdge(this.next,this.current,e,t)}inverse(){return new Edge(this.next,this.current)}static offsetEdge(e,t,r,i){return new Edge([e[0]+r,e[1]+i],[t[0]+r,t[1]+i])}},isArray=Array.isArray,equals2=(e,t)=>e[0]===t[0]&&e[1]===t[1],isNonEmptyArray=e=>Array.isArray(e)&&e.length,orientRings=(e,t=0,r=!1)=>{let i,n;if(isNonEmptyArray(e)&&"number"==typeof e[0][0]){let t=0;const s=e;for(i=0,n=s.length;i0||r&&t<0)&&s.reverse()}else for(i=0,n=e.length;i0);if(0===t&&isNonEmptyArray(e)&&isNonEmptyArray(e[0])&&// @ts-ignore "number"==typeof e[0][0][0]){const t=e[0].slice(0,1)[0];e[0].pop(),e[0].push([t[0],t[1]])}return e},Offset=class{constructor(e,t=5){if(this.distance=0,this.arcSegments=t,!isArray(e))throw new Error("Offset requires at least one coodinate to work with");this.edges=[],isArray(e)&&"number"==typeof e[0]?this.vertices=e:(this.vertices=orientRings(e),this.processContour(this.vertices,this.edges))} /** * Recursively process contour to create normals */processContour(e,t){let r,i;if(isArray(e[0])&&"number"==typeof e[0][0])for(i=e.length,equals2(e[0],e[i-1])&&(i-=1),r=0;r} vertices * @param {Object} center * @param {Number} radius * @param {Object} startVertex * @param {Object} endVertex * @param {Number} segments * @param {Boolean} bOutwards */createArc(e,t,r,i,n,s,a){const o=2*Math.PI;let l=Math.atan2(i[1]-t[1],i[0]-t[0]),c=Math.atan2(n[1]-t[1],n[0]-t[0]);s%2==0&&(s-=1),l<0&&(l+=o),c<0&&(c+=o);let u=l>c?l-c:l+o-c;const h=(a?-u:o-u)/s;e.push(i);for(let i=1;i0?this.margin(this.distance):this.padding(-this.distance)}offsetSegment(e,t,r,i){const n=[r.offset(r.inNormal[0]*i,r.inNormal[1]*i),r.inverseOffset(r.outNormal[0]*i,r.outNormal[1]*i)],s=[];for(let r=0,a=2;r0&&e.push(r)}e.length>0&&(t=1===e.length?e[0]:(0,import_polygon_clipping.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 r=[],i=0,n=0;if(isArray(e[0])&&"number"==typeof e[0][0]){for(i=0,n=e.length-1;i0&&(r=1===r.length?[r[0]]:(0,import_polygon_clipping.union)(r[0],r.slice(1)))}else{const s=[];for(i=0,n=t.length;i0&&s.push(r)}s.length>0&&(r=1===s.length?s[0]:(0,import_polygon_clipping.union)(s[0],...s.slice(1)))}return r}offsetPoint(e){this.setDistance(e);let t=2*this.arcSegments;const r=[],i=this.vertices,n=this.distance;let s=0;t%2==0&&t++;for(let e=0;e{const r=e.attributes[t];if(r instanceof InterleavedBufferAttribute){const i=r.clone();e.attributes[t]=i}}))} /** * Determines if the 2d point is inside the polygon */static isPointInPolygon(e,t,r=!1){const i=e.x,n=e.y;let s=!1;const a=t.length;for(let e=0,o=a-1;en!=u>n;r&&(h=l>=n!=u>=n);h&&i<(c-a)*(n-l)/(u-l)+a&&(s=!s)}return s}static caculateGeometryCenter(e){if(!e.hasAttribute("position"))return null;const t=e.getAttribute("position");if(0===t.count)return null;const r=new Vector3,i=t.itemSize,n=t.array,s=[0,0,0];for(let e=0;e0&&r<0||i<0&&r>0)return!1;r=i}}return!0}static areLineSegmentsIntersecting(e,t){const{start:r,end:i}=e,{start:n,end:s}=t,a=n.clone().sub(r),o=i.clone().sub(r),l=s.clone().sub(r),c=a.cross(o).dot(l.cross(o)),u=r.clone().sub(n),h=s.clone().sub(n),p=i.clone().sub(n),d=u.cross(h).dot(p.cross(h));return c<0&&d<0} /** * Tries to get intersection point of two line segments. * Returns undefined in case two line segments don't intersect with each other. */static getLineSegmentsIntersectingPoint(e,t){const{start:r,end:i}=e,{start:n,end:s}=t,a=tempVec1.subVectors(i,r).normalize(),o=tempVec2.subVectors(s,n).normalize();if(1===a.dot(o))return null;const l=tempVec3.subVectors(n,r),c=a.clone().cross(o),u=l.clone().cross(o),h=l.clone().dot(c);if(h>=1e-5||h<=-1e-5)return null;const p=c.lengthSq();if(MathUtils2.areNumbersEqual(0,p))return;const d=u.clone().dot(c)/p,m=r.clone().add(a.multiplyScalar(d));return m.equals(r)||m.equals(i)?null:m}static isPointOnLineSegment(e,t,r=.001){const{start:i,end:n}=t,s=tempVec1.subVectors(i,n).length(),a=tempVec2.subVectors(e,i).length(),o=tempVec3.subVectors(e,n).length();return Math.abs(s-(a+o))<=r}static isPointOnLineSegments(e,t,r=.001){let i=!1;for(let n=0;n{r?t.add(e):(t.x+=e.x,t.y+=e.y)})),t.divideScalar(e.length);let i=!1;if(GeometryUtils.shouldRebasePositionOnRTC(t)){i=!0;for(let i=0;iMAX_RTC_THRESHOLD||Math.abs(e.y)>MAX_RTC_THRESHOLD||e instanceof Vector3&&Math.abs(e.z)>MAX_RTC_THRESHOLD} /** * Calculates surface area */static calculateSurfaceArea(e){let t=0;const r=e.getAttribute("position"),i=e.index;if(i)for(let e=0;e2&&(s=t?2*n:2*n-2);const a=new i(s);let o=0;for(let e=0;e0&&e{const r=e.geometry.attributes.position.array;return e.localToWorld(new Vector3(r[3*t],r[3*t+1],r[3*t+2]))};e.updateWorldMatrix(!0,!1);const a=(null==(r=e.geometry.getIndex())?void 0:r.array)||[],o=null!=(i=a[t])?i: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)return!1;if(tempBox1.setFromPoints(e),tempBox2.setFromPoints(t),!tempBox1.intersectsBox(tempBox2))return!1;for(let r=0;r1-n)return;const o=t.y-e.y,l=e.x-t.x,c=o*e.x+l*e.y,u=i.y-r.y,h=r.x-i.x,p=u*r.x+h*r.y,d=o*h-u*l;if(Math.abs(d){r.push([e.x,e.y])}));try{i=new Offset(r).setArcSegments(2).offsetLine(t/2)}catch(e){return}if(!i||0===i.length)return;i=i[0];const n=[],s=[];for(let e=0;e{n.push(new Vector2(e[0],e[1]))})),ShapeUtils.isClockWise(n)||n.reverse();else{const t=[];i[e].forEach((e=>{t.push(new Vector2(e[0],e[1]))})),ShapeUtils.isClockWise(t)&&t.reverse(),s.push(t)}const a=ShapeUtils.triangulateShape(n,s),o=[];for(let e=0;en.push(...e)));const l=(new BufferGeometry).setFromPoints(n);return l.setIndex(o),l}static releaseGeometryManually(e){e.index=null,e.attributes={}}static getAdjacentNonRepeatPoints(e,t=1e-7){const r=[],i=e.length;for(let n=0;n(e.ObjectsBoxSection="ObjectsBoxSection",e.PickPlaneSection="PickPlaneSection",e.AxisPlaneSection="AxisPlaneSection",e))(SectionType||{}),SectionMode=(e=>(e.ObjectsBoxSection="ObjectsBoxSection",e.PickPlaneSection="PickPlaneSection",e.AxisPlaneSection="AxisPlaneSection",e))(SectionMode||{}),GroundUtils=class{ /** * Creates ground grid */ static createGroundGrid(e,t,r){e=e||this.DEFAULT_WIDTH,t=t||this.DEFAULT_WIDTH_SEGS;const i=new GridHelper(e,t);r?i.position.set(r.x,r.y,r.z):i.position.y=0;const n=i.material;return Array.isArray(n)||(n.opacity=this.DEFAULT_MAT_PARAMS.opacity,n.transparent=this.DEFAULT_MAT_PARAMS.transparent),i.name=this.GROUND_GRID_NAME,i.layers.set(layerForUnselectableObjects),i.matrixAutoUpdate=!1,i.updateMatrix(),i}static createGrassGround(e,t,r,i,n){return __async(this,null,(function*(){return t=t||this.DEFAULT_WIDTH,r=r||this.DEFAULT_HEIGHT,new Promise((s=>{(new TextureLoader).load(e||"images/terrain/grass.jpg",(e=>{e.wrapS=e.wrapT=RepeatWrapping,e.repeat.set(i||this.DEFAULT_WIDTH_SEGS/5,n||this.DEFAULT_HEIGHT_SETS/5),e.anisotropy=16,e.encoding=sRGBEncoding;const a=new MeshLambertMaterial({map:e});a.side=FrontSide;const o=new Mesh(new PlaneGeometry(t,r),a);return o.rotation.x=-Math.PI/2,o.position.y=0,o.receiveShadow=!0,o.name=this.GRASS_GROUND_NAME,o.layers.set(layerForUnselectableObjects),o.matrixAutoUpdate=!1,o.updateMatrix(),s(o)}))}))}))}}; // src/core/utils/FpsUtils.ts GroundUtils.GROUND_GRID_NAME="GROUND_GRID",GroundUtils.GRASS_GROUND_NAME="GRASS_GROUND",GroundUtils.DEFAULT_WIDTH=1e3,GroundUtils.DEFAULT_HEIGHT=1e3,GroundUtils.DEFAULT_WIDTH_SEGS=100, // number of segments GroundUtils.DEFAULT_HEIGHT_SETS=100,GroundUtils.DEFAULT_MAT_PARAMS={color:12829635,transparent:!0,opacity:.5,wireframeLinewidth:.5}; // src/core/utils/MaterialUtils.ts var MaterialUtils=class{ /** * Compares two materials */ static materialEquals(e,t){if(e===t)return!0;if(e.type!==t.type)return!1;if(e instanceof Material&&t instanceof Material){const r=e,i=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(r.color,i.color)&&this.colorEquals(r.emissive,i.emissive)&&r.roughness===i.roughness&&r.metalness===i.metalness&&r.alphaMap===i.alphaMap&&r.uniforms===i.uniforms&&r.defines===i.defines&&r.vertexShader===i.vertexShader&&r.fragmentShader===i.fragmentShader&&r.clippingPlanes===i.clippingPlanes&&r.map===i.map&&r.clipIntersection===i.clipIntersection}return!1} /** * Compares two materials, which could be material or material array */static materialsEquals(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){for(let r=0;r0){const e=[];return r.forEach((r=>{e.push(this.clonedHighlightMaterial(r,t))})),e}if(r instanceof Material)return this.clonedHighlightMaterial(r,t);console.warn(`[MaterialUtils] Invalid material: ${r}`)}static clonedHighlightMaterial(e,t={}){var r;const{depthTest:i,highlightColor:n=new Color(583902),opacity:s=.7}=t,a=e.clone();return a instanceof MeshStandardMaterial||a instanceof MeshPhongMaterial?(a.emissive.set(n),a.color.set(n)):a instanceof MeshBasicMaterial||a instanceof MeshLambertMaterial||a instanceof LineBasicMaterial||a instanceof LineDashedMaterial?a.color.set(n):a instanceof ShaderMaterial?null==(r=a.uniforms.u_color)||r.value.set(n):a instanceof SpriteMaterial?a.color.set(n):console.warn("[MaterialUtils] Unsupported Material:",a.type),a.opacity=s,a.transparent=!0,void 0!==i&&(a.depthTest=!1,a.side=DoubleSide),a} /** * Clone given material(s) */static cloneMaterial(e){if(!e)return e;if(Array.isArray(e)){const t=[];return e.forEach((e=>{t.push(e.clone())})),t}return e.clone()}static getMaterialColor(e){let t=new Color(16777215);return e instanceof PointsMaterial||e instanceof LineBasicMaterial||e instanceof MeshBasicMaterial?t=e.color:e instanceof ShaderMaterial&&e.uniforms.u_color&&(t=e.uniforms.u_color.value),t}static setMaterialColor(e,t){e instanceof PointsMaterial||e instanceof LineBasicMaterial||e instanceof MeshBasicMaterial?e.color=t:e instanceof ShaderMaterial&&e.uniforms.u_color&&(e.uniforms.u_color.value=t)} /** * Clone object's materials */static cloneMaterials(e){const t=new Map;e.traverse((e=>{e.material&&(e.material=(e=>{let r;return Array.isArray(e)?(r=[],e.forEach((e=>{if(t.has(e))r.push(t.get(e));else{const i=e.clone();t.set(e,i),r.push(i)}}))):e&&(t.has(e)?r=t.get(e):(r=e.clone(),t.set(e,r))),r})(e.material))}))}}; // node_modules/three/examples/jsm/utils/BufferGeometryUtils.js function mergeBufferGeometries(e,t=!1){const r=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),n=new Set(Object.keys(e[0].morphAttributes)),s={},a={},o=e[0].morphTargetsRelative,l=new BufferGeometry;let c=0;for(let u=0;u>8&255]+et[r>>16&255]+et[r>>24&255]+"-"+et[e&255]+et[e>>8&255]+"-"+et[e>>16&15|64]+et[e>>24&255]+"-"+et[t&63|128]+et[t>>8&255]+"-"+et[t>>16&255]+et[t>>24&255]+et[n&255]+et[n>>8&255]+et[n>>16&255]+et[n>>24&255]).toLowerCase()}function lt(r,e,t){return Math.max(e,Math.min(t,r))}function br(r,e){return(r%e+e)%e}function sl(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function rl(r,e,t){return r!==e?(t-r)/(e-r):0}function mi(r,e,t){return(1-t)*r+t*e}function al(r,e,t,n){return mi(r,e,1-Math.exp(-t*n))}function ol(r,e=1){return e-Math.abs(br(r,e*2)-e)}function ll(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function cl(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function hl(r,e){return r+Math.floor(Math.random()*(e-r+1))}function ul(r,e){return r+Math.random()*(e-r)}function dl(r){return r*(.5-Math.random())}function fl(r){r!==void 0&&(ca=r);let e=ca+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function pl(r){return r*pi}function ml(r){return r*Gi}function Js(r){return(r&r-1)===0&&r!==0}function gl(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Xi(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function xl(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),c=o(t/2),l=s((e+n)/2),h=o((e+n)/2),f=s((e-n)/2),d=o((e-n)/2),m=s((n-e)/2),g=o((n-e)/2);switch(i){case"XYX":r.set(a*h,c*f,c*d,a*l);break;case"YZY":r.set(c*d,a*h,c*f,a*l);break;case"ZXZ":r.set(c*f,c*d,a*h,a*l);break;case"XZX":r.set(a*h,c*g,c*m,a*l);break;case"YXY":r.set(c*m,a*h,c*g,a*l);break;case"ZYZ":r.set(c*g,c*m,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function di(r,e){switch(e.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 at(r,e){switch(e.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 Ya=Object.freeze({__proto__:null,DEG2RAD:pi,RAD2DEG:Gi,generateUUID:si,clamp:lt,euclideanModulo:br,mapLinear:sl,inverseLerp:rl,lerp:mi,damp:al,pingpong:ol,smoothstep:ll,smootherstep:cl,randInt:hl,randFloat:ul,randFloatSpread:dl,seededRandom:fl,degToRad:pl,radToDeg:ml,isPowerOfTwo:Js,ceilPowerOfTwo:gl,floorPowerOfTwo:Xi,setQuaternionFromProperEuler:xl,normalize:at,denormalize:di}),De=class{constructor(e=0,t=0){De.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,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},ct=class{constructor(){ct.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,n,i,s,o,a,c,l){let h=this.elements;return h[0]=e,h[1]=i,h[2]=a,h[3]=t,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(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){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 n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],h=n[4],f=n[7],d=n[2],m=n[5],g=n[8],p=i[0],u=i[3],x=i[6],T=i[1],w=i[4],y=i[7],S=i[2],C=i[5],F=i[8];return s[0]=o*p+a*T+c*S,s[3]=o*u+a*w+c*C,s[6]=o*x+a*y+c*F,s[1]=l*p+h*T+f*S,s[4]=l*u+h*w+f*C,s[7]=l*x+h*y+f*F,s[2]=d*p+m*T+g*S,s[5]=d*u+m*w+g*C,s[8]=d*x+m*y+g*F,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],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8];return t*o*h-t*a*l-n*s*h+n*a*c+i*s*l-i*o*c}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8],f=h*o-a*l,d=a*c-h*s,m=l*s-o*c,g=t*f+n*d+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/g;return e[0]=f*p,e[1]=(i*l-h*n)*p,e[2]=(a*n-i*o)*p,e[3]=d*p,e[4]=(h*t-i*c)*p,e[5]=(i*s-a*t)*p,e[6]=m*p,e[7]=(n*c-l*t)*p,e[8]=(o*t-n*s)*p,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,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+e,-i*l,i*c,-i*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],c=i[1],l=i[4],h=i[7];return i[0]=t*s+n*c,i[3]=t*o+n*l,i[6]=t*a+n*h,i[1]=-n*s+t*c,i[4]=-n*o+t*l,i[7]=-n*a+t*h,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};function Za(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function qi(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function yn(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Vi(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var vs={[Vt]:{[_n]:yn},[_n]:{[Vt]:Vi}},bt={legacyMode:!0,get workingColorSpace(){return _n},set workingColorSpace(r){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(r,e,t){if(this.legacyMode||e===t||!e||!t)return r;if(vs[e]&&vs[e][t]!==void 0){let n=vs[e][t];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,e){return this.convert(r,this.workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this.workingColorSpace)}},Ja={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},We={r:0,g:0,b:0},wt={h:0,s:0,l:0},Mi={h:0,s:0,l:0};function ys(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bi(r,e){return e.r=r.r,e.g=r.g,e.b=r.b,e}var ze=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Vt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,bt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=_n){return this.r=e,this.g=t,this.b=n,bt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=_n){if(e=br(e,1),t=lt(t,0,1),n=lt(n,0,1),t===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=ys(o,s,e+1/3),this.g=ys(o,s,e),this.b=ys(o,s,e-1/3)}return bt.toWorkingColorSpace(this,i),this}setStyle(e,t=Vt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(e)){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,bt.toWorkingColorSpace(this,t),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,bt.toWorkingColorSpace(this,t),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,t)}break}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(e)){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,bt.toWorkingColorSpace(this,t),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,bt.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=Vt){let n=Ja[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=yn(e.r),this.g=yn(e.g),this.b=yn(e.b),this}copyLinearToSRGB(e){return this.r=Vi(e.r),this.g=Vi(e.g),this.b=Vi(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Vt){return bt.fromWorkingColorSpace(bi(this,We),e),lt(We.r*255,0,255)<<16^lt(We.g*255,0,255)<<8^lt(We.b*255,0,255)<<0}getHexString(e=Vt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=_n){bt.fromWorkingColorSpace(bi(this,We),t);let n=We.r,i=We.g,s=We.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+(i2048||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(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let t=qi("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o1)switch(this.wrapS){case qs:e.x=e.x-Math.floor(e.x);break;case At:e.x=e.x<0?0:1;break;case Ys:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case qs:e.y=e.y-Math.floor(e.y);break;case At:e.y=e.y<0?0:1;break;case Ys:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}};gt.DEFAULT_IMAGE=null;gt.DEFAULT_MAPPING=Xa;var Ge=class{constructor(e=0,t=0,n=0,i=1){Ge.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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=e.w!==void 0?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,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,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,n,i,s,c=e.elements,l=c[0],h=c[4],f=c[8],d=c[1],m=c[5],g=c[9],p=c[2],u=c[6],x=c[10];if(Math.abs(h-d)<.01&&Math.abs(f-p)<.01&&Math.abs(g-u)<.01){if(Math.abs(h+d)<.1&&Math.abs(f+p)<.1&&Math.abs(g+u)<.1&&Math.abs(l+m+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let w=(l+1)/2,y=(m+1)/2,S=(x+1)/2,C=(h+d)/4,F=(f+p)/4,v=(g+u)/4;return w>y&&w>S?w<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(w),i=C/n,s=F/n):y>S?y<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(y),n=C/i,s=v/i):S<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(S),n=F/s,i=v/s),this.set(n,i,s,t),this}let T=Math.sqrt((u-g)*(u-g)+(f-p)*(f-p)+(d-h)*(d-h));return Math.abs(T)<.001&&(T=1),this.x=(u-g)/T,this.y=(f-p)/T,this.z=(d-h)/T,this.w=Math.acos((l+m+x-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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Xt=class extends an{constructor(e=1,t=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ge(0,0,e,t),this.scissorTest=!1,this.viewport=new Ge(0,0,e,t);let i={width:e,height:t,depth:1};this.texture=new gt(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:yt,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(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new Zi(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ji=class extends gt{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=ot,this.minFilter=ot,this.wrapR=At,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var $s=class extends gt{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=ot,this.minFilter=ot,this.wrapR=At,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var on=class{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,a){let c=n[i+0],l=n[i+1],h=n[i+2],f=n[i+3],d=s[o+0],m=s[o+1],g=s[o+2],p=s[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=h,e[t+3]=f;return}if(a===1){e[t+0]=d,e[t+1]=m,e[t+2]=g,e[t+3]=p;return}if(f!==p||c!==d||l!==m||h!==g){let u=1-a,x=c*d+l*m+h*g+f*p,T=x>=0?1:-1,w=1-x*x;if(w>Number.EPSILON){let S=Math.sqrt(w),C=Math.atan2(S,x*T);u=Math.sin(u*C)/S,a=Math.sin(a*C)/S}let y=a*T;if(c=c*u+d*y,l=l*u+m*y,h=h*u+g*y,f=f*u+p*y,u===1-a){let S=1/Math.sqrt(c*c+l*l+h*h+f*f);c*=S,l*=S,h*=S,f*=S}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],c=n[i+1],l=n[i+2],h=n[i+3],f=s[o],d=s[o+1],m=s[o+2],g=s[o+3];return e[t]=a*g+h*f+c*m-l*d,e[t+1]=c*g+h*d+l*f-a*m,e[t+2]=l*g+h*m+a*d-c*f,e[t+3]=h*g-a*f-c*d-l*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,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 n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(n/2),h=a(i/2),f=a(s/2),d=c(n/2),m=c(i/2),g=c(s/2);switch(o){case"XYZ":this._x=d*h*f+l*m*g,this._y=l*m*f-d*h*g,this._z=l*h*g+d*m*f,this._w=l*h*f-d*m*g;break;case"YXZ":this._x=d*h*f+l*m*g,this._y=l*m*f-d*h*g,this._z=l*h*g-d*m*f,this._w=l*h*f+d*m*g;break;case"ZXY":this._x=d*h*f-l*m*g,this._y=l*m*f+d*h*g,this._z=l*h*g+d*m*f,this._w=l*h*f-d*m*g;break;case"ZYX":this._x=d*h*f-l*m*g,this._y=l*m*f+d*h*g,this._z=l*h*g-d*m*f,this._w=l*h*f+d*m*g;break;case"YZX":this._x=d*h*f+l*m*g,this._y=l*m*f+d*h*g,this._z=l*h*g-d*m*f,this._w=l*h*f-d*m*g;break;case"XZY":this._x=d*h*f-l*m*g,this._y=l*m*f-d*h*g,this._z=l*h*g+d*m*f,this._w=l*h*f+d*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],c=t[9],l=t[2],h=t[6],f=t[10],d=n+a+f;if(d>0){let m=.5/Math.sqrt(d+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(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(lt(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,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(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 e===0?(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 n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,c=t._y,l=t._z,h=t._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(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*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=o,this._x=n,this._y=i,this._z=s,this;let c=1-a*a;if(c<=Number.EPSILON){let m=1-t;return this._w=m*o+t*this._w,this._x=m*n+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(c),h=Math.atan2(l,a),f=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=o*f+this._w*d,this._x=n*f+this._x*d,this._y=i*f+this._y*d,this._z=s*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}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}},L=class{constructor(e=0,t=0,n=0){L.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ha.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ha.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,c=e.w,l=c*t+o*i-a*n,h=c*n+a*t-s*i,f=c*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=l*c+d*-s+h*-a-f*-o,this.y=h*c+d*-o+f*-s-l*-a,this.z=f*c+d*-a+l*-o-h*-s,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,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,c=t.z;return this.x=i*c-s*a,this.y=s*o-n*c,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return bs.copy(this).projectOnVector(e),this.sub(bs)}reflect(e){return this.sub(bs.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(lt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},bs=new L,ha=new on,wn=class{constructor(e=new L(1/0,1/0,1/0),t=new L(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,l=e.length;cs&&(s=h),f>o&&(o=f),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let c=0,l=e.count;cs&&(s=h),f>o&&(o=f),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,un),un.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(oi),wi.subVectors(this.max,oi),In.subVectors(e.a,oi),Dn.subVectors(e.b,oi),Nn.subVectors(e.c,oi),Jt.subVectors(Dn,In),$t.subVectors(Nn,Dn),dn.subVectors(In,Nn);let t=[0,-Jt.z,Jt.y,0,-$t.z,$t.y,0,-dn.z,dn.y,Jt.z,0,-Jt.x,$t.z,0,-$t.x,dn.z,0,-dn.x,-Jt.y,Jt.x,0,-$t.y,$t.x,0,-dn.y,dn.x,0];return!Ss(t,In,Dn,Nn,wi)||(t=[1,0,0,0,1,0,0,0,1],!Ss(t,In,Dn,Nn,wi))?!1:(Si.crossVectors(Jt,$t),t=[Si.x,Si.y,Si.z],Ss(t,In,Dn,Nn,wi))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return un.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(un).length()*.5,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()?this:(zt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),zt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),zt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),zt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),zt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),zt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),zt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),zt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(zt),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)}},zt=[new L,new L,new L,new L,new L,new L,new L,new L],un=new L,ws=new wn,In=new L,Dn=new L,Nn=new L,Jt=new L,$t=new L,dn=new L,oi=new L,wi=new L,Si=new L,fn=new L;function Ss(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){fn.fromArray(r,s);let a=i.x*Math.abs(fn.x)+i.y*Math.abs(fn.y)+i.z*Math.abs(fn.z),c=e.dot(fn),l=t.dot(fn),h=n.dot(fn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!0}var vl=new wn,li=new L,Ts=new L,_i=class{constructor(e=new L,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):vl.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.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;li.subVectors(e,this.center);let t=li.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(li,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Ts.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(li.copy(e.center).add(Ts)),this.expandByPoint(li.copy(e.center).sub(Ts))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Ot=new L,As=new L,Ti=new L,Kt=new L,Es=new L,Ai=new L,Cs=new L,Ks=class{constructor(e=new L,t=new L(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,Ot)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ot.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ot.copy(this.direction).multiplyScalar(t).add(this.origin),Ot.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){As.copy(e).add(t).multiplyScalar(.5),Ti.copy(t).sub(e).normalize(),Kt.copy(this.origin).sub(As);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Ti),a=Kt.dot(this.direction),c=-Kt.dot(Ti),l=Kt.lengthSq(),h=Math.abs(1-o*o),f,d,m,g;if(h>0)if(f=o*c-a,d=o*a-c,g=s*h,f>=0)if(d>=-g)if(d<=g){let p=1/h;f*=p,d*=p,m=f*(f+o*d+2*a)+d*(o*f+d+2*c)+l}else d=s,f=Math.max(0,-(o*d+a)),m=-f*f+d*(d+2*c)+l;else d=-s,f=Math.max(0,-(o*d+a)),m=-f*f+d*(d+2*c)+l;else d<=-g?(f=Math.max(0,-(-o*s+a)),d=f>0?-s:Math.min(Math.max(-s,-c),s),m=-f*f+d*(d+2*c)+l):d<=g?(f=0,d=Math.min(Math.max(-s,-c),s),m=d*(d+2*c)+l):(f=Math.max(0,-(o*s+a)),d=f>0?s:Math.min(Math.max(-s,-c),s),m=-f*f+d*(d+2*c)+l);else d=o>0?-s:s,f=Math.max(0,-(o*d+a)),m=-f*f+d*(d+2*c)+l;return n&&n.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(Ti).multiplyScalar(d).add(As),m}intersectSphere(e,t){Ot.subVectors(e.center,this.origin);let n=Ot.dot(this.direction),i=Ot.dot(Ot)-n*n,s=e.radius*e.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,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(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,c,l=1/this.direction.x,h=1/this.direction.y,f=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),h>=0?(s=(e.min.y-d.y)*h,o=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,o=(e.min.y-d.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o=0?(a=(e.min.z-d.z)*f,c=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,c=(e.min.z-d.z)*f),n>c||a>i)||((a>n||n!==n)&&(n=a),(c=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Ot)!==null}intersectTriangle(e,t,n,i,s){Es.subVectors(t,e),Ai.subVectors(n,e),Cs.crossVectors(Es,Ai);let o=this.direction.dot(Cs),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Kt.subVectors(this.origin,e);let c=a*this.direction.dot(Ai.crossVectors(Kt,Ai));if(c<0)return null;let l=a*this.direction.dot(Es.cross(Kt));if(l<0||c+l>o)return null;let h=-a*Kt.dot(Cs);return h<0?null:this.at(h/o,s)}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)}},Xe=class{constructor(){Xe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,n,i,s,o,a,c,l,h,f,d,m,g,p,u){let x=this.elements;return x[0]=e,x[4]=t,x[8]=n,x[12]=i,x[1]=s,x[5]=o,x[9]=a,x[13]=c,x[2]=l,x[6]=h,x[10]=f,x[14]=d,x[3]=m,x[7]=g,x[11]=p,x[15]=u,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 Xe().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/Fn.setFromMatrixColumn(e,0).length(),s=1/Fn.setFromMatrixColumn(e,1).length(),o=1/Fn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,s=e.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(e.order==="XYZ"){let d=o*h,m=o*f,g=a*h,p=a*f;t[0]=c*h,t[4]=-c*f,t[8]=l,t[1]=m+g*l,t[5]=d-p*l,t[9]=-a*c,t[2]=p-d*l,t[6]=g+m*l,t[10]=o*c}else if(e.order==="YXZ"){let d=c*h,m=c*f,g=l*h,p=l*f;t[0]=d+p*a,t[4]=g*a-m,t[8]=o*l,t[1]=o*f,t[5]=o*h,t[9]=-a,t[2]=m*a-g,t[6]=p+d*a,t[10]=o*c}else if(e.order==="ZXY"){let d=c*h,m=c*f,g=l*h,p=l*f;t[0]=d-p*a,t[4]=-o*f,t[8]=g+m*a,t[1]=m+g*a,t[5]=o*h,t[9]=p-d*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){let d=o*h,m=o*f,g=a*h,p=a*f;t[0]=c*h,t[4]=g*l-m,t[8]=d*l+p,t[1]=c*f,t[5]=p*l+d,t[9]=m*l-g,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){let d=o*c,m=o*l,g=a*c,p=a*l;t[0]=c*h,t[4]=p-d*f,t[8]=g*f+m,t[1]=f,t[5]=o*h,t[9]=-a*h,t[2]=-l*h,t[6]=m*f+g,t[10]=d-p*f}else if(e.order==="XZY"){let d=o*c,m=o*l,g=a*c,p=a*l;t[0]=c*h,t[4]=-f,t[8]=l*h,t[1]=d*f+p,t[5]=o*h,t[9]=m*f-g,t[2]=g*f-m,t[6]=a*h,t[10]=p*f+d}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(yl,e,Ml)}lookAt(e,t,n){let i=this.elements;return dt.subVectors(e,t),dt.lengthSq()===0&&(dt.z=1),dt.normalize(),Qt.crossVectors(n,dt),Qt.lengthSq()===0&&(Math.abs(n.z)===1?dt.x+=1e-4:dt.z+=1e-4,dt.normalize(),Qt.crossVectors(n,dt)),Qt.normalize(),Ei.crossVectors(dt,Qt),i[0]=Qt.x,i[4]=Ei.x,i[8]=dt.x,i[1]=Qt.y,i[5]=Ei.y,i[9]=dt.y,i[2]=Qt.z,i[6]=Ei.z,i[10]=dt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],h=n[1],f=n[5],d=n[9],m=n[13],g=n[2],p=n[6],u=n[10],x=n[14],T=n[3],w=n[7],y=n[11],S=n[15],C=i[0],F=i[4],v=i[8],A=i[12],D=i[1],Z=i[5],ee=i[9],k=i[13],N=i[2],W=i[6],q=i[10],K=i[14],G=i[3],R=i[7],z=i[11],te=i[15];return s[0]=o*C+a*D+c*N+l*G,s[4]=o*F+a*Z+c*W+l*R,s[8]=o*v+a*ee+c*q+l*z,s[12]=o*A+a*k+c*K+l*te,s[1]=h*C+f*D+d*N+m*G,s[5]=h*F+f*Z+d*W+m*R,s[9]=h*v+f*ee+d*q+m*z,s[13]=h*A+f*k+d*K+m*te,s[2]=g*C+p*D+u*N+x*G,s[6]=g*F+p*Z+u*W+x*R,s[10]=g*v+p*ee+u*q+x*z,s[14]=g*A+p*k+u*K+x*te,s[3]=T*C+w*D+y*N+S*G,s[7]=T*F+w*Z+y*W+S*R,s[11]=T*v+w*ee+y*q+S*z,s[15]=T*A+w*k+y*K+S*te,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],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],c=e[9],l=e[13],h=e[2],f=e[6],d=e[10],m=e[14],g=e[3],p=e[7],u=e[11],x=e[15];return g*(+s*c*f-i*l*f-s*a*d+n*l*d+i*a*m-n*c*m)+p*(+t*c*m-t*l*d+s*o*d-i*o*m+i*l*h-s*c*h)+u*(+t*l*f-t*a*m-s*o*f+n*o*m+s*a*h-n*l*h)+x*(-i*a*h-t*c*f+t*a*d+i*o*f-n*o*d+n*c*h)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],m=e[11],g=e[12],p=e[13],u=e[14],x=e[15],T=f*u*l-p*d*l+p*c*m-a*u*m-f*c*x+a*d*x,w=g*d*l-h*u*l-g*c*m+o*u*m+h*c*x-o*d*x,y=h*p*l-g*f*l+g*a*m-o*p*m-h*a*x+o*f*x,S=g*f*c-h*p*c-g*a*d+o*p*d+h*a*u-o*f*u,C=t*T+n*w+i*y+s*S;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let F=1/C;return e[0]=T*F,e[1]=(p*d*s-f*u*s-p*i*m+n*u*m+f*i*x-n*d*x)*F,e[2]=(a*u*s-p*c*s+p*i*l-n*u*l-a*i*x+n*c*x)*F,e[3]=(f*c*s-a*d*s-f*i*l+n*d*l+a*i*m-n*c*m)*F,e[4]=w*F,e[5]=(h*u*s-g*d*s+g*i*m-t*u*m-h*i*x+t*d*x)*F,e[6]=(g*c*s-o*u*s-g*i*l+t*u*l+o*i*x-t*c*x)*F,e[7]=(o*d*s-h*c*s+h*i*l-t*d*l-o*i*m+t*c*m)*F,e[8]=y*F,e[9]=(g*f*s-h*p*s-g*n*m+t*p*m+h*n*x-t*f*x)*F,e[10]=(o*p*s-g*a*s+g*n*l-t*p*l-o*n*x+t*a*x)*F,e[11]=(h*a*s-o*f*s-h*n*l+t*f*l+o*n*m-t*a*m)*F,e[12]=S*F,e[13]=(h*p*i-g*f*i+g*n*d-t*p*d-h*n*u+t*f*u)*F,e[14]=(g*a*i-o*p*i-g*n*c+t*p*c+o*n*u-t*a*u)*F,e[15]=(o*f*i-h*a*i+h*n*c-t*f*c-o*n*d+t*a*d)*F,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,c=e.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(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,c=t._w,l=s+s,h=o+o,f=a+a,d=s*l,m=s*h,g=s*f,p=o*h,u=o*f,x=a*f,T=c*l,w=c*h,y=c*f,S=n.x,C=n.y,F=n.z;return i[0]=(1-(p+x))*S,i[1]=(m+y)*S,i[2]=(g-w)*S,i[3]=0,i[4]=(m-y)*C,i[5]=(1-(d+x))*C,i[6]=(u+T)*C,i[7]=0,i[8]=(g+w)*F,i[9]=(u-T)*F,i[10]=(1-(d+p))*F,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=Fn.set(i[0],i[1],i[2]).length(),o=Fn.set(i[4],i[5],i[6]).length(),a=Fn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],St.copy(this);let l=1/s,h=1/o,f=1/a;return St.elements[0]*=l,St.elements[1]*=l,St.elements[2]*=l,St.elements[4]*=h,St.elements[5]*=h,St.elements[6]*=h,St.elements[8]*=f,St.elements[9]*=f,St.elements[10]*=f,t.setFromRotationMatrix(St),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){let a=this.elements,c=2*s/(t-e),l=2*s/(n-i),h=(t+e)/(t-e),f=(n+i)/(n-i),d=-(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]=d,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,c=1/(t-e),l=1/(n-i),h=1/(o-s),f=(t+e)*c,d=(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]=-d,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(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Fn=new L,St=new Xe,yl=new L(0,0,0),Ml=new L(1,1,1),Qt=new L,Ei=new L,dt=new L,ua=new Xe,da=new on,Sn=class{constructor(e=0,t=0,n=0,i=Sn.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],c=i[1],l=i[5],h=i[9],f=i[2],d=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(lt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-lt(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(lt(d,-1,1)),Math.abs(d)<.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(-lt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,m),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(lt(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(-lt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,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: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ua.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ua,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return da.setFromEuler(this),this.setFromQuaternion(da,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],e[3]!==void 0&&(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}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}};Sn.DefaultOrder="XYZ";Sn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var $i=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(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),d.length>0&&(n.skeletons=d),m.length>0&&(n.animations=m),g.length>0&&(n.nodes=g)}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(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)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Tt.subVectors(i,t),Bt.subVectors(n,t),Ps.subVectors(e,t);let o=Tt.dot(Tt),a=Tt.dot(Bt),c=Tt.dot(Ps),l=Bt.dot(Bt),h=Bt.dot(Ps),f=o*l-a*a;if(f===0)return s.set(-2,-1,-1);let d=1/f,m=(l*c-a*h)*d,g=(o*h-a*c)*d;return s.set(1-m-g,g,m)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,kt),kt.x>=0&&kt.y>=0&&kt.x+kt.y<=1}static getUV(e,t,n,i,s,o,a,c){return this.getBarycoord(e,t,n,i,kt),c.set(0,0),c.addScaledVector(s,kt.x),c.addScaledVector(o,kt.y),c.addScaledVector(a,kt.z),c}static isFrontFacing(e,t,n,i){return Tt.subVectors(n,t),Bt.subVectors(e,t),Tt.cross(Bt).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 Tt.subVectors(this.c,this.b),Bt.subVectors(this.a,this.b),Tt.cross(Bt).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return mt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return mt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return mt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return mt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return mt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;On.subVectors(i,n),Un.subVectors(s,n),Ls.subVectors(e,n);let c=On.dot(Ls),l=Un.dot(Ls);if(c<=0&&l<=0)return t.copy(n);Rs.subVectors(e,i);let h=On.dot(Rs),f=Un.dot(Rs);if(h>=0&&f<=h)return t.copy(i);let d=c*f-h*l;if(d<=0&&c>=0&&h<=0)return o=c/(c-h),t.copy(n).addScaledVector(On,o);Is.subVectors(e,s);let m=On.dot(Is),g=Un.dot(Is);if(g>=0&&m<=g)return t.copy(s);let p=m*l-c*g;if(p<=0&&l>=0&&g<=0)return a=l/(l-g),t.copy(n).addScaledVector(Un,a);let u=h*g-m*f;if(u<=0&&f-h>=0&&m-g>=0)return _a.subVectors(s,i),a=(f-h)/(f-h+(m-g)),t.copy(i).addScaledVector(_a,a);let x=1/(u+p+d);return o=p*x,a=d*x,t.copy(n).addScaledVector(On,o).addScaledVector(Un,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Al=0,ti=class extends an{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Al++}),this.uuid=si(),this.name="",this.type="Material",this.blending=Zn,this.side=Kn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Ha,this.blendDst=Wa,this.blendEquation=Xn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ws,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=il,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=_s,this.stencilZFail=_s,this.stencilZPass=_s,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: \'"+t+"\' parameter is undefined.");continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": \'"+t+"\' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==Zn&&(n.blending=this.blending),this.side!==Kn&&(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.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),JSON.stringify(this.userData)!=="{}"&&(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(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},Ki=class extends ti{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ze(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=Ga,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}},He=new L,Pi=new De,st=class{constructor(e,t,n){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=e!==void 0?e.length/t:0,this.normalized=n===!0,this.usage=oa,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let c in n){let l=n[c];e.data.attributes[c]=l.toJSON(e.data)}let i={},s=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let f=0,d=l.length;f0&&(i[c]=h,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(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 n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let l in i){let h=i[l];this.setAttribute(l,h.clone(t))}let s=e.morphAttributes;for(let l in s){let h=[],f=s[l];for(let d=0,m=f.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;st.far?null:{distance:l,point:zi.clone(),object:r}}function Oi(r,e,t,n,i,s,o,a,c,l,h,f){jt.fromBufferAttribute(i,l),en.fromBufferAttribute(i,h),tn.fromBufferAttribute(i,f);let d=r.morphTargetInfluences;if(s&&d){Li.set(0,0,0),Ri.set(0,0,0),Ii.set(0,0,0);for(let g=0,p=s.length;g0?1:-1,h.push(R.x,R.y,R.z),f.push(Y/F),f.push(1-z/v),K+=1}}for(let z=0;z0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},es=class extends ht{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xe,this.projectionMatrix=new Xe,this.projectionMatrixInverse=new Xe}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)}},pt=class extends es{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Gi*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(pi*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Gi*2*Math.atan(Math.tan(pi*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,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=e,this.view.fullHeight=t,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 e=this.near,t=e*Math.tan(pi*.5*this.fov)/this.zoom,n=2*t,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,t-=o.offsetY*n/l,i*=o.width/c,n*=o.height/l}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Vn=90,Hn=1,Qs=class extends ht{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n;let i=new pt(Vn,Hn,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new L(1,0,0)),this.add(i);let s=new pt(Vn,Hn,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new L(-1,0,0)),this.add(s);let o=new pt(Vn,Hn,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new L(0,1,0)),this.add(o);let a=new pt(Vn,Hn,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new L(0,-1,0)),this.add(a);let c=new pt(Vn,Hn,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new L(0,0,1)),this.add(c);let l=new pt(Vn,Hn,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new L(0,0,-1)),this.add(l)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,c,l]=this.children,h=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=Wt,e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(h),e.toneMapping=f,e.xr.enabled=d,n.texture.needsPMREMUpdate=!0}},ts=class extends gt{constructor(e,t,n,i,s,o,a,c,l,h){e=e!==void 0?e:[],t=t!==void 0?t:Qn,super(e,t,n,i,s,o,a,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},js=class extends Xt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new ts(i,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=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:yt}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 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 \n\t\t\t\t\t#include \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 \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 Tn(5,5,5),s=new Yt({name:"CubemapFromEquirect",uniforms:ni(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Mt,blending:rn});s.uniforms.tEquirect.value=t;let o=new It(i,s),a=t.minFilter;return t.minFilter===rs&&(t.minFilter=yt),new Qs(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}},Bs=new L,Dl=new L,Nl=new ct,Ht=class{constructor(e=new L(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=Bs.subVectors(n,t).cross(Dl.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 n=e.delta(Bs),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||Nl.getNormalMatrix(e),i=this.coplanarPoint(Bs).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),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)}},Wn=new _i,Ui=new L,ns=class{constructor(e=new Ht,t=new Ht,n=new Ht,i=new Ht,s=new Ht,o=new Ht){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.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],d=n[8],m=n[9],g=n[10],p=n[11],u=n[12],x=n[13],T=n[14],w=n[15];return t[0].setComponents(a-i,f-c,p-d,w-u).normalize(),t[1].setComponents(a+i,f+c,p+d,w+u).normalize(),t[2].setComponents(a+s,f+l,p+m,w+x).normalize(),t[3].setComponents(a-s,f-l,p-m,w-x).normalize(),t[4].setComponents(a-o,f-h,p-g,w-T).normalize(),t[5].setComponents(a+o,f+h,p+g,w+T).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Wn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Wn)}intersectsSprite(e){return Wn.center.set(0,0,0),Wn.radius=.7071067811865476,Wn.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wn)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Ui.y=i.normal.y>0?e.max.y:e.min.y,Ui.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ui)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function $a(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function Fl(r,e){let t=e.isWebGL2,n=new WeakMap;function i(l,h){let f=l.array,d=l.usage,m=r.createBuffer();r.bindBuffer(h,m),r.bufferData(h,f,d),l.onUploadCallback();let g;if(f instanceof Float32Array)g=5126;else if(f instanceof Uint16Array)if(l.isFloat16BufferAttribute)if(t)g=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=5123;else if(f instanceof Int16Array)g=5122;else if(f instanceof Uint32Array)g=5125;else if(f instanceof Int32Array)g=5124;else if(f instanceof Int8Array)g=5120;else if(f instanceof Uint8Array)g=5121;else if(f instanceof Uint8ClampedArray)g=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:m,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version}}function s(l,h,f){let d=h.array,m=h.updateRange;r.bindBuffer(f,l),m.count===-1?r.bufferSubData(f,0,d):(t?r.bufferSubData(f,m.offset*d.BYTES_PER_ELEMENT,d,m.offset,m.count):r.bufferSubData(f,m.offset*d.BYTES_PER_ELEMENT,d.subarray(m.offset,m.offset+m.count)),m.count=-1)}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 d=n.get(l);(!d||d.version 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`,Xl=`#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`,ql=`#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`,Yl=`#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`,Zl=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,Jl=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`,$l=`#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`,Kl=`#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif`,Ql=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif`,jl=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif`,ec=`#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`,tc=`#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}`,nc=`#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`,ic=`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`,sc=`#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`,rc=`#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,ac=`#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,oc=`#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`,lc="gl_FragColor = linearToOutputTexel( gl_FragColor );",cc=`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}`,hc=`#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`,uc=`#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`,dc=`#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`,fc=`#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`,pc=`#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`,mc=`#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`,gc=`#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`,xc=`#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`,_c=`#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`,vc=`#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}`,yc=`#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif`,Mc=`#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`,bc=`LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`,wc=`varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)`,Sc=`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`,Tc=`#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`,Ac=`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`,Ec=`varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)`,Cc=`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,Pc=`varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)`,Lc=`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`,Rc=`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}`,Ic=`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,Dc=`#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`,Nc=`#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`,Fc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,zc=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,Oc=`#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`,Uc=`#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`,Bc=`#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`,kc=`#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`,Vc=`#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`,Hc=`#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`,Wc=`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`,Gc=`#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`,Xc=`#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`,qc=`#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`,Yc=`#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`,Zc=`#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`,Jc=`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;`,$c=`#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`,Kc=`#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`,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`,jc=`#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`,eh=`#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`,th=`#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif`,nh=`#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`,ih=`#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`,sh=`#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`,rh=`#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 );`,ah=`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}`,oh=`#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`,lh=`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,ch=`#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,hh=`#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`,uh=`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`,dh=`#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`,fh=`#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif`,ph=`#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`,mh=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif`,gh=`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}`,xh=`#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`,_h=`#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`,vh=`#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`,yh=`#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`,Mh=`float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`,bh=`#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`,wh=`#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,Sh=`#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; }`,Th=`#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`,Ah=`#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`,Eh=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif`,Ch=`#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`,Ph=`#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,Lh=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif`,Rh=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif`,Ih=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,Dh=`#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`,Nh=`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}`,Fh=`uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include \n\t#include \n}`,zh=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`,Oh=`#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}`,Uh=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`,Bh=`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 \n\t#include \n}`,kh=`#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}`,Vh=`#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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}`,Hh=`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}`,Wh=`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}`,Gh=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}`,Xh=`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}`,qh=`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,Yh=`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,Zh=`#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,Jh=`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,$h=`#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,Kh=`#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,Qh=`#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}`,jh=`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,eu=`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}`,tu=`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}`,nu=`#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,iu=`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,su=`#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}`,ru=`#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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,au=`#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}`,ou=`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,lu=`uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}`,cu=`uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,hu=`#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,uu=`uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}`,du=`uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}`,fu=`uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,be={alphamap_fragment:zl,alphamap_pars_fragment:Ol,alphatest_fragment:Ul,alphatest_pars_fragment:Bl,aomap_fragment:kl,aomap_pars_fragment:Vl,begin_vertex:Hl,beginnormal_vertex:Wl,bsdfs:Gl,iridescence_fragment:Xl,bumpmap_pars_fragment:ql,clipping_planes_fragment:Yl,clipping_planes_pars_fragment:Zl,clipping_planes_pars_vertex:Jl,clipping_planes_vertex:$l,color_fragment:Kl,color_pars_fragment:Ql,color_pars_vertex:jl,color_vertex:ec,common:tc,cube_uv_reflection_fragment:nc,defaultnormal_vertex:ic,displacementmap_pars_vertex:sc,displacementmap_vertex:rc,emissivemap_fragment:ac,emissivemap_pars_fragment:oc,encodings_fragment:lc,encodings_pars_fragment:cc,envmap_fragment:hc,envmap_common_pars_fragment:uc,envmap_pars_fragment:dc,envmap_pars_vertex:fc,envmap_physical_pars_fragment:Tc,envmap_vertex:pc,fog_vertex:mc,fog_pars_vertex:gc,fog_fragment:xc,fog_pars_fragment:_c,gradientmap_pars_fragment:vc,lightmap_fragment:yc,lightmap_pars_fragment:Mc,lights_lambert_fragment:bc,lights_lambert_pars_fragment:wc,lights_pars_begin:Sc,lights_toon_fragment:Ac,lights_toon_pars_fragment:Ec,lights_phong_fragment:Cc,lights_phong_pars_fragment:Pc,lights_physical_fragment:Lc,lights_physical_pars_fragment:Rc,lights_fragment_begin:Ic,lights_fragment_maps:Dc,lights_fragment_end:Nc,logdepthbuf_fragment:Fc,logdepthbuf_pars_fragment:zc,logdepthbuf_pars_vertex:Oc,logdepthbuf_vertex:Uc,map_fragment:Bc,map_pars_fragment:kc,map_particle_fragment:Vc,map_particle_pars_fragment:Hc,metalnessmap_fragment:Wc,metalnessmap_pars_fragment:Gc,morphcolor_vertex:Xc,morphnormal_vertex:qc,morphtarget_pars_vertex:Yc,morphtarget_vertex:Zc,normal_fragment_begin:Jc,normal_fragment_maps:$c,normal_pars_fragment:Kc,normal_pars_vertex:Qc,normal_vertex:jc,normalmap_pars_fragment:eh,clearcoat_normal_fragment_begin:th,clearcoat_normal_fragment_maps:nh,clearcoat_pars_fragment:ih,iridescence_pars_fragment:sh,output_fragment:rh,packing:ah,premultiplied_alpha_fragment:oh,project_vertex:lh,dithering_fragment:ch,dithering_pars_fragment:hh,roughnessmap_fragment:uh,roughnessmap_pars_fragment:dh,shadowmap_pars_fragment:fh,shadowmap_pars_vertex:ph,shadowmap_vertex:mh,shadowmask_pars_fragment:gh,skinbase_vertex:xh,skinning_pars_vertex:_h,skinning_vertex:vh,skinnormal_vertex:yh,specularmap_fragment:Mh,specularmap_pars_fragment:bh,tonemapping_fragment:wh,tonemapping_pars_fragment:Sh,transmission_fragment:Th,transmission_pars_fragment:Ah,uv_pars_fragment:Eh,uv_pars_vertex:Ch,uv_vertex:Ph,uv2_pars_fragment:Lh,uv2_pars_vertex:Rh,uv2_vertex:Ih,worldpos_vertex:Dh,background_vert:Nh,background_frag:Fh,backgroundCube_vert:zh,backgroundCube_frag:Oh,cube_vert:Uh,cube_frag:Bh,depth_vert:kh,depth_frag:Vh,distanceRGBA_vert:Hh,distanceRGBA_frag:Wh,equirect_vert:Gh,equirect_frag:Xh,linedashed_vert:qh,linedashed_frag:Yh,meshbasic_vert:Zh,meshbasic_frag:Jh,meshlambert_vert:$h,meshlambert_frag:Kh,meshmatcap_vert:Qh,meshmatcap_frag:jh,meshnormal_vert:eu,meshnormal_frag:tu,meshphong_vert:nu,meshphong_frag:iu,meshphysical_vert:su,meshphysical_frag:ru,meshtoon_vert:au,meshtoon_frag:ou,points_vert:lu,points_frag:cu,shadow_vert:hu,shadow_frag:uu,sprite_vert:du,sprite_frag:fu},j={common:{diffuse:{value:new ze(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new ct},uv2Transform:{value:new ct},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 De(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 ze(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 ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ct}},sprite:{diffuse:{value:new ze(16777215)},opacity:{value:1},center:{value:new De(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ct}}},Rt={basic:{uniforms:it([j.common,j.specularmap,j.envmap,j.aomap,j.lightmap,j.fog]),vertexShader:be.meshbasic_vert,fragmentShader:be.meshbasic_frag},lambert:{uniforms:it([j.common,j.specularmap,j.envmap,j.aomap,j.lightmap,j.emissivemap,j.bumpmap,j.normalmap,j.displacementmap,j.fog,j.lights,{emissive:{value:new ze(0)}}]),vertexShader:be.meshlambert_vert,fragmentShader:be.meshlambert_frag},phong:{uniforms:it([j.common,j.specularmap,j.envmap,j.aomap,j.lightmap,j.emissivemap,j.bumpmap,j.normalmap,j.displacementmap,j.fog,j.lights,{emissive:{value:new ze(0)},specular:{value:new ze(1118481)},shininess:{value:30}}]),vertexShader:be.meshphong_vert,fragmentShader:be.meshphong_frag},standard:{uniforms:it([j.common,j.envmap,j.aomap,j.lightmap,j.emissivemap,j.bumpmap,j.normalmap,j.displacementmap,j.roughnessmap,j.metalnessmap,j.fog,j.lights,{emissive:{value:new ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag},toon:{uniforms:it([j.common,j.aomap,j.lightmap,j.emissivemap,j.bumpmap,j.normalmap,j.displacementmap,j.gradientmap,j.fog,j.lights,{emissive:{value:new ze(0)}}]),vertexShader:be.meshtoon_vert,fragmentShader:be.meshtoon_frag},matcap:{uniforms:it([j.common,j.bumpmap,j.normalmap,j.displacementmap,j.fog,{matcap:{value:null}}]),vertexShader:be.meshmatcap_vert,fragmentShader:be.meshmatcap_frag},points:{uniforms:it([j.points,j.fog]),vertexShader:be.points_vert,fragmentShader:be.points_frag},dashed:{uniforms:it([j.common,j.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:be.linedashed_vert,fragmentShader:be.linedashed_frag},depth:{uniforms:it([j.common,j.displacementmap]),vertexShader:be.depth_vert,fragmentShader:be.depth_frag},normal:{uniforms:it([j.common,j.bumpmap,j.normalmap,j.displacementmap,{opacity:{value:1}}]),vertexShader:be.meshnormal_vert,fragmentShader:be.meshnormal_frag},sprite:{uniforms:it([j.sprite,j.fog]),vertexShader:be.sprite_vert,fragmentShader:be.sprite_frag},background:{uniforms:{uvTransform:{value:new ct},t2D:{value:null}},vertexShader:be.background_vert,fragmentShader:be.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0}},vertexShader:be.backgroundCube_vert,fragmentShader:be.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:be.cube_vert,fragmentShader:be.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:be.equirect_vert,fragmentShader:be.equirect_frag},distanceRGBA:{uniforms:it([j.common,j.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:be.distanceRGBA_vert,fragmentShader:be.distanceRGBA_frag},shadow:{uniforms:it([j.lights,j.fog,{color:{value:new ze(0)},opacity:{value:1}}]),vertexShader:be.shadow_vert,fragmentShader:be.shadow_frag}};Rt.physical={uniforms:it([Rt.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new De(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 ze(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new De},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new ze(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new ze(1,1,1)},specularColorMap:{value:null}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag};function pu(r,e,t,n,i,s,o){let a=new ze(0),c=s===!0?0:1,l,h,f=null,d=0,m=null;function g(u,x){let T=!1,w=x.isScene===!0?x.background:null;w&&w.isTexture&&(w=(x.backgroundBlurriness>0?t:e).get(w));let y=r.xr,S=y.getSession&&y.getSession();S&&S.environmentBlendMode==="additive"&&(w=null),w===null?p(a,c):w&&w.isColor&&(p(w,1),T=!0),(r.autoClear||T)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),w&&(w.isCubeTexture||w.mapping===ss)?(h===void 0&&(h=new It(new Tn(1,1,1),new Yt({name:"BackgroundCubeMaterial",uniforms:ni(Rt.backgroundCube.uniforms),vertexShader:Rt.backgroundCube.vertexShader,fragmentShader:Rt.backgroundCube.fragmentShader,side:Mt,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,F,v){this.matrixWorld.copyPosition(v.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),h.material.uniforms.envMap.value=w,h.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,(f!==w||d!==w.version||m!==r.toneMapping)&&(h.material.needsUpdate=!0,f=w,d=w.version,m=r.toneMapping),h.layers.enableAll(),u.unshift(h,h.geometry,h.material,0,0,null)):w&&w.isTexture&&(l===void 0&&(l=new It(new vi(2,2),new Yt({name:"BackgroundMaterial",uniforms:ni(Rt.background.uniforms),vertexShader:Rt.background.vertexShader,fragmentShader:Rt.background.fragmentShader,side:Kn,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=w,w.matrixAutoUpdate===!0&&w.updateMatrix(),l.material.uniforms.uvTransform.value.copy(w.matrix),(f!==w||d!==w.version||m!==r.toneMapping)&&(l.material.needsUpdate=!0,f=w,d=w.version,m=r.toneMapping),l.layers.enableAll(),u.unshift(l,l.geometry,l.material,0,0,null))}function p(u,x){n.buffers.color.setClear(u.r,u.g,u.b,x,o)}return{getClearColor:function(){return a},setClearColor:function(u,x=1){a.set(u),c=x,p(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(u){c=u,p(a,c)},render:g}}function mu(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},c=u(null),l=c,h=!1;function f(N,W,q,K,G){let R=!1;if(o){let z=p(K,q,W);l!==z&&(l=z,m(l.object)),R=x(N,K,q,G),R&&T(N,K,q,G)}else{let z=W.wireframe===!0;(l.geometry!==K.id||l.program!==q.id||l.wireframe!==z)&&(l.geometry=K.id,l.program=q.id,l.wireframe=z,R=!0)}G!==null&&t.update(G,34963),(R||h)&&(h=!1,v(N,W,q,K),G!==null&&r.bindBuffer(34963,t.get(G).buffer))}function d(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function m(N){return n.isWebGL2?r.bindVertexArray(N):s.bindVertexArrayOES(N)}function g(N){return n.isWebGL2?r.deleteVertexArray(N):s.deleteVertexArrayOES(N)}function p(N,W,q){let K=q.wireframe===!0,G=a[N.id];G===void 0&&(G={},a[N.id]=G);let R=G[W.id];R===void 0&&(R={},G[W.id]=R);let z=R[K];return z===void 0&&(z=u(d()),R[K]=z),z}function u(N){let W=[],q=[],K=[];for(let G=0;G=0){let oe=G[Y],ve=R[Y];if(ve===void 0&&(Y==="instanceMatrix"&&N.instanceMatrix&&(ve=N.instanceMatrix),Y==="instanceColor"&&N.instanceColor&&(ve=N.instanceColor)),oe===void 0||oe.attribute!==ve||ve&&oe.data!==ve.data)return!0;z++}return l.attributesNum!==z||l.index!==K}function T(N,W,q,K){let G={},R=W.attributes,z=0,te=q.getAttributes();for(let Y in te)if(te[Y].location>=0){let oe=R[Y];oe===void 0&&(Y==="instanceMatrix"&&N.instanceMatrix&&(oe=N.instanceMatrix),Y==="instanceColor"&&N.instanceColor&&(oe=N.instanceColor));let ve={};ve.attribute=oe,oe&&oe.data&&(ve.data=oe.data),G[Y]=ve,z++}l.attributes=G,l.attributesNum=z,l.index=K}function w(){let N=l.newAttributes;for(let W=0,q=N.length;W=0){let ne=G[te];if(ne===void 0&&(te==="instanceMatrix"&&N.instanceMatrix&&(ne=N.instanceMatrix),te==="instanceColor"&&N.instanceColor&&(ne=N.instanceColor)),ne!==void 0){let oe=ne.normalized,ve=ne.itemSize,X=t.get(ne);if(X===void 0)continue;let Ie=X.buffer,ge=X.type,ye=X.bytesPerElement;if(ne.isInterleavedBufferAttribute){let ae=ne.data,Fe=ae.stride,Se=ne.offset;if(ae.isInstancedInterleavedBuffer){for(let pe=0;pe0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";F="mediump"}return F==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",c=s(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);let l=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,f=r.getParameter(34930),d=r.getParameter(35660),m=r.getParameter(3379),g=r.getParameter(34076),p=r.getParameter(34921),u=r.getParameter(36347),x=r.getParameter(36348),T=r.getParameter(36349),w=d>0,y=o||e.has("OES_texture_float"),S=w&&y,C=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:f,maxVertexTextures:d,maxTextureSize:m,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:u,maxVaryings:x,maxFragmentUniforms:T,vertexTextures:w,floatFragmentTextures:y,floatVertexTextures:S,maxSamples:C}}function _u(r){let e=this,t=null,n=0,i=!1,s=!1,o=new Ht,a=new ct,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,m){let g=f.length!==0||d||n!==0||i;return i=d,t=h(f,m,0),n=f.length,g},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1,l()},this.setState=function(f,d,m){let g=f.clippingPlanes,p=f.clipIntersection,u=f.clipShadows,x=r.get(f);if(!i||g===null||g.length===0||s&&!u)s?h(null):l();else{let T=s?0:n,w=T*4,y=x.clippingState||null;c.value=y,y=h(g,d,w,m);for(let S=0;S!==w;++S)y[S]=t[S];x.clippingState=y,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=T}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(f,d,m,g){let p=f!==null?f.length:0,u=null;if(p!==0){if(u=c.value,g!==!0||u===null){let x=m+p*4,T=d.matrixWorldInverse;a.getNormalMatrix(T),(u===null||u.length0){let l=new js(c.height/2);return l.fromEquirectangularTexture(r,o),e.set(o,l),o.addEventListener("dispose",i),t(l.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var er=class extends es{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,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=e,this.view.fullHeight=t,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 e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,c=i-t;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(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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},qn=4,ya=[.125,.215,.35,.446,.526,.582],mn=20,ks=new er,Ma=new ze,Vs=null,pn=(1+Math.sqrt(5))/2,Gn=1/pn,ba=[new L(1,1,1),new L(-1,1,1),new L(1,1,-1),new L(-1,1,-1),new L(0,pn,Gn),new L(0,pn,-Gn),new L(Gn,0,pn),new L(-Gn,0,pn),new L(pn,Gn,0),new L(-pn,Gn,0)],is=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,n=.1,i=100){Vs=this._renderer.getRenderTarget(),this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Ta(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Sa(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),h.setRenderTarget(i),p&&h.render(g,a),h.render(e,a)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=d,h.autoClear=f,e.background=u}_textureToCubeUV(e,t){let n=this._renderer,i=e.mapping===Qn||e.mapping===jn;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=Ta()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Sa());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new It(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;let c=this._cubeSize;Bi(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(o,ks)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;imn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${u} samples when the maximum is set to ${mn}`);let x=[],T=0;for(let F=0;Fw-qn?i-w+qn:0),C=4*(this._cubeSize-y);Bi(t,S,C,3*y,2*y),c.setRenderTarget(t),c.render(f,ks)}};function yu(r){let e=[],t=[],n=[],i=r,s=r-qn+1+ya.length;for(let o=0;or-qn?c=ya[o-r+qn-1]:o===0&&(c=0),n.push(c);let l=1/(a-2),h=-l,f=1+l,d=[h,h,f,h,f,f,h,h,f,f,h,f],m=6,g=6,p=3,u=2,x=1,T=new Float32Array(p*g*m),w=new Float32Array(u*g*m),y=new Float32Array(x*g*m);for(let C=0;C2?0:-1,A=[F,v,0,F+2/3,v,0,F+2/3,v+1,0,F,v,0,F+2/3,v+1,0,F,v+1,0];T.set(A,p*g*C),w.set(d,u*g*C);let D=[C,C,C,C,C,C];y.set(D,x*g*C)}let S=new qt;S.setAttribute("position",new st(T,p)),S.setAttribute("uv",new st(w,u)),S.setAttribute("faceIndex",new st(y,x)),e.push(S),i>qn&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function wa(r,e,t){let n=new Xt(r,e,t);return n.texture.mapping=ss,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Bi(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function Mu(r,e,t){let n=new Float32Array(mn),i=new L(0,1,0);return new Yt({name:"SphericalGaussianBlur",defines:{n:mn,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,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:wr(),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 \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:rn,depthTest:!1,depthWrite:!1})}function Sa(){return new Yt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:wr(),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 \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:rn,depthTest:!1,depthWrite:!1})}function Ta(){return new Yt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:wr(),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:rn,depthTest:!1,depthWrite:!1})}function wr(){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 bu(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){let c=a.mapping,l=c===Gs||c===Xs,h=c===Qn||c===jn;if(l||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=e.get(a);return t===null&&(t=new is(r)),f=l?t.fromEquirectangular(a,f):t.fromCubemap(a,f),e.set(a,f),f.texture}else{if(e.has(a))return e.get(a).texture;{let f=a.image;if(l&&f&&f.height>0||h&&f&&i(f)){t===null&&(t=new is(r));let d=l?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",s),d.texture}else return null}}}return a}function i(a){let c=0,l=6;for(let h=0;he.maxTextureSize&&(Z=Math.ceil(D/e.maxTextureSize),D=e.maxTextureSize);let ee=new Float32Array(D*Z*4*p),k=new Ji(ee,D,Z,p);k.type=xn,k.needsUpdate=!0;let N=A*4;for(let q=0;q0)return r;let i=e*t,s=Aa[i];if(s===void 0&&(s=new Float32Array(i),Aa[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function qe(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t":" "} ${a}: ${t[o]}`)}return n.join(`\n`)}function yd(r){switch(r){case bn:return["Linear","( value )"];case ke:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",r),["Linear","( value )"]}}function Da(r,e,t){let n=r.getShaderParameter(e,35713),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\\d+)/.exec(i);if(s){let o=parseInt(s[1]);return t.toUpperCase()+`\n\n`+i+`\n\n`+vd(r.getShaderSource(e),o)}else return i}function Md(r,e){let t=yd(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function bd(r,e){let t;switch(e){case Io:t="Linear";break;case Do:t="Reinhard";break;case No:t="OptimizedCineon";break;case Fo:t="ACESFilmic";break;case zo:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function wd(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 Sd(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`\n`)}function Td(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function sr(r){return r.replace(Ad,Ed)}function Ed(r,e){let t=be[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return sr(t)}var Cd=/#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 za(r){return r.replace(Cd,Pd)}function Pd(r,e,t,n){let i="";for(let s=parseInt(e);s0&&(u+=`\n`),x=[m,g].filter(fi).join(`\n`),x.length>0&&(x+=`\n`)):(u=[Oa(t),"#define SHADER_NAME "+t.shaderName,g,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.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`),x=[m,Oa(t),"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Wt?"#define TONE_MAPPING":"",t.toneMapping!==Wt?be.tonemapping_pars_fragment:"",t.toneMapping!==Wt?bd("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",be.encodings_pars_fragment,Md("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`\n`].filter(fi).join(`\n`)),o=sr(o),o=Na(o,t),o=Fa(o,t),a=sr(a),a=Na(a,t),a=Fa(a,t),o=za(o),a=za(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(T=`#version 300 es\n`,u=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`\n`)+`\n`+u,x=["#define varying in",t.glslVersion===la?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.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`+x);let w=T+u+o,y=T+x+a,S=Ia(i,35633,w),C=Ia(i,35632,y);if(i.attachShader(p,S),i.attachShader(p,C),t.index0AttributeName!==void 0?i.bindAttribLocation(p,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(p,0,"position"),i.linkProgram(p),r.debug.checkShaderErrors){let A=i.getProgramInfoLog(p).trim(),D=i.getShaderInfoLog(S).trim(),Z=i.getShaderInfoLog(C).trim(),ee=!0,k=!0;if(i.getProgramParameter(p,35714)===!1){ee=!1;let N=Da(i,S,"vertex"),W=Da(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(p,35715)+`\n\nProgram Info Log: `+A+`\n`+N+`\n`+W)}else A!==""?console.warn("THREE.WebGLProgram: Program Info Log:",A):(D===""||Z==="")&&(k=!1);k&&(this.diagnostics={runnable:ee,programLog:A,vertexShader:{log:D,prefix:u},fragmentShader:{log:Z,prefix:x}})}i.deleteShader(S),i.deleteShader(C);let F;this.getUniforms=function(){return F===void 0&&(F=new $n(i,p)),F};let v;return this.getAttributes=function(){return v===void 0&&(v=Td(i,p)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.name=t.shaderName,this.id=_d++,this.cacheKey=e,this.usedTimes=1,this.program=p,this.vertexShader=S,this.fragmentShader=C,this}var zd=0,rr=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new ar(e),t.set(e,n)),n}},ar=class{constructor(e){this.id=zd++,this.code=e,this.usedTimes=0}};function Od(r,e,t,n,i,s,o){let a=new $i,c=new rr,l=[],h=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures,m=i.precision,g={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(v,A,D,Z,ee){let k=Z.fog,N=ee.geometry,W=v.isMeshStandardMaterial?Z.environment:null,q=(v.isMeshStandardMaterial?t:e).get(v.envMap||W),K=q&&q.mapping===ss?q.image.height:null,G=g[v.type];v.precision!==null&&(m=i.getMaxPrecision(v.precision),m!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",m,"instead."));let R=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,z=R!==void 0?R.length:0,te=0;N.morphAttributes.position!==void 0&&(te=1),N.morphAttributes.normal!==void 0&&(te=2),N.morphAttributes.color!==void 0&&(te=3);let Y,ne,oe,ve;if(G){let Fe=Rt[G];Y=Fe.vertexShader,ne=Fe.fragmentShader}else Y=v.vertexShader,ne=v.fragmentShader,c.update(v),oe=c.getVertexShaderID(v),ve=c.getFragmentShaderID(v);let X=r.getRenderTarget(),Ie=v.alphaTest>0,ge=v.clearcoat>0,ye=v.iridescence>0;return{isWebGL2:h,shaderID:G,shaderName:v.type,vertexShader:Y,fragmentShader:ne,defines:v.defines,customVertexShaderID:oe,customFragmentShaderID:ve,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:m,instancing:ee.isInstancedMesh===!0,instancingColor:ee.isInstancedMesh===!0&&ee.instanceColor!==null,supportsVertexTextures:d,outputEncoding:X===null?r.outputEncoding:X.isXRRenderTarget===!0?X.texture.encoding:bn,map:!!v.map,matcap:!!v.matcap,envMap:!!q,envMapMode:q&&q.mapping,envMapCubeUVHeight:K,lightMap:!!v.lightMap,aoMap:!!v.aoMap,emissiveMap:!!v.emissiveMap,bumpMap:!!v.bumpMap,normalMap:!!v.normalMap,objectSpaceNormalMap:v.normalMapType===nl,tangentSpaceNormalMap:v.normalMapType===tl,decodeVideoTexture:!!v.map&&v.map.isVideoTexture===!0&&v.map.encoding===ke,clearcoat:ge,clearcoatMap:ge&&!!v.clearcoatMap,clearcoatRoughnessMap:ge&&!!v.clearcoatRoughnessMap,clearcoatNormalMap:ge&&!!v.clearcoatNormalMap,iridescence:ye,iridescenceMap:ye&&!!v.iridescenceMap,iridescenceThicknessMap:ye&&!!v.iridescenceThicknessMap,displacementMap:!!v.displacementMap,roughnessMap:!!v.roughnessMap,metalnessMap:!!v.metalnessMap,specularMap:!!v.specularMap,specularIntensityMap:!!v.specularIntensityMap,specularColorMap:!!v.specularColorMap,opaque:v.transparent===!1&&v.blending===Zn,alphaMap:!!v.alphaMap,alphaTest:Ie,gradientMap:!!v.gradientMap,sheen:v.sheen>0,sheenColorMap:!!v.sheenColorMap,sheenRoughnessMap:!!v.sheenRoughnessMap,transmission:v.transmission>0,transmissionMap:!!v.transmissionMap,thicknessMap:!!v.thicknessMap,combine:v.combine,vertexTangents:!!v.normalMap&&!!N.attributes.tangent,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!N.attributes.color&&N.attributes.color.itemSize===4,vertexUvs:!!v.map||!!v.bumpMap||!!v.normalMap||!!v.specularMap||!!v.alphaMap||!!v.emissiveMap||!!v.roughnessMap||!!v.metalnessMap||!!v.clearcoatMap||!!v.clearcoatRoughnessMap||!!v.clearcoatNormalMap||!!v.iridescenceMap||!!v.iridescenceThicknessMap||!!v.displacementMap||!!v.transmissionMap||!!v.thicknessMap||!!v.specularIntensityMap||!!v.specularColorMap||!!v.sheenColorMap||!!v.sheenRoughnessMap,uvsVertexOnly:!(v.map||v.bumpMap||v.normalMap||v.specularMap||v.alphaMap||v.emissiveMap||v.roughnessMap||v.metalnessMap||v.clearcoatNormalMap||v.iridescenceMap||v.iridescenceThicknessMap||v.transmission>0||v.transmissionMap||v.thicknessMap||v.specularIntensityMap||v.specularColorMap||v.sheen>0||v.sheenColorMap||v.sheenRoughnessMap)&&!!v.displacementMap,fog:!!k,useFog:v.fog===!0,fogExp2:k&&k.isFogExp2,flatShading:!!v.flatShading,sizeAttenuation:v.sizeAttenuation,logarithmicDepthBuffer:f,skinning:ee.isSkinnedMesh===!0,morphTargets:N.morphAttributes.position!==void 0,morphNormals:N.morphAttributes.normal!==void 0,morphColors:N.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:te,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&D.length>0,shadowMapType:r.shadowMap.type,toneMapping:v.toneMapped?r.toneMapping:Wt,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===sn,flipSided:v.side===Mt,useDepthPacking:!!v.depthPacking,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionDerivatives:v.extensions&&v.extensions.derivatives,extensionFragDepth:v.extensions&&v.extensions.fragDepth,extensionDrawBuffers:v.extensions&&v.extensions.drawBuffers,extensionShaderTextureLOD:v.extensions&&v.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:v.customProgramCacheKey()}}function u(v){let A=[];if(v.shaderID?A.push(v.shaderID):(A.push(v.customVertexShaderID),A.push(v.customFragmentShaderID)),v.defines!==void 0)for(let D in v.defines)A.push(D),A.push(v.defines[D]);return v.isRawShaderMaterial===!1&&(x(A,v),T(A,v),A.push(r.outputEncoding)),A.push(v.customProgramCacheKey),A.join()}function x(v,A){v.push(A.precision),v.push(A.outputEncoding),v.push(A.envMapMode),v.push(A.envMapCubeUVHeight),v.push(A.combine),v.push(A.vertexUvs),v.push(A.fogExp2),v.push(A.sizeAttenuation),v.push(A.morphTargetsCount),v.push(A.morphAttributeCount),v.push(A.numDirLights),v.push(A.numPointLights),v.push(A.numSpotLights),v.push(A.numSpotLightMaps),v.push(A.numHemiLights),v.push(A.numRectAreaLights),v.push(A.numDirLightShadows),v.push(A.numPointLightShadows),v.push(A.numSpotLightShadows),v.push(A.numSpotLightShadowsWithMaps),v.push(A.shadowMapType),v.push(A.toneMapping),v.push(A.numClippingPlanes),v.push(A.numClipIntersection),v.push(A.depthPacking)}function T(v,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.map&&a.enable(4),A.matcap&&a.enable(5),A.envMap&&a.enable(6),A.lightMap&&a.enable(7),A.aoMap&&a.enable(8),A.emissiveMap&&a.enable(9),A.bumpMap&&a.enable(10),A.normalMap&&a.enable(11),A.objectSpaceNormalMap&&a.enable(12),A.tangentSpaceNormalMap&&a.enable(13),A.clearcoat&&a.enable(14),A.clearcoatMap&&a.enable(15),A.clearcoatRoughnessMap&&a.enable(16),A.clearcoatNormalMap&&a.enable(17),A.iridescence&&a.enable(18),A.iridescenceMap&&a.enable(19),A.iridescenceThicknessMap&&a.enable(20),A.displacementMap&&a.enable(21),A.specularMap&&a.enable(22),A.roughnessMap&&a.enable(23),A.metalnessMap&&a.enable(24),A.gradientMap&&a.enable(25),A.alphaMap&&a.enable(26),A.alphaTest&&a.enable(27),A.vertexColors&&a.enable(28),A.vertexAlphas&&a.enable(29),A.vertexUvs&&a.enable(30),A.vertexTangents&&a.enable(31),A.uvsVertexOnly&&a.enable(32),v.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.physicallyCorrectLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.specularIntensityMap&&a.enable(15),A.specularColorMap&&a.enable(16),A.transmission&&a.enable(17),A.transmissionMap&&a.enable(18),A.thicknessMap&&a.enable(19),A.sheen&&a.enable(20),A.sheenColorMap&&a.enable(21),A.sheenRoughnessMap&&a.enable(22),A.decodeVideoTexture&&a.enable(23),A.opaque&&a.enable(24),v.push(a.mask)}function w(v){let A=g[v.type],D;if(A){let Z=Rt[A];D=Ll.clone(Z.uniforms)}else D=v.uniforms;return D}function y(v,A){let D;for(let Z=0,ee=l.length;Z0?n.push(x):m.transparent===!0?i.push(x):t.push(x)}function c(f,d,m,g,p,u){let x=o(f,d,m,g,p,u);m.transmission>0?n.unshift(x):m.transparent===!0?i.unshift(x):t.unshift(x)}function l(f,d){t.length>1&&t.sort(f||Bd),n.length>1&&n.sort(d||Ua),i.length>1&&i.sort(d||Ua)}function h(){for(let f=e,d=r.length;f=s.length?(o=new Ba,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function Vd(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new ze};break;case"SpotLight":t={position:new L,direction:new L,color:new ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new ze,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new ze,groundColor:new ze};break;case"RectAreaLight":t={color:new ze,position:new L,halfWidth:new L,halfHeight:new L};break}return r[e.id]=t,t}}}function Hd(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var Wd=0;function Gd(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Xd(r,e){let t=new Vd,n=Hd(),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 L);let s=new L,o=new Xe,a=new Xe;function c(h,f){let d=0,m=0,g=0;for(let Z=0;Z<9;Z++)i.probe[Z].set(0,0,0);let p=0,u=0,x=0,T=0,w=0,y=0,S=0,C=0,F=0,v=0;h.sort(Gd);let A=f!==!0?Math.PI:1;for(let Z=0,ee=h.length;Z0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=j.LTC_FLOAT_1,i.rectAreaLTC2=j.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=j.LTC_HALF_1,i.rectAreaLTC2=j.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=m,i.ambient[2]=g;let D=i.hash;(D.directionalLength!==p||D.pointLength!==u||D.spotLength!==x||D.rectAreaLength!==T||D.hemiLength!==w||D.numDirectionalShadows!==y||D.numPointShadows!==S||D.numSpotShadows!==C||D.numSpotMaps!==F)&&(i.directional.length=p,i.spot.length=x,i.rectArea.length=T,i.point.length=u,i.hemi.length=w,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=C,i.spotShadowMap.length=C,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=C+F-v,i.spotLightMap.length=F,i.numSpotLightShadowsWithMaps=v,D.directionalLength=p,D.pointLength=u,D.spotLength=x,D.rectAreaLength=T,D.hemiLength=w,D.numDirectionalShadows=y,D.numPointShadows=S,D.numSpotShadows=C,D.numSpotMaps=F,i.version=Wd++)}function l(h,f){let d=0,m=0,g=0,p=0,u=0,x=f.matrixWorldInverse;for(let T=0,w=h.length;T=a.length?(c=new ka(r,e),a.push(c)):c=a[o],c}function i(){t=new WeakMap}return{get:n,dispose:i}}var or=class extends ti{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=jo,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}},lr=class extends ti{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new L,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}},Yd=`void main() {\n\tgl_Position = vec4( position, 1.0 );\n}`,Zd=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \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 Jd(r,e,t){let n=new ns,i=new De,s=new De,o=new Ge,a=new or({depthPacking:el}),c=new lr,l={},h=t.maxTextureSize,f={0:Mt,1:Kn,2:sn},d=new Yt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new De},radius:{value:4}},vertexShader:Yd,fragmentShader:Zd}),m=d.clone();m.defines.HORIZONTAL_PASS=1;let g=new qt;g.setAttribute("position",new st(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new It(g,d),u=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Va,this.render=function(y,S,C){if(u.enabled===!1||u.autoUpdate===!1&&u.needsUpdate===!1||y.length===0)return;let F=r.getRenderTarget(),v=r.getActiveCubeFace(),A=r.getActiveMipmapLevel(),D=r.state;D.setBlending(rn),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);for(let Z=0,ee=y.length;Zh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/W.x),i.x=s.x*W.x,N.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/W.y),i.y=s.y*W.y,N.mapSize.y=s.y)),N.map===null){let K=this.type!==ui?{minFilter:ot,magFilter:ot}:{};N.map=new Xt(i.x,i.y,K),N.map.texture.name=k.name+".shadowMap",N.camera.updateProjectionMatrix()}r.setRenderTarget(N.map),r.clear();let q=N.getViewportCount();for(let K=0;K0){let ee=D.uuid,k=S.uuid,N=l[ee];N===void 0&&(N={},l[ee]=N);let W=N[k];W===void 0&&(W=D.clone(),N[k]=W),D=W}return D.visible=S.visible,D.wireframe=S.wireframe,A===ui?D.side=S.shadowSide!==null?S.shadowSide:S.side:D.side=S.shadowSide!==null?S.shadowSide:f[S.side],D.alphaMap=S.alphaMap,D.alphaTest=S.alphaTest,D.clipShadows=S.clipShadows,D.clippingPlanes=S.clippingPlanes,D.clipIntersection=S.clipIntersection,D.displacementMap=S.displacementMap,D.displacementScale=S.displacementScale,D.displacementBias=S.displacementBias,D.wireframeLinewidth=S.wireframeLinewidth,D.linewidth=S.linewidth,C.isPointLight===!0&&D.isMeshDistanceMaterial===!0&&(D.referencePosition.setFromMatrixPosition(C.matrixWorld),D.nearDistance=F,D.farDistance=v),D}function w(y,S,C,F,v){if(y.visible===!1)return;if(y.layers.test(S.layers)&&(y.isMesh||y.isLine||y.isPoints)&&(y.castShadow||y.receiveShadow&&v===ui)&&(!y.frustumCulled||n.intersectsObject(y))){y.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,y.matrixWorld);let Z=e.update(y),ee=y.material;if(Array.isArray(ee)){let k=Z.groups;for(let N=0,W=k.length;N=1):G.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\\d)/.exec(G)[1]),q=K>=2);let R=null,z={},te=r.getParameter(3088),Y=r.getParameter(2978),ne=new Ge().fromArray(te),oe=new Ge().fromArray(Y);function ve(E,B,J){let re=new Uint8Array(4),ce=r.createTexture();r.bindTexture(E,ce),r.texParameteri(E,10241,9728),r.texParameteri(E,10240,9728);for(let Ce=0;Ce$||b.height>$)&&(Q=$/Math.max(b.width,b.height)),Q<1||_===!0)if(typeof HTMLImageElement!="undefined"&&b instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&b instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&b instanceof ImageBitmap){let ie=_?Xi:Math.floor,xe=ie(Q*b.width),se=ie(Q*b.height);p===void 0&&(p=T(xe,se));let H=U?T(xe,se):p;return H.width=xe,H.height=se,H.getContext("2d").drawImage(b,0,0,xe,se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+b.width+"x"+b.height+") to ("+xe+"x"+se+")."),H}else return"data"in b&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+b.width+"x"+b.height+")."),b;return b}function y(b){return Js(b.width)&&Js(b.height)}function S(b){return a?!1:b.wrapS!==At||b.wrapT!==At||b.minFilter!==ot&&b.minFilter!==yt}function C(b,_){return b.generateMipmaps&&_&&b.minFilter!==ot&&b.minFilter!==yt}function F(b){r.generateMipmap(b)}function v(b,_,U,$,Q=!1){if(a===!1)return _;if(b!==null){if(r[b]!==void 0)return r[b];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'"+b+"\'")}let ie=_;return _===6403&&(U===5126&&(ie=33326),U===5131&&(ie=33325),U===5121&&(ie=33321)),_===33319&&(U===5126&&(ie=33328),U===5131&&(ie=33327),U===5121&&(ie=33323)),_===6408&&(U===5126&&(ie=34836),U===5131&&(ie=34842),U===5121&&(ie=$===ke&&Q===!1?35907:32856),U===32819&&(ie=32854),U===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function A(b,_,U){return C(b,U)===!0||b.isFramebufferTexture&&b.minFilter!==ot&&b.minFilter!==yt?Math.log2(Math.max(_.width,_.height))+1:b.mipmaps!==void 0&&b.mipmaps.length>0?b.mipmaps.length:b.isCompressedTexture&&Array.isArray(b.image)?_.mipmaps.length:1}function D(b){return b===ot||b===Fr||b===zr?9728:9729}function Z(b){let _=b.target;_.removeEventListener("dispose",Z),k(_),_.isVideoTexture&&g.delete(_)}function ee(b){let _=b.target;_.removeEventListener("dispose",ee),W(_)}function k(b){let _=n.get(b);if(_.__webglInit===void 0)return;let U=b.source,$=u.get(U);if($){let Q=$[_.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&N(b),Object.keys($).length===0&&u.delete(U)}n.remove(b)}function N(b){let _=n.get(b);r.deleteTexture(_.__webglTexture);let U=b.source,$=u.get(U);delete $[_.__cacheKey],o.memory.textures--}function W(b){let _=b.texture,U=n.get(b),$=n.get(_);if($.__webglTexture!==void 0&&(r.deleteTexture($.__webglTexture),o.memory.textures--),b.depthTexture&&b.depthTexture.dispose(),b.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++)r.deleteFramebuffer(U.__webglFramebuffer[Q]),U.__webglDepthbuffer&&r.deleteRenderbuffer(U.__webglDepthbuffer[Q]);else{if(r.deleteFramebuffer(U.__webglFramebuffer),U.__webglDepthbuffer&&r.deleteRenderbuffer(U.__webglDepthbuffer),U.__webglMultisampledFramebuffer&&r.deleteFramebuffer(U.__webglMultisampledFramebuffer),U.__webglColorRenderbuffer)for(let Q=0;Q=c&&console.warn("THREE.WebGLTextures: Trying to use "+b+" texture units while this GPU supports only "+c),q+=1,b}function R(b){let _=[];return _.push(b.wrapS),_.push(b.wrapT),_.push(b.wrapR||0),_.push(b.magFilter),_.push(b.minFilter),_.push(b.anisotropy),_.push(b.internalFormat),_.push(b.format),_.push(b.type),_.push(b.generateMipmaps),_.push(b.premultiplyAlpha),_.push(b.flipY),_.push(b.unpackAlignment),_.push(b.encoding),_.join()}function z(b,_){let U=n.get(b);if(b.isVideoTexture&&Dt(b),b.isRenderTargetTexture===!1&&b.version>0&&U.__version!==b.version){let $=b.image;if($===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ge(U,b,_);return}}t.bindTexture(3553,U.__webglTexture,33984+_)}function te(b,_){let U=n.get(b);if(b.version>0&&U.__version!==b.version){ge(U,b,_);return}t.bindTexture(35866,U.__webglTexture,33984+_)}function Y(b,_){let U=n.get(b);if(b.version>0&&U.__version!==b.version){ge(U,b,_);return}t.bindTexture(32879,U.__webglTexture,33984+_)}function ne(b,_){let U=n.get(b);if(b.version>0&&U.__version!==b.version){ye(U,b,_);return}t.bindTexture(34067,U.__webglTexture,33984+_)}let oe={[qs]:10497,[At]:33071,[Ys]:33648},ve={[ot]:9728,[Fr]:9984,[zr]:9986,[yt]:9729,[Oo]:9985,[rs]:9987};function X(b,_,U){if(U?(r.texParameteri(b,10242,oe[_.wrapS]),r.texParameteri(b,10243,oe[_.wrapT]),(b===32879||b===35866)&&r.texParameteri(b,32882,oe[_.wrapR]),r.texParameteri(b,10240,ve[_.magFilter]),r.texParameteri(b,10241,ve[_.minFilter])):(r.texParameteri(b,10242,33071),r.texParameteri(b,10243,33071),(b===32879||b===35866)&&r.texParameteri(b,32882,33071),(_.wrapS!==At||_.wrapT!==At)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(b,10240,D(_.magFilter)),r.texParameteri(b,10241,D(_.minFilter)),_.minFilter!==ot&&_.minFilter!==yt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let $=e.get("EXT_texture_filter_anisotropic");if(_.type===xn&&e.has("OES_texture_float_linear")===!1||a===!1&&_.type===xi&&e.has("OES_texture_half_float_linear")===!1)return;(_.anisotropy>1||n.get(_).__currentAnisotropy)&&(r.texParameterf(b,$.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,i.getMaxAnisotropy())),n.get(_).__currentAnisotropy=_.anisotropy)}}function Ie(b,_){let U=!1;b.__webglInit===void 0&&(b.__webglInit=!0,_.addEventListener("dispose",Z));let $=_.source,Q=u.get($);Q===void 0&&(Q={},u.set($,Q));let ie=R(_);if(ie!==b.__cacheKey){Q[ie]===void 0&&(Q[ie]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,U=!0),Q[ie].usedTimes++;let xe=Q[b.__cacheKey];xe!==void 0&&(Q[b.__cacheKey].usedTimes--,xe.usedTimes===0&&N(_)),b.__cacheKey=ie,b.__webglTexture=Q[ie].texture}return U}function ge(b,_,U){let $=3553;(_.isDataArrayTexture||_.isCompressedArrayTexture)&&($=35866),_.isData3DTexture&&($=32879);let Q=Ie(b,_),ie=_.source;t.bindTexture($,b.__webglTexture,33984+U);let xe=n.get(ie);if(ie.version!==xe.__version||Q===!0){t.activeTexture(33984+U),r.pixelStorei(37440,_.flipY),r.pixelStorei(37441,_.premultiplyAlpha),r.pixelStorei(3317,_.unpackAlignment),r.pixelStorei(37443,0);let se=S(_)&&y(_.image)===!1,H=w(_.image,se,!1,h);H=Nt(_,H);let de=y(H)||a,me=s.convert(_.format,_.encoding),le=s.convert(_.type),fe=v(_.internalFormat,me,le,_.encoding,_.isVideoTexture);X($,_,de);let he,Ee=_.mipmaps,Oe=a&&_.isVideoTexture!==!0,Ze=xe.__version===void 0||Q===!0,E=A(_,H,de);if(_.isDepthTexture)fe=6402,a?_.type===xn?fe=36012:_.type===gn?fe=33190:_.type===Jn?fe=35056:fe=33189:_.type===xn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),_.format===vn&&fe===6402&&_.type!==qa&&_.type!==gn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),_.type=gn,le=s.convert(_.type)),_.format===ei&&fe===6402&&(fe=34041,_.type!==Jn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),_.type=Jn,le=s.convert(_.type))),Ze&&(Oe?t.texStorage2D(3553,1,fe,H.width,H.height):t.texImage2D(3553,0,fe,H.width,H.height,0,me,le,null));else if(_.isDataTexture)if(Ee.length>0&&de){Oe&&Ze&&t.texStorage2D(3553,E,fe,Ee[0].width,Ee[0].height);for(let B=0,J=Ee.length;B>=1,J>>=1}}else if(Ee.length>0&&de){Oe&&Ze&&t.texStorage2D(3553,E,fe,Ee[0].width,Ee[0].height);for(let B=0,J=Ee.length;B0&&Ze++,t.texStorage2D(34067,Ze,he,H[0].width,H[0].height));for(let B=0;B<6;B++)if(se){Ee?t.texSubImage2D(34069+B,0,0,0,H[B].width,H[B].height,le,fe,H[B].data):t.texImage2D(34069+B,0,he,H[B].width,H[B].height,0,le,fe,H[B].data);for(let J=0;J=34069&&Q<=34074)&&r.framebufferTexture2D(36160,$,Q,n.get(U).__webglTexture,0),t.bindFramebuffer(36160,null)}function Fe(b,_,U){if(r.bindRenderbuffer(36161,b),_.depthBuffer&&!_.stencilBuffer){let $=33189;if(U||Ne(_)){let Q=_.depthTexture;Q&&Q.isDepthTexture&&(Q.type===xn?$=36012:Q.type===gn&&($=33190));let ie=Qe(_);Ne(_)?d.renderbufferStorageMultisampleEXT(36161,ie,$,_.width,_.height):r.renderbufferStorageMultisample(36161,ie,$,_.width,_.height)}else r.renderbufferStorage(36161,$,_.width,_.height);r.framebufferRenderbuffer(36160,36096,36161,b)}else if(_.depthBuffer&&_.stencilBuffer){let $=Qe(_);U&&Ne(_)===!1?r.renderbufferStorageMultisample(36161,$,35056,_.width,_.height):Ne(_)?d.renderbufferStorageMultisampleEXT(36161,$,35056,_.width,_.height):r.renderbufferStorage(36161,34041,_.width,_.height),r.framebufferRenderbuffer(36160,33306,36161,b)}else{let $=_.isWebGLMultipleRenderTargets===!0?_.texture:[_.texture];for(let Q=0;Q<$.length;Q++){let ie=$[Q],xe=s.convert(ie.format,ie.encoding),se=s.convert(ie.type),H=v(ie.internalFormat,xe,se,ie.encoding),de=Qe(_);U&&Ne(_)===!1?r.renderbufferStorageMultisample(36161,de,H,_.width,_.height):Ne(_)?d.renderbufferStorageMultisampleEXT(36161,de,H,_.width,_.height):r.renderbufferStorage(36161,H,_.width,_.height)}}r.bindRenderbuffer(36161,null)}function Se(b,_){if(_&&_.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,b),!(_.depthTexture&&_.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(_.depthTexture).__webglTexture||_.depthTexture.image.width!==_.width||_.depthTexture.image.height!==_.height)&&(_.depthTexture.image.width=_.width,_.depthTexture.image.height=_.height,_.depthTexture.needsUpdate=!0),z(_.depthTexture,0);let $=n.get(_.depthTexture).__webglTexture,Q=Qe(_);if(_.depthTexture.format===vn)Ne(_)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,$,0,Q):r.framebufferTexture2D(36160,36096,3553,$,0);else if(_.depthTexture.format===ei)Ne(_)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,$,0,Q):r.framebufferTexture2D(36160,33306,3553,$,0);else throw new Error("Unknown depthTexture format")}function pe(b){let _=n.get(b),U=b.isWebGLCubeRenderTarget===!0;if(b.depthTexture&&!_.__autoAllocateDepthBuffer){if(U)throw new Error("target.depthTexture not supported in Cube render targets");Se(_.__webglFramebuffer,b)}else if(U){_.__webglDepthbuffer=[];for(let $=0;$<6;$++)t.bindFramebuffer(36160,_.__webglFramebuffer[$]),_.__webglDepthbuffer[$]=r.createRenderbuffer(),Fe(_.__webglDepthbuffer[$],b,!1)}else t.bindFramebuffer(36160,_.__webglFramebuffer),_.__webglDepthbuffer=r.createRenderbuffer(),Fe(_.__webglDepthbuffer,b,!1);t.bindFramebuffer(36160,null)}function Ke(b,_,U){let $=n.get(b);_!==void 0&&ae($.__webglFramebuffer,b,b.texture,36064,3553),U!==void 0&&pe(b)}function rt(b){let _=b.texture,U=n.get(b),$=n.get(_);b.addEventListener("dispose",ee),b.isWebGLMultipleRenderTargets!==!0&&($.__webglTexture===void 0&&($.__webglTexture=r.createTexture()),$.__version=_.version,o.memory.textures++);let Q=b.isWebGLCubeRenderTarget===!0,ie=b.isWebGLMultipleRenderTargets===!0,xe=y(b)||a;if(Q){U.__webglFramebuffer=[];for(let se=0;se<6;se++)U.__webglFramebuffer[se]=r.createFramebuffer()}else{if(U.__webglFramebuffer=r.createFramebuffer(),ie)if(i.drawBuffers){let se=b.texture;for(let H=0,de=se.length;H0&&Ne(b)===!1){let se=ie?_:[_];U.__webglMultisampledFramebuffer=r.createFramebuffer(),U.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,U.__webglMultisampledFramebuffer);for(let H=0;H0&&Ne(b)===!1){let _=b.isWebGLMultipleRenderTargets?b.texture:[b.texture],U=b.width,$=b.height,Q=16384,ie=[],xe=b.stencilBuffer?33306:36096,se=n.get(b),H=b.isWebGLMultipleRenderTargets===!0;if(H)for(let de=0;de<_.length;de++)t.bindFramebuffer(36160,se.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+de,36161,null),t.bindFramebuffer(36160,se.__webglFramebuffer),r.framebufferTexture2D(36009,36064+de,3553,null,0);t.bindFramebuffer(36008,se.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,se.__webglFramebuffer);for(let de=0;de<_.length;de++){ie.push(36064+de),b.depthBuffer&&ie.push(xe);let me=se.__ignoreDepthValues!==void 0?se.__ignoreDepthValues:!1;if(me===!1&&(b.depthBuffer&&(Q|=256),b.stencilBuffer&&(Q|=1024)),H&&r.framebufferRenderbuffer(36008,36064,36161,se.__webglColorRenderbuffer[de]),me===!0&&(r.invalidateFramebuffer(36008,[xe]),r.invalidateFramebuffer(36009,[xe])),H){let le=n.get(_[de]).__webglTexture;r.framebufferTexture2D(36009,36064,3553,le,0)}r.blitFramebuffer(0,0,U,$,0,0,U,$,Q,9728),m&&r.invalidateFramebuffer(36008,ie)}if(t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,null),H)for(let de=0;de<_.length;de++){t.bindFramebuffer(36160,se.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(36160,36064+de,36161,se.__webglColorRenderbuffer[de]);let me=n.get(_[de]).__webglTexture;t.bindFramebuffer(36160,se.__webglFramebuffer),r.framebufferTexture2D(36009,36064+de,3553,me,0)}t.bindFramebuffer(36009,se.__webglMultisampledFramebuffer)}}function Qe(b){return Math.min(f,b.samples)}function Ne(b){let _=n.get(b);return a&&b.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function Dt(b){let _=o.render.frame;g.get(b)!==_&&(g.set(b,_),b.update())}function Nt(b,_){let U=b.encoding,$=b.format,Q=b.type;return b.isCompressedTexture===!0||b.isVideoTexture===!0||b.format===Zs||U!==bn&&(U===ke?a===!1?e.has("EXT_sRGB")===!0&&$===Et?(b.format=Zs,b.minFilter=yt,b.generateMipmaps=!1):_=Yi.sRGBToLinear(_):($!==Et||Q!==Mn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",U)),_}this.allocateTextureUnit=G,this.resetTextureUnits=K,this.setTexture2D=z,this.setTexture2DArray=te,this.setTexture3D=Y,this.setTextureCube=ne,this.rebindTextures=Ke,this.setupRenderTarget=rt,this.updateRenderTargetMipmap=tt,this.updateMultisampleRenderTarget=Pt,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=Ne}function Qd(r,e,t){let n=t.isWebGL2;function i(s,o=null){let a;if(s===Mn)return 5121;if(s===Vo)return 32819;if(s===Ho)return 32820;if(s===Uo)return 5120;if(s===Bo)return 5122;if(s===qa)return 5123;if(s===ko)return 5124;if(s===gn)return 5125;if(s===xn)return 5126;if(s===xi)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===Wo)return 6406;if(s===Et)return 6408;if(s===Xo)return 6409;if(s===qo)return 6410;if(s===vn)return 6402;if(s===ei)return 34041;if(s===Yo)return 6403;if(s===Go)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===Zs)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===Zo)return 36244;if(s===Jo)return 33319;if(s===$o)return 33320;if(s===Ko)return 36249;if(s===fs||s===ps||s===ms||s===gs)if(o===ke)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===fs)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===ps)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===ms)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===gs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===fs)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===ps)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===ms)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===gs)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Or||s===Ur||s===Br||s===kr)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Or)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Ur)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Br)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===kr)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Qo)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Vr||s===Hr)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Vr)return o===ke?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Hr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Wr||s===Gr||s===Xr||s===qr||s===Yr||s===Zr||s===Jr||s===$r||s===Kr||s===Qr||s===jr||s===ea||s===ta||s===na)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Wr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Gr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Xr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===qr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Yr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Zr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Jr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===$r)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Kr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Qr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===jr)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ea)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ta)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===na)return o===ke?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===ia)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===ia)return o===ke?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===Jn?n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}var cr=class extends pt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},Yn=class extends ht{constructor(){super(),this.isGroup=!0,this.type="Group"}},jd={type:"move"},gi=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Yn,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 Yn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Yn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null,a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){o=!0;for(let p of e.hand.values()){let u=t.getJointPose(p,n);if(l.joints[p.jointName]===void 0){let T=new Yn;T.matrixAutoUpdate=!1,T.visible=!1,l.joints[p.jointName]=T,l.add(T)}let x=l.joints[p.jointName];u!==null&&(x.matrix.fromArray(u.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.jointRadius=u.radius),x.visible=u!==null}let h=l.joints["index-finger-tip"],f=l.joints["thumb-tip"],d=h.position.distanceTo(f.position),m=.02,g=.005;l.inputState.pinching&&d>m+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=m-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.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=t.getPose(e.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(jd)))}return a!==null&&(a.visible=i!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=o!==null),this}},hr=class extends gt{constructor(e,t,n,i,s,o,a,c,l,h){if(h=h!==void 0?h:vn,h!==vn&&h!==ei)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===vn&&(n=gn),n===void 0&&h===ei&&(n=Jn),super(null,i,s,o,a,c,h,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:ot,this.minFilter=c!==void 0?c:ot,this.flipY=!1,this.generateMipmaps=!1}},ur=class extends an{constructor(e,t){super();let n=this,i=null,s=1,o=null,a="local-floor",c=null,l=null,h=null,f=null,d=null,m=null,g=t.getContextAttributes(),p=null,u=null,x=[],T=[],w=new pt;w.layers.enable(1),w.viewport=new Ge;let y=new pt;y.layers.enable(2),y.viewport=new Ge;let S=[w,y],C=new cr;C.layers.enable(1),C.layers.enable(2);let F=null,v=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(R){let z=x[R];return z===void 0&&(z=new gi,x[R]=z),z.getTargetRaySpace()},this.getControllerGrip=function(R){let z=x[R];return z===void 0&&(z=new gi,x[R]=z),z.getGripSpace()},this.getHand=function(R){let z=x[R];return z===void 0&&(z=new gi,x[R]=z),z.getHandSpace()};function A(R){let z=T.indexOf(R.inputSource);if(z===-1)return;let te=x[z];te!==void 0&&te.dispatchEvent({type:R.type,data:R.inputSource})}function D(){i.removeEventListener("select",A),i.removeEventListener("selectstart",A),i.removeEventListener("selectend",A),i.removeEventListener("squeeze",A),i.removeEventListener("squeezestart",A),i.removeEventListener("squeezeend",A),i.removeEventListener("end",D),i.removeEventListener("inputsourceschange",Z);for(let R=0;R=0&&(T[Y]=null,x[Y].dispatchEvent({type:"disconnected",data:te}))}for(let z=0;z=T.length){T.push(te),Y=oe;break}else if(T[oe]===null){T[oe]=te,Y=oe;break}if(Y===-1)break}let ne=x[Y];ne&&ne.dispatchEvent({type:"connected",data:te})}}let ee=new L,k=new L;function N(R,z,te){ee.setFromMatrixPosition(z.matrixWorld),k.setFromMatrixPosition(te.matrixWorld);let Y=ee.distanceTo(k),ne=z.projectionMatrix.elements,oe=te.projectionMatrix.elements,ve=ne[14]/(ne[10]-1),X=ne[14]/(ne[10]+1),Ie=(ne[9]+1)/ne[5],ge=(ne[9]-1)/ne[5],ye=(ne[8]-1)/ne[0],ae=(oe[8]+1)/oe[0],Fe=ve*ye,Se=ve*ae,pe=Y/(-ye+ae),Ke=pe*-ye;z.matrixWorld.decompose(R.position,R.quaternion,R.scale),R.translateX(Ke),R.translateZ(pe),R.matrixWorld.compose(R.position,R.quaternion,R.scale),R.matrixWorldInverse.copy(R.matrixWorld).invert();let rt=ve+pe,tt=X+pe,Pt=Fe-Ke,Qe=Se+(Y-Ke),Ne=Ie*X/tt*rt,Dt=ge*X/tt*rt;R.projectionMatrix.makePerspective(Pt,Qe,Ne,Dt,rt,tt)}function W(R,z){z===null?R.matrixWorld.copy(R.matrix):R.matrixWorld.multiplyMatrices(z.matrixWorld,R.matrix),R.matrixWorldInverse.copy(R.matrixWorld).invert()}this.updateCamera=function(R){if(i===null)return;C.near=y.near=w.near=R.near,C.far=y.far=w.far=R.far,(F!==C.near||v!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),F=C.near,v=C.far);let z=R.parent,te=C.cameras;W(C,z);for(let ne=0;ne0&&(p.alphaTest.value=u.alphaTest);let x=e.get(u).envMap;if(x&&(p.envMap.value=x,p.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=u.reflectivity,p.ior.value=u.ior,p.refractionRatio.value=u.refractionRatio),u.lightMap){p.lightMap.value=u.lightMap;let y=r.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=u.lightMapIntensity*y}u.aoMap&&(p.aoMap.value=u.aoMap,p.aoMapIntensity.value=u.aoMapIntensity);let T;u.map?T=u.map:u.specularMap?T=u.specularMap:u.displacementMap?T=u.displacementMap:u.normalMap?T=u.normalMap:u.bumpMap?T=u.bumpMap:u.roughnessMap?T=u.roughnessMap:u.metalnessMap?T=u.metalnessMap:u.alphaMap?T=u.alphaMap:u.emissiveMap?T=u.emissiveMap:u.clearcoatMap?T=u.clearcoatMap:u.clearcoatNormalMap?T=u.clearcoatNormalMap:u.clearcoatRoughnessMap?T=u.clearcoatRoughnessMap:u.iridescenceMap?T=u.iridescenceMap:u.iridescenceThicknessMap?T=u.iridescenceThicknessMap:u.specularIntensityMap?T=u.specularIntensityMap:u.specularColorMap?T=u.specularColorMap:u.transmissionMap?T=u.transmissionMap:u.thicknessMap?T=u.thicknessMap:u.sheenColorMap?T=u.sheenColorMap:u.sheenRoughnessMap&&(T=u.sheenRoughnessMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),p.uvTransform.value.copy(T.matrix));let w;u.aoMap?w=u.aoMap:u.lightMap&&(w=u.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uv2Transform.value.copy(w.matrix))}function s(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity}function o(p,u){p.dashSize.value=u.dashSize,p.totalSize.value=u.dashSize+u.gapSize,p.scale.value=u.scale}function a(p,u,x,T){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.size.value=u.size*x,p.scale.value=T*.5,u.map&&(p.map.value=u.map),u.alphaMap&&(p.alphaMap.value=u.alphaMap),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest);let w;u.map?w=u.map:u.alphaMap&&(w=u.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uvTransform.value.copy(w.matrix))}function c(p,u){p.diffuse.value.copy(u.color),p.opacity.value=u.opacity,p.rotation.value=u.rotation,u.map&&(p.map.value=u.map),u.alphaMap&&(p.alphaMap.value=u.alphaMap),u.alphaTest>0&&(p.alphaTest.value=u.alphaTest);let x;u.map?x=u.map:u.alphaMap&&(x=u.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),p.uvTransform.value.copy(x.matrix))}function l(p,u){p.specular.value.copy(u.specular),p.shininess.value=Math.max(u.shininess,1e-4)}function h(p,u){u.gradientMap&&(p.gradientMap.value=u.gradientMap)}function f(p,u){p.roughness.value=u.roughness,p.metalness.value=u.metalness,u.roughnessMap&&(p.roughnessMap.value=u.roughnessMap),u.metalnessMap&&(p.metalnessMap.value=u.metalnessMap),e.get(u).envMap&&(p.envMapIntensity.value=u.envMapIntensity)}function d(p,u,x){p.ior.value=u.ior,u.sheen>0&&(p.sheenColor.value.copy(u.sheenColor).multiplyScalar(u.sheen),p.sheenRoughness.value=u.sheenRoughness,u.sheenColorMap&&(p.sheenColorMap.value=u.sheenColorMap),u.sheenRoughnessMap&&(p.sheenRoughnessMap.value=u.sheenRoughnessMap)),u.clearcoat>0&&(p.clearcoat.value=u.clearcoat,p.clearcoatRoughness.value=u.clearcoatRoughness,u.clearcoatMap&&(p.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),p.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===Mt&&p.clearcoatNormalScale.value.negate())),u.iridescence>0&&(p.iridescence.value=u.iridescence,p.iridescenceIOR.value=u.iridescenceIOR,p.iridescenceThicknessMinimum.value=u.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=u.iridescenceThicknessRange[1],u.iridescenceMap&&(p.iridescenceMap.value=u.iridescenceMap),u.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=u.iridescenceThicknessMap)),u.transmission>0&&(p.transmission.value=u.transmission,p.transmissionSamplerMap.value=x.texture,p.transmissionSamplerSize.value.set(x.width,x.height),u.transmissionMap&&(p.transmissionMap.value=u.transmissionMap),p.thickness.value=u.thickness,u.thicknessMap&&(p.thicknessMap.value=u.thicknessMap),p.attenuationDistance.value=u.attenuationDistance,p.attenuationColor.value.copy(u.attenuationColor)),p.specularIntensity.value=u.specularIntensity,p.specularColor.value.copy(u.specularColor),u.specularIntensityMap&&(p.specularIntensityMap.value=u.specularIntensityMap),u.specularColorMap&&(p.specularColorMap.value=u.specularColorMap)}function m(p,u){u.matcap&&(p.matcap.value=u.matcap)}function g(p,u){p.referencePosition.value.copy(u.referencePosition),p.nearDistance.value=u.nearDistance,p.farDistance.value=u.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function tf(r,e,t,n){let i={},s={},o=[],a=t.isWebGL2?r.getParameter(35375):0;function c(T,w){let y=w.program;n.uniformBlockBinding(T,y)}function l(T,w){let y=i[T.id];y===void 0&&(g(T),y=h(T),i[T.id]=y,T.addEventListener("dispose",u));let S=w.program;n.updateUBOMapping(T,S);let C=e.render.frame;s[T.id]!==C&&(d(T),s[T.id]=C)}function h(T){let w=f();T.__bindingPointIndex=w;let y=r.createBuffer(),S=T.__size,C=T.usage;return r.bindBuffer(35345,y),r.bufferData(35345,S,C),r.bindBuffer(35345,null),r.bindBufferBase(35345,w,y),y}function f(){for(let T=0;T0){C=y%S;let Z=S-C;C!==0&&Z-D.boundary<0&&(y+=S-C,A.__offset=y)}y+=D.storage}return C=y%S,C>0&&(y+=S-C),T.__size=y,T.__cache={},this}function p(T){let w=T.value,y={boundary:0,storage:0};return typeof w=="number"?(y.boundary=4,y.storage=4):w.isVector2?(y.boundary=8,y.storage=8):w.isVector3||w.isColor?(y.boundary=16,y.storage=12):w.isVector4?(y.boundary=16,y.storage=16):w.isMatrix3?(y.boundary=48,y.storage=48):w.isMatrix4?(y.boundary=64,y.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),y}function u(T){let w=T.target;w.removeEventListener("dispose",u);let y=o.indexOf(w.__bindingPointIndex);o.splice(y,1),r.deleteBuffer(i[w.id]),delete i[w.id],delete s[w.id]}function x(){for(let T in i)r.deleteBuffer(i[T]);o=[],i={},s={}}return{bind:c,update:l,dispose:x}}function nf(){let r=qi("canvas");return r.style.display="block",r}function sf(r={}){this.isWebGLRenderer=!0;let e=r.canvas!==void 0?r.canvas:nf(),t=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;t!==null?h=t.getContextAttributes().alpha:h=r.alpha!==void 0?r.alpha:!1;let f=null,d=null,m=[],g=[];this.domElement=e,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=bn,this.physicallyCorrectLights=!1,this.toneMapping=Wt,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});let p=this,u=!1,x=0,T=0,w=null,y=-1,S=null,C=new Ge,F=new Ge,v=null,A=e.width,D=e.height,Z=1,ee=null,k=null,N=new Ge(0,0,A,D),W=new Ge(0,0,A,D),q=!1,K=new ns,G=!1,R=!1,z=null,te=new Xe,Y=new De,ne=new L,oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ve(){return w===null?Z:1}let X=t;function Ie(M,I){for(let O=0;O0?d=g[g.length-1]:d=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function Je(M,I,O,P){if(M.visible===!1)return;if(M.layers.test(I.layers)){if(M.isGroup)O=M.renderOrder;else if(M.isLOD)M.autoUpdate===!0&&M.update(I);else if(M.isLight)d.pushLight(M),M.castShadow&&d.pushShadow(M);else if(M.isSprite){if(!M.frustumCulled||K.intersectsSprite(M)){P&&ne.setFromMatrixPosition(M.matrixWorld).applyMatrix4(te);let _e=Qe.update(M),we=M.material;we.visible&&f.push(M,_e,we,O,ne.z,null)}}else if((M.isMesh||M.isLine||M.isPoints)&&(M.isSkinnedMesh&&M.skeleton.frame!==Fe.render.frame&&(M.skeleton.update(),M.skeleton.frame=Fe.render.frame),!M.frustumCulled||K.intersectsObject(M))){P&&ne.setFromMatrixPosition(M.matrixWorld).applyMatrix4(te);let _e=Qe.update(M),we=M.material;if(Array.isArray(we)){let Me=_e.groups;for(let Pe=0,Te=Me.length;Pe0&&ln(V,I,O),P&&ae.viewport(C.copy(P)),V.length>0&&Ue(V,I,O),ue.length>0&&Ue(ue,I,O),_e.length>0&&Ue(_e,I,O),ae.buffers.depth.setTest(!0),ae.buffers.depth.setMask(!0),ae.buffers.color.setMask(!0),ae.setPolygonOffset(!1)}function ln(M,I,O){let P=ye.isWebGL2;z===null&&(z=new Xt(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?xi:Mn,minFilter:rs,samples:P&&s===!0?4:0})),p.getDrawingBufferSize(Y),P?z.setSize(Y.x,Y.y):z.setSize(Xi(Y.x),Xi(Y.y));let V=p.getRenderTarget();p.setRenderTarget(z),p.clear();let ue=p.toneMapping;p.toneMapping=Wt,Ue(M,I,O),p.toneMapping=ue,pe.updateMultisampleRenderTarget(z),pe.updateRenderTargetMipmap(z),p.setRenderTarget(V)}function Ue(M,I,O){let P=I.isScene===!0?I.overrideMaterial:null;for(let V=0,ue=M.length;V0&&pe.useMultisampledRTT(M)===!1?V=Se.get(M).__webglMultisampledFramebuffer:V=Te,C.copy(M.viewport),F.copy(M.scissor),v=M.scissorTest}else C.copy(N).multiplyScalar(Z).floor(),F.copy(W).multiplyScalar(Z).floor(),v=q;if(ae.bindFramebuffer(36160,V)&&ye.drawBuffers&&P&&ae.drawBuffers(M,V),ae.viewport(C),ae.scissor(F),ae.setScissorTest(v),ue){let Me=Se.get(M.texture);X.framebufferTexture2D(36160,36064,34069+I,Me.__webglTexture,O)}else if(_e){let Me=Se.get(M.texture),Pe=I||0;X.framebufferTextureLayer(36160,36064,Me.__webglTexture,O||0,Pe)}y=-1},this.readRenderTargetPixels=function(M,I,O,P,V,ue,_e){if(!(M&&M.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=Se.get(M).__webglFramebuffer;if(M.isWebGLCubeRenderTarget&&_e!==void 0&&(we=we[_e]),we){ae.bindFramebuffer(36160,we);try{let Me=M.texture,Pe=Me.format,Te=Me.type;if(Pe!==Et&&se.convert(Pe)!==X.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Ae=Te===xi&&(ge.has("EXT_color_buffer_half_float")||ye.isWebGL2&&ge.has("EXT_color_buffer_float"));if(Te!==Mn&&se.convert(Te)!==X.getParameter(35738)&&!(Te===xn&&(ye.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!Ae){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}I>=0&&I<=M.width-P&&O>=0&&O<=M.height-V&&X.readPixels(I,O,P,V,se.convert(Pe),se.convert(Te),ue)}finally{let Me=w!==null?Se.get(w).__webglFramebuffer:null;ae.bindFramebuffer(36160,Me)}}},this.copyFramebufferToTexture=function(M,I,O=0){let P=Math.pow(2,-O),V=Math.floor(I.image.width*P),ue=Math.floor(I.image.height*P);pe.setTexture2D(I,0),X.copyTexSubImage2D(3553,O,0,0,M.x,M.y,V,ue),ae.unbindTexture()},this.copyTextureToTexture=function(M,I,O,P=0){let V=I.image.width,ue=I.image.height,_e=se.convert(O.format),we=se.convert(O.type);pe.setTexture2D(O,0),X.pixelStorei(37440,O.flipY),X.pixelStorei(37441,O.premultiplyAlpha),X.pixelStorei(3317,O.unpackAlignment),I.isDataTexture?X.texSubImage2D(3553,P,M.x,M.y,V,ue,_e,we,I.image.data):I.isCompressedTexture?X.compressedTexSubImage2D(3553,P,M.x,M.y,I.mipmaps[0].width,I.mipmaps[0].height,_e,I.mipmaps[0].data):X.texSubImage2D(3553,P,M.x,M.y,_e,we,I.image),P===0&&O.generateMipmaps&&X.generateMipmap(3553),ae.unbindTexture()},this.copyTextureToTexture3D=function(M,I,O,P,V=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let ue=M.max.x-M.min.x+1,_e=M.max.y-M.min.y+1,we=M.max.z-M.min.z+1,Me=se.convert(P.format),Pe=se.convert(P.type),Te;if(P.isData3DTexture)pe.setTexture3D(P,0),Te=32879;else if(P.isDataArrayTexture)pe.setTexture2DArray(P,0),Te=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}X.pixelStorei(37440,P.flipY),X.pixelStorei(37441,P.premultiplyAlpha),X.pixelStorei(3317,P.unpackAlignment);let Ae=X.getParameter(3314),Be=X.getParameter(32878),cn=X.getParameter(3316),Cn=X.getParameter(3315),Pn=X.getParameter(32877),Lt=O.isCompressedTexture?O.mipmaps[0]:O.image;X.pixelStorei(3314,Lt.width),X.pixelStorei(32878,Lt.height),X.pixelStorei(3316,M.min.x),X.pixelStorei(3315,M.min.y),X.pixelStorei(32877,M.min.z),O.isDataTexture||O.isData3DTexture?X.texSubImage3D(Te,V,I.x,I.y,I.z,ue,_e,we,Me,Pe,Lt.data):O.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),X.compressedTexSubImage3D(Te,V,I.x,I.y,I.z,ue,_e,we,Me,Lt.data)):X.texSubImage3D(Te,V,I.x,I.y,I.z,ue,_e,we,Me,Pe,Lt),X.pixelStorei(3314,Ae),X.pixelStorei(32878,Be),X.pixelStorei(3316,cn),X.pixelStorei(3315,Cn),X.pixelStorei(32877,Pn),V===0&&P.generateMipmaps&&X.generateMipmap(Te),ae.unbindTexture()},this.initTexture=function(M){M.isCubeTexture?pe.setTextureCube(M,0):M.isData3DTexture?pe.setTexture3D(M,0):M.isDataArrayTexture||M.isCompressedArrayTexture?pe.setTexture2DArray(M,0):pe.setTexture2D(M,0),ae.unbindTexture()},this.resetState=function(){x=0,T=0,w=null,ae.reset(),H.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var dr=class extends sf{};dr.prototype.isWebGL1Renderer=!0;function nn(r,e,t){return to(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)}function ki(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function to(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var ii=class{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],s=t[n-1];n:{e:{let o;t:{i:if(!(e=s)){let a=t[1];e=s)break e}o=n,n=0;break t}break n}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=nn(n,s,o),this.values=nn(this.values,s*a,o*a)}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 n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!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),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(i!==void 0&&to(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),e=!1;break}}return e}optimize(){let e=nn(this.times),t=nn(this.values),n=this.getValueSize(),i=this.getInterpolation()===xs,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,c=o*n,l=0;l!==n;++l)t[c+l]=t[a+l];++o}return o!==e.length?(this.times=nn(e,0,o),this.values=nn(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=nn(this.times,0),t=nn(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Ct.prototype.TimeBufferType=Float32Array;Ct.prototype.ValueBufferType=Float32Array;Ct.prototype.DefaultInterpolation=Wi;var An=class extends Ct{};An.prototype.ValueTypeName="bool";An.prototype.ValueBufferType=Array;An.prototype.DefaultInterpolation=Hi;An.prototype.InterpolantFactoryMethodLinear=void 0;An.prototype.InterpolantFactoryMethodSmooth=void 0;var gr=class extends Ct{};gr.prototype.ValueTypeName="color";var xr=class extends Ct{};xr.prototype.ValueTypeName="number";var _r=class extends ii{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(n-t)/(i-t),l=e*a;for(let h=l+a;l!==h;l+=4)on.slerpFlat(s,0,o,l-a,o,l,c);return s}},yi=class extends Ct{InterpolantFactoryMethodLinear(e){return new _r(this.times,this.values,this.getValueSize(),e)}};yi.prototype.ValueTypeName="quaternion";yi.prototype.DefaultInterpolation=Wi;yi.prototype.InterpolantFactoryMethodSmooth=void 0;var En=class extends Ct{};En.prototype.ValueTypeName="string";En.prototype.ValueBufferType=Array;En.prototype.DefaultInterpolation=Hi;En.prototype.InterpolantFactoryMethodLinear=void 0;En.prototype.InterpolantFactoryMethodSmooth=void 0;var vr=class extends Ct{};vr.prototype.ValueTypeName="vector";var Sr="\\\\[\\\\]\\\\.:\\\\/",rf=new RegExp("["+Sr+"]","g"),Tr="[^"+Sr+"]",af="[^"+Sr.replace("\\\\.","")+"]",of=/((?:WC+[\\/:])*)/.source.replace("WC",Tr),lf=/(WCOD+)?/.source.replace("WCOD",af),cf=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Tr),hf=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Tr),uf=new RegExp("^"+of+lf+cf+hf+"$"),df=["material","materials","bones","map"],yr=class{constructor(e,t,n){let i=n||Re.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Re=class{constructor(e,t,n){this.path=t,this.parsedPath=n||Re.parseTrackName(t),this.node=Re.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Re.Composite(e,t,n):new Re(e,t,n)}static sanitizeNodeName(e){return e.replace(/\\s/g,"_").replace(rf,"")}static parseTrackName(e){let t=uf.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);df.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: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;oMath.round(A*a);if(u[0]=`${v(S.x)}, ${v(S.y)}, ${v(S.z)}`,u[1]=`${v(C.x)}, ${v(C.y)}, ${v(C.z)}`,u[2]=`${v(F.x)}, ${v(F.y)}, ${v(F.z)}`,!(u[0]===u[1]||u[1]===u[2]||u[2]===u[0]))for(let A=0;A<3;A++){let D=(A+1)%3,Z=u[A],ee=u[D],k=cs[p[A]],N=cs[p[D]],W=`${Z}_${ee}`,q=`${ee}_${Z}`;q in x&&x[q]?(Ar.dot(x[q].normal)<=c&&(T.push(k.x,k.y,k.z),T.push(N.x,N.y,N.z)),x[q]=null):W in x||(x[W]={index0:g[A],index1:g[D],normal:Ar.clone()})}}for(let y in x)if(x[y]){let{index0:S,index1:C}=x[y];os.fromBufferAttribute(d,S),ls.fromBufferAttribute(d,C),T.push(os.x,os.y,os.z),T.push(ls.x,ls.y,ls.z)}let w=new self[h](T);no.postMessage({id:t,vertices:w},[w.buffer])}});\n/*! Bundled license information:\n\nthree/build/three.module.js:\n (**\n * @license\n * Copyright 2010-2022 Three.js Authors\n * SPDX-License-Identifier: MIT\n *)\n*/\n')} // src/core/workers/WorkerManager.ts var CreateEdgesGeometryWorker=class{constructor(){this.worker=new Worker2,this.geometries=new Map, // eslint-disable-line 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=>{const t=this.geometries.get(e.data.id.toString());(null==t?void 0:t.length)>0&&(t.forEach((t=>{(null==t?void 0:t.geometry)&&(null==t?void 0:t.matrix)&&(null==t?void 0:t.geom)&&(null==t?void 0:t.line)&&(t.geom.parameters={geometry:t.geometry,thresholdAngle:5},t.geom.setAttribute("position",new Float32BufferAttribute(e.data.vertices,3)),t.geom.applyMatrix4(t.matrix),t.line.geometry=t.geom,t.line.visible=!0)})),this.geometries.delete(e.data.id.toString()),this.jobCount--),this.loadedGeometries.set(e.data.id.toString(),e.data.vertices)}))}postMessage(e){this.worker.postMessage(JSON.stringify(e))}},createEdgesGeometryWorker=new CreateEdgesGeometryWorker,Default_Up=new Vector3(0,1,0),_ObjectUtils=class{ /** * Clears any styles, including transparency, wireframe mode, filter by floor, etc. * @param object */ static resetObjectStyle(e){this.revertWireframeMode(e),this.revertObjectOpacity(e,[]),this.revertAppliedMaterialToObject(e),this.revertVisibleForFloors(e)} /** * Clears any styles, including transparency, wireframe mode, filter by floor, etc. */static resetObjectStyleById(e,t){const r=this.getObjectById(e,t);this.resetObjectStyle(r)} /** * Sets an object's opacity * @returns returns MaterialInfo list in case caller want to revert the opacity */static setObjectOpacity(e,t=.3,r,i){const 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=DoubleSide)},a=e=>{const r=n.find((t=>t.id===e.id));if(!r){const r=e.clone();return n.push({id:e.id,opacity:e.opacity,transparent:e.transparent,side:e.side,material:e,clonedMaterial:r}),r.opacity*=t,r.transparent=!0,r}return r.clonedMaterial};return e.traverse((e=>{if((!i||-1===i.indexOf(e.id))&&(!r||-1!==r.indexOf(e.id))&&e instanceof Mesh){const t=e;if(r||i){if(Array.isArray(t.material)){const e=[];t.material.forEach((t=>{const r=a(t);r&&e.push(r)})),t.material=e}else if(t.material){const e=a(t.material);e&&(t.material=e)}}else if(Array.isArray(t.material))t.material.forEach((e=>{s(e)}));else if(t.material){const e=t.material;s(e)}}})),n} /** * Reverts an object's opacity * @param object the root object */static revertObjectOpacity(e,t,r,i){const n=e=>{const r=t.find((t=>t.id===e.id));r&&(e.opacity=r.opacity,e.transparent=r.transparent,e.side=r.side)},s=e=>{const r=t.find((t=>t.clonedMaterial&&t.clonedMaterial.id===e.id));if(r)return r.material};e.traverse((e=>{if((!i||-1===i.indexOf(e.id))&&(!r||-1!==r.indexOf(e.id))&&e instanceof Mesh)if(Array.isArray(e.material)){const t=[];e.material.forEach((e=>{const r=s(e);r?t.push(r):n(e)})),e.material=t}else if(e.material){const t=s(e.material);t?e.material=t:n(e.material)}}))} /** * Sets an object's opacity */static setObjectOpacityById(e,t,r=.3,i,n){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);return _ObjectUtils.setObjectOpacity(s,r,i,n)} /** * Reverts an object's opacity */static revertObjectOpacityById(e,t,r,i,n){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);_ObjectUtils.revertObjectOpacity(s,r,i,n)} /** * Applies material to an object, including its children * The originalMaterial will be saved to userData in case user want to revert it */static applyMaterialToObject(e,t,r,i){e.traverse((e=>{i&&-1!==i.indexOf(e.id)||r&&-1===r.indexOf(e.id)||e instanceof Mesh&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),e.material=t)}))} /** * Revert applied material to an object, including its children */static revertAppliedMaterialToObject(e,t,r){e.traverse((e=>{r&&-1!==r.indexOf(e.id)||t&&-1===t.indexOf(e.id)||e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,e.userData.originalMaterial=void 0)}))} /** * Sets an object's opacity */static applyMaterialToObjectById(e,t,r,i,n){const s=e.getObjectById(t);if(!s)throw new Error(`Failed to find object by id: ${t}`);this.applyMaterialToObject(s,r,i,n)} /** * Reverts an object's opacity */static revertAppliedMaterialToObjectById(e,t,r,i){const n=e.getObjectById(t);if(!n)throw new Error(`Failed to find object by id: ${t}`);this.revertAppliedMaterialToObject(n,r,i)} /** * Applies a default opacity material to an object, including its children */static applyOpacityMaterialToObject(e,t,r){const i=new MeshBasicMaterial({color:0,transparent:!0,opacity:.05});this.applyMaterialToObject(e,i,t,r)} // /** // * Explodes an object // */ // public static explodeObject(scene: THREE.Scene, object: THREE.Object3D, explodeUp = false): Exploder { // const position = new THREE.Vector3(); // SceneUtils.getObjectCenter(object, position); // const exploder = new Exploder(scene, object.id, position); // exploder.setOnlyExplodeUp(explodeUp); // exploder.explode(); // return exploder; // } // /** // * Unexplodes an object // */ // public static unexplodeObject(exploder: Exploder) { // if (!exploder) { // throw new Error("Invalid exploder!"); // } // exploder.unexplode(); // } /** * Sets an object to be wireframe mode. * In order to revert wireframe mode, we'll store original material in userData: \{ * materialForWireframe: THREE.Material * \} * It seems wireframe mode have performance degradation, look at here for more info: * https://stackoverflow.com/questions/45917611/shader-wireframe-of-an-object */ static setWireframeMode(e){const t=new MeshBasicMaterial({color:16732160,wireframe:!0,transparent:!0,opacity:.8});e.traverseVisible((e=>{if(e instanceof Mesh){const r=e;r.userData.materialForWireframe=r.material,r.material=t}}))} /** * Sets an object to be wireframe mode. */static setWireframeModeById(e,t){const r=e.getObjectById(t);if(!r)throw new Error(`Failed to find object by id: ${t}`);_ObjectUtils.setWireframeMode(r)} /** * Reverts an object to be non-wireframe mode. */static revertWireframeMode(e){e.traverseVisible((e=>{e instanceof Mesh&&e.userData.materialForWireframe&&(e.material=e.userData.materialForWireframe,e.userData.materialForWireframe=void 0)}))} /** * Reverts an object to be non-wireframe mode. */static revertWireframeModeById(e,t){const r=e.getObjectById(t);if(!r)throw new Error(`Failed to find object by id: ${t}`);_ObjectUtils.revertWireframeMode(r)} /** * Finds objects by name, id, userData, etc. * @param scene * @param targetIds target object ids to find from * @param searchText search text * @param findFirst only find the first */static findInner(e,t,r=[],i=!1){const 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){const t=e.gltfExtensions,r=t.objectId&&t.objectId.Value||t.elementId&&t.elementId.Value;if(r&&-1!==r.toLowerCase().indexOf(n))return!0}return!1};if(r.length>0)for(let t=0;t{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),i&&s.length>0)return[s[0]]}else if(e.traverse((e=>{(a(e.name)||o(e.id)||l(e.userData))&&s.push(e)})),i&&s.length>0)return[s[0]];return s} /** * Finds objects by given string */static find(e,t,r=[],i=!1){return this.findInner(e,t,r,i)} /** * Finds the first object by given string */static findFirst(e,t,r=[],i=!1){const n=this.findInner(e,t,r,i);if(n.length>0)return n[0]} /** * Checks if given string contains floor * @param str string to match, e.g. '5F(xxx)' */static getFloorsFromString(e){const t=[],r=new RegExp(/(?:-?(?:\d+(?:\.5)?)F)(?=\W|$)/,"g").exec(e);return r&&r.length>0&&r.forEach((e=>{if(e){const r=e.replace("F",""),i=Number(r);i?t.push(i):console.log(`[OU] invalid floor: ${e}`)}})),t} /** * Matches if a string contains floor string * @param str string to match, e.g. '5F(xxx)' * @param floor '5F', etc. */static matchFloor(e,t){return-1!==this.getFloorsFromString(e).findIndex((e=>e===t))} /** * Matches if a string contains one of floor string in floors * @param str string to match, e.g. '5F(xxx)' * @param floor '5F', etc. */static matchFloors(e,t){return-1!==this.getFloorsFromString(e).findIndex((e=>-1!==t.findIndex((t=>t===e))))} /** * Distincts/find floors from models, by checking children object.name */static distinctFloors(e,t){const r=[],i=e=>{this.getFloorsFromString(e).forEach((e=>{r[e]=!0}))};return t.forEach((t=>{const r=e.getObjectById(t);r&&r.traverse((e=>{if(i(e.name),e.userData.gltfExtensions){const t=e.userData.gltfExtensions;t.level&&t.level.Value&&i(t.level.Value)}}))})),Object.keys(r).sort()} /** * Sets object's visible to true if its name, etc. match one of given floor. * This method won't affect other objects that don't match. */static traverseObjectByFloors(e,t,r,i,n){const s=e.getObjectById(t);if(!s)return[];s.traverse((e=>{let t=this.matchFloors(e.name,r);if(!t&&e.userData&&e.userData.gltfExtensions){const i=e.userData.gltfExtensions;i.level&&i.level.Value&&(t=this.matchFloors(i.level.Value,r))}t&&i&&i(e),!t&&n&&n(e)}))} /** * Sets object belong to given floors to be visible * @param objectId root or parent object id * @param makeUnmatchedInvisible if it should make unmatched object invisible */static setVisibleForFloors(e,t,r,i=!0){this.traverseObjectByFloors(e,t,r,(e=>{let t=e;for(;t;)t.visible=!0,t=t.parent||void 0}),(e=>{i&&(e.visible=!1)}))}static revertVisibleForFloors(e){e.traverse((e=>{e.visible=!0}))}static revertVisibleForFloorsById(e,t){const r=this.getObjectById(e,t);this.revertVisibleForFloors(r)}static getObjectById(e,t){const r=e.getObjectById(t);if(!r)throw new Error(`Failed to find object by id: ${t}`);return r} /** * Creates outlines for given object and children * @param object * @param options 'replaceOriginalObject' must be used carefully, it removes original objects and cannot get back for now. * It can be used in case for really large models that has a bad performace. */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 Mesh)))return[];const r=e;for(let e=r.children.length-1;e>=0;--e){const i=r.children[e];this.createOutlines(i,t).forEach((e=>e.applyMatrix4(r.matrixWorld)))}if(!r.geometry)return[];const i=[];if(r instanceof InstancedMesh)for(let e=0;e=0;--t){const r=e.children[t];r.children.length>0&&this.removeOutlines(r),r.userData.isOutline&&e.remove(r)}} /** * Recursively checks if an object or children has outline already */static hasOutline(e){let t=!1;for(let r=0;r0&&(t=this.hasOutline(i),t))break}return t} /** * Sets outline visiblility for given object and children */static setOutlinesVisibility(e,t){e.traverse((e=>{e.userData.isOutline&&(e.visible=t)}))} /** * Creates outline for given geometry */static createOutline(e,t,r=this.OUTLINE_MATERIAL){const i=new EdgesGeometry,n=new LineSegments(i,r);if(n.layers.set(layerForUnselectableObjects),n.userData.isOutline=!0,n.matrixAutoUpdate=matrixAutoUpdate,n.visible=!1,n.updateMatrix(),createEdgesGeometryWorker.loadedGeometries.has(e.id.toString())){const r=createEdgesGeometryWorker.loadedGeometries.get(e.id.toString());return i.parameters={geometry:e,thresholdAngle:5},i.setAttribute("position",new Float32BufferAttribute(r,3)),i.applyMatrix4(t),n.geometry=i,n.visible=!0,n}return createEdgesGeometryWorker.get(e.id.toString())||createEdgesGeometryWorker.add(e.id.toString(),[]),createEdgesGeometryWorker.loadedGeometries.has(e.id.toString())||(createEdgesGeometryWorker.add(e.id.toString(),createEdgesGeometryWorker.get(e.id.toString()).concat([{geometry:e,matrix:t,geom:i,line:n}])),createEdgesGeometryWorker.postMessage({id:e.id,position:e.getAttribute("position").toJSON(),index:e.getIndex(),thresholdAngle:5})),n} /** * Creates outline for given geometry */static createOutlineSync(e,t,r=this.OUTLINE_MATERIAL){const i=new EdgesGeometry(e,5),n=new LineSegments(i,r);return n.layers.set(layerForUnselectableObjects),n.userData.isOutline=!0,n.matrixAutoUpdate=matrixAutoUpdate,n.applyMatrix4(t),n} /** * Clones object * @param object target object to be cloned * @param cloneMaterial if it needs to clone material or not * @returns cloned object */static cloneObject(e,t=!0){const r=e.clone();return t&&r.traverse((e=>{(e instanceof Mesh||e instanceof Line)&&(e.material=MaterialUtils.cloneMaterial(e.material))})),r} /** * Creates box mesh */static createBox(e,t,r,i=_ObjectUtils.BOX_FACE_MATERIAL,n=!0){const s=[],a=(e,t,r)=>{s.push(new Vector3(e,t,r))};a(0,0,0),a(e,0,0),a(e,t,0),a(0,t,0),a(0,0,r),a(e,0,r),a(e,t,r),a(0,t,r);const o=new BufferGeometry;o.setFromPoints(s);const l=[0,3,2,0,2,1,4,6,7,4,5,6,0,7,3,0,4,7,3,6,2,3,7,6,1,6,5,1,2,6];return n&&l.push(0,5,4,0,1,5),o.setIndex(l),o.computeVertexNormals(),new Mesh(o,i)} /** * TODO: Relative to center */static rebaseObjectOnRTC(e){const t=e;if(!(t.isMesh||t.isLine||t.isPoints))return e;if(!(t.geometry&&t.geometry instanceof BufferGeometry))return e;const r=t.geometry;if(!r.hasAttribute("position"))return e;const i=r.getAttribute("position");if(0===i.count)return e;const n=i.itemSize,s=i.array,a=[];for(let e=0;e2?a[2]:0);const l=e.matrixAutoUpdate;return e.matrixAutoUpdate=!1,e.applyMatrix4(o),e.matrixAutoUpdate=l,e}static isEmptyObject(e){if(0===e.children.length){const t=e.geometry;if(!t||!t.hasAttribute("position")||0===t.getAttribute("position").count)return!0}return!1}static removeEmptyObjects(e){for(let t=0;t{e.removeFromParent()})),this.removeEmptyObjects(t))} /** * To save memory, object3d shares some variables */static setSharedVariablesOfObject(e){e.uuid="",e.up=Default_Up} /** * Checks if an object is a drawable leaf object */static isLeafObject(e){return(e instanceof Mesh||e instanceof Line||e instanceof Points)&&!(e.children.length>0||!e.geometry)}},ObjectUtils=_ObjectUtils; // src/core/utils/ObjectUtils.ts /** * Outline default material */ ObjectUtils.OUTLINE_MATERIAL=new LineBasicMaterial({name:"outline",color:0,transparent:!0,opacity:.2}),ObjectUtils.BOX_FACE_MATERIAL=new MeshPhongMaterial({color:11648971,transparent:!0,opacity:.3,side:FrontSide}); // src/core/utils/MergeUtils.ts var tempMatrix2=new Matrix4,identifyMatrix=new Matrix4,_MergeUtils=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} /** * Merges child objects for given object. * it tries to merge objects in the same level and with the same parent; * @param saveBatchInfo caller can set saveBatchInfo to true, so that s/he can * get the object's original data before merged. * While this takes some extra space, so, we'd like to add a flag here. */static merge(e,t=!0){const r=Date.now();this.mergeInner(e,t),this.mergeInfo.elapsedTime+=Date.now()-r} /** * Merges child objects of given object. * If objects' material are the same, they can be merged. */static mergeInner(e,t=!0){if(!e.children||e.children.length<1)return;const r=e.children.length,i={},n=[];for(let s=0;s0){this.mergeInner(r,t);continue}if(r.userData.relativeToCenter)continue;if(r.isInstancedMesh)continue;if(!r.geometry)continue;if(!(r.geometry instanceof BufferGeometry))continue;let a=!1;const o=Object.values(i);for(let t=o.length-1;t>=0;--t){const r=o[t].indexes[0];if(a=this.tryHandleMergeableObjects(e,s,r,i,n),a)break}for(let t=n.length-1;!a&&t>=0;--t){const r=n[t];if(a=this.tryHandleMergeableObjects(e,s,r,i,n),a)break}a||n.push(s)}if(Object.keys(i).length<=0)return;const s=[],a=[],o=[],l=[];Object.values(i).forEach((r=>{const i=r.indexes,n=e.children[i[0]];let c=[],u=0,h=0,p=0;const d=[];if(i.forEach((r=>{var i,n,s;const a=e.children[r],o=a.geometry.clone();if(o.applyMatrix4(a.matrix),GeometryUtils.tryConvertInterleavedBufferAttributes(o),o.userData.isLineSegments=!0===a.isLineSegments,c.push(o),t){const e=null==(n=null==(i=o.attributes)?void 0:i.position)?void 0:n.count,t=(null==(s=o.index)?void 0:s.count)||0;d.push({batchId:u, //name, //id, positionStart:h,positionCount:e,indexStart:p,indexCount:t}),h+=e,p+=t,u++}})),0===c.length)return;let m;if(n.isMesh){const e=mergeBufferGeometries(c);if(!e)return;e.userData={},m=new Mesh(e,n.material),s.push(m)}else if(n.isLine){const e=this.mergeLineGeometries(c,t,n.material instanceof LineDashedMaterial||n.material instanceof ShaderMaterial,d);if(!e)return;m=new LineSegments(e,n.material),a.push(m)}else if(n.isPoints){const e=mergeBufferGeometries(c);if(!e)return;e.userData={},m=new Points(e,n.material),o.push(m)}m&&(t?m.userData.batches=d:m.userData=n.userData,m.userData.layerName=n.userData.layerName,m.name=`[Merged] ${n.name}`,m.matrixAutoUpdate=matrixAutoUpdate,m.renderOrder=n.renderOrder,m.layers=n.layers,m.visible=n.visible,l.push(...i)),c.forEach((e=>{GeometryUtils.releaseGeometryManually(e)})),c=[]})),l.sort(((e,t)=>t-e)),l.forEach((t=>{const r=e.children[t];e.remove(r)})),[...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} /** * @param object parent object or THREE.Object3D[] * @param i index of for object.children[] * @param k index of for object.children[] * @param dict to store merge-able object * @param nonMergeIndexes used in order to improve performance */static tryHandleMergeableObjects(e,t,r,i,n){let s=!1;const a=Array.isArray(e),o=a?e.length:e.children.length;if(t===r||t>=o||r>=o)return s;const l=a?e[t]:e.children[t],c=a?e[r]:e.children[r];return this.areObjectsMergeable(l,c)&&this.areGeometriesMergeable(l.geometry,c.geometry)&&MaterialUtils.materialsEquals(l.material,c.material)&&(i[r]||(i[r]={indexes:[r]},this.removeFromArray(n,r)),i[r].indexes.push(t),s=!0),s} /** * TODO: Filters XC etc. * there are cases where entities with xc and without xc are merged together */static isFilteredByOtherFactors(e,t){const r=e;if(r.isMesh&&r.material.isShaderMaterial)return!0;let i=!1,n=e;for(;n&&n!==t;){const e=n.userData;if(e.relativeToCenter||e.spatialFilterHandle){i=!0;break}n=n.parent}return i} /** * Merges all objects of given object, just leaf children. * If objects' material are the same, they can be merged. * Better to call mergeInner first then deepMerge for a better performance. * return \{ "added": THREE.Object3D[], "removed": THREE.Object3D[] \} */static deepMerge(e,t,r=!0,i=!0,n=!0){const s={added:[],removed:[]};if(e.length<=1)return s;let a=Date.now();const o={},l=[];for(let r=0;r=0;--t){const i=s[t].indexes[0];if(n=this.tryHandleMergeableObjects(e,r,i,o,l),n)break}for(let t=l.length-1;!n&&t>=0;--t){const i=l[t];if(n=this.tryHandleMergeableObjects(e,r,i,o,l),n)break}n||l.push(r)}if(Object.keys(o).length<=0)return s;log.debug(`[Merge] Built merged indexes for ${e.length} objects in ${(Date.now()-a)/1e3}s`),a=Date.now();const c=[],u=[],h=[],p=[];Object.values(o).forEach((r=>{const i=r.indexes;if(i.length<2)return;const s=e[i[0]];let a=[],o=0,l=0,d=0;const m=[];if(i.forEach((r=>{var i,c,u;const h=e[r],p=h.geometry.clone();if(s.material instanceof LineBasicMaterial&&p.deleteAttribute("lineDistance"),this.applyMatrix(p,h,t),p.userData.isLineSegments=!0===h.isLineSegments,a.push(p),n){const e=null==(c=null==(i=p.attributes)?void 0:i.position)?void 0:c.count,t=(null==(u=p.index)?void 0:u.count)||0;let r;s.isLine&&(p.boundingSphere||p.computeBoundingSphere(),r=p.boundingSphere.clone()),m.push({batchId:o, //name, //id, positionStart:l,positionCount:e,indexStart:d,indexCount:t,boundingSphere:r}),l+=e,d+=t,o++}})),0===a.length)return;let f;if(s.isMesh){const e=mergeBufferGeometries(a);if(!e)return;e.userData={},f=new Mesh(e,s.material),c.push(f)}else if(s.isLine){const e=this.mergeLineGeometries(a,n,s.material instanceof LineDashedMaterial||s.material instanceof ShaderMaterial,m);if(!e)return;f=new LineSegments(e,s.material),u.push(f)}else if(s.isPoints){const e=mergeBufferGeometries(a);if(!e)return;e.userData={},f=new Points(e,s.material),h.push(f)}f&&(n?f.userData.batches=m:f.userData=s.userData,f.userData.layerName=s.userData.layerName,f.name=`[Merged] ${s.name}`,f.matrixAutoUpdate=matrixAutoUpdate,f.renderOrder=s.renderOrder,f.layers=s.layers,f.visible=s.visible,i.forEach((e=>p.push(e)))),a.forEach((e=>{GeometryUtils.releaseGeometryManually(e)})),a=[]})),log.debug(`[Merge] Ran deepMerge() in ${(Date.now()-a)/1e3}s`);const d=s.removed;p.forEach((t=>{const i=e[t];d.push(i),r&&i.removeFromParent()}));const m=s.added;return[...c,...u,...h].forEach((e=>{m.push(e),r&&t&&(t.add(e),e.updateWorldMatrix(!1,!1))})),this.mergeInfo.removedObjects+=p.length,this.mergeInfo.mergedMeshes+=c.length,this.mergeInfo.mergedLines+=u.length,this.mergeInfo.mergedPoints+=h.length,i&&t&&ObjectUtils.removeEmptyObjects(t),s} /** * since we'll move geometry to another merged mesh under a group, below is the structure: - root object - merged objects group - merged object 1 * need to consider a geomery's matrix for each level of ancestor */static applyMatrix(e,t,r){let i=t;for(tempMatrix2.identity();i&&i!==r&&(tempMatrix2.premultiply(i.matrix),i.parent);)i=i.parent;return tempMatrix2.equals(identifyMatrix)?e:e.applyMatrix4(tempMatrix2)} /** * Merges geometries for lines */static mergeLineGeometries(e,t,r,i){let n;if(r)n=_MergeUtils.mergeBufferGeometriesWithLinesToLineSegements(e,t,i);else{if(n=mergeBufferGeometries(e),!n)return;n.userData={};const r=[];let s=0;e.forEach(((e,n)=>{const a=e.attributes.position;if(!a)return;const o=e.index,l=!0===e.userData.isLineSegments,c=r.length;if(o)for(let e=0;e0&&r.push(s+o.array[e-1],s+t)}else for(let e=0;e0&&(l?e%2==1&&r.push(s+e-1,s+e):r.push(s+e-1,s+e));s+=a.count,t&&i&&(i[n].indexStart=c,i[n].indexCount=r.length-c)})),n.setIndex(r)}return n}static mergeBufferGeometriesWithLinesToLineSegements(e,t,r){const i=new Set(Object.keys(e[0].attributes)),n={},s=new BufferGeometry,a=[];let o=0;for(let s=0;s=0;--r)if(e[r]===t)return void e.splice(r,1)} /** * Removes object from objects */static removeObjectFromArray(e,t){for(let r=e.length-1;r>=0;--r)if(e[r]===t)return void e.splice(r,1)} /** * Checks if two geometries are mergable. * It requires they have the same type and the same attributes. */static areGeometriesMergeable(e,t){if(!e||!t)return!1;if("InstancedBufferGeometry"===e.type||"InstancedBufferGeometry"===t.type)return!1;if(!!e.index!=!!t.index)return!1;const r=Object.keys(e.attributes);if(r.length!==Object.keys(t.attributes).length)return!1;for(const e of r)if(!t.attributes[e])return!1;return!0} /** * Checks if two objects are mergable. * It requires * - They are with the same masks. * - Their userData.layerName must be the same if there is. This is useful for Dxf. * - They have the same type or the same draw type( Mesh or Line or Point). */static areObjectsMergeable(e,t){if(e.layers.mask!==t.layers.mask)return!1;if(e.renderOrder!==t.renderOrder)return!1;if(e.visible!==t.visible)return!1;if(e.userData.layerName!==t.userData.layerName)return!1;if(e.type===t.type)return!0;const r=e,i=t;return r.isMesh&&i.isMesh||r.isLine&&i.isLine||r.isPoints&&i.isPoints} /** * Checks if it is a merged object */static isMergedMesh(e){return!(!e||!e.userData.batches)}static isFaceIndexInBatch(e,t,r){if(e.boundsTree){const i=e.index.getX(3*r);if(i>=t.positionStart&&i=e&&r<=i)return!0}else{const e=3*r;if(e>=t.positionStart&&e0?e.children.forEach((e=>this.explodeObject(e))):this.explodeLeafObject(e)} /** * Explodes a leaf object (that has geometry, and ususally no children) */explodeLeafObject(e){if(e.geometry){if(e.userData.originalPosition=e.position.clone(),e instanceof InstancedMesh){const t=new Matrix4,r=new Vector3,i=new Quaternion,n=new Vector3;for(let s=0;s0?e.children.forEach((e=>this.unexplodeObject(e))):this.unexplodeLeafObject(e)} /** * Unexplodes a leaf object */unexplodeLeafObject(e){const t=e.userData.originalPosition;t&&(e.position.set(t.x,t.y,t.z),e.updateMatrix(),delete e.userData.originalPosition)}setOnlyExplodeUp(e){this.isExplodeUp=e}getObjectCenter(e){const t=new Box3;if(!this.objectId)return void console.log(`[EXP] Invalid objectId: ${this.objectId}`);const r=this.scene.getObjectById(this.objectId);r&&r.children?(r.traverse((e=>{t.expandByObject(e)})),t.getCenter(e)):console.log("[EXP] No children to explode!")}},Exploder=_Exploder;Exploder.DEFAULT_SCALE=1; // src/core/utils/SceneUtils.ts var SceneUtils=class{ /** * Get all visible objects' bounding box in a scene. * @param scene */ static getVisibleObjectBoundingBox(e){const t=new Box3;return e.traverseVisible((e=>{e instanceof Mesh&&!1!==e.userData.selectable&&t.expandByObject(e)})),t}static getObjectsBoundingBox(e,t,r){const i=new Box3;return t.forEach((t=>{const n=e.getObjectById(t);if(n){const e=SceneUtils.getBoundingBox(n,r);e.isEmpty()||i.union(e)}})),i} /** * Box3.expandByObject() doesn't work well in some case. * E.g. when object's position is far away from object's center? * When objects are instanced? * That's why we need a method to find bounding box by object's children! * And, better to do sampling in case there are too many children. */static getBoundingBox(e,t=!0){const r=new Box3;if(e instanceof InstancedMesh)return SceneUtils.getInstancedMeshBoundingBox(e);if(0===e.children.length)return r.expandByObject(e),r;const i=e.children.length;let n=1;i>20&&(n=3),i>100&&(n=5),i>200&&(n=10),i>1e3&&(n=100),e.updateMatrixWorld(!1);for(let s=0;s{r.find((e=>e===n.id))&&(n.children&&1===n.children.length?SceneUtils.explodeObject(n.children[0],e,t,i):SceneUtils.explodeObject(n,e,t,i))})),t}static unexplodeObjects(e,t){e.traverse((e=>{const r=t[e.id];r&&(r.unexplode(),delete t[e.id])}))}static getObjectCenter(e,t){const r=SceneUtils.getBoundingBox(e);r.getCenter(t),t.y=r.min.y}},import_simplify_js=__toESM(require_simplify(),1),_cb=new Vector3,_ab=new Vector3,SimplifyModifier=class{modify(e,t){const r=(e=e.clone()).attributes;for(const t in r)"position"!==t&&e.deleteAttribute(t);const i=[],n=[],s=(e=mergeVertices(e)).getAttribute("position");for(let e=0;e-1&&e.splice(r,1)}function computeEdgeCollapseCost(e,t){const r=t.position.distanceTo(e.position);let i=0;const n=[];for(let r=0,i=e.faces.length;r=0;e--)r.faces[e]&&r.faces[e].hasVertex(i)&&removeFace(r.faces[e],t);for(let e=r.faces.length-1;e>=0;e--)r.faces[e].replaceVertex(r,i);removeVertex(r,e);for(let e=0;e0){return(new SimplifyModifier).modify(e,r)}return e} /** * Simplifies points of a line/pline/polygon, etc. * @param points point array * @param tolerance If tolerance is bigger, more points are simpified. Default is 1. */static simplifyPoints(e,t=1){const r=(0,import_simplify_js.default)(e,t);return this.simplifiedInfo.total+=e.length,this.simplifiedInfo.removed+=e.length-r.length,r} /** * Gets number of vertices to remove */static getNumberOfVerticesToRemove(e,t){let r=0;e instanceof BufferGeometry&&e.index&&(r=e.attributes.position.count);const i=Math.floor(r*t);return r<20?0:i}}; // used for collecting information and print logs SimplifyUtils.simplifiedInfo={total:0,removed:0}; // src/core/utils/SkyboxUtils.ts var _SkyboxUtils=class{ /** * Creates sky * @param radius * @param widthSegments * @param heightSegments */ static createSkyOfGradientRamp(e=4e3,t=32,r=15,i=new Vector3,n=new Vector3(0,.7,.5)){const s=this.COLOR_TEMPLATES.default,a={topColor:{value:new Color(s[0])},skylineColor:{value:new Color(s[1])},bottomColor:{value:new Color(s[2])},offset:{value:400},exponent:{value:.9},skyCenter:{value:i||new Vector3},sunDirection:{value:n.normalize()}},o=new SphereGeometry(e,t,r),l=new ShaderMaterial({uniforms:a,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader,side:BackSide}),c=new Mesh(o,l);return c.matrixAutoUpdate=!1,c.name=this.NAME,c.userData.selectable=!1,c.layers.set(layerForUnselectableObjects),c} /** * Create sky according to a bounding box */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<_SkyboxUtils.MIN_SKY_RADIUS?t=_SkyboxUtils.MIN_SKY_RADIUS:t>_SkyboxUtils.MAX_SKY_RADIUS&&(t=_SkyboxUtils.MAX_SKY_RADIUS);const r=new Vector3;e.getCenter(r);const i=_SkyboxUtils.createSkyOfGradientRamp(t,void 0,void 0,r);return i.position.set(r.x,0,r.z),i} /** * Creates skybox by 6 pictures. The texture should be assigned to scene.background. */static createSkyFromTextures(e){return __async(this,null,(function*(){const t=new CubeTextureLoader;return new Promise((r=>{t.load(e,(e=>r(e)))}))}))}},SkyboxUtils=_SkyboxUtils; // src/core/utils/UnitConversionUtils.ts function __getPointBaseLength(){const e=document.createElement("div");e.setAttribute("style","height: 1in; visibility: hidden; position: absolute; margin: 0; padding: 0;"),document.body.appendChild(e);return.0254/e.clientHeight}SkyboxUtils.NAME="SKYBOX",SkyboxUtils.MIN_SKY_RADIUS=4e3,SkyboxUtils.MAX_SKY_RADIUS=2e4,SkyboxUtils.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 }",SkyboxUtils.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 }", // some color templates for skybox SkyboxUtils.COLOR_TEMPLATES={default:[8828661,16777215,10066329], // blue sky, gray ground blueSky:[11189247,16777215,6974058], // dark blue sky, gray ground boardwalk:[14413823,16777215,15459804]};var unitConversionByMeter={file:1, // hard code to be meters now. TODO: fix it later m:1,mm:.001,cm:.01,ft:.3048,in:.0254,pt:__getPointBaseLength()},unitLabel={file:"m",m:"m",mm:"mm",cm:"cm",ft:"ft",in:"in",pt:"pt"},_getSuffix=e=>2===e?"²":3===e?"³":"",getUnitStr=(e,t=1)=>unitLabel[e]+_getSuffix(t),getLengthValueByUnit=(e,t,r,i=1)=>{if(null==r&&(r=t),r===t)return{value:e,unit:getUnitStr(r)};return{value:e*Math.pow(unitConversionByMeter[t]/unitConversionByMeter[r],i),unit:getUnitStr(r)+_getSuffix(i)}},Views=(e=>(e.Top="Top",e.Bottom="Bottom",e.Front="Front",e.Back="Back",e.Left="Left",e.Right="Right",e))(Views||{}),_Viewer3DUtils=class{ // /** // * Calculates camera position and look at point by given scene // * @param scene // * @param view // * @param eye this method pass out it to caller // * @param look this method pass out it to caller // */ // static getCameraPositionByView( // scene: THREE.Scene, // view: Views | string, // eye: THREE.Vector3, // look: THREE.Vector3, // cameraProjectionMatrix?: THREE.Matrix4 // ) { // const bbox = SceneUtils.getVisibleObjectBoundingBox(scene); // const cameraDir = Viewer3DUtils.getCameraDirectionByView(view); // Viewer3DUtils.getCameraPositionByBboxAndDirection(bbox, eye, look, cameraProjectionMatrix, cameraDir); // } // /** // * Calculates camera position and look at point by given object ids // * @param scene // * @param objectIds // * @param view // * @param eye // * @param look // */ // public static getCameraPositionByObjectIds( // scene: THREE.Scene, // objectIds: number[], // view: Views | string, // eye: THREE.Vector3, // look: THREE.Vector3, // cameraProjectionMatrix?: THREE.Matrix4 // ) { // const bbox = SceneUtils.getObjectsBoundingBox(scene, objectIds); // const cameraDir = Viewer3DUtils.getCameraDirectionByView(view); // Viewer3DUtils.getCameraPositionByBboxAndDirection(bbox, eye, look, cameraProjectionMatrix, cameraDir); // } // /** // * Gets camera's new position and target(lookAt) by given bbox and camera's current position // */ // public static getCameraPositionByObjects( // objects: THREE.Object3D[], // camera: THREE.Camera, // eye: THREE.Vector3, // look: THREE.Vector3 // ) { // const bbox = new THREE.Box3(); // objects.forEach((object) => { // const box = SceneUtils.getBoundingBox(object); // bbox.union(box); // }); // const cameraDir = new THREE.Vector3(); // camera.getWorldDirection(cameraDir); // Viewer3DUtils.getCameraPositionByBboxAndDirection(bbox, eye, look, camera.projectionMatrix, cameraDir); // } // public static getCameraPositionByVisibleObject( // scene: THREE.Scene, // camera: THREE.Camera, // eye: THREE.Vector3, // look: THREE.Vector3 // ) { // const bbox = SceneUtils.getVisibleObjectBoundingBox(scene); // Viewer3DUtils.getCameraPositionByBboxAndDirection(bbox, eye, look, camera.projectionMatrix); // } /** * Gets camera's new position and target(lookAt) by given bbox and view */ static getCameraPositionByBboxAndView(e,t,r,i,n){const s=_Viewer3DUtils.getCameraDirectionByView(t);return this.getCameraPositionByBboxAndDirection(e,r,i,n,s)} /** * Gets camera's new position and target(lookAt) by given bbox and expected camera direction */static getCameraPositionByBboxAndDirection(e,t,r,i,n){if(e.isEmpty())return;if(!i)return;const s=new Vector3,a=new Vector3,o=new Vector3(0,1,0);e.getSize(a),e.getCenter(s);let l,c,u=(a.x+a.y+a.z)/3*1.5;if(!n||(null==n?void 0:n.equals(new Vector3)))l=new Vector3(s.x+u,s.y+u/1.5,s.z+u),c=l.clone().sub(s);else{const e=new Vector3(u,u/1.5,u).length();c=new Vector3(-n.x,-n.y,-n.z).normalize().multiplyScalar(e),l=c.clone().add(s)}u=c.length(),c=c.normalize();const h=new Matrix4;h.lookAt(l,s,o);const p=new Matrix4;p.makeTranslation(-l.x,-l.y,-l.z);const d=e.clone().applyMatrix4(p).applyMatrix4(h.invert()).applyMatrix4(i),m=Math.max(Math.abs(d.max.x),Math.abs(d.min.x)),f=Math.max(Math.abs(d.max.y),Math.abs(d.min.y));u*=1.1*Math.sqrt(Math.pow(m,2)+Math.pow(f,2)),l=c.multiplyScalar(u).add(s),r.set(s.x,s.y,s.z),t.set(l.x,l.y,l.z)}static getCameraDirectionByView(e){const t=new Vector3(1,0,0);return"Top"/* Top */===e?t.set(0,-1,0):"Bottom"/* Bottom */===e?t.set(0,1,0):"Front"/* Front */===e?t.set(0,0,-1):"Back"/* Back */===e?t.set(0,0,1):"Left"/* Left */===e?t.set(1,0,0):"Right"/* Right */===e&&t.set(-1,0,0),t} /** * Sleep a while */static sleep(e){return __async(this,null,(function*(){let t;return new Promise((r=>{t=setTimeout((()=>{r("")}),e)})).then((()=>{clearTimeout(t)}))}))} /** * Twinkle the object several times */static twinkle(e,t=500){return __async(this,null,(function*(){const r=_Viewer3DUtils.twinklingObjectIds;r[e.id]||(r[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 r[e.id])}))}},Viewer3DUtils=_Viewer3DUtils; // need to store the objects that is twinkling, do this to avoid one object to be // twinkled while it is twinkling, that can be buggy! Viewer3DUtils.twinklingObjectIds={}; // src/core/viewers/ViewerEvent.ts var debugLines,ViewerEvent=(e=>(e.LayoutChanged="LayoutChanged",e.RenderAfter="RenderAfter",e))(ViewerEvent||{}),debug=!1,Drawable=class extends Event{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=[], // eslint-disable-next-line @typescript-eslint/no-explicit-any this.userData={},this.width=0,this.height=0, // for world to screen scale this.tolerance=1,this.visible=!0, // is select markup this.selected=!1, // TODO:If need // renderOrder: number; // When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. // If set to false the object gets rendered every frame even if it is not in the frustum of the camera. Default is true. this.needsFrustumCulled=!0,this.editPointSize=3,this.editPointColor="#ffffff", // just for edit this.matrix=new Matrix4,this.id=e||CommonUtils.guid()}setTolerance(e){this.tolerance=e}render(e,t){this.ctx=e,this.draw(e,t),this.selected&&this.drawSelect(e,t),debug&&(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 Vector3(this.x,this.y,0),new Vector3(this.x+this.width,this.y,0),new Vector3(this.x+this.width,this.y+this.height,0),new Vector3(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 Vector3)}transToScreenCoord(e,t){return this.ctx?CoordinateConversionUtils.worldPosition2ScreenPoint(e,t,this.ctx.canvas):new Vector2} /** * * @param ctx * @param camera * @describe just for debug bounds */drawBounds(e,t){const{min:r,max:i}=this.getBounds(),n=[],s=(e,t,r)=>n.push(new Vector3(e,t,r));s(i.x,i.y,i.z),s(r.x,i.y,i.z),s(r.x,r.y,i.z),s(i.x,r.y,i.z),s(i.x,i.y,r.z),s(r.x,i.y,r.z),s(r.x,r.y,r.z),s(i.x,r.y,r.z),s(r.x,i.y,i.z),s(r.x,r.y,i.z),s(i.x,i.y,i.z),s(i.x,r.y,i.z),s(i.x,i.y,r.z),s(i.x,r.y,r.z),s(r.x,i.y,r.z),s(r.x,r.y,r.z),s(r.x,i.y,i.z),s(r.x,i.y,r.z),s(i.x,i.y,i.z),s(i.x,i.y,r.z),s(r.x,r.y,i.z),s(r.x,r.y,r.z),s(i.x,r.y,i.z),s(i.x,r.y,r.z),e.save(),e.strokeStyle="yellow",e.beginPath(),n.forEach(((r,i)=>{const n=this.transToScreenCoord(r,t);i%2==0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()} /** * * @param ctx * @param camera * @describe just for debug */drawCenter(e,t){const r=this.transToScreenCoord(this.getCenter(),t);e.save(),e.fillStyle="yellow",e.beginPath(),e.arc(r.x,r.y,5,0,2*Math.PI),e.closePath(),e.fill(),e.restore()}getBounds(){const e=this.getVertexs();return(new Box3).setFromPoints(e)}},DrawableList=class{constructor(e){ // not really useful for now this.drawableMap=new Map,this.category=e}addDrawable(e){this.drawableMap.set(e.id,e)}updateDrawable(e,t){e.setData(t)}removeDrawable(e){this.drawableMap.delete(e.id)}getDrawableById(e){return this.drawableMap.get(e)}clear(){this.drawableMap.clear()}getDrawables(){return this.drawableMap}getDrawableDatas(){return Array.from(this.drawableMap).map((([e,t])=>t.getData()))}setDrawableDatas(e){for(let t=0;tnew Vector3(e[0],e[1],e[2]||0))),i=new t(e.id,r);return i.setData(e),i}get container(){return this.viewer.viewerContainer}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()} // for calculate screen length to world length getPixelSize(e,t){const{clientWidth:r,clientHeight:i}=this.container;let n=0;if("OrthographicCamera"===t.type){const s=t;n=e*Math.max(s.right-s.left,s.top-s.bottom)/s.zoom/Math.max(r,i)}else if("PerspectiveCamera"===t.type){const r=t,s=this.viewer.cameraCfg,a=s&&CommonUtils.arrayToVector3(s.eye),o=s&&CommonUtils.arrayToVector3(s.look);n=2*e*(a.distanceTo(o)*Math.tan(r.fov/2*Math.PI/180))/i}return n}init(){this.initCanvas(),this.viewer.addEventListener("RenderAfter"/* RenderAfter */,(()=>{this.projScreenMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(this.projScreenMatrix),this.render()}))}initCanvas(){const e=this.canvas=document.createElement("canvas"),t=this.viewer.viewerContainer;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});const{clientWidth:r,clientHeight:i}=t;this.setSize(r,i),t.appendChild(e)}toHighDpr(e,t,r){const i=window.devicePixelRatio||1,n=this.canvas;return n.width=t*i,n.height=r*i,e.scale(i,i),n.style.width=`${t}px`,n.style.height=`${r}px`,e}clearCanvas(){var e,t,r;null==(r=this.context)||r.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(){this.clearCanvas();const e=this.getSortedDrawables(),t=new Sphere;for(let r=0;r{e.push(...Array.from(t.getDrawables().values()))})),e.sort(((e,t)=>t.getCenter().distanceTo(this.camera.position)-e.getCenter().distanceTo(this.camera.position))),e}getDrawablesByPosition(e,t){const r=this.getSortedDrawables().reverse(),i=[];for(let n=0;ne.clear())),this.drawableLists=[],this.canvas&&(null==(e=this.viewer.viewerContainer)||e.removeChild(this.canvas),this.canvas=void 0)}},MarkupType=(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))(MarkupType||{}),import_lodash=__toESM(require_lodash(),1),Tooltip=class{constructor(e,t,r){this.follow=e=>{this.node.style.left=e.offsetX+15+"px",this.node.style.top=e.offsetY-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(MOUSEMOVE_EVENT,this.follow):document.removeEventListener(MOUSEMOVE_EVENT,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==r?void 0:r.target,this.parentNode=(null==r?void 0:r.parentNode)||document.body,(null==r?void 0:r.followPointer)&&(this.node.classList.add("follow-tooltip"),this.target?this.target.addEventListener(MOUSEMOVE_EVENT,this.follow):document.addEventListener(MOUSEMOVE_EVENT,this.follow)),this.parentNode.appendChild(this.node),!(null==r?void 0:r.showOnCreate)&&this.node.setAttribute("hidden","")}setContent(e){this.node.textContent&&(this.node.textContent=null),(0,import_lodash.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,import_lodash.forEach)(this.childNode.children,(e=>{this.childNode.removeChild(e)})),this.childNode.append(e)}},_SnapDrawable=class extends Drawable{constructor(e){super(CommonUtils.guid()),this.needsFrustumCulled=!1,this.snapType="Dot"/* Dot */,this.snapLineVisible=!1,this.snapType=e,this.drawSnapFunctions={Dot:this.drawDot.bind(this),Square:this.drawSquare.bind(this),Cross:this.drawCross.bind(this),Triangle:this.drawTriangle.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=_SnapDrawable.FILL_COLOR,e.strokeStyle=_SnapDrawable.LINE_COLOR,e.lineWidth=_SnapDrawable.LINE_WIDTH,e.beginPath(),this.drawSnapFunctions[this.snapType](e,t),debugLines&&this.drawDebug(e,t),e.closePath(),e.fill(),e.stroke(),e.restore())}drawDebug(e,t){null==debugLines||debugLines.forEach((r=>{const i=this.transToScreenCoord(r.start,t),n=this.transToScreenCoord(r.end,t);e.moveTo(i.x,i.y),e.lineTo(n.x,n.y)}))} // eslint-disable-next-line @typescript-eslint/no-unused-vars drawSelect(e,t){} // eslint-disable-next-line @typescript-eslint/no-unused-vars isPointInPath(e){return!1}drawSnapLine(e,t){e.save(),e.strokeStyle=_SnapDrawable.SNAP_LINE_COLOR,e.lineWidth=_SnapDrawable.LINE_WIDTH;const r=this.transToScreenCoord(this.osnapInfo.line.start,t),i=this.transToScreenCoord(this.osnapInfo.line.end,t);e.moveTo(r.x,r.y),e.lineTo(i.x,i.y),e.stroke(),e.restore()}drawDot(e,t){const r=this.transToScreenCoord(this.osnapInfo.point,t);e.arc(r.x,r.y,_SnapDrawable.SNAP_ICON_SIZE/3,0,2*Math.PI)}drawSquare(e,t){const r=this.transToScreenCoord(this.osnapInfo.point,t),i=_SnapDrawable.SNAP_ICON_SIZE/1.2,n=_SnapDrawable.SNAP_ICON_SIZE/1.2;e.rect(r.x-i/2,r.y-n/2,i,n)}drawTriangle(e,t){const r=this.transToScreenCoord(this.osnapInfo.point,t),i=_SnapDrawable.SNAP_ICON_SIZE/1.2/2,n=new Vector2(0,-i).add(r),s=new Vector2(-.87*i,i/2).add(r),a=new Vector2(.87*i,i/2).add(r);e.moveTo(n.x,n.y),e.lineTo(s.x,s.y),e.lineTo(a.x,a.y),e.closePath()}drawCross(e,t){const r=this.transToScreenCoord(this.osnapInfo.point,t),i=_SnapDrawable.SNAP_ICON_SIZE/1.2/2,n=new Vector2(-i,-i).add(r),s=new Vector2(i,i).add(r),a=new Vector2(i,-i).add(r),o=new Vector2(-i,i).add(r);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){const r=this.transToScreenCoord(this.osnapInfo.point,t),i=_SnapDrawable.SNAP_ICON_SIZE/1.2/2;[new Vector2(0,0).add(r),new Vector2(-i,0).add(r),new Vector2(0,0).add(r),new Vector2(0,i).add(r),new Vector2(i,i).add(r),new Vector2(-i,i).add(r),new Vector2(-i,i).add(r),new Vector2(-i,-i).add(r)].forEach(((t,r)=>{0===r?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}))}update(e){this.osnapInfo=e}getClassType(){return"SnapDrawable"}},SnapDrawable=_SnapDrawable; // src/core/canvas/Drawable.ts SnapDrawable.LINE_COLOR="rgba(255, 240, 0, 0.8)",SnapDrawable.FILL_COLOR="rgba(135, 206, 250, 0.5)",SnapDrawable.SNAP_LINE_COLOR="rgba(255, 240, 0, 0.3)",SnapDrawable.LINE_WIDTH=2.5,SnapDrawable.SNAP_ICON_SIZE=10,CanvasRender._registerDrawableClass(SnapDrawable);var EPSILON=1e-5,OSnapHelper=class{ // in world coordinate (not pixel) constructor(e){var t;this.drawableList=new DrawableList("snap"),this.markers={}, // the key is OSnapType this.activeOSnapType=0/* None */, // the active OSnapType, we should display its marker on screen this.snapTolerance=1,this.overlayRender=e,null==(t=this.overlayRender)||t.addDrawableList(this.drawableList),this.initOSnapMarkers()}initOSnapMarkers(){const e=new SnapDrawable("Square"/* Square */),t=new SnapDrawable("Triangle"/* Triangle */),r=new SnapDrawable("Dot"/* Dot */),i=new SnapDrawable("Cross"/* Cross */),n=new SnapDrawable("Perpendicular"/* Perpendicular */);this.markers[2/* StartPoint */]=e,this.markers[4/* EndPoint */]=e,this.markers[8/* MiddlePoint */]=t,this.markers[1/* PointOnLine */]=r,this.markers[32/* Intersection */]=i,this.markers[16/* FootOfPerpendicular */]=n,Object.values(this.markers).forEach((e=>{e.visible=!1,this.drawableList.addDrawable(e)}))} // TODO: support enable some of OSnapTypes // setEnabledOSnapTypes(types: OSnapType) { // this.enabledOSnapTypes = types; // } /** * Updates snap tolerance in world coordinate */ 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/* None */}destroy(){} /** * Tries to find a proper snap point and display corresponding marker. * @param intersections * @returns Target snap point if any */handleSnap(e,t,r,i){if(!(null==t?void 0:t.length))return void this.activateMarker(0/* None */);const n=this.getInteractionLines(e,t);if(n){const t=this.getSnapInfo(e,n,i);return t&&0/* None */!==t.type?(this.activateMarker(t.type,r,t),t.point):void this.activateMarker(0/* None */)}this.activateMarker(0/* None */)}activateMarker(e,t=!1,r){var i;this.activeOSnapType&&(this.markers[this.activeOSnapType].visible=!1),this.activeOSnapType=e;const n=this.markers[e];n&&r&&(n.setSnapLineVisible(t),n.update(r),n.visible=!0),null==(i=this.overlayRender)||i.render()}getFootOfPerpendicular(e,t,r=EPSILON){const{start:i,end:n}=t,s=i.x-n.x,a=i.y-n.y,o=i.z-n.z;if(i.distanceTo(n)t.type-e.type)),n[0]}},_BaseMeasureDrawable=class extends Drawable{ // just for drawing drawable constructor(e,t){super(e),this.type="Distance"/* Distance */, // it's label screen point this.labelBounds=new Box2, // it's 2d box for select label this.drawing=!1,this.update(t)}setDrawingState(e){this.drawing=e}drawSelect(e,t){const r=this.getVertexs();this.drawPoints(e,t,r)}drawPoints(e,t,r){e.save(),e.fillStyle=_BaseMeasureDrawable.MAJOR_COLOR,e.strokeStyle=_BaseMeasureDrawable.MINOR_COLOR,e.lineWidth=_BaseMeasureDrawable.LINE_WIDTH,e.beginPath(),r.forEach((r=>{const i=this.transToScreenCoord(r,t);e.moveTo(i.x+_BaseMeasureDrawable.POINT_RADIUS,i.y),e.arc(i.x,i.y,_BaseMeasureDrawable.POINT_RADIUS,0,2*Math.PI)})),e.closePath(),e.fill(),e.stroke(),e.restore()} // eslint-disable-next-line @typescript-eslint/no-unused-vars drawText(e,t){if(!this.label||!this.labelPositon)return;e.font=`${_BaseMeasureDrawable.LABEL_FONT_SIZE}px Arial`;const r=1.2*e.measureText(this.label).width,i=1.5*_BaseMeasureDrawable.LABEL_FONT_SIZE;this.labelBounds.setFromCenterAndSize(this.labelPositon,new Vector2(r,i)),this.drawRoundRect(e,this.labelPositon.x-r/2,this.labelPositon.y-i/2,r,i,4),e.save(),e.fillStyle=_BaseMeasureDrawable.MINOR_COLOR,e.textBaseline="middle",e.textAlign="center",e.fillText(this.label,this.labelPositon.x,this.labelPositon.y),e.restore()}drawRoundRect(e,t,r,i,n,s){i<2*s&&(s=i/2),n<2*s&&(s=n/2),e.save(),e.fillStyle=_BaseMeasureDrawable.MAJOR_COLOR,e.strokeStyle=_BaseMeasureDrawable.MINOR_COLOR,e.lineWidth=_BaseMeasureDrawable.LINE_WIDTH,e.beginPath(),e.moveTo(t+s,r),e.arcTo(t+i,r,t+i,r+n,s),e.arcTo(t+i,r+n,t,r+n,s),e.arcTo(t,r+n,t,r,s),e.arcTo(t,r,t+i,r,s),e.closePath(),e.fill(),this.selected&&e.stroke(),e.restore()}getVertexs(){return this.points}update(e){const{min:t,max:r}=(new Box3).setFromPoints(e);return this.x=t.x,this.y=t.y,this.width=Math.abs(r.x-t.x),this.height=Math.abs(r.y-t.y),this.points=e,this}getBounds(){const e=this.getVertexs();return(new Box3).setFromPoints(e)}getData(){return{id:this.id,type:this.type, // must the same as class type points:this.points.map((e=>[e.x,e.y,e.z]))}}setData(e){super.setData(e),this.setLineColor(_BaseMeasureDrawable.MAJOR_COLOR),this.setFillColor(_BaseMeasureDrawable.AREA_FILL_COLOR),this.setLineWidth(_BaseMeasureDrawable.LINE_WIDTH)}isPointInPath(e,t){const r=null==t?void 0:t.ray;if(!r)return!1;const i=3*this.tolerance,n=this.transToScreenCoord(e,t.camera);if(this.labelBounds.containsPoint(n))return!0;const s=new Vector3,a=new Vector3,o=this.points;for(let e=0;e(e.Distance="Distance",e.Area="Area",e.Angle="Angle",e.Coordinate="Coordinate",e))(MeasurementType||{}),BaseMeasurement=class extends Event{constructor(e,t,r,i){super(), // protected markersRaycaster = new THREE.Raycaster(); // used to raycaster measurements this.mouseMoved=!1,this.mouseDowned=!1,this.mouseDownPositionX=-1, // -1 means invalid point this.mouseDownPositionY=-1,this.tempEdgeMaterial=new LineBasicMaterial({color:16711680}),this.snapPoint=void 0,this.mousedown=e=>{const t=CoordinateConversionUtils.getScreenPointByEvent(e,this.canvas);this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y,this.mouseMoved=!1,this.mouseDowned=!0},this.mousemove=e=>{if(this.lastMoveEvent=e,this.mouseDownPositionX>=0&&this.mouseDownPositionY>=0){const t=5;(Math.abs(e.offsetX-this.mouseDownPositionX)>t||Math.abs(e.offsetY-this.mouseDownPositionY)>t)&&(this.mouseMoved=!0)}if(this.mouseDowned)return;const t=this.getIntersections(e);if(!t.length)return;const r=Date.now();this.handleSnap(t),log.debug(`[BaseMeasurement] this.handleSnap costs ${(Date.now()-r)/1e3}s`),this.onMouseMove(this.snapPoint),this.viewer.enableRender()},this.mouseup=e=>{0===e.buttons&&(this.mouseDowned=!1),this.mouseMoved||this.onMouseClick(e)},this.dblclick=()=>{log.info("[Measure] Double clicked")},this.keydown=e=>{if("Enter"===e.code){const e=new MouseEvent("pointerup",{button:MOUSE.RIGHT});this.onMouseClick(e)}else"Escape"===e.code&&this.cancel()}, /** * The closest intersection * @param e */ this.getIntersections=e=>{if(!this.raycaster)return[];this.raycaster&&this.raycaster.layers.disable(layerForNonSnapableObjects);const t=this.viewer.getRaycastableObjectsByMouse(e);log.debug(`[BaseMeasurement] The count of raycastable object is ${t.length}`,t);const r=Date.now(),i=this.raycaster.intersectObjects(t,!0)||[];return log.debug(`[BaseMeasurement] this.raycaster.intersectObjects costs ${(Date.now()-r)/1e3}s`),i},this.type=e,this.viewer=t,this.drawList=r,this.osnapHelper=i}get canvas(){var e;return null==(e=this.viewer.renderer)?void 0:e.domElement}get camera(){return this.viewer.camera} /** * If measurement is active. * Here let's use raycaster to identify whether this measurement is active. */get isActive(){return!!this.raycaster} /** * If it started to measure, but a measruement action is not completed yet. */get isMeasuring(){return this.isActive&&!this.completed}activate(){this.canvas.addEventListener("pointerdown",this.mousedown),this.canvas.addEventListener("pointermove",this.mousemove),this.canvas.addEventListener("pointerup",this.mouseup),this.canvas.addEventListener("dblclick",this.dblclick),window.addEventListener("keydown",this.keydown);const e=this.viewer.translate;if(e){this.tooltip=new Tooltip("measure-tooltip",e("Tooltip.measure"),{followPointer:!0,showOnCreate:!0,parentNode:this.viewer.widgetContainer,target:this.canvas});const t=document.getElementById("measure-tooltip");t&&(t.style.pointerEvents="none")}this.setTooltipContent(),this.raycaster=this.viewer.getRaycaster()}deactivate(){var e,t;const r=this.canvas;r&&(r.removeEventListener("pointerdown",this.mousedown),r.removeEventListener("pointermove",this.mousemove),r.removeEventListener("pointerup",this.mouseup),r.removeEventListener("dblclick",this.dblclick)),window.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)}clearClickedDrawable(){this.clickedOnMeasurementDrawable&&(this.clickedOnMeasurementDrawable.selected=!1,this.clickedOnMeasurementDrawable=void 0)} // eslint-disable-next-line onMouseClick(e){const t=Date.now();if(!(this.lastClickTime&&t-this.lastClickTime<500)&&(this.lastClickTime=t,this.clickedOnMeasurementDrawable=void 0,null==this.completed||!0===this.completed)){const t=this.getIntersections(e)[0];if(t){const e=this.drawList.getDrawableByPosition(t.point,this.raycaster);e&&(this.dispatchEvent("clickedonmeasurement",e),this.clickedOnMeasurementDrawable=e)}}}getIntersectsOutline(e){var t,r;const i=[];for(let r=0;re instanceof Points?0:e instanceof LineSegments?2:e instanceof Line?1:3;n.sort(((t,r)=>{const i=e(t.object),n=e(r.object);return i!==n?i-n:t.distance-r.distance}))}}n=this.getIntersectsOutline(n),log.debug("[BaseMeasurement] filteredIntersections:",n),this.snapPoint=(null==(r=this.osnapHelper.handleSnap(i,n,this.viewer.is3d(),this.lastMouseDownPosition))?void 0:r.clone())||e[0].point.clone(),this.snapPoint||(this.viewer.is3d()?this.snapPoint=e[0].point:this.snapPoint=i)}}; // node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof2(e){return(_typeof2="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)} // node_modules/@babel/runtime/helpers/esm/classCallCheck.js function _classCallCheck2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")} // node_modules/@babel/runtime/helpers/esm/createClass.js function _defineProperties2(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,i=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck2(this,e),this.init(t,r)}return _createClass2(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||consoleLogger,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),r=0;r1?t-1:0),i=1;i-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=i(s.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return n()?{}:{obj:e,k:i(s.shift())}}function setPath(e,t,r){var i=getLastOfPath(e,t,Object);i.obj[i.k]=r}function pushPath(e,t,r,i){var n=getLastOfPath(e,t,Object),s=n.obj,a=n.k;s[a]=s[a]||[],i&&(s[a]=s[a].concat(r)),i||s[a].push(r)}function getPath(e,t){var r=getLastOfPath(e,t),i=r.obj,n=r.k;if(i)return i[n]}function getPathWithDefaults(e,t,r){var i=getPath(e,r);return void 0!==i?i:getPath(t,r)}function deepExtend(e,t,r){for(var i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof t[i]||t[i]instanceof String?r&&(e[i]=t[i]):deepExtend(e[i],t[i],r):e[i]=t[i]);return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape2(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]})):e}var isIE10="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,r){t=t||"",r=r||"";var i=chars.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===i.length)return!0;var n=new RegExp("(".concat(i.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),s=!n.test(e);if(!s){var a=e.indexOf(r);a>0&&!n.test(e.substring(0,a))&&(s=!0)}return s}function ownKeys$1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$1(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var i=t.split(r),n=e,s=0;ss+a;)a++,l=n[o=i.slice(s,s+a).join(r)];if(void 0===l)return;if(t.endsWith(o)){if("string"==typeof l)return l;if(o&&"string"==typeof l[o])return l[o]}var c=i.slice(s+a).join(r);return c?deepFind(l,c,r):void 0}n=n[i[s]]}return n}}var ResourceStore=function(e){_inherits(r,EventEmitter);var t=_createSuper(r);function r(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck2(this,r),i=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(i)),i.data=e||{},i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),void 0===i.options.ignoreJSONStructure&&(i.options.ignoreJSONStructure=!0),i}return _createClass2(r,[{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,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];r&&"string"!=typeof r&&(a=a.concat(r)),r&&"string"==typeof r&&(a=a.concat(n?r.split(n):r)),e.indexOf(".")>-1&&(a=e.split("."));var o=getPath(this.data,a);return o||!s||"string"!=typeof r?o:deepFind(this.data&&this.data[e]&&this.data[e][t],r,n)}},{key:"addResource",value:function(e,t,r,i){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];r&&(a=a.concat(s?r.split(s):r)),e.indexOf(".")>-1&&(i=t,t=(a=e.split("."))[1]),this.addNamespaces(t),setPath(this.data,a,i),n.silent||this.emit("added",e,t,r,i)}},{key:"addResources",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in r)"string"!=typeof r[n]&&"[object Array]"!==Object.prototype.toString.apply(r[n])||this.addResource(e,t,n,r[n],{silent:!0});i.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,i,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(i=r,r=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var o=getPath(this.data,a)||{};i?deepExtend(o,r,n):o=_objectSpread$1(_objectSpread$1({},o),r),setPath(this.data,a,o),s.silent||this.emit("added",e,t,r)}},{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?_objectSpread$1(_objectSpread$1({},{}),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}}]),r}(),postProcessor={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,i,n){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,r,i,n))})),t}};function ownKeys$2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$2(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck2(this,r),i=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(i)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(i)),i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=baseLogger.create("translator"),i}return _createClass2(r,[{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 r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,n=t.ns||this.options.defaultNS||[],s=r&&e.indexOf(r)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||looksLikeObjectPath(e,r,i));if(s&&!a){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:n};var l=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(l[0])>-1)&&(n=l.shift()),e=l.join(i)}return"string"==typeof n&&(n=[n]),{key:e,namespaces:n}}},{key:"translate",value:function(e,t,i){var n=this;if("object"!==_typeof2(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,c=o.namespaces,u=c[c.length-1],h=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(p){var d=t.nsSeparator||this.options.nsSeparator;return s?(m.res="".concat(u).concat(d).concat(l),m):"".concat(u).concat(d).concat(l)}return s?(m.res=l,m):l}var m=this.resolve(e,t),f=m&&m.res,g=m&&m.usedKey||l,_=m&&m.exactUsedKey||l,y=Object.prototype.toString.apply(f),T=["[object Number]","[object Function]","[object RegExp]"],v=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,I="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(E&&f&&I&&T.indexOf(y)<0&&("string"!=typeof v||"[object Array]"!==y)){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,f,_objectSpread$2(_objectSpread$2({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return s?(m.res=b,m):b}if(a){var x="[object Array]"===y,S=x?[]:{},w=x?_:g;for(var C in f)if(Object.prototype.hasOwnProperty.call(f,C)){var M="".concat(w).concat(a).concat(C);S[C]=this.translate(M,_objectSpread$2(_objectSpread$2({},t),{joinArrays:!1,ns:c})),S[C]===M&&(S[C]=f[C])}f=S}}else if(E&&"string"==typeof v&&"[object Array]"===y)(f=f.join(v))&&(f=this.extendTranslation(f,e,t,i));else{var R=!1,A=!1,D=void 0!==t.count&&"string"!=typeof t.count,O=r.hasDefaultValue(t),L=D?this.pluralResolver.getSuffix(h,t.count,t):"",P=t["defaultValue".concat(L)]||t.defaultValue;!this.isValidLookup(f)&&O&&(R=!0,f=P),this.isValidLookup(f)||(A=!0,f=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,F=N&&A?void 0:f,U=O&&P!==f&&this.options.updateMissing;if(A||R||U){if(this.logger.log(U?"updateKey":"missingKey",h,u,l,U?P:f),a){var B=this.resolve(l,_objectSpread$2(_objectSpread$2({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var k=[],G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&G&&G[0])for(var V=0;V1&&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),c=l.key;r=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var h=void 0!==o.count&&"string"!=typeof o.count,p=h&&!o.ordinal&&0===o.count&&a.pluralResolver.shouldUseIntlApi(),d=void 0!==o.context&&("string"==typeof o.context||"number"==typeof o.context)&&""!==o.context,m=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(s=e,!checkedLoadedFor["".concat(m[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(s)&&(checkedLoadedFor["".concat(m[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(r,'" for languages "').concat(m.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!!!")),m.forEach((function(r){if(!a.isValidLookup(t)){n=r;var s,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,r,e,o);else{var u;h&&(u=a.pluralResolver.getSuffix(r,o.count,o));var m="_zero";if(h&&(l.push(c+u),p&&l.push(c+m)),d){var f="".concat(c).concat(a.options.contextSeparator).concat(o.context);l.push(f),h&&(l.push(f+u),p&&l.push(f+m))}}for(;s=l.pop();)a.isValidLookup(t)||(i=s,t=a.getResource(r,e,s,o))}})))}))}})),{res:t,usedKey:r,exactUsedKey:i,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,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,i):this.resourceStore.getResource(e,t,r,i)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}();function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck2(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass2(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||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"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=capitalize(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=capitalize(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=capitalize(r[2].toLowerCase()))),r.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,r=this;return e?(e.forEach((function(e){if(!t){var i=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(i)||(t=i)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var i=r.getLanguagePartFromCode(e);if(r.isSupportedCode(i))return t=i;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(i))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],s=function(e){e&&(r.isSupportedCode(e)?n.push(e):r.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)),i.forEach((function(e){n.indexOf(e)<0&&s(r.formatLanguageCode(e))})),n}}]),e}(),sets=[{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}],_rulesPluralsTypes={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)}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};return sets.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))})),e}var PluralResolver=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck2(this,e),this.languageUtils=t,this.options=r,this.logger=baseLogger.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=createRules()}return _createClass2(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]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(e,r);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):i.numbers.map((function(i){return t.getSuffix(e,i,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getRule(e,r);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(t)):this.getSuffixRetroCompatible(i,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));var s=function(){return r.options.prepend&&n.toString()?r.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&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),e}();function ownKeys$3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$3(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck2(this,e),this.logger=baseLogger.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return _createClass2(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:escape2,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?regexEscape(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?regexEscape(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?regexEscape(t.nestingPrefix):t.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=t.nestingSuffix?regexEscape(t.nestingSuffix):t.nestingSuffixEscaped||regexEscape(")"),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 r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,i){var n,s,a,o=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(o.formatSeparator)<0){var n=getPathWithDefaults(t,l,e);return o.alwaysFormat?o.format(n,void 0,r,_objectSpread$3(_objectSpread$3(_objectSpread$3({},i),t),{},{interpolationkey:e})):n}var s=e.split(o.formatSeparator),a=s.shift().trim(),c=s.join(o.formatSeparator).trim();return o.format(getPathWithDefaults(t,l,a),c,r,_objectSpread$3(_objectSpread$3(_objectSpread$3({},i),t),{},{interpolationkey:a}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return o.escapeValue?c(o.escape(e)):c(e)}}].forEach((function(t){for(a=0;n=t.regex.exec(e);){var r=n[1].trim();if(void 0===(s=u(r)))if("function"==typeof h){var l=h(e,n,i);s="string"==typeof l?l:""}else if(i&&i.hasOwnProperty(r))s="";else{if(p){s=n[0];continue}o.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),s=""}else"string"==typeof s||o.useRawValueToEscape||(s=makeString(s));var c=t.safeValue(s);if(e=e.replace(n[0],c),p?(t.regex.lastIndex+=c.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,++a>=o.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,i,n=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=_objectSpread$3({},s);function o(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var i=e.split(new RegExp("".concat(r,"[ ]*{"))),n="{".concat(i[1]);e=i[0],n=(n=this.interpolate(n,a)).replace(/'/g,'"');try{a=JSON.parse(n),t&&(a=_objectSpread$3(_objectSpread$3({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(n)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;r=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var u=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=u.shift(),l=u,c=!0}if((i=t(o.call(this,r[1].trim(),a),a))&&r[0]===e&&"string"!=typeof i)return i;"string"!=typeof i&&(i=makeString(i)),i||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),i=""),c&&(i=l.reduce((function(e,t){return n.format(e,t,s.lng,_objectSpread$3(_objectSpread$3({},s),{},{interpolationkey:r[1].trim()}))}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}]),e}();function ownKeys$4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$4(e){for(var t=1;t-1){var i=e.split("(");t=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if("currency"===t&&n.indexOf(":")<0)r.currency||(r.currency=n.trim());else if("relativetime"===t&&n.indexOf(":")<0)r.range||(r.range=n.trim());else{n.split(";").forEach((function(e){if(e){var t=_toArray(e.split(":")),i=t[0],n=t.slice(1).join(":");r[i.trim()]||(r[i.trim()]=n.trim()),"false"===n.trim()&&(r[i.trim()]=!1),"true"===n.trim()&&(r[i.trim()]=!0),isNaN(n.trim())||(r[i.trim()]=parseInt(n.trim(),10))}}))}}return{formatName:t,formatOptions:r}}var Formatter=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck2(this,e),this.logger=baseLogger.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,_objectSpread$4(_objectSpread$4({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,_objectSpread$4({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,_objectSpread$4({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,_objectSpread$4({},r)).format(e)}},this.init(t)}return _createClass2(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,i){var n=this;return t.split(this.formatSeparator).reduce((function(e,t){var s=parseFormatStr(t),a=s.formatName,o=s.formatOptions;if(n.formats[a]){var l=e;try{var c=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},u=c.locale||c.lng||i.locale||i.lng||r;l=n.formats[a](e,u,_objectSpread$4(_objectSpread$4(_objectSpread$4({},o),i),c))}catch(e){n.logger.warn(e)}return l}return n.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function ownKeys$5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$5(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return _classCallCheck2(this,r),s=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(s)),s.backend=e,s.store=i,s.services=n,s.languageUtils=n.languageUtils,s.options=a,s.logger=baseLogger.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(n,a.backend,a),s}return _createClass2(r,[{key:"queueLoad",value:function(e,t,r,i){var n=this,s={},a={},o={},l={};return e.forEach((function(e){var i=!0;t.forEach((function(t){var o="".concat(e,"|").concat(t);!r.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,i=!1,void 0===a[o]&&(a[o]=!0),void 0===s[o]&&(s[o]=!0),void 0===l[t]&&(l[t]=!0)))})),i||(o[e]=!0)})),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,r){var i=e.split("|"),n=i[0],s=i[1];t&&this.emit("failedLoading",n,s,t),r&&this.store.addResourceBundle(n,s,r),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(r){pushPath(r.loaded,[n],s),removePending(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){a[e]||(a[e]={});var t=Object.keys(a[e]);t.length&&t.forEach((function(r){void 0!==t[r]&&(a[e][r]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var i=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:s,callback:a}):(this.readingCalls++,this.backend[r](e,t,(function(o,l){if(o&&l&&n<5)setTimeout((function(){i.read.call(i,e,t,r,n+1,2*s,a)}),s);else{if(i.readingCalls--,i.waitingReads.length>0){var c=i.waitingReads.shift();i.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a(o,l)}}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,i=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,i,n);if(!s.toLoad.length)return s.pending.length||n(),null;s.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.split("|"),n=i[0],s=i[1];this.read(n,s,"read",void 0,void 0,(function(i,a){i&&t.logger.warn("".concat(r,"loading namespace ").concat(s," for language ").concat(n," failed"),i),!i&&a&&t.logger.log("".concat(r,"loaded namespace ").concat(s," for language ").concat(n),a),t.loaded(e,i,a)}))}},{key:"saveMissing",value:function(e,t,r,i,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(r,'" 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!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,i,null,_objectSpread$5(_objectSpread$5({},s),{},{isUpdate:n})),e&&e[0]&&this.store.addResource(e[0],t,r,i))}}]),r}();function get(){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"===_typeof2(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===_typeof2(e[2])||"object"===_typeof2(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(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 ownKeys$6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function _objectSpread$6(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(_classCallCheck2(this,r),e=t.call(this),isIE10&&EventEmitter.call(_assertThisInitialized(e)),e.options=transformOptions(i),e.services={},e.logger=baseLogger,e.modules={external:[]},bindMemberFunctions(_assertThisInitialized(e)),n&&!e.isInitialized&&!i.isClone){if(!e.options.initImmediate)return e.init(i,n),_possibleConstructorReturn(e,_assertThisInitialized(e));setTimeout((function(){e.init(i,n)}),0)}return e}return _createClass2(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var i=get();function n(e){return e?"function"==typeof e?new e:e:null}if(this.options=_objectSpread$6(_objectSpread$6(_objectSpread$6({},i),this.options),transformOptions(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_objectSpread$6(_objectSpread$6({},i.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?baseLogger.init(n(this.modules.logger),this.options):baseLogger.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=Formatter);var a=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var o=this.services;o.logger=baseLogger,o.resourceStore=this.store,o.languageUtils=a,o.pluralResolver=new PluralResolver(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==i.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 Interpolator(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Connector(n(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n1?r-1:0),n=1;n0&&"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");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var h=defer(),p=function(){var t=function(t,i){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(i),r(t,i)};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?p():setTimeout(p,0),h}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,i=r,n="string"==typeof e?e:this.language;if("function"==typeof e&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return i();var s=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};if(n)a(n);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(s,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,r){var i=defer();return e||(e=this.languages),t||(t=this.options.ns),r||(r=noop),this.services.backendConnector.reload(e,t,(function(e){i.resolve(),r(e)})),i}},{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&&postProcessor.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-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var i=defer();this.emit("languageChanging",e);var n=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},s=function(s){e||s||!r.services.languageDetector||(s=[]);var a="string"==typeof s?s:r.services.languageUtils.getBestMatchFromCodes(s);a&&(r.language||n(a),r.translator.language||r.translator.changeLanguage(a),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(a)),r.loadResources(a,(function(e){!function(e,s){s?(n(s),r.translator.changeLanguage(s),r.isLanguageChangingTo=void 0,r.emit("languageChanged",s),r.logger.log("languageChanged",s)):r.isLanguageChangingTo=void 0,i.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,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()),i}},{key:"getFixedT",value:function(e,t,r){var i=this,n=function e(t,n){var s;if("object"!==_typeof2(n)){for(var a=arguments.length,o=new Array(a>2?a-2:0),l=2;l1&&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 i=this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function(e,r){var i=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===i||2===i};if(r.precheck){var o=r.precheck(this,a);if(void 0!==o)return o}return!!this.hasResourceBundle(i,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(i,e)||n&&!a(s,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,i=defer();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=defer();"string"==typeof e&&(e=[e]);var i=this.options.preload||[],n=e.filter((function(e){return i.indexOf(e)<0}));return n.length?(this.options.preload=i.concat(n),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,n=_objectSpread$6(_objectSpread$6(_objectSpread$6({},this.options),t),{isClone:!0}),s=new r(n),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.services=_objectSpread$6({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new Translator(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new I18n(e,t)}));var instance=I18n.createInstance();instance.createInstance=I18n.createInstance;var createInstance=instance.createInstance,init=instance.init,loadResources=instance.loadResources,reloadResources=instance.reloadResources,use=instance.use,changeLanguage=instance.changeLanguage,getFixedT=instance.getFixedT,t=instance.t,exists=instance.exists,setDefaultNamespace=instance.setDefaultNamespace,hasLoadedNamespace=instance.hasLoadedNamespace,loadNamespaces=instance.loadNamespaces,loadLanguages=instance.loadLanguages,i18next_default=instance,_changeEvent={type:"change"},_startEvent={type:"start"},_endEvent={type:"end"},OrbitControls=class extends EventDispatcher{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:MOUSE.ROTATE,MIDDLE:MOUSE.DOLLY,RIGHT:MOUSE.PAN},this.touches={ONE:TOUCH.ROTATE,TWO:TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(e){e.addEventListener("keydown",j),this._domElementKeyEvents=e},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(_changeEvent),r.update(),n=i.NONE},this.update=function(){const t=new Vector3,h=(new Quaternion).setFromUnitVectors(e.up,new Vector3(0,1,0)),p=h.clone().invert(),d=new Vector3,m=new Quaternion,f=2*Math.PI;return function(){const e=r.object.position;t.copy(e).sub(r.target),t.applyQuaternion(h),a.setFromVector3(t),r.autoRotate&&n===i.NONE&&b(2*Math.PI/60/60*r.autoRotateSpeed),r.enableDamping?(a.theta+=o.theta*r.dampingFactor,a.phi+=o.phi*r.dampingFactor):(a.theta+=o.theta,a.phi+=o.phi);let g=r.minAzimuthAngle,_=r.maxAzimuthAngle;return isFinite(g)&&isFinite(_)&&(g<-Math.PI?g+=f:g>Math.PI&&(g-=f),_<-Math.PI?_+=f:_>Math.PI&&(_-=f),a.theta=g<=_?Math.max(g,Math.min(_,a.theta)):a.theta>(g+_)/2?Math.max(g,a.theta):Math.min(_,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=l,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),!0===r.enableDamping?r.target.addScaledVector(c,r.dampingFactor):r.target.add(c),t.setFromSpherical(a),t.applyQuaternion(p),e.copy(r.target).add(t),r.object.lookAt(r.target),!0===r.enableDamping?(o.theta*=1-r.dampingFactor,o.phi*=1-r.dampingFactor,c.multiplyScalar(1-r.dampingFactor)):(o.set(0,0,0),c.set(0,0,0)),l=1,!!(u||d.distanceToSquared(r.object.position)>s||8*(1-m.dot(r.object.quaternion))>s)&&(r.dispatchEvent(_changeEvent),d.copy(r.object.position),m.copy(r.object.quaternion),u=!1,!0)}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",z),r.domElement.removeEventListener("pointerdown",B),r.domElement.removeEventListener("pointercancel",V),r.domElement.removeEventListener("wheel",H),r.domElement.removeEventListener("pointermove",k),r.domElement.removeEventListener("pointerup",G),null!==r._domElementKeyEvents&&r._domElementKeyEvents.removeEventListener("keydown",j)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let n=i.NONE;const s=1e-6,a=new Spherical,o=new Spherical;let l=1;const c=new Vector3;let u=!1;const h=new Vector2,p=new Vector2,d=new Vector2,m=new Vector2,f=new Vector2,g=new Vector2,_=new Vector2,y=new Vector2,T=new Vector2,v=[],E={};function I(){return Math.pow(.95,r.zoomSpeed)}function b(e){o.theta-=e}function x(e){o.phi-=e}const S=function(){const e=new Vector3;return function(t,r){e.setFromMatrixColumn(r,0),e.multiplyScalar(-t),c.add(e)}}(),w=function(){const e=new Vector3;return function(t,i){!0===r.screenSpacePanning?e.setFromMatrixColumn(i,1):(e.setFromMatrixColumn(i,0),e.crossVectors(r.object.up,e)),e.multiplyScalar(t),c.add(e)}}(),C=function(){const e=new Vector3;return function(t,i){const n=r.domElement;if(r.object.isPerspectiveCamera){const s=r.object.position;e.copy(s).sub(r.target);let a=e.length();a*=Math.tan(r.object.fov/2*Math.PI/180),S(2*t*a/n.clientHeight,r.object.matrix),w(2*i*a/n.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(S(t*(r.object.right-r.object.left)/r.object.zoom/n.clientWidth,r.object.matrix),w(i*(r.object.top-r.object.bottom)/r.object.zoom/n.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function M(e){r.object.isPerspectiveCamera?l/=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function R(e){r.object.isPerspectiveCamera?l*=e:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function A(e){h.set(e.clientX,e.clientY)}function D(e){m.set(e.clientX,e.clientY)}function O(){if(1===v.length)h.set(v[0].pageX,v[0].pageY);else{const e=.5*(v[0].pageX+v[1].pageX),t=.5*(v[0].pageY+v[1].pageY);h.set(e,t)}}function L(){if(1===v.length)m.set(v[0].pageX,v[0].pageY);else{const e=.5*(v[0].pageX+v[1].pageX),t=.5*(v[0].pageY+v[1].pageY);m.set(e,t)}}function P(){const e=v[0].pageX-v[1].pageX,t=v[0].pageY-v[1].pageY,r=Math.sqrt(e*e+t*t);_.set(0,r)}function N(e){if(1==v.length)p.set(e.pageX,e.pageY);else{const t=Y(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);p.set(r,i)}d.subVectors(p,h).multiplyScalar(r.rotateSpeed);const t=r.domElement;b(2*Math.PI*d.x/t.clientHeight),x(2*Math.PI*d.y/t.clientHeight),h.copy(p)}function F(e){if(1===v.length)f.set(e.pageX,e.pageY);else{const t=Y(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);f.set(r,i)}g.subVectors(f,m).multiplyScalar(r.panSpeed),C(g.x,g.y),m.copy(f)}function U(e){const t=Y(e),i=e.pageX-t.x,n=e.pageY-t.y,s=Math.sqrt(i*i+n*n);y.set(0,s),T.set(0,Math.pow(y.y/_.y,r.zoomSpeed)),M(T.y),_.copy(y)}function B(e){!1!==r.enabled&&(0===v.length&&(r.domElement.setPointerCapture(e.pointerId),r.domElement.addEventListener("pointermove",k),r.domElement.addEventListener("pointerup",G)),function(e){v.push(e)}(e),"touch"===e.pointerType?function(e){switch(W(e),v.length){case 1:switch(r.touches.ONE){case TOUCH.ROTATE:if(!1===r.enableRotate)return;O(),n=i.TOUCH_ROTATE;break;case TOUCH.PAN:if(!1===r.enablePan)return;L(),n=i.TOUCH_PAN;break;default:n=i.NONE}break;case 2:switch(r.touches.TWO){case TOUCH.DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;r.enableZoom&&P(),r.enablePan&&L(),n=i.TOUCH_DOLLY_PAN;break;case TOUCH.DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;r.enableZoom&&P(),r.enableRotate&&O(),n=i.TOUCH_DOLLY_ROTATE;break;default:n=i.NONE}break;default:n=i.NONE}n!==i.NONE&&r.dispatchEvent(_startEvent)}(e):function(e){let t;switch(e.button){case 0:t=r.mouseButtons.LEFT;break;case 1:t=r.mouseButtons.MIDDLE;break;case 2:t=r.mouseButtons.RIGHT;break;default:t=-1}switch(t){case MOUSE.DOLLY:if(!1===r.enableZoom)return;!function(e){_.set(e.clientX,e.clientY)}(e),n=i.DOLLY;break;case MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===r.enablePan)return;D(e),n=i.PAN}else{if(!1===r.enableRotate)return;A(e),n=i.ROTATE}break;case MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===r.enableRotate)return;A(e),n=i.ROTATE}else{if(!1===r.enablePan)return;D(e),n=i.PAN}break;default:n=i.NONE}n!==i.NONE&&r.dispatchEvent(_startEvent)}(e))}function k(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){switch(W(e),n){case i.TOUCH_ROTATE:if(!1===r.enableRotate)return;N(e),r.update();break;case i.TOUCH_PAN:if(!1===r.enablePan)return;F(e),r.update();break;case i.TOUCH_DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){r.enableZoom&&U(e),r.enablePan&&F(e)}(e),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;!function(e){r.enableZoom&&U(e),r.enableRotate&&N(e)}(e),r.update();break;default:n=i.NONE}}(e):function(e){switch(n){case i.ROTATE:if(!1===r.enableRotate)return;!function(e){p.set(e.clientX,e.clientY),d.subVectors(p,h).multiplyScalar(r.rotateSpeed);const t=r.domElement;b(2*Math.PI*d.x/t.clientHeight),x(2*Math.PI*d.y/t.clientHeight),h.copy(p),r.update()}(e);break;case i.DOLLY:if(!1===r.enableZoom)return;!function(e){y.set(e.clientX,e.clientY),T.subVectors(y,_),T.y>0?M(I()):T.y<0&&R(I()),_.copy(y),r.update()}(e);break;case i.PAN:if(!1===r.enablePan)return;!function(e){f.set(e.clientX,e.clientY),g.subVectors(f,m).multiplyScalar(r.panSpeed),C(g.x,g.y),m.copy(f),r.update()}(e)}}(e))}function G(e){q(e),0===v.length&&(r.domElement.releasePointerCapture(e.pointerId),r.domElement.removeEventListener("pointermove",k),r.domElement.removeEventListener("pointerup",G)),r.dispatchEvent(_endEvent),n=i.NONE}function V(e){q(e)}function H(e){!1!==r.enabled&&!1!==r.enableZoom&&n===i.NONE&&(e.preventDefault(),r.dispatchEvent(_startEvent),function(e){e.deltaY<0?R(I()):e.deltaY>0&&M(I()),r.update()}(e),r.dispatchEvent(_endEvent))}function j(e){!1!==r.enabled&&!1!==r.enablePan&&function(e){let t=!1;switch(e.code){case r.keys.UP:C(0,r.keyPanSpeed),t=!0;break;case r.keys.BOTTOM:C(0,-r.keyPanSpeed),t=!0;break;case r.keys.LEFT:C(r.keyPanSpeed,0),t=!0;break;case r.keys.RIGHT:C(-r.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),r.update())}(e)}function z(e){!1!==r.enabled&&e.preventDefault()}function q(e){delete E[e.pointerId];for(let t=0;ti.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*i.far),console.warn("[BimViewer] camera could be too far to see the object!"))}const s=i.position.clone(),a=n.target.clone(),o=this.flyDuration,l=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let c=Date.now()-l;c>o&&(c=o);const u=(e,t,r)=>{const i=e.x+(t.x-e.x)*r,n=e.y+(t.y-e.y)*r,s=e.z+(t.z-e.z)*r;return new Vector3(i,n,s)};((e,t)=>{i.lookAt(t),i.position.set(e.x,e.y,e.z),n.target.set(t.x,t.y,t.z),n.update()})(u(s,e,c/o),u(a,t,c/o)),c>=o&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0,r&&r())}),10)} /** * Adjusts camera direction to look to a certain position. While, * it doesn't mean to set the target position as camera's target. */lookTo(e){const t=this.camera,r=this.controls;if(!t||!r)return;const i=t.position,n=r.target.distanceTo(i),s=e.normalize().multiplyScalar(n),a=new Vector3(i.x+s.x,i.y+s.y,i.z+s.z);this.flyTo(i,a)}startAutoRotate(){const e=this.camera,t=this.controls;if(!e||!t)return;t.autoRotate=!0;const r=new Vector3;e.getWorldPosition(r);const i=t.target;if(i.y===r.y)return;const n=(i.y-r.y)/50;for(let e=0;e<50;++e)setTimeout((()=>{const e=t.target.y-n;t.target.setY(e),t.update()}),30*e)}delayAutoRotate(){this.autoRotateRemainingTime=5e3,this.controls&&(this.controls.autoRotate=!1)}startToRotate(e){const 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){const r=this.controls;if(!this.camera||!r)return;const i=this.camera.position,n=r.target,s=n.clone();let a=Math.PI*e/180;t&&(a=-a),s.x=(n.x-i.x)*Math.cos(a)-(n.z-i.z)*Math.sin(a)+i.x,s.z=(n.z-i.z)*Math.cos(a)+(n.x-i.x)*Math.sin(a)+i.z,this.camera.lookAt(s),r.target=s,r.update()}rotateUpOrDown(e,t=!0){const r=this.controls;if(!this.camera||!r)return;const i=this.camera.position,n=r.target,s=n.clone();let a=Math.PI*e/180;const o=new Vector3(n.x-i.x,n.y-i.y,n.z-i.z).length(),l=n.y-i.y;t||(a=-a);const c=Math.asin(l/o)+a;if(c<-Math.PI/2||c>Math.PI/2)return;const u=Math.sin(c)*o;s.y=n.y+(u-l),r.target=s,r.update()}},STATE=(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))(STATE||{}),Keys=(e=>(e.LEFT="ArrowLeft",e.UP="ArrowUp",e.RIGHT="ArrowRight",e.BOTTOM="ArrowDown",e))(Keys||{});function dispatchEventType(e){return{type:e}}var touchInfo={movable:!1,startDistBetweenFingers:0,scale:1},twoPI=2*Math.PI,EPS=1e-6,VRControls2=class extends EventDispatcher{constructor(e,t,r=!1){var i;super(),this.enabled=!0, // "target" sets the location of focus, where the object orbits around this.target=new Vector3,this.enableZoom=!1,this.enablePan=!1,this.enableRotate=!0,this.state=-1/* NONE */,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, // radians this.maxAzimuthAngle=1/0, // radians 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 Vector3,this.pointerPositions={},this.rotateStart=new Vector2,this.rotateEnd=new Vector2,this.rotateDelta=new Vector2,this.dollyStart=new Vector2,this.dollyEnd=new Vector2,this.dollyDelta=new Vector2,this.panStart=new Vector2,this.panEnd=new Vector2,this.panDelta=new Vector2,this.pointers=[],this.spherical=new Spherical,this.sphericalDelta=new Spherical,this.update=function(e){const t=new Vector3,r=new Vector3,i=new Quaternion;return function(){const 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/* NONE */===e.state&&(e.isVRMode?e.sphericalDelta.theta+=twoPI/60/60*e.autoRotateSpeed:e.sphericalDelta.theta-=twoPI/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+=twoPI:o>Math.PI&&(o-=twoPI),l<-Math.PI?l+=twoPI:l>Math.PI&&(l-=twoPI),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||r.distanceToSquared(e.object.position)>EPS||8*(1-i.dot(e.object.quaternion))>EPS)&&(e.dispatchEvent(dispatchEventType("change")),r.copy(e.object.position),i.copy(e.object.quaternion),e.zoomChanged=!1,!0)}}(this),this.onContextMenu=(i=this,e=>{!1!==i.enabled&&e.preventDefault()}),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(dispatchEventType("end")),e.state=-1/* NONE */}}(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/* NONE */===e.state&&(t.preventDefault(),t.stopPropagation(),e.dispatchEvent(dispatchEventType("start")),e.handleMouseWheel(t),e.dispatchEvent(dispatchEventType("end")))}}(this), /**************************Mouse move pan event handling*************************/ this.pan=function(e){const t=new Vector3;return function(r,i){const n=e.domElement;if(e.object instanceof PerspectiveCamera){const s=e.object.position;t.copy(s).sub(e.target);let a=t.length();a*=Math.tan(e.object.fov/2*Math.PI/180),e.panLeft(2*r*a/n.clientHeight,e.object.matrix),e.panUp(2*i*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){const t=new Vector3;return function(r,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-r),e.panOffset.add(t)}}(this),this.panUp=function(e){const t=new Vector3;return function(r,i){!0===e.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(e.object.up,t)),t.multiplyScalar(r),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=r,this.quat=(new Quaternion).setFromUnitVectors(this.object.up,new Vector3(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;t0&&this.dollyOut(t),this.update()} /**************************Ponter down event handling*************************/handleMouseDownRotate(e){this.rotateStart.set(e.clientX,e.clientY)}handleMouseDownDolly(e){this.dollyStart.set(e.clientX,e.clientY)}handleMouseDownPan(e){this.panStart.set(e.clientX,e.clientY)}handleTouchStartRotate(){if(1===this.pointers.length)this.rotateStart.set(this.pointers[0].pageX,this.pointers[0].pageY);else{const e=.5*(this.pointers[0].pageX+this.pointers[1].pageX),t=.5*(this.pointers[0].pageY+this.pointers[1].pageY);this.rotateStart.set(e,t)}}handleTouchStartDolly(e){if(e.length<2)return;const t=e[0],r=e[1];touchInfo.startDistBetweenFingers=this.getDist([t.pageX,t.pageY],[r.pageX,r.pageY]),touchInfo.movable=!0,touchInfo.scale=1} /**************************Mouse move rotate event handling*************************/updateRotate(){const e=this.isVRMode,t=this.sphericalDelta;this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const r=this.domElement;e?(t.theta+=2*Math.PI*this.rotateDelta.x/r.clientHeight,t.phi+=2*Math.PI*this.rotateDelta.y/r.clientHeight):(t.theta-=2*Math.PI*this.rotateDelta.x/r.clientHeight,t.phi-=2*Math.PI*this.rotateDelta.y/r.clientHeight),this.rotateStart.copy(this.rotateEnd)}handleMouseMoveRotate(e){this.rotateEnd.set(e.clientX,e.clientY),this.updateRotate()} /**************************Mouse move zoom event handling*************************/dollyOut(e){this.object instanceof PerspectiveCamera?this.scale/=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}dollyIn(e){this.object instanceof PerspectiveCamera?this.scale*=e:(console.warn("WARNING: VRControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}handleMouseMoveDolly(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart);const t=Math.pow(.95,this.zoomSpeed);this.dollyDelta.y>0?this.dollyOut(t):this.dollyIn(t),this.dollyStart.copy(this.dollyEnd)}handleMouseMovePan(e){this.panEnd.set(e.clientX,e.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)} /**************************One-finger or Two-finger rotate event handling*************************/getSecondPointerPosition(e){const t=e.pointerId===this.pointers[0].pointerId?this.pointers[1]:this.pointers[0];return this.pointerPositions[t.pointerId]}handleTouchMoveRotate(e){if(1==this.pointers.length)this.rotateEnd.set(e.pageX,e.pageY);else{const t=this.getSecondPointerPosition(e),r=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);this.rotateEnd.set(r,i)}this.updateRotate()} /**************************Two-finger zoom event handling*************************/updateFov(e){var t;const r=this.object;if(!(r&&r instanceof PerspectiveCamera))return void console.warn("WARNING: VRControls.js encountered an unknown camera type - updateFov disabled.");const i=this.minFov,n=this.maxFov,s=e=>{let t=r.fov+e;t=Math.min(t,n),t=Math.max(t,i),r.fov!==t&&(r.fov=t,r.updateProjectionMatrix(),this.dispatchEvent({type:"change"}))},a=e/20;for(let e=0;e<20;++e)setTimeout((()=>s(a)),5*e);this.autoRotate&&(null==(t=this.controlsHelper)||t.delayAutoRotate())}handleTouchMoveDolly(e){if(!touchInfo.movable||this.pointers.length<2)return;const t=this.getSecondPointerPosition(e),r=[e.pageX,e.pageY],i=[t.x,t.y],n=touchInfo.startDistBetweenFingers,s=this.getDist(r,i);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);const o=a-touchInfo.scale;if(Math.abs(o)<.05)return;let l=0;l=o>0?10*-o:10*(touchInfo.scale/a-1),this.updateFov(l),touchInfo.scale=a}handleKeyDown(e){let t=!1;switch(e.code){case"ArrowUp"/* UP */:this.pan(0,this.keyPanSpeed),t=!0;break;case"ArrowDown"/* BOTTOM */:this.pan(0,-this.keyPanSpeed),t=!0;break;case"ArrowLeft"/* LEFT */:this.pan(this.keyPanSpeed,0),t=!0;break;case"ArrowRight"/* RIGHT */:this.pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}listenToKeyEvents(e){e.addEventListener("keydown",this.onKeyDown),this.domElementKeyEvents=e}},MOUSE_BUTTON={LEFT:1,RIGHT:2,MIDDLE:4},ACTION=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 isPerspectiveCamera(e){return e.isPerspectiveCamera}function isOrthographicCamera(e){return e.isOrthographicCamera}var PI_2=2*Math.PI,PI_HALF=Math.PI/2,EPSILON2=1e-5;function approxZero(e,t=EPSILON2){return Math.abs(e){t.x+=e.clientX,t.y+=e.clientY})),t.x/=e.length,t.y/=e.length}function notSupportedInOrthographicCamera(e,t){return!!isOrthographicCamera(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}function quatInvertCompat(e){return e.invert?e.invert():e.inverse(),e}var THREE,_ORIGIN,_AXIS_Y,_AXIS_Z,_v22,_v3A,_v3B,_v3C,_xColumn,_yColumn,_zColumn,_deltaTarget,_deltaOffset,_sphericalA,_sphericalB,_box3A,_box3B,_sphere5,_quaternionA,_quaternionB,_rotationMatrix,_raycaster,EventDispatcher2=class{constructor(){this._listeners={}} /** * Adds the specified event listener. * @param type event name * @param listener handler function * @category Methods */addEventListener(e,t){const r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)} // hasEventListener( type: string, listener: Listener ): boolean { // const listeners = this._listeners; // return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; // } /** * Removes the specified event listener * @param type event name * @param listener handler function * @category Methods */ removeEventListener(e,t){const r=this._listeners[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}} /** * Removes all event listeners * @param type event name * @category Methods */removeAllEventListeners(e){e?Array.isArray(this._listeners[e])&&(this._listeners[e].length=0):this._listeners={}} /** * Fire an event type. * @param event DispatcherEvent * @category Methods */dispatchEvent(e){const t=this._listeners[e.type];if(void 0!==t){e.target=this;const r=t.slice(0);for(let t=0,i=r.length;t{},this._enabled=!0,this._state=ACTION.NONE,this._viewport=null,this._dollyControlAmount=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._activePointers=[],this._truckInternal=(e,t,r)=>{if(isPerspectiveCamera(this._camera)){const i=_v3A.copy(this._camera.position).sub(this._target),n=this._camera.getEffectiveFOV()*THREE.MathUtils.DEG2RAD,s=i.length()*Math.tan(.5*n),a=this.truckSpeed*e*s/this._elementRect.height,o=this.truckSpeed*t*s/this._elementRect.height;this.verticalDragToForward?(r?this.setFocalOffset(this._focalOffsetEnd.x+a,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(a,0,!0),this.forward(-o,!0)):r?this.setFocalOffset(this._focalOffsetEnd.x+a,this._focalOffsetEnd.y+o,this._focalOffsetEnd.z,!0):this.truck(a,o,!0)}else if(isOrthographicCamera(this._camera)){const i=this._camera,n=e*(i.right-i.left)/i.zoom/this._elementRect.width,s=t*(i.top-i.bottom)/i.zoom/this._elementRect.height;r?this.setFocalOffset(this._focalOffsetEnd.x+n,this._focalOffsetEnd.y+s,this._focalOffsetEnd.z,!0):this.truck(n,s,!0)}},this._rotateInternal=(e,t)=>{const r=PI_2*this.azimuthRotateSpeed*e/this._elementRect.height,i=PI_2*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(r,i,!0)},this._dollyInternal=(e,t,r)=>{const i=Math.pow(.95,-e*this.dollySpeed),n=this._sphericalEnd.radius*i,s=this._sphericalEnd.radius,a=s*(e>=0?-1:1);this.dollyTo(n),this.infinityDolly&&(n{const i=Math.pow(.95,e*this.dollySpeed),n=this._zoomEnd;this.zoomTo(this._zoom*i),this.dollyToCursor&&(this._dollyControlAmount+=this._zoomEnd-n,this._dollyControlCoord.set(t,r))},void 0===THREE&&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 THREE.Quaternion).setFromUnitVectors(this._camera.up,_AXIS_Y),this._yAxisUpSpaceInverse=quatInvertCompat(this._yAxisUpSpace.clone()),this._state=ACTION.NONE,this._domElement=t,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._target=new THREE.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new THREE.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new THREE.Spherical).setFromVector3(_v3A.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._nearPlaneCorners=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this._updateNearPlaneCorners(),this._boundary=new THREE.Box3(new THREE.Vector3(-1/0,-1/0,-1/0),new THREE.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 THREE.Vector2,this.mouseButtons={left:ACTION.ROTATE,middle:ACTION.DOLLY,right:ACTION.TRUCK,wheel:isPerspectiveCamera(this._camera)?ACTION.DOLLY:isOrthographicCamera(this._camera)?ACTION.ZOOM:ACTION.NONE},this.touches={one:ACTION.TOUCH_ROTATE,two:isPerspectiveCamera(this._camera)?ACTION.TOUCH_DOLLY_TRUCK:isOrthographicCamera(this._camera)?ACTION.TOUCH_ZOOM_TRUCK:ACTION.NONE,three:ACTION.TOUCH_TRUCK},this._domElement){const e=new THREE.Vector2,t=new THREE.Vector2,r=new THREE.Vector2,i=e=>{if(!this._enabled)return;const t={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0};this._activePointers.push(t),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),f(e)},n=e=>{if(!this._enabled)return;const t={pointerId:0,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0};this._activePointers.push(t),this._domElement.ownerDocument.removeEventListener("mousemove",o),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",o),this._domElement.ownerDocument.addEventListener("mouseup",u),f(e)},s=e=>{this._enabled&&(e.preventDefault(),Array.prototype.forEach.call(e.changedTouches,(e=>{const t={pointerId:e.identifier,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0};this._activePointers.push(t)})),this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("touchend",h),this._domElement.ownerDocument.addEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("touchend",h),f(e))},a=e=>{e.cancelable&&e.preventDefault();const t=e.pointerId,r=this._findPointerById(t);if(r){if(r.clientX=e.clientX,r.clientY=e.clientY,r.deltaX=e.movementX,r.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&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&(this._state=this._state|this.mouseButtons.left),(e.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);g()}},o=e=>{const 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&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&(this._state=this._state|this.mouseButtons.left),(e.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right),g())},l=e=>{e.cancelable&&e.preventDefault(),Array.prototype.forEach.call(e.changedTouches,(e=>{const t=e.identifier,r=this._findPointerById(t);r&&(r.clientX=e.clientX,r.clientY=e.clientY)})),g()},c=e=>{const t=e.pointerId,r=this._findPointerById(t);if(r&&this._activePointers.splice(this._activePointers.indexOf(r),1),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=ACTION.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=ACTION.NONE;_()},u=()=>{const e=this._findPointerById(0);e&&this._activePointers.splice(this._activePointers.indexOf(e),1),this._state=ACTION.NONE,_()},h=e=>{switch(Array.prototype.forEach.call(e.changedTouches,(e=>{const t=e.identifier,r=this._findPointerById(t);r&&this._activePointers.splice(this._activePointers.indexOf(r),1)})),this._activePointers.length){case 0:this._state=ACTION.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}_()};let p=-1;const d=e=>{if(!this._enabled||this.mouseButtons.wheel===ACTION.NONE)return;if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ACTION.ROTATE||this.mouseButtons.wheel===ACTION.TRUCK){const e=performance.now();p-e<1e3&&this._getClientRect(this._elementRect),p=e}const t=isMac?-1:-3,r=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),i=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 ACTION.ROTATE:this._rotateInternal(e.deltaX,e.deltaY);break;case ACTION.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1);break;case ACTION.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0);break;case ACTION.DOLLY:this._dollyInternal(-r,i,n);break;case ACTION.ZOOM:this._zoomInternal(-r,i,n)}this.dispatchEvent({type:"control"})},m=e=>{this._enabled&&e.preventDefault()},f=i=>{if(!this._enabled)return;extractClientCoordFromEvent(this._activePointers,_v22),this._getClientRect(this._elementRect),e.copy(_v22),t.copy(_v22);if(this._activePointers.length>=2){const e=_v22.x-this._activePointers[1].clientX,i=_v22.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+i*i);r.set(0,n);const s=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),a=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);t.set(s,a)}if("touches"in i||"pointerType"in i&&"touch"===i.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,(i.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&(this._state=this._state|this.mouseButtons.left),(i.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(i.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);this.dispatchEvent({type:"controlstart"})},g=()=>{if(!this._enabled)return;extractClientCoordFromEvent(this._activePointers,_v22);const i=this._domElement&&document.pointerLockElement===this._domElement,n=i?-this._activePointers[0].deltaX:t.x-_v22.x,s=i?-this._activePointers[0].deltaY:t.y-_v22.y;if(t.copy(_v22),(this._state&ACTION.ROTATE)!==ACTION.ROTATE&&(this._state&ACTION.TOUCH_ROTATE)!==ACTION.TOUCH_ROTATE&&(this._state&ACTION.TOUCH_DOLLY_ROTATE)!==ACTION.TOUCH_DOLLY_ROTATE&&(this._state&ACTION.TOUCH_ZOOM_ROTATE)!==ACTION.TOUCH_ZOOM_ROTATE||this._rotateInternal(n,s),(this._state&ACTION.DOLLY)===ACTION.DOLLY||(this._state&ACTION.ZOOM)===ACTION.ZOOM){const t=this.dollyToCursor?(e.x-this._elementRect.x)/this._elementRect.width*2-1:0,r=this.dollyToCursor?(e.y-this._elementRect.y)/this._elementRect.height*-2+1:0;this._state===ACTION.DOLLY?this._dollyInternal(s*TOUCH_DOLLY_FACTOR,t,r):this._zoomInternal(s*TOUCH_DOLLY_FACTOR,t,r)}if((this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_ZOOM)===ACTION.TOUCH_ZOOM||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE){const e=_v22.x-this._activePointers[1].clientX,i=_v22.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+i*i),s=r.y-n;r.set(0,n);const a=this.dollyToCursor?(t.x-this._elementRect.x)/this._elementRect.width*2-1:0,o=this.dollyToCursor?(t.y-this._elementRect.y)/this._elementRect.height*-2+1:0;this._state===ACTION.TOUCH_DOLLY||this._state===ACTION.TOUCH_DOLLY_ROTATE||this._state===ACTION.TOUCH_DOLLY_TRUCK||this._state===ACTION.TOUCH_DOLLY_OFFSET?this._dollyInternal(s*TOUCH_DOLLY_FACTOR,a,o):this._zoomInternal(s*TOUCH_DOLLY_FACTOR,a,o)}(this._state&ACTION.TRUCK)!==ACTION.TRUCK&&(this._state&ACTION.TOUCH_TRUCK)!==ACTION.TOUCH_TRUCK&&(this._state&ACTION.TOUCH_DOLLY_TRUCK)!==ACTION.TOUCH_DOLLY_TRUCK&&(this._state&ACTION.TOUCH_ZOOM_TRUCK)!==ACTION.TOUCH_ZOOM_TRUCK||this._truckInternal(n,s,!1),(this._state&ACTION.OFFSET)!==ACTION.OFFSET&&(this._state&ACTION.TOUCH_OFFSET)!==ACTION.TOUCH_OFFSET&&(this._state&ACTION.TOUCH_DOLLY_OFFSET)!==ACTION.TOUCH_DOLLY_OFFSET&&(this._state&ACTION.TOUCH_ZOOM_OFFSET)!==ACTION.TOUCH_ZOOM_OFFSET||this._truckInternal(n,s,!0),this.dispatchEvent({type:"control"})},_=()=>{extractClientCoordFromEvent(this._activePointers,_v22),t.copy(_v22),0===this._activePointers.length&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("touchend",h),this.dispatchEvent({type:"controlend"}))};this._domElement.addEventListener("pointerdown",i),isPointerEventsNotSupported&&this._domElement.addEventListener("mousedown",n),isPointerEventsNotSupported&&this._domElement.addEventListener("touchstart",s),this._domElement.addEventListener("pointercancel",c),this._domElement.addEventListener("wheel",d,{passive:!1}),this._domElement.addEventListener("contextmenu",m),this._removeAllEventListeners=()=>{this._domElement.removeEventListener("pointerdown",i),this._domElement.removeEventListener("mousedown",n),this._domElement.removeEventListener("touchstart",s),this._domElement.removeEventListener("pointercancel",c),this._domElement.removeEventListener("wheel",d,{passive:!1}),this._domElement.removeEventListener("contextmenu",m),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",o),this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("touchend",h)},this.cancel=()=>{this._state!==ACTION.NONE&&(this._state=ACTION.NONE,this._activePointers.length=0,_())}}this.update(0)} /** * Injects THREE as the dependency. You can then proceed to use CameraControls. * * e.g * ```javascript * CameraControls.install( { THREE: THREE } ); * ``` * * Note: If you do not wish to use enter three.js to reduce file size(tree-shaking for example), make a subset to install. * * ```js * import { * Vector2, * Vector3, * Vector4, * Quaternion, * Matrix4, * Spherical, * Box3, * Sphere, * Raycaster, * MathUtils, * } from 'three'; * * const subsetOfTHREE = { * Vector2 : Vector2, * Vector3 : Vector3, * Vector4 : Vector4, * Quaternion: Quaternion, * Matrix4 : Matrix4, * Spherical : Spherical, * Box3 : Box3, * Sphere : Sphere, * Raycaster : Raycaster, * MathUtils : { * DEG2RAD: MathUtils.DEG2RAD, * clamp: MathUtils.clamp, * }, * }; * CameraControls.install( { THREE: subsetOfTHREE } ); * ``` * @category Statics */static install(e){THREE=e.THREE,_ORIGIN=Object.freeze(new THREE.Vector3(0,0,0)),_AXIS_Y=Object.freeze(new THREE.Vector3(0,1,0)),_AXIS_Z=Object.freeze(new THREE.Vector3(0,0,1)),_v22=new THREE.Vector2,_v3A=new THREE.Vector3,_v3B=new THREE.Vector3,_v3C=new THREE.Vector3,_xColumn=new THREE.Vector3,_yColumn=new THREE.Vector3,_zColumn=new THREE.Vector3,_deltaTarget=new THREE.Vector3,_deltaOffset=new THREE.Vector3,_sphericalA=new THREE.Spherical,_sphericalB=new THREE.Spherical,_box3A=new THREE.Box3,_box3B=new THREE.Box3,_sphere5=new THREE.Sphere,_quaternionA=new THREE.Quaternion,_quaternionB=new THREE.Quaternion,_rotationMatrix=new THREE.Matrix4,_raycaster=new THREE.Raycaster} /** * list all ACTIONs * @category Statics */static get ACTION(){return ACTION} /** * The camera to be controlled * @category Properties */get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0} /** * Whether or not the controls are enabled. * `false` to disable user dragging/touch-move, but all methods works. * @category Properties */get enabled(){return this._enabled}set enabled(e){this._enabled=e,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="")} /** * Returns `true` if the controls are active updating. * readonly value. * @category Properties */get active(){return!this._hasRested} /** * Getter for the current `ACTION`. * readonly value. * @category Properties */get currentAction(){return this._state} /** * get/set Current distance. * @category Properties */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)} // horizontal angle /** * get/set the azimuth angle (horizontal) in radians. * Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative. * @category Properties */ 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)} // vertical angle /** * get/set the polar angle (vertical) in radians. * @category Properties */ 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)} /** * Whether camera position should be enclosed in the boundary or not. * @category Properties */get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0} /** * Adds the specified event listener. * Applicable event types (which is `K`) are: * | Event name | Timing | * | ------------------- | ------ | * | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ | * | `'control'` | When the user controls the camera (dragging). | * | `'controlend'` | When the user ends to control the camera. ¹ | * | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` | * | `'update'` | When the camera position is updated. | * | `'wake'` | When the camera starts moving. | * | `'rest'` | When the camera movement is below `.restThreshold` ². | * | `'sleep'` | When the camera end moving. | * * 1. `mouseButtons.wheel` (Mouse wheel control) does not emit `'controlstart'` and `'controlend'`. `mouseButtons.wheel` uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected. * 2. Due to damping, `sleep` will usually fire a few seconds after the camera _appears_ to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the `rest` event. This can be fine tuned using the `.restThreshold` parameter. See the [Rest and Sleep Example](https://yomotsu.github.io/camera-controls/examples/rest-and-sleep.html). * * e.g. * ``` * cameraControl.addEventListener( 'controlstart', myCallbackFunction ); * ``` * @param type event name * @param listener handler function * @category Methods */addEventListener(e,t){super.addEventListener(e,t)} /** * Removes the specified event listener * e.g. * ``` * cameraControl.addEventListener( 'controlstart', myCallbackFunction ); * ``` * @param type event name * @param listener handler function * @category Methods */removeEventListener(e,t){super.removeEventListener(e,t)} /** * Rotate azimuthal angle(horizontal) and polar angle(vertical). * Every value is added to the current value. * @param azimuthAngle Azimuth rotate angle. In radian. * @param polarAngle Polar rotate angle. In radian. * @param enableTransition Whether to move smoothly or immediately * @category Methods */rotate(e,t,r=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,r)} /** * Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target. * * e.g. * ``` * cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true ); * ``` * @param azimuthAngle Azimuth rotate angle. In radian. * @param enableTransition Whether to move smoothly or immediately * @category Methods */rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)} /** * Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target. * * e.g. * ``` * cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true ); * ``` * @param polarAngle Polar rotate angle. In radian. * @param enableTransition Whether to move smoothly or immediately * @category Methods */rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)} /** * Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle. * Camera view will rotate over the orbit pivot absolutely: * * azimuthAngle * ``` * 0º * \ * 90º -----+----- -90º * \ * 180º * ``` * | direction | angle | * | --------- | ---------------------- | * | front | 0º | * | left | 90º (`Math.PI / 2`) | * | right | -90º (`- Math.PI / 2`) | * | back | 180º (`Math.PI`) | * * polarAngle * ``` * 180º * | * 90º * | * 0º * ``` * | direction | angle | * | -------------------- | ---------------------- | * | top/sky | 180º (`Math.PI`) | * | horizontal from view | 90º (`Math.PI / 2`) | * | bottom/floor | 0º | * * @param azimuthAngle Azimuth rotate angle to. In radian. * @param polarAngle Polar rotate angle to. In radian. * @param enableTransition Whether to move smoothly or immediately * @category Methods */rotateTo(e,t,r=!1){const i=THREE.MathUtils.clamp(e,this.minAzimuthAngle,this.maxAzimuthAngle),n=THREE.MathUtils.clamp(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,r||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const s=!r||approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(s)} /** * Dolly in/out camera position. * @param distance Distance of dollyIn. Negative number for dollyOut. * @param enableTransition Whether to move smoothly or immediately. * @category Methods */dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)} /** * Dolly in/out camera position to given distance. * @param distance Distance of dolly. * @param enableTransition Whether to move smoothly or immediately. * @category Methods */dollyTo(e,t=!1){const r=this._sphericalEnd.radius,i=THREE.MathUtils.clamp(e,this.minDistance,this.maxDistance);if(this.colliderMeshes.length>=1){const e=this._collisionTest(),t=approxEquals(e,this._spherical.radius);if(!(r>i)&&t)return Promise.resolve();this._sphericalEnd.radius=Math.min(i,e)}else this._sphericalEnd.radius=i;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)} /** * Zoom in/out camera. The value is added to camera zoom. * Limits set with `.minZoom` and `.maxZoom` * @param zoomStep zoom scale * @param enableTransition Whether to move smoothly or immediately * @category Methods */zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)} /** * Zoom in/out camera to given scale. The value overwrites camera zoom. * Limits set with .minZoom and .maxZoom * @param zoom * @param enableTransition * @category Methods */zoomTo(e,t=!1){this._zoomEnd=THREE.MathUtils.clamp(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const r=!t||approxEquals(this._zoom,this._zoomEnd,this.restThreshold);return this._createOnRestPromise(r)} /** * @deprecated `pan()` has been renamed to `truck()` * @category Methods */pan(e,t,r=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,r)} /** * Truck and pedestal camera using current azimuthal angle * @param x Horizontal translate amount * @param y Vertical translate amount * @param enableTransition Whether to move smoothly or immediately * @category Methods */truck(e,t,r=!1){this._camera.updateMatrix(),_xColumn.setFromMatrixColumn(this._camera.matrix,0),_yColumn.setFromMatrixColumn(this._camera.matrix,1),_xColumn.multiplyScalar(e),_yColumn.multiplyScalar(-t);const i=_v3A.copy(_xColumn).add(_yColumn),n=_v3B.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,r)} /** * Move forward / backward. * @param distance Amount to move forward / backward. Negative value to move backward * @param enableTransition Whether to move smoothly or immediately * @category Methods */forward(e,t=!1){_v3A.setFromMatrixColumn(this._camera.matrix,0),_v3A.crossVectors(this._camera.up,_v3A),_v3A.multiplyScalar(e);const r=_v3B.copy(this._targetEnd).add(_v3A);return this.moveTo(r.x,r.y,r.z,t)} /** * Move target position to given point. * @param x x coord to move center position * @param y y coord to move center position * @param z z coord to move center position * @param enableTransition Whether to move smoothly or immediately * @category Methods */moveTo(e,t,r,i=!1){const n=_v3A.set(e,t,r).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const s=!i||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)} /** * Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit. * set `cover: true` to fill enter screen. * e.g. * ``` * cameraControls.fitToBox( myMesh ); * ``` * @param box3OrObject Axis aligned bounding box to fit the view. * @param enableTransition Whether to move smoothly or immediately. * @param options | `` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number } * @returns Transition end promise * @category Methods */fitToBox(e,t,{cover:r=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:s=0,paddingTop:a=0}={}){const o=[],l=e.isBox3?_box3A.copy(e):_box3A.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const c=roundToStep(this._sphericalEnd.theta,PI_HALF),u=roundToStep(this._sphericalEnd.phi,PI_HALF);o.push(this.rotateTo(c,u,t));const h=_v3A.setFromSpherical(this._sphericalEnd).normalize(),p=_quaternionA.setFromUnitVectors(h,_AXIS_Z),d=approxEquals(Math.abs(h.y),1);d&&p.multiply(_quaternionB.setFromAxisAngle(_AXIS_Y,c)),p.multiply(this._yAxisUpSpaceInverse);const m=_box3B.makeEmpty();_v3B.copy(l.min).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.min).setX(l.max.x).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.min).setY(l.max.y).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.max).setZ(l.min.z).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.min).setZ(l.max.z).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.max).setY(l.min.y).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.max).setX(l.min.x).applyQuaternion(p),m.expandByPoint(_v3B),_v3B.copy(l.max).applyQuaternion(p),m.expandByPoint(_v3B),m.min.x-=i,m.min.y-=s,m.max.x+=n,m.max.y+=a,p.setFromUnitVectors(_AXIS_Z,h),d&&p.premultiply(_quaternionB.invert()),p.premultiply(this._yAxisUpSpace);const f=m.getSize(_v3A),g=m.getCenter(_v3B).applyQuaternion(p);if(isPerspectiveCamera(this._camera)){const e=this.getDistanceToFitBox(f.x,f.y,f.z,r);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(isOrthographicCamera(this._camera)){const e=this._camera,i=e.right-e.left,n=e.top-e.bottom,s=r?Math.max(i/f.x,n/f.y):Math.min(i/f.x,n/f.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)} /** * Fit the viewport to the sphere or the bounding sphere of the object. * @param sphereOrMesh * @param enableTransition * @category Methods */fitToSphere(e,t){const r=[],i=e instanceof THREE.Sphere?_sphere5.copy(e):createBoundingSphere(e,_sphere5);if(r.push(this.moveTo(i.center.x,i.center.y,i.center.z,t)),isPerspectiveCamera(this._camera)){const e=this.getDistanceToFitSphere(i.radius);r.push(this.dollyTo(e,t))}else if(isOrthographicCamera(this._camera)){const e=this._camera.right-this._camera.left,n=this._camera.top-this._camera.bottom,s=2*i.radius,a=Math.min(e/s,n/s);r.push(this.zoomTo(a,t))}return r.push(this.setFocalOffset(0,0,0,t)),Promise.all(r)} /** * Make an orbit with given points. * @param positionX * @param positionY * @param positionZ * @param targetX * @param targetY * @param targetZ * @param enableTransition * @category Methods */setLookAt(e,t,r,i,n,s,a=!1){const o=_v3B.set(i,n,s),l=_v3A.set(e,t,r);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));const c=!a||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(c)} /** * Similar to setLookAt, but it interpolates between two states. * @param positionAX * @param positionAY * @param positionAZ * @param targetAX * @param targetAY * @param targetAZ * @param positionBX * @param positionBY * @param positionBZ * @param targetBX * @param targetBY * @param targetBZ * @param t * @param enableTransition * @category Methods */lerpLookAt(e,t,r,i,n,s,a,o,l,c,u,h,p,d=!1){const m=_v3A.set(i,n,s),f=_v3B.set(e,t,r);_sphericalA.setFromVector3(f.sub(m).applyQuaternion(this._yAxisUpSpace));const g=_v3C.set(c,u,h),_=_v3B.set(a,o,l);_sphericalB.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,p));const y=_sphericalB.theta-_sphericalA.theta,T=_sphericalB.phi-_sphericalA.phi,v=_sphericalB.radius-_sphericalA.radius;this._sphericalEnd.set(_sphericalA.radius+v*p,_sphericalA.phi+T*p,_sphericalA.theta+y*p),this.normalizeRotations(),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const E=!d||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(E)} /** * setLookAt without target, keep gazing at the current target * @param positionX * @param positionY * @param positionZ * @param enableTransition * @category Methods */setPosition(e,t,r,i=!1){return this.setLookAt(e,t,r,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)} /** * setLookAt without position, Stay still at the position. * @param targetX * @param targetY * @param targetZ * @param enableTransition * @category Methods */setTarget(e,t,r,i=!1){const n=this.getPosition(_v3A);return this.setLookAt(n.x,n.y,n.z,e,t,r,i)} /** * Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly. * @param x * @param y * @param z * @param enableTransition * @category Methods */setFocalOffset(e,t,r,i=!1){this._focalOffsetEnd.set(e,t,r),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||approxEquals(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&approxEquals(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&approxEquals(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)} /** * Set orbit point without moving the camera. * SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions. * @param targetX * @param targetY * @param targetZ * @category Methods */setOrbitPoint(e,t,r){this._camera.updateMatrixWorld(),_xColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_yColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,1),_zColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=_v3A.set(e,t,r),n=i.distanceTo(this._camera.position),s=i.sub(this._camera.position);_xColumn.multiplyScalar(s.x),_yColumn.multiplyScalar(s.y),_zColumn.multiplyScalar(s.z),_v3A.copy(_xColumn).add(_yColumn).add(_zColumn),_v3A.z=_v3A.z+n,this.dollyTo(n,!1),this.setFocalOffset(-_v3A.x,_v3A.y,-_v3A.z,!1),this.moveTo(e,t,r,!1)} /** * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3 * @param box3 * @category Methods */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} /** * Set (or unset) the current viewport. * Set this when you want to use renderer viewport and .dollyToCursor feature at the same time. * @param viewportOrX * @param y * @param width * @param height * @category Methods */setViewport(e,t,r,i){null!==e?(this._viewport=this._viewport||new THREE.Vector4,"number"==typeof e?this._viewport.set(e,t,r,i):this._viewport.copy(e)):this._viewport=null} /** * Calculate the distance to fit the box. * @param width box width * @param height box height * @param depth box depth * @returns distance * @category Methods */getDistanceToFitBox(e,t,r,i=!1){if(notSupportedInOrthographicCamera(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=e/t,s=this._camera.getEffectiveFOV()*THREE.MathUtils.DEG2RAD,a=this._camera.aspect;return.5*((i?n>a:nr.pointerId===e&&(t=r,!0))),t}_encloseToBoundary(e,t,r){const i=t.lengthSq();if(0===i)return e;const n=_v3B.copy(t).add(e),s=this._boundary.clampPoint(n,_v3C).sub(n),a=s.lengthSq();if(0===a)return e.add(t);if(a===i)return e;if(0===r)return e.add(t).add(s);{const i=1+r*a/t.dot(s);return e.add(_v3B.copy(t).multiplyScalar(i)).add(s.multiplyScalar(1-r))}}_updateNearPlaneCorners(){if(isPerspectiveCamera(this._camera)){const e=this._camera,t=e.near,r=e.getEffectiveFOV()*THREE.MathUtils.DEG2RAD,i=Math.tan(.5*r)*t,n=i*e.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(isOrthographicCamera(this._camera)){const e=this._camera,t=1/e.zoom,r=e.left*t,i=e.right*t,n=e.top*t,s=e.bottom*t;this._nearPlaneCorners[0].set(r,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,s,0),this._nearPlaneCorners[3].set(r,s,0)}} // lateUpdate _collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1))return e;if(notSupportedInOrthographicCamera(this._camera,"_collisionTest"))return e;const t=_v3A.setFromSpherical(this._spherical).divideScalar(this._spherical.radius);_rotationMatrix.lookAt(_ORIGIN,t,this._camera.up);for(let r=0;r<4;r++){const i=_v3B.copy(this._nearPlaneCorners[r]);i.applyMatrix4(_rotationMatrix);const n=_v3C.addVectors(this._target,i);_raycaster.set(n,t),_raycaster.far=this._spherical.radius+1;const s=_raycaster.intersectObjects(this.colliderMeshes);0!==s.length&&s[0].distance{const t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)})))}_removeAllEventListeners(){}};function createBoundingSphere(e,t){const r=t,i=r.center;_box3A.makeEmpty(),e.traverseVisible((e=>{e.isMesh&&_box3A.expandByObject(e)})),_box3A.getCenter(i);let n=0;return e.traverseVisible((e=>{if(!e.isMesh)return;const t=e,r=t.geometry.clone();if(r.applyMatrix4(t.matrixWorld),r.isBufferGeometry){const e=r.attributes.position;for(let t=0,r=e.count;t{this.enabled&&this.enablePan&&this.handleKeyDown(e)},CameraControls.install({THREE:three_module_exports}),this.cameraControls=new CameraControls(e,t),this.object=e,this.domElement=t,this.dampingFactor=.05,this.zoomSpeed=.05,this.rotateSpeed=1,this.panSpeed=1,this.mouseButtons={LEFT:MOUSE.ROTATE,MIDDLE:MOUSE.DOLLY,RIGHT:MOUSE.PAN},this.touches={ONE:TOUCH.ROTATE,TWO:TOUCH.DOLLY_PAN}}get minDistance(){return this.cameraControls.minDistance}set minDistance(e){this.cameraControls.minDistance=e}get maxDistance(){return this.cameraControls.maxDistance}set maxDistance(e){this.cameraControls.maxDistance=e}get minZoom(){return this.cameraControls.minZoom}set minZoom(e){this.cameraControls.minZoom=e}get maxZoom(){return this.cameraControls.maxZoom}set maxZoom(e){this.cameraControls.maxZoom=e}get minPolarAngle(){return this.cameraControls.minPolarAngle}set minPolarAngle(e){this.cameraControls.minPolarAngle=e}get maxPolarAngle(){return this.cameraControls.maxPolarAngle}set maxPolarAngle(e){this.cameraControls.maxPolarAngle=e}get minAzimuthAngle(){return this.cameraControls.minAzimuthAngle}set minAzimuthAngle(e){this.cameraControls.minAzimuthAngle=e}get maxAzimuthAngle(){return this.cameraControls.maxAzimuthAngle}set maxAzimuthAngle(e){this.cameraControls.maxAzimuthAngle=e}get enabled(){return this.cameraControls.enabled}set enabled(e){this.cameraControls.enabled=e}get position(){return this.cameraControls.getPosition(new Vector3)}set position(e){this.cameraControls.setPosition(e.x,e.y,e.z)}get target(){const e=new Vector3;return this.cameraControls.getTarget(e),e}set target(e){this.cameraControls.setTarget(e.x,e.y,e.z)}get enableDamping(){return this._enableDamping}set enableDamping(e){this._enableDamping=e,e||(this.dampingFactorValue=this.cameraControls.dampingFactor),this.cameraControls.dampingFactor=e?this.dampingFactorValue:1,this.cameraControls.draggingDampingFactor=e?this.dampingFactorValue:1,e&&(this.dampingFactorValue=void 0)}get dampingFactor(){return this.cameraControls.dampingFactor}set dampingFactor(e){this.cameraControls.dampingFactor=e,this.cameraControls.draggingDampingFactor=e}get enableZoom(){return this._enableZoom}set enableZoom(e){this._enableZoom=e,e||(this.dollySpeedValue=this.cameraControls.dollySpeed),this.cameraControls.dollySpeed=e?this.dollySpeedValue:0,e&&(this.dollySpeedValue=void 0)}get zoomSpeed(){return this.cameraControls.dollySpeed}set zoomSpeed(e){this.cameraControls.dollySpeed=e}get enableRotate(){return this._enableRotate}set enableRotate(e){this._enableRotate=e,e||(this.rotateSpeedValue=this.cameraControls.azimuthRotateSpeed),this.cameraControls.azimuthRotateSpeed=e?this.rotateSpeedValue:0,this.cameraControls.polarRotateSpeed=e?this.rotateSpeedValue:0,e&&(this.rotateSpeedValue=void 0)}get rotateSpeed(){return this.cameraControls.azimuthRotateSpeed}set rotateSpeed(e){this.cameraControls.azimuthRotateSpeed=e,this.cameraControls.polarRotateSpeed=e}get enablePan(){return this._enablePan}set enablePan(e){this._enablePan=e,e||(this.panSpeedValue=this.cameraControls.truckSpeed),this.cameraControls.truckSpeed=e?this.panSpeedValue:0,e&&(this.panSpeedValue=void 0)}get panSpeed(){return this.cameraControls.truckSpeed}set panSpeed(e){this.cameraControls.truckSpeed=e}get dollyToCursor(){return this.cameraControls.dollyToCursor}set dollyToCursor(e){this.cameraControls.dollyToCursor=e}get screenSpacePanning(){return!this.cameraControls.verticalDragToForward}set screenSpacePanning(e){this.cameraControls.verticalDragToForward=!e}get mouseButtons(){return this._mouseButtons}set mouseButtons(e){this._mouseButtons=e;for(const t in e){const r=getCameraControlsMouseButtons(this.object)[e[t]];"MIDDLE"===t?this.cameraControls.mouseButtons.wheel=r:this.cameraControls.mouseButtons[t.toLowerCase()]=r}this.cameraControls.mouseButtons.middle=CameraControls.ACTION.NONE}get touches(){return this._touches}set touches(e){this._touches=e;for(const t in e){const r=getCameraControlsTouches(this.object)[e[t]],i=t.toLowerCase();"one"!==i?this.cameraControls.touches[i]=r:r!==CameraControls.ACTION.TOUCH_ROTATE&&r!==CameraControls.ACTION.TOUCH_TRUCK||(this.cameraControls.touches[i]=r)}}get target0(){const e=JSON.parse(this.cameraControls.toJSON()).target0;return new Vector3(e[0],e[1],e[2])}set target0(e){const t=JSON.parse(this.cameraControls.toJSON());t.target0=e.toArray(),this.cameraControls.fromJSON(JSON.stringify(t))}get position0(){const e=JSON.parse(this.cameraControls.toJSON()).position0;return new Vector3(e[0],e[1],e[2])}set position0(e){const t=JSON.parse(this.cameraControls.toJSON());t.position0=e.toArray(),this.cameraControls.fromJSON(JSON.stringify(t))}get zoom0(){return JSON.parse(this.cameraControls.toJSON()).zoom0}set zoom0(e){const t=JSON.parse(this.cameraControls.toJSON());t.zoom0=e,this.cameraControls.fromJSON(JSON.stringify(t))}handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.cameraControls.rotateAzimuthTo(2*Math.PI*this.cameraControls.azimuthRotateSpeed/this.domElement.clientHeight,!1):this.cameraControls.truck(0,.05*this.keyPanSpeed/this.panSpeed,!1),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.cameraControls.rotateAzimuthTo(-2*Math.PI*this.cameraControls.azimuthRotateSpeed/this.domElement.clientHeight,!1):this.cameraControls.truck(0,.05*-this.keyPanSpeed/this.panSpeed,!1),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.cameraControls.rotatePolarTo(2*Math.PI*this.cameraControls.polarRotateSpeed/this.domElement.clientHeight,!1):this.cameraControls.truck(.05*this.keyPanSpeed/this.panSpeed,0,!1),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.cameraControls.rotatePolarTo(-2*Math.PI*this.cameraControls.polarRotateSpeed/this.domElement.clientHeight,!1):this.cameraControls.truck(.05*-this.keyPanSpeed/this.panSpeed,0,!1),t=!0}t&&(e.preventDefault(),this.update())}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}listenToKeyEvents(e){e.addEventListener("keydown",this.onKeyDown),this.domElementKeyEvents=e}update(){const e=this.clock.getDelta();this.cameraControls.update(e),this.autoRotate&&this.cameraControls.currentAction===CameraControls.ACTION.NONE&&this.cameraControls.rotate(this.getAutoRotationAngle(),0,!1)}saveState(){this.cameraControls.saveState()}reset(){this.cameraControls.reset(!0)}dispose(){this.cameraControls.dispose()}getPolarAngle(){return this.cameraControls.polarAngle}getAzimuthalAngle(){return this.cameraControls.azimuthAngle}getDistance(){return this.cameraControls.distance}addEventListener(e,t){this.cameraControls.addEventListener(e,t)}removeEventListener(e,t){this.cameraControls.removeEventListener(e,t)}dispatchEvent(e){this.cameraControls.dispatchEvent(e)}setLookAt(e,t){this.cameraControls.setLookAt(e.x,e.y,e.z,t.x,t.y,t.z,!1),this.cameraControls.setFocalOffset(0,0,0,!1)}setOrbitPoint(e){this.cameraControls.setOrbitPoint(e.x,e.y,e.z)}},en={ // English 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",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"},Tooltip:{measure:"Pick a point to continue, pressing ESC to exit",areaMeasurement:"Pick a point to continue, pressing ESC to exit, right click to finish",section:"Click to pick a section plane"},PopPanel:{reset:"Reset"}},cn={ // Chinese NavCube:{front:"前",back:"后",top:"上",bottom:"下",left:"左",right:"右"},ContextMenu:{viewFitAll:"缩放视口到所有模型",hideAll:"全部隐藏",showAll:"全部显示",xRayAll:"全部应用 X 光模式",xRayNone:"清除 X 光模式",selectNone:"清空选择",resetView:"重置视图",viewFitEntity:"缩放视口到实体",hideEntity:"隐藏",hideOthers:"隐藏其他 (隔离)",xRayEntity:"应用 X 光模式",xRayOthers:"对其他实体应用 X 光模式",select:"选择",deselect:"取消选择",showSectionPlane:"显示剖切面",showSectionBox:"显示剖切盒",showAxisSection:"显示轴向剖切",hideSectionPlane:"隐藏剖切面",hideSectionBox:"隐藏剖切盒",hideAxisSection:"隐藏轴向剖切",undoSection:"取消剖切"},ProgressBar:{Loading:"正在加载",Comparing:"正在对比"},Toolbar:{homeView:"主视图",orthoView:"正交视图",measurement:"测量",distanceMeasurement:"距离测量",areaMeasurement:"面积测量",angleMeasurement:"角度测量",coordinateMeasurement:"坐标测量",clearMeasurement:"清除测量",markup:"批注",markupArrow:"箭头",markupRect:"矩形框",markupCloudRect:"云线框",markupPolyLine:"多段线",markupCloudLine:"云线",markupEllipse:"椭圆",markupCircle:"圆",markupDot:"点",markupText:"文字",markupX:"叉号",markupStroke:"画笔颜色",markupLineWidth:"线宽",markupLineWidth2:"线宽 2",markupLineWidth5:"线宽 5",markupLineWidth10:"线宽 10",markupFontSize:"字号",markupFontSize14:"14",markupFontSize18:"18",markupFontSize24:"24",clearMarkup:"清除批注",quitMarkup:"退出批注",section:"剖切",axisSection:"轴向剖切",pickSectionPlane:"面剖切", // 拾取面剖切 sectionBox:"剖切盒",bimTree:"BIM树",viewpoint:"视点",annotation:"批注",property:"属性",settings:"设置",compared:"图纸对比",quitCompare:"退出图纸对比",fullscreen:"全屏",layers:"图层",zoomToRectangle:"框选放大"},Tooltip:{measure:"点击继续测量, ESC 取消测量",areaMeasurement:"点击继续测量, ESC 取消测量,右键完成测量",section:"点击确定剖切面"},PopPanel:{reset:"重置"}},BaseViewer=class extends Event{constructor(e){super(), /** * @internal */ this.translate=this.initLocalization(),this.height=0,this.width=0,this.enableOverlayRenderer=!0,this.viewerCfg=e,this.initLocalization(),this.initViewerContainer(),this.initWidgetContainer()}initLocalization(){var e;const t=(null==(e=this.viewerCfg)?void 0:e.language)||"cn";return i18next_default.init({lng:t, // if you're using a language detector, do not define the lng option debug:!1,resources:{en:{translation:en},cn:{translation:cn}}}),i18next_default.t} /** * Creates a viewerContainer under the container that user passed in. * There are some benifits to create a new one. e.g., its style won't affect * the container div user passed in. */initViewerContainer(){let e=document.getElementById(this.viewerCfg.containerId);e||(log.error("[BaseViewer] containerId:",this.viewerCfg.containerId,"is not found in dom tree! will append to document body"),e=document.body);const t=document.createElement("div");t.classList.add("viewer-container"),t.style.cssText="width: 100%; height: 100%; position: absolute; overflow: hidden;",e.appendChild(t),this.width=t.clientWidth,this.height=t.clientHeight,this.viewerContainer=t}initWidgetContainer(){var e;const t=document.createElement("div");t.classList.add("widget-container"),null==(e=this.viewerContainer)||e.appendChild(t),this.widgetContainer=t}destroy(){var e,t,r;null==(e=this.widgetContainer)||e.remove(),this.widgetContainer=void 0,null==(t=this.viewerContainer)||t.remove(),this.viewerContainer=void 0,null==(r=this.scene)||r.clear(),this.scene=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)}enableRender(){}getRaycaster(){} // eslint-disable-next-line getRaycastableObjectsByMouse(e){return[]}getBBox(){} // eslint-disable-next-line flyTo(e,t){} /** * If it is a 3d viewer. * DxfViewer is 2d, thus returns false. * @default true */is3d(){return!0}deactivateMeasurement(){}}; // src/core/utils/Locale.ts // node_modules/3d-tiles-renderer/src/utilities/urlExtension.js function getUrlExtension(e){let t;try{t=new URL(e,"http://fakehost.com/")}catch(e){return null}const r=t.pathname.split("/").pop(),i=r.lastIndexOf(".");if(-1===i||i===r.length-1)return null;return r.substring(i+1)} // node_modules/3d-tiles-renderer/src/utilities/LRUCache.js function enqueueMicrotask(e){Promise.resolve().then(e)}var LRUCache=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;const e=this.itemSet;this.defaultPriorityCallback=t=>e.get(t)} // Returns whether or not the cache has reached the maximum size isFull(){return this.itemSet.size>=this.maxSize}add(e,t){const r=this.itemSet;if(r.has(e))return!1;if(this.isFull())return!1;const i=this.usedSet,n=this.itemList,s=this.callbacks;return n.push(e),i.add(e),r.set(e,Date.now()),s.set(e,t),!0}remove(e){const t=this.usedSet,r=this.itemSet,i=this.itemList,n=this.callbacks;if(r.has(e)){n.get(e)(e);const s=i.indexOf(e);return i.splice(s,1),t.delete(e),r.delete(e),n.delete(e),!0}return!1}markUsed(e){const t=this.itemSet,r=this.usedSet;t.has(e)&&!r.has(e)&&(t.set(e,Date.now()),r.add(e))}markAllUnused(){this.usedSet.clear()} // TODO: this should be renamed because it's not necessarily unloading all unused content // Maybe call it "cleanup" or "unloadToMinSize" unloadUnusedContent(){const e=this.unloadPercent,t=this.minSize,r=this.itemList,i=this.itemSet,n=this.usedSet,s=this.callbacks,a=r.length-n.size,o=r.length-t,l=this.unloadPriorityCallback||this.defaultPriorityCallback;if(o>0&&a>0){r.sort(((e,t)=>{const r=n.has(e),i=n.has(t);return r&&i?0:r||i?r?1:-1:l(t)-l(e)}));const c=Math.min(o,a),u=Math.max(t*e,c*e);let h=Math.min(u,a);h=Math.ceil(h);const p=r.splice(0,h);for(let e=0,t=p.length;e{this.scheduled=!1,this.unloadUnusedContent(),e&&this.markAllUnused()})))}},PriorityQueue=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(){const e=this.priorityCallback;this.items.sort(e)}add(e,t){return new Promise(((r,i)=>{const n=this.items,s=this.callbacks;n.push(e),s.set(e,((...e)=>t(...e).then(r).catch(i))),this.autoUpdate&&this.scheduleJobRun()}))}remove(e){const t=this.items,r=this.callbacks,i=t.indexOf(e);-1!==i&&(t.splice(i,1),r.delete(e))}tryRunJobs(){this.sort();const e=this.items,t=this.callbacks,r=this.maxJobs;let i=this.currJobs;for(;r>i&&e.length>0;){i++;const r=e.pop(),n=t.get(r);t.delete(r),n(r).then((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})).catch((()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}))}this.currJobs=i}scheduleJobRun(){this.scheduled||(this.schedulingCallback(this._runjobs),this.scheduled=!0)}},UNLOADED=0,LOADING=1,PARSING=2,LOADED=3,FAILED=4,WGS84_RADIUS=6378137,WGS84_FLATTENING=1/298.257223563,WGS84_HEIGHT=-(WGS84_FLATTENING*WGS84_RADIUS-WGS84_RADIUS); // node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js // node_modules/3d-tiles-renderer/src/base/traverseFunctions.js function isDownloadFinished(e){return e===LOADED||e===FAILED}function isUsedThisFrame(e,t){return e.__lastFrameVisited===t&&e.__used}function resetFrameState(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 recursivelyMarkUsed(e,t,r){if(resetFrameState(e,t),e.__used=!0,r.markUsed(e),e.__contentEmpty){const i=e.children;for(let e=0,n=i.length;e0&&e.__depth+1>=s)return!0}let c=!1;const u=e.children;for(let e=0,r=u.length;ee.__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,lruPriorityCallback=e=>1/(e.__depthFromRenderedParent+1),TilesRendererBase=class{get rootTileSet(){const e=this.tileSets[this.rootURL];return!e||e instanceof Promise?null:e}get root(){const e=this.rootTileSet;return e?e.root:null}constructor(e){this.tileSets={},this.rootURL=e,this.fetchOptions={},this.preprocessURL=null;const t=new LRUCache;t.unloadPriorityCallback=lruPriorityCallback;const r=new PriorityQueue;r.maxJobs=4,r.priorityCallback=priorityCallback;const i=new PriorityQueue;i.maxJobs=1,i.priorityCallback=priorityCallback,this.lruCache=t,this.downloadQueue=r,this.parseQueue=i,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){const r=this.tileSets[this.rootURL];r&&r.root&&traverseSet(r.root,e,t)} // Public API update(){const e=this.stats,t=this.lruCache,r=this.tileSets,i=r[this.rootURL];if(!(this.rootURL in r))return void this.loadRootTileSet(this.rootURL);if(!i||!i.root)return;const n=i.root;e.inFrustum=0,e.used=0,e.active=0,e.visible=0,this.frameCount++,determineFrustumSet(n,this),markUsedSetLeaves(n,this),skipTraversal(n,this),toggleTiles(n,this),t.scheduleUnload()} // Overrideable parseTile(e,t,r){return null}disposeTile(e){}preprocessNode(e,t,r){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,r+"/").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||[];if(e.content&&e.content.uri){const t=getUrlExtension(e.content.uri),r=Boolean(t&&"json"===t.toLowerCase());e.__externalTileSet=r,e.__contentEmpty=r}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=UNLOADED,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(){const e=this.stats;0!==e.failed&&(this.traverse((e=>{e.__loadingState===FAILED&&(e.__loadingState=UNLOADED)})),e.failed=0)} // Private Functions fetchTileSet(e,t,r=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=>{const i=t.asset.version;console.assert("1.0"===i||"0.0"===i,'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(),traverseSet(t.root,((e,t)=>this.preprocessNode(e,t,n)),null,r,r?r.__depth:0),t}))}loadRootTileSet(e){const t=this.tileSets;if(e in t)return t[e]instanceof Error?Promise.reject(t[e]):Promise.resolve(t[e]);{const r=this.fetchTileSet(this.preprocessURL?this.preprocessURL(e):e,this.fetchOptions).then((r=>{t[e]=r}));return r.catch((r=>{console.error(r),t[e]=r})),t[e]=r,r}}requestTileContents(e){if(e.__loadingState!==UNLOADED)return;const t=this.stats,r=this.lruCache,i=this.downloadQueue,n=this.parseQueue,s=e.__externalTileSet;r.add(e,(e=>{e.__loadingState===LOADING?(e.__loadAbort.abort(),e.__loadAbort=null):s?e.children.length=0:this.disposeTile(e),e.__loadingState===LOADING?t.downloading--:e.__loadingState===PARSING&&t.parsing--,e.__loadingState=UNLOADED,e.__loadIndex++,n.remove(e),i.remove(e)})),e.__loadIndex++;const a=e.__loadIndex,o=new AbortController,l=o.signal;t.downloading++,e.__loadAbort=o,e.__loadingState=LOADING;const c=s=>{e.__loadIndex===a&&("AbortError"!==s.name?(n.remove(e),i.remove(e),e.__loadingState===PARSING?t.parsing--:e.__loadingState===LOADING&&t.downloading--,t.failed++,console.error(`TilesRenderer : Failed to load tile at url "${e.content.uri}".`),console.error(s),e.__loadingState=FAILED):r.remove(e))};s?i.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();const t=this.preprocessURL?this.preprocessURL(e.content.uri):e.content.uri;return this.fetchTileSet(t,Object.assign({signal:l},this.fetchOptions),e)})).then((r=>{e.__loadIndex===a&&(t.downloading--,e.__loadAbort=null,e.__loadingState=LOADED,e.children.push(r.root))})).catch(c):i.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();const 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((r=>{if(e.__loadIndex===a)return t.downloading--,t.parsing++,e.__loadAbort=null,e.__loadingState=PARSING,n.add(e,(e=>{if(e.__loadIndex!==a)return Promise.resolve();const t=getUrlExtension(e.content.uri);return this.parseTile(r,e,t)}))})).then((()=>{e.__loadIndex===a&&(t.parsing--,e.__loadingState=LOADED,e.__wasSetVisible&&this.setTileVisible(e,!0),e.__wasSetActive&&this.setTileActive(e,!0))})).catch(c)}dispose(){const 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}}; // node_modules/3d-tiles-renderer/src/utilities/arrayToString.js function arrayToString(e){return(new TextDecoder).decode(e)} // node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js var FeatureTable=class{constructor(e,t,r,i){this.buffer=e,this.binOffset=t+r,this.binLength=i;let n=null;if(0!==r){const i=new Uint8Array(e,t,r);n=JSON.parse(arrayToString(i))}else n={};this.header=n}getKeys(){return Object.keys(this.header)}getData(e,t,r=null,i=null){const n=this.header;if(!(e in n))return null;const s=n[e];if(s instanceof Object){if(Array.isArray(s))return s;{const{buffer:n,binOffset:a,binLength:o}=this,l=s.byteOffset||0,c=s.type||i,u=s.componentType||r;if("type"in s&&i&&s.type!==i)throw new Error("FeatureTable: Specified type does not match expected type.");let h,p;switch(c){case"SCALAR":h=1;break;case"VEC2":h=2;break;case"VEC3":h=3;break;case"VEC4":h=4;break;default:throw new Error(`FeatureTable : Feature type not provided for "${e}".`)}const d=a+l,m=t*h;switch(u){case"BYTE":p=new Int8Array(n,d,m);break;case"UNSIGNED_BYTE":p=new Uint8Array(n,d,m);break;case"SHORT":p=new Int16Array(n,d,m);break;case"UNSIGNED_SHORT":p=new Uint16Array(n,d,m);break;case"INT":p=new Int32Array(n,d,m);break;case"UNSIGNED_INT":p=new Uint32Array(n,d,m);break;case"FLOAT":p=new Float32Array(n,d,m);break;case"DOUBLE":p=new Float64Array(n,d,m);break;default:throw new Error(`FeatureTable : Feature component type not provided for "${e}".`)}if(d+m*p.BYTES_PER_ELEMENT>a+o)throw new Error("FeatureTable: Feature data read outside binary body length.");return p}}return s}},BatchTable=class extends FeatureTable{constructor(e,t,r,i,n){super(e,r,i,n),this.batchSize=t}getData(e,t=null,r=null){return super.getData(e,this.batchSize,t,r)}},LoaderBase=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){const t=e.split(/[\\/]/g);t.pop();return t.join("/")+"/"}parse(e){throw new Error("LoaderBase: Parse not implemented.")}}; // node_modules/3d-tiles-renderer/src/utilities/readMagicBytes.js function readMagicBytes(e){let t;if(t=e instanceof DataView?e:new DataView(e),"{"===String.fromCharCode(t.getUint8(0)))return null;let r="";for(let e=0;e<4;e++)r+=String.fromCharCode(t.getUint8(e));return r} // node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js var B3DMLoaderBase=class extends LoaderBase{parse(e){const t=new DataView(e),r=readMagicBytes(t);console.assert("b3dm"===r);const i=t.getUint32(4,!0);console.assert(1===i);const n=t.getUint32(8,!0);console.assert(n===e.byteLength);const s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+a),u=new FeatureTable(c,0,s,a),h=28+s+a,p=e.slice(h,h+o+l),d=new BatchTable(p,u.getData("BATCH_LENGTH"),0,o,l),m=h+o+l;return{version:i,featureTable:u,batchTable:d,glbBytes:new Uint8Array(e,m,n-m)}}},GLTFLoader=class extends Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new GLTFMaterialsClearcoatExtension2(e)})),this.register((function(e){return new GLTFTextureBasisUExtension(e)})),this.register((function(e){return new GLTFTextureWebPExtension(e)})),this.register((function(e){return new GLTFMaterialsSheenExtension(e)})),this.register((function(e){return new GLTFMaterialsTransmissionExtension2(e)})),this.register((function(e){return new GLTFMaterialsVolumeExtension2(e)})),this.register((function(e){return new GLTFMaterialsIorExtension(e)})),this.register((function(e){return new GLTFMaterialsEmissiveStrengthExtension(e)})),this.register((function(e){return new GLTFMaterialsSpecularExtension(e)})),this.register((function(e){return new GLTFMaterialsIridescenceExtension2(e)})),this.register((function(e){return new GLTFLightsExtension(e)})),this.register((function(e){return new GLTFMeshoptCompression(e)})),this.register((function(e){return new GLTFMeshGpuInstancing(e)}))}load(e,t,r,i){const n=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const a=function(t){i?i(t):console.error(t),n.manager.itemError(e),n.manager.itemEnd(e)},o=new FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(r){try{n.parse(r,s,(function(r){t(r),n.manager.itemEnd(e)}),a)}catch(e){a(e)}}),r,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,r,i){let n;const s={},a={};if("string"==typeof e)n=JSON.parse(e);else if(e instanceof ArrayBuffer){if(LoaderUtils.decodeText(new Uint8Array(e,0,4))===BINARY_EXTENSION_HEADER_MAGIC){try{s[EXTENSIONS.KHR_BINARY_GLTF]=new GLTFBinaryExtension(e)}catch(e){return void(i&&i(e))}n=JSON.parse(s[EXTENSIONS.KHR_BINARY_GLTF].content)}else n=JSON.parse(LoaderUtils.decodeText(new Uint8Array(e)))}else n=e;if(void 0===n.asset||n.asset.version[0]<2)return void(i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const o=new GLTFParser(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(s),o.setPlugins(a),o.parse(r,i)}parseAsync(e,t){const r=this;return new Promise((function(i,n){r.parse(e,t,i,n)}))}}; // node_modules/three/examples/jsm/loaders/GLTFLoader.js function GLTFRegistry(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var EXTENSIONS={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},GLTFLightsExtension=class{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,s)}},GLTFTextureWebPExtension=class{constructor(e){this.parser=e,this.name=EXTENSIONS.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,n=i.textures[e];if(!n.extensions||!n.extensions[t])return null;const s=n.extensions[t],a=i.images[s.source];let o=r.textureLoader;if(a.uri){const e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(e,s.source,o);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}},GLTFMeshoptCompression=class{constructor(e){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const e=r.extensions[this.name],i=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 i.then((function(t){const r=e.byteOffset||0,i=e.byteLength||0,s=e.count,a=e.byteStride,o=new Uint8Array(t,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,a,o,e.mode,e.filter).then((function(e){return e.buffer})):n.ready.then((function(){const t=new ArrayBuffer(s*a);return n.decodeGltfBuffer(new Uint8Array(t),s,a,o,e.mode,e.filter),t}))}))}return null}},GLTFMeshGpuInstancing=class{constructor(e){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const i=t.meshes[r.mesh];for(const e of i.primitives)if(e.mode!==WEBGL_CONSTANTS2.TRIANGLES&&e.mode!==WEBGL_CONSTANTS2.TRIANGLE_STRIP&&e.mode!==WEBGL_CONSTANTS2.TRIANGLE_FAN&&void 0!==e.mode)return null;const n=r.extensions[this.name].attributes,s=[],a={};for(const e in n)s.push(this.parser.getDependency("accessor",n[e]).then((t=>(a[e]=t,a[e]))));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then((e=>{const t=e.pop(),r=t.isGroup?t.children:[t],i=e[0].count,n=[];for(const e of r){const t=new Matrix4,r=new Vector3,s=new Quaternion,o=new Vector3(1,1,1),l=new InstancedMesh(e.geometry,e.material,i);for(let e=0;e",t).replace("#include ",r).replace("#include ",i).replace("#include ",n).replace("#include ",s)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(e){a.specular.value=e}},specularMap:{get:function(){return a.specularMap.value},set:function(e){a.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(e){a.glossiness.value=e}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(e){a.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},GLTFMaterialsPbrSpecularGlossinessExtension=class{constructor(){this.name=EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return GLTFMeshStandardSGMaterial}extendParams(e,t,r){const i=t.extensions[this.name];e.color=new Color(1,1,1),e.opacity=1;const n=[];if(Array.isArray(i.diffuseFactor)){const t=i.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==i.diffuseTexture&&n.push(r.assignTexture(e,"map",i.diffuseTexture,sRGBEncoding)),e.emissive=new Color(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new Color(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){const t=i.specularGlossinessTexture;n.push(r.assignTexture(e,"glossinessMap",t)),n.push(r.assignTexture(e,"specularMap",t,sRGBEncoding))}return Promise.all(n)}createMaterial(e){const t=new GLTFMeshStandardSGMaterial(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}},GLTFMeshQuantizationExtension=class{constructor(){this.name=EXTENSIONS.KHR_MESH_QUANTIZATION}},GLTFCubicSplineInterpolant=class extends Interpolant{constructor(e,t,r,i){super(e,t,r,i)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=e*i*3+i;for(let e=0;e!==i;e++)t[e]=r[n+e];return t}interpolate_(e,t,r,i){const n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=i-t,u=(r-t)/c,h=u*u,p=h*u,d=e*l,m=d-l,f=-2*p+3*h,g=p-h,_=1-f,y=g-h+u;for(let e=0;e!==a;e++){const t=s[m+e+a],r=s[m+e+o]*c,i=s[d+e+a],l=s[d+e]*c;n[e]=_*t+y*r+f*i+g*l}return n}},_q=new Quaternion,GLTFCubicSplineQuaternionInterpolant=class extends GLTFCubicSplineInterpolant{interpolate_(e,t,r,i){const n=super.interpolate_(e,t,r,i);return _q.fromArray(n).normalize().toArray(n),n}},WEBGL_CONSTANTS2={FLOAT:5126, //FLOAT_MAT2: 35674, 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},WEBGL_COMPONENT_TYPES={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},WEBGL_FILTERS={9728:NearestFilter,9729:LinearFilter,9984:NearestMipmapNearestFilter,9985:LinearMipmapNearestFilter,9986:NearestMipmapLinearFilter,9987:LinearMipmapLinearFilter},WEBGL_WRAPPINGS={33071:ClampToEdgeWrapping,33648:MirroredRepeatWrapping,10497:RepeatWrapping},WEBGL_TYPE_SIZES={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ATTRIBUTES={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES2={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each // keyframe track will be initialized with a default interpolation type, then modified. LINEAR:InterpolateLinear,STEP:InterpolateDiscrete},ALPHA_MODES={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function createDefaultMaterial(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:FrontSide})),e.DefaultMaterial}function addUnknownExtensionsToUserData(e,t,r){for(const i in r.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=r.extensions[i])}function assignExtrasToUserData(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 addMorphTargets(e,t,r){let i=!1,n=!1,s=!1;for(let e=0,r=t.length;e0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"}var GLTFParser=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,n=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||r||i&&n<98?this.textureLoader=new TextureLoader(this.options.manager):this.textureLoader=new ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,i=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([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(t){const s={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:r,userData:{}};addUnknownExtensionsToUserData(n,s,i),assignExtrasToUserData(s,i),Promise.all(r._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)} /** * Marks the special nodes/meshes in json for efficient parse. */_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=t.length;r{const r=this.associations.get(e);null!=r&&this.associations.set(t,r);for(const[r,i]of e.children.entries())n(i,t.children[r])};return n(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r} */getDependency(e,t){const r=e+":"+t;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":i=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":i=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,i)}return i} /** * Requests all dependencies of the specified type asynchronously, with caching. * @param {string} type * @return {Promise>} */getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,i=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(i.map((function(t,i){return r.getDependency(e,i)}))),this.cache.add(e,t)}return t} /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferIndex * @return {Promise} */loadBuffer(e){const t=this.json.buffers[e],r=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[EXTENSIONS.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,n){r.load(LoaderUtils.resolveURL(t.uri,i.path),e,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))} /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferViewIndex * @return {Promise} */loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const r=t.byteLength||0,i=t.byteOffset||0;return e.slice(i,i+r)}))} /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param {number} accessorIndex * @return {Promise} */loadAccessor(e){const t=this,r=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse)return Promise.resolve(null);const n=[];return void 0!==i.bufferView?n.push(this.getDependency("bufferView",i.bufferView)):n.push(null),void 0!==i.sparse&&(n.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(n).then((function(e){const n=e[0],s=WEBGL_TYPE_SIZES[i.type],a=WEBGL_COMPONENT_TYPES[i.componentType],o=a.BYTES_PER_ELEMENT,l=o*s,c=i.byteOffset||0,u=void 0!==i.bufferView?r.bufferViews[i.bufferView].byteStride:void 0,h=!0===i.normalized;let p,d;if(u&&u!==l){const e=Math.floor(c/u),r="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let l=t.cache.get(r);l||(p=new a(n,e*u,i.count*u/o),l=new InterleavedBuffer(p,u/o),t.cache.add(r,l)),d=new InterleavedBufferAttribute(l,s,c%u/o,h)}else p=null===n?new a(i.count*s):new a(n,c,i.count*s),d=new BufferAttribute(p,s,h);if(void 0!==i.sparse){const t=WEBGL_TYPE_SIZES.SCALAR,r=WEBGL_COMPONENT_TYPES[i.sparse.indices.componentType],o=i.sparse.indices.byteOffset||0,l=i.sparse.values.byteOffset||0,c=new r(e[1],o,i.sparse.count*t),u=new a(e[2],l,i.sparse.count*s);null!==n&&(d=new BufferAttribute(d.array.slice(),d.itemSize,d.normalized));for(let e=0,t=c.length;e=2&&d.setY(t,u[e*s+1]),s>=3&&d.setZ(t,u[e*s+2]),s>=4&&d.setW(t,u[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return d}))} /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures * @param {number} textureIndex * @return {Promise} */loadTexture(e){const t=this.json,r=this.options,i=t.textures[e].source,n=t.images[i];let s=this.textureLoader;if(n.uri){const e=r.manager.getHandler(n.uri);null!==e&&(s=e)}return this.loadTextureImage(e,i,s)}loadTextureImage(e,t,r){const i=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];const l=this.loadImageSource(t,r).then((function(t){t.flipY=!1,t.name=s.name||a.name||"";const r=(n.samplers||{})[s.sampler]||{};return t.magFilter=WEBGL_FILTERS[r.magFilter]||LinearFilter,t.minFilter=WEBGL_FILTERS[r.minFilter]||LinearMipmapLinearFilter,t.wrapS=WEBGL_WRAPPINGS[r.wrapS]||RepeatWrapping,t.wrapT=WEBGL_WRAPPINGS[r.wrapT]||RepeatWrapping,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}loadImageSource(e,t){const r=this,i=this.json,n=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const s=i.images[e],a=self.URL||self.webkitURL;let o=s.uri||"",l=!1;if(void 0!==s.bufferView)o=r.getDependency("bufferView",s.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:s.mimeType});return o=a.createObjectURL(t),o}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(o).then((function(e){return new Promise((function(r,i){let s=r;!0===t.isImageBitmapLoader&&(s=function(e){const t=new Texture(e);t.needsUpdate=!0,r(t)}),t.load(LoaderUtils.resolveURL(e,n.path),s,void 0,i)}))})).then((function(e){return!0===l&&a.revokeObjectURL(o),e.userData.mimeType=s.mimeType||getImageURIMimeType(s.uri),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e}));return this.sourceCache[e]=c,c} /** * Asynchronously assigns a texture to the given material parameters. * @param {Object} materialParams * @param {string} mapName * @param {Object} mapDef * @return {Promise} */assignTexture(e,t,r,i){const n=this;return this.getDependency("texture",r.index).then((function(s){if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),n.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){const e=void 0!==r.extensions?r.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=n.associations.get(s);s=n.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),n.associations.set(s,t)}}return void 0!==i&&(s.encoding=i),e[t]=s,s}))} /** * Assigns final material to a Mesh, Line, or Points instance. The instance * already has a material (generated from the glTF material options alone) * but reuse of the same glTF material may require multiple threejs materials * to accommodate different primitive types, defines, etc. New materials will * be created if necessary, and reused from a cache. * @param {Object3D} mesh Mesh, Line, or Points instance. */assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new PointsMaterial,Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){const e="LineBasicMaterial:"+r.uuid;let t=this.cache.get(e);t||(t=new LineBasicMaterial,Material.prototype.copy.call(t,r),t.color.copy(r.color),this.cache.add(e,t)),r=t}if(i||n||s){let e="ClonedMaterial:"+r.uuid+":";r.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),i&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),s&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=r}getMaterialType(){return MeshStandardMaterial} /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param {number} materialIndex * @return {Promise} */loadMaterial(e){const t=this,r=this.json,i=this.extensions,n=r.materials[e];let s;const a={},o=n.extensions||{},l=[];if(o[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=i[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];s=e.getMaterialType(),l.push(e.extendParams(a,n,t))}else if(o[EXTENSIONS.KHR_MATERIALS_UNLIT]){const e=i[EXTENSIONS.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),l.push(e.extendParams(a,n,t))}else{const r=n.pbrMetallicRoughness||{};if(a.color=new Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const e=r.baseColorFactor;a.color.fromArray(e),a.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(t.assignTexture(a,"map",r.baseColorTexture,sRGBEncoding)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===n.doubleSided&&(a.side=DoubleSide);const c=n.alphaMode||ALPHA_MODES.OPAQUE;if(c===ALPHA_MODES.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===ALPHA_MODES.MASK&&(a.alphaTest=void 0!==n.alphaCutoff?n.alphaCutoff:.5)),void 0!==n.normalTexture&&s!==MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",n.normalTexture)),a.normalScale=new Vector2(1,1),void 0!==n.normalTexture.scale)){const e=n.normalTexture.scale;a.normalScale.set(e,e)}return void 0!==n.occlusionTexture&&s!==MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",n.occlusionTexture)),void 0!==n.occlusionTexture.strength&&(a.aoMapIntensity=n.occlusionTexture.strength)),void 0!==n.emissiveFactor&&s!==MeshBasicMaterial&&(a.emissive=(new Color).fromArray(n.emissiveFactor)),void 0!==n.emissiveTexture&&s!==MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",n.emissiveTexture,sRGBEncoding)),Promise.all(l).then((function(){let r;return r=s===GLTFMeshStandardSGMaterial?i[EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new s(a),n.name&&(r.name=n.name),assignExtrasToUserData(r,n),t.associations.set(r,{materials:e}),n.extensions&&addUnknownExtensionsToUserData(i,r,n),r}))} /** When Object3D instances are targeted by animation, they need unique names. */createUniqueName(e){const t=PropertyBinding.sanitizeNodeName(e||"");let r=t;for(let e=1;this.nodeNamesUsed[r];++e)r=t+"_"+e;return this.nodeNamesUsed[r]=!0,r} /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry * * Creates BufferGeometries from primitives. * * @param {Array} primitives * @return {Promise>} */loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function n(e){return r[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return addPrimitiveAttributes(r,e,t)}))}const s=[];for(let r=0,a=e.length;r} */loadMesh(e){const t=this,r=this.json,i=this.extensions,n=r.meshes[e],s=n.primitives,a=[];for(let e=0,t=s.length;e0&&updateMorphTargets(h,n),h.name=t.createUniqueName(n.name||"mesh_"+e),assignExtrasToUserData(h,n),u.extensions&&addUnknownExtensionsToUserData(i,h,u),t.assignFinalMaterial(h),l.push(h)}for(let r=0,i=l.length;r} */loadCamera(e){let t;const r=this.json.cameras[e],i=r[r.type];if(i)return"perspective"===r.type?t=new PerspectiveCamera(MathUtils.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===r.type&&(t=new OrthographicCamera(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),assignExtrasToUserData(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")} /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param {number} skinIndex * @return {Promise} */loadSkin(e){const t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))} /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param {number} animationIndex * @return {Promise} */loadAnimation(e){const t=this.json.animations[e],r=[],i=[],n=[],s=[],a=[];for(let e=0,o=t.channels.length;e} */loadNode(e){const t=this.json,r=this.extensions,i=this,n=t.nodes[e],s=n.name?i.createUniqueName(n.name):"";return function(){const t=[],r=i._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return r&&t.push(r),void 0!==n.camera&&t.push(i.getDependency("camera",n.camera).then((function(e){return i._getNodeRef(i.cameraCache,n.camera,e)}))),i._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let a;if(a=!0===n.isBone?new Bone:t.length>1?new Group:1===t.length?t[0]:new Object3D,a!==t[0])for(let e=0,r=t.length;e} */loadScene(e){const t=this.json,r=this.extensions,i=this.json.scenes[e],n=this,s=new Group;i.name&&(s.name=n.createUniqueName(i.name)),assignExtrasToUserData(s,i),i.extensions&&addUnknownExtensionsToUserData(r,s,i);const a=i.nodes||[],o=[];for(let e=0,r=a.length;e{const t=new Map;for(const[e,r]of n.associations)(e instanceof Material||e instanceof Texture)&&t.set(e,r);return e.traverse((e=>{const r=n.associations.get(e);null!=r&&t.set(e,r)})),t})(s),s}))}};function buildNodeHierarchy(e,t,r,i){const n=r.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===n.skin)return e;let t;return i.getDependency("skin",n.skin).then((function(e){t=e;const r=[];for(let e=0,n=t.joints.length;e{const n=this.manager,s=this.fetchOptions,a=n.getHandler("path.gltf")||new GLTFLoader(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+="/");const l=this.adjustmentTransform;a.parse(r,o,(r=>{const{batchTable:i,featureTable:n}=t,{scene:s}=r,a=n.getData("RTC_CENTER");a&&(s.position.x+=a[0],s.position.y+=a[1],s.position.z+=a[2]),r.scene.updateMatrix(),r.scene.matrix.multiply(l),r.scene.matrix.decompose(r.scene.position,r.scene.quaternion,r.scene.scale),r.batchTable=i,r.featureTable=n,s.batchTable=i,s.featureTable=n,e(r)}),i)}))}},PNTSLoaderBase=class extends LoaderBase{parse(e){const t=new DataView(e),r=readMagicBytes(t);console.assert("pnts"===r);const i=t.getUint32(4,!0);console.assert(1===i);const n=t.getUint32(8,!0);console.assert(n===e.byteLength);const s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),c=e.slice(28,28+s+a),u=new FeatureTable(c,0,s,a),h=28+s+a,p=e.slice(h,h+o+l),d=new BatchTable(p,u.getData("BATCH_LENGTH")||u.getData("POINTS_LENGTH"),0,o,l);return Promise.resolve({version:i,featureTable:u,batchTable:d})}},PNTSLoader=class extends PNTSLoaderBase{constructor(e=DefaultLoadingManager){super(),this.manager=e}parse(e){return super.parse(e).then((e=>{const{featureTable:t}=e,r=t.getData("POINTS_LENGTH"),i=t.getData("POSITION",r,"FLOAT","VEC3"),n=t.getData("RGB",r,"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.`)}));const s=new BufferGeometry;s.setAttribute("position",new BufferAttribute(i,3,!1));const a=new PointsMaterial;a.size=2,a.sizeAttenuation=!1,null!==n&&(s.setAttribute("color",new BufferAttribute(n,3,!0)),a.vertexColors=!0);const o=new Points(s,a);e.scene=o,e.scene.featureTable=t;const 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}))}},I3DMLoaderBase=class extends LoaderBase{parse(e){const t=new DataView(e),r=readMagicBytes(t);console.assert("i3dm"===r);const i=t.getUint32(4,!0);console.assert(1===i);const n=t.getUint32(8,!0);console.assert(n===e.byteLength);const s=t.getUint32(12,!0),a=t.getUint32(16,!0),o=t.getUint32(20,!0),l=t.getUint32(24,!0),c=t.getUint32(28,!0),u=e.slice(32,32+s+a),h=new FeatureTable(u,0,s,a),p=32+s+a,d=e.slice(p,p+o+l),m=new BatchTable(d,h.getData("INSTANCES_LENGTH"),0,o,l),f=p+o+l,g=new Uint8Array(e,f,n-f);let _=null,y=null;if(c)_=g,y=Promise.resolve();else{const e=this.resolveExternalURL(arrayToString(g));y=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=>{_=new Uint8Array(e)}))}return y.then((()=>({version:i,featureTable:h,batchTable:m,glbBytes:_})))}},tempFwd=new Vector3,tempUp=new Vector3,tempRight=new Vector3,tempPos=new Vector3,tempQuat=new Quaternion,tempSca=new Vector3,tempMat=new Matrix4,I3DMLoader=class extends I3DMLoaderBase{constructor(e=DefaultLoadingManager){super(),this.manager=e,this.adjustmentTransform=new Matrix4}resolveExternalURL(e){return this.manager.resolveURL(super.resolveExternalURL(e))}parse(e){return super.parse(e).then((e=>{const{featureTable:t,batchTable:r}=e,i=e.glbBytes.slice().buffer;return new Promise(((e,n)=>{const s=this.fetchOptions,a=this.manager,o=a.getHandler("path.gltf")||new GLTFLoader(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+="/");const c=this.adjustmentTransform;o.parse(i,l,(i=>{const 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.`)}));const h=new Map,p=[];i.scene.traverse((e=>{if(e.isMesh){const{geometry:t,material:r}=e,i=new InstancedMesh(t,r,n);i.position.copy(e.position),i.rotation.copy(e.rotation),i.scale.copy(e.scale),p.push(i),h.set(e,i)}}));const d=new Vector3;for(let e=0;e{const r=t.parent;r&&(r.remove(t),r.add(e),e.updateMatrixWorld(),e.position.copy(d).applyMatrix4(e.matrixWorld))}));for(let e=0;e{const t=new Group;return e.forEach((e=>{t.add(e.scene)})),{tiles:e,scene:t}}))}},GLTFCesiumRTCExtension=class{constructor(){this.name="CESIUM_RTC"}afterRoot(e){if(e.parser.json.extensions&&e.parser.json.extensions.CESIUM_RTC){const{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])}}},GLTFExtensionLoader=class extends LoaderBase{constructor(e=DefaultLoadingManager){super(),this.manager=e}parse(e){return new Promise(((t,r)=>{const i=this.manager,n=this.fetchOptions;let s=i.getHandler("path.gltf")||i.getHandler("path.glb");s||(s=new GLTFLoader(i),s.register((()=>new GLTFCesiumRTCExtension)),"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)}),r)}))}},tempMat2=new Matrix4,TilesGroup=class extends Group{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?tempMat2.copy(this.matrix):tempMat2.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const e=tempMat2.elements,t=this.matrixWorld.elements;let r=!1;for(let i=0;i<16;i++){const n=e[i],s=t[i];if(Math.abs(n-s)>Number.EPSILON){r=!0;break}}if(r){this.matrixWorld.copy(tempMat2);const e=this.children;for(let t=0,r=e.length;t=t&&a<=r&&o>=i&&o<=n){const t=getVector(e);h.push(t),this.getCartographicToPosition(a,o,l,t)}}}return h}getBoundingBox(e,t){resetPool();const{latStart:r,latEnd:i,lonStart:n,lonEnd:s}=this;if(i-r{Object.getPrototypeOf(e).raycast.call(e,t,r)}))}function raycastTraverseFirstHit(e,t,r,i){if(r.has(e)){if(intersectTileScene(e.cached.scene,i,_hitArray),_hitArray.length>0){_hitArray.length>1&&_hitArray.sort(distanceSort);const e=_hitArray[0];return _hitArray.length=0,e}return null}const n=[],s=e.children;for(let e=0,r=s.length;e1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.");const t={distance:1/0,tile:null};n.push(t),t.distance=_vec2.distanceToSquared(_ray3.origin)*e*e,t.tile=r}}}n.sort(distanceSort);let a=1/0,o=null;for(let e=0,s=n.length;ea)break;{const e=s.tile,n=e.cached.scene;let l=null;if(r.has(e)?(intersectTileScene(n,i,_hitArray),_hitArray.length>0&&(_hitArray.length>1&&_hitArray.sort(distanceSort),l=_hitArray[0])):l=raycastTraverseFirstHit(e,t,r,i),l){const e=l.distance*l.distance;e{e.frustumCulled=e[INITIAL_FRUSTUM_CULLED]&&t}))}var TilesRenderer=class extends TilesRendererBase{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(e){this._autoDisableRendererCulling!==e&&(super._autoDisableRendererCulling=e,this.forEachLoadedModel((t=>{updateFrustumCulled(t,!e)})))}constructor(...e){super(...e),this.group=new TilesGroup(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;const t=new LoadingManager;t.setURLModifier((e=>this.preprocessURL?this.preprocessURL(e):e)),this.manager=t;const r=this;this._overridenRaycast=function(e,t){r.optimizeRaycast||Object.getPrototypeOf(this).raycast.call(this,e,t)}} /* Public API */getBounds(e){if(!this.root)return!1;const t=this.root.cached,r=t.box,i=t.boxTransform;return!!r&&(e.copy(r),e.applyMatrix4(i),!0)}getOrientedBounds(e,t){if(!this.root)return!1;const r=this.root.cached,i=r.box,n=r.boxTransform;return!!i&&(e.copy(i),t.copy(n),!0)}getBoundingSphere(e){if(!this.root)return!1;const t=this.root.cached.sphere;return!!t&&(e.copy(t),!0)}forEachLoadedModel(e){this.traverse((t=>{const r=t.cached.scene;r&&e(r,t)}))}raycast(e,t){if(this.root)if(e.firstHitOnly){const r=raycastTraverseFirstHit(this.root,this.group,this.activeTiles,e);r&&t.push(r)}else raycastTraverse(this.root,this.group,this.activeTiles,e,t)}hasCamera(e){return this.cameraMap.has(e)}setCamera(e){const t=this.cameras,r=this.cameraMap;return!r.has(e)&&(r.set(e,new Vector2),t.push(e),!0)}setResolution(e,t,r){const i=this.cameraMap;return!!i.has(e)&&(t instanceof Vector2?i.get(e).copy(t):i.get(e).set(t,r),!0)}setResolutionFromRenderer(e,t){const r=this.cameraMap;if(!r.has(e))return!1;const i=r.get(e);return t.getSize(i),i.multiplyScalar(t.getPixelRatio()),!0}deleteCamera(e){const t=this.cameras,r=this.cameraMap;if(r.has(e)){const i=t.indexOf(e);return t.splice(i,1),r.delete(e),!0}return!1} /* Overriden */fetchTileSet(e,...t){const r=super.fetchTileSet(e,...t);return r.then((t=>{this.onLoadTileSet&&Promise.resolve().then((()=>{this.onLoadTileSet(t,e)}))})),r}update(){const e=this.group,t=this.cameras,r=this.cameraMap,i=this.cameraInfo;if(0===t.length)return void console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");for(;i.length>t.length;)i.pop();for(;i.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let s=0,a=i.length;se.scene));break}case"pnts":{const t=new PNTSLoader(a);t.workingPath=n,t.fetchOptions=s,l=t.parse(e).then((e=>e.scene));break}case"i3dm":{const t=new I3DMLoader(a);t.workingPath=n,t.fetchOptions=s,t.adjustmentTransform.copy(tempMat3),l=t.parse(e).then((e=>e.scene));break}case"cmpt":{const t=new CMPTLoader(a);t.workingPath=n,t.fetchOptions=s,t.adjustmentTransform.copy(tempMat3),l=t.parse(e).then((e=>e.scene));break}case"gltf":case"glb":const t=new GLTFExtensionLoader(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(tempMat3),e.matrix.premultiply(h),e.matrix.decompose(e.position,e.quaternion,e.scale),e.traverse((e=>{e[INITIAL_FRUSTUM_CULLED]=e.frustumCulled})),updateFrustumCulled(e,!this.autoDisableRendererCulling),u.scene=e,e.traverse((e=>{e.raycast=this._overridenRaycast}));const r=[],i=[],n=[];e.traverse((e=>{if(e.geometry&&i.push(e.geometry),e.material){const t=e.material;r.push(e.material);for(const e in t){const r=t[e];r&&r.isTexture&&n.push(r)}}})),u.materials=r,u.geometry=i,u.textures=n,this.onLoadModel&&this.onLoadModel(e,t)}))}disposeTile(e){const t=e.cached;if(t.scene){const r=t.materials,i=t.geometry,n=t.textures,s=t.scene.parent;for(let e=0,t=i.length;e=s+1e3&&(o.update(1e3*a/(e-s),100),s=e,a=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){n=this.end()}, // Backwards Compatibility domElement:t,setMode:i}}; // src/core/viewers/BimViewer.ts Stats.Panel=function(e,t,r){var i=1/0,n=0,s=Math.round,a=s(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,u=2*a,h=3*a,p=15*a,d=74*a,m=30*a,f=document.createElement("canvas");f.width=o,f.height=l,f.style.cssText="width:80px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,c,u),g.fillRect(h,p,d,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(h,p,d,m),{dom:f,update:function(l,_){i=Math.min(i,l),n=Math.max(n,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,o,p),g.fillStyle=t,g.fillText(s(l)+" "+e+" ("+s(i)+"-"+s(n)+")",c,u),g.drawImage(f,h+a,p,d-a,m,h,p,d-a,m),g.fillRect(h+d-a,p,a,m),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(h+d-a,p,a,s((1-l/_)*m))}}};var stats_module_default=Stats,Pass=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(){}},_camera2=new OrthographicCamera(-1,1,1,-1,0,1),_geometry2=new BufferGeometry; // node_modules/three/examples/jsm/postprocessing/Pass.js _geometry2.setAttribute("position",new Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),_geometry2.setAttribute("uv",new Float32BufferAttribute([0,2,0,0,2,0],2));var FullScreenQuad=class{constructor(e){this._mesh=new Mesh(_geometry2,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,_camera2)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},ConvolutionShader={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new Vector2(.001953125,0)},cKernel:{value:[]}},vertexShader: /* glsl */ "\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: /* glsl */ "\n\n\t\tuniform float cKernel[ KERNEL_SIZE_INT ];\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec2 uImageIncrement;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 imageCoord = vUv;\n\t\t\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\n\n\t\t\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {\n\n\t\t\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];\n\t\t\t\timageCoord += uImageIncrement;\n\n\t\t\t}\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}",buildKernel:function(e){let t=2*Math.ceil(3*e)+1;t>25&&(t=25);const r=.5*(t-1),i=new Array(t);let n=0;for(let s=0;s0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,n&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const i=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=i,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=OutlinePass.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=OutlinePass.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=OutlinePass.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=OutlinePass.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(r),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new Vector2(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include \n\t\t\t\t#include \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 \n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\t\t\t\t\t#include \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 \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 ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new Vector2(.5,.5)},visibleEdgeColor:{value:new Vector3(1,1,1)},hiddenEdgeColor:{value:new Vector3(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 ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new Vector2(.5,.5)},direction:{value:new Vector2(.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 \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 ShaderMaterial({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:AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}};OutlinePass.BlurDirectionX=new Vector2(1,0),OutlinePass.BlurDirectionY=new Vector2(0,1); // node_modules/three/examples/jsm/postprocessing/RenderPass.js var RenderPass=class extends Pass{constructor(e,t,r,i,n){super(),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=i,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Color}render(e,t,r){const i=e.autoClear;let n,s;e.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),n=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:r),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,n),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=i}},SAOShader={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 Vector2(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new Matrix4},cameraInverseProjectionMatrix:{value:new Matrix4},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader: /* glsl */ "\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: /* glsl */ "\n\n\t\t#include \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 \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}"},DepthLimitedBlurShader={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new Vector2(512,512)},sampleUvOffsets:{value:[new Vector2(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader: /* glsl */ "\n\n\t\t#include \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: /* glsl */ "\n\n\t\t#include \n\t\t#include \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}"},BlurShaderUtils={createSampleWeights:function(e,t){const r=[];for(let i=0;i<=e;i++)r.push(gaussian(i,t));return r},createSampleOffsets:function(e,t){const r=[];for(let i=0;i<=e;i++)r.push(t.clone().multiplyScalar(i));return r},configure:function(e,t,r,i){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=BlurShaderUtils.createSampleOffsets(t,i),e.uniforms.sampleWeights.value=BlurShaderUtils.createSampleWeights(t,r),e.needsUpdate=!0}}; // node_modules/three/examples/jsm/shaders/SAOShader.js function gaussian(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)} // node_modules/three/examples/jsm/shaders/UnpackDepthRGBAShader.js var UnpackDepthRGBAShader={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader: /* glsl */ "\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: /* glsl */ "\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\t#include \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}"},SAOPass=class extends Pass{constructor(e,t,r=!1,i=!1,n=new Vector2(256,256)){let s;super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=r,this.supportsNormalTexture=i,this.originalClearColor=new Color,this._oldClearColor=new Color,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 Vector2(n.x,n.y),this.saoRenderTarget=new WebGLRenderTarget(this.resolution.x,this.resolution.y),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:NearestFilter,magFilter:NearestFilter}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension&&(s=new DepthTexture,s.type=UnsignedShortType,this.beautyRenderTarget.depthTexture=s,this.beautyRenderTarget.depthBuffer=!0),this.depthMaterial=new MeshDepthMaterial,this.depthMaterial.depthPacking=RGBADepthPacking,this.depthMaterial.blending=NoBlending,this.normalMaterial=new MeshNormalMaterial,this.normalMaterial.blending=NoBlending,void 0===SAOShader&&console.error("THREE.SAOPass relies on SAOShader"),this.saoMaterial=new ShaderMaterial({defines:Object.assign({},SAOShader.defines),fragmentShader:SAOShader.fragmentShader,vertexShader:SAOShader.vertexShader,uniforms:UniformsUtils.clone(SAOShader.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=NoBlending,void 0===DepthLimitedBlurShader&&console.error("THREE.SAOPass relies on DepthLimitedBlurShader"),this.vBlurMaterial=new ShaderMaterial({uniforms:UniformsUtils.clone(DepthLimitedBlurShader.uniforms),defines:Object.assign({},DepthLimitedBlurShader.defines),vertexShader:DepthLimitedBlurShader.vertexShader,fragmentShader:DepthLimitedBlurShader.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=NoBlending,this.hBlurMaterial=new ShaderMaterial({uniforms:UniformsUtils.clone(DepthLimitedBlurShader.uniforms),defines:Object.assign({},DepthLimitedBlurShader.defines),vertexShader:DepthLimitedBlurShader.vertexShader,fragmentShader:DepthLimitedBlurShader.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=NoBlending,void 0===CopyShader&&console.error("THREE.SAOPass relies on CopyShader"),this.materialCopy=new ShaderMaterial({uniforms:UniformsUtils.clone(CopyShader.uniforms),vertexShader:CopyShader.vertexShader,fragmentShader:CopyShader.fragmentShader,blending:NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=CustomBlending,this.materialCopy.blendSrc=DstColorFactor,this.materialCopy.blendDst=ZeroFactor,this.materialCopy.blendEquation=AddEquation,this.materialCopy.blendSrcAlpha=DstAlphaFactor,this.materialCopy.blendDstAlpha=ZeroFactor,this.materialCopy.blendEquationAlpha=AddEquation,void 0===UnpackDepthRGBAShader&&console.error("THREE.SAOPass relies on UnpackDepthRGBAShader"),this.depthCopy=new ShaderMaterial({uniforms:UniformsUtils.clone(UnpackDepthRGBAShader.uniforms),vertexShader:UnpackDepthRGBAShader.vertexShader,fragmentShader:UnpackDepthRGBAShader.fragmentShader,blending:NoBlending}),this.fsQuad=new FullScreenQuad(null)}render(e,t,r){if(this.renderToScreen&&(this.materialCopy.blending=NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1===this.params.output)return;e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const i=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;const 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||(BlurShaderUtils.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Vector2(0,1)),BlurShaderUtils.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Vector2(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=CustomBlending:s.blending=NoBlending,this.renderPass(e,s,this.renderToScreen?null:r),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=i}renderPass(e,t,r,i,n){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,null!=i&&(e.setClearColor(i),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,r,i,n){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,i=t.clearColor||i,n=t.clearAlpha||n,null!=i&&(e.setClearColor(i),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()}}; // node_modules/three/examples/jsm/postprocessing/SAOPass.js SAOPass.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4}; // node_modules/three/examples/jsm/postprocessing/SSAARenderPass.js var SSAARenderPass=class extends Pass{constructor(e,t,r,i){super(),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==i?i:0,this._oldClearColor=new Color,void 0===CopyShader&&console.error("THREE.SSAARenderPass relies on CopyShader");const n=CopyShader;this.copyUniforms=UniformsUtils.clone(n.uniforms),this.copyMaterial=new ShaderMaterial({uniforms:this.copyUniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,transparent:!0,blending:AdditiveBlending,depthTest:!1,depthWrite:!1}),this.fsQuad=new FullScreenQuad(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,r){this.sampleRenderTarget||(this.sampleRenderTarget=new WebGLRenderTarget(r.width,r.height),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");const i=_JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],n=e.autoClear;e.autoClear=!1,e.getClearColor(this._oldClearColor);const s=e.getClearAlpha(),a=1/i.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;const o={fullWidth:r.width,fullHeight:r.height,offsetX:0,offsetY:0,width:r.width,height:r.height},l=Object.assign({},this.camera.view);l.enabled&&Object.assign(o,l);for(let r=0;rh?(p=1,d=0):(p=0,d=1);const m=u-p+l,f=h-d+l,g=u-1+2*l,_=h-1+2*l,y=255&a,T=255&o,v=this.perm[y+this.perm[T]]%12,E=this.perm[y+p+this.perm[T+d]]%12,I=this.perm[y+1+this.perm[T+1]]%12;let b=.5-u*u-h*h;b<0?r=0:(b*=b,r=b*b*this.dot(this.grad3[v],u,h));let x=.5-m*m-f*f;x<0?i=0:(x*=x,i=x*x*this.dot(this.grad3[E],m,f));let S=.5-g*g-_*_;return S<0?n=0:(S*=S,n=S*S*this.dot(this.grad3[I],g,_)),70*(r+i+n)} // 3D simplex noise noise3d(e,t,r){let i,n,s,a;const o=(e+t+r)*(1/3),l=Math.floor(e+o),c=Math.floor(t+o),u=Math.floor(r+o),h=1/6,p=(l+c+u)*h,d=e-(l-p),m=t-(c-p),f=r-(u-p);let g,_,y,T,v,E;d>=m?m>=f?(g=1,_=0,y=0,T=1,v=1,E=0):d>=f?(g=1,_=0,y=0,T=1,v=0,E=1):(g=0,_=0,y=1,T=1,v=0,E=1):mE?32:0)+(v>I?16:0)+(E>I?8:0)+(v>b?4:0)+(E>b?2:0)+(I>b?1:0),S=s[x][0]>=3?1:0,w=s[x][1]>=3?1:0,C=s[x][2]>=3?1:0,M=s[x][3]>=3?1:0,R=s[x][0]>=2?1:0,A=s[x][1]>=2?1:0,D=s[x][2]>=2?1:0,O=s[x][3]>=2?1:0,L=s[x][0]>=1?1:0,P=s[x][1]>=1?1:0,N=s[x][2]>=1?1:0,F=s[x][3]>=1?1:0,U=v-S+l,B=E-w+l,k=I-C+l,G=b-M+l,V=v-R+2*l,H=E-A+2*l,j=I-D+2*l,z=b-O+2*l,q=v-L+3*l,W=E-P+3*l,Y=I-N+3*l,X=b-F+3*l,J=v-1+4*l,$=E-1+4*l,Z=I-1+4*l,K=b-1+4*l,Q=255&f,ee=255&g,te=255&_,re=255&y,ie=a[Q+a[ee+a[te+a[re]]]]%32,ne=a[Q+S+a[ee+w+a[te+C+a[re+M]]]]%32,se=a[Q+R+a[ee+A+a[te+D+a[re+O]]]]%32,ae=a[Q+L+a[ee+P+a[te+N+a[re+F]]]]%32,oe=a[Q+1+a[ee+1+a[te+1+a[re+1]]]]%32;let le=.6-v*v-E*E-I*I-b*b;le<0?c=0:(le*=le,c=le*le*this.dot4(n[ie],v,E,I,b));let ce=.6-U*U-B*B-k*k-G*G;ce<0?u=0:(ce*=ce,u=ce*ce*this.dot4(n[ne],U,B,k,G));let ue=.6-V*V-H*H-j*j-z*z;ue<0?h=0:(ue*=ue,h=ue*ue*this.dot4(n[se],V,H,j,z));let he=.6-q*q-W*W-Y*Y-X*X;he<0?p=0:(he*=he,p=he*he*this.dot4(n[ae],q,W,Y,X));let pe=.6-J*J-$*$-Z*Z-K*K;return pe<0?d=0:(pe*=pe,d=pe*pe*this.dot4(n[oe],J,$,Z,K)),27*(c+u+h+p+d)}},SSAOShader={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 Vector2},cameraProjectionMatrix:{value:new Matrix4},cameraInverseProjectionMatrix:{value:new Matrix4},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader: /* glsl */ "\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: /* glsl */ "\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 \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}"},SSAODepthShader={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 \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}"},SSAOBlurShader={uniforms:{tDiffuse:{value:null},resolution:{value:new Vector2}},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}"},SSAOPass=class extends Pass{constructor(e,t,r,i){super(),this.width=void 0!==r?r:512,this.height=void 0!==i?i: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();const n=new DepthTexture;n.format=DepthStencilFormat,n.type=UnsignedInt248Type,this.beautyRenderTarget=new WebGLRenderTarget(this.width,this.height),this.normalRenderTarget=new WebGLRenderTarget(this.width,this.height,{minFilter:NearestFilter,magFilter:NearestFilter,depthTexture:n}),this.ssaoRenderTarget=new WebGLRenderTarget(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),void 0===SSAOShader&&console.error("THREE.SSAOPass: The pass relies on SSAOShader."),this.ssaoMaterial=new ShaderMaterial({defines:Object.assign({},SSAOShader.defines),uniforms:UniformsUtils.clone(SSAOShader.uniforms),vertexShader:SSAOShader.vertexShader,fragmentShader:SSAOShader.fragmentShader,blending:NoBlending}),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 MeshNormalMaterial,this.normalMaterial.blending=NoBlending,this.blurMaterial=new ShaderMaterial({defines:Object.assign({},SSAOBlurShader.defines),uniforms:UniformsUtils.clone(SSAOBlurShader.uniforms),vertexShader:SSAOBlurShader.vertexShader,fragmentShader:SSAOBlurShader.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new ShaderMaterial({defines:Object.assign({},SSAODepthShader.defines),uniforms:UniformsUtils.clone(SSAODepthShader.uniforms),vertexShader:SSAODepthShader.vertexShader,fragmentShader:SSAODepthShader.fragmentShader,blending:NoBlending}),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 ShaderMaterial({uniforms:UniformsUtils.clone(CopyShader.uniforms),vertexShader:CopyShader.vertexShader,fragmentShader:CopyShader.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:DstColorFactor,blendDst:ZeroFactor,blendEquation:AddEquation,blendSrcAlpha:DstAlphaFactor,blendDstAlpha:ZeroFactor,blendEquationAlpha:AddEquation}),this.fsQuad=new FullScreenQuad(null),this.originalClearColor=new Color}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=LuminanceFormat),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 SSAOPass.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case SSAOPass.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case SSAOPass.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case SSAOPass.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case SSAOPass.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case SSAOPass.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=CustomBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(e,t,r,i,n){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,null!=i&&(e.setClearColor(i),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,r,i,n){e.getClearColor(this.originalClearColor);const s=e.getClearAlpha(),a=e.autoClear;e.setRenderTarget(r),e.autoClear=!1,i=t.clearColor||i,n=t.clearAlpha||n,null!=i&&(e.setClearColor(i),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(){const e=this.kernelSize,t=this.kernel;for(let r=0;r\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 ShaderMaterial({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}"})}}; // node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js UnrealBloomPass.BlurDirectionX=new Vector2(1,0),UnrealBloomPass.BlurDirectionY=new Vector2(0,1); // node_modules/three/examples/jsm/shaders/FXAAShader.js var FXAAShader={uniforms:{tDiffuse:{value:null},resolution:{value:new Vector2(1/1024,1/512)}},vertexShader: /* glsl */ "\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"},import_lodash2=__toESM(require_lodash(),1); // src/components/bottom-bar/BottomBar.ts // node_modules/mitt/dist/mitt.mjs function mitt_default(e){return{all:e=e||new Map,on:function(t,r){var i=e.get(t);i?i.push(r):e.set(t,[r])},off:function(t,r){var i=e.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var i=e.get(t);i&&i.slice().map((function(e){e(r)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,r)}))}}} // package.json var version="0.2.19",BOTTOM_BAR_ID="bottomBar",bottomBarItems={stats:{icon:{default:"icon-showsectionplane"},mutexIds:["statistics"/* statistics */,"cameraInfo"/* cameraInfo */,"tips"/* tips */],onActive:e=>{e.viewer instanceof DxfViewer&&e.viewer.showStats()},onDeactive:e=>{e.viewer instanceof DxfViewer&&e.viewer.hideStats()}},statistics:{icon:{default:"icon-info",active:"icon-info-filled"},mutexIds:["stats"/* stats */,"cameraInfo"/* cameraInfo */,"tips"/* tips */],onActive:e=>{const t=document.createElement("span");if(!e.viewer.scene)return void(t.textContent="Failed!");t.textContent="Comupting...";const r={components:{},points:0,faces:0,materials:{},lights:{}},i=["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"];e.viewer.scene.traverse((e=>{(e instanceof Mesh||e instanceof Line||e instanceof Points)&&!i.includes(e.name)?((e,t)=>{if(t.components[e.type]?t.components[e.type]++:t.components[e.type]=1,e.geometry){const r=e.geometry;if(e instanceof Mesh)if(r.index&&r.index.count){let i=Math.round(r.index.count/3);e instanceof InstancedMesh&&(i*=e.count),t.faces+=i}else if(r.groups.length>0)for(let e=0;e{t.materials[e]?t.materials[e]++:t.materials[e]=1},i=e.material;i instanceof Material?r(i.id):Array.isArray(i)&&i.forEach((e=>r(e.id)))})(e,r):e instanceof Light&&(r.lights[e.type]?r.lights[e.type]++:r.lights[e.type]=1)}));const n=(e,r)=>{t.innerHTML+=`

${e}:${r}

`};t.innerHTML="";const s=` (${(e=>{var t;const r=null==(t=e.renderer)?void 0:t.domElement;return null==r?void 0:r.dataset.engine})(e.viewer)})`;if(n("Version",`${version}${s}`),n("Components",JSON.stringify(r.components)),n("Points",r.points),n("Faces",r.faces),n("Materials",Object.keys(r.materials).length),n("Lights",JSON.stringify(r.lights)),e.viewer instanceof DxfViewer){n("Entities",e.viewer.getEntitiesCount())}e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()},onUpdate:e=>{const t=e.viewer.renderer,r=document.createElement("span"),i=(e,t)=>{r.innerHTML+=`

${e}:${t}

`};r.innerHTML="

-- Renderer Info --

";const n=null==t?void 0:t.info;i("Drawcalls",JSON.stringify(null==n?void 0:n.render.calls)),i("Points",JSON.stringify(null==n?void 0:n.render.points)),i("Lines",JSON.stringify(null==n?void 0:n.render.lines)),i("Triangles",JSON.stringify(null==n?void 0:n.render.triangles)),i("Geometries",JSON.stringify(null==n?void 0:n.memory.geometries)),i("Textures",JSON.stringify(null==n?void 0:n.memory.textures)),e.tooltip.updateChildContent(r)}},cameraInfo:{icon:{default:"icon-view",active:"icon-view-filled"},mutexIds:["stats"/* stats */,"statistics"/* statistics */,"tips"/* tips */],onActive:e=>{const t=()=>{if(!e.viewer||!e.viewer.camera||!e.viewer.controls)return;const r=e.viewer.camera,i=e.viewer.controls,n=e=>CommonUtils.numberToString(e),s=e=>CommonUtils.vectorToString(e),a=r.position,o=i.target;if(a){const t=document.createElement("span");t.innerHTML=`\n

Camera position:${s(a)}

\n

Camera target:${s(o)}

`,r instanceof OrthographicCamera&&(t.innerHTML+=`\n

top: ${n(r.top)}, bottom: ${n(r.bottom)}, left: ${n(r.left)}, right: ${n(r.right)}

\n

zoom: ${n(r.zoom)}

`),e.tooltip.setContent(t)}e.active||window.removeEventListener("mouseup",t)};if(t(),window.addEventListener("mouseup",t),e.viewer instanceof BimViewer){const r=e.viewer.controls;null==r||r.addEventListener("update",t)}else{e.viewer.controls.addEventListener("change",t)}e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}},tips:{icon:{default:"icon-more"},mutexIds:["stats"/* stats */,"cameraInfo"/* cameraInfo */,"cameraInfo"/* cameraInfo */],onActive:e=>{const t=document.createElement("span");e.viewer instanceof BimViewer?t.innerHTML="\n

W: Move forward

\n

A: Move backward

\n

S: Move left

\n

D: Move right

\n

Q: Rise up

\n

E: Lower down

\n

↑: Rotate up

\n

↓: Rotate down

\n

←: Rotate to left

\n

→: Rotate to right

\n ":e.viewer instanceof DxfViewer?t.innerHTML="\n

↑: Move up

\n

↓: Move down

\n

←: Move to left

\n

→: Move to right

\n ":e.viewer instanceof VRViewer?t.innerHTML="\n

↑: Rotate up

\n

↓: Rotate down

\n

←: Rotate to left

\n

→: Rotate to right

\n ":t.innerHTML="\n

Nothing to show

\n ",e.tooltip.setContent(t),e.tooltip.show()},onDeactive:e=>{e.tooltip.hide()}}},BottomBar=class{constructor(e){this.viewer=e,this.itemList=new Map,this.init()}update(){this.itemList.forEach((e=>{e.update()}))}init(){var e;const t=document.createElement("div");t.id=BOTTOM_BAR_ID,t.classList.add("bottom-bar"),(0,import_lodash2.forEach)(bottomBarItems,((e,r)=>{const i=this.createItem(this.viewer,r,e);t.appendChild(i.element)})),this.element=t,null==(e=this.viewer.widgetContainer)||e.appendChild(this.element)}createItem(e,t,r){const i=new BottomBarItem(e,this,t,r);return this.itemList.set(t,i),i}},BottomBarItem=class{constructor(e,t,r,i){this.viewer=e,this.bottomBar=t,this.menuId=r,this.cfg=i,this.eventBus=mitt_default(),this.active=!1,this.itemconfig=i,this.element=this.createButton(this.menuId,i),this.tooltip=new Tooltip(r+"-tooltip",null,{parentNode:e.widgetContainer}),this.eventBus.on("activeChange",(e=>{e?(this.element.classList.add("active"),(0,import_lodash2.forEach)(i.mutexIds,(e=>{var t;const r=null==(t=this.bottomBar)?void 0:t.itemList.get(e);r&&r.active&&r.setActive(!1)})),i.onActive&&i.onActive(this)):(this.element.classList.remove("active"),i.onDeactive&&i.onDeactive(this)),this.element instanceof HTMLElement&&setIcon(this.element.classList,i.icon,this.active)}))}createButton(e,t){const r=document.createElement("i");r.id=e;const{default:i="icon-new",iconFont:n=ICON_FONT_CLASS}=t.icon;return r.classList.add("icon"),r.classList.add(n),r.classList.add(i),r.onclick=()=>{this.active=!this.active,t.onClick&&t.onClick(this),this.eventBus.emit("activeChange",this.active)},r}setActive(e){this.active=e,this.eventBus.emit("activeChange",this.active)}update(){this.active&&this.itemconfig.onUpdate&&this.itemconfig.onUpdate(this)}},import_lodash3=__toESM(require_lodash(),1),PopPanel=class{constructor(e,t,r=document.body){this.container=r,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;const t=e.clientX-this.diffX,r=e.clientY-this.diffY;tthis.container.clientWidth-this.element.clientWidth?this.element.style.left=this.container.clientWidth-this.element.clientWidth+"px":this.element.style.left=t+"px",rthis.container.clientHeight-this.element.clientHeight?this.element.style.top=this.container.clientHeight-this.element.clientHeight+"px":this.element.style.top=r+"px"},this.element=document.createElement("div"),this.element.id=e,this.element.classList.add("pop-panel");const i=document.createElement("div");i.classList.add("pop-panel-header"),i.append(t),this.element.appendChild(i),this.header=i;const n=document.createElement("div");n.classList.add("pop-panel-body"),this.element.appendChild(n),this.body=n,i.addEventListener(MOUSEDOWN_EVENT,this.start),i.addEventListener(MOUSEUP_EVENT,this.stop),this.container.addEventListener(MOUSEMOVE_EVENT,this.follow),this.container.appendChild(this.element)}destroy(){this.container.removeEventListener(MOUSEMOVE_EVENT,this.follow),this.element.removeEventListener(MOUSEDOWN_EVENT,this.start),this.element.removeEventListener(MOUSEUP_EVENT,this.stop),this.container.removeChild(this.element)}},AxisSectionPopPanel=class extends PopPanel{constructor(e){super("axis-section-pop-panel","轴向剖切",e),this.axis="x",this.isVisible=!0,this.eventBus=mitt_default(),this.createGroupSelectLayout(),this.addGroupSelectItems(),this.createActiveSelectLayout(),this.addActiveItems()}createGroupSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-group-select"),this.body.appendChild(e),this.groupSelectNode=e}addGroupSelectItems(){const e=(e,t,r=!1)=>{const i=document.createElement("div");return i.classList.add("pop-panel-item"),i.setAttribute("itemName",e),i.append(t),r&&i.classList.add("active"),this.groupSelectNode&&this.groupSelectNode.appendChild(i),i},t=(e,t)=>s=>{s.stopPropagation(),this.activeItem!==e&&(r.classList.remove("active"),i.classList.remove("active"),n.classList.remove("active"),this.activeItem=e,t.classList.add("active"),this.eventBus.emit("axis",e))},r=e("x"/* X */,"X",!0);r.onclick=t("x"/* X */,r);const i=e("y"/* Y */,"Y");i.onclick=t("y"/* Y */,i);const n=e("z"/* Z */,"Z");n.onclick=t("z"/* Z */,n)}createActiveSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){const e=(e,t)=>{const r=document.createElement("i");r.classList.add(ICON_FONT_CLASS),r.classList.add(t),e.innerHTML="",e.appendChild(r)},t=((t,r,i="")=>{const n=document.createElement("div");return n.classList.add("pop-panel-item"),r&&n.setAttribute("title",r),n.setAttribute("itemName",t),n.setAttribute("isActive","false"),e(n,i),n})("visible","隐藏剖切面","icon-hidesectionplane");t.onclick=()=>{this.isVisible=!this.isVisible,this.isVisible?(e(t,"icon-hidesectionplane"),t.setAttribute("title","隐藏剖切面")):(e(t,"icon-showsectionplane"),t.setAttribute("title","显示剖切面")),this.eventBus.emit("visible",this.isVisible)}}},ObjectPixelSizeHelper=class{constructor(e,t,r,i,n){this.targetPixelHeight=100,this.canvasHeight=800,this.camera=e,this.object=r,this.targetPixelHeight=i,this.canvasHeight=n,this.adjustSize(),t.addEventListener("update",(()=>{this.adjustSize()}))}adjustSize(){const e=new Box3;if(this.object.updateMatrix(),e.expandByObject(this.object),!e)return;const t=e.max.x-e.min.x,r=this.camera.position.distanceTo(this.object.position),i=computePixelHeight(t,r,this.canvasHeight);if(Math.abs(i-this.targetPixelHeight)<5)return;let n=this.object.scale.x;n*=this.targetPixelHeight/i,this.object.scale.set(n,n,n),this.object.updateMatrix()}},computePixelHeight=(e,t,r=800,i=45)=>{const n=i*(Math.PI/180);return r*(e/(2*Math.tan(n/2)*t))},GEOMETRY_RADIUS=4,DEFAULT_COLOR=new Color(0,.855,.718),HIGHLIGHT_COLOR=new Color(1,1,0),RED_COLOR=new Color(1,0,0),GREEN_COLOR=new Color(0,1,0),BLUE_COLOR=new Color(0,0,1),BasePlaneSection=class{ // used to adjust gizmo size /** * Constructor */ constructor(e,t,r,i){ // basic member data this.isOpen=!1,this.isSectionObjectVisible=!0,this.gizmo=new Group,this.canvasHeight=800, // --------------- Sectionping plane ------------------ this.boxMin=new Vector3, // min point of section plane, use its 'y' for constrant this.boxMax=new Vector3, // max point of section plane (ignore its y) this.group=new Group, // contains any object for section this.hoverGroup=new Group, // container any mesh for hover visibles, todo remove this.planes=[], // section plane this.vertices=[new Vector3,new Vector3,new Vector3,new Vector3],this.pointMarkers=[],this.lines=[], // ------------------- Mouse events ----------------------- // basic data member this.raycaster=new Raycaster,this.mousePosition=new Vector2,this.activeFace=void 0, // the face that the mouse is hovering this.activeMarker=void 0,this.isMouseDown=!1,this.activeActionType=""/* None */, /** * Handles mouse move event, highlights corresponding face/lines properly */ this.onMouseMove=e=>{var t;if(!this.isSectionObjectVisible)return;const r=(e,t=!1)=>{const r=this.gizmo.children.find((t=>t.userData.actionType===e));if(!r||0===r.children.length)return;const i=r.children[0].material,n=r.children.length>1?r.children[1]:void 0;t?(i.color.set(HIGHLIGHT_COLOR),"RotateX"/* RotateX */!==e&&"RotateY"/* RotateY */!==e&&"RotateZ"/* RotateZ */!==e||n&&(n.visible=!0)):"TranslateX"/* TranslateX */===e?i.color.set(RED_COLOR):"TranslateY"/* TranslateY */===e?i.color.set(GREEN_COLOR):"TranslateZ"/* TranslateZ */===e?i.color.set(BLUE_COLOR):"RotateX"/* RotateX */===e?(i.color.set(RED_COLOR),n&&(n.visible=!1)):"RotateY"/* RotateY */===e?(i.color.set(GREEN_COLOR),n&&(n.visible=!1)):"RotateZ"/* RotateZ */===e&&(i.color.set(BLUE_COLOR),n&&(n.visible=!1))};this.updateMouseAndRay(e);const i=[this.gizmo,this.face],n=this.raycaster.intersectObjects(i,!0);if(n.length<=0)return""/* None */!==this.activeActionType&&(r(this.activeActionType,!1),this.activeActionType=""/* None */),this.activeFace&&(this.activeFace.setActive(!1),this.activeFace=void 0),this.renderer.domElement.style.cursor="auto",void(this.gizmo.visible=!1);const s=n[0].object;if(s instanceof BoxFace){const e=s;""/* None */!==this.activeActionType&&(r(this.activeActionType,!1),this.activeActionType=""/* None */),this.activeFace||(e.setActive(!0),this.activeFace=e)}else{const e=(null==(t=s.parent)?void 0:t.userData.actionType)||""/* None */;this.activeActionType!==e&&(""/* None */!==this.activeActionType&&r(this.activeActionType,!1),r(e,!0),this.activeActionType=e)}this.gizmo.visible=!0,this.renderer.domElement.style.cursor="pointer"}, /** * Handles mouse down event, starts to drag a face using left button */ this.onMouseDown=e=>{if(e.stopPropagation(),!this.isSectionObjectVisible)return;if(!(0===e.button))return;this.isMouseDown=!0,this.updateMouseAndRay(e);this.raycaster.intersectObjects([this.gizmo],!0).length>0&&this.dragStart()},this.dragMove=e=>{const t=new Vector3(1,0,0),r=new Vector3(0,1,0),i=new Vector3(0,0,1),n=this.getCanvasPos(e);if(!this.isMouseDown)return;if(!this.lastCanvasPos)return void(this.lastCanvasPos=[n[0],n[1]]);const s=this.lastCanvasPos;switch(this.activeActionType){case"TranslateX"/* TranslateX */:this.dragTranslateSectionPlane(t,s,n);break;case"TranslateY"/* TranslateY */:this.dragTranslateSectionPlane(r,s,n);break;case"TranslateZ"/* TranslateZ */:this.dragTranslateSectionPlane(i,s,n);break;case"RotateX"/* RotateX */:this.dragRotateSectionPlane(t,s,n);break;case"RotateY"/* RotateY */:this.dragRotateSectionPlane(r,s,n);break;case"RotateZ"/* RotateZ */:this.dragRotateSectionPlane(i,s,n)}this.lastCanvasPos=[n[0],n[1]],this.renderer.render(this.scene,this.camera)},this.dragUp=()=>{this.isMouseDown=!1,this.controls.enablePan=!0,this.controls.enableZoom=!0,this.controls.enableRotate=!0,this.lastCanvasPos=void 0,window.removeEventListener("pointermove",this.dragMove),window.removeEventListener("pointerup",this.dragUp),window.addEventListener("pointermove",this.onMouseMove)},this.scene=e,this.camera=t,this.renderer=r,this.controls=i} /** * If plane is not assigned in constructor, then set it here. * For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionPlane properly. */setSectionPlane(e){e=e.clone(),CommonUtils.expandBoxByScale(e,1.2);const t=e.max,r=e.min,i=t.x-r.x+t.y-r.y+t.z-r.z;CommonUtils.expandBoxByMinSize(e,i/3);const n=(e.min.y+e.max.y)/2;this.boxMin.set(e.min.x,n,e.min.z),this.boxMax.set(e.max.x,n,e.max.z),GEOMETRY_RADIUS=i/300}rotatePlane(e,t){this.gizmo.rotateOnAxis(e,t),this.group.rotateOnAxis(e,t),this.updatePlanes()}movePlaneToCenter(e){this.gizmo.position.set(e.x,e.y,e.z),this.group.position.set(e.x,e.y,e.z),this.updatePlanes()} /** * Sets section object's visibility, in case caller don't want to see it */setSectionObjectVisible(e){this.isSectionObjectVisible=e,this.group.visible=e,this.gizmo.visible=e,this.renderer.render(this.scene,this.camera)} /** * Starts to section */open(){this.initSectionPlane(),this.setSectionObjectVisible(this.isSectionObjectVisible),this.addMouseListener(),this.isOpen=!0} /** * Close section */close(){this.isOpen=!1,this.removeMouseListener(),this.clearSectionPlane()} /** * reset section */reset(){this.close(),this.open()} /** * Sets a matrix for section planes, which constains rotation on x, y, z, scale, etc. * Should call this after initSectionPlane() is called. * The rotation can be any value, but the editor (drag tool) doesn't work well when rotation is too big! * So, we'd better to limmit user from applying a big value. */setMatrix(e){this.group.applyMatrix4(e),this.gizmo.applyMatrix4(e),this.planes.forEach((t=>t.applyMatrix4(e)))} /** * Initialize section plane */initSectionPlane(){this.group=new Group,this.initOrUpdateVertices(),this.initGizmo(),this.updateHoverVisibles(),this.initControllerMarkers(),this.initOrUpdateFace(),this.initOrUpdateLines(),this.initPlanes(),this.scene.add(this.gizmo),this.scene.add(this.group)} /** * Initialize section planes */initPlanes(){this.planes=[],this.planes.push( // for a section panel, objects in a direction/normal is visible new Plane(new Vector3(0,-1,0)), // up new Plane(new Vector3(-1,0,0)), // xLeft new Plane(new Vector3(0,0,1)), // zFront new Plane(new Vector3(1,0,0)), // xRight new Plane(new Vector3(0,0,-1))),this.updatePlanes()} /** * Updates planes for section plane */updatePlanes(){const e=new Matrix4;let t,r;e.makeRotationFromQuaternion(this.gizmo.quaternion);const i=this.gizmo.position;r=new Vector3(0,-1,0).applyMatrix4(e),this.planes[0].setFromNormalAndCoplanarPoint(r,i),r=new Vector3(-1,0,0).applyMatrix4(e),t=this.pointMarkers[0].position.clone(),t=this.localToWorldVec(t,!1),this.planes[1].setFromNormalAndCoplanarPoint(r,t.add(i)),r=new Vector3(0,0,1).applyMatrix4(e),t=this.pointMarkers[1].position.clone(),t=this.localToWorldVec(t,!1),this.planes[2].setFromNormalAndCoplanarPoint(r,t.add(i)),r=new Vector3(1,0,0).applyMatrix4(e),t=this.pointMarkers[2].position.clone(),t=this.localToWorldVec(t,!1),this.planes[3].setFromNormalAndCoplanarPoint(r,t.add(i)),r=new Vector3(0,0,-1).applyMatrix4(e),t=this.pointMarkers[3].position.clone(),t=this.localToWorldVec(t,!1),this.planes[4].setFromNormalAndCoplanarPoint(r,t.add(i))} /** * Initialize or update 4 vertices of section plane */initOrUpdateVertices(){const e=this.boxMax.y;this.vertices[0].set(this.boxMin.x,e,this.boxMin.z),this.vertices[1].set(this.boxMin.x,e,this.boxMax.z),this.vertices[2].set(this.boxMax.x,e,this.boxMax.z),this.vertices[3].set(this.boxMax.x,e,this.boxMin.z)}initControllerMarkers(){const e=(e,t,r)=>{const i=new SphereGeometry(GEOMETRY_RADIUS),n=new MeshPhongMaterial({color:DEFAULT_COLOR});n.depthTest=!1;const s=new Mesh(i,n);s.name=r,s.position.set((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2),this.pointMarkers.push(s),this.group.add(s),s.visible=!1},t=this.vertices,r=this.gizmo.position;e(t[0].clone().sub(r),t[1].clone().sub(r),"xLeft"),e(t[1].clone().sub(r),t[2].clone().sub(r),"zFront"),e(t[2].clone().sub(r),t[3].clone().sub(r),"xRight"),e(t[3].clone().sub(r),t[0].clone().sub(r),"zBack")}updateControllerMarkers(){const e=(e,t,r)=>{r.position.set((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2)},t=this.vertices,r=this.gizmo.position;e(t[0].clone().sub(r),t[1].clone().sub(r),this.pointMarkers[0]),e(t[1].clone().sub(r),t[2].clone().sub(r),this.pointMarkers[1]),e(t[2].clone().sub(r),t[3].clone().sub(r),this.pointMarkers[2]),e(t[3].clone().sub(r),t[0].clone().sub(r),this.pointMarkers[3])} /** * Initialize 1 face of section plane */initOrUpdateFace(){const e=e=>e.clone().sub(this.group.position),t=this.vertices.map((t=>e(t)));if(this.face)this.face.setFromPoints(t);else{let e=0;this.face=new BoxFace("yUp",[t[e++],t[e++],t[e++],t[e++]]),this.group.add(this.face)}} // initially update center position updateHoverVisibles(){this.gizmo.position.setX((this.boxMin.x+this.boxMax.x)/2),this.gizmo.position.setY(this.boxMax.y),this.gizmo.position.setZ((this.boxMin.z+this.boxMax.z)/2),this.group.position.setX((this.boxMin.x+this.boxMax.x)/2),this.group.position.setY(this.boxMax.y),this.group.position.setZ((this.boxMin.z+this.boxMax.z)/2)} // create hover objects initGizmo(){const e={arrowHead:new CylinderGeometry(0,GEOMETRY_RADIUS,3*GEOMETRY_RADIUS),axis:new CylinderGeometry(GEOMETRY_RADIUS/5,GEOMETRY_RADIUS/5,20*GEOMETRY_RADIUS),pickableAxis:new CylinderGeometry(GEOMETRY_RADIUS,GEOMETRY_RADIUS,23*GEOMETRY_RADIUS),curve:new TorusGeometry(12*GEOMETRY_RADIUS,GEOMETRY_RADIUS/5,8,12,Math.PI/2),pickableCurve:new TorusGeometry(12*GEOMETRY_RADIUS,GEOMETRY_RADIUS,6,4,Math.PI/2),hoop:new TorusGeometry(12*GEOMETRY_RADIUS,GEOMETRY_RADIUS/5,8,64,2*Math.PI),sphere:new SphereGeometry(GEOMETRY_RADIUS)},t={red:new MeshPhongMaterial({color:RED_COLOR,depthTest:!1}),green:new MeshPhongMaterial({color:GREEN_COLOR,depthTest:!1}),blue:new MeshPhongMaterial({color:BLUE_COLOR,depthTest:!1}),center:new MeshPhongMaterial({color:DEFAULT_COLOR,depthTest:!1}),highlight:new MeshPhongMaterial({color:HIGHLIGHT_COLOR,depthTest:!1}),pickable:new MeshBasicMaterial({wireframe:!0,transparent:!0,opacity:0,side:BackSide})},r=new Matrix4;r.makeScale(.6,.6,.6);const i=(e,t)=>{const r=new Matrix4;return r.makeRotationAxis(new Vector3(...t),MathUtils.degToRad(e)),r},n=(e,t,r)=>{const i=new Matrix4;return i.makeTranslation(e,t,r),i},s=(e,t=r)=>{const i=new Matrix4;return i.multiplyMatrices(e,t),i},a=(r,i,n)=>{const s=new Mesh(e.curve,n.clone()),a=new Mesh(e.hoop,t.highlight.clone());a.visible=!1;const o=new Mesh(e.pickableCurve,t.pickable.clone()),l=new Group;l.userData.actionType=r,l.add(s,a,o),l.applyMatrix4(i),this.gizmo.add(l)};let o=s(i(90,[1,0,0]),i(90,[0,1,0]));a("RotateX"/* RotateX */,o,t.red),o=i(90,[0,0,1]),a("RotateZ"/* RotateZ */,o,t.blue);const l=(r,i,n,s)=>{const a=mergeBufferGeometries([e.arrowHead.clone().applyMatrix4(n),e.axis.clone().applyMatrix4(i)]),o=new Mesh(a,s),l=e.pickableAxis.clone().applyMatrix4(i),c=new Mesh(l,t.pickable),u=new Group;u.userData.actionType=r,u.add(o,c),this.gizmo.add(u)},c=10*GEOMETRY_RADIUS,u=2*c;let h=s(i(90,[0,0,1]),n(0,c,0)),p=s(i(90,[0,0,1]),n(0,u,0));l("TranslateX"/* TranslateX */,h,p,t.red),h=n(0,c,0),p=s(i(0,[1,0,0]),n(0,u,0)),l("TranslateY"/* TranslateY */,h,p,t.green),h=s(i(90,[1,0,0]),n(0,c,0)),p=s(i(90,[1,0,0]),n(0,u,0)),l("TranslateZ"/* TranslateZ */,h,p,t.blue);const d=new Mesh(e.sphere,t.center);d.userData.actionType=""/* None */,this.gizmo.add(d),this.gizmo.visible=!1,this.objectPixelSizeHelper||(this.objectPixelSizeHelper=new ObjectPixelSizeHelper(this.camera,this.controls,this.gizmo,200,this.canvasHeight));const m=this.objectPixelSizeHelper;setTimeout((()=>{m.adjustSize(),this.renderer.render(this.scene,this.camera)}),0)} /** * Initialize 4 lines of section plane */initOrUpdateLines(){const e=this.vertices;if(this.lines&&0!==this.lines.length){let t=0;const r=this.gizmo.position;this.lines[t].setFromPoints([e[t].clone().sub(r),e[++t].clone().sub(r)]),this.lines[t].setFromPoints([e[t].clone().sub(r),e[++t].clone().sub(r)]),this.lines[t].setFromPoints([e[t].clone().sub(r),e[++t].clone().sub(r)]),this.lines[t].setFromPoints([e[t].clone().sub(r),e[0].clone().sub(r)])}else{const t=this.face;if(!t)throw Error("Need to init Face first!");const r=this.gizmo.position;this.lines.push(new BoxLine([e[0].clone().sub(r),e[1].clone().sub(r)],[t]),new BoxLine([e[1].clone().sub(r),e[2].clone().sub(r)],[t]),new BoxLine([e[2].clone().sub(r),e[3].clone().sub(r)],[t]),new BoxLine([e[3].clone().sub(r),e[0].clone().sub(r)],[t])),this.group.add(...this.lines)}} /** * Clears section plane */clearSectionPlane(){this.scene.remove(this.group),this.scene.remove(this.gizmo),this.renderer.domElement.style.cursor=""} /** * Adds mouse event listener */addMouseListener(){window.addEventListener("pointermove",this.onMouseMove),window.addEventListener("pointerdown",this.onMouseDown)} /** * Removes mouse event listener */removeMouseListener(){window.removeEventListener("pointermove",this.onMouseMove),window.removeEventListener("pointerdown",this.onMouseDown)} /** * Converts mouse coordinates, and updates raycaster */updateMouseAndRay(e){const t=this.renderer.domElement,r=t.clientWidth,i=t.clientHeight;this.mousePosition.setX(e.offsetX/r*2-1),this.mousePosition.setY(-e.offsetY/i*2+1),this.raycaster.setFromCamera(this.mousePosition,this.camera)}getCanvasPos(e){return[e.clientX,e.clientY]}localToWorldVec(e,t=!0){const r=new Matrix4;let i=e.clone();return r.makeRotationFromQuaternion(this.group.quaternion),i=i.applyMatrix4(r),t&&i.normalize(),i} // protected worldToLocalVec(worldVec: Vector3, normalize = true) { // const mat = new THREE.Matrix4(); // const localVec = worldVec.clone(); // mat.makeRotationFromQuaternion(this.group.quaternion); // mat.invert(); // localVec.applyMatrix4(mat); // return localVec; // } getTranslationPlane(e){let t;const r=e.clone(),i=Math.abs(e.x);return t=i>Math.abs(e.y)&&i>Math.abs(e.z)?r.cross(new Vector3(0,1,0)):r.cross(new Vector3(1,0,0)),t=t.cross(e),t.normalize(),t}getPointerPlaneIntersect(e,t,r=0){let i;const n=new Vector4(0,0,0,1),s=new Matrix4;n.setX(e[0]/window.innerWidth*2-1),n.setY(-(e[1]/window.innerHeight*2-1)),s.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),s.invert(),n.applyMatrix4(s),n.multiplyScalar(1/n.w);const a=new Vector3(n.x,n.y,n.z),o=this.camera.position;a.sub(o);const l=this.gizmo.position,c=-l.dot(t)-r,u=t.dot(a);if(Math.abs(u)>1e-4){const e=-(t.dot(o)+c)/u;return i=a.multiplyScalar(e),i=i.add(o),i=i.sub(l),i}log.info("[Section] Can't get the intersection. dot=",u)}dragTranslateSectionPlane(e,t,r){if(!this.gizmo.visible)return;const i=this.localToWorldVec(e),n=this.getTranslationPlane(i),s=this.getPointerPlaneIntersect(t,n);let a=this.getPointerPlaneIntersect(r,n);if(!s)return;if(!a)return;a=a.sub(s);const o=a.dot(i),l=new Matrix4;l.makeTranslation(i.x*o,i.y*o,i.z*o),this.group.applyMatrix4(l),this.gizmo.applyMatrix4(l),this.planes.forEach((e=>{e.applyMatrix4(l)}))}dragRotateSectionPlane(e,t,r){if(!this.gizmo.visible)return;let i=new Vector3,n=0;const s=this.localToWorldVec(e);let a=this.getPointerPlaneIntersect(t,s),o=this.getPointerPlaneIntersect(r,s);if(!(a&&o)){const e=this.getTranslationPlane(s);a=this.getPointerPlaneIntersect(t,e,1),o=this.getPointerPlaneIntersect(r,e,1),a&&o&&(n=a.dot(s),a.setX(a.x-n*s.x),a.setY(a.y-n*s.y),a.setZ(a.z-n*s.z),n=o.dot(s),o.setX(o.x-n*s.x),o.setY(o.y-n*s.y),o.setZ(o.z-n*s.z))}if(a&&o){a.normalize(),o.normalize(),n=a.dot(o),n=MathUtils.clamp(n,-1,1);let t=Math.acos(n);i=a.cross(o),i.dot(s)<0&&(t=-t),this.gizmo.rotateOnAxis(e,t),this.group.rotateOnAxis(e,t),this.updatePlanes()}}updatePosition(){this.updateHoverVisibles(),this.initOrUpdateVertices(),this.initOrUpdateLines(),this.updateControllerMarkers(),this.updatePlanes(),this.initOrUpdateFace()}dragStart(){this.controls.enablePan=!1,this.controls.enableZoom=!1,this.controls.enableRotate=!1,log.info("[Section] dragStart"),window.removeEventListener("pointermove",this.onMouseMove),window.addEventListener("pointermove",this.dragMove),window.addEventListener("pointerup",this.dragUp)}},BoxLine=class extends LineSegments{ // active color of line (original color: 0x00ffff) /** * @param vertices two points of a line * @param faces two faces relative to a line */ constructor(e,t){super(), // basic data member // 0x795548 0x4e342e this.normalMaterial=new LineBasicMaterial({color:7951688}), // normal color of line (original color: 0xe1f2fb) this.activeMaterial=new LineBasicMaterial({color:DEFAULT_COLOR}),t.forEach((e=>e.lines.push(this))),this.geometry=new BufferGeometry,this.geometry.setFromPoints(e),this.normalMaterial.depthTest=!1,this.activeMaterial.depthTest=!1,this.material=this.normalMaterial} /** * Updates geometry */setFromPoints(e){this.geometry.setFromPoints(e)} /** * Sets to active or inactive * @param isActive */setActive(e){this.material=e?this.activeMaterial:this.normalMaterial}},BoxFace=class extends Mesh{ // 4 lines relative to a face /** * @param axis axis of a face * @param vertices 4 points of a face */ constructor(e,t){super(),this.lines=[],this.name=SECTION_PLANE_NAME,this.axis=e,this.lines=[],this.geometry=new BufferGeometry,this.geometry.setFromPoints(t),this.geometry.setIndex([0,3,2,0,2,1]),this.geometry.computeVertexNormals(),this.material=new MeshBasicMaterial({colorWrite:!1,depthWrite:!1,side:DoubleSide})} /** * Updates geometry */setFromPoints(e){this.geometry.setFromPoints(e)} /** * Sets to active or inactive * @param isActive */setActive(e){this.lines.forEach((t=>{t.setActive(e)}))}},AxisPlaneSection=class{constructor(e,t,r){if(this.container=r,this.isShowSectionPlane=!0,this.viewer=e,!e.camera||!e.renderer||!e.controls)throw new Error("Invalid bimViewer!");this.camera=e.camera,this.scene=e.scene,this.renderer=e.renderer,this.controls=e.controls,this.objectIds=t,this.axisInfoMap={x:{normal:new Vector3(1,0,0)},y:{normal:new Vector3(0,1,0)},z:{normal:new Vector3(0,0,1)}}}getRotateParam(e){const t=this.axisInfoMap[e].normal,r=new Vector3(0,1,0);let i;i=1===t.y||-1===t.y?new Vector3(1,0,0):r.clone().cross(t);return[i,Math.acos(t.dot(r))]}initPlane(e){const[t,r]=this.getRotateParam(e);this.sectionPlane&&(this.cancelSection(),this.sectionPlane.close()),this.sectionPlane=new BasePlaneSection(this.scene,this.camera,this.renderer,this.controls),this.sectionPlane.setSectionPlane(this.viewer.getBBox()),this.sectionPlane.open(),this.sectionPlane.rotatePlane(t,r),this.enableSection()}open(){this.initPlane("x"/* X */),this.popPanel=new AxisSectionPopPanel(this.container);const e=this.popPanel.eventBus;e.on("visible",(e=>{e?this.showSectionPlane():this.hideSectionPlane()})),e.on("axis",(e=>{this.initPlane(e),this.renderer.render(this.scene,this.camera)}))}close(){this.sectionPlane&&(this.sectionPlane.close(),this.sectionPlane=void 0),this.popPanel&&(this.popPanel.destroy(),this.popPanel=void 0),this.cancelSection()}enableSection(){this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t;["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{var t;e.clippingPlanes=null==(t=this.sectionPlane)?void 0:t.planes,e.clipIntersection=!0})):e.material&&(e.material.clippingPlanes=null==(t=this.sectionPlane)?void 0:t.planes,e.material.clipIntersection=!0))}))}))}cancelSection(){this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}showSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!0,this.sectionPlane.setSectionObjectVisible(!0))}hideSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!1,this.sectionPlane.setSectionObjectVisible(!1))}},DEFAULT_COLOR2=new Color(0,.855,.718),HIGHLIGHT_COLOR2=new Color(1,1,0),GEOMETRY_RADIUS2=.5,MIN_WIDTH=.2,getCenter=e=>{const t=e[0].clone(),r=e[1].clone(),i=e[2].clone(),n=e[3].clone();return t.add(r).add(i).add(n).multiplyScalar(.25)},BaseBoxSection=class{ // the active section view, top, left, etc. /** * Constructor */ constructor(e,t,r,i){this.isOpen=!1,this.draggableArrowView="", // the active section view, top, left, etc. this.visibleArrowView="", // --------------- Clipping box -------------------- // basic data member this.sectionBoxBoundary=new Box3, // boundary of the section box this.group=new Group, // contains any object for section this.arrows=new Map, // arrow gizmos this.planes=[], // section planes this.vertices=[new Vector3,new Vector3,new Vector3,new Vector3, // 4 vertices at the top new Vector3,new Vector3,new Vector3,new Vector3],this.faces=[],this.lines=[],this.sectionPlaneMap=new Map, // ------------------- Mouse events ----------------------- // basic data member this.raycaster=new Raycaster,this.mousePosition=new Vector2,this.activeFace=null, /** * Handles mouse move event, highlights corresponding face/lines properly */ this.onMouseMove=e=>{const t=(e,t=!1,r=!1)=>{const i=this.arrows.get(e);if(!i)return;const n=i.children[0].material;t?(n.opacity=1,n.color.set(HIGHLIGHT_COLOR2)):r?(n.opacity=1,n.color.set(DEFAULT_COLOR2)):(n.color.set(DEFAULT_COLOR2),n.opacity=0)};this.updateMouseAndRay(e);const r=[...this.arrows.values(),...this.faces],i=this.raycaster.intersectObjects(r,!0);if(i.length<=0)return this.draggableArrowView&&(t(this.draggableArrowView,!1),this.draggableArrowView=""),this.visibleArrowView&&(t(this.visibleArrowView,!1),this.visibleArrowView=""),this.activeFace&&(this.activeFace.setActive(!1),this.activeFace=null),void(this.renderer.domElement.style.cursor="auto");const n=i[0].object;if(n instanceof BoxFace2){const e=n;this.draggableArrowView&&(e!==this.activeFace?t(this.draggableArrowView,!1):t(this.draggableArrowView,!1,!0),this.draggableArrowView=""),e!==this.activeFace&&(this.activeFace&&(this.activeFace.setActive(!1),this.visibleArrowView&&(t(this.visibleArrowView,!1),this.visibleArrowView="")),e.setActive(!0),t(e.axis,!1,!0),this.activeFace=e,this.visibleArrowView=e.axis)}else{const e=n.userData.view;this.draggableArrowView!==e&&(this.draggableArrowView&&t(this.draggableArrowView,!1),t(e,!0),this.draggableArrowView=e)}this.renderer.domElement.style.cursor="pointer"},this.isMouseDown=!1, /** * Handles mouse down event, starts to drag a face using left button */ this.onMouseDown=e=>{const t=0===e.button;t&&(this.isMouseDown=!0,this.lastCanvasPos=[e.clientX,e.clientY],this.draggableArrowView&&t&&this.dragStart())},this.dragStart=()=>{log.info("[Section] dragStart"),this.controls.enablePan=!1,this.controls.enableZoom=!1,this.controls.enableRotate=!1,window.removeEventListener("pointermove",this.onMouseMove),window.addEventListener("pointermove",this.dragMove),window.addEventListener("pointerup",this.dragEnd)},this.dragEnd=()=>{log.info("[Section] dragEnd"),this.controls.enablePan=!0,this.controls.enableZoom=!0,this.controls.enableRotate=!0,this.isMouseDown=!1,window.removeEventListener("pointermove",this.dragMove),window.removeEventListener("pointerup",this.dragEnd),window.addEventListener("pointermove",this.onMouseMove)},this.dragMove=e=>{const t=new Vector3(1,0,0),r=new Vector3(0,1,0),i=new Vector3(0,0,1),n=[e.clientX,e.clientY];if(this.isMouseDown){switch(this.lastCanvasPos||(this.lastCanvasPos=n),this.draggableArrowView){case"Left"/* Left */:case"Right"/* Right */:this.dragTranslateSectionPlane(t,this.lastCanvasPos,n);break;case"Top"/* Top */:case"Bottom"/* Bottom */:this.dragTranslateSectionPlane(r,this.lastCanvasPos,n);break;case"Front"/* Front */:case"Back"/* Back */:this.dragTranslateSectionPlane(i,this.lastCanvasPos,n)}this.lastCanvasPos=n,this.renderer.render(this.scene,this.camera)}},this.scene=e,this.camera=t,this.renderer=r,this.controls=i} /** * If sectionBox is not assigned in constructor, then set it here. * For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionBox properly. * @param sectionBox */setSectionBox(e){if(this.sectionBox)throw new Error("sectionBox is assigned already!");this.sectionBox=e,CommonUtils.expandBoxByScale(this.sectionBox,1.1);const t=e.max,r=e.min,i=t.x-r.x+t.y-r.y+t.z-r.z;CommonUtils.expandBoxByMinSize(this.sectionBox,i/20),MIN_WIDTH=GEOMETRY_RADIUS2=i/300} /** * Starts to clip */open(){this.initSectionBox(),this.addMouseListener(),this.isOpen=!0} /** * Close clipper */close(){this.isOpen=!1,this.removeMouseListener(),this.clearSectionBox()} /** * reset clipper */reset(){this.close(),this.open()} /** * Initialize clip box */initSectionBox(){if(!this.sectionBox)throw new Error("Need to set sectionBox first!");this.group=new Group,this.initPlanes(),this.initOrUpdateVertices(),this.initArrowGizmos();const e=this.sectionBox.clone();CommonUtils.expandBoxByScale(e,1.5);const t=e.max,r=e.min,i=t.x-r.x+t.y-r.y+t.z-r.z;CommonUtils.expandBoxByMinSize(e,i/10),this.sectionBoxBoundary=e;const n=new Vector3;e.getCenter(n),this.group.position.set(n.x,n.y,n.z),this.initOrUpdateFaces(),this.initOrUpdateLines(),this.setArrowPosition(!0),this.scene.add(this.group)} /** * Initialize 6 section plane */initPlanes(){if(!this.sectionBox)return;const e=this.sectionBox.min,t=this.sectionBox.max;this.planes=[new Plane(new Vector3(0,-1,0),t.y), // up new Plane(new Vector3(0,1,0),-e.y), // down new Plane(new Vector3(1,0,0),-e.x), // left new Plane(new Vector3(-1,0,0),t.x), // right new Plane(new Vector3(0,0,-1),t.z), // front new Plane(new Vector3(0,0,1),-e.z)];const r=this.sectionPlaneMap;r.set("Top"/* Top */,this.planes[0]),r.set("Bottom"/* Bottom */,this.planes[1]),r.set("Left"/* Left */,this.planes[2]),r.set("Right"/* Right */,this.planes[3]),r.set("Front"/* Front */,this.planes[4]),r.set("Back"/* Back */,this.planes[5])}updatePlanes(){const e=new Matrix4,t=this.group.position;e.makeRotationFromQuaternion(this.group.quaternion);for(const[r,i]of this.sectionPlaneMap){const n=i.normal.applyMatrix4(e),s=this.faces.find((e=>e.axis===r));let a=getCenter(s.vertices);a=this.localToWorldVec(a,!1),a=a.add(t),i.setFromNormalAndCoplanarPoint(n,a)}} /** * Initialize or update 8 vertices of section box */initOrUpdateVertices(){if(!this.sectionBox)return;const e=this.sectionBox.min,t=this.sectionBox.max,r=this.vertices;r[0].set(e.x,t.y,e.z),r[1].set(t.x,t.y,e.z),r[2].set(t.x,t.y,t.z),r[3].set(e.x,t.y,t.z),r[4].set(e.x,e.y,e.z),r[5].set(t.x,e.y,e.z),r[6].set(t.x,e.y,t.z),r[7].set(e.x,e.y,t.z)} /** * Initialize 6 faces of section box */initOrUpdateFaces(){const e=this.vertices,t=e=>e.map((e=>e.clone().sub(this.group.position)));if(this.faces&&0!==this.faces.length){const r=this.faces;r[0].setFromPoints(t([e[0],e[1],e[2],e[3]])),r[1].setFromPoints(t([e[4],e[7],e[6],e[5]])),r[2].setFromPoints(t([e[0],e[3],e[7],e[4]])),r[3].setFromPoints(t([e[1],e[5],e[6],e[2]])),r[4].setFromPoints(t([e[2],e[6],e[7],e[3]])),r[5].setFromPoints(t([e[0],e[4],e[5],e[1]]))}else this.faces=[new BoxFace2("Top"/* Top */,t([e[0],e[1],e[2],e[3]])), // up new BoxFace2("Bottom"/* Bottom */,t([e[4],e[7],e[6],e[5]])), // down new BoxFace2("Left"/* Left */,t([e[0],e[3],e[7],e[4]])), // left new BoxFace2("Right"/* Right */,t([e[1],e[5],e[6],e[2]])), // right new BoxFace2("Front"/* Front */,t([e[2],e[6],e[7],e[3]])), // front new BoxFace2("Back"/* Back */,t([e[0],e[4],e[5],e[1]]))],this.group.add(...this.faces),this.faces.forEach((e=>{this.group.add(e.backFace)}))} /** * Initialize 12 lines of section box */initOrUpdateLines(){const e=this.vertices,t=e=>e.map((e=>e.clone().sub(this.group.position)));if(this.lines&&0!==this.lines.length){let r=0;this.lines[r++].setFromPoints(t([e[0],e[1]])),this.lines[r++].setFromPoints(t([e[1],e[2]])),this.lines[r++].setFromPoints(t([e[2],e[3]])),this.lines[r++].setFromPoints(t([e[3],e[0]])),this.lines[r++].setFromPoints(t([e[4],e[5]])),this.lines[r++].setFromPoints(t([e[5],e[6]])),this.lines[r++].setFromPoints(t([e[6],e[7]])),this.lines[r++].setFromPoints(t([e[7],e[4]])),this.lines[r++].setFromPoints(t([e[0],e[4]])),this.lines[r++].setFromPoints(t([e[1],e[5]])),this.lines[r++].setFromPoints(t([e[2],e[6]])),this.lines[r++].setFromPoints(t([e[3],e[7]]))}else{const r=this.faces;if(!r)throw Error("Need to init Face first!");this.lines=[new BoxLine2(t([e[0],e[1]]),[r[0],r[5]]),new BoxLine2(t([e[1],e[2]]),[r[0],r[3]]),new BoxLine2(t([e[2],e[3]]),[r[0],r[4]]),new BoxLine2(t([e[3],e[0]]),[r[0],r[2]]),new BoxLine2(t([e[4],e[5]]),[r[1],r[5]]),new BoxLine2(t([e[5],e[6]]),[r[1],r[3]]),new BoxLine2(t([e[6],e[7]]),[r[1],r[4]]),new BoxLine2(t([e[7],e[4]]),[r[1],r[2]]),new BoxLine2(t([e[0],e[4]]),[r[2],r[5]]),new BoxLine2(t([e[1],e[5]]),[r[3],r[5]]),new BoxLine2(t([e[2],e[6]]),[r[3],r[4]]),new BoxLine2(t([e[3],e[7]]),[r[2],r[4]])],this.group.add(...this.lines)}}initArrowGizmos(){const e=new MeshPhongMaterial({color:DEFAULT_COLOR2,depthTest:!1,transparent:!0,side:DoubleSide}),t=new MeshBasicMaterial({wireframe:!0,transparent:!0,opacity:0}),r=8*GEOMETRY_RADIUS2,i=12*GEOMETRY_RADIUS2,n=new CylinderGeometry(0,2*GEOMETRY_RADIUS2,r),s=new CylinderGeometry(GEOMETRY_RADIUS2/2,GEOMETRY_RADIUS2/2,i),a=new CylinderGeometry(4*GEOMETRY_RADIUS2,4*GEOMETRY_RADIUS2,r+i),o=(e,t)=>{e.applyMatrix4((new Matrix4).makeTranslation(0,t,0))};o(n,i+r/2),o(s,i/2),o(a,(i+r)/2),Object.values(Views).forEach((r=>{const i=mergeBufferGeometries([n,s]),o=e.clone();o.opacity=0;const l=new Mesh(i,o);l.userData.view=r;const c=new Mesh(a,t);c.userData.view=r;const u=new Group;u.add(l,c),u.applyMatrix4((new Matrix4).makeRotationAxis(new Vector3(1,0,0),-Math.PI/2)),this.group.add(u),this.arrows.set(r,u)}))} // Change the aabb of box mesh setArrowPosition(e=!1){const t=this.sectionBox;if(!t)return;const r=t.max.x-t.min.x,i=t.max.y-t.min.y,n=t.max.z-t.min.z,s=(e,t)=>{const r=Math.sqrt(e.dot(e)*t.dot(t));let i=r+e.dot(t),n=new Vector3;return i<1e-8*r?(i=0,Math.abs(e.x)>Math.abs(e.z)?(n.setX(-e.y),n.setY(e.x),n.setZ(0)):(n.setX(0),n.setY(-e.z),n.setZ(e.y))):n=e.cross(t),new Quaternion(n.x,n.y,n.z,i).normalize()};for(const[t,a]of this.sectionPlaneMap){const o=this.arrows.get(t);if(!o)return;if(e){const e=s(new Vector3(0,0,1),a.normal),t=new Matrix4;t.makeRotationFromQuaternion(e),o.applyMatrix4(t)}switch(t){case"Right"/* Right */:o.position.set(r/2,0,0);break;case"Left"/* Left */:o.position.set(-r/2,0,0);break;case"Top"/* Top */:o.position.set(0,i/2,0);break;case"Bottom"/* Bottom */:o.position.set(0,-i/2,0);break;case"Front"/* Front */:o.position.set(0,0,n/2);break;case"Back"/* Back */:o.position.set(0,0,-n/2)}}}localToWorldVec(e,t=!0){const r=new Matrix4;r.makeRotationFromQuaternion(this.group.quaternion);const i=e.applyMatrix4(r);return t&&i.normalize(),i}worldToLocalVec(e){const t=new Matrix4;t.makeRotationFromQuaternion(this.group.quaternion),t.invert();return e.applyMatrix4(t)}getTranslationPlane(e){const t=Math.abs(e.x);let r;return r=t>Math.abs(e.y)&&t>Math.abs(e.z)?e.clone().cross(new Vector3(0,1,0)):e.clone().cross(new Vector3(1,0,0)),r=r.cross(e),r.normalize(),r}getPointerPlaneIntersect(e,t,r=0){let i=new Vector4(0,0,0,1),n=new Matrix4;i.x=e[0]/this.renderer.domElement.width*2-1,i.y=-(e[1]/this.renderer.domElement.height*2-1),i.z=0,i.w=1,n=n.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),n=n.invert(),i=i.applyMatrix4(n),i.multiplyScalar(1/i.w);let s=new Vector3(i.x,i.y,i.z);const a=this.camera.position.clone();s=s.sub(a);let o=new Vector3(0,0,0);if(this.draggableArrowView){const e=this.getBoxFaceVerties(this.draggableArrowView);o=getCenter(e).add(this.group.position)}const l=-o.dot(t)-r,c=t.dot(s);if(Math.abs(c)>1e-4){const e=-(t.dot(a)+l)/c;let r=s.multiplyScalar(e);return r=r.add(a),r=r.sub(o),r}return!1}dragTranslateSectionPlane(e,t,r){let i=new Vector3;const n=this.localToWorldVec(e),s=this.getTranslationPlane(n);let a;const o=this.getPointerPlaneIntersect(t,s);if(!o)return void log.info("[Section] p1 doesn't exists");if(a=this.getPointerPlaneIntersect(r,s),!a)return void log.info("[Section] p2 doesn't exists");const l=this.sectionBox;if(!l)return void log.error("[BoxSection] Invalid sectionBox!");const c=l.min,u=l.max;a=a.sub(o),i=this.worldToLocalVec(a);const h=i.dot(e),p=new Vector3(e.x*h,e.y*h,e.z*h);let d,m=new Vector3;if(this.draggableArrowView){const e=this.getBoxFaceVerties(this.draggableArrowView);m=getCenter(e)}switch(m=m.add(p).add(this.group.position),this.draggableArrowView){case"Left"/* Left */:d=Math.max(this.sectionBoxBoundary.min.x,m.x),d=Math.min(u.x-MIN_WIDTH,d),c.setX(d);break;case"Right"/* Right */:d=Math.min(this.sectionBoxBoundary.max.x,m.x),d=Math.max(c.x+MIN_WIDTH,d),u.setX(d);break;case"Bottom"/* Bottom */:d=Math.max(this.sectionBoxBoundary.min.y,m.y),d=Math.min(u.y-MIN_WIDTH,d),c.setY(d);break;case"Top"/* Top */:d=Math.min(this.sectionBoxBoundary.max.y,m.y),d=Math.max(c.y+MIN_WIDTH,d),u.setY(d);break;case"Back"/* Back */:d=Math.max(this.sectionBoxBoundary.min.z,m.z),d=Math.min(u.z-MIN_WIDTH,d),c.setZ(d);break;case"Front"/* Front */:d=Math.min(this.sectionBoxBoundary.max.z,m.z),d=Math.max(c.z+MIN_WIDTH,d),u.setZ(d)}const f=new Vector3;l.getCenter(f),this.group.position.set(f.x,f.y,f.z),this.initOrUpdateVertices(),this.updatePlanes(),this.initOrUpdateFaces(),this.initOrUpdateLines(),this.setArrowPosition()}dragRotateSectionPlane(e,t,r){let i=new Vector3,n=0;const s=this.localToWorldVec(e);let a=this.getPointerPlaneIntersect(t,s),o=this.getPointerPlaneIntersect(r,s);if(!(a&&o)){const e=this.getTranslationPlane(s);a=this.getPointerPlaneIntersect(t,e,1),o=this.getPointerPlaneIntersect(r,e,1),a&&o&&(n=a.dot(s),a.setX(a.x-n*s.x),a.setY(a.y-n*s.y),a.setZ(a.z-n*s.z),n=o.dot(s),o.setX(o.x-n*s.x),o.setY(o.y-n*s.y),o.setZ(o.z-n*s.z))}if(a&&o){a=a.normalize(),o=o.normalize(),n=a.dot(o),n=MathUtils.clamp(n,-1,1);let t=Math.acos(n);i=a.cross(o),i.dot(s)<0&&(t=-t),log.info("[Section] rotate, = ",t),this.group.rotateOnAxis(e,2*t),this.updatePlanes()}}getBoxFaceVerties(e){const t=this.faces.find((t=>t.axis===e));return t&&t.vertices} /** * Clears clip box */clearSectionBox(){this.scene.remove(this.group),this.renderer.domElement.style.cursor=""} // the face that the mouse is hovering /** * Adds mouse event listener */ addMouseListener(){window.addEventListener("pointermove",this.onMouseMove),window.addEventListener("pointerdown",this.onMouseDown)} /** * Removes mouse event listener */removeMouseListener(){window.removeEventListener("pointermove",this.onMouseMove),window.removeEventListener("pointerdown",this.onMouseDown)} /** * Converts mouse coordinates, and updates raycaster */updateMouseAndRay(e){const t=this.renderer.domElement,r=t.clientWidth,i=t.clientHeight;this.mousePosition.setX(e.offsetX/r*2-1),this.mousePosition.setY(-e.offsetY/i*2+1),this.raycaster.setFromCamera(this.mousePosition,this.camera)}},BoxLine2=class extends LineSegments{ // 0xff5000, active color of line (original color: 0x00ffff) /** * @param vertices two points of a line * @param faces two faces relative to a line */ constructor(e,t){super(), // basic data member this.normalMaterial=new LineBasicMaterial({color:DEFAULT_COLOR2}), // 0xffa080, normal color of line (original color: 0xe1f2fb) this.activeMaterial=new LineBasicMaterial({color:DEFAULT_COLOR2}),t.forEach((e=>e.lines.push(this))),this.geometry=new BufferGeometry,this.geometry.setFromPoints(e),this.material=this.normalMaterial} /** * Updates geometry */setFromPoints(e){this.geometry.setFromPoints(e)} /** * Sets to active or inactive * @param isActive */setActive(e){this.material=e?this.activeMaterial:this.normalMaterial}},BoxFace2=class extends Mesh{ /** * @param axis axis of a face * @param vertices 4 points of a face */ constructor(e,t){super(),this.lines=[], // the back side of a face, used to display this.vertices=[],this.axis=e,this.lines=[],this.geometry=new BufferGeometry,this.vertices=t,this.geometry.setFromPoints(t),this.geometry.setIndex([0,3,2,0,2,1]),this.geometry.computeVertexNormals(),this.material=new MeshBasicMaterial({colorWrite:!1,depthWrite:!1});const r=new MeshBasicMaterial({color:DEFAULT_COLOR2,transparent:!0,opacity:0,side:BackSide});this.backFace=new Mesh(this.geometry,r)} /** * Updates geometry */setFromPoints(e){this.vertices=e,this.geometry.setFromPoints(e)} /** * Sets to active or inactive * @param isActive */setActive(e){this.material=new MeshBasicMaterial({color:DEFAULT_COLOR2,transparent:!0,opacity:e?.1:0}),this.lines.forEach((t=>{t.setActive(e)}))}},ObjectsBoxSection=class extends BaseBoxSection{ /** * Constructor */ constructor(e,t,r,i,n){super(e,t,r,i),this.objectIds=n;const s=new Box3;this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&s.expandByObject(t)})),super.setSectionBox(s)} /** * Initialize 6 section plane **/initPlanes(){super.initPlanes(),this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{e.clippingPlanes=this.planes,e.clipIntersection=!1})):e.material&&(e.material.clippingPlanes=this.planes,e.material.clipIntersection=!1))}))}))} /** * Clears section box **/clearSectionBox(){super.clearSectionBox(),this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}},PickSectionPopPanel=class extends PopPanel{constructor(e=document.body){super("pick-section-pop-panel","拾取面剖切",e),this.eventBus=mitt_default(),this.isVisible=!0,this.enabled=!0,this.createActiveSelectLayout(),this.addActiveItems()}createActiveSelectLayout(){const e=document.createElement("div");e.classList.add("pop-panel-active-select"),this.body.appendChild(e),this.activeSelectNode=e}addActiveItems(){const e=(e,t)=>{const r=document.createElement("i");r.classList.add(ICON_FONT_CLASS),r.classList.add(t),e.innerHTML="",e.appendChild(r)},t=(t,r,i="")=>{const n=document.createElement("div");return n.classList.add("pop-panel-item"),r&&n.setAttribute("title",r),n.setAttribute("itemName",t),n.setAttribute("isActive","false"),e(n,i),n},r=t("visible","隐藏剖切面","icon-hidesectionplane");r.onclick=()=>{this.enabled&&(this.isVisible=!this.isVisible,this.isVisible?(e(r,"icon-hidesectionplane"),r.setAttribute("title","隐藏剖切面")):(e(r,"icon-showsectionplane"),r.setAttribute("title","显示剖切面")),this.eventBus.emit("visible",this.isVisible))},this.activeSelectNode&&this.activeSelectNode.appendChild(r),this.visibleNode=r;const i=t("reset","重置","icon-reset");i.onclick=t=>{t.stopPropagation(),this.enabled&&(this.isVisible=!0,e(r,"icon-hidesectionplane"),r.setAttribute("title","隐藏剖切面"),this.eventBus.emit("reset"))},this.activeSelectNode&&this.activeSelectNode.appendChild(i),this.resetNode=i}enable(){this.enabled=!0,this.visibleNode&&this.visibleNode.classList.remove("disable")}disable(){this.enabled=!1,this.visibleNode&&this.visibleNode.classList.add("disable")}},PickPlaneSection=class{constructor(e,t,r){if(this.container=r,this.isShowSectionPlane=!0,this.isSelected=!1,this.raycaster=new Raycaster,this.clickOnceListerner=e=>{if(this.viewer.mouseMoved)return;this.pickFace(e)&&(this.isSelected=!0,window.removeEventListener("click",this.clickOnceListerner),this.popPanel&&this.popPanel.enable(),this.tooltip&&this.tooltip.hide())},this.viewer=e,!e.camera||!e.renderer||!e.controls)throw new Error("Invalid bimViewer!");this.camera=e.camera,this.scene=e.scene,this.renderer=e.renderer,this.controls=e.controls,this.objectIds=t,this.init()}updateMouseAndRay(e){const t=new Vector2;t.setX(e.clientX/window.innerWidth*2-1),t.setY(-e.clientY/window.innerHeight*2+1),this.raycaster.setFromCamera(t,this.camera)}pickFace(e){this.updateMouseAndRay(e);const t=[];this.objectIds.forEach((e=>{const r=this.scene&&this.scene.getObjectById(e);r&&r.visible&&t.push(r)}));const r=this.raycaster.intersectObjects(t,!0);if(0===r.length)return!1;const i=r.find((e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Mesh)}));if(!i||!i.face)return!1;const n=(new Matrix3).getNormalMatrix(i.object.matrixWorld),s=i.face.normal.clone().applyMatrix3(n).normalize(),a=i.point,o=new Vector3(0,1,0);let l;l=1===s.y||-1===s.y?new Vector3(1,0,0):o.clone().cross(s);const c=Math.acos(s.dot(o));return this.sectionPlane&&this.sectionPlane.isOpen&&this.sectionPlane.close(),this.sectionPlane=new BasePlaneSection(this.scene,this.camera,this.renderer,this.controls),this.sectionPlane.setSectionPlane(this.viewer.getBBox()),this.sectionPlane.open(),this.sectionPlane.canvasHeight=this.viewer.height,this.enableSection(),this.sectionPlane.rotatePlane(l,c),this.sectionPlane.movePlaneToCenter(a),!0}init(){this.isSelected=!1,this.popPanel=new PickSectionPopPanel(this.container);const e=this.popPanel.eventBus;e.on("visible",(e=>{e?this.showSectionPlane():this.hideSectionPlane()})),e.on("reset",(()=>{this.popPanel&&this.popPanel.disable(),this.sectionPlane&&(this.sectionPlane.close(),this.cancelSection()),this.tooltip&&this.tooltip.show(),this.open(),this.viewer.enableRender()})),this.tooltip=new Tooltip("pick-section-plane","点击选择面",{parentNode:this.container,followPointer:!0,showOnCreate:!0})}open(){window.addEventListener("click",this.clickOnceListerner)}close(){this.popPanel&&(this.popPanel.eventBus.off("visible"),this.popPanel.eventBus.off("reset"),this.popPanel.destroy(),this.popPanel=void 0),this.tooltip&&(this.tooltip.destroy(),this.tooltip=void 0),this.cancelSection(),this.sectionPlane&&this.sectionPlane.close(),this.isSelected||window.removeEventListener("click",this.clickOnceListerner)}enableSection(){this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{var t;["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{var t;e.clippingPlanes=null==(t=this.sectionPlane)?void 0:t.planes,e.clipIntersection=!0})):e.material&&(e.material.clippingPlanes=null==(t=this.sectionPlane)?void 0:t.planes,e.material.clipIntersection=!0))}))}))}cancelSection(){this.objectIds.forEach((e=>{const t=this.scene.getObjectById(e);t&&t.traverse((e=>{["Mesh","LineSegments"].includes(e.type)&&(Array.isArray(e.material)?e.material.forEach((e=>{e.clippingPlanes=[]})):e.material&&(e.material.clippingPlanes=[]))}))}))}hideSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!1,this.sectionPlane.setSectionObjectVisible(!1))}showSectionPlane(){this.sectionPlane&&(this.isShowSectionPlane=!0,this.sectionPlane.setSectionObjectVisible(!0))}},CONTEXT_MENU_ID="gemini-context-menu",ContextMenu=class{constructor(e){this.itemList=[],this.id=e.id||CONTEXT_MENU_ID,this.container=e.container||document.body,this.context=e.context||{},this.element=this.createMenuUI(e.items||[]),this.handleClick=()=>{this.hide()},!1!==e.hideOnMouseDown&&document.addEventListener("click",this.handleClick),this.hide()}isEnable(e){return e.getEnabled?e.getEnabled(this.context):void 0===e.enabled||e.enabled}isShown(e){return e.getShown?e.getShown(this.context):void 0===e.shown||e.shown}getTitle(e){return e.title||e.getTitle&&e.getTitle(this.context)||""}createMenuUI(e){const t=document.createElement("div");t.id=this.id,t.classList.add("context-menu");const r=this.createMenuGroup(e);return t.append(...r),this.container.appendChild(t),t}createMenuGroup(e){return(0,import_lodash3.map)(e,(e=>{const t=document.createElement("ul");return(0,import_lodash3.forEach)(e,(e=>{const r=this.createMenuItem(e);t.append(r)})),t}))}createMenuItem(e){const t=document.createElement("li");return t.innerHTML=this.getTitle(e),t.onclick=()=>e.doAction&&e.doAction(this.context),this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),this.itemList.push([e,t]),t}updateMenuItems(){(0,import_lodash3.forEach)(this.itemList,(([e,t])=>{this.isEnable(e)?t.classList.remove("disabled"):t.classList.add("disabled"),this.isShown(e)?t.removeAttribute("hidden"):t.setAttribute("hidden",""),t.innerHTML=this.getTitle(e)}))}showMenuElement(e,t){const r=this.element.offsetHeight,i=this.element.offsetWidth;t+r>window.innerHeight&&(t=window.innerHeight-r-5),e+i>window.innerWidth&&(e=window.innerWidth-i-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)}},import_lodash4=__toESM(require_lodash(),1),Toolbar2=class{constructor(e,t,r=[...GROUP_CONFIG]){this.bimViewer=e,this.menuConfig=t,this.groupConfig=r,this.menuList=new Map,this.init()}init(){var e;const t=document.createElement("div");t.classList.add("toolbar"),this.groupConfig.forEach(((e,r)=>{const i=document.createElement("div");i.classList.add("toolbar-group");const n=document.createElement("div");n.classList.add("toolbar-group-division"),e.forEach((e=>{const t=(0,import_lodash4.get)(this.menuConfig,e);if(t&&!1!==t.visible){const r=this.createToolbarMenu(this.bimViewer,e,t);i.appendChild(r.element)}})),i.hasChildNodes()&&(r&&t.appendChild(n),t.appendChild(i))})),this.element=t,null==(e=this.bimViewer.widgetContainer)||e.appendChild(t),t.oncontextmenu=e=>{e.preventDefault()}}createToolbarMenu(e,t,r,i){const n=new ToolbarMenu(e,this,t,r,i);if(this.menuList.set(t,n),r.children){const t=document.createElement("div");t.classList.add("toolbar-sub-menu");const i=document.createElement("div");i.classList.add("toolbar-sub-menu-list"),t.appendChild(i),(0,import_lodash4.forIn)(r.children,((t,r)=>{if(t&&!1!==t.visible){const s=this.createToolbarMenu(e,r,t,n);i.appendChild(s.element)}})),n.element.appendChild(t)}return n} /** * @description Modify the menu configuration and update the toolbar. * @param {ToolbarMenuId} menuId * @param {Partial} config * @memberof Toolbar */updateMenu(e,t){(0,import_lodash4.assign)(this.menuConfig[e],t),this.refresh()} /** * @description Modify the menu configuration and update the toolbar. * @param {{ menuId: ToolbarMenuId; config: Partial }[]} configs * @memberof Toolbar */updateMenus(e){(0,import_lodash4.forEach)(e,(({menuId:e,config:t})=>{(0,import_lodash4.assign)(this.menuConfig[e],t)})),this.refresh()} /** * @description Add a custmized menu to toolbar. * @param {string} menuId * @param {ToolbarMenuConfig} config * @param {[number, number]} [insertPosition] * @return {*} * @memberof Toolbar */addMenu(e,t,r){if((0,import_lodash4.keys)(this.menuConfig).includes(e))log.error("[Toolbar]",e,"exists.");else{if((0,import_lodash4.assign)(this.menuConfig,{[e]:t}),r){const[t,i]=r;if(t>this.groupConfig.length-1)this.groupConfig=(0,import_lodash4.concat)(this.groupConfig,[[e]]);else{const r=this.groupConfig[t];this.groupConfig[t]=i>r.length-1?(0,import_lodash4.concat)(r,e):(0,import_lodash4.concat)((0,import_lodash4.take)(r,i),e,(0,import_lodash4.takeRight)(r,r.length-i))}}else this.groupConfig=(0,import_lodash4.concat)(this.groupConfig,[[e]]);this.refresh()}} /** * @description Update the whole toolbar element with the current configuration. * @memberof Toolbar */refresh(){this.destroy(),this.init()}show(){this.element&&(this.element.style.display="")}hide(){this.element&&(this.element.style.display="none")}destroy(){this.element&&this.element.remove(),this.element=void 0,this.menuList.clear()}},ToolbarMenu=class{constructor(e,t,r,i,n){this.bimViewer=e,this.toolbar=t,this.menuId=r,this.eventBus=mitt_default(),this.active=i.defaultActive||!1,this.element=i.customElement&&i.customElement(e,this.menuId,i)||this.createButton(e,this.menuId,i),this.eventBus.on("activeChange",(t=>{t?(this.element.classList.add("active"),(0,import_lodash4.forEach)(i.mutexIds,(e=>{var t;const r=null==(t=this.toolbar)?void 0:t.menuList.get(e);r&&r.active&&r.setActive(!1)})),i.onActive&&i.onActive(e)):(this.element.classList.remove("active"),i.onDeactive&&i.onDeactive(e)),this.element.firstChild instanceof HTMLElement&&setIcon(this.element.firstChild.classList,i.icon,this.active),n&&n.setActive(t)})),this.element.onclick=t=>{switch(t.stopPropagation(),i.type){case 1/* ClickEvent */:i.onClick&&i.onClick(e,this.toolbar,t);break;case 4/* Switch */:i.onClick&&i.onClick(e,this.toolbar,t),this.active=!this.active,this.eventBus.emit("activeChange",this.active)}}}createButton(e,r,i){const n=document.createElement("div");n.id=r,n.classList.add("toolbar-menu"),i.defaultActive&&n.classList.add("active"),i.children&&n.classList.add("toolbar-parent-menu");const{default:s="icon-new",iconFont:a=ICON_FONT_CLASS}=i.icon;return n.innerHTML=`
`,n.title=t(i.menuName),n.innerHTML+=`${n.title}`,n}setActive(e){this.active=e,this.eventBus.emit("activeChange",this.active)}},MenuTypeEnums=(e=>(e[e.ClickEvent=1]="ClickEvent",e[e.Popup=2]="Popup",e[e.SubMenu=3]="SubMenu",e[e.Switch=4]="Switch",e))(MenuTypeEnums||{}),ToolbarMenuId2=(e=>(e.HomeView="HomeView",e.OrthoMode="OrthoMode",e.Measure="Measure",e.MeasureDistance="MeasureDistance",e.MeasureArea="MeasureArea",e.MeasureAngle="MeasureAngle",e.MeasureCoordinate="MeasureCoordinate",e.MeasureClear="MeasureClear",e.Markup="Markup",e.MarkupArrow="Arrow",e.MarkupRect="Rect",e.MarkupCloudRect="CloudRect",e.MarkupPolyLine="PolyLine",e.MarkupCloudLine="CloudLine",e.MarkupEllipse="Ellipse",e.MarkupCircle="Circle",e.MarkupDot="Dot",e.MarkupText="Text",e.MarkupX="X",e.MarkupStrokeStyle="StrokeStyle",e.MarkupLineWidth="LineWidth",e.MarkupLineWidth2="LineWidth2",e.MarkupLineWidth5="LineWidth5",e.MarkupLineWidth10="LineWidth10",e.MarkupFontSize="FontSize",e.MarkupFontSize14="FontSize14",e.MarkupFontSize18="FontSize18",e.MarkupFontSize24="FontSize24",e.MarkupClear="MarkupClear",e.MarkupQuit="MarkupQuit",e.Section="Section",e.SectionBox="SectionBox",e.SectionPlane="SectionPlane",e.AxisSectionPlane="AxisSectionPlane",e.BimTree="BimTree",e.Viewpoint="Viewpoint",e.Annotation="Annotation",e.Property="Property",e.Settings="Settings",e.Compared="Compared",e.QuitCompare="QuitCompare",e.Fullscreen="FullScreen",e.SceneClear="SceneClear",e.Layers="Layers",e.ZoomToRectangle="ZoomToRectangle",e))(ToolbarMenuId2||{}),translate=e=>({bimViewer:t})=>t.translate(`ContextMenu.${e}`),hasVisibleObject=e=>{var t;let r=0;return null==(t=e.scene)||t.traverseVisible((e=>{e instanceof Mesh&&r++})),r>0},hasInvisibleObject=e=>{var t,r;let i=0;return null==(t=e.scene)||t.traverse((e=>{e instanceof Mesh&&i++})),null==(r=e.scene)||r.traverseVisible((e=>{e instanceof Mesh&&i--})),i>0},hasXRayedObject=e=>e.hasTransparentObject(),isObjectHideable=e=>!1!==e.userData.selectable,isObjectSelected=(e,t,r,i)=>{const n=e.selectedObject;return!(!n||!t||n.id!==t.id)&&(null!=r&&n.isInstancedMesh?r===n.userData.instanceId:null==i||!MergeUtils.isMergedMesh(n)||i===n.userData.batchId)},viewFitEntity={getTitle:translate("viewFitEntity"), // View Fit getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.flyToObject(t)}},viewFitAll={getTitle:translate("viewFitAll"), // View Fit All getEnabled:({bimViewer:e})=>hasVisibleObject(e),doAction:({bimViewer:e})=>e.viewFitAll()},hideEntity={getTitle:translate("hideEntity"), // Hide getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{isObjectHideable(t)&&(t.visible=!1,e.enableRender())}},hideOthers={getTitle:translate("hideOthers"), // Hide Others getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{var r;null==(r=e.scene)||r.traverse((e=>{e instanceof Mesh&&isObjectHideable(e)&&(e.visible=!1)})),t.visible=!0,e.enableRender()}},hideAll={getTitle:translate("hideAll"), // Hide All getEnabled:({bimViewer:e})=>hasVisibleObject(e),doAction:({bimViewer:e})=>{var t;null==(t=e.scene)||t.traverse((e=>{e instanceof Mesh&&isObjectHideable(e)&&(e.visible=!1)})),e.enableRender()}},showAll={getTitle:translate("showAll"), // Show All getEnabled:({bimViewer:e})=>hasInvisibleObject(e),doAction:({bimViewer:e})=>{var t;null==(t=e.scene)||t.traverse((e=>{e instanceof Mesh&&isObjectHideable(e)&&(e.visible=!0)})),e.enableRender()}},selectEntity={getTitle:({hit:e,bimViewer:t,instanceId:r,batchId:i})=>isObjectSelected(t,e,r,i)?translate("deselect")({bimViewer:t}):translate("select")({bimViewer:t}),getShown:({hit:e})=>e,doAction:({hit:e,bimViewer:t,instanceId:r,batchId:i})=>{!1!==e.userData.selectable?isObjectSelected(t,e,r,i)?t.clearSelection():t.selectObject(e,e.instanceId,i):log.debug(`[ContextMenu] object(type: ${e.type}, name: ${e.name}) not selectable!`)}},selectNone={getTitle:translate("selectNone"), // Select None getEnabled:({bimViewer:e})=>e.selectedObject,doAction:({bimViewer:e})=>e.clearSelection()},xRayAll={getTitle:translate("xRayAll"), // X-Ray getShown:({bimViewer:e})=>!hasXRayedObject(e),doAction:({bimViewer:e})=>{e.addOrRemoveObjectOpacity(!0),e.enableRender()}},xRayNone={getTitle:translate("xRayNone"), // X-Ray None getEnabled:({bimViewer:e})=>hasXRayedObject(e),doAction:({bimViewer:e})=>{hasXRayedObject(e)&&(e.addOrRemoveObjectOpacity(!1),e.enableRender())}},xRayEntity={getTitle:translate("xRayEntity"), // X-Ray getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,void 0,[t.id],void 0)}},xRayOthers={getTitle:translate("xRayOthers"), // X-Ray Others getShown:({hit:e})=>e,doAction:({bimViewer:e,hit:t})=>{e.addOrRemoveObjectOpacity(!0,.1,void 0,[t.id]),e.enableRender()}},showSection={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionType){case"PickPlaneSection"/* PickPlaneSection */:t="*showSectionPlane";break;case"AxisPlaneSection"/* AxisPlaneSection */:t="showAxisSection";break;case"ObjectsBoxSection"/* ObjectsBoxSection */:t="*showSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:({bimViewer:e,section:t})=>!("PickPlaneSection"/* PickPlaneSection */!==e.sectionType&&"AxisPlaneSection"/* AxisPlaneSection */!==e.sectionType||!t||t.isShowSectionPlane),doAction:({bimViewer:e,section:t})=>{("PickPlaneSection"/* PickPlaneSection */===e.sectionType||"AxisPlaneSection"/* AxisPlaneSection */===e.sectionType)&&(null==t||t.showSectionPlane())}},hideSection={getTitle:({bimViewer:e})=>{let t="";switch(e.sectionType){case"PickPlaneSection"/* PickPlaneSection */:t="hideSectionPlane";break;case"AxisPlaneSection"/* AxisPlaneSection */:t="hideAxisSection";break;case"ObjectsBoxSection"/* ObjectsBoxSection */:t="hideSectionBox"}return e.translate(`ContextMenu.${t}`)},getShown:e=>hitOnSection(e),doAction:({bimViewer:e,section:t})=>{("PickPlaneSection"/* PickPlaneSection */===e.sectionType||"AxisPlaneSection"/* AxisPlaneSection */===e.sectionType)&&(null==t||t.hideSectionPlane())}},undoSection={getTitle:translate("undoSection"),getShown:e=>hitOnSection(e),doAction:({bimViewer:e,toolbar:t})=>{if("PickPlaneSection"/* PickPlaneSection */===e.sectionType){const e=null==t?void 0:t.menuList.get("SectionPlane"/* SectionPlane */);null==e||e.setActive(!1)}else if("AxisPlaneSection"/* AxisPlaneSection */===e.sectionType){const e=null==t?void 0:t.menuList.get("AxisSectionPlane"/* AxisSectionPlane */);null==e||e.setActive(!1)}else if("ObjectsBoxSection"/* ObjectsBoxSection */===e.sectionType){const e=null==t?void 0:t.menuList.get("SectionBox"/* SectionBox */);null==e||e.setActive(!1)}}},hitOnSection=({bimViewer:e,hit:t,section:r})=>("PickPlaneSection"/* PickPlaneSection */===e.sectionType||"AxisPlaneSection"/* AxisPlaneSection */===e.sectionType)&&!!r&&r.isShowSectionPlane&&(null==t?void 0:t.name)===SECTION_PLANE_NAME,contextMenuItems=[[showSection],[hideSection,undoSection],[viewFitEntity,viewFitAll],[hideEntity,hideOthers,hideAll,showAll],[xRayEntity,xRayOthers,xRayAll,xRayNone],[selectEntity,selectNone]]; // src/components/bottom-bar/BottomBar.ts // node_modules/dat.gui/build/dat.gui.module.js function ___$insertStyle(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 colorToString(e,t){var r=e.__state.conversionName.toString(),i=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),c=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===r||"SIX_CHAR_HEX"===r){for(var u=e.hex.toString(16);u.length<6;)u="0"+u;return"#"+u}return"CSS_RGB"===r?"rgb("+i+","+n+","+s+")":"CSS_RGBA"===r?"rgba("+i+","+n+","+s+","+a+")":"HEX"===r?"0x"+e.hex.toString(16):"RGB_ARRAY"===r?"["+i+","+n+","+s+"]":"RGBA_ARRAY"===r?"["+i+","+n+","+s+","+a+"]":"RGB_OBJ"===r?"{r:"+i+",g:"+n+",b:"+s+"}":"RGBA_OBJ"===r?"{r:"+i+",g:"+n+",b:"+s+",a:"+a+"}":"HSV_OBJ"===r?"{h:"+o+",s:"+l+",v:"+c+"}":"HSVA_OBJ"===r?"{h:"+o+",s:"+l+",v:"+c+",a:"+a+"}":"unknown format"}var ARR_EACH=Array.prototype.forEach,ARR_SLICE=Array.prototype.slice,Common={BREAK:{},extend:function(e){return this.each(ARR_SLICE.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(r){this.isUndefined(t[r])||(e[r]=t[r])}.bind(this))}),this),e},defaults:function(e){return this.each(ARR_SLICE.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(r){this.isUndefined(e[r])&&(e[r]=t[r])}.bind(this))}),this),e},compose:function(){var e=ARR_SLICE.call(arguments);return function(){for(var t=ARR_SLICE.call(arguments),r=e.length-1;r>=0;r--)t=[e[r].apply(this,t)];return t[0]}},each:function(e,t,r){if(e)if(ARR_EACH&&e.forEach&&e.forEach===ARR_EACH)e.forEach(t,r);else if(e.length===e.length+0){var i,n=void 0;for(n=0,i=e.length;n1?Common.toArray(arguments):arguments[0];return Common.each(INTERPRETATIONS,(function(t){if(t.litmus(e))return Common.each(t.conversions,(function(t,r){if(result=t.read(e),!1===toReturn&&!1!==result)return toReturn=result,result.conversionName=r,result.conversion=t,Common.BREAK})),Common.BREAK})),toReturn},tmpComponent=void 0,ColorMath={hsv_to_rgb:function(e,t,r){var i=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),s=r*(1-t),a=r*(1-n*t),o=r*(1-(1-n)*t),l=[[r,o,s],[a,r,s],[s,r,o],[s,a,r],[o,s,r],[r,s,a]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,r){var i=Math.min(e,t,r),n=Math.max(e,t,r),s=n-i,a=void 0;return 0===n?{h:NaN,s:0,v:0}:(a=e===n?(t-r)/s:t===n?2+(r-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,r){var i=this.hex_with_component(0,2,e);return i=this.hex_with_component(i,1,t),i=this.hex_with_component(i,0,r)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,r){return r<<(tmpComponent=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var NumberController=function(e){function t(e,r,i){classCallCheck(this,t);var n=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),s=i||{};return n.__min=s.min,n.__max=s.max,n.__step=s.step,Common.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=numDecimals(n.__impliedStep),n}return inherits(t,Controller),createClass(t,[{key:"setValue",value:function(e){var r=e;return void 0!==this.__min&&rthis.__max&&(r=this.__max),void 0!==this.__step&&r%this.__step!=0&&(r=Math.round(r/this.__step)*this.__step),get3(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,r)}},{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=numDecimals(e),this}}]),t}();function roundToDecimal(e,t){var r=Math.pow(10,t);return Math.round(e*r)/r}var NumberControllerBox=function(e){function t(e,r,i){classCallCheck(this,t);var n=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,i));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 c(){dom.unbind(window,"mousemove",l),dom.unbind(window,"mouseup",c),o()}return n.__input=document.createElement("input"),n.__input.setAttribute("type","text"),dom.bind(n.__input,"change",(function(){var e=parseFloat(s.__input.value);Common.isNaN(e)||s.setValue(e)})),dom.bind(n.__input,"blur",(function(){o()})),dom.bind(n.__input,"mousedown",(function(e){dom.bind(window,"mousemove",l),dom.bind(window,"mouseup",c),a=e.clientY})),dom.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 inherits(t,NumberController),createClass(t,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():roundToDecimal(this.getValue(),this.__precision),get3(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}();function map2(e,t,r,i,n){return i+(e-t)/(r-t)*(n-i)}var NumberControllerSlider=function(e){function t(e,r,i,n,s){classCallCheck(this,t);var a=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r,{min:i,max:n,step:s})),o=a;function l(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(map2(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function c(){dom.unbind(window,"mousemove",l),dom.unbind(window,"mouseup",c),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=e.touches[0].clientX,r=o.__background.getBoundingClientRect();o.setValue(map2(t,r.left,r.right,o.__min,o.__max))}function h(){dom.unbind(window,"touchmove",u),dom.unbind(window,"touchend",h),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),dom.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),dom.bind(window,"mousemove",l),dom.bind(window,"mouseup",c),l(e)})),dom.bind(a.__background,"touchstart",(function(e){if(1!==e.touches.length)return;dom.bind(window,"touchmove",u),dom.bind(window,"touchend",h),u(e)})),dom.addClass(a.__background,"slider"),dom.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return inherits(t,NumberController),createClass(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",get3(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(),FunctionController=function(e){function t(e,r,i){classCallCheck(this,t);var n=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r)),s=n;return n.__button=document.createElement("div"),n.__button.innerHTML=void 0===i?"Fire":i,dom.bind(n.__button,"click",(function(e){return e.preventDefault(),s.fire(),!1})),dom.addClass(n.__button,"button"),n.domElement.appendChild(n.__button),n}return inherits(t,Controller),createClass(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}(),ColorController=function(e){function t(e,r){classCallCheck(this,t);var i=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));i.__color=new Color2(i.getValue()),i.__temp=new Color2(0);var n=i;i.domElement=document.createElement("div"),dom.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",dom.bind(i.__input,"keydown",(function(e){13===e.keyCode&&u.call(this)})),dom.bind(i.__input,"blur",u),dom.bind(i.__selector,"mousedown",(function(){dom.addClass(this,"drag").bind(window,"mouseup",(function(){dom.removeClass(n.__selector,"drag")}))})),dom.bind(i.__selector,"touchstart",(function(){dom.addClass(this,"drag").bind(window,"touchend",(function(){dom.removeClass(n.__selector,"drag")}))}));var s=document.createElement("div");function a(e){p(e),dom.bind(window,"mousemove",p),dom.bind(window,"touchmove",p),dom.bind(window,"mouseup",l),dom.bind(window,"touchend",l)}function o(e){d(e),dom.bind(window,"mousemove",d),dom.bind(window,"touchmove",d),dom.bind(window,"mouseup",c),dom.bind(window,"touchend",c)}function l(){dom.unbind(window,"mousemove",p),dom.unbind(window,"touchmove",p),dom.unbind(window,"mouseup",l),dom.unbind(window,"touchend",l),h()}function c(){dom.unbind(window,"mousemove",d),dom.unbind(window,"touchmove",d),dom.unbind(window,"mouseup",c),dom.unbind(window,"touchend",c),h()}function u(){var e=interpret(this.value);!1!==e?(n.__color.__state=e,n.setValue(n.__color.toOriginal())):this.value=n.__color.toString()}function h(){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(),r=e.touches&&e.touches[0]||e,i=r.clientX,s=r.clientY,a=(i-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(),r=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return r>1?r=1:r<0&&(r=0),n.__color.h=360*r,n.setValue(n.__color.toOriginal()),!1}return Common.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Common.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Common.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Common.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Common.extend(s.style,{width:"100%",height:"100%",background:"none"}),linearGradient(s,"top","rgba(0,0,0,0)","#000"),Common.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),hueGradient(i.__hue_field),Common.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),dom.bind(i.__saturation_field,"mousedown",a),dom.bind(i.__saturation_field,"touchstart",a),dom.bind(i.__field_knob,"mousedown",a),dom.bind(i.__field_knob,"touchstart",a),dom.bind(i.__hue_field,"mousedown",o),dom.bind(i.__hue_field,"touchstart",o),i.__saturation_field.appendChild(s),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return inherits(t,Controller),createClass(t,[{key:"updateDisplay",value:function(){var e=interpret(this.getValue());if(!1!==e){var t=!1;Common.each(Color2.COMPONENTS,(function(r){if(!Common.isUndefined(e[r])&&!Common.isUndefined(this.__color.__state[r])&&e[r]!==this.__color.__state[r])return t=!0,{}}),this),t&&Common.extend(this.__color.__state,e)}Common.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var r=this.__color.v<.5||this.__color.s>.5?255:0,i=255-r;Common.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("+r+","+r+","+r+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,linearGradient(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Common.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+r+","+r+","+r+")",textShadow:this.__input_textShadow+"rgba("+i+","+i+","+i+",.7)"})}}]),t}(),vendors=["-moz-","-o-","-webkit-","-ms-",""];function linearGradient(e,t,r,i){e.style.background="",Common.each(vendors,(function(n){e.style.cssText+="background: "+n+"linear-gradient("+t+", "+r+" 0%, "+i+" 100%); "}))}function hueGradient(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 css={load:function(e,t){var r=t||document,i=r.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=e,r.getElementsByTagName("head")[0].appendChild(i)},inject:function(e,t){var r=t||document,i=document.createElement("style");i.type="text/css",i.innerHTML=e;var n=r.getElementsByTagName("head")[0];try{n.appendChild(i)}catch(e){}}},saveDialogContents='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',ControllerFactory=function(e,t){var r=e[t];return Common.isArray(arguments[2])||Common.isObject(arguments[2])?new OptionController(e,t,arguments[2]):Common.isNumber(r)?Common.isNumber(arguments[2])&&Common.isNumber(arguments[3])?Common.isNumber(arguments[4])?new NumberControllerSlider(e,t,arguments[2],arguments[3],arguments[4]):new NumberControllerSlider(e,t,arguments[2],arguments[3]):Common.isNumber(arguments[4])?new NumberControllerBox(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new NumberControllerBox(e,t,{min:arguments[2],max:arguments[3]}):Common.isString(r)?new StringController(e,t):Common.isFunction(r)?new FunctionController(e,t,""):Common.isBoolean(r)?new BooleanController(e,t):null};function requestAnimationFrame2(e){setTimeout(e,1e3/60)}var requestAnimationFrame$1=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||requestAnimationFrame2,CenteredDiv=function(){function e(){classCallCheck(this,e),this.backgroundElement=document.createElement("div"),Common.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"}),dom.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Common.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;dom.bind(this.backgroundElement,"click",(function(){t.hide()}))}return createClass(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(),Common.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",dom.unbind(e.domElement,"webkitTransitionEnd",t),dom.unbind(e.domElement,"transitionend",t),dom.unbind(e.domElement,"oTransitionEnd",t)};dom.bind(this.domElement,"webkitTransitionEnd",t),dom.bind(this.domElement,"transitionend",t),dom.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-dom.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-dom.getHeight(this.domElement)/2+"px"}}]),e}(),styleSheet=___$insertStyle(".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");css.inject(styleSheet);var CSS_NAMESPACE="dg",HIDE_KEY_CODE=72,CLOSE_BUTTON_HEIGHT=20,DEFAULT_DEFAULT_PRESET_NAME="Default",SUPPORTS_LOCAL_STORAGE=function(){try{return!!window.localStorage}catch(e){return!1}}(),SAVE_DIALOGUE=void 0,autoPlaceVirgin=!0,autoPlaceContainer=void 0,hide=!1,hideableGuis=[],GUI=function e(t){var r=this,i=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),dom.addClass(this.domElement,CSS_NAMESPACE),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=Common.defaults(i,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),i=Common.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),Common.isUndefined(i.load)?i.load={preset:DEFAULT_DEFAULT_PRESET_NAME}:i.preset&&(i.load.preset=i.preset),Common.isUndefined(i.parent)&&i.hideable&&hideableGuis.push(this),i.resizable=Common.isUndefined(i.parent)&&i.resizable,i.autoPlace&&Common.isUndefined(i.scrollable)&&(i.scrollable=!0);var n,s=SUPPORTS_LOCAL_STORAGE&&"true"===localStorage.getItem(getLocalStorageHash(this,"isLocal")),a=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return r.parent?r.getRoot().preset:i.load.preset},set:function(e){r.parent?r.getRoot().preset=e:i.load.preset=e,setPresetSelectIndex(this),r.revert()}},width:{get:function(){return i.width},set:function(e){i.width=e,setWidth(r,e)}},name:{get:function(){return i.name},set:function(e){i.name=e,o&&(o.innerHTML=i.name)}},closed:{get:function(){return i.closed},set:function(t){i.closed=t,i.closed?dom.addClass(r.__ul,e.CLASS_CLOSED):dom.removeClass(r.__ul,e.CLASS_CLOSED),this.onResize(),r.__closeButton&&(r.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return i.load}},useLocalStorage:{get:function(){return s},set:function(e){SUPPORTS_LOCAL_STORAGE&&(s=e,e?dom.bind(window,"unload",a):dom.unbind(window,"unload",a),localStorage.setItem(getLocalStorageHash(r,"isLocal"),e))}}}),Common.isUndefined(i.parent)){if(this.closed=i.closed||!1,dom.addClass(this.domElement,e.CLASS_MAIN),dom.makeSelectable(this.domElement,!1),SUPPORTS_LOCAL_STORAGE&&s){r.useLocalStorage=!0;var l=localStorage.getItem(getLocalStorageHash(this,"gui"));l&&(i.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,dom.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),i.closeOnTop?(dom.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(dom.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),dom.bind(this.__closeButton,"click",(function(){r.closed=!r.closed}))}else{void 0===i.closed&&(i.closed=!0);var c=document.createTextNode(i.name);dom.addClass(c,"controller-name"),o=addRow(r,c);dom.addClass(this.__ul,e.CLASS_CLOSED),dom.addClass(o,"title"),dom.bind(o,"click",(function(e){return e.preventDefault(),r.closed=!r.closed,!1})),i.closed||(this.closed=!1)}i.autoPlace&&(Common.isUndefined(i.parent)&&(autoPlaceVirgin&&(autoPlaceContainer=document.createElement("div"),dom.addClass(autoPlaceContainer,CSS_NAMESPACE),dom.addClass(autoPlaceContainer,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(autoPlaceContainer),autoPlaceVirgin=!1),autoPlaceContainer.appendChild(this.domElement),dom.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||setWidth(r,i.width)),this.__resizeHandler=function(){r.onResizeDebounced()},dom.bind(window,"resize",this.__resizeHandler),dom.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),dom.bind(this.__ul,"transitionend",this.__resizeHandler),dom.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),i.resizable&&addResizeHandle(this),a=function(){SUPPORTS_LOCAL_STORAGE&&"true"===localStorage.getItem(getLocalStorageHash(r,"isLocal"))&&localStorage.setItem(getLocalStorageHash(r,"gui"),JSON.stringify(r.getSaveObject()))},this.saveToLocalStorageIfPossible=a,i.parent||((n=r.getRoot()).width+=1,Common.defer((function(){n.width-=1})))};function addRow(e,t,r){var i=document.createElement("li");return t&&i.appendChild(t),r?e.__ul.insertBefore(i,r):e.__ul.appendChild(i),e.onResize(),i}function removeListeners(e){dom.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&dom.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function markPresetModified(e,t){var r=e.__preset_select[e.__preset_select.selectedIndex];r.innerHTML=t?r.value+"*":r.value}function augmentController(e,t,r){if(r.__li=t,r.__gui=e,Common.extend(r,{options:function(t){if(arguments.length>1){var i=r.__li.nextElementSibling;return r.remove(),_add(e,r.object,r.property,{before:i,factoryArgs:[Common.toArray(arguments)]})}if(Common.isArray(t)||Common.isObject(t)){var n=r.__li.nextElementSibling;return r.remove(),_add(e,r.object,r.property,{before:n,factoryArgs:[t]})}},name:function(e){return r.__li.firstElementChild.firstElementChild.innerHTML=e,r},listen:function(){return r.__gui.listen(r),r},remove:function(){return r.__gui.remove(r),r}}),r instanceof NumberControllerSlider){var i=new NumberControllerBox(r.object,r.property,{min:r.__min,max:r.__max,step:r.__step});Common.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=r[e],n=i[e];r[e]=i[e]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(i,e),t.apply(r,e)}})),dom.addClass(t,"has-slider"),r.domElement.insertBefore(i.domElement,r.domElement.firstElementChild)}else if(r instanceof NumberControllerBox){var n=function(t){if(Common.isNumber(r.__min)&&Common.isNumber(r.__max)){var i=r.__li.firstElementChild.firstElementChild.innerHTML,n=r.__gui.__listening.indexOf(r)>-1;r.remove();var s=_add(e,r.object,r.property,{before:r.__li.nextElementSibling,factoryArgs:[r.__min,r.__max,r.__step]});return s.name(i),n&&s.listen(),s}return t};r.min=Common.compose(n,r.min),r.max=Common.compose(n,r.max)}else r instanceof BooleanController?(dom.bind(t,"click",(function(){dom.fakeEvent(r.__checkbox,"click")})),dom.bind(r.__checkbox,"click",(function(e){e.stopPropagation()}))):r instanceof FunctionController?(dom.bind(t,"click",(function(){dom.fakeEvent(r.__button,"click")})),dom.bind(t,"mouseover",(function(){dom.addClass(r.__button,"hover")})),dom.bind(t,"mouseout",(function(){dom.removeClass(r.__button,"hover")}))):r instanceof ColorController&&(dom.addClass(t,"color"),r.updateDisplay=Common.compose((function(e){return t.style.borderLeftColor=r.__color.toString(),e}),r.updateDisplay),r.updateDisplay());r.setValue=Common.compose((function(t){return e.getRoot().__preset_select&&r.isModified()&&markPresetModified(e.getRoot(),!0),t}),r.setValue)}function recallSavedValue(e,t){var r=e.getRoot(),i=r.__rememberedObjects.indexOf(t.object);if(-1!==i){var n=r.__rememberedObjectIndecesToControllers[i];if(void 0===n&&(n={},r.__rememberedObjectIndecesToControllers[i]=n),n[t.property]=t,r.load&&r.load.remembered){var s=r.load.remembered,a=void 0;if(s[e.preset])a=s[e.preset];else{if(!s[DEFAULT_DEFAULT_PRESET_NAME])return;a=s[DEFAULT_DEFAULT_PRESET_NAME]}if(a[i]&&void 0!==a[i][t.property]){var o=a[i][t.property];t.initialValue=o,t.setValue(o)}}}}function _add(e,t,r,i){if(void 0===t[r])throw new Error('Object "'+t+'" has no property "'+r+'"');var n=void 0;if(i.color)n=new ColorController(t,r);else{var s=[t,r].concat(i.factoryArgs);n=ControllerFactory.apply(e,s)}i.before instanceof Controller&&(i.before=i.before.__li),recallSavedValue(e,n),dom.addClass(n.domElement,"c");var a=document.createElement("span");dom.addClass(a,"property-name"),a.innerHTML=n.property;var o=document.createElement("div");o.appendChild(a),o.appendChild(n.domElement);var l=addRow(e,o,i.before);return dom.addClass(l,GUI.CLASS_CONTROLLER_ROW),n instanceof ColorController?dom.addClass(l,"color"):dom.addClass(l,_typeof3(n.getValue())),augmentController(e,l,n),e.__controllers.push(n),n}function getLocalStorageHash(e,t){return document.location.href+"."+t}function addPresetOption(e,t,r){var i=document.createElement("option");i.innerHTML=t,i.value=t,e.__preset_select.appendChild(i),r&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function showHideExplain(e,t){t.style.display=e.useLocalStorage?"block":"none"}function addSaveMenu(e){var t=e.__save_row=document.createElement("li");dom.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),dom.addClass(t,"save-row");var r=document.createElement("span");r.innerHTML=" ",dom.addClass(r,"button gears");var i=document.createElement("span");i.innerHTML="Save",dom.addClass(i,"button"),dom.addClass(i,"save");var n=document.createElement("span");n.innerHTML="New",dom.addClass(n,"button"),dom.addClass(n,"save-as");var s=document.createElement("span");s.innerHTML="Revert",dom.addClass(s,"button"),dom.addClass(s,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?Common.each(e.load.remembered,(function(t,r){addPresetOption(e,r,r===e.preset)})):addPresetOption(e,DEFAULT_DEFAULT_PRESET_NAME,!1),dom.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=getCurrentPreset(this)),e.folders={},Common.each(this.__folders,(function(t,r){e.folders[r]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=getCurrentPreset(this),markPresetModified(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME]=getCurrentPreset(this,!0)),this.load.remembered[e]=getCurrentPreset(this),this.preset=e,addPresetOption(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){Common.each(this.__controllers,(function(t){this.getRoot().load.remembered?recallSavedValue(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),Common.each(this.__folders,(function(e){e.revert(e)})),e||markPresetModified(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&updateDisplays(this.__listening)},updateDisplay:function(){Common.each(this.__controllers,(function(e){e.updateDisplay()})),Common.each(this.__folders,(function(e){e.updateDisplay()}))}});var GUI$1=GUI,methodMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"], // New WebKit ["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"], // Old WebKit ["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],nativeAPI=(()=>{const e=methodMap[0],t={};for(const r of methodMap){if((null==r?void 0:r[1])in document){for(const[i,n]of r.entries())t[e[i]]=n;return t}}return!1})(),eventNameMap={change:nativeAPI.fullscreenchange,error:nativeAPI.fullscreenerror},screenfull={ // eslint-disable-next-line default-param-last request:(e=document.documentElement,t)=>new Promise(((r,i)=>{const n=()=>{screenfull.off("change",n),r()};screenfull.on("change",n);const s=e[nativeAPI.requestFullscreen](t);s instanceof Promise&&s.then(n).catch(i)})),exit:()=>new Promise(((e,t)=>{if(!screenfull.isFullscreen)return void e();const r=()=>{screenfull.off("change",r),e()};screenfull.on("change",r);const i=document[nativeAPI.exitFullscreen]();i instanceof Promise&&i.then(r).catch(t)})),toggle:(e,t)=>screenfull.isFullscreen?screenfull.exit():screenfull.request(e,t),onchange(e){screenfull.on("change",e)},onerror(e){screenfull.on("error",e)},on(e,t){const r=eventNameMap[e];r&&document.addEventListener(r,t,!1)},off(e,t){const r=eventNameMap[e];r&&document.removeEventListener(r,t,!1)},raw:nativeAPI}; // node_modules/screenfull/index.js Object.defineProperties(screenfull,{isFullscreen:{get:()=>Boolean(document[nativeAPI.fullscreenElement])},element:{enumerable:!0,get:()=>{var e;return null!=(e=document[nativeAPI.fullscreenElement])?e:void 0}},isEnabled:{enumerable:!0, // Coerce to boolean in case of old WebKit. get:()=>Boolean(document[nativeAPI.fullscreenEnabled])}}),nativeAPI||(screenfull={isEnabled:!1});var screenfull_default=screenfull,IUploader=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=>{const t=e.target.files;!t||t.length<=0?log.error("[Uploader] No files to be uploaded!"):this.uploadFiles(t)}}formats(){return log.warn("[Uploader]: Should call derived class instead!"),[]}uploadFiles(e){log.warn(`[Uploader]: Should call derived class instead! files: ${e}`)}openFileBrowserToUpload(){this.input.click()}},LocalModelUploader=class extends IUploader{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){const t=e.length;if(0===t)return;const r=__spreadValues({},this.defaultModelConfig);let i,n,s;const a=new Map;for(let r=0;r{s&&(i=URL.createObjectURL(s),o.push(i),r.src=s.name)};if(s){l();const e=LoaderUtils.extractUrlBase(i);n=new LoadingManager,n.setURLModifier((t=>{const r=decodeURI(t).replace(e,"").replace(/^(\.?\/)/,"");if(a.has(r)){const e=a.get(r),t=URL.createObjectURL(e);return o.push(t),t}return t}))}else s=e[0],l();this.viewer.loadLocalModel(i,r,n,(e=>{const t=Math.floor(100*e.loaded/e.total);log.info(`[Uploader] Loading ${null==s?void 0:s.name}, ${t}%`)})).then((()=>{log.info(`[Uploader] Loaded ${null==s?void 0:s.name}`),o.forEach(URL.revokeObjectURL)}))}},LocalDxfUploader=class extends IUploader{constructor(e,t){super(t), //eslint-disable-line this.defaultModelConfig={src:"",position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],instantiate:!1,merge:!0},this.viewer=e}formats(){return["dxf"]}uploadFiles(e){const t=e=>{const t=(100*e.loaded/e.total).toFixed(1);log.info(`[Uploader] Progress: ${t}%`)};if(2===e.length){const r=e[0],i=e[1],n=URL.createObjectURL(r),s=URL.createObjectURL(i);this.viewer.compare({src:n,modelId:r.name},{src:s,modelId:i.name},t).then((()=>{this.onSuccess&&this.onSuccess({compare:!0}),log.debug(`[Uploader] Compared models: ${n}, ${s}`)})).catch((e=>{log.error(`[Uploader] Failed to compare models: ${n}, ${s}. reason: ${e}`)}))}else{const r=e[0],i=URL.createObjectURL(r),n=__spreadValues({},this.defaultModelConfig);n.src=i,n.modelId=r.name;try{this.viewer.loadModelAsync(n,t).then((()=>{this.onSuccess&&this.onSuccess({}),log.info(`[Uploader] Loaded model '${n.src}'`)}))}catch(e){log.info(e)}}}},LocalImageUploader=class extends IUploader{constructor(e,t){super(t),this.viewer=e}formats(){return["png","jpg","jpeg"]}uploadFiles(e){const t={panoramas:[],id:"viewpoint_1",name:"",position:[0,1,0],initialDirection:[0,0,1]};if(1===e.length){const r=[];r.push(URL.createObjectURL(e[0])),t.panoramas.push({id:"panorama_1",images:r}),this.viewer.setViewpoints([t]),this.viewer.activatePanoramaById(t.id,t.panoramas[0].id)}else if(6===e.length){const r=t=>{let r="";for(let i=0;i(n=o.indexOf("\n"))&&s watts/steradian/m^2. defaults to 1.0 */ width:0,height:0 /* image dimensions, width/height */};let l,c;if(e.pos>=e.byteLength||!(l=r(e)))return t(1,"no header found");if(!(c=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(o.valid|=1,o.programtype=c[1],o.string+=l+"\n";l=r(e),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((c=l.match(i))&&(o.gamma=parseFloat(c[1])),(c=l.match(n))&&(o.exposure=parseFloat(c[1])),(c=l.match(s))&&(o.valid|=2,o.format=c[1]),(c=l.match(a))&&(o.valid|=4,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==a){const e=a.width,r=a.height,o=function(e,r,i){const n=r;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");const s=new Uint8Array(4*r*i);if(!s.length)return t(4,"unable to allocate buffer space");let a=0,o=0;const l=4*n,c=new Uint8Array(4),u=new Uint8Array(l);let h=i;for(;h>0&&oe.byteLength)return t(1);if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],2!=c[0]||2!=c[1]||(c[2]<<8|c[3])!=n)return t(3,"bad rgbe scanline format");let r,i=0;for(;i128;if(n&&(r-=128),0===r||i+r>l)return t(3,"bad scanline data");if(n){const t=e[o++];for(let e=0;e{r.load(t,(t=>{if(e){const r=e.fromEquirectangular(t).texture;e.dispose(),i(r)}}))}))}))} /** * Creates default environment texture */static createEnvTextureFromDataArray(e){return __async(this,arguments,(function*(e,t=this.HDR_CITY_STREET_64x32,r=64,i=32){if(e){const n=new DataTexture(t,r,i);n.flipY=!0,n.magFilter=LinearFilter,n.minFilter=LinearFilter,n.type=HalfFloatType,n.version=1;const s=e.fromEquirectangular(n).texture;return e.dispose(),Promise.resolve(s)}return Promise.reject("Invalid pmremGenerator!")}))}}; // src/core/local-model-uploader/LocalModelUploader.ts // src/components/dat-gui/BimViewerDatGui.ts function makeXYZGUI(e,t,r,i,n,s,a){const o=e.addFolder(t);o.add(r,"x",n,s,a).onChange(i),o.add(r,"y",n,s,a).onChange(i),o.add(r,"z",n,s,a).onChange(i)} // eslint-disable-next-line TextureUtils.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 BimViewerDatGui=class{ /** * * @param viewer pass in the Viewer3D, so we can reference its data members */ constructor(e){this.exploderDict={}, /** * Defined all controls here, which will be displyed in dat.GUI * Color should follow these formats: * '#ffffff', [0, 0, 0], [0, 0, 0, 0.5], \{ h: 100, s: 0.9, v: 0.3 \} */ this.controls={ // Common settings 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...") // model operations // showLayerManager: false, ,showBimTree:!1,showPropertyPanel:!1,transparentMode:!1,showVertexNormals:!1, // explodeMode: ['No explode', 'Explode', 'Explode Up'], // hide it beause it doesn't work well yet! sectionMode:["No section","Box section","Plane section"], // filterFloor: ['No filter', '-2F', '-1F', '1F', '2F', '3F', '4F', '5F', '6F', '7F', '8F', '9F', '10F', '11F', '12F', '13F', '14F', '15F', '16F', '17F', '18F', '19F', '20F'], // Ambient Light (环境光) alVisible:!0,alColor:"#cccccc",alIntensity:1, // Directinal Light (平行光) //dlVisible: true, dlColor:"#dddddd", //dlIntensity: 2, //dlCastShadow: true, showDlHelper:!1, // Hemisphere Light (半球光源) hlVisible:!0,hlIntensity:1,hlColor:[255,255,255,.6], // sky color hlGroundColor:[200,255,200,.6], // Fog fogEnabled:!1,fogColor:14540253,fogNearDistance:1,fogFarDistance:1e3, // Composer composerEnabled:!1,renderPassEnabled:!1,fxaaEnabled:!1,saoEnabled:!1,ssaoEnabled:!1,outlineEnabled:!1,ssaaEnabled:!1,bloomEnabled:!1,unrealBloomEnabled:!1},this.viewer=e,this.init()} /** * Init dat.GUI */init(){if(!this.viewer||!this.viewer.renderer||!this.viewer.scene)throw new Error("Need to initialize renderer, scene first!");const e=this.viewer,t=this.viewer.scene,r=this.controls;this.gui=new GUI$1({name:"controls",autoPlace:!0,width:300,closed:!0}),this.gui.domElement.style.opacity="0.6";const i=this.gui.addFolder("Common settings");i.add(r,"showGroundGrid").name("Show ground grid").onChange((r=>{e.groundGrid?e.groundGrid.visible=r:r&&(e.groundGrid=GroundUtils.createGroundGrid(),t.add(e.groundGrid),e.enableRender()),e.enableRender()})),i.add(r,"showGrassGround").name("Show grass ground").onChange((r=>{e.grassGround?e.grassGround.visible=r:r&&(()=>{__async(this,null,(function*(){e.grassGround=yield GroundUtils.createGrassGround(),t.add(e.grassGround),e.enableRender()}))})(),e.enableRender()}));const n=i.add(r,"skyMode",r.skyMode).name("Sky mode");n.onChange((r=>{if(e.skyOfGradientRamp&&(e.skyOfGradientRamp.visible="Gradient ramp"===r),"Black Background"===r)t.background=new Color(0);else if("White Background"===r)t.background=new Color(16777215);else if("Gradient ramp"===r)e.skyOfGradientRamp||(e.skyOfGradientRamp=SkyboxUtils.createSkyOfGradientRamp(),t.add(e.skyOfGradientRamp)),e.skyOfGradientRamp.visible=!0;else if("Cloudy"===r){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}`)),SkyboxUtils.createSkyFromTextures(e).then((e=>{t.background=e}))}else t.background=e.sceneBackgroundColor;e.enableRender()})),n.setValue("Gradient ramp");i.add(r,"environments",r.environments).name("Environments").onChange((r=>{let i="";if("Default (City Streat 64x32)"===r){if(e.pmremGenerator)return TextureUtils.createEnvTextureFromDataArray(e.pmremGenerator).then((e=>{t.environment=e})),void e.enableRender()}else"Venice Sunset"===r?i="venice_sunset_1k.hdr":"Footprint Court (HDR Labs)"===r?i="footprint_court_2k.hdr":"City Street"===r&&(i="city_street_256.hdr");""===i?t.environment=null:(i=`${window.location.origin}/images/envmap/${i}`,TextureUtils.createEnvTexture(e.pmremGenerator,i).then((e=>{t.environment=e}))),e.enableRender()})),i.add(r,"homeView").name("Go to home view").onChange((()=>{e.goToHomeView()})),i.add(r,"views",r.views).name("Views").onChange((r=>{var i;const n=new Vector3,s=new Vector3,a=SceneUtils.getVisibleObjectBoundingBox(t),o=Viewer3DUtils.getCameraDirectionByView(r);Viewer3DUtils.getCameraPositionByBboxAndDirection(a,n,s,null==(i=e.camera)?void 0:i.projectionMatrix,o),e.flyTo(n,s)})),i.add(r,"OrthographicCamera").name("Orth Camera").onChange((t=>{e.setToOrthographicCamera(t)})),i.add(r,"takeSnapshot").name("Take snapshot").onChange((()=>{})),i.add(r,"fullScreen").name("Full screen").onChange((()=>{screenfull_default&&screenfull_default.isEnabled&&screenfull_default.request(),e.enableRender()})),i.add(r,"uploadFile").name("Upload file").onChange((()=>{new LocalModelUploader(e).openFileBrowserToUpload()}));const s=this.gui.addFolder("Model operations");s.add(r,"transparentMode",r.transparentMode).name("Transparent mode").onChange((t=>{e.addOrRemoveObjectOpacity(t),e.enableRender()})),s.add(r,"showVertexNormals",r.showVertexNormals).name("Show Vertex Normals").onChange((t=>{e.showVertexNormals(t),e.enableRender()})),s.add(r,"sectionMode",r.sectionMode).name("Section mode").onChange((t=>{"No section"===t?e.deactivateSection():"Box section"===t?e.activateSection("ObjectsBoxSection"/* ObjectsBoxSection */):"Plane section"===t&&e.activateSection("PickPlaneSection"/* PickPlaneSection */),e.enableRender()}));const a=this.viewer.ambientLight,o=this.gui.addFolder("Ambient light");o.add(r,"alVisible",r.alVisible).name("visible").onChange((t=>{a&&(a.visible=t),e.enableRender()})),o.addColor(r,"alColor").name("color").onChange((t=>{a&&(a.color=new Color(t)),e.enableRender()})),o.add(r,"alIntensity",0,5).name("intensity").onChange((t=>{a&&(a.intensity=t),e.enableRender()}));const l=this.viewer.directionalLight;if(l){const t=this.gui.addFolder("Directional light");t.add(l,"visible").name("visible").onChange((t=>{l&&(l.visible=t),e.enableRender()})),t.addColor(r,"dlColor").name("color").onChange((t=>{l&&(l.color=new Color(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(r,"showDlHelper").name("showDlHelper").onChange((t=>{e.showDirectionalLightHelper(t),e.enableRender()}));const i=()=>{e.updateDirectionalLight(),e.enableRender()};makeXYZGUI(t,"position",l.position,i),makeXYZGUI(t,"target",l.target.position,i);const n=t.addFolder("shadow");n.add(l.shadow.camera,"near").name("near").onChange(i),n.add(l.shadow.camera,"far").name("far").onChange(i),n.add(l.shadow.camera,"zoom").name("zoom").onChange(i)}const c=this.viewer.hemisphereLight,u=this.gui.addFolder("Hemisphere Light");u.add(r,"hlVisible",r.hlVisible).name("visible").onChange((t=>{c&&(c.visible=t),e.enableRender()})),u.add(r,"hlIntensity",0,5).name("intensity").onChange((t=>{c&&(c.intensity=t),e.enableRender()})),u.addColor(r,"hlColor").name("color").onChange((t=>{c&&(c.color=new Color(t)),e.enableRender()})),u.addColor(r,"hlGroundColor").name("groundColor").onChange((t=>{c&&(c.groundColor=new Color(t)),e.enableRender()}));const h=this.gui.addFolder("Fog");h.add(r,"fogEnabled",r.fogEnabled).name("Enabled").onChange((i=>{t.fog=i?new Fog(r.fogColor,r.fogNearDistance,r.fogFarDistance):null,e.enableRender()})),h.add(r,"fogNearDistance",0,100).name("Near").onChange((i=>{r.fogEnabled&&t&&(t.fog=new Fog(r.fogColor,i,r.fogFarDistance)),e.enableRender()})),h.add(r,"fogFarDistance",100,2e3).name("Far").onChange((i=>{r.fogEnabled&&t&&(t.fog=new Fog(r.fogColor,r.fogNearDistance,i)),e.enableRender()}));const p=this.gui.addFolder("Composer");p.add(r,"composerEnabled",r.composerEnabled).name("Composer Enabled").onChange((t=>{e.enableComposer(t)})),p.add(r,"renderPassEnabled",r.renderPassEnabled).name("RenderPass Enabled").onChange((t=>{e.enableRenderPass(t)})),p.add(r,"fxaaEnabled",r.fxaaEnabled).name("Effect FXAA Enabled").onChange((t=>{e.enableFxaaPass(t)})),p.add(r,"saoEnabled",r.saoEnabled).name("SAO Enabled").onChange((t=>{e.enableSaoPass(t)})),p.add(r,"ssaoEnabled",r.ssaoEnabled).name("SSAO Enabled").onChange((t=>{e.enableSsaoPass(t)})),p.add(r,"outlineEnabled",r.outlineEnabled).name("OutlinePass Enabled").onChange((t=>{e.enableOutlinePass(t)})),p.add(r,"ssaaEnabled",r.ssaaEnabled).name("SSAA Enabled").onChange((t=>{e.enableSsaaPass(t)})),p.add(r,"bloomEnabled",r.bloomEnabled).name("Bloom Enabled").onChange((t=>{e.enableBloomPass(t)})),p.add(r,"unrealBloomEnabled",r.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?SceneUtils.explodeObjects(this.viewer.scene,this.exploderDict,Object.values(this.viewer.loadedModels).map((e=>e.id)),t):SceneUtils.unexplodeObjects(this.viewer.scene,this.exploderDict||{}))} // private filterFloor (floor: string) { // if (this.viewer && this.viewer.scene && this.viewer.loadedModels) { // const scene = this.viewer.scene // const ids = Object.values(this.viewer.loadedModels).map(obj => obj.id) // if (floor) { // const f = Number(floor.replace('F', '')) // ids.forEach(id => { // ObjectUtils.setVisibleForFloors(scene, id, [f]) // }) // } else { // ids.forEach(id => { // ObjectUtils.revertVisibleForFloorsById(scene, id) // }) // } // this.viewer.enableRender() // } // } 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=[]}},CSS2DObject=class extends Object3D{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}},_vector3=new Vector3,_viewMatrix=new Matrix4,_viewProjectionMatrix=new Matrix4,_a=new Vector3,_b=new Vector3,CSS2DRenderer=class{constructor(e={}){const t=this;let r,i,n,s;const a={objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");function l(e,r,i){if(e.isCSS2DObject){_vector3.setFromMatrixPosition(e.matrixWorld),_vector3.applyMatrix4(_viewProjectionMatrix);const l=!0===e.visible&&_vector3.z>=-1&&_vector3.z<=1&&!0===e.layers.test(i.layers);if(e.element.style.display=!0===l?"":"none",!0===l){e.onBeforeRender(t,r,i);const a=e.element;a.style.transform="translate(-50%,-50%) translate("+(_vector3.x*n+n)+"px,"+(-_vector3.y*s+s)+"px)",a.parentNode!==o&&o.appendChild(a),e.onAfterRender(t,r,i)}const u={distanceToCameraSquared:c(i,e)};a.objects.set(e,u)}for(let t=0,n=e.children.length;t0)continue;if(!t.geometry)continue;let s=!1;const a=Object.values(r);for(let o=a.length-1;o>=0;--o){const l=a[o].indexes[0],c=e.children[l];if(this.geometryEquals(t.geometry,c.geometry)&&MaterialUtils.materialsEquals(t.material,c.material)){r[l]||(r[l]={indexes:[l]},this.removeFromArray(i,l)),r[l].indexes.push(n),s=!0;break}}for(let a=i.length-1;!s&&a>=0;--a){const o=i[a],l=e.children[o];if(this.geometryEquals(t.geometry,l.geometry)&&MaterialUtils.materialsEquals(t.material,l.material)){r[o]||(r[o]={indexes:[o]},this.removeFromArray(i,o)),r[o].indexes.push(n),s=!0;break}}s||i.push(n)}if(Object.keys(r).length<=0)return;const n=[],s=[];Object.values(r).forEach((t=>{const r=t.indexes;s.push(...r);const i=e.children[r[0]];let a=i.material;if(a instanceof Material)a=a.clone();else if(Array.isArray(a)){const e=[];a.forEach((t=>e.push(t.clone()))),a=e}const o=new InstancedMesh(i.geometry,a,r.length);o.name=`[Instanced] ${i.name}`;for(let t=0;tt-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`)} /** * Removes a number from array */removeFromArray(e,t){for(let r=e.length-1;r>=0;--r)if(e[r]===t)return void e.splice(r,1)} /** * Checks if two geometries equal */geometryEquals(e,t){return GeometryUtils.geometryEquals(e,t)}},TGALoader=class extends DataTextureLoader{constructor(e){super(e)}parse(e){const t=0,r=1,i=2,n=3,s=9,a=10,o=11,l=48,c=4,u=0,h=1,p=2,d=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let m=0;const f=new Uint8Array(e),g={id_length:f[m++],colormap_type:f[m++],image_type:f[m++],colormap_index:f[m++]|f[m++]<<8,colormap_length:f[m++]|f[m++]<<8,colormap_size:f[m++],origin:[f[m++]|f[m++]<<8,f[m++]|f[m++]<<8],width:f[m++]|f[m++]<<8,height:f[m++]|f[m++]<<8,pixel_size:f[m++],flags:f[m++]};!function(e){switch(e.image_type){case r:case s:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case i:case n:case a:case o:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(g),g.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=g.id_length;let _=!1,y=!1,T=!1;switch(g.image_type){case s:_=!0,y=!0;break;case r:y=!0;break;case a:_=!0;break;case i:break;case o:_=!0,T=!0;break;case n:T=!0}const v=new Uint8Array(g.width*g.height*4),E=function(e,t,r,i,n){let s,a;const o=r.pixel_size>>3,l=r.width*r.height*o;if(t&&(a=n.subarray(i,i+=r.colormap_length*(r.colormap_size>>3))),e){let e,t,r;s=new Uint8Array(l);let a=0;const c=new Uint8Array(o);for(;a>c){default:case p:s=0,o=1,f=t,a=0,m=1,_=r;break;case u:s=0,o=1,f=t,a=r-1,m=-1,_=-1;break;case d:s=t-1,o=-1,f=-1,a=0,m=1,_=r;break;case h:s=t-1,o=-1,f=-1,a=r-1,m=-1,_=-1}if(T)switch(g.pixel_size){case 8:!function(e,t,r,i,n,s,a,o){let l,c,u,h=0;const p=g.width;for(u=t;u!==i;u+=r)for(c=n;c!==a;c+=s,h++)l=o[h],e[4*(c+p*u)+0]=l,e[4*(c+p*u)+1]=l,e[4*(c+p*u)+2]=l,e[4*(c+p*u)+3]=255}(e,a,m,_,s,o,f,i);break;case 16:!function(e,t,r,i,n,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==i;c+=r)for(l=n;l!==a;l+=s,u+=2)e[4*(l+h*c)+0]=o[u+0],e[4*(l+h*c)+1]=o[u+0],e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+3]=o[u+1]}(e,a,m,_,s,o,f,i);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(g.pixel_size){case 8:!function(e,t,r,i,n,s,a,o,l){const c=l;let u,h,p,d=0;const m=g.width;for(p=t;p!==i;p+=r)for(h=n;h!==a;h+=s,d++)u=o[d],e[4*(h+m*p)+3]=255,e[4*(h+m*p)+2]=c[3*u+0],e[4*(h+m*p)+1]=c[3*u+1],e[4*(h+m*p)+0]=c[3*u+2]}(e,a,m,_,s,o,f,i,n);break;case 16:!function(e,t,r,i,n,s,a,o){let l,c,u,h=0;const p=g.width;for(u=t;u!==i;u+=r)for(c=n;c!==a;c+=s,h+=2)l=o[h+0]+(o[h+1]<<8),e[4*(c+p*u)+0]=(31744&l)>>7,e[4*(c+p*u)+1]=(992&l)>>2,e[4*(c+p*u)+2]=(31&l)<<3,e[4*(c+p*u)+3]=32768&l?0:255}(e,a,m,_,s,o,f,i);break;case 24:!function(e,t,r,i,n,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==i;c+=r)for(l=n;l!==a;l+=s,u+=3)e[4*(l+h*c)+3]=255,e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2]}(e,a,m,_,s,o,f,i);break;case 32:!function(e,t,r,i,n,s,a,o){let l,c,u=0;const h=g.width;for(c=t;c!==i;c+=r)for(l=n;l!==a;l+=s,u+=4)e[4*(l+h*c)+2]=o[u+0],e[4*(l+h*c)+1]=o[u+1],e[4*(l+h*c)+0]=o[u+2],e[4*(l+h*c)+3]=o[u+3]}(e,a,m,_,s,o,f,i);break;default:console.error("THREE.TGALoader: Format not supported.")}}(v,g.width,g.height,E.pixel_data,E.palettes),{data:v,width:g.width,height:g.height,flipY:!0,generateMipmaps:!0,minFilter:LinearMipmapLinearFilter}}},ColladaLoader=class extends Loader{constructor(e){super(e)}load(e,t,r,i){const n=this,s=""===n.path?LoaderUtils.extractUrlBase(e):n.path,a=new FileLoader(n.manager);a.setPath(n.path),a.setRequestHeader(n.requestHeader),a.setWithCredentials(n.withCredentials),a.load(e,(function(r){try{t(n.parse(r,s))}catch(t){i?i(t):console.error(t),n.manager.itemError(e)}}),r,i)}parse(e,t){function r(e,t){const r=[],i=e.childNodes;for(let e=0,n=i.length;e0&&t.push(new VectorKeyframeTrack(i+".position",n,s)),a.length>0&&t.push(new QuaternionKeyframeTrack(i+".quaternion",n,a)),o.length>0&&t.push(new VectorKeyframeTrack(i+".scale",n,o)),t}function I(e,t,r){let i,n,s,a=!0;for(n=0,s=e.length;n=0;){const i=e[t];if(null!==i.value[r])return i;t--}return null}function x(e,t,r){for(;t>>0));r=r.toLowerCase(),t="tga"===r?We:qe;return t}(n);if(void 0!==t){const i=t.load(n),s=e.extra;if(void 0!==s&&void 0!==s.technique&&!1===o(s.technique)){const e=s.technique;i.wrapS=e.wrapU?RepeatWrapping:ClampToEdgeWrapping,i.wrapT=e.wrapV?RepeatWrapping:ClampToEdgeWrapping,i.offset.set(e.offsetU||0,e.offsetV||0),i.repeat.set(e.repeatU||1,e.repeatV||1)}else i.wrapS=RepeatWrapping,i.wrapT=RepeatWrapping;return null!==r&&(i.encoding=r),i}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}n.name=e.name||"";const a=i.parameters;for(const e in a){const t=a[e];switch(e){case"diffuse":t.color&&n.color.fromArray(t.color),t.texture&&(n.map=s(t.texture,sRGBEncoding));break;case"specular":t.color&&n.specular&&n.specular.fromArray(t.color),t.texture&&(n.specularMap=s(t.texture));break;case"bump":t.texture&&(n.normalMap=s(t.texture));break;case"ambient":t.texture&&(n.lightMap=s(t.texture,sRGBEncoding));break;case"shininess":t.float&&n.shininess&&(n.shininess=t.float);break;case"emission":t.color&&n.emissive&&n.emissive.fromArray(t.color),t.texture&&(n.emissiveMap=s(t.texture,sRGBEncoding))}}n.color.convertSRGBToLinear(),n.specular&&n.specular.convertSRGBToLinear(),n.emissive&&n.emissive.convertSRGBToLinear();let l=a.transparent,c=a.transparency;if(void 0===c&&l&&(c={float:1}),void 0===l&&c&&(l={opaque:"A_ONE",data:{color:[1,1,1,1]}}),l&&c)if(l.data.texture)n.transparent=!0;else{const e=l.data.color;switch(l.opaque){case"A_ONE":n.opacity=e[3]*c.float;break;case"RGB_ZERO":n.opacity=1-e[0]*c.float;break;case"A_ZERO":n.opacity=1-e[3]*c.float;break;case"RGB_ONE":n.opacity=e[0]*c.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',l.opaque)}n.opacity<1&&(n.transparent=!0)}if(void 0!==i.extra&&void 0!==i.extra.technique){const e=i.extra.technique;for(const t in e){const r=e[t];switch(t){case"double_sided":n.side=1===r?DoubleSide:FrontSide;break;case"bump":n.normalMap=s(r.texture),n.normalScale=new Vector2(1,1)}}}return n}function J(e){return p(Ze.materials[e],X)}function $(e){for(let t=0;t0?r+o:r;t.inputs[l]={id:e,offset:n},t.stride=Math.max(t.stride,n+1),"TEXCOORD"===r&&(t.hasUV=!0);break;case"vcount":t.vcount=s(i.textContent);break;case"p":t.p=s(i.textContent)}}return t}function le(e){let t=0;for(let r=0,i=e.length;r0&&t0&&d.setAttribute("position",new Float32BufferAttribute(n.array,n.stride)),s.array.length>0&&d.setAttribute("normal",new Float32BufferAttribute(s.array,s.stride)),l.array.length>0&&d.setAttribute("color",new Float32BufferAttribute(l.array,l.stride)),a.array.length>0&&d.setAttribute("uv",new Float32BufferAttribute(a.array,a.stride)),o.array.length>0&&d.setAttribute("uv2",new Float32BufferAttribute(o.array,o.stride)),c.length>0&&d.setAttribute("skinIndex",new Float32BufferAttribute(c,u)),h.length>0&&d.setAttribute("skinWeight",new Float32BufferAttribute(h,p)),i.data=d,i.type=e[0].type,i.materialKeys=m,i}function he(e,t,r,i,n=!1){const s=e.p,a=e.stride,o=e.vcount;function l(e){let t=s[e+r]*u;const a=t+u;for(;t4)for(let t=1,i=r-2;t<=i;t++){const r=e+a*t,i=e+a*(t+1);l(e+0*a),l(r),l(i)}e+=a*r}}else for(let e=0,t=s.length;e=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function _e(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let r=0;ri.limits.max||t{this.decodeDracoFile(e,t).catch(i)}),r,i)}decodeDracoFile(e,t,r,i){const n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};return this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){const r=JSON.stringify(t);if(_taskCache.has(e)){const t=_taskCache.get(e);if(t.key===r)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 i;const n=this.workerNextTaskID++,s=e.byteLength,a=this._getWorker(n,s).then((r=>(i=r,new Promise(((r,s)=>{i._callbacks[n]={resolve:r,reject:s},i.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return a.catch((()=>!0)).then((()=>{i&&n&&this._releaseTask(i,n)})),_taskCache.set(e,{key:r,promise:a}),a}_createGeometry(e){const t=new BufferGeometry;e.index&&t.setIndex(new BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const i=DRACOWorker.toString(),n=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.lengtht._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e{const t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{const e=function(e,t,i,n){const s=n.attributeIDs,a=n.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(i);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(i,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(i,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const u={index:null,attributes:[]};for(const i in s){const l=self[a[i]];let c,h;if(n.useUniqueIDs)h=s[i],c=t.GetAttributeByUniqueId(o,h);else{if(h=t.GetAttributeId(o,e[s[i]]),-1===h)continue;c=t.GetAttribute(o,h)}u.attributes.push(r(e,t,o,i,l,c))}c===e.TRIANGULAR_MESH&&(u.index=function(e,t,r){const i=r.num_faces(),n=3*i,s=4*n,a=e._malloc(s);t.GetTrianglesUInt32Array(r,s,a);const o=new Uint32Array(e.HEAPF32.buffer,a,n).slice();return e._free(a),{array:o,itemSize:1}}(e,t,o));return e.destroy(o),u}(t,a,o,s),i=e.attributes.map((e=>e.array.buffer));e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(o),t.destroy(a)}}))}}} // node_modules/three/examples/jsm/libs/fflate.module.js var fflate_module_exports={};__export(fflate_module_exports,{AsyncCompress:()=>AsyncGzip,AsyncDecompress:()=>AsyncDecompress,AsyncDeflate:()=>AsyncDeflate,AsyncGunzip:()=>AsyncGunzip,AsyncGzip:()=>AsyncGzip,AsyncInflate:()=>AsyncInflate,AsyncUnzipInflate:()=>AsyncUnzipInflate,AsyncUnzlib:()=>AsyncUnzlib,AsyncZipDeflate:()=>AsyncZipDeflate,AsyncZlib:()=>AsyncZlib,Compress:()=>Gzip,DecodeUTF8:()=>DecodeUTF8,Decompress:()=>Decompress,Deflate:()=>Deflate,EncodeUTF8:()=>EncodeUTF8,Gunzip:()=>Gunzip,Gzip:()=>Gzip,Inflate:()=>Inflate,Unzip:()=>Unzip,UnzipInflate:()=>UnzipInflate,UnzipPassThrough:()=>UnzipPassThrough,Unzlib:()=>Unzlib,Zip:()=>Zip,ZipDeflate:()=>ZipDeflate,ZipPassThrough:()=>ZipPassThrough,Zlib:()=>Zlib,compress:()=>gzip,compressSync:()=>gzipSync,decompress:()=>decompress,decompressSync:()=>decompressSync,deflate:()=>deflate,deflateSync:()=>deflateSync,gunzip:()=>gunzip,gunzipSync:()=>gunzipSync,gzip:()=>gzip,gzipSync:()=>gzipSync,inflate:()=>inflate,inflateSync:()=>inflateSync,strFromU8:()=>strFromU8,strToU8:()=>strToU8,unzip:()=>unzip,unzipSync:()=>unzipSync,unzlib:()=>unzlib,unzlibSync:()=>unzlibSync,zip:()=>zip,zipSync:()=>zipSync,zlib:()=>zlib,zlibSync:()=>zlibSync});var ch2={},durl=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},cwk=function(e){return new Worker(e)};try{URL.revokeObjectURL(durl(""))}catch(e){durl=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},cwk=function(e){return new Worker(e,{type:"module"})}}var wk=function(e,t,r,i,n){var s=cwk(ch2[t]||(ch2[t]=durl(e)));return s.onerror=function(e){return n(e.error,null)},s.onmessage=function(e){return n(null,e.data)},s.postMessage(r,i),s},u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([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, /* unused */ 0,0, /* impossible */ 0]),fdeb=new u8([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, /* unused */ 0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var r=new u16(31),i=0;i<31;++i)r[i]=t+=1<>>1|(21845&i)<<1))>>>2|(13107&x)<<2))>>>4|(3855&x)<<4,rev[i]=((65280&x)>>>8|(255&x)<<8)>>>1;var hMap=function(e,t,r){for(var i=e.length,n=0,s=new u16(t);n>>l]=c}else for(a=new u16(i),n=0;n>>15-e[n]);return a},flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;for(i=144;i<256;++i)flt[i]=9;for(i=256;i<280;++i)flt[i]=7;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),max=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},bits=function(e,t,r){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&r},bits16=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},shft=function(e){return(e/8|0)+(7&e&&1)},slc=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof u16?u16:e instanceof u32?u32:u8)(r-t);return i.set(e.subarray(t,r)),i},inflt=function(e,t,r){var i=e.length;if(!i||r&&!r.l&&i<5)return t||new u8(0);var n=!t||r,s=!r||r.i;r||(r={}),t||(t=new u8(3*i));var a=function(e){var r=t.length;if(e>r){var i=new u8(Math.max(2*r,e));i.set(t),t=i}},o=r.f||0,l=r.p||0,c=r.b||0,u=r.l,h=r.d,p=r.m,d=r.n,m=8*i;do{if(!u){r.f=o=bits(e,l,1);var f=bits(e,l+1,3);if(l+=3,!f){var g=e[(C=shft(l)+4)-4]|e[C-3]<<8,_=C+g;if(_>i){if(s)throw"unexpected EOF";break}n&&a(c+g),t.set(e.subarray(C,_),c),r.b=c+=g,r.p=l=8*_;continue}if(1==f)u=flrm,h=fdrm,p=9,d=5;else{if(2!=f)throw"invalid block type";var y=bits(e,l,31)+257,T=bits(e,l+10,15)+4,v=y+bits(e,l+5,31)+1;l+=14;for(var E=new u8(v),I=new u8(19),b=0;b>>4)<16)E[b++]=C;else{var R=0,A=0;for(16==C?(A=3+bits(e,l,3),l+=2,R=E[b-1]):17==C?(A=3+bits(e,l,7),l+=3):18==C&&(A=11+bits(e,l,127),l+=7);A--;)E[b++]=R}}var D=E.subarray(0,y),O=E.subarray(y);p=max(D),d=max(O),u=hMap(D,p,1),h=hMap(O,d,1)}if(l>m){if(s)throw"unexpected EOF";break}}n&&a(c+131072);for(var L=(1<>>4;if((l+=15&R)>m){if(s)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(F<256)t[c++]=F;else{if(256==F){N=l,u=null;break}var U=F-254;if(F>264){var B=fleb[b=F-257];U=bits(e,l,(1<>>4;if(!k)throw"invalid distance";l+=15&k;O=fd[G];if(G>3){B=fdeb[G];O+=bits16(e,l)&(1<m){if(s)throw"unexpected EOF";break}n&&a(c+131072);for(var V=c+U;c>>8},wbits16=function(e,t,r){r<<=7&t;var i=t/8|0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},hTree=function(e,t){for(var r=[],i=0;ip&&(p=s[i].s);var d=new u16(p+1),m=ln(r[u-1],d,0);if(m>t){i=0;var f=0,g=m-t,_=1<t))break;f+=_-(1<>>=g;f>0;){var T=s[i].s;d[T]=0&&f;--i){var v=s[i].s;d[v]==t&&(--d[v],++f)}m=t}return[new u8(d),m]},ln=function(e,t,r){return-1==e.s?Math.max(ln(e.l,t,r+1),ln(e.r,t,r+1)):t[e.s]=r},lc=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new u16(++t),i=0,n=e[0],s=1,a=function(e){r[i++]=e},o=1;o<=t;++o)if(e[o]==n&&o!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=e[o]}return[r.subarray(0,i),t]},clen=function(e,t){for(var r=0,i=0;i>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;s4&&!w[clim[M-1]];--M);var R,A,D,O,L=c+5<<3,P=clen(n,flt)+clen(s,fdt)+a,N=clen(n,p)+clen(s,f)+a+14+3*M+clen(b,w)+(2*b[16]+3*b[17]+7*b[18]);if(L<=P&&L<=N)return wfblk(t,u,e.subarray(l,l+c));if(wbits(t,u,1+(N15&&(wbits(t,u,k[x]>>>5&127),u+=k[x]>>>12)}}}else R=flm,A=flt,D=fdm,O=fdt;for(x=0;x255){G=i[x]>>>18&31;wbits16(t,u,R[G+257]),u+=A[G+257],G>7&&(wbits(t,u,i[x]>>>23&31),u+=fleb[G]);var V=31&i[x];wbits16(t,u,D[V]),u+=O[V],V>3&&(wbits16(t,u,i[x]>>>5&8191),u+=fdeb[V])}else wbits16(t,u,R[i[x]]),u+=A[i[x]];return wbits16(t,u,R[256]),u+A[256]},deo=new u32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(e,t,r,i,n,s){var a=e.length,o=new u8(i+a+5*(1+Math.ceil(a/7e3))+n),l=o.subarray(i,o.length-n),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var h=u+65535;h>>13,m=8191&p,f=(1<7e3||w>24576)&&O>423){c=wblk(e,l,0,E,I,b,S,w,M,u-M,c),w=x=S=0,M=u;for(var L=0;L<286;++L)I[L]=0;for(L=0;L<30;++L)b[L]=0}var P=2,N=0,F=m,U=A-D&32767;if(O>2&&R==v(u-U))for(var B=Math.min(d,O)-1,k=Math.min(32767,u),G=Math.min(258,O);U<=k&&--F&&A!=D;){if(e[u+P]==e[u+P-U]){for(var V=0;VP){if(P=V,N=U,V>B)break;var H=Math.min(U,V-2),j=0;for(L=0;Lj&&(j=q,D=z)}}}U+=(A=D)-(D=g[A])+32768&32767}if(N){E[w++]=268435456|revfl[P]<<18|revfd[N];var W=31&revfl[P],Y=31&revfd[N];S+=fleb[W]+fdeb[Y],++I[257+W],++b[Y],C=u+P,++x}else E[w++]=e[u],++I[e[u]]}}c=wblk(e,l,s,E,I,b,S,w,M,u-M,c),!s&&7&c&&(c=wfblk(l,c+1,et))}return slc(o,0,i+shft(c)+n)},crct=function(){for(var e=new u32(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),crc=function(){var e=-1;return{p:function(t){for(var r=e,i=0;i>>8;e=r},d:function(){return~e}}},adler=function(){var e=1,t=0;return{p:function(r){for(var i=e,n=t,s=r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a>16),n=(65535&n)+15*(n>>16)}e=i,t=n},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},dopt=function(e,t,r,i,n){return dflt(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i,!n)},mrg=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},wcln=function(e,t,r){for(var i=e(),n=e.toString(),s=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/ /g,"").split(","),a=0;a>>0},b8=function(e,t){return b4(e,t)+4294967296*b4(e,t+4)},wbytes=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},gzh=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&wbytes(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}},gzs=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],r=10;4&t&&(r+=e[10]|2+(e[11]<<8));for(var i=(t>>3&1)+(t>>4&1);i>0;i-=!e[r++]);return r+(2&t)},gzl=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},gzhl=function(e){return 10+(e.filename&&e.filename.length+1||0)},zlh=function(e,t){var r=t.level,i=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)},zlv=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 AsyncCmpStrm(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var Deflate=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(dopt(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),AsyncDeflate=function(){return function(e,t){astrmify([bDflt,function(){return[astrm,Deflate]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new Deflate(e.data);onmessage=astrm(t)}),6)}}();function deflate(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bDflt],(function(e){return pbf(deflateSync(e.data[0],e.data[1]))}),0,r)}function deflateSync(e,t){return dopt(e,t||{},0,0)}var Inflate=function(){function e(e){this.s={},this.p=new u8(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,r=new u8(t+e.length);r.set(this.p),r.set(e,t),this.p=r},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,r=inflt(this.p,this.o,this.s);this.ondata(slc(r,t,this.s.b),this.d),this.o=slc(r,this.s.b-32768),this.s.b=this.o.length,this.p=slc(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),AsyncInflate=function(){return function(e){this.ondata=e,astrmify([bInflt,function(){return[astrm,Inflate]}],this,0,(function(){var e=new Inflate;onmessage=astrm(e)}),7)}}();function inflate(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bInflt],(function(e){return pbf(inflateSync(e.data[0],gu8(e.data[1])))}),1,r)}function inflateSync(e,t){return inflt(e,t)}var Gzip=function(){function e(e,t){this.c=crc(),this.l=0,this.v=1,Deflate.call(this,e,t)}return e.prototype.push=function(e,t){Deflate.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var r=dopt(e,this.o,this.v&&gzhl(this.o),t&&8,!t);this.v&&(gzh(r,this.o),this.v=0),t&&(wbytes(r,r.length-8,this.c.d()),wbytes(r,r.length-4,this.l)),this.ondata(r,t)},e}(),AsyncGzip=function(){return function(e,t){astrmify([bDflt,gze,function(){return[astrm,Deflate,Gzip]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new Gzip(e.data);onmessage=astrm(t)}),8)}}();function gzip(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bDflt,gze,function(){return[gzipSync]}],(function(e){return pbf(gzipSync(e.data[0],e.data[1]))}),2,r)}function gzipSync(e,t){t||(t={});var r=crc(),i=e.length;r.p(e);var n=dopt(e,t,gzhl(t),8),s=n.length;return gzh(n,t),wbytes(n,s-8,r.d()),wbytes(n,s-4,i),n}var Gunzip=function(){function e(e){this.v=1,Inflate.call(this,e)}return e.prototype.push=function(e,t){if(Inflate.prototype.e.call(this,e),this.v){var r=this.p.length>3?gzs(this.p):4;if(r>=this.p.length&&!t)return;this.p=this.p.subarray(r),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Inflate.prototype.c.call(this,t)},e}(),AsyncGunzip=function(){return function(e){this.ondata=e,astrmify([bInflt,guze,function(){return[astrm,Inflate,Gunzip]}],this,0,(function(){var e=new Gunzip;onmessage=astrm(e)}),9)}}();function gunzip(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bInflt,guze,function(){return[gunzipSync]}],(function(e){return pbf(gunzipSync(e.data[0]))}),3,r)}function gunzipSync(e,t){return inflt(e.subarray(gzs(e),-8),t||new u8(gzl(e)))}var Zlib=function(){function e(e,t){this.c=adler(),this.v=1,Deflate.call(this,e,t)}return e.prototype.push=function(e,t){Deflate.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var r=dopt(e,this.o,this.v&&2,t&&4,!t);this.v&&(zlh(r,this.o),this.v=0),t&&wbytes(r,r.length-4,this.c.d()),this.ondata(r,t)},e}(),AsyncZlib=function(){return function(e,t){astrmify([bDflt,zle,function(){return[astrm,Deflate,Zlib]}],this,AsyncCmpStrm.call(this,e,t),(function(e){var t=new Zlib(e.data);onmessage=astrm(t)}),10)}}();function zlib(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bDflt,zle,function(){return[zlibSync]}],(function(e){return pbf(zlibSync(e.data[0],e.data[1]))}),4,r)}function zlibSync(e,t){t||(t={});var r=adler();r.p(e);var i=dopt(e,t,2,4);return zlh(i,t),wbytes(i,i.length-4,r.d()),i}var Unzlib=function(){function e(e){this.v=1,Inflate.call(this,e)}return e.prototype.push=function(e,t){if(Inflate.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Inflate.prototype.c.call(this,t)},e}(),AsyncUnzlib=function(){return function(e){this.ondata=e,astrmify([bInflt,zule,function(){return[astrm,Inflate,Unzlib]}],this,0,(function(){var e=new Unzlib;onmessage=astrm(e)}),11)}}();function unzlib(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return cbify(e,t,[bInflt,zule,function(){return[unzlibSync]}],(function(e){return pbf(unzlibSync(e.data[0],gu8(e.data[1])))}),5,r)}function unzlibSync(e,t){return inflt((zlv(e),e.subarray(2,-4)),t)}var Decompress=function(){function e(e){this.G=Gunzip,this.I=Inflate,this.Z=Unzlib,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var r=new u8(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var i=this,n=function(){i.ondata.apply(i,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(n):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(n):new this.Z(n),this.s.push(this.p,t),this.p=null}}},e}(),AsyncDecompress=function(){function e(e){this.G=AsyncGunzip,this.I=AsyncInflate,this.Z=AsyncUnzlib,this.ondata=e}return e.prototype.push=function(e,t){Decompress.prototype.push.call(this,e,t)},e}();function decompress(e,t,r){if(r||(r=t,t={}),"function"!=typeof r)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?gunzip(e,t,r):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?inflate(e,t,r):unzlib(e,t,r)}function decompressSync(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?gunzipSync(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?inflateSync(e,t):unzlibSync(e,t)}var fltn=function(e,t,r,i){for(var n in e){var s=e[n],a=t+n;s instanceof u8?r[a]=[s,i]:Array.isArray(s)?r[a]=[s[0],mrg(i,s[1])]:fltn(s,a+"/",r,i)}},te="undefined"!=typeof TextEncoder&&new TextEncoder,td="undefined"!=typeof TextDecoder&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch(e){}var dutf8=function(e){for(var t="",r=0;;){var i=e[r++],n=(i>127)+(i>223)+(i>239);if(r+n>e.length)return[t,slc(e,r-1)];n?3==n?(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=String.fromCharCode(55296|i>>10,56320|1023&i)):t+=1&n?String.fromCharCode((31&i)<<6|63&e[r++]):String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(i)}},DecodeUTF8=function(){function e(e){this.ondata=e,tds?this.t=new TextDecoder:this.p=et}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var r=new u8(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length);var i=dutf8(r),n=i[0],s=i[1];if(t){if(s.length)throw"invalid utf-8 data";this.p=null}else this.p=s;this.ondata(n,t)}},e}(),EncodeUTF8=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(strToU8(e),this.d=t||!1)},e}();function strToU8(e,t){if(t){for(var r=new u8(e.length),i=0;i>1)),a=0,o=function(e){s[a++]=e};for(i=0;is.length){var l=new u8(a+8+(n-i<<1));l.set(s),s=l}var c=e.charCodeAt(i);c<128||t?o(c):c<2048?(o(192|c>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++i))>>18),o(128|c>>12&63),o(128|c>>6&63),o(128|63&c)):(o(224|c>>12),o(128|c>>6&63),o(128|63&c))}return slc(s,0,a)}function strFromU8(e,t){if(t){for(var r="",i=0;i65535)throw"extra field too long";t+=i+4}return t},wzh=function(e,t,r,i,n,s,a,o){var l=i.length,c=r.extra,u=o&&o.length,h=exfl(c);wbytes(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(null==s&&8),e[t++]=n&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var p=new Date(null==r.mtime?Date.now():r.mtime),d=p.getFullYear()-1980;if(d<0||d>119)throw"date not in range 1980-2099";if(wbytes(e,t,d<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),t+=4,null!=s&&(wbytes(e,t,r.crc),wbytes(e,t+4,s),wbytes(e,t+8,r.size)),wbytes(e,t+12,l),wbytes(e,t+14,h),t+=16,null!=a&&(wbytes(e,t,u),wbytes(e,t+6,r.attrs),wbytes(e,t+10,a),t+=14),e.set(i,t),t+=l,h)for(var m in c){var f=c[m],g=f.length;wbytes(e,t,+m),wbytes(e,t+2,g),e.set(f,t+4),t+=4+g}return u&&(e.set(o,t),t+=u),t},wzf=function(e,t,r,i,n){wbytes(e,t,101010256),wbytes(e,t+8,r),wbytes(e,t+10,r),wbytes(e,t+12,i),wbytes(e,t+16,n)},ZipPassThrough=function(){function e(e){this.filename=e,this.c=crc(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),ZipDeflate=function(){function e(e,t){var r=this;t||(t={}),ZipPassThrough.call(this,e),this.d=new Deflate(t,(function(e,t){r.ondata(null,e,t)})),this.compression=8,this.flag=dbf(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){ZipPassThrough.prototype.push.call(this,e,t)},e}(),AsyncZipDeflate=function(){function e(e,t){var r=this;t||(t={}),ZipPassThrough.call(this,e),this.d=new AsyncDeflate(t,(function(e,t,i){r.ondata(e,t,i)})),this.compression=8,this.flag=dbf(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){ZipPassThrough.prototype.push.call(this,e,t)},e}(),Zip=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var r=strToU8(e.filename),i=r.length,n=e.comment,s=n&&strToU8(n),a=i!=e.filename.length||s&&n.length!=s.length,o=i+exfl(e.extra)+30;if(i>65535)throw"filename too long";var l=new u8(o);wzh(l,0,e,r,a);var c=[l],u=function(){for(var e=0,r=c;e65535&&x("filename too long",null),b)if(g<16e4)try{x(null,deflateSync(d,m))}catch(e){x(e,null)}else u.push(deflate(d,m,x));else x(null,d)},m=0;m65535)throw"filename too long";var g=u?deflateSync(l,c):l,_=g.length,y=crc();y.p(l),i.push(mrg(c,{size:l.length,crc:y.d(),c:g,f:b,m:d,u:h!=a.length||d&&p.length!=m,o:n,compression:u})),n+=30+h+f+_,s+=76+2*(h+f)+(m||0)+_}for(var T=new u8(s+22),v=n,E=s-n,I=0;I0){var i=Math.min(this.c,e.length),n=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(i)).length)return this.push(e,t)}else{var s=0,a=0,o=void 0,l=void 0;this.p.length?e.length?((l=new u8(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var c=l.length,u=this.c,h=u&&this.d,p=function(){var e,t=b4(l,a);if(67324752==t){s=1,o=a,d.d=null,d.c=0;var i=b2(l,a+6),n=b2(l,a+8),h=2048&i,p=8&i,m=b2(l,a+26),f=b2(l,a+28);if(c>a+30+m+f){var g=[];d.k.unshift(g),s=2;var _,y=b4(l,a+18),T=b4(l,a+22),v=strFromU8(l.subarray(a+30,a+=30+m),!h);4294967295==y?(e=p?[-2]:z64e(l,a),y=e[0],T=e[1]):p&&(y=-1),a+=f,d.c=y;var E={name:v,compression:n,start:function(){if(!E.ondata)throw"no callback";if(y){var e=r.o[n];if(!e)throw"unknown compression type "+n;(_=y<0?new e(v):new e(v,y,T)).ondata=function(e,t,r){E.ondata(e,t,r)};for(var t=0,i=g;t=0&&(E.size=y,E.originalSize=T),d.onfile(E)}return"break"}if(u){if(134695760==t)return o=a+=12+(-2==u&&8),s=3,d.c=0,"break";if(33639248==t)return o=a-=4,s=3,d.c=0,"break"}},d=this;a65558)return void t("invalid zip file",null);var a=b2(e,s+8);a||t(null,{});var o=a,l=b4(e,s+16),c=4294967295==l;if(c){if(s=b4(e,s-12),101075792!=b4(e,s))return void t("invalid zip file",null);o=a=b4(e,s+32),l=b4(e,s+48)}for(var u=function(s){var o=zh(e,l,c),u=o[0],h=o[1],p=o[2],d=o[3],m=o[4],f=o[5],g=slzh(e,f);l=m;var _=function(e,r){e?(i(),t(e,null)):(n[d]=r,--a||t(null,n))};if(u)if(8==u){var y=e.subarray(g,g+h);if(h<32e4)try{_(null,inflateSync(y,new u8(p)))}catch(e){_(e,null)}else r.push(inflate(y,{size:p},_))}else _("unknown compression type "+u,null);else _(null,slc(e,g,g+h))},h=0;h65558)throw"invalid zip file";var i=b2(e,r+8);if(!i)return{};var n=b4(e,r+16),s=4294967295==n;if(s){if(r=b4(e,r-12),101075792!=b4(e,r))throw"invalid zip file";i=b4(e,r+32),n=b4(e,r+48)}for(var a=0;a=r[i])return i-1;if(t<=r[e])return e;let n=e,s=i,a=Math.floor((n+s)/2);for(;t=r[a+1];)t=s&&(l[n][0]=l[t][0]/o[u+1][c],i=l[n][0]*o[c][u]);const h=e-1<=u?s-1:r-e;for(let e=c>=-1?1:-c;e<=h;++e)l[n][e]=(l[t][e]-l[t][e-1])/o[u+1][c+e],i+=l[n][e]*o[c+e][u];e<=u&&(l[n][s]=-l[t][s-1]/o[u+1][e],i+=l[n][s]*o[e][u]),a[s][e]=i;const p=t;t=n,n=p}}let u=r;for(let e=1;e<=i;++e){for(let t=0;t<=r;++t)a[e][t]*=u;u*=r-e}return a}function calcBSplineDerivatives(e,t,r,i,n){const s=n texture, model->geometry ) // and details the connection type parseConnections(){const e=new Map;if("Connections"in fbxTree){fbxTree.Connections.connections.forEach((function(t){const r=t[0],i=t[1],n=t[2];e.has(r)||e.set(r,{parents:[],children:[]});const s={ID:i,relationship:n};e.get(r).parents.push(s),e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:r,relationship:n};e.get(i).children.push(a)}))}return e} // Parse FBXTree.Objects.Video for embedded image data // These images are connected to textures in FBXTree.Objects.Textures // via FBXTree.Connections. parseImages(){const e={},t={};if("Video"in fbxTree.Objects){const r=fbxTree.Objects.Video;for(const i in r){const n=r[i];if(e[parseInt(i)]=n.RelativeFilename||n.Filename,"Content"in n){const e=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,s="string"==typeof n.Content&&""!==n.Content;if(e||s){const e=this.parseImage(r[i]);t[n.RelativeFilename||n.Filename]=e}}}}for(const r in e){const i=e[r];void 0!==t[i]?e[r]=t[i]:e[r]=e[r].split("\\").pop()}return e} // Parse embedded image data in FBXTree.Video.Content parseImage(e){const t=e.Content,r=e.RelativeFilename||e.Filename,i=r.slice(r.lastIndexOf(".")+1).toLowerCase();let n;switch(i){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",r),n="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+i+'" is not supported.')}if("string"==typeof t)return"data:"+n+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:n}))}} // Parse nodes in FBXTree.Objects.Texture // These contain details such as UV scaling, cropping, rotation etc and are connected // to images in FBXTree.Objects.Video parseTextures(e){const t=new Map;if("Texture"in fbxTree.Objects){const r=fbxTree.Objects.Texture;for(const i in r){const n=this.parseTexture(r[i],e);t.set(parseInt(i),n)}}return t} // Parse individual node in FBXTree.Objects.Texture parseTexture(e,t){const r=this.loadTexture(e,t);r.ID=e.id,r.name=e.attrName;const i=e.WrapModeU,n=e.WrapModeV,s=void 0!==i?i.value:0,a=void 0!==n?n.value:0;if(r.wrapS=0===s?RepeatWrapping:ClampToEdgeWrapping,r.wrapT=0===a?RepeatWrapping:ClampToEdgeWrapping,"Scaling"in e){const t=e.Scaling.value;r.repeat.x=t[0],r.repeat.y=t[1]}if("Translation"in e){const t=e.Translation.value;r.offset.x=t[0],r.offset.y=t[1]}return r} // load a texture specified as a blob or data URI, or via an external URL using TextureLoader loadTexture(e,t){let r;const i=this.textureLoader.path,n=connections.get(e.id).children;let s;void 0!==n&&n.length>0&&void 0!==t[n[0].ID]&&(r=t[n[0].ID],0!==r.indexOf("blob:")&&0!==r.indexOf("data:")||this.textureLoader.setPath(void 0));const a=e.FileName.slice(-3).toLowerCase();if("tga"===a){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new Texture):(t.setPath(this.textureLoader.path),s=t.load(r))}else"psd"===a?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new Texture):s=this.textureLoader.load(r);return this.textureLoader.setPath(i),s} // Parse nodes in FBXTree.Objects.Material parseMaterials(e){const t=new Map;if("Material"in fbxTree.Objects){const r=fbxTree.Objects.Material;for(const i in r){const n=this.parseMaterial(r[i],e);null!==n&&t.set(parseInt(i),n)}}return t} // Parse single node in FBXTree.Objects.Material // Materials are connected to texture maps in FBXTree.Objects.Textures // FBX format currently only supports Lambert and Phong shading models parseMaterial(e,t){const r=e.id,i=e.attrName;let n=e.ShadingModel;if("object"==typeof n&&(n=n.value),!connections.has(r))return null;const s=this.parseParameters(e,t,r);let a;switch(n.toLowerCase()){case"phong":a=new MeshPhongMaterial;break;case"lambert":a=new MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),a=new MeshPhongMaterial}return a.setValues(s),a.name=i,a} // Parse FBX material and return parameters suitable for a three.js material // Also parse the texture map and return any textures associated with the material parseParameters(e,t,r){const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new Color).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(i.color=(new Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new Color).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(i.emissive=(new Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new Color).fromArray(e.SpecularColor.value));const n=this;return connections.get(r).children.forEach((function(e){const r=e.relationship;switch(r){case"Bump":i.bumpMap=n.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=n.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=n.getTexture(t,e.ID),void 0!==i.map&&(i.map.encoding=sRGBEncoding);break;case"DisplacementColor":i.displacementMap=n.getTexture(t,e.ID);break;case"EmissiveColor":i.emissiveMap=n.getTexture(t,e.ID),void 0!==i.emissiveMap&&(i.emissiveMap.encoding=sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=n.getTexture(t,e.ID);break;case"ReflectionColor":i.envMap=n.getTexture(t,e.ID),void 0!==i.envMap&&(i.envMap.mapping=EquirectangularReflectionMapping,i.envMap.encoding=sRGBEncoding);break;case"SpecularColor":i.specularMap=n.getTexture(t,e.ID),void 0!==i.specularMap&&(i.specularMap.encoding=sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=n.getTexture(t,e.ID),i.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r)}})),i} // get a texture from the textureMap for use by a material. getTexture(e,t){return"LayeredTexture"in fbxTree.Objects&&t in fbxTree.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=connections.get(t).children[0].ID),e.get(t)} // Parse nodes in FBXTree.Objects.Deformer // Deformer node can contain skinning or Vertex Cache animation data, however only skinning is supported here // Generates map of Skeleton-like objects for use later when generating and binding skeletons. parseDeformers(){const e={},t={};if("Deformer"in fbxTree.Objects){const r=fbxTree.Objects.Deformer;for(const i in r){const n=r[i],s=connections.get(parseInt(i));if("Skin"===n.attrType){const t=this.parseSkeleton(s,r);t.ID=i,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[i]=t}else if("BlendShape"===n.attrType){const e={id:i};e.rawTargets=this.parseMorphTargets(s,r),e.id=i,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[i]=e}}}return{skeletons:e,morphTargets:t}} // Parse single nodes in FBXTree.Objects.Deformer // The top level skeleton node has type 'Skin' and sub nodes have type 'Cluster' // Each skin node represents a skeleton and each cluster node represents a bone parseSkeleton(e,t){const r=[];return e.children.forEach((function(e){const i=t[e.ID];if("Cluster"!==i.attrType)return;const n={ID:e.ID,indices:[],weights:[],transformLink:(new Matrix4).fromArray(i.TransformLink.a)};"Indexes"in i&&(n.indices=i.Indexes.a,n.weights=i.Weights.a),r.push(n)})),{rawBones:r,bones:[]}} // The top level morph deformer node has type "BlendShape" and sub nodes have type "BlendShapeChannel" parseMorphTargets(e,t){const r=[];for(let i=0;i1?s=a:a.length>0?s=a[0]:(s=new MeshPhongMaterial({color:13421772}),a.push(s)),"color"in n.attributes&&a.forEach((function(e){e.vertexColors=!0})),n.FBX_Deformer?(i=new SkinnedMesh(n,s),i.normalizeSkinWeights()):i=new Mesh(n,s),i}createCurve(e,t){const r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),i=new LineBasicMaterial({color:3342591,linewidth:1});return new Line(r,i)} // parse the model node for transform data getTransformData(e,t){const r={};"InheritType"in t&&(r.inheritType=parseInt(t.InheritType.value)),r.eulerOrder="RotationOrder"in t?getEulerOrder(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(r.translation=t.Lcl_Translation.value),"PreRotation"in t&&(r.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(r.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(r.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(r.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(r.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(r.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(r.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(r.rotationPivot=t.RotationPivot.value),e.userData.transformData=r}setLookAtProperties(e,t){if("LookAtProperty"in t){connections.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const r=fbxTree.Objects.Model[t.ID];if("Lcl_Translation"in r){const t=r.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),sceneGraph.add(e.target)):e.lookAt((new Vector3).fromArray(t))}}}))}}bindSkeleton(e,t,r){const i=this.parsePoseNodes();for(const n in e){const s=e[n];connections.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;connections.get(t).parents.forEach((function(e){if(r.has(e.ID)){r.get(e.ID).bind(new Skeleton(s.bones),i[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in fbxTree.Objects){const t=fbxTree.Objects.Pose;for(const r in t)if("BindPose"===t[r].attrType&&t[r].NbPoseNodes>0){const i=t[r].PoseNode;Array.isArray(i)?i.forEach((function(t){e[t.Node]=(new Matrix4).fromArray(t.Matrix.a)})):e[i.Node]=(new Matrix4).fromArray(i.Matrix.a)}}return e} // Parse ambient color in FBXTree.GlobalSettings - if it's not set to black (default), create an ambient light createAmbientLight(){if("GlobalSettings"in fbxTree&&"AmbientColor"in fbxTree.GlobalSettings){const e=fbxTree.GlobalSettings.AmbientColor.value,t=e[0],r=e[1],i=e[2];if(0!==t||0!==r||0!==i){const e=new Color(t,r,i);sceneGraph.add(new AmbientLight(e,1))}}}},GeometryParser=class{constructor(){this.negativeMaterialIndices=!1} // Parse nodes in FBXTree.Objects.Geometry parse(e){const t=new Map;if("Geometry"in fbxTree.Objects){const r=fbxTree.Objects.Geometry;for(const i in r){const n=connections.get(parseInt(i)),s=this.parseGeometry(n,r[i],e);t.set(parseInt(i),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} // Parse single node in FBXTree.Objects.Geometry parseGeometry(e,t,r){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,r);case"NurbsCurve":return this.parseNurbsGeometry(t)}} // Parse single node mesh geometry in FBXTree.Objects.Geometry parseMeshGeometry(e,t,r){const i=r.skeletons,n=[],s=e.parents.map((function(e){return fbxTree.Objects.Model[e.ID]}));if(0===s.length)return;const a=e.children.reduce((function(e,t){return void 0!==i[t.ID]&&(e=i[t.ID]),e}),null);e.children.forEach((function(e){void 0!==r.morphTargets[e.ID]&&n.push(r.morphTargets[e.ID])}));const o=s[0],l={};"RotationOrder"in o&&(l.eulerOrder=getEulerOrder(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);const c=generateTransform(l);return this.genGeometry(t,a,n,c)} // Generate a BufferGeometry from a node in FBXTree.Objects.Geometry genGeometry(e,t,r,i){const n=new BufferGeometry;e.attrName&&(n.name=e.attrName);const s=this.parseGeoNode(e,t),a=this.genBuffers(s),o=new Float32BufferAttribute(a.vertex,3);if(o.applyMatrix4(i),n.setAttribute("position",o),a.colors.length>0&&n.setAttribute("color",new Float32BufferAttribute(a.colors,3)),t&&(n.setAttribute("skinIndex",new Uint16BufferAttribute(a.weightsIndices,4)),n.setAttribute("skinWeight",new Float32BufferAttribute(a.vertexWeights,4)),n.FBX_Deformer=t),a.normal.length>0){const e=(new Matrix3).getNormalMatrix(i),t=new Float32BufferAttribute(a.normal,3);t.applyNormalMatrix(e),n.setAttribute("normal",t)}if(a.uvs.forEach((function(e,t){let r="uv"+(t+1).toString();0===t&&(r="uv"),n.setAttribute(r,new Float32BufferAttribute(a.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=a.materialIndex[0],t=0;if(a.materialIndex.forEach((function(r,i){r!==e&&(n.addGroup(t,i-t,e),e=r,t=i)})),n.groups.length>0){const t=n.groups[n.groups.length-1],r=t.start+t.count;r!==a.materialIndex.length&&n.addGroup(r,a.materialIndex.length-r,e)}0===n.groups.length&&n.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(n,e,r,i),n}parseGeoNode(e,t){const r={};if(r.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],r.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(r.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(r.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(r.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){r.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&r.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return r.weightTable={},null!==t&&(r.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(i,n){void 0===r.weightTable[i]&&(r.weightTable[i]=[]),r.weightTable[i].push({id:t,weight:e.weights[n]})}))}))),r}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let r=0,i=0,n=!1,s=[],a=[],o=[],l=[],c=[],u=[];const h=this;return e.vertexIndices.forEach((function(p,d){let m,f=!1;p<0&&(p^=-1,f=!0);let g=[],_=[];if(s.push(3*p,3*p+1,3*p+2),e.color){const t=getData(d,r,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){_.push(e.weight),g.push(e.id)})),_.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const e=[0,0,0,0],t=[0,0,0,0];_.forEach((function(r,i){let n=r,s=g[i];t.forEach((function(t,r,i){if(n>t){i[r]=n,n=t;const a=e[r];e[r]=s,s=a}}))})),g=e,_=t}for(;_.length<4;)_.push(0),g.push(0);for(let e=0;e<4;++e)c.push(_[e]),u.push(g[e])}if(e.normal){const t=getData(d,r,p,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(m=getData(d,r,p,e.material)[0],m<0&&(h.negativeMaterialIndices=!0,m=0)),e.uv&&e.uv.forEach((function(e,t){const i=getData(d,r,p,e);void 0===l[t]&&(l[t]=[]),l[t].push(i[0]),l[t].push(i[1])})),i++,f&&(h.genFace(t,e,s,m,a,o,l,c,u,i),r++,i=0,s=[],a=[],o=[],l=[],c=[],u=[])})),t} // Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris genFace(e,t,r,i,n,s,a,o,l,c){for(let u=2;u1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=e.get(n[0].ID);r[i]={name:t[i].attrName,layer:s}}return r}addClip(e){let t=[];const r=this;return e.layer.forEach((function(e){t=t.concat(r.generateTracks(e))})),new AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let r=new Vector3,i=new Quaternion,n=new Vector3;if(e.transform&&e.transform.decompose(r,i,n),r=r.toArray(),i=(new Euler).setFromQuaternion(i,e.eulerOrder).toArray(),n=n.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,r,"position");void 0!==i&&t.push(i)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const r=this.generateRotationTrack(e.modelName,e.R.curves,i,e.preRotation,e.postRotation,e.eulerOrder);void 0!==r&&t.push(r)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");void 0!==r&&t.push(r)}if(void 0!==e.DeformPercent){const r=this.generateMorphTrack(e);void 0!==r&&t.push(r)}return t}generateVectorTrack(e,t,r,i){const n=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(n,t,r);return new VectorKeyframeTrack(e+"."+i,n,s)}generateRotationTrack(e,t,r,i,n,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(MathUtils.degToRad));const a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,r);void 0!==i&&((i=i.map(MathUtils.degToRad)).push(s),i=(new Euler).fromArray(i),i=(new Quaternion).setFromEuler(i)),void 0!==n&&((n=n.map(MathUtils.degToRad)).push(s),n=(new Euler).fromArray(n),n=(new Quaternion).setFromEuler(n).invert());const l=new Quaternion,c=new Euler,u=[];for(let e=0;e1){let e=1,r=t[0];for(let i=1;i=180){const s=n/180,a=i/s;let o=r+a;const l=e.times[t-1],c=(e.times[t]-l)/s;let u=l+c;const h=[],p=[];for(;u1&&(r=e[1].replace(/^(\w+)::/,""),i=e[2]),{id:t,name:r,type:i}}parseNodeProperty(e,t,r){let i=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===i&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());const s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===i){const e=n.split(",").slice(1),t=parseInt(e[0]),r=parseInt(e[1]);let a=n.split(",").slice(3);a=a.map((function(e){return e.trim().replace(/^"/,"")})),i="connections",n=[t,r],append(n,a),void 0===s[i]&&(s[i]=[])}"Node"===i&&(s.id=n),i in s&&Array.isArray(s[i])?s[i].push(n):"a"!==i?s[i]=n:s.a=n,this.setCurrentProp(s,i),"a"===i&&","!==n.slice(-1)&&(s.a=parseNumberArray(n))}else this.parseNodeSpecialProperty(e,i,n)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=parseNumberArray(t.a))} // parse "Property70" parseNodeSpecialProperty(e,t,r){const i=r.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),n=i[0],s=i[1],a=i[2],o=i[3];let l=i[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=parseNumberArray(l)}this.getPrevNode()[n]={type:s,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),n)}},BinaryParser=class{parse(e){const t=new BinaryReader(e);t.skip(23);const r=t.getUint32();if(r<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+r);const i=new FBXTree;for(;!this.endOfContent(t);){const e=this.parseNode(t,r);null!==e&&i.add(e.name,e)}return i} // Check if reader has reached the end of content. endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()} // recursively parse nodes until the end of the file is reached parseNode(e,t){const r={},i=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const s=e.getUint8(),a=e.getString(s);if(0===i)return null;const o=[];for(let t=0;t0?o[0]:"",c=o.length>1?o[1]:"",u=o.length>2?o[2]:"";for(r.singleProperty=1===n&&e.getOffset()===i;i>e.getOffset();){const i=this.parseNode(e,t);null!==i&&this.parseSubNode(a,r,i)}return r.propertyList=o,"number"==typeof l&&(r.id=l),""!==c&&(r.attrName=c),""!==u&&(r.attrType=u),""!==a&&(r.name=a),r}parseSubNode(e,t,r){if(!0===r.singleProperty){const e=r.propertyList[0];Array.isArray(e)?(t[r.name]=r,r.a=e):t[r.name]=e}else if("Connections"===e&&"C"===r.name){const e=[];r.propertyList.forEach((function(t,r){0!==r&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){let e=r.propertyList[0],i=r.propertyList[1];const n=r.propertyList[2],s=r.propertyList[3];let a;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===i.indexOf("Lcl ")&&(i=i.replace("Lcl ","Lcl_")),a="Color"===i||"ColorRGB"===i||"Vector"===i||"Vector3D"===i||0===i.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[e]={type:i,type2:n,flag:s,value:a}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)}parseProperty(e){const t=e.getString(1);let r;switch(t){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 r=e.getUint32(),e.getArrayBuffer(r);case"S":return r=e.getUint32(),e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const i=e.getUint32(),n=e.getUint32(),s=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(i);case"d":return e.getFloat64Array(i);case"f":return e.getFloat32Array(i);case"i":return e.getInt32Array(i);case"l":return e.getInt64Array(i)}void 0===fflate_module_exports&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const a=unzlibSync(new Uint8Array(e.getArrayBuffer(s))),o=new BinaryReader(a.buffer);switch(t){case"b":case"c":return o.getBooleanArray(i);case"d":return o.getFloat64Array(i);case"f":return o.getFloat32Array(i);case"i":return o.getInt32Array(i);case"l":return o.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}},BinaryReader=class{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e} // seems like true/false representation depends on exporter. // true: 1 or 'Y'(=0x59), false: 0 or 'T'(=0x54) // then sees LSB. getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let r=0;r=0&&(t=t.slice(0,r)),LoaderUtils.decodeText(new Uint8Array(t))}},FBXTree=class{add(e,t){this[e]=t}}; // node_modules/three/examples/jsm/loaders/FBXLoader.js function isFbxFormatBinary(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===convertArrayBufferToString(e,0,t.length)}function isFbxFormatASCII(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let r=0;function i(t){const i=e[t-1];return e=e.slice(r+t),r++,i}for(let e=0;e XYZ extrinsic "YZX", // -> XZY extrinsic "XZY", // -> YZX extrinsic "ZXY", // -> YXZ extrinsic "YXZ", // -> ZXY extrinsic "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 parseNumberArray(e){return e.split(",").map((function(e){return parseFloat(e)}))}function convertArrayBufferToString(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=e.byteLength),LoaderUtils.decodeText(new Uint8Array(e,t,r))}function append(e,t){for(let r=0,i=e.length,n=t.length;rt in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues2=(e,t)=>{for(var r in t||(t={}))__hasOwnProp2.call(t,r)&&__defNormalProp2(e,r,t[r]);if(__getOwnPropSymbols2)for(var r of __getOwnPropSymbols2(t))__propIsEnum2.call(t,r)&&__defNormalProp2(e,r,t[r]);return e},__require2=e=>{if(void 0!==__require)return __require(e);throw new Error('Dynamic require of "'+e+'" is not supported')},__commonJS2=(e,t)=>function(){return t||(0,e[Object.keys(e)[0]])((t={exports:{}}).exports,t),t.exports},__async2=(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{o(r.next(e))}catch(e){n(e)}},a=e=>{try{o(r.throw(e))}catch(e){n(e)}},o=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,a);o((r=r.apply(e,t)).next())})),require_crypto=__commonJS2({"(disabled):crypto"(){}}),require_web_ifc=__commonJS2({"dist/web-ifc.js"(e,t){var r,i=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r=r||__filename),function(e){var t,i,n=void 0!==(e=e||{})?e:{};n.ready=new Promise((function(e,r){t=e,i=r}));var s,a={};for(s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);var o=[],l="./this.program",c=function(e,t){throw t},u=!1,h=!1,p=!1,d=!1;u="object"==typeof window,h="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,d=!u&&!p&&!h;var m,f,g,_,y="";function T(e){return n.locateFile?n.locateFile(e,y):y+e}p?(y=h?__require2("path").dirname(y)+"/":__dirname+"/",m=function(e,t){return g||(g=__require2("fs")),_||(_=__require2("path")),e=_.normalize(e),g.readFileSync(e,t?null:"utf8")},f=function(e){var t=m(e,!0);return t.buffer||(t=new Uint8Array(t)),R(t.buffer),t},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),o=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Gi))throw e})),process.on("unhandledRejection",ve),c=function(e){process.exit(e)},n.inspect=function(){return"[Emscripten Module object]"}):d?("undefined"!=typeof read&&(m=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(R("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),"function"==typeof quit&&(c=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||h)&&(h?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y=0!==y.indexOf("blob:")?y.slice(0,y.lastIndexOf("/")+1):"",m=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},h&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var v=n.print||console.log.bind(console),E=n.printErr||console.warn.bind(console);for(s in a)a.hasOwnProperty(s)&&(n[s]=a[s]);a=null,n.arguments&&(o=n.arguments),n.thisProgram&&(l=n.thisProgram),n.quit&&(c=n.quit);var I=16;function b(e,t){return t||(t=I),Math.ceil(e/t)*t}var x,S,w,C=function(e){};n.wasmBinary&&(x=n.wasmBinary),n.noExitRuntime&&(S=n.noExitRuntime),"object"!=typeof WebAssembly&&ve("no native wasm support detected");var M=!1;function R(e,t){e||ve("Assertion failed: "+t)}var A="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(e,t,r){for(var i=(t>>>=0)+r,n=t;e[n>>>0]&&!(n>=i);)++n;if(n-t>16&&e.subarray&&A)return A.decode(e.subarray(t>>>0,n>>>0));for(var s="";t>>0];if(128&a){var o=63&e[t++>>>0];if(192!=(224&a)){var l=63&e[t++>>>0];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++>>>0])<65536)s+=String.fromCharCode(a);else{var c=a-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}function O(e,t){return(e>>>=0)?D(B,e,t):""}function L(e,t,r,i){if(!(i>0))return 0;for(var n=r>>>=0,s=r+i-1,a=0;a=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),o<=127){if(r>=s)break;t[r++>>>0]=o}else if(o<=2047){if(r+1>=s)break;t[r++>>>0]=192|o>>6,t[r++>>>0]=128|63&o}else if(o<=65535){if(r+2>=s)break;t[r++>>>0]=224|o>>12,t[r++>>>0]=128|o>>6&63,t[r++>>>0]=128|63&o}else{if(r+3>=s)break;t[r++>>>0]=240|o>>18,t[r++>>>0]=128|o>>12&63,t[r++>>>0]=128|o>>6&63,t[r++>>>0]=128|63&o}}return t[r>>>0]=0,r-n}function P(e,t,r){return L(e,B,t,r)}function N(e){for(var t=0,r=0;r=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t+=i<=2047?2:i<=65535?3:4}return t}var F,U,B,k,G,V,H,j,z,q="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function W(e,t){for(var r=e,i=r>>1,n=i+t/2;!(i>=n)&&G[i>>>0];)++i;if((r=i<<1)-e>32&&q)return q.decode(B.subarray(e>>>0,r>>>0));for(var s="",a=0;!(a>=t/2);++a){var o=k[e+2*a>>>1];if(0==o)break;s+=String.fromCharCode(o)}return s}function Y(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var i=t,n=(r-=2)<2*e.length?r/2:e.length,s=0;s>>1]=a,t+=2}return k[t>>>1]=0,t-i}function X(e){return 2*e.length}function J(e,t){for(var r=0,i="";!(r>=t/4);){var n=V[e+4*r>>>2];if(0==n)break;if(++r,n>=65536){var s=n-65536;i+=String.fromCharCode(55296|s>>10,56320|1023&s)}else i+=String.fromCharCode(n)}return i}function $(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var i=t>>>=0,n=i+r-4,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),V[t>>>2]=a,(t+=4)+4>n)break}return V[t>>>2]=0,t-i}function Z(e){for(var t=0,r=0;r=55296&&i<=57343&&++r,t+=4}return t}function K(e,t){U.set(e,t>>>0)}function Q(e,t,r){for(var i=0;i>>0]=e.charCodeAt(i);r||(U[t>>>0]=0)}function ee(e,t){return e%t>0&&(e+=t-e%t),e}function te(e){F=e,n.HEAP8=U=new Int8Array(e),n.HEAP16=k=new Int16Array(e),n.HEAP32=V=new Int32Array(e),n.HEAPU8=B=new Uint8Array(e),n.HEAPU16=G=new Uint16Array(e),n.HEAPU32=H=new Uint32Array(e),n.HEAPF32=j=new Float32Array(e),n.HEAPF64=z=new Float64Array(e)}var re,ie=n.INITIAL_MEMORY||16777216;(w=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:ie/65536,maximum:65536}))&&(F=w.buffer),ie=F.byteLength,te(F);var ne=[],se=[],ae=[],oe=[];function le(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)de(n.preRun.shift());Oe(ne)}function ce(){n.noFSInit||je.init.initialized||je.init(),Ge.init(),Oe(se)}function ue(){je.ignorePermissions=!1,Oe(ae)}function he(){}function pe(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)me(n.postRun.shift());Oe(oe)}function de(e){ne.unshift(e)}function me(e){oe.unshift(e)}var fe=0,ge=null,_e=null;function ye(e){fe++,n.monitorRunDependencies&&n.monitorRunDependencies(fe)}function Te(e){if(fe--,n.monitorRunDependencies&&n.monitorRunDependencies(fe),0==fe&&(null!==ge&&(clearInterval(ge),ge=null),_e)){var t=_e;_e=null,t()}}function ve(e){n.onAbort&&n.onAbort(e),E(e+=""),M=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw i(t),t}function Ee(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}n.preloadedImages={},n.preloadedAudios={};var Ie="data:application/octet-stream;base64,";function be(e){return Ee(e,Ie)}var xe="file://";function Se(e){return Ee(e,xe)}var we,Ce,Me=WasmPath+"web-ifc.wasm";function Re(){try{if(x)return new Uint8Array(x);if(f)return f(Me);throw"both async and sync fetching of the wasm failed"}catch(e){ve(e)}}function Ae(){return x||!u&&!h||"function"!=typeof fetch||Se(Me)?Promise.resolve().then(Re):fetch(Me,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Me+"'";return e.arrayBuffer()})).catch((function(){return Re()}))}function De(){var e={a:Pi};function t(e,t){var r=e.exports;n.asm=r,re=n.asm.X,Te()}function r(e){t(e.instance)}function s(t){return Ae().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){E("failed to asynchronously prepare wasm: "+e),ve(e)}))}if(ye(),n.instantiateWasm)try{return n.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}return(x||"function"!=typeof WebAssembly.instantiateStreaming||be(Me)||Se(Me)||"function"!=typeof fetch?s(r):fetch(Me,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return E("wasm streaming compile failed: "+e),E("falling back to ArrayBuffer instantiation"),s(r)}))}))).catch(i),{}}function Oe(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?re.get(r)():re.get(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(n)}}function Le(e,t,r){return r&&r.length?n["dynCall_"+e].apply(null,[t].concat(r)):n["dynCall_"+e].call(null,t)}function Pe(e,t,r){return-1!=e.indexOf("j")?Le(e,t,r):re.get(t).apply(null,r)}function Ne(e,t,r,i){ve("Assertion failed: "+O(e)+", at: "+[t?O(t):"unknown filename",r,i?O(i):"unknown function"])}function Fe(e){return V[Bi()>>>2]=e,e}be(Me)||(Me=T(Me));var Ue={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,i=e.length-1;i>=0;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.slice(-1);return(e=Ue.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=Ue.splitPath(e),r=t[0],i=t[1];return r||i?(i&&(i=i.slice(0,i.length-1)),r+i):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=Ue.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.slice(t+1)},extname:function(e){return Ue.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return Ue.normalize(e.join("/"))},join2:function(e,t){return Ue.normalize(e+"/"+t)}};function Be(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(p)try{var t=require_crypto();return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ve("randomDevice")}}var ke={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:je.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t="/"===i.charAt(0)}return(t?"/":"")+(e=Ue.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ke.resolve(e).slice(1),t=ke.resolve(t).slice(1);for(var i=r(e.split("/")),n=r(t.split("/")),s=Math.min(i.length,n.length),a=s,o=0;o0?r.slice(0,i).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=Oi(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(v(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(v(D(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(E(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(D(e.output,0)),e.output=[])}}};function Ve(e){for(var t=b(e,16384),r=Fi(t);e>>0]=0;return r}var He={ops_table:null,mount:function(e){return He.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(je.isBlkdev(r)||je.isFIFO(r))throw new je.ErrnoError(63);He.ops_table||(He.ops_table={dir:{node:{getattr:He.node_ops.getattr,setattr:He.node_ops.setattr,lookup:He.node_ops.lookup,mknod:He.node_ops.mknod,rename:He.node_ops.rename,unlink:He.node_ops.unlink,rmdir:He.node_ops.rmdir,readdir:He.node_ops.readdir,symlink:He.node_ops.symlink},stream:{llseek:He.stream_ops.llseek}},file:{node:{getattr:He.node_ops.getattr,setattr:He.node_ops.setattr},stream:{llseek:He.stream_ops.llseek,read:He.stream_ops.read,write:He.stream_ops.write,allocate:He.stream_ops.allocate,mmap:He.stream_ops.mmap,msync:He.stream_ops.msync}},link:{node:{getattr:He.node_ops.getattr,setattr:He.node_ops.setattr,readlink:He.node_ops.readlink},stream:{}},chrdev:{node:{getattr:He.node_ops.getattr,setattr:He.node_ops.setattr},stream:je.chrdev_stream_ops}});var n=je.createNode(e,t,r,i);return je.isDir(n.mode)?(n.node_ops=He.ops_table.dir.node,n.stream_ops=He.ops_table.dir.stream,n.contents={}):je.isFile(n.mode)?(n.node_ops=He.ops_table.file.node,n.stream_ops=He.ops_table.file.stream,n.usedBytes=0,n.contents=null):je.isLink(n.mode)?(n.node_ops=He.ops_table.link.node,n.stream_ops=He.ops_table.link.stream):je.isChrdev(n.mode)&&(n.node_ops=He.ops_table.chrdev.node,n.stream_ops=He.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=[],r=0;r>>=0;var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var i=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(i.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 r=e.contents;return e.contents=new Uint8Array(t),r&&e.contents.set(r.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=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,i);if(a>8&&s.subarray)t.set(s.subarray(n,n+a),r);else for(var o=0;o0||i+r>>=0,U.set(l,a>>>0)}else o=!1,a=l.byteOffset;return{ptr:a,allocated:o}},msync:function(e,t,r,i,n){if(!je.isFile(e.node.mode))throw new je.ErrnoError(43);return 2&n||He.stream_ops.write(e,t,0,i,r,!1),0}}},je={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=ke.resolve(je.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var i in r)void 0===t[i]&&(t[i]=r[i]);if(t.recurse_count>8)throw new je.ErrnoError(32);for(var n=Ue.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),s=je.root,a="/",o=0;o40)throw new je.ErrnoError(32)}}return{path:a,node:s}},getPath:function(e){for(var t;;){if(je.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,i=0;i>>0)%je.nameTable.length},hashAddNode:function(e){var t=je.hashName(e.parent.id,e.name);e.name_next=je.nameTable[t],je.nameTable[t]=e},hashRemoveNode:function(e){var t=je.hashName(e.parent.id,e.name);if(je.nameTable[t]===e)je.nameTable[t]=e.name_next;else for(var r=je.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=je.mayLookup(e);if(r)throw new je.ErrnoError(r,e);for(var i=je.hashName(e.id,t),n=je.nameTable[i];n;n=n.name_next){var s=n.name;if(n.parent.id===e.id&&s===t)return n}return je.lookup(e,t)},createNode:function(e,t,r,i){var n=new je.FSNode(e,t,r,i);return je.hashAddNode(n),n},destroyNode:function(e){je.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=je.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 je.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){var t=je.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return je.lookupNode(e,t),20}catch(e){}return je.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var i;try{i=je.lookupNode(e,t)}catch(e){return e.errno}var n=je.nodePermissions(e,"wx");if(n)return n;if(r){if(!je.isDir(i.mode))return 54;if(je.isRoot(i)||je.getPath(i)===je.cwd())return 10}else if(je.isDir(i.mode))return 31;return 0},mayOpen:function(e,t){return e?je.isLink(e.mode)?32:je.isDir(e.mode)&&("r"!==je.flagsToPermissionString(t)||512&t)?31:je.nodePermissions(e,je.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||je.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!je.streams[r])return r;throw new je.ErrnoError(33)},getStream:function(e){return je.streams[e]},createStream:function(e,t,r){je.FSStream||(je.FSStream=function(){},je.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 i=new je.FSStream;for(var n in e)i[n]=e[n];e=i;var s=je.nextfd(t,r);return e.fd=s,je.streams[s]=e,e},closeStream:function(e){je.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=je.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new je.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){je.devices[e]={stream_ops:t}},getDevice:function(e){return je.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var i=r.pop();t.push(i),r.push.apply(r,i.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),je.syncFSRequests++,je.syncFSRequests>1&&E("warning: "+je.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=je.getMounts(je.root.mount),i=0;function n(e){return je.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,n(e));++i>=r.length&&n(null)}r.forEach((function(t){if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount:function(e,t,r){var i,n="/"===r,s=!r;if(n&&je.root)throw new je.ErrnoError(10);if(!n&&!s){var a=je.lookupPath(r,{follow_mount:!1});if(r=a.path,i=a.node,je.isMountpoint(i))throw new je.ErrnoError(10);if(!je.isDir(i.mode))throw new je.ErrnoError(54)}var o={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(o);return l.mount=o,o.root=l,n?je.root=l:i&&(i.mounted=o,i.mount&&i.mount.mounts.push(o)),l},unmount:function(e){var t=je.lookupPath(e,{follow_mount:!1});if(!je.isMountpoint(t.node))throw new je.ErrnoError(28);var r=t.node,i=r.mounted,n=je.getMounts(i);Object.keys(je.nameTable).forEach((function(e){for(var t=je.nameTable[e];t;){var r=t.name_next;-1!==n.indexOf(t.mount)&&je.destroyNode(t),t=r}})),r.mounted=null;var s=r.mount.mounts.indexOf(i);r.mount.mounts.splice(s,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var i=je.lookupPath(e,{parent:!0}).node,n=Ue.basename(e);if(!n||"."===n||".."===n)throw new je.ErrnoError(28);var s=je.mayCreate(i,n);if(s)throw new je.ErrnoError(s);if(!i.node_ops.mknod)throw new je.ErrnoError(63);return i.node_ops.mknod(i,n,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,je.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,je.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),i="",n=0;n>>=0,i<0||n<0)throw new je.ErrnoError(28);if(je.isClosed(e))throw new je.ErrnoError(8);if(1==(2097155&e.flags))throw new je.ErrnoError(8);if(je.isDir(e.node.mode))throw new je.ErrnoError(31);if(!e.stream_ops.read)throw new je.ErrnoError(28);var s=void 0!==n;if(s){if(!e.seekable)throw new je.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,r,i,n);return s||(e.position+=a),a},write:function(e,t,r,i,n,s){if(r>>>=0,i<0||n<0)throw new je.ErrnoError(28);if(je.isClosed(e))throw new je.ErrnoError(8);if(0==(2097155&e.flags))throw new je.ErrnoError(8);if(je.isDir(e.node.mode))throw new je.ErrnoError(31);if(!e.stream_ops.write)throw new je.ErrnoError(28);e.seekable&&1024&e.flags&&je.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new je.ErrnoError(70)}else n=e.position;var o=e.stream_ops.write(e,t,r,i,n,s);a||(e.position+=o);try{e.path&&je.trackingDelegate.onWriteToFile&&je.trackingDelegate.onWriteToFile(e.path)}catch(t){E("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return o},allocate:function(e,t,r){if(je.isClosed(e))throw new je.ErrnoError(8);if(t<0||r<=0)throw new je.ErrnoError(28);if(0==(2097155&e.flags))throw new je.ErrnoError(8);if(!je.isFile(e.node.mode)&&!je.isDir(e.node.mode))throw new je.ErrnoError(43);if(!e.stream_ops.allocate)throw new je.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,i,n,s){if(t>>>=0,0!=(2&n)&&0==(2&s)&&2!=(2097155&e.flags))throw new je.ErrnoError(2);if(1==(2097155&e.flags))throw new je.ErrnoError(2);if(!e.stream_ops.mmap)throw new je.ErrnoError(43);return e.stream_ops.mmap(e,t,r,i,n,s)},msync:function(e,t,r,i,n){return r>>>=0,e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,i,n):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new je.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},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 r,i=je.open(e,t.flags),n=je.stat(e).size,s=new Uint8Array(n);return je.read(i,s,0,n,0),"utf8"===t.encoding?r=D(s,0):"binary"===t.encoding&&(r=s),je.close(i),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||577;var i=je.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(N(t)+1),s=L(t,n,0,n.length);je.write(i,n,0,s,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");je.write(i,t,0,t.byteLength,void 0,r.canOwn)}je.close(i)},cwd:function(){return je.currentPath},chdir:function(e){var t=je.lookupPath(e,{follow:!0});if(null===t.node)throw new je.ErrnoError(44);if(!je.isDir(t.node.mode))throw new je.ErrnoError(54);var r=je.nodePermissions(t.node,"x");if(r)throw new je.ErrnoError(r);je.currentPath=t.path},createDefaultDirectories:function(){je.mkdir("/tmp"),je.mkdir("/home"),je.mkdir("/home/web_user")},createDefaultDevices:function(){je.mkdir("/dev"),je.registerDevice(je.makedev(1,3),{read:function(){return 0},write:function(e,t,r,i,n){return i}}),je.mkdev("/dev/null",je.makedev(1,3)),Ge.register(je.makedev(5,0),Ge.default_tty_ops),Ge.register(je.makedev(6,0),Ge.default_tty1_ops),je.mkdev("/dev/tty",je.makedev(5,0)),je.mkdev("/dev/tty1",je.makedev(6,0));var e=Be();je.createDevice("/dev","random",e),je.createDevice("/dev","urandom",e),je.mkdir("/dev/shm"),je.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){je.mkdir("/proc"),je.mkdir("/proc/self"),je.mkdir("/proc/self/fd"),je.mount({mount:function(){var e=je.createNode("/proc/self","fd",16895,73);return e.node_ops={lookup:function(e,t){var r=+t,i=je.getStream(r);if(!i)throw new je.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return i.path}}};return n.parent=n,n}},e}},{},"/proc/self/fd")},createStandardStreams:function(){n.stdin?je.createDevice("/dev","stdin",n.stdin):je.symlink("/dev/tty","/dev/stdin"),n.stdout?je.createDevice("/dev","stdout",null,n.stdout):je.symlink("/dev/tty","/dev/stdout"),n.stderr?je.createDevice("/dev","stderr",null,n.stderr):je.symlink("/dev/tty1","/dev/stderr"),je.open("/dev/stdin",0),je.open("/dev/stdout",1),je.open("/dev/stderr",1)},ensureErrnoError:function(){je.ErrnoError||(je.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},je.ErrnoError.prototype=new Error,je.ErrnoError.prototype.constructor=je.ErrnoError,[44].forEach((function(e){je.genericErrors[e]=new je.ErrnoError(e),je.genericErrors[e].stack=""})))},staticInit:function(){je.ensureErrnoError(),je.nameTable=new Array(4096),je.mount(He,{},"/"),je.createDefaultDirectories(),je.createDefaultDevices(),je.createSpecialDirectories(),je.filesystems={MEMFS:He}},init:function(e,t,r){je.init.initialized=!0,je.ensureErrnoError(),n.stdin=e||n.stdin,n.stdout=t||n.stdout,n.stderr=r||n.stderr,je.createStandardStreams()},quit:function(){je.init.initialized=!1;var e=n._fflush;e&&e(0);for(var t=0;tthis.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,i=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=i);var o=this;o.setDataGetter((function(e){var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,i-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>i-1)throw new Error("only "+i+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),i!==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 "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):Oi(n.responseText||"",!0)}(t,n)),void 0===o.chunks[e])throw new Error("doXHR failed!");return o.chunks[e]})),!s&&i||(a=i=1,i=this.getter(0).length,a=i,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=i,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!h)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:r};var l=je.createFile(e,t,o,i,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 c={};return Object.keys(l.stream_ops).forEach((function(e){var t=l.stream_ops[e];c[e]=function(){return je.forceLoadFile(l),t.apply(null,arguments)}})),c.read=function(e,t,r,i,n){je.forceLoadFile(l);var s=e.node.contents;if(n>=s.length)return 0;var a=Math.min(s.length-n,i);if(s.slice)for(var o=0;o>>2]=i.dev,V[r+4>>>2]=0,V[r+8>>>2]=i.ino,V[r+12>>>2]=i.mode,V[r+16>>>2]=i.nlink,V[r+20>>>2]=i.uid,V[r+24>>>2]=i.gid,V[r+28>>>2]=i.rdev,V[r+32>>>2]=0,Ce=[i.size>>>0,(we=i.size,+Math.abs(we)>=1?we>0?(0|Math.min(+Math.floor(we/4294967296),4294967295))>>>0:~~+Math.ceil((we-+(~~we>>>0))/4294967296)>>>0:0)],V[r+40>>>2]=Ce[0],V[r+44>>>2]=Ce[1],V[r+48>>>2]=4096,V[r+52>>>2]=i.blocks,V[r+56>>>2]=i.atime.getTime()/1e3|0,V[r+60>>>2]=0,V[r+64>>>2]=i.mtime.getTime()/1e3|0,V[r+68>>>2]=0,V[r+72>>>2]=i.ctime.getTime()/1e3|0,V[r+76>>>2]=0,Ce=[i.ino>>>0,(we=i.ino,+Math.abs(we)>=1?we>0?(0|Math.min(+Math.floor(we/4294967296),4294967295))>>>0:~~+Math.ceil((we-+(~~we>>>0))/4294967296)>>>0:0)],V[r+80>>>2]=Ce[0],V[r+84>>>2]=Ce[1],0},doMsync:function(e,t,r,i,n){var s=B.slice(e,e+r);je.msync(t,s,n,r,i)},doMkdir:function(e,t){return"/"===(e=Ue.normalize(e))[e.length-1]&&(e=e.slice(0,e.length-1)),je.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return je.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var i=je.readlink(e),n=Math.min(r,N(i)),s=U[t+n>>>0];return P(i,t,r+1),U[t+n>>>0]=s,n},doAccess:function(e,t){if(-8&t)return-28;var r;if(!(r=je.lookupPath(e,{follow:!0}).node))return-44;var i="";return 4&t&&(i+="r"),2&t&&(i+="w"),1&t&&(i+="x"),i&&je.nodePermissions(r,i)?-2:0},doDup:function(e,t,r){var i=je.getStream(r);return i&&je.close(i),je.open(e,t,0,r,r).fd},doReadv:function(e,t,r,i){for(var n=0,s=0;s>>2],o=V[t+(8*s+4)>>>2],l=je.read(e,U,a,o,i);if(l<0)return-1;if(n+=l,l>>2],o=V[t+(8*s+4)>>>2],l=je.write(e,U,a,o,i);if(l<0)return-1;n+=l}return n},varargs:void 0,get:function(){return ze.varargs+=4,V[ze.varargs-4>>>2]},getStr:function(e){return O(e)},getStreamFromFD:function(e){var t=je.getStream(e);if(!t)throw new je.ErrnoError(8);return t},get64:function(e,t){return e}};function qe(e,t,r){ze.varargs=r;try{var i=ze.getStreamFromFD(e);switch(t){case 0:return(n=ze.get())<0?-28:je.open(i.path,i.flags,0,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return i.flags;case 4:var n=ze.get();return i.flags|=n,0;case 12:return n=ze.get(),k[n+0>>>1]=2,0;case 16:case 8:default:return-28;case 9:return Fe(28),-1}}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),-e.errno}}function We(e,t,r){ze.varargs=r;try{var i=ze.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 i.tty?0:-59;case 21519:if(!i.tty)return-59;var n=ze.get();return V[n>>>2]=0,0;case 21520:return i.tty?-28:-59;case 21531:return n=ze.get(),je.ioctl(i,t,n);default:ve("bad ioctl syscall "+t)}}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),-e.errno}}function Ye(e,t,r){ze.varargs=r;try{var i=ze.getStr(e),n=ze.get();return je.open(i,t,n).fd}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),-e.errno}}var Xe={};function Je(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function $e(e){return this.fromWireType(H[e>>>2])}var Ze={},Ke={},Qe={},et=48,tt=57;function rt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=et&&t<=tt?"_"+e:e}function it(e,t){return e=rt(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function nt(e,t){var r=it(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var st=void 0;function at(e){throw new st(e)}function ot(e,t,r){function i(t){var i=r(t);i.length!==e.length&&at("Mismatched type converter count");for(var n=0;n>>0];)t+=dt[B[r++>>>0]];return t}var ft=void 0;function gt(e){throw new ft(e)}function _t(e,t,r){if(r=r||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=t.name;if(e||gt('type "'+i+'" must have a positive integer typeid pointer'),Ke.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;gt("Cannot register type '"+i+"' twice")}if(Ke[e]=t,delete Qe[e],Ze.hasOwnProperty(e)){var n=Ze[e];delete Ze[e],n.forEach((function(e){e()}))}}function yt(e,t,r,i,n){var s=ht(r);_t(e,{name:t=mt(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?i:n},argPackAdvance:8,readValueFromPointer:function(e){var i;if(1===r)i=U;else if(2===r)i=k;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);i=V}return this.fromWireType(i[e>>>s])},destructorFunction:null})}function Tt(e){if(!(this instanceof Nt))return!1;if(!(e instanceof Nt))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=e.$$.ptrType.registeredClass,n=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return t===i&&r===n}function vt(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function Et(e){gt(e.$$.ptrType.registeredClass.name+" instance already deleted")}var It=!1;function bt(e){}function xt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function St(e){e.count.value-=1,0===e.count.value&&xt(e)}function wt(e){return"undefined"==typeof FinalizationGroup?(wt=function(e){return e},e):(It=new FinalizationGroup((function(e){for(var t=e.next();!t.done;t=e.next()){var r=t.value;r.ptr?St(r):console.warn("object already deleted: "+r.ptr)}})),bt=function(e){It.unregister(e.$$)},(wt=function(e){return It.register(e,e.$$,e.$$),e})(e))}function Ct(){if(this.$$.ptr||Et(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=wt(Object.create(Object.getPrototypeOf(this),{$$:{value:vt(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Mt(){this.$$.ptr||Et(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&>("Object already scheduled for deletion"),bt(this),St(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Rt(){return!this.$$.ptr}var At=void 0,Dt=[];function Ot(){for(;Dt.length;){var e=Dt.pop();e.$$.deleteScheduled=!1,e.delete()}}function Lt(){return this.$$.ptr||Et(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&>("Object already scheduled for deletion"),Dt.push(this),1===Dt.length&&At&&At(Ot),this.$$.deleteScheduled=!0,this}function Pt(){Nt.prototype.isAliasOf=Tt,Nt.prototype.clone=Ct,Nt.prototype.delete=Mt,Nt.prototype.isDeleted=Rt,Nt.prototype.deleteLater=Lt}function Nt(){}var Ft={};function Ut(e,t,r){if(void 0===e[t].overloadTable){var i=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||gt("Function '"+r+"' 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[i.argCount]=i}}function Bt(e,t,r){n.hasOwnProperty(e)?((void 0===r||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[r])&>("Cannot register public name '"+e+"' twice"),Ut(n,e,e),n.hasOwnProperty(r)&>("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),n[e].overloadTable[r]=t):(n[e]=t,void 0!==r&&(n[e].numArguments=r))}function kt(e,t,r,i,n,s,a,o){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=s,this.upcast=a,this.downcast=o,this.pureVirtualFunctions=[]}function Gt(e,t,r){for(;t!==r;)t.upcast||gt("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Vt(e,t){if(null===t)return this.isReference&>("null is not a valid "+this.name),0;t.$$||gt('Cannot pass "'+Sr(t)+'" as a '+this.name),t.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Gt(t.$$.ptr,r,this.registeredClass)}function Ht(e,t){var r;if(null===t)return this.isReference&>("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||gt('Cannot pass "'+Sr(t)+'" as a '+this.name),t.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&>("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var i=t.$$.ptrType.registeredClass;if(r=Gt(t.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&>("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:gt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var n=t.clone();r=this.rawShare(r,br((function(){n.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:gt("Unsupporting sharing policy")}return r}function jt(e,t){if(null===t)return this.isReference&>("null is not a valid "+this.name),0;t.$$||gt('Cannot pass "'+Sr(t)+'" as a '+this.name),t.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&>("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Gt(t.$$.ptr,r,this.registeredClass)}function zt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function qt(e){this.rawDestructor&&this.rawDestructor(e)}function Wt(e){null!==e&&e.delete()}function Yt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var i=Yt(e,t,r.baseClass);return null===i?null:r.downcast(i)}function Xt(){return Object.keys(Kt).length}function Jt(){var e=[];for(var t in Kt)Kt.hasOwnProperty(t)&&e.push(Kt[t]);return e}function $t(e){At=e,Dt.length&&At&&At(Ot)}function Zt(){n.getInheritedInstanceCount=Xt,n.getLiveInheritedInstances=Jt,n.flushPendingDeletes=Ot,n.setDelayFunction=$t}var Kt={};function Qt(e,t){for(void 0===t&>("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function er(e,t){return t=Qt(e,t),Kt[t]}function tr(e,t){return t.ptrType&&t.ptr||at("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&at("Both smartPtrType and smartPtr must be specified"),t.count={value:1},wt(Object.create(e,{$$:{value:t}}))}function rr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=er(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var i=r.clone();return this.destructor(e),i}function n(){return this.isSmartPointer?tr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):tr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(t),o=Ft[a];if(!o)return n.call(this);s=this.isConst?o.constPointerType:o.pointerType;var l=Yt(t,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?tr(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):tr(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function ir(){nr.prototype.getPointee=zt,nr.prototype.destructor=qt,nr.prototype.argPackAdvance=8,nr.prototype.readValueFromPointer=$e,nr.prototype.deleteObject=Wt,nr.prototype.fromWireType=rr}function nr(e,t,r,i,n,s,a,o,l,c,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=o,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,n||void 0!==t.baseClass?this.toWireType=Ht:i?(this.toWireType=Vt,this.destructorFunction=null):(this.toWireType=jt,this.destructorFunction=null)}function sr(e,t,r){n.hasOwnProperty(e)||at("Replacing nonexistant public symbol"),void 0!==n[e].overloadTable&&void 0!==r?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)}function ar(e,t){R(e.indexOf("j")>=0,"getDynCaller should only be called with i64 sigs");var r=[];return function(){r.length=arguments.length;for(var i=0;i>2)+i>>>0]);return r}function dr(e,t,r,i,n,s){R(t>0);var a=pr(t,r);n=or(i,n);var o=[s],l=[];ot([],[e],(function(e){var r="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 ft("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(){ur("Cannot construct "+e.name+" due to unbound types",a)},ot([],a,(function(i){return e.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&>(r+" called with "+arguments.length+" arguments, expected "+(t-1)),l.length=0,o.length=t;for(var e=1;e0?", ":"")+h),p+=(c?"var rv = ":"")+"invoker(fn"+(h.length>0?", ":"")+h+");\n",o)p+="runDestructors(destructors);\n";else for(l=a?1:2;l4&&0==--yr[e].refcount&&(yr[e]=void 0,_r.push(e))}function vr(){for(var e=0,t=5;t>>2])};case 3:return function(e){return this.fromWireType(z[e>>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Cr(e,t,r){var i=ht(r);_t(e,{name:t=mt(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Sr(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:wr(t,i),destructorFunction:null})}function Mr(e,t,r,i,n,s){var a=pr(t,r);e=mt(e),n=or(i,n),Bt(e,(function(){ur("Cannot call "+e+" due to unbound types",a)}),t-1),ot([],a,(function(r){var i=[r[0],null].concat(r.slice(1));return sr(e,fr(e,i,null,n,s),t-1),[]}))}function Rr(e,t,r){switch(t){case 0:return r?function(e){return U[e>>>0]}:function(e){return B[e>>>0]};case 1:return r?function(e){return k[e>>>1]}:function(e){return G[e>>>1]};case 2:return r?function(e){return V[e>>>2]}:function(e){return H[e>>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Ar(e,t,r,i,n){t=mt(t),-1===n&&(n=4294967295);var s=ht(r),a=function(e){return e};if(0===i){var o=32-8*r;a=function(e){return e<>>o}}var l=-1!=t.indexOf("unsigned");_t(e,{name:t,fromWireType:a,toWireType:function(e,r){if("number"!=typeof r&&"boolean"!=typeof r)throw new TypeError('Cannot convert "'+Sr(r)+'" to '+this.name);if(rn)throw new TypeError('Passing a number "'+Sr(r)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+i+", "+n+"]!");return l?r>>>0:0|r},argPackAdvance:8,readValueFromPointer:Rr(t,s,0!==i),destructorFunction:null})}function Dr(e,t,r){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function n(e){var t=H,r=t[(e>>=2)>>>0],n=t[e+1>>>0];return new i(F,n,r)}_t(e,{name:r=mt(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})}function Or(e,t){var r="std::string"===(t=mt(t));_t(e,{name:t,fromWireType:function(e){var t,i=H[e>>>2];if(r)for(var n=e+4,s=0;s<=i;++s){var a=e+4+s;if(s==i||0==B[a>>>0]){var o=O(n,a-n);void 0===t?t=o:(t+=String.fromCharCode(0),t+=o),n=a+1}}else{var l=new Array(i);for(s=0;s>>0]);t=l.join("")}return ki(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var i="string"==typeof t;i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||gt("Cannot pass non-string to std::string");var n=(r&&i?function(){return N(t)}:function(){return t.length})(),s=Fi(4+n+1);if(H[(s>>>=0)>>>2]=n,r&&i)P(t,s+4,n+1);else if(i)for(var a=0;a255&&(ki(s),gt("String has UTF-16 code units that do not fit in 8 bits")),B[s+4+a>>>0]=o}else for(a=0;a>>0]=t[a];return null!==e&&e.push(ki,s),s},argPackAdvance:8,readValueFromPointer:$e,destructorFunction:function(e){ki(e)}})}function Lr(e,t,r){var i,n,s,a,o;r=mt(r),2===t?(i=W,n=Y,a=X,s=function(){return G},o=1):4===t&&(i=J,n=$,a=Z,s=function(){return H},o=2),_t(e,{name:r,fromWireType:function(e){for(var r,n=H[e>>>2],a=s(),l=e+4,c=0;c<=n;++c){var u=e+4+c*t;if(c==n||0==a[u>>>o]){var h=i(l,u-l);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),l=u+t}}return ki(e),r},toWireType:function(e,i){"string"!=typeof i&>("Cannot pass non-string to C++ string type "+r);var s=a(i),l=Fi(4+s+t);return H[(l>>>=0)>>>2]=s>>o,n(i,l+4,s+t),null!==e&&e.push(ki,l),l},argPackAdvance:8,readValueFromPointer:$e,destructorFunction:function(e){ki(e)}})}function Pr(e,t,r,i,n,s){Xe[e]={name:mt(t),rawConstructor:or(r,i),rawDestructor:or(n,s),elements:[]}}function Nr(e,t,r,i,n,s,a,o,l){Xe[e].elements.push({getterReturnType:t,getter:or(r,i),getterContext:n,setterArgumentType:s,setter:or(a,o),setterContext:l})}function Fr(e,t,r,i,n,s){ct[e]={name:mt(t),rawConstructor:or(r,i),rawDestructor:or(n,s),fields:[]}}function Ur(e,t,r,i,n,s,a,o,l,c){ct[e].fields.push({fieldName:mt(t),getterReturnType:r,getter:or(i,n),getterContext:s,setterArgumentType:a,setter:or(o,l),setterContext:c})}function Br(e,t){_t(e,{isVoid:!0,name:t=mt(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function kr(e){return e||gt("Cannot use deleted val. handle = "+e),yr[e].value}function Gr(e,t){var r=Ke[e];return void 0===r&>(t+" has unknown type "+cr(e)),r}function Vr(e,t,r){e=kr(e),t=Gr(t,"emval::as");var i=[],n=br(i);return V[r>>>2]=n,t.toWireType(i,e)}function Hr(e,t){for(var r=new Array(e),i=0;i>2)+i>>>0],"parameter "+i);return r}function jr(e,t,r,i){e=kr(e);for(var n=Hr(t,r),s=new Array(t),a=0;a4&&(yr[e].refcount+=1)}function Zr(e,t){return(e=kr(e))instanceof(t=kr(t))}function Kr(e){return"number"==typeof(e=kr(e))}function Qr(){return br([])}function ei(e){return br(Wr(e))}function ti(){return br({})}function ri(e){Je(yr[e].value),Tr(e)}function ii(e,t,r){e=kr(e),t=kr(t),r=kr(r),e[t]=r}function ni(e,t){return br((e=Gr(e,"_emval_take_value")).readValueFromPointer(t))}function si(){ve()}zr=p?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var ai=!0;function oi(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!ai)return Fe(28),-1;r=zr()}return V[t>>>2]=r/1e3|0,V[t+4>>>2]=r%1e3*1e3*1e3|0,0}function li(e,t,r){B.copyWithin(e>>>0,t>>>0,t+r>>>0)}function ci(){return B.length}function ui(e){try{return w.grow(e-F.byteLength+65535>>>16),te(w.buffer),1}catch(e){}}function hi(e){e>>>=0;var t=ci(),r=4294967296;if(e>r)return!1;for(var i=1;i<=4;i*=2){var n=t*(1+.2/i);if(n=Math.min(n,e+100663296),ui(Math.min(r,ee(Math.max(16777216,e,n),65536))))return!0}return!1}var pi={};function di(){return l||"./this.program"}function mi(){if(!mi.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",_:di()};for(var t in pi)e[t]=pi[t];var r=[];for(var t in e)r.push(t+"="+e[t]);mi.strings=r}return mi.strings}function fi(e,t){try{var r=0;return mi().forEach((function(i,n){var s=t+r;V[e+4*n>>>2]=s,Q(i,s),r+=i.length+1})),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function gi(e,t){try{var r=mi();V[e>>>2]=r.length;var i=0;return r.forEach((function(e){i+=e.length+1})),V[t>>>2]=i,0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function _i(e){try{var t=ze.getStreamFromFD(e);return je.close(t),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function yi(e,t,r,i){try{var n=ze.getStreamFromFD(e),s=ze.doReadv(n,t,r);return V[i>>>2]=s,0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function Ti(e,t,r,i,n){try{var s=ze.getStreamFromFD(e),a=4294967296*r+(t>>>0),o=9007199254740992;return a<=-o||a>=o?-61:(je.llseek(s,a,i),Ce=[s.position>>>0,(we=s.position,+Math.abs(we)>=1?we>0?(0|Math.min(+Math.floor(we/4294967296),4294967295))>>>0:~~+Math.ceil((we-+(~~we>>>0))/4294967296)>>>0:0)],V[n>>>2]=Ce[0],V[n+4>>>2]=Ce[1],s.getdents&&0===a&&0===i&&(s.getdents=null),0)}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function vi(e,t,r,i){try{var n=ze.getStreamFromFD(e),s=ze.doWritev(n,t,r);return V[i>>>2]=s,0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||ve(e),e.errno}}function Ei(e){C(0|e)}function Ii(e){return e%4==0&&(e%100!=0||e%400==0)}function bi(e,t){for(var r=0,i=0;i<=t;r+=e[i++]);return r}var xi=[31,29,31,30,31,30,31,31,30,31,30,31],Si=[31,28,31,30,31,30,31,31,30,31,30,31];function wi(e,t){for(var r=new Date(e.getTime());t>0;){var i=Ii(r.getFullYear()),n=r.getMonth(),s=(i?xi:Si)[n];if(!(t>s-r.getDate()))return r.setDate(r.getDate()+t),r;t-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function Ci(e,t,r,i){var n=V[i+40>>>2],s={tm_sec:V[i>>>2],tm_min:V[i+4>>>2],tm_hour:V[i+8>>>2],tm_mday:V[i+12>>>2],tm_mon:V[i+16>>>2],tm_year:V[i+20>>>2],tm_wday:V[i+24>>>2],tm_yday:V[i+28>>>2],tm_isdst:V[i+32>>>2],tm_gmtoff:V[i+36>>>2],tm_zone:n?O(n):""},a=O(r),o={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in o)a=a.replace(new RegExp(l,"g"),o[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,r){for(var i="number"==typeof e?e.toString():e||"";i.length0?1:0}var i;return 0===(i=r(e.getFullYear()-t.getFullYear()))&&0===(i=r(e.getMonth()-t.getMonth()))&&(i=r(e.getDate()-t.getDate())),i}function m(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function f(e){var t=wi(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),i=new Date(t.getFullYear()+1,0,4),n=m(r),s=m(i);return d(n,t)<=0?d(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return p((e.tm_year+1900)/100|0,2)},"%d":function(e){return p(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return f(e).toString().substring(2)},"%G":function(e){return f(e)},"%H":function(e){return p(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":function(e){return p(e.tm_mday+bi(Ii(e.tm_year+1900)?xi:Si,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),r=0===t.getDay()?t:wi(t,7-t.getDay()),i=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(r,i)<0){var n=bi(Ii(i.getFullYear())?xi:Si,i.getMonth()-1)-31,s=31-r.getDate()+n+i.getDate();return p(Math.ceil(s/7),2)}return 0===d(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),i=new Date(e.tm_year+1901,0,4),n=m(r),s=m(i),a=wi(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()=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+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 _=Oi(a,!1);return _.length>t?0:(K(_,e),_.length-1)}function Mi(e,t,r,i){return Ci(e,t,r,i)}var Ri=function(e,t,r,i){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=je.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=i},Ai=365,Di=146;function Oi(e,t,r){var i=r>0?r:N(e)+1,n=new Array(i),s=L(e,n,0,n.length);return t&&(n.length=s),n}Object.defineProperties(Ri.prototype,{read:{get:function(){return(this.mode&Ai)===Ai},set:function(e){e?this.mode|=Ai:this.mode&=~Ai}},write:{get:function(){return(this.mode&Di)===Di},set:function(e){e?this.mode|=Di:this.mode&=~Di}},isFolder:{get:function(){return je.isDir(this.mode)}},isDevice:{get:function(){return je.isChrdev(this.mode)}}}),je.FSNode=Ri,je.staticInit(),n.FS_createPath=je.createPath,n.FS_createDataFile=je.createDataFile,n.FS_createPreloadedFile=je.createPreloadedFile,n.FS_createLazyFile=je.createLazyFile,n.FS_createDevice=je.createDevice,n.FS_unlink=je.unlink,st=n.InternalError=nt(Error,"InternalError"),pt(),ft=n.BindingError=nt(Error,"BindingError"),Pt(),ir(),Zt(),lr=n.UnboundTypeError=nt(Error,"UnboundTypeError"),Ir(),se.push({func:function(){Ni()}});var Li,Pi={x:Ne,A:qe,P:We,Q:Ye,U:lt,s:ut,S:yt,v:hr,u:dr,d:gr,R:xr,C:Cr,h:Mr,m:Ar,k:Dr,D:Or,w:Lr,V:Pr,g:Nr,t:Fr,j:Ur,T:Br,q:Vr,W:jr,b:Tr,F:Xr,n:Jr,l:$r,N:Zr,E:Kr,y:Qr,f:ei,r:ti,p:ri,i:ii,e:ni,c:si,M:oi,I:li,o:hi,K:fi,L:gi,B:_i,O:yi,G:Ti,z:vi,a:w,H:Ei,J:Mi},Ni=(De(),n.___wasm_call_ctors=function(){return(Ni=n.___wasm_call_ctors=n.asm.Y).apply(null,arguments)}),Fi=(n._main=function(){return(n._main=n.asm.Z).apply(null,arguments)},n._malloc=function(){return(Fi=n._malloc=n.asm._).apply(null,arguments)}),Ui=n.___getTypeName=function(){return(Ui=n.___getTypeName=n.asm.$).apply(null,arguments)},Bi=(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(Bi=n.___errno_location=n.asm.ba).apply(null,arguments)}),ki=n._free=function(){return(ki=n._free=n.asm.ca).apply(null,arguments)};function Gi(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Vi(e){var t=n._main;try{ji(t(0,0),!0)}catch(e){if(e instanceof Gi)return;if("unwind"==e)return void(S=!0);var r=e;e&&"object"==typeof e&&e.stack&&(r=[e,e.stack]),E("exception thrown: "+r),c(1,e)}}function Hi(e){function r(){Li||(Li=!0,n.calledRun=!0,M||(ce(),ue(),t(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),zi&&Vi(),pe()))}e=e||o,fe>0||(le(),fe>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),r()}),1)):r()))}function ji(e,t){t&&S&&0===e||(S||(he(),n.onExit&&n.onExit(e),M=!0),c(e,new Gi(e)))}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=ye,n.removeRunDependency=Te,n.FS_createPath=je.createPath,n.FS_createDataFile=je.createDataFile,n.FS_createPreloadedFile=je.createPreloadedFile,n.FS_createLazyFile=je.createLazyFile,n.FS_createDevice=je.createDevice,n.FS_unlink=je.unlink,n.FS=je,_e=function e(){Li||Hi(),Li||(_e=e)},n.run=Hi,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();var zi=!0;return n.noInitialRun&&(zi=!1),S=!0,Hi(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=i:"function"==typeof define&&define.amd?define([],(function(){return i})):"object"==typeof e&&(e.WebIFCWasm=i)}}),IFCACTIONREQUEST=3821786052,IFCACTOR=2296667514,IFCACTORROLE=3630933823,IFCACTUATOR=4288193352,IFCACTUATORTYPE=2874132201,IFCADDRESS=618182010,IFCADVANCEDBREP=1635779807,IFCADVANCEDBREPWITHVOIDS=2603310189,IFCADVANCEDFACE=3406155212,IFCAIRTERMINAL=1634111441,IFCAIRTERMINALBOX=177149247,IFCAIRTERMINALBOXTYPE=1411407467,IFCAIRTERMINALTYPE=3352864051,IFCAIRTOAIRHEATRECOVERY=2056796094,IFCAIRTOAIRHEATRECOVERYTYPE=1871374353,IFCALARM=3087945054,IFCALARMTYPE=3001207471,IFCALIGNMENT=325726236,IFCALIGNMENT2DHORIZONTAL=749761778,IFCALIGNMENT2DHORIZONTALSEGMENT=3199563722,IFCALIGNMENT2DSEGMENT=2483840362,IFCALIGNMENT2DVERSEGCIRCULARARC=3379348081,IFCALIGNMENT2DVERSEGLINE=3239324667,IFCALIGNMENT2DVERSEGPARABOLICARC=4263986512,IFCALIGNMENT2DVERTICAL=53199957,IFCALIGNMENT2DVERTICALSEGMENT=2029264950,IFCALIGNMENTCURVE=3512275521,IFCANNOTATION=1674181508,IFCANNOTATIONFILLAREA=669184980,IFCAPPLICATION=639542469,IFCAPPLIEDVALUE=411424972,IFCAPPROVAL=130549933,IFCAPPROVALRELATIONSHIP=3869604511,IFCARBITRARYCLOSEDPROFILEDEF=3798115385,IFCARBITRARYOPENPROFILEDEF=1310608509,IFCARBITRARYPROFILEDEFWITHVOIDS=2705031697,IFCASSET=3460190687,IFCASYMMETRICISHAPEPROFILEDEF=3207858831,IFCAUDIOVISUALAPPLIANCE=277319702,IFCAUDIOVISUALAPPLIANCETYPE=1532957894,IFCAXIS1PLACEMENT=4261334040,IFCAXIS2PLACEMENT2D=3125803723,IFCAXIS2PLACEMENT3D=2740243338,IFCBSPLINECURVE=1967976161,IFCBSPLINECURVEWITHKNOTS=2461110595,IFCBSPLINESURFACE=2887950389,IFCBSPLINESURFACEWITHKNOTS=167062518,IFCBEAM=753842376,IFCBEAMSTANDARDCASE=2906023776,IFCBEAMTYPE=819618141,IFCBEARING=4196446775,IFCBEARINGTYPE=3649138523,IFCBLOBTEXTURE=616511568,IFCBLOCK=1334484129,IFCBOILER=32344328,IFCBOILERTYPE=231477066,IFCBOOLEANCLIPPINGRESULT=3649129432,IFCBOOLEANRESULT=2736907675,IFCBOUNDARYCONDITION=4037036970,IFCBOUNDARYCURVE=1136057603,IFCBOUNDARYEDGECONDITION=1560379544,IFCBOUNDARYFACECONDITION=3367102660,IFCBOUNDARYNODECONDITION=1387855156,IFCBOUNDARYNODECONDITIONWARPING=2069777674,IFCBOUNDEDCURVE=1260505505,IFCBOUNDEDSURFACE=4182860854,IFCBOUNDINGBOX=2581212453,IFCBOXEDHALFSPACE=2713105998,IFCBRIDGE=644574406,IFCBRIDGEPART=963979645,IFCBUILDING=4031249490,IFCBUILDINGELEMENT=3299480353,IFCBUILDINGELEMENTPART=2979338954,IFCBUILDINGELEMENTPARTTYPE=39481116,IFCBUILDINGELEMENTPROXY=1095909175,IFCBUILDINGELEMENTPROXYTYPE=1909888760,IFCBUILDINGELEMENTTYPE=1950629157,IFCBUILDINGSTOREY=3124254112,IFCBUILDINGSYSTEM=1177604601,IFCBURNER=2938176219,IFCBURNERTYPE=2188180465,IFCCSHAPEPROFILEDEF=2898889636,IFCCABLECARRIERFITTING=635142910,IFCCABLECARRIERFITTINGTYPE=395041908,IFCCABLECARRIERSEGMENT=3758799889,IFCCABLECARRIERSEGMENTTYPE=3293546465,IFCCABLEFITTING=1051757585,IFCCABLEFITTINGTYPE=2674252688,IFCCABLESEGMENT=4217484030,IFCCABLESEGMENTTYPE=1285652485,IFCCAISSONFOUNDATION=3999819293,IFCCAISSONFOUNDATIONTYPE=3203706013,IFCCARTESIANPOINT=1123145078,IFCCARTESIANPOINTLIST=574549367,IFCCARTESIANPOINTLIST2D=1675464909,IFCCARTESIANPOINTLIST3D=2059837836,IFCCARTESIANTRANSFORMATIONOPERATOR=59481748,IFCCARTESIANTRANSFORMATIONOPERATOR2D=3749851601,IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM=3486308946,IFCCARTESIANTRANSFORMATIONOPERATOR3D=3331915920,IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM=1416205885,IFCCENTERLINEPROFILEDEF=3150382593,IFCCHILLER=3902619387,IFCCHILLERTYPE=2951183804,IFCCHIMNEY=3296154744,IFCCHIMNEYTYPE=2197970202,IFCCIRCLE=2611217952,IFCCIRCLEHOLLOWPROFILEDEF=2937912522,IFCCIRCLEPROFILEDEF=1383045692,IFCCIRCULARARCSEGMENT2D=1062206242,IFCCIVILELEMENT=1677625105,IFCCIVILELEMENTTYPE=3893394355,IFCCLASSIFICATION=747523909,IFCCLASSIFICATIONREFERENCE=647927063,IFCCLOSEDSHELL=2205249479,IFCCOIL=639361253,IFCCOILTYPE=2301859152,IFCCOLOURRGB=776857604,IFCCOLOURRGBLIST=3285139300,IFCCOLOURSPECIFICATION=3264961684,IFCCOLUMN=843113511,IFCCOLUMNSTANDARDCASE=905975707,IFCCOLUMNTYPE=300633059,IFCCOMMUNICATIONSAPPLIANCE=3221913625,IFCCOMMUNICATIONSAPPLIANCETYPE=400855858,IFCCOMPLEXPROPERTY=2542286263,IFCCOMPLEXPROPERTYTEMPLATE=3875453745,IFCCOMPOSITECURVE=3732776249,IFCCOMPOSITECURVEONSURFACE=15328376,IFCCOMPOSITECURVESEGMENT=2485617015,IFCCOMPOSITEPROFILEDEF=1485152156,IFCCOMPRESSOR=3571504051,IFCCOMPRESSORTYPE=3850581409,IFCCONDENSER=2272882330,IFCCONDENSERTYPE=2816379211,IFCCONIC=2510884976,IFCCONNECTEDFACESET=370225590,IFCCONNECTIONCURVEGEOMETRY=1981873012,IFCCONNECTIONGEOMETRY=2859738748,IFCCONNECTIONPOINTECCENTRICITY=45288368,IFCCONNECTIONPOINTGEOMETRY=2614616156,IFCCONNECTIONSURFACEGEOMETRY=2732653382,IFCCONNECTIONVOLUMEGEOMETRY=775493141,IFCCONSTRAINT=1959218052,IFCCONSTRUCTIONEQUIPMENTRESOURCE=3898045240,IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE=2185764099,IFCCONSTRUCTIONMATERIALRESOURCE=1060000209,IFCCONSTRUCTIONMATERIALRESOURCETYPE=4105962743,IFCCONSTRUCTIONPRODUCTRESOURCE=488727124,IFCCONSTRUCTIONPRODUCTRESOURCETYPE=1525564444,IFCCONSTRUCTIONRESOURCE=2559216714,IFCCONSTRUCTIONRESOURCETYPE=2574617495,IFCCONTEXT=3419103109,IFCCONTEXTDEPENDENTUNIT=3050246964,IFCCONTROL=3293443760,IFCCONTROLLER=25142252,IFCCONTROLLERTYPE=578613899,IFCCONVERSIONBASEDUNIT=2889183280,IFCCONVERSIONBASEDUNITWITHOFFSET=2713554722,IFCCOOLEDBEAM=4136498852,IFCCOOLEDBEAMTYPE=335055490,IFCCOOLINGTOWER=3640358203,IFCCOOLINGTOWERTYPE=2954562838,IFCCOORDINATEOPERATION=1785450214,IFCCOORDINATEREFERENCESYSTEM=1466758467,IFCCOSTITEM=3895139033,IFCCOSTSCHEDULE=1419761937,IFCCOSTVALUE=602808272,IFCCOVERING=1973544240,IFCCOVERINGTYPE=1916426348,IFCCREWRESOURCE=3295246426,IFCCREWRESOURCETYPE=1815067380,IFCCSGPRIMITIVE3D=2506170314,IFCCSGSOLID=2147822146,IFCCURRENCYRELATIONSHIP=539742890,IFCCURTAINWALL=3495092785,IFCCURTAINWALLTYPE=1457835157,IFCCURVE=2601014836,IFCCURVEBOUNDEDPLANE=2827736869,IFCCURVEBOUNDEDSURFACE=2629017746,IFCCURVESEGMENT2D=1186437898,IFCCURVESTYLE=3800577675,IFCCURVESTYLEFONT=1105321065,IFCCURVESTYLEFONTANDSCALING=2367409068,IFCCURVESTYLEFONTPATTERN=3510044353,IFCCYLINDRICALSURFACE=1213902940,IFCDAMPER=4074379575,IFCDAMPERTYPE=3961806047,IFCDEEPFOUNDATION=3426335179,IFCDEEPFOUNDATIONTYPE=1306400036,IFCDERIVEDPROFILEDEF=3632507154,IFCDERIVEDUNIT=1765591967,IFCDERIVEDUNITELEMENT=1045800335,IFCDIMENSIONALEXPONENTS=2949456006,IFCDIRECTION=32440307,IFCDISCRETEACCESSORY=1335981549,IFCDISCRETEACCESSORYTYPE=2635815018,IFCDISTANCEEXPRESSION=1945343521,IFCDISTRIBUTIONCHAMBERELEMENT=1052013943,IFCDISTRIBUTIONCHAMBERELEMENTTYPE=1599208980,IFCDISTRIBUTIONCIRCUIT=562808652,IFCDISTRIBUTIONCONTROLELEMENT=1062813311,IFCDISTRIBUTIONCONTROLELEMENTTYPE=2063403501,IFCDISTRIBUTIONELEMENT=1945004755,IFCDISTRIBUTIONELEMENTTYPE=3256556792,IFCDISTRIBUTIONFLOWELEMENT=3040386961,IFCDISTRIBUTIONFLOWELEMENTTYPE=3849074793,IFCDISTRIBUTIONPORT=3041715199,IFCDISTRIBUTIONSYSTEM=3205830791,IFCDOCUMENTINFORMATION=1154170062,IFCDOCUMENTINFORMATIONRELATIONSHIP=770865208,IFCDOCUMENTREFERENCE=3732053477,IFCDOOR=395920057,IFCDOORLININGPROPERTIES=2963535650,IFCDOORPANELPROPERTIES=1714330368,IFCDOORSTANDARDCASE=3242481149,IFCDOORSTYLE=526551008,IFCDOORTYPE=2323601079,IFCDRAUGHTINGPREDEFINEDCOLOUR=445594917,IFCDRAUGHTINGPREDEFINEDCURVEFONT=4006246654,IFCDUCTFITTING=342316401,IFCDUCTFITTINGTYPE=869906466,IFCDUCTSEGMENT=3518393246,IFCDUCTSEGMENTTYPE=3760055223,IFCDUCTSILENCER=1360408905,IFCDUCTSILENCERTYPE=2030761528,IFCEDGE=3900360178,IFCEDGECURVE=476780140,IFCEDGELOOP=1472233963,IFCELECTRICAPPLIANCE=1904799276,IFCELECTRICAPPLIANCETYPE=663422040,IFCELECTRICDISTRIBUTIONBOARD=862014818,IFCELECTRICDISTRIBUTIONBOARDTYPE=2417008758,IFCELECTRICFLOWSTORAGEDEVICE=3310460725,IFCELECTRICFLOWSTORAGEDEVICETYPE=3277789161,IFCELECTRICGENERATOR=264262732,IFCELECTRICGENERATORTYPE=1534661035,IFCELECTRICMOTOR=402227799,IFCELECTRICMOTORTYPE=1217240411,IFCELECTRICTIMECONTROL=1003880860,IFCELECTRICTIMECONTROLTYPE=712377611,IFCELEMENT=1758889154,IFCELEMENTASSEMBLY=4123344466,IFCELEMENTASSEMBLYTYPE=2397081782,IFCELEMENTCOMPONENT=1623761950,IFCELEMENTCOMPONENTTYPE=2590856083,IFCELEMENTQUANTITY=1883228015,IFCELEMENTTYPE=339256511,IFCELEMENTARYSURFACE=2777663545,IFCELLIPSE=1704287377,IFCELLIPSEPROFILEDEF=2835456948,IFCENERGYCONVERSIONDEVICE=1658829314,IFCENERGYCONVERSIONDEVICETYPE=2107101300,IFCENGINE=2814081492,IFCENGINETYPE=132023988,IFCEVAPORATIVECOOLER=3747195512,IFCEVAPORATIVECOOLERTYPE=3174744832,IFCEVAPORATOR=484807127,IFCEVAPORATORTYPE=3390157468,IFCEVENT=4148101412,IFCEVENTTIME=211053100,IFCEVENTTYPE=4024345920,IFCEXTENDEDPROPERTIES=297599258,IFCEXTERNALINFORMATION=4294318154,IFCEXTERNALREFERENCE=3200245327,IFCEXTERNALREFERENCERELATIONSHIP=1437805879,IFCEXTERNALSPATIALELEMENT=1209101575,IFCEXTERNALSPATIALSTRUCTUREELEMENT=2853485674,IFCEXTERNALLYDEFINEDHATCHSTYLE=2242383968,IFCEXTERNALLYDEFINEDSURFACESTYLE=1040185647,IFCEXTERNALLYDEFINEDTEXTFONT=3548104201,IFCEXTRUDEDAREASOLID=477187591,IFCEXTRUDEDAREASOLIDTAPERED=2804161546,IFCFACE=2556980723,IFCFACEBASEDSURFACEMODEL=2047409740,IFCFACEBOUND=1809719519,IFCFACEOUTERBOUND=803316827,IFCFACESURFACE=3008276851,IFCFACETEDBREP=807026263,IFCFACETEDBREPWITHVOIDS=3737207727,IFCFACILITY=24185140,IFCFACILITYPART=1310830890,IFCFAILURECONNECTIONCONDITION=4219587988,IFCFAN=3415622556,IFCFANTYPE=346874300,IFCFASTENER=647756555,IFCFASTENERTYPE=2489546625,IFCFEATUREELEMENT=2827207264,IFCFEATUREELEMENTADDITION=2143335405,IFCFEATUREELEMENTSUBTRACTION=1287392070,IFCFILLAREASTYLE=738692330,IFCFILLAREASTYLEHATCHING=374418227,IFCFILLAREASTYLETILES=315944413,IFCFILTER=819412036,IFCFILTERTYPE=1810631287,IFCFIRESUPPRESSIONTERMINAL=1426591983,IFCFIRESUPPRESSIONTERMINALTYPE=4222183408,IFCFIXEDREFERENCESWEPTAREASOLID=2652556860,IFCFLOWCONTROLLER=2058353004,IFCFLOWCONTROLLERTYPE=3907093117,IFCFLOWFITTING=4278956645,IFCFLOWFITTINGTYPE=3198132628,IFCFLOWINSTRUMENT=182646315,IFCFLOWINSTRUMENTTYPE=4037862832,IFCFLOWMETER=2188021234,IFCFLOWMETERTYPE=3815607619,IFCFLOWMOVINGDEVICE=3132237377,IFCFLOWMOVINGDEVICETYPE=1482959167,IFCFLOWSEGMENT=987401354,IFCFLOWSEGMENTTYPE=1834744321,IFCFLOWSTORAGEDEVICE=707683696,IFCFLOWSTORAGEDEVICETYPE=1339347760,IFCFLOWTERMINAL=2223149337,IFCFLOWTERMINALTYPE=2297155007,IFCFLOWTREATMENTDEVICE=3508470533,IFCFLOWTREATMENTDEVICETYPE=3009222698,IFCFOOTING=900683007,IFCFOOTINGTYPE=1893162501,IFCFURNISHINGELEMENT=263784265,IFCFURNISHINGELEMENTTYPE=4238390223,IFCFURNITURE=1509553395,IFCFURNITURETYPE=1268542332,IFCGEOGRAPHICELEMENT=3493046030,IFCGEOGRAPHICELEMENTTYPE=4095422895,IFCGEOMETRICCURVESET=987898635,IFCGEOMETRICREPRESENTATIONCONTEXT=3448662350,IFCGEOMETRICREPRESENTATIONITEM=2453401579,IFCGEOMETRICREPRESENTATIONSUBCONTEXT=4142052618,IFCGEOMETRICSET=3590301190,IFCGRID=3009204131,IFCGRIDAXIS=852622518,IFCGRIDPLACEMENT=178086475,IFCGROUP=2706460486,IFCHALFSPACESOLID=812098782,IFCHEATEXCHANGER=3319311131,IFCHEATEXCHANGERTYPE=1251058090,IFCHUMIDIFIER=2068733104,IFCHUMIDIFIERTYPE=1806887404,IFCISHAPEPROFILEDEF=1484403080,IFCIMAGETEXTURE=3905492369,IFCINDEXEDCOLOURMAP=3570813810,IFCINDEXEDPOLYCURVE=2571569899,IFCINDEXEDPOLYGONALFACE=178912537,IFCINDEXEDPOLYGONALFACEWITHVOIDS=2294589976,IFCINDEXEDTEXTUREMAP=1437953363,IFCINDEXEDTRIANGLETEXTUREMAP=2133299955,IFCINTERCEPTOR=4175244083,IFCINTERCEPTORTYPE=3946677679,IFCINTERSECTIONCURVE=3113134337,IFCINVENTORY=2391368822,IFCIRREGULARTIMESERIES=3741457305,IFCIRREGULARTIMESERIESVALUE=3020489413,IFCJUNCTIONBOX=2176052936,IFCJUNCTIONBOXTYPE=4288270099,IFCLSHAPEPROFILEDEF=572779678,IFCLABORRESOURCE=3827777499,IFCLABORRESOURCETYPE=428585644,IFCLAGTIME=1585845231,IFCLAMP=76236018,IFCLAMPTYPE=1051575348,IFCLIBRARYINFORMATION=2655187982,IFCLIBRARYREFERENCE=3452421091,IFCLIGHTDISTRIBUTIONDATA=4162380809,IFCLIGHTFIXTURE=629592764,IFCLIGHTFIXTURETYPE=1161773419,IFCLIGHTINTENSITYDISTRIBUTION=1566485204,IFCLIGHTSOURCE=1402838566,IFCLIGHTSOURCEAMBIENT=125510826,IFCLIGHTSOURCEDIRECTIONAL=2604431987,IFCLIGHTSOURCEGONIOMETRIC=4266656042,IFCLIGHTSOURCEPOSITIONAL=1520743889,IFCLIGHTSOURCESPOT=3422422726,IFCLINE=1281925730,IFCLINESEGMENT2D=3092502836,IFCLINEARPLACEMENT=388784114,IFCLINEARPOSITIONINGELEMENT=1154579445,IFCLOCALPLACEMENT=2624227202,IFCLOOP=1008929658,IFCMANIFOLDSOLIDBREP=1425443689,IFCMAPCONVERSION=3057273783,IFCMAPPEDITEM=2347385850,IFCMATERIAL=1838606355,IFCMATERIALCLASSIFICATIONRELATIONSHIP=1847130766,IFCMATERIALCONSTITUENT=3708119e3,IFCMATERIALCONSTITUENTSET=2852063980,IFCMATERIALDEFINITION=760658860,IFCMATERIALDEFINITIONREPRESENTATION=2022407955,IFCMATERIALLAYER=248100487,IFCMATERIALLAYERSET=3303938423,IFCMATERIALLAYERSETUSAGE=1303795690,IFCMATERIALLAYERWITHOFFSETS=1847252529,IFCMATERIALLIST=2199411900,IFCMATERIALPROFILE=2235152071,IFCMATERIALPROFILESET=164193824,IFCMATERIALPROFILESETUSAGE=3079605661,IFCMATERIALPROFILESETUSAGETAPERING=3404854881,IFCMATERIALPROFILEWITHOFFSETS=552965576,IFCMATERIALPROPERTIES=3265635763,IFCMATERIALRELATIONSHIP=853536259,IFCMATERIALUSAGEDEFINITION=1507914824,IFCMEASUREWITHUNIT=2597039031,IFCMECHANICALFASTENER=377706215,IFCMECHANICALFASTENERTYPE=2108223431,IFCMEDICALDEVICE=1437502449,IFCMEDICALDEVICETYPE=1114901282,IFCMEMBER=1073191201,IFCMEMBERSTANDARDCASE=1911478936,IFCMEMBERTYPE=3181161470,IFCMETRIC=3368373690,IFCMIRROREDPROFILEDEF=2998442950,IFCMONETARYUNIT=2706619895,IFCMOTORCONNECTION=2474470126,IFCMOTORCONNECTIONTYPE=977012517,IFCNAMEDUNIT=1918398963,IFCOBJECT=3888040117,IFCOBJECTDEFINITION=219451334,IFCOBJECTPLACEMENT=3701648758,IFCOBJECTIVE=2251480897,IFCOCCUPANT=4143007308,IFCOFFSETCURVE=590820931,IFCOFFSETCURVE2D=3388369263,IFCOFFSETCURVE3D=3505215534,IFCOFFSETCURVEBYDISTANCES=2485787929,IFCOPENSHELL=2665983363,IFCOPENINGELEMENT=3588315303,IFCOPENINGSTANDARDCASE=3079942009,IFCORGANIZATION=4251960020,IFCORGANIZATIONRELATIONSHIP=1411181986,IFCORIENTATIONEXPRESSION=643959842,IFCORIENTEDEDGE=1029017970,IFCOUTERBOUNDARYCURVE=144952367,IFCOUTLET=3694346114,IFCOUTLETTYPE=2837617999,IFCOWNERHISTORY=1207048766,IFCPARAMETERIZEDPROFILEDEF=2529465313,IFCPATH=2519244187,IFCPCURVE=1682466193,IFCPERFORMANCEHISTORY=2382730787,IFCPERMEABLECOVERINGPROPERTIES=3566463478,IFCPERMIT=3327091369,IFCPERSON=2077209135,IFCPERSONANDORGANIZATION=101040310,IFCPHYSICALCOMPLEXQUANTITY=3021840470,IFCPHYSICALQUANTITY=2483315170,IFCPHYSICALSIMPLEQUANTITY=2226359599,IFCPILE=1687234759,IFCPILETYPE=1158309216,IFCPIPEFITTING=310824031,IFCPIPEFITTINGTYPE=804291784,IFCPIPESEGMENT=3612865200,IFCPIPESEGMENTTYPE=4231323485,IFCPIXELTEXTURE=597895409,IFCPLACEMENT=2004835150,IFCPLANARBOX=603570806,IFCPLANAREXTENT=1663979128,IFCPLANE=220341763,IFCPLATE=3171933400,IFCPLATESTANDARDCASE=1156407060,IFCPLATETYPE=4017108033,IFCPOINT=2067069095,IFCPOINTONCURVE=4022376103,IFCPOINTONSURFACE=1423911732,IFCPOLYLOOP=2924175390,IFCPOLYGONALBOUNDEDHALFSPACE=2775532180,IFCPOLYGONALFACESET=2839578677,IFCPOLYLINE=3724593414,IFCPORT=3740093272,IFCPOSITIONINGELEMENT=1946335990,IFCPOSTALADDRESS=3355820592,IFCPREDEFINEDCOLOUR=759155922,IFCPREDEFINEDCURVEFONT=2559016684,IFCPREDEFINEDITEM=3727388367,IFCPREDEFINEDPROPERTIES=3778827333,IFCPREDEFINEDPROPERTYSET=3967405729,IFCPREDEFINEDTEXTFONT=1775413392,IFCPRESENTATIONITEM=677532197,IFCPRESENTATIONLAYERASSIGNMENT=2022622350,IFCPRESENTATIONLAYERWITHSTYLE=1304840413,IFCPRESENTATIONSTYLE=3119450353,IFCPRESENTATIONSTYLEASSIGNMENT=2417041796,IFCPROCEDURE=2744685151,IFCPROCEDURETYPE=569719735,IFCPROCESS=2945172077,IFCPRODUCT=4208778838,IFCPRODUCTDEFINITIONSHAPE=673634403,IFCPRODUCTREPRESENTATION=2095639259,IFCPROFILEDEF=3958567839,IFCPROFILEPROPERTIES=2802850158,IFCPROJECT=103090709,IFCPROJECTLIBRARY=653396225,IFCPROJECTORDER=2904328755,IFCPROJECTEDCRS=3843373140,IFCPROJECTIONELEMENT=3651124850,IFCPROPERTY=2598011224,IFCPROPERTYABSTRACTION=986844984,IFCPROPERTYBOUNDEDVALUE=871118103,IFCPROPERTYDEFINITION=1680319473,IFCPROPERTYDEPENDENCYRELATIONSHIP=148025276,IFCPROPERTYENUMERATEDVALUE=4166981789,IFCPROPERTYENUMERATION=3710013099,IFCPROPERTYLISTVALUE=2752243245,IFCPROPERTYREFERENCEVALUE=941946838,IFCPROPERTYSET=1451395588,IFCPROPERTYSETDEFINITION=3357820518,IFCPROPERTYSETTEMPLATE=492091185,IFCPROPERTYSINGLEVALUE=3650150729,IFCPROPERTYTABLEVALUE=110355661,IFCPROPERTYTEMPLATE=3521284610,IFCPROPERTYTEMPLATEDEFINITION=1482703590,IFCPROTECTIVEDEVICE=738039164,IFCPROTECTIVEDEVICETRIPPINGUNIT=2295281155,IFCPROTECTIVEDEVICETRIPPINGUNITTYPE=655969474,IFCPROTECTIVEDEVICETYPE=1842657554,IFCPROXY=3219374653,IFCPUMP=90941305,IFCPUMPTYPE=2250791053,IFCQUANTITYAREA=2044713172,IFCQUANTITYCOUNT=2093928680,IFCQUANTITYLENGTH=931644368,IFCQUANTITYSET=2090586900,IFCQUANTITYTIME=3252649465,IFCQUANTITYVOLUME=2405470396,IFCQUANTITYWEIGHT=825690147,IFCRAILING=2262370178,IFCRAILINGTYPE=2893384427,IFCRAMP=3024970846,IFCRAMPFLIGHT=3283111854,IFCRAMPFLIGHTTYPE=2324767716,IFCRAMPTYPE=1469900589,IFCRATIONALBSPLINECURVEWITHKNOTS=1232101972,IFCRATIONALBSPLINESURFACEWITHKNOTS=683857671,IFCRECTANGLEHOLLOWPROFILEDEF=2770003689,IFCRECTANGLEPROFILEDEF=3615266464,IFCRECTANGULARPYRAMID=2798486643,IFCRECTANGULARTRIMMEDSURFACE=3454111270,IFCRECURRENCEPATTERN=3915482550,IFCREFERENCE=2433181523,IFCREFERENT=4021432810,IFCREGULARTIMESERIES=3413951693,IFCREINFORCEMENTBARPROPERTIES=1580146022,IFCREINFORCEMENTDEFINITIONPROPERTIES=3765753017,IFCREINFORCINGBAR=979691226,IFCREINFORCINGBARTYPE=2572171363,IFCREINFORCINGELEMENT=3027567501,IFCREINFORCINGELEMENTTYPE=964333572,IFCREINFORCINGMESH=2320036040,IFCREINFORCINGMESHTYPE=2310774935,IFCRELAGGREGATES=160246688,IFCRELASSIGNS=3939117080,IFCRELASSIGNSTOACTOR=1683148259,IFCRELASSIGNSTOCONTROL=2495723537,IFCRELASSIGNSTOGROUP=1307041759,IFCRELASSIGNSTOGROUPBYFACTOR=1027710054,IFCRELASSIGNSTOPROCESS=4278684876,IFCRELASSIGNSTOPRODUCT=2857406711,IFCRELASSIGNSTORESOURCE=205026976,IFCRELASSOCIATES=1865459582,IFCRELASSOCIATESAPPROVAL=4095574036,IFCRELASSOCIATESCLASSIFICATION=919958153,IFCRELASSOCIATESCONSTRAINT=2728634034,IFCRELASSOCIATESDOCUMENT=982818633,IFCRELASSOCIATESLIBRARY=3840914261,IFCRELASSOCIATESMATERIAL=2655215786,IFCRELCONNECTS=826625072,IFCRELCONNECTSELEMENTS=1204542856,IFCRELCONNECTSPATHELEMENTS=3945020480,IFCRELCONNECTSPORTTOELEMENT=4201705270,IFCRELCONNECTSPORTS=3190031847,IFCRELCONNECTSSTRUCTURALACTIVITY=2127690289,IFCRELCONNECTSSTRUCTURALMEMBER=1638771189,IFCRELCONNECTSWITHECCENTRICITY=504942748,IFCRELCONNECTSWITHREALIZINGELEMENTS=3678494232,IFCRELCONTAINEDINSPATIALSTRUCTURE=3242617779,IFCRELCOVERSBLDGELEMENTS=886880790,IFCRELCOVERSSPACES=2802773753,IFCRELDECLARES=2565941209,IFCRELDECOMPOSES=2551354335,IFCRELDEFINES=693640335,IFCRELDEFINESBYOBJECT=1462361463,IFCRELDEFINESBYPROPERTIES=4186316022,IFCRELDEFINESBYTEMPLATE=307848117,IFCRELDEFINESBYTYPE=781010003,IFCRELFILLSELEMENT=3940055652,IFCRELFLOWCONTROLELEMENTS=279856033,IFCRELINTERFERESELEMENTS=427948657,IFCRELNESTS=3268803585,IFCRELPOSITIONS=1441486842,IFCRELPROJECTSELEMENT=750771296,IFCRELREFERENCEDINSPATIALSTRUCTURE=1245217292,IFCRELSEQUENCE=4122056220,IFCRELSERVICESBUILDINGS=366585022,IFCRELSPACEBOUNDARY=3451746338,IFCRELSPACEBOUNDARY1STLEVEL=3523091289,IFCRELSPACEBOUNDARY2NDLEVEL=1521410863,IFCRELVOIDSELEMENT=1401173127,IFCRELATIONSHIP=478536968,IFCREPARAMETRISEDCOMPOSITECURVESEGMENT=816062949,IFCREPRESENTATION=1076942058,IFCREPRESENTATIONCONTEXT=3377609919,IFCREPRESENTATIONITEM=3008791417,IFCREPRESENTATIONMAP=1660063152,IFCRESOURCE=2914609552,IFCRESOURCEAPPROVALRELATIONSHIP=2943643501,IFCRESOURCECONSTRAINTRELATIONSHIP=1608871552,IFCRESOURCELEVELRELATIONSHIP=2439245199,IFCRESOURCETIME=1042787934,IFCREVOLVEDAREASOLID=1856042241,IFCREVOLVEDAREASOLIDTAPERED=3243963512,IFCRIGHTCIRCULARCONE=4158566097,IFCRIGHTCIRCULARCYLINDER=3626867408,IFCROOF=2016517767,IFCROOFTYPE=2781568857,IFCROOT=2341007311,IFCROUNDEDRECTANGLEPROFILEDEF=2778083089,IFCSIUNIT=448429030,IFCSANITARYTERMINAL=3053780830,IFCSANITARYTERMINALTYPE=1768891740,IFCSCHEDULINGTIME=1054537805,IFCSEAMCURVE=2157484638,IFCSECTIONPROPERTIES=2042790032,IFCSECTIONREINFORCEMENTPROPERTIES=4165799628,IFCSECTIONEDSOLID=1862484736,IFCSECTIONEDSOLIDHORIZONTAL=1290935644,IFCSECTIONEDSPINE=1509187699,IFCSENSOR=4086658281,IFCSENSORTYPE=1783015770,IFCSHADINGDEVICE=1329646415,IFCSHADINGDEVICETYPE=4074543187,IFCSHAPEASPECT=867548509,IFCSHAPEMODEL=3982875396,IFCSHAPEREPRESENTATION=4240577450,IFCSHELLBASEDSURFACEMODEL=4124623270,IFCSIMPLEPROPERTY=3692461612,IFCSIMPLEPROPERTYTEMPLATE=3663146110,IFCSITE=4097777520,IFCSLAB=1529196076,IFCSLABELEMENTEDCASE=3127900445,IFCSLABSTANDARDCASE=3027962421,IFCSLABTYPE=2533589738,IFCSLIPPAGECONNECTIONCONDITION=2609359061,IFCSOLARDEVICE=3420628829,IFCSOLARDEVICETYPE=1072016465,IFCSOLIDMODEL=723233188,IFCSPACE=3856911033,IFCSPACEHEATER=1999602285,IFCSPACEHEATERTYPE=1305183839,IFCSPACETYPE=3812236995,IFCSPATIALELEMENT=1412071761,IFCSPATIALELEMENTTYPE=710998568,IFCSPATIALSTRUCTUREELEMENT=2706606064,IFCSPATIALSTRUCTUREELEMENTTYPE=3893378262,IFCSPATIALZONE=463610769,IFCSPATIALZONETYPE=2481509218,IFCSPHERE=451544542,IFCSPHERICALSURFACE=4015995234,IFCSTACKTERMINAL=1404847402,IFCSTACKTERMINALTYPE=3112655638,IFCSTAIR=331165859,IFCSTAIRFLIGHT=4252922144,IFCSTAIRFLIGHTTYPE=1039846685,IFCSTAIRTYPE=338393293,IFCSTRUCTURALACTION=682877961,IFCSTRUCTURALACTIVITY=3544373492,IFCSTRUCTURALANALYSISMODEL=2515109513,IFCSTRUCTURALCONNECTION=1179482911,IFCSTRUCTURALCONNECTIONCONDITION=2273995522,IFCSTRUCTURALCURVEACTION=1004757350,IFCSTRUCTURALCURVECONNECTION=4243806635,IFCSTRUCTURALCURVEMEMBER=214636428,IFCSTRUCTURALCURVEMEMBERVARYING=2445595289,IFCSTRUCTURALCURVEREACTION=2757150158,IFCSTRUCTURALITEM=3136571912,IFCSTRUCTURALLINEARACTION=1807405624,IFCSTRUCTURALLOAD=2162789131,IFCSTRUCTURALLOADCASE=385403989,IFCSTRUCTURALLOADCONFIGURATION=3478079324,IFCSTRUCTURALLOADGROUP=1252848954,IFCSTRUCTURALLOADLINEARFORCE=1595516126,IFCSTRUCTURALLOADORRESULT=609421318,IFCSTRUCTURALLOADPLANARFORCE=2668620305,IFCSTRUCTURALLOADSINGLEDISPLACEMENT=2473145415,IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION=1973038258,IFCSTRUCTURALLOADSINGLEFORCE=1597423693,IFCSTRUCTURALLOADSINGLEFORCEWARPING=1190533807,IFCSTRUCTURALLOADSTATIC=2525727697,IFCSTRUCTURALLOADTEMPERATURE=3408363356,IFCSTRUCTURALMEMBER=530289379,IFCSTRUCTURALPLANARACTION=1621171031,IFCSTRUCTURALPOINTACTION=2082059205,IFCSTRUCTURALPOINTCONNECTION=734778138,IFCSTRUCTURALPOINTREACTION=1235345126,IFCSTRUCTURALREACTION=3689010777,IFCSTRUCTURALRESULTGROUP=2986769608,IFCSTRUCTURALSURFACEACTION=3657597509,IFCSTRUCTURALSURFACECONNECTION=1975003073,IFCSTRUCTURALSURFACEMEMBER=3979015343,IFCSTRUCTURALSURFACEMEMBERVARYING=2218152070,IFCSTRUCTURALSURFACEREACTION=603775116,IFCSTYLEMODEL=2830218821,IFCSTYLEDITEM=3958052878,IFCSTYLEDREPRESENTATION=3049322572,IFCSUBCONTRACTRESOURCE=148013059,IFCSUBCONTRACTRESOURCETYPE=4095615324,IFCSUBEDGE=2233826070,IFCSURFACE=2513912981,IFCSURFACECURVE=699246055,IFCSURFACECURVESWEPTAREASOLID=2028607225,IFCSURFACEFEATURE=3101698114,IFCSURFACEOFLINEAREXTRUSION=2809605785,IFCSURFACEOFREVOLUTION=4124788165,IFCSURFACEREINFORCEMENTAREA=2934153892,IFCSURFACESTYLE=1300840506,IFCSURFACESTYLELIGHTING=3303107099,IFCSURFACESTYLEREFRACTION=1607154358,IFCSURFACESTYLERENDERING=1878645084,IFCSURFACESTYLESHADING=846575682,IFCSURFACESTYLEWITHTEXTURES=1351298697,IFCSURFACETEXTURE=626085974,IFCSWEPTAREASOLID=2247615214,IFCSWEPTDISKSOLID=1260650574,IFCSWEPTDISKSOLIDPOLYGONAL=1096409881,IFCSWEPTSURFACE=230924584,IFCSWITCHINGDEVICE=1162798199,IFCSWITCHINGDEVICETYPE=2315554128,IFCSYSTEM=2254336722,IFCSYSTEMFURNITUREELEMENT=413509423,IFCSYSTEMFURNITUREELEMENTTYPE=1580310250,IFCTSHAPEPROFILEDEF=3071757647,IFCTABLE=985171141,IFCTABLECOLUMN=2043862942,IFCTABLEROW=531007025,IFCTANK=812556717,IFCTANKTYPE=5716631,IFCTASK=3473067441,IFCTASKTIME=1549132990,IFCTASKTIMERECURRING=2771591690,IFCTASKTYPE=3206491090,IFCTELECOMADDRESS=912023232,IFCTENDON=3824725483,IFCTENDONANCHOR=2347447852,IFCTENDONANCHORTYPE=3081323446,IFCTENDONCONDUIT=3663046924,IFCTENDONCONDUITTYPE=2281632017,IFCTENDONTYPE=2415094496,IFCTESSELLATEDFACESET=2387106220,IFCTESSELLATEDITEM=901063453,IFCTEXTLITERAL=4282788508,IFCTEXTLITERALWITHEXTENT=3124975700,IFCTEXTSTYLE=1447204868,IFCTEXTSTYLEFONTMODEL=1983826977,IFCTEXTSTYLEFORDEFINEDFONT=2636378356,IFCTEXTSTYLETEXTMODEL=1640371178,IFCTEXTURECOORDINATE=280115917,IFCTEXTURECOORDINATEGENERATOR=1742049831,IFCTEXTUREMAP=2552916305,IFCTEXTUREVERTEX=1210645708,IFCTEXTUREVERTEXLIST=3611470254,IFCTIMEPERIOD=1199560280,IFCTIMESERIES=3101149627,IFCTIMESERIESVALUE=581633288,IFCTOPOLOGICALREPRESENTATIONITEM=1377556343,IFCTOPOLOGYREPRESENTATION=1735638870,IFCTOROIDALSURFACE=1935646853,IFCTRANSFORMER=3825984169,IFCTRANSFORMERTYPE=1692211062,IFCTRANSITIONCURVESEGMENT2D=2595432518,IFCTRANSPORTELEMENT=1620046519,IFCTRANSPORTELEMENTTYPE=2097647324,IFCTRAPEZIUMPROFILEDEF=2715220739,IFCTRIANGULATEDFACESET=2916149573,IFCTRIANGULATEDIRREGULARNETWORK=1229763772,IFCTRIMMEDCURVE=3593883385,IFCTUBEBUNDLE=3026737570,IFCTUBEBUNDLETYPE=1600972822,IFCTYPEOBJECT=1628702193,IFCTYPEPROCESS=3736923433,IFCTYPEPRODUCT=2347495698,IFCTYPERESOURCE=3698973494,IFCUSHAPEPROFILEDEF=427810014,IFCUNITASSIGNMENT=180925521,IFCUNITARYCONTROLELEMENT=630975310,IFCUNITARYCONTROLELEMENTTYPE=3179687236,IFCUNITARYEQUIPMENT=4292641817,IFCUNITARYEQUIPMENTTYPE=1911125066,IFCVALVE=4207607924,IFCVALVETYPE=728799441,IFCVECTOR=1417489154,IFCVERTEX=2799835756,IFCVERTEXLOOP=2759199220,IFCVERTEXPOINT=1907098498,IFCVIBRATIONDAMPER=1530820697,IFCVIBRATIONDAMPERTYPE=3956297820,IFCVIBRATIONISOLATOR=2391383451,IFCVIBRATIONISOLATORTYPE=3313531582,IFCVIRTUALELEMENT=2769231204,IFCVIRTUALGRIDINTERSECTION=891718957,IFCVOIDINGFEATURE=926996030,IFCWALL=2391406946,IFCWALLELEMENTEDCASE=4156078855,IFCWALLSTANDARDCASE=3512223829,IFCWALLTYPE=1898987631,IFCWASTETERMINAL=4237592921,IFCWASTETERMINALTYPE=1133259667,IFCWINDOW=3304561284,IFCWINDOWLININGPROPERTIES=336235671,IFCWINDOWPANELPROPERTIES=512836454,IFCWINDOWSTANDARDCASE=486154966,IFCWINDOWSTYLE=1299126871,IFCWINDOWTYPE=4009809668,IFCWORKCALENDAR=4088093105,IFCWORKCONTROL=1028945134,IFCWORKPLAN=4218914973,IFCWORKSCHEDULE=3342526732,IFCWORKTIME=1236880293,IFCZSHAPEPROFILEDEF=2543172580,IFCZONE=1033361043,FromRawLineData={};FromRawLineData[IFCACTIONREQUEST]=e=>IfcActionRequest.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCACTOR]=e=>IfcActor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCACTORROLE]=e=>IfcActorRole.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCACTUATOR]=e=>IfcActuator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCACTUATORTYPE]=e=>IfcActuatorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCADDRESS]=e=>IfcAddress.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCADVANCEDBREP]=e=>IfcAdvancedBrep.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCADVANCEDBREPWITHVOIDS]=e=>IfcAdvancedBrepWithVoids.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCADVANCEDFACE]=e=>IfcAdvancedFace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTERMINAL]=e=>IfcAirTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTERMINALBOX]=e=>IfcAirTerminalBox.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTERMINALBOXTYPE]=e=>IfcAirTerminalBoxType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTERMINALTYPE]=e=>IfcAirTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTOAIRHEATRECOVERY]=e=>IfcAirToAirHeatRecovery.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAIRTOAIRHEATRECOVERYTYPE]=e=>IfcAirToAirHeatRecoveryType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALARM]=e=>IfcAlarm.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALARMTYPE]=e=>IfcAlarmType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT]=e=>IfcAlignment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DHORIZONTAL]=e=>IfcAlignment2DHorizontal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DHORIZONTALSEGMENT]=e=>IfcAlignment2DHorizontalSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DSEGMENT]=e=>IfcAlignment2DSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DVERSEGCIRCULARARC]=e=>IfcAlignment2DVerSegCircularArc.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DVERSEGLINE]=e=>IfcAlignment2DVerSegLine.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DVERSEGPARABOLICARC]=e=>IfcAlignment2DVerSegParabolicArc.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DVERTICAL]=e=>IfcAlignment2DVertical.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENT2DVERTICALSEGMENT]=e=>IfcAlignment2DVerticalSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCALIGNMENTCURVE]=e=>IfcAlignmentCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCANNOTATION]=e=>IfcAnnotation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCANNOTATIONFILLAREA]=e=>IfcAnnotationFillArea.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAPPLICATION]=e=>IfcApplication.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAPPLIEDVALUE]=e=>IfcAppliedValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAPPROVAL]=e=>IfcApproval.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAPPROVALRELATIONSHIP]=e=>IfcApprovalRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCARBITRARYCLOSEDPROFILEDEF]=e=>IfcArbitraryClosedProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCARBITRARYOPENPROFILEDEF]=e=>IfcArbitraryOpenProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCARBITRARYPROFILEDEFWITHVOIDS]=e=>IfcArbitraryProfileDefWithVoids.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCASSET]=e=>IfcAsset.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCASYMMETRICISHAPEPROFILEDEF]=e=>IfcAsymmetricIShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAUDIOVISUALAPPLIANCE]=e=>IfcAudioVisualAppliance.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAUDIOVISUALAPPLIANCETYPE]=e=>IfcAudioVisualApplianceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAXIS1PLACEMENT]=e=>IfcAxis1Placement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAXIS2PLACEMENT2D]=e=>IfcAxis2Placement2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCAXIS2PLACEMENT3D]=e=>IfcAxis2Placement3D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBSPLINECURVE]=e=>IfcBSplineCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBSPLINECURVEWITHKNOTS]=e=>IfcBSplineCurveWithKnots.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBSPLINESURFACE]=e=>IfcBSplineSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBSPLINESURFACEWITHKNOTS]=e=>IfcBSplineSurfaceWithKnots.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBEAM]=e=>IfcBeam.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBEAMSTANDARDCASE]=e=>IfcBeamStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBEAMTYPE]=e=>IfcBeamType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBEARING]=e=>IfcBearing.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBEARINGTYPE]=e=>IfcBearingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBLOBTEXTURE]=e=>IfcBlobTexture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBLOCK]=e=>IfcBlock.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOILER]=e=>IfcBoiler.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOILERTYPE]=e=>IfcBoilerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOOLEANCLIPPINGRESULT]=e=>IfcBooleanClippingResult.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOOLEANRESULT]=e=>IfcBooleanResult.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYCONDITION]=e=>IfcBoundaryCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYCURVE]=e=>IfcBoundaryCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYEDGECONDITION]=e=>IfcBoundaryEdgeCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYFACECONDITION]=e=>IfcBoundaryFaceCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYNODECONDITION]=e=>IfcBoundaryNodeCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDARYNODECONDITIONWARPING]=e=>IfcBoundaryNodeConditionWarping.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDEDCURVE]=e=>IfcBoundedCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDEDSURFACE]=e=>IfcBoundedSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOUNDINGBOX]=e=>IfcBoundingBox.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBOXEDHALFSPACE]=e=>IfcBoxedHalfSpace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBRIDGE]=e=>IfcBridge.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBRIDGEPART]=e=>IfcBridgePart.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDING]=e=>IfcBuilding.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENT]=e=>IfcBuildingElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENTPART]=e=>IfcBuildingElementPart.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENTPARTTYPE]=e=>IfcBuildingElementPartType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENTPROXY]=e=>IfcBuildingElementProxy.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENTPROXYTYPE]=e=>IfcBuildingElementProxyType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGELEMENTTYPE]=e=>IfcBuildingElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGSTOREY]=e=>IfcBuildingStorey.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBUILDINGSYSTEM]=e=>IfcBuildingSystem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBURNER]=e=>IfcBurner.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCBURNERTYPE]=e=>IfcBurnerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCSHAPEPROFILEDEF]=e=>IfcCShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLECARRIERFITTING]=e=>IfcCableCarrierFitting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLECARRIERFITTINGTYPE]=e=>IfcCableCarrierFittingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLECARRIERSEGMENT]=e=>IfcCableCarrierSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLECARRIERSEGMENTTYPE]=e=>IfcCableCarrierSegmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLEFITTING]=e=>IfcCableFitting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLEFITTINGTYPE]=e=>IfcCableFittingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLESEGMENT]=e=>IfcCableSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCABLESEGMENTTYPE]=e=>IfcCableSegmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCAISSONFOUNDATION]=e=>IfcCaissonFoundation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCAISSONFOUNDATIONTYPE]=e=>IfcCaissonFoundationType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANPOINT]=e=>IfcCartesianPoint.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANPOINTLIST]=e=>IfcCartesianPointList.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANPOINTLIST2D]=e=>IfcCartesianPointList2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANPOINTLIST3D]=e=>IfcCartesianPointList3D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR]=e=>IfcCartesianTransformationOperator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR2D]=e=>IfcCartesianTransformationOperator2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM]=e=>IfcCartesianTransformationOperator2DnonUniform.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR3D]=e=>IfcCartesianTransformationOperator3D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM]=e=>IfcCartesianTransformationOperator3DnonUniform.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCENTERLINEPROFILEDEF]=e=>IfcCenterLineProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCHILLER]=e=>IfcChiller.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCHILLERTYPE]=e=>IfcChillerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCHIMNEY]=e=>IfcChimney.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCHIMNEYTYPE]=e=>IfcChimneyType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIRCLE]=e=>IfcCircle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIRCLEHOLLOWPROFILEDEF]=e=>IfcCircleHollowProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIRCLEPROFILEDEF]=e=>IfcCircleProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIRCULARARCSEGMENT2D]=e=>IfcCircularArcSegment2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIVILELEMENT]=e=>IfcCivilElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCIVILELEMENTTYPE]=e=>IfcCivilElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCLASSIFICATION]=e=>IfcClassification.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCLASSIFICATIONREFERENCE]=e=>IfcClassificationReference.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCLOSEDSHELL]=e=>IfcClosedShell.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOIL]=e=>IfcCoil.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOILTYPE]=e=>IfcCoilType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLOURRGB]=e=>IfcColourRgb.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLOURRGBLIST]=e=>IfcColourRgbList.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLOURSPECIFICATION]=e=>IfcColourSpecification.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLUMN]=e=>IfcColumn.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLUMNSTANDARDCASE]=e=>IfcColumnStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOLUMNTYPE]=e=>IfcColumnType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMMUNICATIONSAPPLIANCE]=e=>IfcCommunicationsAppliance.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMMUNICATIONSAPPLIANCETYPE]=e=>IfcCommunicationsApplianceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPLEXPROPERTY]=e=>IfcComplexProperty.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPLEXPROPERTYTEMPLATE]=e=>IfcComplexPropertyTemplate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPOSITECURVE]=e=>IfcCompositeCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPOSITECURVEONSURFACE]=e=>IfcCompositeCurveOnSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPOSITECURVESEGMENT]=e=>IfcCompositeCurveSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPOSITEPROFILEDEF]=e=>IfcCompositeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPRESSOR]=e=>IfcCompressor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOMPRESSORTYPE]=e=>IfcCompressorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONDENSER]=e=>IfcCondenser.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONDENSERTYPE]=e=>IfcCondenserType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONIC]=e=>IfcConic.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTEDFACESET]=e=>IfcConnectedFaceSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONCURVEGEOMETRY]=e=>IfcConnectionCurveGeometry.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONGEOMETRY]=e=>IfcConnectionGeometry.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONPOINTECCENTRICITY]=e=>IfcConnectionPointEccentricity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONPOINTGEOMETRY]=e=>IfcConnectionPointGeometry.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONSURFACEGEOMETRY]=e=>IfcConnectionSurfaceGeometry.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONNECTIONVOLUMEGEOMETRY]=e=>IfcConnectionVolumeGeometry.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRAINT]=e=>IfcConstraint.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONEQUIPMENTRESOURCE]=e=>IfcConstructionEquipmentResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE]=e=>IfcConstructionEquipmentResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONMATERIALRESOURCE]=e=>IfcConstructionMaterialResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONMATERIALRESOURCETYPE]=e=>IfcConstructionMaterialResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONPRODUCTRESOURCE]=e=>IfcConstructionProductResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONPRODUCTRESOURCETYPE]=e=>IfcConstructionProductResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONRESOURCE]=e=>IfcConstructionResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONSTRUCTIONRESOURCETYPE]=e=>IfcConstructionResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONTEXT]=e=>IfcContext.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONTEXTDEPENDENTUNIT]=e=>IfcContextDependentUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONTROL]=e=>IfcControl.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONTROLLER]=e=>IfcController.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONTROLLERTYPE]=e=>IfcControllerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONVERSIONBASEDUNIT]=e=>IfcConversionBasedUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCONVERSIONBASEDUNITWITHOFFSET]=e=>IfcConversionBasedUnitWithOffset.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOOLEDBEAM]=e=>IfcCooledBeam.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOOLEDBEAMTYPE]=e=>IfcCooledBeamType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOOLINGTOWER]=e=>IfcCoolingTower.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOOLINGTOWERTYPE]=e=>IfcCoolingTowerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOORDINATEOPERATION]=e=>IfcCoordinateOperation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOORDINATEREFERENCESYSTEM]=e=>IfcCoordinateReferenceSystem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOSTITEM]=e=>IfcCostItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOSTSCHEDULE]=e=>IfcCostSchedule.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOSTVALUE]=e=>IfcCostValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOVERING]=e=>IfcCovering.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCOVERINGTYPE]=e=>IfcCoveringType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCREWRESOURCE]=e=>IfcCrewResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCREWRESOURCETYPE]=e=>IfcCrewResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCSGPRIMITIVE3D]=e=>IfcCsgPrimitive3D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCSGSOLID]=e=>IfcCsgSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURRENCYRELATIONSHIP]=e=>IfcCurrencyRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURTAINWALL]=e=>IfcCurtainWall.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURTAINWALLTYPE]=e=>IfcCurtainWallType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVE]=e=>IfcCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVEBOUNDEDPLANE]=e=>IfcCurveBoundedPlane.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVEBOUNDEDSURFACE]=e=>IfcCurveBoundedSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVESEGMENT2D]=e=>IfcCurveSegment2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVESTYLE]=e=>IfcCurveStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVESTYLEFONT]=e=>IfcCurveStyleFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVESTYLEFONTANDSCALING]=e=>IfcCurveStyleFontAndScaling.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCURVESTYLEFONTPATTERN]=e=>IfcCurveStyleFontPattern.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCCYLINDRICALSURFACE]=e=>IfcCylindricalSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDAMPER]=e=>IfcDamper.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDAMPERTYPE]=e=>IfcDamperType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDEEPFOUNDATION]=e=>IfcDeepFoundation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDEEPFOUNDATIONTYPE]=e=>IfcDeepFoundationType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDERIVEDPROFILEDEF]=e=>IfcDerivedProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDERIVEDUNIT]=e=>IfcDerivedUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDERIVEDUNITELEMENT]=e=>IfcDerivedUnitElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDIMENSIONALEXPONENTS]=e=>IfcDimensionalExponents.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDIRECTION]=e=>IfcDirection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISCRETEACCESSORY]=e=>IfcDiscreteAccessory.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISCRETEACCESSORYTYPE]=e=>IfcDiscreteAccessoryType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTANCEEXPRESSION]=e=>IfcDistanceExpression.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONCHAMBERELEMENT]=e=>IfcDistributionChamberElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONCHAMBERELEMENTTYPE]=e=>IfcDistributionChamberElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONCIRCUIT]=e=>IfcDistributionCircuit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONCONTROLELEMENT]=e=>IfcDistributionControlElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONCONTROLELEMENTTYPE]=e=>IfcDistributionControlElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONELEMENT]=e=>IfcDistributionElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONELEMENTTYPE]=e=>IfcDistributionElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONFLOWELEMENT]=e=>IfcDistributionFlowElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONFLOWELEMENTTYPE]=e=>IfcDistributionFlowElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONPORT]=e=>IfcDistributionPort.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDISTRIBUTIONSYSTEM]=e=>IfcDistributionSystem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOCUMENTINFORMATION]=e=>IfcDocumentInformation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOCUMENTINFORMATIONRELATIONSHIP]=e=>IfcDocumentInformationRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOCUMENTREFERENCE]=e=>IfcDocumentReference.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOOR]=e=>IfcDoor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOORLININGPROPERTIES]=e=>IfcDoorLiningProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOORPANELPROPERTIES]=e=>IfcDoorPanelProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOORSTANDARDCASE]=e=>IfcDoorStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOORSTYLE]=e=>IfcDoorStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDOORTYPE]=e=>IfcDoorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDRAUGHTINGPREDEFINEDCOLOUR]=e=>IfcDraughtingPreDefinedColour.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDRAUGHTINGPREDEFINEDCURVEFONT]=e=>IfcDraughtingPreDefinedCurveFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTFITTING]=e=>IfcDuctFitting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTFITTINGTYPE]=e=>IfcDuctFittingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTSEGMENT]=e=>IfcDuctSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTSEGMENTTYPE]=e=>IfcDuctSegmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTSILENCER]=e=>IfcDuctSilencer.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCDUCTSILENCERTYPE]=e=>IfcDuctSilencerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEDGE]=e=>IfcEdge.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEDGECURVE]=e=>IfcEdgeCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEDGELOOP]=e=>IfcEdgeLoop.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICAPPLIANCE]=e=>IfcElectricAppliance.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICAPPLIANCETYPE]=e=>IfcElectricApplianceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICDISTRIBUTIONBOARD]=e=>IfcElectricDistributionBoard.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICDISTRIBUTIONBOARDTYPE]=e=>IfcElectricDistributionBoardType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICFLOWSTORAGEDEVICE]=e=>IfcElectricFlowStorageDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICFLOWSTORAGEDEVICETYPE]=e=>IfcElectricFlowStorageDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICGENERATOR]=e=>IfcElectricGenerator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICGENERATORTYPE]=e=>IfcElectricGeneratorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICMOTOR]=e=>IfcElectricMotor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICMOTORTYPE]=e=>IfcElectricMotorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICTIMECONTROL]=e=>IfcElectricTimeControl.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELECTRICTIMECONTROLTYPE]=e=>IfcElectricTimeControlType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENT]=e=>IfcElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTASSEMBLY]=e=>IfcElementAssembly.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTASSEMBLYTYPE]=e=>IfcElementAssemblyType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTCOMPONENT]=e=>IfcElementComponent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTCOMPONENTTYPE]=e=>IfcElementComponentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTQUANTITY]=e=>IfcElementQuantity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTTYPE]=e=>IfcElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELEMENTARYSURFACE]=e=>IfcElementarySurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELLIPSE]=e=>IfcEllipse.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCELLIPSEPROFILEDEF]=e=>IfcEllipseProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCENERGYCONVERSIONDEVICE]=e=>IfcEnergyConversionDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCENERGYCONVERSIONDEVICETYPE]=e=>IfcEnergyConversionDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCENGINE]=e=>IfcEngine.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCENGINETYPE]=e=>IfcEngineType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVAPORATIVECOOLER]=e=>IfcEvaporativeCooler.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVAPORATIVECOOLERTYPE]=e=>IfcEvaporativeCoolerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVAPORATOR]=e=>IfcEvaporator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVAPORATORTYPE]=e=>IfcEvaporatorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVENT]=e=>IfcEvent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVENTTIME]=e=>IfcEventTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEVENTTYPE]=e=>IfcEventType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTENDEDPROPERTIES]=e=>IfcExtendedProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALINFORMATION]=e=>IfcExternalInformation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALREFERENCE]=e=>IfcExternalReference.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALREFERENCERELATIONSHIP]=e=>IfcExternalReferenceRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALSPATIALELEMENT]=e=>IfcExternalSpatialElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALSPATIALSTRUCTUREELEMENT]=e=>IfcExternalSpatialStructureElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALLYDEFINEDHATCHSTYLE]=e=>IfcExternallyDefinedHatchStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALLYDEFINEDSURFACESTYLE]=e=>IfcExternallyDefinedSurfaceStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTERNALLYDEFINEDTEXTFONT]=e=>IfcExternallyDefinedTextFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTRUDEDAREASOLID]=e=>IfcExtrudedAreaSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCEXTRUDEDAREASOLIDTAPERED]=e=>IfcExtrudedAreaSolidTapered.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACE]=e=>IfcFace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACEBASEDSURFACEMODEL]=e=>IfcFaceBasedSurfaceModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACEBOUND]=e=>IfcFaceBound.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACEOUTERBOUND]=e=>IfcFaceOuterBound.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACESURFACE]=e=>IfcFaceSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACETEDBREP]=e=>IfcFacetedBrep.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACETEDBREPWITHVOIDS]=e=>IfcFacetedBrepWithVoids.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACILITY]=e=>IfcFacility.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFACILITYPART]=e=>IfcFacilityPart.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFAILURECONNECTIONCONDITION]=e=>IfcFailureConnectionCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFAN]=e=>IfcFan.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFANTYPE]=e=>IfcFanType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFASTENER]=e=>IfcFastener.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFASTENERTYPE]=e=>IfcFastenerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFEATUREELEMENT]=e=>IfcFeatureElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFEATUREELEMENTADDITION]=e=>IfcFeatureElementAddition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFEATUREELEMENTSUBTRACTION]=e=>IfcFeatureElementSubtraction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFILLAREASTYLE]=e=>IfcFillAreaStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFILLAREASTYLEHATCHING]=e=>IfcFillAreaStyleHatching.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFILLAREASTYLETILES]=e=>IfcFillAreaStyleTiles.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFILTER]=e=>IfcFilter.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFILTERTYPE]=e=>IfcFilterType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFIRESUPPRESSIONTERMINAL]=e=>IfcFireSuppressionTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFIRESUPPRESSIONTERMINALTYPE]=e=>IfcFireSuppressionTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFIXEDREFERENCESWEPTAREASOLID]=e=>IfcFixedReferenceSweptAreaSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWCONTROLLER]=e=>IfcFlowController.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWCONTROLLERTYPE]=e=>IfcFlowControllerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWFITTING]=e=>IfcFlowFitting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWFITTINGTYPE]=e=>IfcFlowFittingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWINSTRUMENT]=e=>IfcFlowInstrument.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWINSTRUMENTTYPE]=e=>IfcFlowInstrumentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWMETER]=e=>IfcFlowMeter.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWMETERTYPE]=e=>IfcFlowMeterType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWMOVINGDEVICE]=e=>IfcFlowMovingDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWMOVINGDEVICETYPE]=e=>IfcFlowMovingDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWSEGMENT]=e=>IfcFlowSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWSEGMENTTYPE]=e=>IfcFlowSegmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWSTORAGEDEVICE]=e=>IfcFlowStorageDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWSTORAGEDEVICETYPE]=e=>IfcFlowStorageDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWTERMINAL]=e=>IfcFlowTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWTERMINALTYPE]=e=>IfcFlowTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWTREATMENTDEVICE]=e=>IfcFlowTreatmentDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFLOWTREATMENTDEVICETYPE]=e=>IfcFlowTreatmentDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFOOTING]=e=>IfcFooting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFOOTINGTYPE]=e=>IfcFootingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFURNISHINGELEMENT]=e=>IfcFurnishingElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFURNISHINGELEMENTTYPE]=e=>IfcFurnishingElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFURNITURE]=e=>IfcFurniture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCFURNITURETYPE]=e=>IfcFurnitureType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOGRAPHICELEMENT]=e=>IfcGeographicElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOGRAPHICELEMENTTYPE]=e=>IfcGeographicElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOMETRICCURVESET]=e=>IfcGeometricCurveSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOMETRICREPRESENTATIONCONTEXT]=e=>IfcGeometricRepresentationContext.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOMETRICREPRESENTATIONITEM]=e=>IfcGeometricRepresentationItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOMETRICREPRESENTATIONSUBCONTEXT]=e=>IfcGeometricRepresentationSubContext.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGEOMETRICSET]=e=>IfcGeometricSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGRID]=e=>IfcGrid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGRIDAXIS]=e=>IfcGridAxis.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGRIDPLACEMENT]=e=>IfcGridPlacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCGROUP]=e=>IfcGroup.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCHALFSPACESOLID]=e=>IfcHalfSpaceSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCHEATEXCHANGER]=e=>IfcHeatExchanger.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCHEATEXCHANGERTYPE]=e=>IfcHeatExchangerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCHUMIDIFIER]=e=>IfcHumidifier.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCHUMIDIFIERTYPE]=e=>IfcHumidifierType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCISHAPEPROFILEDEF]=e=>IfcIShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCIMAGETEXTURE]=e=>IfcImageTexture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDCOLOURMAP]=e=>IfcIndexedColourMap.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDPOLYCURVE]=e=>IfcIndexedPolyCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDPOLYGONALFACE]=e=>IfcIndexedPolygonalFace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDPOLYGONALFACEWITHVOIDS]=e=>IfcIndexedPolygonalFaceWithVoids.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDTEXTUREMAP]=e=>IfcIndexedTextureMap.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINDEXEDTRIANGLETEXTUREMAP]=e=>IfcIndexedTriangleTextureMap.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINTERCEPTOR]=e=>IfcInterceptor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINTERCEPTORTYPE]=e=>IfcInterceptorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINTERSECTIONCURVE]=e=>IfcIntersectionCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCINVENTORY]=e=>IfcInventory.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCIRREGULARTIMESERIES]=e=>IfcIrregularTimeSeries.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCIRREGULARTIMESERIESVALUE]=e=>IfcIrregularTimeSeriesValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCJUNCTIONBOX]=e=>IfcJunctionBox.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCJUNCTIONBOXTYPE]=e=>IfcJunctionBoxType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLSHAPEPROFILEDEF]=e=>IfcLShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLABORRESOURCE]=e=>IfcLaborResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLABORRESOURCETYPE]=e=>IfcLaborResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLAGTIME]=e=>IfcLagTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLAMP]=e=>IfcLamp.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLAMPTYPE]=e=>IfcLampType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIBRARYINFORMATION]=e=>IfcLibraryInformation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIBRARYREFERENCE]=e=>IfcLibraryReference.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTDISTRIBUTIONDATA]=e=>IfcLightDistributionData.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTFIXTURE]=e=>IfcLightFixture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTFIXTURETYPE]=e=>IfcLightFixtureType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTINTENSITYDISTRIBUTION]=e=>IfcLightIntensityDistribution.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCE]=e=>IfcLightSource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCEAMBIENT]=e=>IfcLightSourceAmbient.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCEDIRECTIONAL]=e=>IfcLightSourceDirectional.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCEGONIOMETRIC]=e=>IfcLightSourceGoniometric.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCEPOSITIONAL]=e=>IfcLightSourcePositional.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLIGHTSOURCESPOT]=e=>IfcLightSourceSpot.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLINE]=e=>IfcLine.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLINESEGMENT2D]=e=>IfcLineSegment2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLINEARPLACEMENT]=e=>IfcLinearPlacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLINEARPOSITIONINGELEMENT]=e=>IfcLinearPositioningElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLOCALPLACEMENT]=e=>IfcLocalPlacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCLOOP]=e=>IfcLoop.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMANIFOLDSOLIDBREP]=e=>IfcManifoldSolidBrep.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMAPCONVERSION]=e=>IfcMapConversion.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMAPPEDITEM]=e=>IfcMappedItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIAL]=e=>IfcMaterial.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALCLASSIFICATIONRELATIONSHIP]=e=>IfcMaterialClassificationRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALCONSTITUENT]=e=>IfcMaterialConstituent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALCONSTITUENTSET]=e=>IfcMaterialConstituentSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALDEFINITION]=e=>IfcMaterialDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALDEFINITIONREPRESENTATION]=e=>IfcMaterialDefinitionRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALLAYER]=e=>IfcMaterialLayer.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALLAYERSET]=e=>IfcMaterialLayerSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALLAYERSETUSAGE]=e=>IfcMaterialLayerSetUsage.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALLAYERWITHOFFSETS]=e=>IfcMaterialLayerWithOffsets.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALLIST]=e=>IfcMaterialList.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROFILE]=e=>IfcMaterialProfile.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROFILESET]=e=>IfcMaterialProfileSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROFILESETUSAGE]=e=>IfcMaterialProfileSetUsage.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROFILESETUSAGETAPERING]=e=>IfcMaterialProfileSetUsageTapering.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROFILEWITHOFFSETS]=e=>IfcMaterialProfileWithOffsets.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALPROPERTIES]=e=>IfcMaterialProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALRELATIONSHIP]=e=>IfcMaterialRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMATERIALUSAGEDEFINITION]=e=>IfcMaterialUsageDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEASUREWITHUNIT]=e=>IfcMeasureWithUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMECHANICALFASTENER]=e=>IfcMechanicalFastener.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMECHANICALFASTENERTYPE]=e=>IfcMechanicalFastenerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEDICALDEVICE]=e=>IfcMedicalDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEDICALDEVICETYPE]=e=>IfcMedicalDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEMBER]=e=>IfcMember.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEMBERSTANDARDCASE]=e=>IfcMemberStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMEMBERTYPE]=e=>IfcMemberType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMETRIC]=e=>IfcMetric.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMIRROREDPROFILEDEF]=e=>IfcMirroredProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMONETARYUNIT]=e=>IfcMonetaryUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMOTORCONNECTION]=e=>IfcMotorConnection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCMOTORCONNECTIONTYPE]=e=>IfcMotorConnectionType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCNAMEDUNIT]=e=>IfcNamedUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOBJECT]=e=>IfcObject.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOBJECTDEFINITION]=e=>IfcObjectDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOBJECTPLACEMENT]=e=>IfcObjectPlacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOBJECTIVE]=e=>IfcObjective.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOCCUPANT]=e=>IfcOccupant.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOFFSETCURVE]=e=>IfcOffsetCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOFFSETCURVE2D]=e=>IfcOffsetCurve2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOFFSETCURVE3D]=e=>IfcOffsetCurve3D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOFFSETCURVEBYDISTANCES]=e=>IfcOffsetCurveByDistances.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOPENSHELL]=e=>IfcOpenShell.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOPENINGELEMENT]=e=>IfcOpeningElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOPENINGSTANDARDCASE]=e=>IfcOpeningStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCORGANIZATION]=e=>IfcOrganization.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCORGANIZATIONRELATIONSHIP]=e=>IfcOrganizationRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCORIENTATIONEXPRESSION]=e=>IfcOrientationExpression.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCORIENTEDEDGE]=e=>IfcOrientedEdge.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOUTERBOUNDARYCURVE]=e=>IfcOuterBoundaryCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOUTLET]=e=>IfcOutlet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOUTLETTYPE]=e=>IfcOutletType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCOWNERHISTORY]=e=>IfcOwnerHistory.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPARAMETERIZEDPROFILEDEF]=e=>IfcParameterizedProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPATH]=e=>IfcPath.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPCURVE]=e=>IfcPcurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPERFORMANCEHISTORY]=e=>IfcPerformanceHistory.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPERMEABLECOVERINGPROPERTIES]=e=>IfcPermeableCoveringProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPERMIT]=e=>IfcPermit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPERSON]=e=>IfcPerson.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPERSONANDORGANIZATION]=e=>IfcPersonAndOrganization.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPHYSICALCOMPLEXQUANTITY]=e=>IfcPhysicalComplexQuantity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPHYSICALQUANTITY]=e=>IfcPhysicalQuantity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPHYSICALSIMPLEQUANTITY]=e=>IfcPhysicalSimpleQuantity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPILE]=e=>IfcPile.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPILETYPE]=e=>IfcPileType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPIPEFITTING]=e=>IfcPipeFitting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPIPEFITTINGTYPE]=e=>IfcPipeFittingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPIPESEGMENT]=e=>IfcPipeSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPIPESEGMENTTYPE]=e=>IfcPipeSegmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPIXELTEXTURE]=e=>IfcPixelTexture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLACEMENT]=e=>IfcPlacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLANARBOX]=e=>IfcPlanarBox.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLANAREXTENT]=e=>IfcPlanarExtent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLANE]=e=>IfcPlane.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLATE]=e=>IfcPlate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLATESTANDARDCASE]=e=>IfcPlateStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPLATETYPE]=e=>IfcPlateType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOINT]=e=>IfcPoint.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOINTONCURVE]=e=>IfcPointOnCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOINTONSURFACE]=e=>IfcPointOnSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOLYLOOP]=e=>IfcPolyLoop.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOLYGONALBOUNDEDHALFSPACE]=e=>IfcPolygonalBoundedHalfSpace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOLYGONALFACESET]=e=>IfcPolygonalFaceSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOLYLINE]=e=>IfcPolyline.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPORT]=e=>IfcPort.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOSITIONINGELEMENT]=e=>IfcPositioningElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPOSTALADDRESS]=e=>IfcPostalAddress.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDCOLOUR]=e=>IfcPreDefinedColour.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDCURVEFONT]=e=>IfcPreDefinedCurveFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDITEM]=e=>IfcPreDefinedItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDPROPERTIES]=e=>IfcPreDefinedProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDPROPERTYSET]=e=>IfcPreDefinedPropertySet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPREDEFINEDTEXTFONT]=e=>IfcPreDefinedTextFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRESENTATIONITEM]=e=>IfcPresentationItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRESENTATIONLAYERASSIGNMENT]=e=>IfcPresentationLayerAssignment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRESENTATIONLAYERWITHSTYLE]=e=>IfcPresentationLayerWithStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRESENTATIONSTYLE]=e=>IfcPresentationStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRESENTATIONSTYLEASSIGNMENT]=e=>IfcPresentationStyleAssignment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROCEDURE]=e=>IfcProcedure.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROCEDURETYPE]=e=>IfcProcedureType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROCESS]=e=>IfcProcess.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRODUCT]=e=>IfcProduct.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRODUCTDEFINITIONSHAPE]=e=>IfcProductDefinitionShape.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPRODUCTREPRESENTATION]=e=>IfcProductRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROFILEDEF]=e=>IfcProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROFILEPROPERTIES]=e=>IfcProfileProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROJECT]=e=>IfcProject.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROJECTLIBRARY]=e=>IfcProjectLibrary.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROJECTORDER]=e=>IfcProjectOrder.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROJECTEDCRS]=e=>IfcProjectedCRS.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROJECTIONELEMENT]=e=>IfcProjectionElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTY]=e=>IfcProperty.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYABSTRACTION]=e=>IfcPropertyAbstraction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYBOUNDEDVALUE]=e=>IfcPropertyBoundedValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYDEFINITION]=e=>IfcPropertyDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYDEPENDENCYRELATIONSHIP]=e=>IfcPropertyDependencyRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYENUMERATEDVALUE]=e=>IfcPropertyEnumeratedValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYENUMERATION]=e=>IfcPropertyEnumeration.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYLISTVALUE]=e=>IfcPropertyListValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYREFERENCEVALUE]=e=>IfcPropertyReferenceValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYSET]=e=>IfcPropertySet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYSETDEFINITION]=e=>IfcPropertySetDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYSETTEMPLATE]=e=>IfcPropertySetTemplate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYSINGLEVALUE]=e=>IfcPropertySingleValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYTABLEVALUE]=e=>IfcPropertyTableValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYTEMPLATE]=e=>IfcPropertyTemplate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROPERTYTEMPLATEDEFINITION]=e=>IfcPropertyTemplateDefinition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROTECTIVEDEVICE]=e=>IfcProtectiveDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROTECTIVEDEVICETRIPPINGUNIT]=e=>IfcProtectiveDeviceTrippingUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROTECTIVEDEVICETRIPPINGUNITTYPE]=e=>IfcProtectiveDeviceTrippingUnitType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROTECTIVEDEVICETYPE]=e=>IfcProtectiveDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPROXY]=e=>IfcProxy.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPUMP]=e=>IfcPump.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCPUMPTYPE]=e=>IfcPumpType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYAREA]=e=>IfcQuantityArea.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYCOUNT]=e=>IfcQuantityCount.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYLENGTH]=e=>IfcQuantityLength.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYSET]=e=>IfcQuantitySet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYTIME]=e=>IfcQuantityTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYVOLUME]=e=>IfcQuantityVolume.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCQUANTITYWEIGHT]=e=>IfcQuantityWeight.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAILING]=e=>IfcRailing.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAILINGTYPE]=e=>IfcRailingType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAMP]=e=>IfcRamp.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAMPFLIGHT]=e=>IfcRampFlight.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAMPFLIGHTTYPE]=e=>IfcRampFlightType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRAMPTYPE]=e=>IfcRampType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRATIONALBSPLINECURVEWITHKNOTS]=e=>IfcRationalBSplineCurveWithKnots.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRATIONALBSPLINESURFACEWITHKNOTS]=e=>IfcRationalBSplineSurfaceWithKnots.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRECTANGLEHOLLOWPROFILEDEF]=e=>IfcRectangleHollowProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRECTANGLEPROFILEDEF]=e=>IfcRectangleProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRECTANGULARPYRAMID]=e=>IfcRectangularPyramid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRECTANGULARTRIMMEDSURFACE]=e=>IfcRectangularTrimmedSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRECURRENCEPATTERN]=e=>IfcRecurrencePattern.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREFERENCE]=e=>IfcReference.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREFERENT]=e=>IfcReferent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREGULARTIMESERIES]=e=>IfcRegularTimeSeries.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCEMENTBARPROPERTIES]=e=>IfcReinforcementBarProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCEMENTDEFINITIONPROPERTIES]=e=>IfcReinforcementDefinitionProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGBAR]=e=>IfcReinforcingBar.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGBARTYPE]=e=>IfcReinforcingBarType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGELEMENT]=e=>IfcReinforcingElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGELEMENTTYPE]=e=>IfcReinforcingElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGMESH]=e=>IfcReinforcingMesh.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREINFORCINGMESHTYPE]=e=>IfcReinforcingMeshType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELAGGREGATES]=e=>IfcRelAggregates.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNS]=e=>IfcRelAssigns.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOACTOR]=e=>IfcRelAssignsToActor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOCONTROL]=e=>IfcRelAssignsToControl.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOGROUP]=e=>IfcRelAssignsToGroup.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOGROUPBYFACTOR]=e=>IfcRelAssignsToGroupByFactor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOPROCESS]=e=>IfcRelAssignsToProcess.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTOPRODUCT]=e=>IfcRelAssignsToProduct.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSIGNSTORESOURCE]=e=>IfcRelAssignsToResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATES]=e=>IfcRelAssociates.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESAPPROVAL]=e=>IfcRelAssociatesApproval.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESCLASSIFICATION]=e=>IfcRelAssociatesClassification.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESCONSTRAINT]=e=>IfcRelAssociatesConstraint.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESDOCUMENT]=e=>IfcRelAssociatesDocument.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESLIBRARY]=e=>IfcRelAssociatesLibrary.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELASSOCIATESMATERIAL]=e=>IfcRelAssociatesMaterial.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTS]=e=>IfcRelConnects.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSELEMENTS]=e=>IfcRelConnectsElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSPATHELEMENTS]=e=>IfcRelConnectsPathElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSPORTTOELEMENT]=e=>IfcRelConnectsPortToElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSPORTS]=e=>IfcRelConnectsPorts.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSSTRUCTURALACTIVITY]=e=>IfcRelConnectsStructuralActivity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSSTRUCTURALMEMBER]=e=>IfcRelConnectsStructuralMember.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSWITHECCENTRICITY]=e=>IfcRelConnectsWithEccentricity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONNECTSWITHREALIZINGELEMENTS]=e=>IfcRelConnectsWithRealizingElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCONTAINEDINSPATIALSTRUCTURE]=e=>IfcRelContainedInSpatialStructure.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCOVERSBLDGELEMENTS]=e=>IfcRelCoversBldgElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELCOVERSSPACES]=e=>IfcRelCoversSpaces.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDECLARES]=e=>IfcRelDeclares.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDECOMPOSES]=e=>IfcRelDecomposes.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDEFINES]=e=>IfcRelDefines.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDEFINESBYOBJECT]=e=>IfcRelDefinesByObject.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDEFINESBYPROPERTIES]=e=>IfcRelDefinesByProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDEFINESBYTEMPLATE]=e=>IfcRelDefinesByTemplate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELDEFINESBYTYPE]=e=>IfcRelDefinesByType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELFILLSELEMENT]=e=>IfcRelFillsElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELFLOWCONTROLELEMENTS]=e=>IfcRelFlowControlElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELINTERFERESELEMENTS]=e=>IfcRelInterferesElements.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELNESTS]=e=>IfcRelNests.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELPOSITIONS]=e=>IfcRelPositions.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELPROJECTSELEMENT]=e=>IfcRelProjectsElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELREFERENCEDINSPATIALSTRUCTURE]=e=>IfcRelReferencedInSpatialStructure.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELSEQUENCE]=e=>IfcRelSequence.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELSERVICESBUILDINGS]=e=>IfcRelServicesBuildings.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELSPACEBOUNDARY]=e=>IfcRelSpaceBoundary.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELSPACEBOUNDARY1STLEVEL]=e=>IfcRelSpaceBoundary1stLevel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELSPACEBOUNDARY2NDLEVEL]=e=>IfcRelSpaceBoundary2ndLevel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELVOIDSELEMENT]=e=>IfcRelVoidsElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRELATIONSHIP]=e=>IfcRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREPARAMETRISEDCOMPOSITECURVESEGMENT]=e=>IfcReparametrisedCompositeCurveSegment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREPRESENTATION]=e=>IfcRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREPRESENTATIONCONTEXT]=e=>IfcRepresentationContext.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREPRESENTATIONITEM]=e=>IfcRepresentationItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREPRESENTATIONMAP]=e=>IfcRepresentationMap.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRESOURCE]=e=>IfcResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRESOURCEAPPROVALRELATIONSHIP]=e=>IfcResourceApprovalRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRESOURCECONSTRAINTRELATIONSHIP]=e=>IfcResourceConstraintRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRESOURCELEVELRELATIONSHIP]=e=>IfcResourceLevelRelationship.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRESOURCETIME]=e=>IfcResourceTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREVOLVEDAREASOLID]=e=>IfcRevolvedAreaSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCREVOLVEDAREASOLIDTAPERED]=e=>IfcRevolvedAreaSolidTapered.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRIGHTCIRCULARCONE]=e=>IfcRightCircularCone.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCRIGHTCIRCULARCYLINDER]=e=>IfcRightCircularCylinder.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCROOF]=e=>IfcRoof.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCROOFTYPE]=e=>IfcRoofType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCROOT]=e=>IfcRoot.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCROUNDEDRECTANGLEPROFILEDEF]=e=>IfcRoundedRectangleProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSIUNIT]=e=>IfcSIUnit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSANITARYTERMINAL]=e=>IfcSanitaryTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSANITARYTERMINALTYPE]=e=>IfcSanitaryTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSCHEDULINGTIME]=e=>IfcSchedulingTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSEAMCURVE]=e=>IfcSeamCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSECTIONPROPERTIES]=e=>IfcSectionProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSECTIONREINFORCEMENTPROPERTIES]=e=>IfcSectionReinforcementProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSECTIONEDSOLID]=e=>IfcSectionedSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSECTIONEDSOLIDHORIZONTAL]=e=>IfcSectionedSolidHorizontal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSECTIONEDSPINE]=e=>IfcSectionedSpine.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSENSOR]=e=>IfcSensor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSENSORTYPE]=e=>IfcSensorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHADINGDEVICE]=e=>IfcShadingDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHADINGDEVICETYPE]=e=>IfcShadingDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHAPEASPECT]=e=>IfcShapeAspect.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHAPEMODEL]=e=>IfcShapeModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHAPEREPRESENTATION]=e=>IfcShapeRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSHELLBASEDSURFACEMODEL]=e=>IfcShellBasedSurfaceModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSIMPLEPROPERTY]=e=>IfcSimpleProperty.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSIMPLEPROPERTYTEMPLATE]=e=>IfcSimplePropertyTemplate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSITE]=e=>IfcSite.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSLAB]=e=>IfcSlab.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSLABELEMENTEDCASE]=e=>IfcSlabElementedCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSLABSTANDARDCASE]=e=>IfcSlabStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSLABTYPE]=e=>IfcSlabType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSLIPPAGECONNECTIONCONDITION]=e=>IfcSlippageConnectionCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSOLARDEVICE]=e=>IfcSolarDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSOLARDEVICETYPE]=e=>IfcSolarDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSOLIDMODEL]=e=>IfcSolidModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPACE]=e=>IfcSpace.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPACEHEATER]=e=>IfcSpaceHeater.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPACEHEATERTYPE]=e=>IfcSpaceHeaterType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPACETYPE]=e=>IfcSpaceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALELEMENT]=e=>IfcSpatialElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALELEMENTTYPE]=e=>IfcSpatialElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALSTRUCTUREELEMENT]=e=>IfcSpatialStructureElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALSTRUCTUREELEMENTTYPE]=e=>IfcSpatialStructureElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALZONE]=e=>IfcSpatialZone.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPATIALZONETYPE]=e=>IfcSpatialZoneType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPHERE]=e=>IfcSphere.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSPHERICALSURFACE]=e=>IfcSphericalSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTACKTERMINAL]=e=>IfcStackTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTACKTERMINALTYPE]=e=>IfcStackTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTAIR]=e=>IfcStair.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTAIRFLIGHT]=e=>IfcStairFlight.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTAIRFLIGHTTYPE]=e=>IfcStairFlightType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTAIRTYPE]=e=>IfcStairType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALACTION]=e=>IfcStructuralAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALACTIVITY]=e=>IfcStructuralActivity.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALANALYSISMODEL]=e=>IfcStructuralAnalysisModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCONNECTION]=e=>IfcStructuralConnection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCONNECTIONCONDITION]=e=>IfcStructuralConnectionCondition.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCURVEACTION]=e=>IfcStructuralCurveAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCURVECONNECTION]=e=>IfcStructuralCurveConnection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCURVEMEMBER]=e=>IfcStructuralCurveMember.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCURVEMEMBERVARYING]=e=>IfcStructuralCurveMemberVarying.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALCURVEREACTION]=e=>IfcStructuralCurveReaction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALITEM]=e=>IfcStructuralItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLINEARACTION]=e=>IfcStructuralLinearAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOAD]=e=>IfcStructuralLoad.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADCASE]=e=>IfcStructuralLoadCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADCONFIGURATION]=e=>IfcStructuralLoadConfiguration.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADGROUP]=e=>IfcStructuralLoadGroup.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADLINEARFORCE]=e=>IfcStructuralLoadLinearForce.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADORRESULT]=e=>IfcStructuralLoadOrResult.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADPLANARFORCE]=e=>IfcStructuralLoadPlanarForce.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADSINGLEDISPLACEMENT]=e=>IfcStructuralLoadSingleDisplacement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION]=e=>IfcStructuralLoadSingleDisplacementDistortion.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADSINGLEFORCE]=e=>IfcStructuralLoadSingleForce.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADSINGLEFORCEWARPING]=e=>IfcStructuralLoadSingleForceWarping.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADSTATIC]=e=>IfcStructuralLoadStatic.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALLOADTEMPERATURE]=e=>IfcStructuralLoadTemperature.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALMEMBER]=e=>IfcStructuralMember.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALPLANARACTION]=e=>IfcStructuralPlanarAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALPOINTACTION]=e=>IfcStructuralPointAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALPOINTCONNECTION]=e=>IfcStructuralPointConnection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALPOINTREACTION]=e=>IfcStructuralPointReaction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALREACTION]=e=>IfcStructuralReaction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALRESULTGROUP]=e=>IfcStructuralResultGroup.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALSURFACEACTION]=e=>IfcStructuralSurfaceAction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALSURFACECONNECTION]=e=>IfcStructuralSurfaceConnection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALSURFACEMEMBER]=e=>IfcStructuralSurfaceMember.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALSURFACEMEMBERVARYING]=e=>IfcStructuralSurfaceMemberVarying.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTRUCTURALSURFACEREACTION]=e=>IfcStructuralSurfaceReaction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTYLEMODEL]=e=>IfcStyleModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTYLEDITEM]=e=>IfcStyledItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSTYLEDREPRESENTATION]=e=>IfcStyledRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSUBCONTRACTRESOURCE]=e=>IfcSubContractResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSUBCONTRACTRESOURCETYPE]=e=>IfcSubContractResourceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSUBEDGE]=e=>IfcSubedge.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACE]=e=>IfcSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACECURVE]=e=>IfcSurfaceCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACECURVESWEPTAREASOLID]=e=>IfcSurfaceCurveSweptAreaSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACEFEATURE]=e=>IfcSurfaceFeature.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACEOFLINEAREXTRUSION]=e=>IfcSurfaceOfLinearExtrusion.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACEOFREVOLUTION]=e=>IfcSurfaceOfRevolution.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACEREINFORCEMENTAREA]=e=>IfcSurfaceReinforcementArea.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLE]=e=>IfcSurfaceStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLELIGHTING]=e=>IfcSurfaceStyleLighting.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLEREFRACTION]=e=>IfcSurfaceStyleRefraction.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLERENDERING]=e=>IfcSurfaceStyleRendering.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLESHADING]=e=>IfcSurfaceStyleShading.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACESTYLEWITHTEXTURES]=e=>IfcSurfaceStyleWithTextures.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSURFACETEXTURE]=e=>IfcSurfaceTexture.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWEPTAREASOLID]=e=>IfcSweptAreaSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWEPTDISKSOLID]=e=>IfcSweptDiskSolid.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWEPTDISKSOLIDPOLYGONAL]=e=>IfcSweptDiskSolidPolygonal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWEPTSURFACE]=e=>IfcSweptSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWITCHINGDEVICE]=e=>IfcSwitchingDevice.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSWITCHINGDEVICETYPE]=e=>IfcSwitchingDeviceType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSYSTEM]=e=>IfcSystem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSYSTEMFURNITUREELEMENT]=e=>IfcSystemFurnitureElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCSYSTEMFURNITUREELEMENTTYPE]=e=>IfcSystemFurnitureElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTSHAPEPROFILEDEF]=e=>IfcTShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTABLE]=e=>IfcTable.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTABLECOLUMN]=e=>IfcTableColumn.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTABLEROW]=e=>IfcTableRow.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTANK]=e=>IfcTank.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTANKTYPE]=e=>IfcTankType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTASK]=e=>IfcTask.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTASKTIME]=e=>IfcTaskTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTASKTIMERECURRING]=e=>IfcTaskTimeRecurring.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTASKTYPE]=e=>IfcTaskType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTELECOMADDRESS]=e=>IfcTelecomAddress.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDON]=e=>IfcTendon.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDONANCHOR]=e=>IfcTendonAnchor.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDONANCHORTYPE]=e=>IfcTendonAnchorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDONCONDUIT]=e=>IfcTendonConduit.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDONCONDUITTYPE]=e=>IfcTendonConduitType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTENDONTYPE]=e=>IfcTendonType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTESSELLATEDFACESET]=e=>IfcTessellatedFaceSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTESSELLATEDITEM]=e=>IfcTessellatedItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTLITERAL]=e=>IfcTextLiteral.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTLITERALWITHEXTENT]=e=>IfcTextLiteralWithExtent.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTSTYLE]=e=>IfcTextStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTSTYLEFONTMODEL]=e=>IfcTextStyleFontModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTSTYLEFORDEFINEDFONT]=e=>IfcTextStyleForDefinedFont.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTSTYLETEXTMODEL]=e=>IfcTextStyleTextModel.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTURECOORDINATE]=e=>IfcTextureCoordinate.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTURECOORDINATEGENERATOR]=e=>IfcTextureCoordinateGenerator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTUREMAP]=e=>IfcTextureMap.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTUREVERTEX]=e=>IfcTextureVertex.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTEXTUREVERTEXLIST]=e=>IfcTextureVertexList.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTIMEPERIOD]=e=>IfcTimePeriod.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTIMESERIES]=e=>IfcTimeSeries.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTIMESERIESVALUE]=e=>IfcTimeSeriesValue.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTOPOLOGICALREPRESENTATIONITEM]=e=>IfcTopologicalRepresentationItem.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTOPOLOGYREPRESENTATION]=e=>IfcTopologyRepresentation.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTOROIDALSURFACE]=e=>IfcToroidalSurface.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRANSFORMER]=e=>IfcTransformer.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRANSFORMERTYPE]=e=>IfcTransformerType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRANSITIONCURVESEGMENT2D]=e=>IfcTransitionCurveSegment2D.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRANSPORTELEMENT]=e=>IfcTransportElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRANSPORTELEMENTTYPE]=e=>IfcTransportElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRAPEZIUMPROFILEDEF]=e=>IfcTrapeziumProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRIANGULATEDFACESET]=e=>IfcTriangulatedFaceSet.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRIANGULATEDIRREGULARNETWORK]=e=>IfcTriangulatedIrregularNetwork.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTRIMMEDCURVE]=e=>IfcTrimmedCurve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTUBEBUNDLE]=e=>IfcTubeBundle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTUBEBUNDLETYPE]=e=>IfcTubeBundleType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTYPEOBJECT]=e=>IfcTypeObject.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTYPEPROCESS]=e=>IfcTypeProcess.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTYPEPRODUCT]=e=>IfcTypeProduct.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCTYPERESOURCE]=e=>IfcTypeResource.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUSHAPEPROFILEDEF]=e=>IfcUShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUNITASSIGNMENT]=e=>IfcUnitAssignment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUNITARYCONTROLELEMENT]=e=>IfcUnitaryControlElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUNITARYCONTROLELEMENTTYPE]=e=>IfcUnitaryControlElementType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUNITARYEQUIPMENT]=e=>IfcUnitaryEquipment.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCUNITARYEQUIPMENTTYPE]=e=>IfcUnitaryEquipmentType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVALVE]=e=>IfcValve.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVALVETYPE]=e=>IfcValveType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVECTOR]=e=>IfcVector.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVERTEX]=e=>IfcVertex.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVERTEXLOOP]=e=>IfcVertexLoop.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVERTEXPOINT]=e=>IfcVertexPoint.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIBRATIONDAMPER]=e=>IfcVibrationDamper.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIBRATIONDAMPERTYPE]=e=>IfcVibrationDamperType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIBRATIONISOLATOR]=e=>IfcVibrationIsolator.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIBRATIONISOLATORTYPE]=e=>IfcVibrationIsolatorType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIRTUALELEMENT]=e=>IfcVirtualElement.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVIRTUALGRIDINTERSECTION]=e=>IfcVirtualGridIntersection.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCVOIDINGFEATURE]=e=>IfcVoidingFeature.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWALL]=e=>IfcWall.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWALLELEMENTEDCASE]=e=>IfcWallElementedCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWALLSTANDARDCASE]=e=>IfcWallStandardCase.FromTape(e.ID,e.type,e.arguments);FromRawLineData[IFCWALLTYPE]=e=>IfcWallType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWASTETERMINAL]=e=>IfcWasteTerminal.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWASTETERMINALTYPE]=e=>IfcWasteTerminalType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOW]=e=>IfcWindow.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOWLININGPROPERTIES]=e=>IfcWindowLiningProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOWPANELPROPERTIES]=e=>IfcWindowPanelProperties.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOWSTANDARDCASE]=e=>IfcWindowStandardCase.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOWSTYLE]=e=>IfcWindowStyle.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWINDOWTYPE]=e=>IfcWindowType.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWORKCALENDAR]=e=>IfcWorkCalendar.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWORKCONTROL]=e=>IfcWorkControl.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWORKPLAN]=e=>IfcWorkPlan.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWORKSCHEDULE]=e=>IfcWorkSchedule.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCWORKTIME]=e=>IfcWorkTime.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCZSHAPEPROFILEDEF]=e=>IfcZShapeProfileDef.FromTape(e.ID,e.type,e.arguments),FromRawLineData[IFCZONE]=e=>IfcZone.FromTape(e.ID,e.type,e.arguments);var IfcActionRequestTypeEnum=class{constructor(e){this.value=e}};IfcActionRequestTypeEnum.EMAIL="EMAIL",IfcActionRequestTypeEnum.FAX="FAX",IfcActionRequestTypeEnum.PHONE="PHONE",IfcActionRequestTypeEnum.POST="POST",IfcActionRequestTypeEnum.VERBAL="VERBAL",IfcActionRequestTypeEnum.USERDEFINED="USERDEFINED",IfcActionRequestTypeEnum.NOTDEFINED="NOTDEFINED";var IfcActionSourceTypeEnum=class{constructor(e){this.value=e}};IfcActionSourceTypeEnum.DEAD_LOAD_G="DEAD_LOAD_G",IfcActionSourceTypeEnum.COMPLETION_G1="COMPLETION_G1",IfcActionSourceTypeEnum.LIVE_LOAD_Q="LIVE_LOAD_Q",IfcActionSourceTypeEnum.SNOW_S="SNOW_S",IfcActionSourceTypeEnum.WIND_W="WIND_W",IfcActionSourceTypeEnum.PRESTRESSING_P="PRESTRESSING_P",IfcActionSourceTypeEnum.SETTLEMENT_U="SETTLEMENT_U",IfcActionSourceTypeEnum.TEMPERATURE_T="TEMPERATURE_T",IfcActionSourceTypeEnum.EARTHQUAKE_E="EARTHQUAKE_E",IfcActionSourceTypeEnum.FIRE="FIRE",IfcActionSourceTypeEnum.IMPULSE="IMPULSE",IfcActionSourceTypeEnum.IMPACT="IMPACT",IfcActionSourceTypeEnum.TRANSPORT="TRANSPORT",IfcActionSourceTypeEnum.ERECTION="ERECTION",IfcActionSourceTypeEnum.PROPPING="PROPPING",IfcActionSourceTypeEnum.SYSTEM_IMPERFECTION="SYSTEM_IMPERFECTION",IfcActionSourceTypeEnum.SHRINKAGE="SHRINKAGE",IfcActionSourceTypeEnum.CREEP="CREEP",IfcActionSourceTypeEnum.LACK_OF_FIT="LACK_OF_FIT",IfcActionSourceTypeEnum.BUOYANCY="BUOYANCY",IfcActionSourceTypeEnum.ICE="ICE",IfcActionSourceTypeEnum.CURRENT="CURRENT",IfcActionSourceTypeEnum.WAVE="WAVE",IfcActionSourceTypeEnum.RAIN="RAIN",IfcActionSourceTypeEnum.BRAKES="BRAKES",IfcActionSourceTypeEnum.USERDEFINED="USERDEFINED",IfcActionSourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcActionTypeEnum=class{constructor(e){this.value=e}};IfcActionTypeEnum.PERMANENT_G="PERMANENT_G",IfcActionTypeEnum.VARIABLE_Q="VARIABLE_Q",IfcActionTypeEnum.EXTRAORDINARY_A="EXTRAORDINARY_A",IfcActionTypeEnum.USERDEFINED="USERDEFINED",IfcActionTypeEnum.NOTDEFINED="NOTDEFINED";var IfcActuatorTypeEnum=class{constructor(e){this.value=e}};IfcActuatorTypeEnum.ELECTRICACTUATOR="ELECTRICACTUATOR",IfcActuatorTypeEnum.HANDOPERATEDACTUATOR="HANDOPERATEDACTUATOR",IfcActuatorTypeEnum.HYDRAULICACTUATOR="HYDRAULICACTUATOR",IfcActuatorTypeEnum.PNEUMATICACTUATOR="PNEUMATICACTUATOR",IfcActuatorTypeEnum.THERMOSTATICACTUATOR="THERMOSTATICACTUATOR",IfcActuatorTypeEnum.USERDEFINED="USERDEFINED",IfcActuatorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAddressTypeEnum=class{constructor(e){this.value=e}};IfcAddressTypeEnum.OFFICE="OFFICE",IfcAddressTypeEnum.SITE="SITE",IfcAddressTypeEnum.HOME="HOME",IfcAddressTypeEnum.DISTRIBUTIONPOINT="DISTRIBUTIONPOINT",IfcAddressTypeEnum.USERDEFINED="USERDEFINED";var IfcAirTerminalBoxTypeEnum=class{constructor(e){this.value=e}};IfcAirTerminalBoxTypeEnum.CONSTANTFLOW="CONSTANTFLOW",IfcAirTerminalBoxTypeEnum.VARIABLEFLOWPRESSUREDEPENDANT="VARIABLEFLOWPRESSUREDEPENDANT",IfcAirTerminalBoxTypeEnum.VARIABLEFLOWPRESSUREINDEPENDANT="VARIABLEFLOWPRESSUREINDEPENDANT",IfcAirTerminalBoxTypeEnum.USERDEFINED="USERDEFINED",IfcAirTerminalBoxTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAirTerminalTypeEnum=class{constructor(e){this.value=e}};IfcAirTerminalTypeEnum.DIFFUSER="DIFFUSER",IfcAirTerminalTypeEnum.GRILLE="GRILLE",IfcAirTerminalTypeEnum.LOUVRE="LOUVRE",IfcAirTerminalTypeEnum.REGISTER="REGISTER",IfcAirTerminalTypeEnum.USERDEFINED="USERDEFINED",IfcAirTerminalTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAirToAirHeatRecoveryTypeEnum=class{constructor(e){this.value=e}};IfcAirToAirHeatRecoveryTypeEnum.FIXEDPLATECOUNTERFLOWEXCHANGER="FIXEDPLATECOUNTERFLOWEXCHANGER",IfcAirToAirHeatRecoveryTypeEnum.FIXEDPLATECROSSFLOWEXCHANGER="FIXEDPLATECROSSFLOWEXCHANGER",IfcAirToAirHeatRecoveryTypeEnum.FIXEDPLATEPARALLELFLOWEXCHANGER="FIXEDPLATEPARALLELFLOWEXCHANGER",IfcAirToAirHeatRecoveryTypeEnum.ROTARYWHEEL="ROTARYWHEEL",IfcAirToAirHeatRecoveryTypeEnum.RUNAROUNDCOILLOOP="RUNAROUNDCOILLOOP",IfcAirToAirHeatRecoveryTypeEnum.HEATPIPE="HEATPIPE",IfcAirToAirHeatRecoveryTypeEnum.TWINTOWERENTHALPYRECOVERYLOOPS="TWINTOWERENTHALPYRECOVERYLOOPS",IfcAirToAirHeatRecoveryTypeEnum.THERMOSIPHONSEALEDTUBEHEATEXCHANGERS="THERMOSIPHONSEALEDTUBEHEATEXCHANGERS",IfcAirToAirHeatRecoveryTypeEnum.THERMOSIPHONCOILTYPEHEATEXCHANGERS="THERMOSIPHONCOILTYPEHEATEXCHANGERS",IfcAirToAirHeatRecoveryTypeEnum.USERDEFINED="USERDEFINED",IfcAirToAirHeatRecoveryTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAlarmTypeEnum=class{constructor(e){this.value=e}};IfcAlarmTypeEnum.BELL="BELL",IfcAlarmTypeEnum.BREAKGLASSBUTTON="BREAKGLASSBUTTON",IfcAlarmTypeEnum.LIGHT="LIGHT",IfcAlarmTypeEnum.MANUALPULLBOX="MANUALPULLBOX",IfcAlarmTypeEnum.SIREN="SIREN",IfcAlarmTypeEnum.WHISTLE="WHISTLE",IfcAlarmTypeEnum.USERDEFINED="USERDEFINED",IfcAlarmTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAlignmentTypeEnum=class{constructor(e){this.value=e}};IfcAlignmentTypeEnum.USERDEFINED="USERDEFINED",IfcAlignmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAnalysisModelTypeEnum=class{constructor(e){this.value=e}};IfcAnalysisModelTypeEnum.IN_PLANE_LOADING_2D="IN_PLANE_LOADING_2D",IfcAnalysisModelTypeEnum.OUT_PLANE_LOADING_2D="OUT_PLANE_LOADING_2D",IfcAnalysisModelTypeEnum.LOADING_3D="LOADING_3D",IfcAnalysisModelTypeEnum.USERDEFINED="USERDEFINED",IfcAnalysisModelTypeEnum.NOTDEFINED="NOTDEFINED";var IfcAnalysisTheoryTypeEnum=class{constructor(e){this.value=e}};IfcAnalysisTheoryTypeEnum.FIRST_ORDER_THEORY="FIRST_ORDER_THEORY",IfcAnalysisTheoryTypeEnum.SECOND_ORDER_THEORY="SECOND_ORDER_THEORY",IfcAnalysisTheoryTypeEnum.THIRD_ORDER_THEORY="THIRD_ORDER_THEORY",IfcAnalysisTheoryTypeEnum.FULL_NONLINEAR_THEORY="FULL_NONLINEAR_THEORY",IfcAnalysisTheoryTypeEnum.USERDEFINED="USERDEFINED",IfcAnalysisTheoryTypeEnum.NOTDEFINED="NOTDEFINED";var IfcArithmeticOperatorEnum=class{constructor(e){this.value=e}};IfcArithmeticOperatorEnum.ADD="ADD",IfcArithmeticOperatorEnum.DIVIDE="DIVIDE",IfcArithmeticOperatorEnum.MULTIPLY="MULTIPLY",IfcArithmeticOperatorEnum.SUBTRACT="SUBTRACT";var IfcAssemblyPlaceEnum=class{constructor(e){this.value=e}};IfcAssemblyPlaceEnum.SITE="SITE",IfcAssemblyPlaceEnum.FACTORY="FACTORY",IfcAssemblyPlaceEnum.NOTDEFINED="NOTDEFINED";var IfcAudioVisualApplianceTypeEnum=class{constructor(e){this.value=e}};IfcAudioVisualApplianceTypeEnum.AMPLIFIER="AMPLIFIER",IfcAudioVisualApplianceTypeEnum.CAMERA="CAMERA",IfcAudioVisualApplianceTypeEnum.DISPLAY="DISPLAY",IfcAudioVisualApplianceTypeEnum.MICROPHONE="MICROPHONE",IfcAudioVisualApplianceTypeEnum.PLAYER="PLAYER",IfcAudioVisualApplianceTypeEnum.PROJECTOR="PROJECTOR",IfcAudioVisualApplianceTypeEnum.RECEIVER="RECEIVER",IfcAudioVisualApplianceTypeEnum.SPEAKER="SPEAKER",IfcAudioVisualApplianceTypeEnum.SWITCHER="SWITCHER",IfcAudioVisualApplianceTypeEnum.TELEPHONE="TELEPHONE",IfcAudioVisualApplianceTypeEnum.TUNER="TUNER",IfcAudioVisualApplianceTypeEnum.USERDEFINED="USERDEFINED",IfcAudioVisualApplianceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBSplineCurveForm=class{constructor(e){this.value=e}};IfcBSplineCurveForm.POLYLINE_FORM="POLYLINE_FORM",IfcBSplineCurveForm.CIRCULAR_ARC="CIRCULAR_ARC",IfcBSplineCurveForm.ELLIPTIC_ARC="ELLIPTIC_ARC",IfcBSplineCurveForm.PARABOLIC_ARC="PARABOLIC_ARC",IfcBSplineCurveForm.HYPERBOLIC_ARC="HYPERBOLIC_ARC",IfcBSplineCurveForm.UNSPECIFIED="UNSPECIFIED";var IfcBSplineSurfaceForm=class{constructor(e){this.value=e}};IfcBSplineSurfaceForm.PLANE_SURF="PLANE_SURF",IfcBSplineSurfaceForm.CYLINDRICAL_SURF="CYLINDRICAL_SURF",IfcBSplineSurfaceForm.CONICAL_SURF="CONICAL_SURF",IfcBSplineSurfaceForm.SPHERICAL_SURF="SPHERICAL_SURF",IfcBSplineSurfaceForm.TOROIDAL_SURF="TOROIDAL_SURF",IfcBSplineSurfaceForm.SURF_OF_REVOLUTION="SURF_OF_REVOLUTION",IfcBSplineSurfaceForm.RULED_SURF="RULED_SURF",IfcBSplineSurfaceForm.GENERALISED_CONE="GENERALISED_CONE",IfcBSplineSurfaceForm.QUADRIC_SURF="QUADRIC_SURF",IfcBSplineSurfaceForm.SURF_OF_LINEAR_EXTRUSION="SURF_OF_LINEAR_EXTRUSION",IfcBSplineSurfaceForm.UNSPECIFIED="UNSPECIFIED";var IfcBeamTypeEnum=class{constructor(e){this.value=e}};IfcBeamTypeEnum.BEAM="BEAM",IfcBeamTypeEnum.JOIST="JOIST",IfcBeamTypeEnum.HOLLOWCORE="HOLLOWCORE",IfcBeamTypeEnum.LINTEL="LINTEL",IfcBeamTypeEnum.SPANDREL="SPANDREL",IfcBeamTypeEnum.T_BEAM="T_BEAM",IfcBeamTypeEnum.GIRDER_SEGMENT="GIRDER_SEGMENT",IfcBeamTypeEnum.DIAPHRAGM="DIAPHRAGM",IfcBeamTypeEnum.PIERCAP="PIERCAP",IfcBeamTypeEnum.HATSTONE="HATSTONE",IfcBeamTypeEnum.CORNICE="CORNICE",IfcBeamTypeEnum.EDGEBEAM="EDGEBEAM",IfcBeamTypeEnum.USERDEFINED="USERDEFINED",IfcBeamTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBearingTypeDisplacementEnum=class{constructor(e){this.value=e}};IfcBearingTypeDisplacementEnum.FIXED_MOVEMENT="FIXED_MOVEMENT",IfcBearingTypeDisplacementEnum.GUIDED_LONGITUDINAL="GUIDED_LONGITUDINAL",IfcBearingTypeDisplacementEnum.GUIDED_TRANSVERSAL="GUIDED_TRANSVERSAL",IfcBearingTypeDisplacementEnum.FREE_MOVEMENT="FREE_MOVEMENT",IfcBearingTypeDisplacementEnum.NOTDEFINED="NOTDEFINED";var IfcBearingTypeEnum=class{constructor(e){this.value=e}};IfcBearingTypeEnum.CYLINDRICAL="CYLINDRICAL",IfcBearingTypeEnum.SPHERICAL="SPHERICAL",IfcBearingTypeEnum.ELASTOMERIC="ELASTOMERIC",IfcBearingTypeEnum.POT="POT",IfcBearingTypeEnum.GUIDE="GUIDE",IfcBearingTypeEnum.ROCKER="ROCKER",IfcBearingTypeEnum.ROLLER="ROLLER",IfcBearingTypeEnum.DISK="DISK",IfcBearingTypeEnum.USERDEFINED="USERDEFINED",IfcBearingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBenchmarkEnum=class{constructor(e){this.value=e}};IfcBenchmarkEnum.GREATERTHAN="GREATERTHAN",IfcBenchmarkEnum.GREATERTHANOREQUALTO="GREATERTHANOREQUALTO",IfcBenchmarkEnum.LESSTHAN="LESSTHAN",IfcBenchmarkEnum.LESSTHANOREQUALTO="LESSTHANOREQUALTO",IfcBenchmarkEnum.EQUALTO="EQUALTO",IfcBenchmarkEnum.NOTEQUALTO="NOTEQUALTO",IfcBenchmarkEnum.INCLUDES="INCLUDES",IfcBenchmarkEnum.NOTINCLUDES="NOTINCLUDES",IfcBenchmarkEnum.INCLUDEDIN="INCLUDEDIN",IfcBenchmarkEnum.NOTINCLUDEDIN="NOTINCLUDEDIN";var IfcBoilerTypeEnum=class{constructor(e){this.value=e}};IfcBoilerTypeEnum.WATER="WATER",IfcBoilerTypeEnum.STEAM="STEAM",IfcBoilerTypeEnum.USERDEFINED="USERDEFINED",IfcBoilerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBooleanOperator=class{constructor(e){this.value=e}};IfcBooleanOperator.UNION="UNION",IfcBooleanOperator.INTERSECTION="INTERSECTION",IfcBooleanOperator.DIFFERENCE="DIFFERENCE";var IfcBridgePartTypeEnum=class{constructor(e){this.value=e}};IfcBridgePartTypeEnum.ABUTMENT="ABUTMENT",IfcBridgePartTypeEnum.DECK="DECK",IfcBridgePartTypeEnum.DECK_SEGMENT="DECK_SEGMENT",IfcBridgePartTypeEnum.FOUNDATION="FOUNDATION",IfcBridgePartTypeEnum.PIER="PIER",IfcBridgePartTypeEnum.PIER_SEGMENT="PIER_SEGMENT",IfcBridgePartTypeEnum.PYLON="PYLON",IfcBridgePartTypeEnum.SUBSTRUCTURE="SUBSTRUCTURE",IfcBridgePartTypeEnum.SUPERSTRUCTURE="SUPERSTRUCTURE",IfcBridgePartTypeEnum.SURFACESTRUCTURE="SURFACESTRUCTURE",IfcBridgePartTypeEnum.USERDEFINED="USERDEFINED",IfcBridgePartTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBridgeTypeEnum=class{constructor(e){this.value=e}};IfcBridgeTypeEnum.ARCHED="ARCHED",IfcBridgeTypeEnum.CABLE_STAYED="CABLE_STAYED",IfcBridgeTypeEnum.CANTILEVER="CANTILEVER",IfcBridgeTypeEnum.CULVERT="CULVERT",IfcBridgeTypeEnum.FRAMEWORK="FRAMEWORK",IfcBridgeTypeEnum.GIRDER="GIRDER",IfcBridgeTypeEnum.SUSPENSION="SUSPENSION",IfcBridgeTypeEnum.TRUSS="TRUSS",IfcBridgeTypeEnum.USERDEFINED="USERDEFINED",IfcBridgeTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBuildingElementPartTypeEnum=class{constructor(e){this.value=e}};IfcBuildingElementPartTypeEnum.INSULATION="INSULATION",IfcBuildingElementPartTypeEnum.PRECASTPANEL="PRECASTPANEL",IfcBuildingElementPartTypeEnum.APRON="APRON",IfcBuildingElementPartTypeEnum.USERDEFINED="USERDEFINED",IfcBuildingElementPartTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBuildingElementProxyTypeEnum=class{constructor(e){this.value=e}};IfcBuildingElementProxyTypeEnum.COMPLEX="COMPLEX",IfcBuildingElementProxyTypeEnum.ELEMENT="ELEMENT",IfcBuildingElementProxyTypeEnum.PARTIAL="PARTIAL",IfcBuildingElementProxyTypeEnum.PROVISIONFORVOID="PROVISIONFORVOID",IfcBuildingElementProxyTypeEnum.PROVISIONFORSPACE="PROVISIONFORSPACE",IfcBuildingElementProxyTypeEnum.USERDEFINED="USERDEFINED",IfcBuildingElementProxyTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBuildingSystemTypeEnum=class{constructor(e){this.value=e}};IfcBuildingSystemTypeEnum.FENESTRATION="FENESTRATION",IfcBuildingSystemTypeEnum.FOUNDATION="FOUNDATION",IfcBuildingSystemTypeEnum.LOADBEARING="LOADBEARING",IfcBuildingSystemTypeEnum.OUTERSHELL="OUTERSHELL",IfcBuildingSystemTypeEnum.SHADING="SHADING",IfcBuildingSystemTypeEnum.TRANSPORT="TRANSPORT",IfcBuildingSystemTypeEnum.REINFORCING="REINFORCING",IfcBuildingSystemTypeEnum.PRESTRESSING="PRESTRESSING",IfcBuildingSystemTypeEnum.USERDEFINED="USERDEFINED",IfcBuildingSystemTypeEnum.NOTDEFINED="NOTDEFINED";var IfcBurnerTypeEnum=class{constructor(e){this.value=e}};IfcBurnerTypeEnum.USERDEFINED="USERDEFINED",IfcBurnerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCableCarrierFittingTypeEnum=class{constructor(e){this.value=e}};IfcCableCarrierFittingTypeEnum.BEND="BEND",IfcCableCarrierFittingTypeEnum.CROSS="CROSS",IfcCableCarrierFittingTypeEnum.REDUCER="REDUCER",IfcCableCarrierFittingTypeEnum.TEE="TEE",IfcCableCarrierFittingTypeEnum.USERDEFINED="USERDEFINED",IfcCableCarrierFittingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCableCarrierSegmentTypeEnum=class{constructor(e){this.value=e}};IfcCableCarrierSegmentTypeEnum.CABLELADDERSEGMENT="CABLELADDERSEGMENT",IfcCableCarrierSegmentTypeEnum.CABLETRAYSEGMENT="CABLETRAYSEGMENT",IfcCableCarrierSegmentTypeEnum.CABLETRUNKINGSEGMENT="CABLETRUNKINGSEGMENT",IfcCableCarrierSegmentTypeEnum.CONDUITSEGMENT="CONDUITSEGMENT",IfcCableCarrierSegmentTypeEnum.USERDEFINED="USERDEFINED",IfcCableCarrierSegmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCableFittingTypeEnum=class{constructor(e){this.value=e}};IfcCableFittingTypeEnum.CONNECTOR="CONNECTOR",IfcCableFittingTypeEnum.ENTRY="ENTRY",IfcCableFittingTypeEnum.EXIT="EXIT",IfcCableFittingTypeEnum.JUNCTION="JUNCTION",IfcCableFittingTypeEnum.TRANSITION="TRANSITION",IfcCableFittingTypeEnum.USERDEFINED="USERDEFINED",IfcCableFittingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCableSegmentTypeEnum=class{constructor(e){this.value=e}};IfcCableSegmentTypeEnum.BUSBARSEGMENT="BUSBARSEGMENT",IfcCableSegmentTypeEnum.CABLESEGMENT="CABLESEGMENT",IfcCableSegmentTypeEnum.CONDUCTORSEGMENT="CONDUCTORSEGMENT",IfcCableSegmentTypeEnum.CORESEGMENT="CORESEGMENT",IfcCableSegmentTypeEnum.USERDEFINED="USERDEFINED",IfcCableSegmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCaissonFoundationTypeEnum=class{constructor(e){this.value=e}};IfcCaissonFoundationTypeEnum.WELL="WELL",IfcCaissonFoundationTypeEnum.CAISSON="CAISSON",IfcCaissonFoundationTypeEnum.USERDEFINED="USERDEFINED",IfcCaissonFoundationTypeEnum.NOTDEFINED="NOTDEFINED";var IfcChangeActionEnum=class{constructor(e){this.value=e}};IfcChangeActionEnum.NOCHANGE="NOCHANGE",IfcChangeActionEnum.MODIFIED="MODIFIED",IfcChangeActionEnum.ADDED="ADDED",IfcChangeActionEnum.DELETED="DELETED",IfcChangeActionEnum.NOTDEFINED="NOTDEFINED";var IfcChillerTypeEnum=class{constructor(e){this.value=e}};IfcChillerTypeEnum.AIRCOOLED="AIRCOOLED",IfcChillerTypeEnum.WATERCOOLED="WATERCOOLED",IfcChillerTypeEnum.HEATRECOVERY="HEATRECOVERY",IfcChillerTypeEnum.USERDEFINED="USERDEFINED",IfcChillerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcChimneyTypeEnum=class{constructor(e){this.value=e}};IfcChimneyTypeEnum.USERDEFINED="USERDEFINED",IfcChimneyTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCoilTypeEnum=class{constructor(e){this.value=e}};IfcCoilTypeEnum.DXCOOLINGCOIL="DXCOOLINGCOIL",IfcCoilTypeEnum.ELECTRICHEATINGCOIL="ELECTRICHEATINGCOIL",IfcCoilTypeEnum.GASHEATINGCOIL="GASHEATINGCOIL",IfcCoilTypeEnum.HYDRONICCOIL="HYDRONICCOIL",IfcCoilTypeEnum.STEAMHEATINGCOIL="STEAMHEATINGCOIL",IfcCoilTypeEnum.WATERCOOLINGCOIL="WATERCOOLINGCOIL",IfcCoilTypeEnum.WATERHEATINGCOIL="WATERHEATINGCOIL",IfcCoilTypeEnum.USERDEFINED="USERDEFINED",IfcCoilTypeEnum.NOTDEFINED="NOTDEFINED";var IfcColumnTypeEnum=class{constructor(e){this.value=e}};IfcColumnTypeEnum.COLUMN="COLUMN",IfcColumnTypeEnum.PILASTER="PILASTER",IfcColumnTypeEnum.PIERSTEM="PIERSTEM",IfcColumnTypeEnum.PIERSTEM_SEGMENT="PIERSTEM_SEGMENT",IfcColumnTypeEnum.STANDCOLUMN="STANDCOLUMN",IfcColumnTypeEnum.USERDEFINED="USERDEFINED",IfcColumnTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCommunicationsApplianceTypeEnum=class{constructor(e){this.value=e}};IfcCommunicationsApplianceTypeEnum.ANTENNA="ANTENNA",IfcCommunicationsApplianceTypeEnum.COMPUTER="COMPUTER",IfcCommunicationsApplianceTypeEnum.FAX="FAX",IfcCommunicationsApplianceTypeEnum.GATEWAY="GATEWAY",IfcCommunicationsApplianceTypeEnum.MODEM="MODEM",IfcCommunicationsApplianceTypeEnum.NETWORKAPPLIANCE="NETWORKAPPLIANCE",IfcCommunicationsApplianceTypeEnum.NETWORKBRIDGE="NETWORKBRIDGE",IfcCommunicationsApplianceTypeEnum.NETWORKHUB="NETWORKHUB",IfcCommunicationsApplianceTypeEnum.PRINTER="PRINTER",IfcCommunicationsApplianceTypeEnum.REPEATER="REPEATER",IfcCommunicationsApplianceTypeEnum.ROUTER="ROUTER",IfcCommunicationsApplianceTypeEnum.SCANNER="SCANNER",IfcCommunicationsApplianceTypeEnum.USERDEFINED="USERDEFINED",IfcCommunicationsApplianceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcComplexPropertyTemplateTypeEnum=class{constructor(e){this.value=e}};IfcComplexPropertyTemplateTypeEnum.P_COMPLEX="P_COMPLEX",IfcComplexPropertyTemplateTypeEnum.Q_COMPLEX="Q_COMPLEX";var IfcCompressorTypeEnum=class{constructor(e){this.value=e}};IfcCompressorTypeEnum.DYNAMIC="DYNAMIC",IfcCompressorTypeEnum.RECIPROCATING="RECIPROCATING",IfcCompressorTypeEnum.ROTARY="ROTARY",IfcCompressorTypeEnum.SCROLL="SCROLL",IfcCompressorTypeEnum.TROCHOIDAL="TROCHOIDAL",IfcCompressorTypeEnum.SINGLESTAGE="SINGLESTAGE",IfcCompressorTypeEnum.BOOSTER="BOOSTER",IfcCompressorTypeEnum.OPENTYPE="OPENTYPE",IfcCompressorTypeEnum.HERMETIC="HERMETIC",IfcCompressorTypeEnum.SEMIHERMETIC="SEMIHERMETIC",IfcCompressorTypeEnum.WELDEDSHELLHERMETIC="WELDEDSHELLHERMETIC",IfcCompressorTypeEnum.ROLLINGPISTON="ROLLINGPISTON",IfcCompressorTypeEnum.ROTARYVANE="ROTARYVANE",IfcCompressorTypeEnum.SINGLESCREW="SINGLESCREW",IfcCompressorTypeEnum.TWINSCREW="TWINSCREW",IfcCompressorTypeEnum.USERDEFINED="USERDEFINED",IfcCompressorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCondenserTypeEnum=class{constructor(e){this.value=e}};IfcCondenserTypeEnum.AIRCOOLED="AIRCOOLED",IfcCondenserTypeEnum.EVAPORATIVECOOLED="EVAPORATIVECOOLED",IfcCondenserTypeEnum.WATERCOOLED="WATERCOOLED",IfcCondenserTypeEnum.WATERCOOLEDBRAZEDPLATE="WATERCOOLEDBRAZEDPLATE",IfcCondenserTypeEnum.WATERCOOLEDSHELLCOIL="WATERCOOLEDSHELLCOIL",IfcCondenserTypeEnum.WATERCOOLEDSHELLTUBE="WATERCOOLEDSHELLTUBE",IfcCondenserTypeEnum.WATERCOOLEDTUBEINTUBE="WATERCOOLEDTUBEINTUBE",IfcCondenserTypeEnum.USERDEFINED="USERDEFINED",IfcCondenserTypeEnum.NOTDEFINED="NOTDEFINED";var IfcConnectionTypeEnum=class{constructor(e){this.value=e}};IfcConnectionTypeEnum.ATPATH="ATPATH",IfcConnectionTypeEnum.ATSTART="ATSTART",IfcConnectionTypeEnum.ATEND="ATEND",IfcConnectionTypeEnum.NOTDEFINED="NOTDEFINED";var IfcConstraintEnum=class{constructor(e){this.value=e}};IfcConstraintEnum.HARD="HARD",IfcConstraintEnum.SOFT="SOFT",IfcConstraintEnum.ADVISORY="ADVISORY",IfcConstraintEnum.USERDEFINED="USERDEFINED",IfcConstraintEnum.NOTDEFINED="NOTDEFINED";var IfcConstructionEquipmentResourceTypeEnum=class{constructor(e){this.value=e}};IfcConstructionEquipmentResourceTypeEnum.DEMOLISHING="DEMOLISHING",IfcConstructionEquipmentResourceTypeEnum.EARTHMOVING="EARTHMOVING",IfcConstructionEquipmentResourceTypeEnum.ERECTING="ERECTING",IfcConstructionEquipmentResourceTypeEnum.HEATING="HEATING",IfcConstructionEquipmentResourceTypeEnum.LIGHTING="LIGHTING",IfcConstructionEquipmentResourceTypeEnum.PAVING="PAVING",IfcConstructionEquipmentResourceTypeEnum.PUMPING="PUMPING",IfcConstructionEquipmentResourceTypeEnum.TRANSPORTING="TRANSPORTING",IfcConstructionEquipmentResourceTypeEnum.USERDEFINED="USERDEFINED",IfcConstructionEquipmentResourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcConstructionMaterialResourceTypeEnum=class{constructor(e){this.value=e}};IfcConstructionMaterialResourceTypeEnum.AGGREGATES="AGGREGATES",IfcConstructionMaterialResourceTypeEnum.CONCRETE="CONCRETE",IfcConstructionMaterialResourceTypeEnum.DRYWALL="DRYWALL",IfcConstructionMaterialResourceTypeEnum.FUEL="FUEL",IfcConstructionMaterialResourceTypeEnum.GYPSUM="GYPSUM",IfcConstructionMaterialResourceTypeEnum.MASONRY="MASONRY",IfcConstructionMaterialResourceTypeEnum.METAL="METAL",IfcConstructionMaterialResourceTypeEnum.PLASTIC="PLASTIC",IfcConstructionMaterialResourceTypeEnum.WOOD="WOOD",IfcConstructionMaterialResourceTypeEnum.NOTDEFINED="NOTDEFINED",IfcConstructionMaterialResourceTypeEnum.USERDEFINED="USERDEFINED";var IfcConstructionProductResourceTypeEnum=class{constructor(e){this.value=e}};IfcConstructionProductResourceTypeEnum.ASSEMBLY="ASSEMBLY",IfcConstructionProductResourceTypeEnum.FORMWORK="FORMWORK",IfcConstructionProductResourceTypeEnum.USERDEFINED="USERDEFINED",IfcConstructionProductResourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcControllerTypeEnum=class{constructor(e){this.value=e}};IfcControllerTypeEnum.FLOATING="FLOATING",IfcControllerTypeEnum.PROGRAMMABLE="PROGRAMMABLE",IfcControllerTypeEnum.PROPORTIONAL="PROPORTIONAL",IfcControllerTypeEnum.MULTIPOSITION="MULTIPOSITION",IfcControllerTypeEnum.TWOPOSITION="TWOPOSITION",IfcControllerTypeEnum.USERDEFINED="USERDEFINED",IfcControllerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCooledBeamTypeEnum=class{constructor(e){this.value=e}};IfcCooledBeamTypeEnum.ACTIVE="ACTIVE",IfcCooledBeamTypeEnum.PASSIVE="PASSIVE",IfcCooledBeamTypeEnum.USERDEFINED="USERDEFINED",IfcCooledBeamTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCoolingTowerTypeEnum=class{constructor(e){this.value=e}};IfcCoolingTowerTypeEnum.NATURALDRAFT="NATURALDRAFT",IfcCoolingTowerTypeEnum.MECHANICALINDUCEDDRAFT="MECHANICALINDUCEDDRAFT",IfcCoolingTowerTypeEnum.MECHANICALFORCEDDRAFT="MECHANICALFORCEDDRAFT",IfcCoolingTowerTypeEnum.USERDEFINED="USERDEFINED",IfcCoolingTowerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCostItemTypeEnum=class{constructor(e){this.value=e}};IfcCostItemTypeEnum.USERDEFINED="USERDEFINED",IfcCostItemTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCostScheduleTypeEnum=class{constructor(e){this.value=e}};IfcCostScheduleTypeEnum.BUDGET="BUDGET",IfcCostScheduleTypeEnum.COSTPLAN="COSTPLAN",IfcCostScheduleTypeEnum.ESTIMATE="ESTIMATE",IfcCostScheduleTypeEnum.TENDER="TENDER",IfcCostScheduleTypeEnum.PRICEDBILLOFQUANTITIES="PRICEDBILLOFQUANTITIES",IfcCostScheduleTypeEnum.UNPRICEDBILLOFQUANTITIES="UNPRICEDBILLOFQUANTITIES",IfcCostScheduleTypeEnum.SCHEDULEOFRATES="SCHEDULEOFRATES",IfcCostScheduleTypeEnum.USERDEFINED="USERDEFINED",IfcCostScheduleTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCoveringTypeEnum=class{constructor(e){this.value=e}};IfcCoveringTypeEnum.CEILING="CEILING",IfcCoveringTypeEnum.FLOORING="FLOORING",IfcCoveringTypeEnum.CLADDING="CLADDING",IfcCoveringTypeEnum.ROOFING="ROOFING",IfcCoveringTypeEnum.MOLDING="MOLDING",IfcCoveringTypeEnum.SKIRTINGBOARD="SKIRTINGBOARD",IfcCoveringTypeEnum.INSULATION="INSULATION",IfcCoveringTypeEnum.MEMBRANE="MEMBRANE",IfcCoveringTypeEnum.SLEEVING="SLEEVING",IfcCoveringTypeEnum.WRAPPING="WRAPPING",IfcCoveringTypeEnum.COPING="COPING",IfcCoveringTypeEnum.USERDEFINED="USERDEFINED",IfcCoveringTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCrewResourceTypeEnum=class{constructor(e){this.value=e}};IfcCrewResourceTypeEnum.OFFICE="OFFICE",IfcCrewResourceTypeEnum.SITE="SITE",IfcCrewResourceTypeEnum.USERDEFINED="USERDEFINED",IfcCrewResourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCurtainWallTypeEnum=class{constructor(e){this.value=e}};IfcCurtainWallTypeEnum.USERDEFINED="USERDEFINED",IfcCurtainWallTypeEnum.NOTDEFINED="NOTDEFINED";var IfcCurveInterpolationEnum=class{constructor(e){this.value=e}};IfcCurveInterpolationEnum.LINEAR="LINEAR",IfcCurveInterpolationEnum.LOG_LINEAR="LOG_LINEAR",IfcCurveInterpolationEnum.LOG_LOG="LOG_LOG",IfcCurveInterpolationEnum.NOTDEFINED="NOTDEFINED";var IfcDamperTypeEnum=class{constructor(e){this.value=e}};IfcDamperTypeEnum.BACKDRAFTDAMPER="BACKDRAFTDAMPER",IfcDamperTypeEnum.BALANCINGDAMPER="BALANCINGDAMPER",IfcDamperTypeEnum.BLASTDAMPER="BLASTDAMPER",IfcDamperTypeEnum.CONTROLDAMPER="CONTROLDAMPER",IfcDamperTypeEnum.FIREDAMPER="FIREDAMPER",IfcDamperTypeEnum.FIRESMOKEDAMPER="FIRESMOKEDAMPER",IfcDamperTypeEnum.FUMEHOODEXHAUST="FUMEHOODEXHAUST",IfcDamperTypeEnum.GRAVITYDAMPER="GRAVITYDAMPER",IfcDamperTypeEnum.GRAVITYRELIEFDAMPER="GRAVITYRELIEFDAMPER",IfcDamperTypeEnum.RELIEFDAMPER="RELIEFDAMPER",IfcDamperTypeEnum.SMOKEDAMPER="SMOKEDAMPER",IfcDamperTypeEnum.USERDEFINED="USERDEFINED",IfcDamperTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDataOriginEnum=class{constructor(e){this.value=e}};IfcDataOriginEnum.MEASURED="MEASURED",IfcDataOriginEnum.PREDICTED="PREDICTED",IfcDataOriginEnum.SIMULATED="SIMULATED",IfcDataOriginEnum.USERDEFINED="USERDEFINED",IfcDataOriginEnum.NOTDEFINED="NOTDEFINED";var IfcDerivedUnitEnum=class{constructor(e){this.value=e}};IfcDerivedUnitEnum.ANGULARVELOCITYUNIT="ANGULARVELOCITYUNIT",IfcDerivedUnitEnum.AREADENSITYUNIT="AREADENSITYUNIT",IfcDerivedUnitEnum.COMPOUNDPLANEANGLEUNIT="COMPOUNDPLANEANGLEUNIT",IfcDerivedUnitEnum.DYNAMICVISCOSITYUNIT="DYNAMICVISCOSITYUNIT",IfcDerivedUnitEnum.HEATFLUXDENSITYUNIT="HEATFLUXDENSITYUNIT",IfcDerivedUnitEnum.INTEGERCOUNTRATEUNIT="INTEGERCOUNTRATEUNIT",IfcDerivedUnitEnum.ISOTHERMALMOISTURECAPACITYUNIT="ISOTHERMALMOISTURECAPACITYUNIT",IfcDerivedUnitEnum.KINEMATICVISCOSITYUNIT="KINEMATICVISCOSITYUNIT",IfcDerivedUnitEnum.LINEARVELOCITYUNIT="LINEARVELOCITYUNIT",IfcDerivedUnitEnum.MASSDENSITYUNIT="MASSDENSITYUNIT",IfcDerivedUnitEnum.MASSFLOWRATEUNIT="MASSFLOWRATEUNIT",IfcDerivedUnitEnum.MOISTUREDIFFUSIVITYUNIT="MOISTUREDIFFUSIVITYUNIT",IfcDerivedUnitEnum.MOLECULARWEIGHTUNIT="MOLECULARWEIGHTUNIT",IfcDerivedUnitEnum.SPECIFICHEATCAPACITYUNIT="SPECIFICHEATCAPACITYUNIT",IfcDerivedUnitEnum.THERMALADMITTANCEUNIT="THERMALADMITTANCEUNIT",IfcDerivedUnitEnum.THERMALCONDUCTANCEUNIT="THERMALCONDUCTANCEUNIT",IfcDerivedUnitEnum.THERMALRESISTANCEUNIT="THERMALRESISTANCEUNIT",IfcDerivedUnitEnum.THERMALTRANSMITTANCEUNIT="THERMALTRANSMITTANCEUNIT",IfcDerivedUnitEnum.VAPORPERMEABILITYUNIT="VAPORPERMEABILITYUNIT",IfcDerivedUnitEnum.VOLUMETRICFLOWRATEUNIT="VOLUMETRICFLOWRATEUNIT",IfcDerivedUnitEnum.ROTATIONALFREQUENCYUNIT="ROTATIONALFREQUENCYUNIT",IfcDerivedUnitEnum.TORQUEUNIT="TORQUEUNIT",IfcDerivedUnitEnum.MOMENTOFINERTIAUNIT="MOMENTOFINERTIAUNIT",IfcDerivedUnitEnum.LINEARMOMENTUNIT="LINEARMOMENTUNIT",IfcDerivedUnitEnum.LINEARFORCEUNIT="LINEARFORCEUNIT",IfcDerivedUnitEnum.PLANARFORCEUNIT="PLANARFORCEUNIT",IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT="MODULUSOFELASTICITYUNIT",IfcDerivedUnitEnum.SHEARMODULUSUNIT="SHEARMODULUSUNIT",IfcDerivedUnitEnum.LINEARSTIFFNESSUNIT="LINEARSTIFFNESSUNIT",IfcDerivedUnitEnum.ROTATIONALSTIFFNESSUNIT="ROTATIONALSTIFFNESSUNIT",IfcDerivedUnitEnum.MODULUSOFSUBGRADEREACTIONUNIT="MODULUSOFSUBGRADEREACTIONUNIT",IfcDerivedUnitEnum.ACCELERATIONUNIT="ACCELERATIONUNIT",IfcDerivedUnitEnum.CURVATUREUNIT="CURVATUREUNIT",IfcDerivedUnitEnum.HEATINGVALUEUNIT="HEATINGVALUEUNIT",IfcDerivedUnitEnum.IONCONCENTRATIONUNIT="IONCONCENTRATIONUNIT",IfcDerivedUnitEnum.LUMINOUSINTENSITYDISTRIBUTIONUNIT="LUMINOUSINTENSITYDISTRIBUTIONUNIT",IfcDerivedUnitEnum.MASSPERLENGTHUNIT="MASSPERLENGTHUNIT",IfcDerivedUnitEnum.MODULUSOFLINEARSUBGRADEREACTIONUNIT="MODULUSOFLINEARSUBGRADEREACTIONUNIT",IfcDerivedUnitEnum.MODULUSOFROTATIONALSUBGRADEREACTIONUNIT="MODULUSOFROTATIONALSUBGRADEREACTIONUNIT",IfcDerivedUnitEnum.PHUNIT="PHUNIT",IfcDerivedUnitEnum.ROTATIONALMASSUNIT="ROTATIONALMASSUNIT",IfcDerivedUnitEnum.SECTIONAREAINTEGRALUNIT="SECTIONAREAINTEGRALUNIT",IfcDerivedUnitEnum.SECTIONMODULUSUNIT="SECTIONMODULUSUNIT",IfcDerivedUnitEnum.SOUNDPOWERLEVELUNIT="SOUNDPOWERLEVELUNIT",IfcDerivedUnitEnum.SOUNDPOWERUNIT="SOUNDPOWERUNIT",IfcDerivedUnitEnum.SOUNDPRESSURELEVELUNIT="SOUNDPRESSURELEVELUNIT",IfcDerivedUnitEnum.SOUNDPRESSUREUNIT="SOUNDPRESSUREUNIT",IfcDerivedUnitEnum.TEMPERATUREGRADIENTUNIT="TEMPERATUREGRADIENTUNIT",IfcDerivedUnitEnum.TEMPERATURERATEOFCHANGEUNIT="TEMPERATURERATEOFCHANGEUNIT",IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT="THERMALEXPANSIONCOEFFICIENTUNIT",IfcDerivedUnitEnum.WARPINGCONSTANTUNIT="WARPINGCONSTANTUNIT",IfcDerivedUnitEnum.WARPINGMOMENTUNIT="WARPINGMOMENTUNIT",IfcDerivedUnitEnum.USERDEFINED="USERDEFINED";var IfcDirectionSenseEnum=class{constructor(e){this.value=e}};IfcDirectionSenseEnum.POSITIVE="POSITIVE",IfcDirectionSenseEnum.NEGATIVE="NEGATIVE";var IfcDiscreteAccessoryTypeEnum=class{constructor(e){this.value=e}};IfcDiscreteAccessoryTypeEnum.ANCHORPLATE="ANCHORPLATE",IfcDiscreteAccessoryTypeEnum.BRACKET="BRACKET",IfcDiscreteAccessoryTypeEnum.SHOE="SHOE",IfcDiscreteAccessoryTypeEnum.EXPANSION_JOINT_DEVICE="EXPANSION_JOINT_DEVICE",IfcDiscreteAccessoryTypeEnum.USERDEFINED="USERDEFINED",IfcDiscreteAccessoryTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDistributionChamberElementTypeEnum=class{constructor(e){this.value=e}};IfcDistributionChamberElementTypeEnum.FORMEDDUCT="FORMEDDUCT",IfcDistributionChamberElementTypeEnum.INSPECTIONCHAMBER="INSPECTIONCHAMBER",IfcDistributionChamberElementTypeEnum.INSPECTIONPIT="INSPECTIONPIT",IfcDistributionChamberElementTypeEnum.MANHOLE="MANHOLE",IfcDistributionChamberElementTypeEnum.METERCHAMBER="METERCHAMBER",IfcDistributionChamberElementTypeEnum.SUMP="SUMP",IfcDistributionChamberElementTypeEnum.TRENCH="TRENCH",IfcDistributionChamberElementTypeEnum.VALVECHAMBER="VALVECHAMBER",IfcDistributionChamberElementTypeEnum.USERDEFINED="USERDEFINED",IfcDistributionChamberElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDistributionPortTypeEnum=class{constructor(e){this.value=e}};IfcDistributionPortTypeEnum.CABLE="CABLE",IfcDistributionPortTypeEnum.CABLECARRIER="CABLECARRIER",IfcDistributionPortTypeEnum.DUCT="DUCT",IfcDistributionPortTypeEnum.PIPE="PIPE",IfcDistributionPortTypeEnum.USERDEFINED="USERDEFINED",IfcDistributionPortTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDistributionSystemEnum=class{constructor(e){this.value=e}};IfcDistributionSystemEnum.AIRCONDITIONING="AIRCONDITIONING",IfcDistributionSystemEnum.AUDIOVISUAL="AUDIOVISUAL",IfcDistributionSystemEnum.CHEMICAL="CHEMICAL",IfcDistributionSystemEnum.CHILLEDWATER="CHILLEDWATER",IfcDistributionSystemEnum.COMMUNICATION="COMMUNICATION",IfcDistributionSystemEnum.COMPRESSEDAIR="COMPRESSEDAIR",IfcDistributionSystemEnum.CONDENSERWATER="CONDENSERWATER",IfcDistributionSystemEnum.CONTROL="CONTROL",IfcDistributionSystemEnum.CONVEYING="CONVEYING",IfcDistributionSystemEnum.DATA="DATA",IfcDistributionSystemEnum.DISPOSAL="DISPOSAL",IfcDistributionSystemEnum.DOMESTICCOLDWATER="DOMESTICCOLDWATER",IfcDistributionSystemEnum.DOMESTICHOTWATER="DOMESTICHOTWATER",IfcDistributionSystemEnum.DRAINAGE="DRAINAGE",IfcDistributionSystemEnum.EARTHING="EARTHING",IfcDistributionSystemEnum.ELECTRICAL="ELECTRICAL",IfcDistributionSystemEnum.ELECTROACOUSTIC="ELECTROACOUSTIC",IfcDistributionSystemEnum.EXHAUST="EXHAUST",IfcDistributionSystemEnum.FIREPROTECTION="FIREPROTECTION",IfcDistributionSystemEnum.FUEL="FUEL",IfcDistributionSystemEnum.GAS="GAS",IfcDistributionSystemEnum.HAZARDOUS="HAZARDOUS",IfcDistributionSystemEnum.HEATING="HEATING",IfcDistributionSystemEnum.LIGHTING="LIGHTING",IfcDistributionSystemEnum.LIGHTNINGPROTECTION="LIGHTNINGPROTECTION",IfcDistributionSystemEnum.MUNICIPALSOLIDWASTE="MUNICIPALSOLIDWASTE",IfcDistributionSystemEnum.OIL="OIL",IfcDistributionSystemEnum.OPERATIONAL="OPERATIONAL",IfcDistributionSystemEnum.POWERGENERATION="POWERGENERATION",IfcDistributionSystemEnum.RAINWATER="RAINWATER",IfcDistributionSystemEnum.REFRIGERATION="REFRIGERATION",IfcDistributionSystemEnum.SECURITY="SECURITY",IfcDistributionSystemEnum.SEWAGE="SEWAGE",IfcDistributionSystemEnum.SIGNAL="SIGNAL",IfcDistributionSystemEnum.STORMWATER="STORMWATER",IfcDistributionSystemEnum.TELEPHONE="TELEPHONE",IfcDistributionSystemEnum.TV="TV",IfcDistributionSystemEnum.VACUUM="VACUUM",IfcDistributionSystemEnum.VENT="VENT",IfcDistributionSystemEnum.VENTILATION="VENTILATION",IfcDistributionSystemEnum.WASTEWATER="WASTEWATER",IfcDistributionSystemEnum.WATERSUPPLY="WATERSUPPLY",IfcDistributionSystemEnum.USERDEFINED="USERDEFINED",IfcDistributionSystemEnum.NOTDEFINED="NOTDEFINED";var IfcDocumentConfidentialityEnum=class{constructor(e){this.value=e}};IfcDocumentConfidentialityEnum.PUBLIC="PUBLIC",IfcDocumentConfidentialityEnum.RESTRICTED="RESTRICTED",IfcDocumentConfidentialityEnum.CONFIDENTIAL="CONFIDENTIAL",IfcDocumentConfidentialityEnum.PERSONAL="PERSONAL",IfcDocumentConfidentialityEnum.USERDEFINED="USERDEFINED",IfcDocumentConfidentialityEnum.NOTDEFINED="NOTDEFINED";var IfcDocumentStatusEnum=class{constructor(e){this.value=e}};IfcDocumentStatusEnum.DRAFT="DRAFT",IfcDocumentStatusEnum.FINALDRAFT="FINALDRAFT",IfcDocumentStatusEnum.FINAL="FINAL",IfcDocumentStatusEnum.REVISION="REVISION",IfcDocumentStatusEnum.NOTDEFINED="NOTDEFINED";var IfcDoorPanelOperationEnum=class{constructor(e){this.value=e}};IfcDoorPanelOperationEnum.SWINGING="SWINGING",IfcDoorPanelOperationEnum.DOUBLE_ACTING="DOUBLE_ACTING",IfcDoorPanelOperationEnum.SLIDING="SLIDING",IfcDoorPanelOperationEnum.FOLDING="FOLDING",IfcDoorPanelOperationEnum.REVOLVING="REVOLVING",IfcDoorPanelOperationEnum.ROLLINGUP="ROLLINGUP",IfcDoorPanelOperationEnum.FIXEDPANEL="FIXEDPANEL",IfcDoorPanelOperationEnum.USERDEFINED="USERDEFINED",IfcDoorPanelOperationEnum.NOTDEFINED="NOTDEFINED";var IfcDoorPanelPositionEnum=class{constructor(e){this.value=e}};IfcDoorPanelPositionEnum.LEFT="LEFT",IfcDoorPanelPositionEnum.MIDDLE="MIDDLE",IfcDoorPanelPositionEnum.RIGHT="RIGHT",IfcDoorPanelPositionEnum.NOTDEFINED="NOTDEFINED";var IfcDoorStyleConstructionEnum=class{constructor(e){this.value=e}};IfcDoorStyleConstructionEnum.ALUMINIUM="ALUMINIUM",IfcDoorStyleConstructionEnum.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",IfcDoorStyleConstructionEnum.STEEL="STEEL",IfcDoorStyleConstructionEnum.WOOD="WOOD",IfcDoorStyleConstructionEnum.ALUMINIUM_WOOD="ALUMINIUM_WOOD",IfcDoorStyleConstructionEnum.ALUMINIUM_PLASTIC="ALUMINIUM_PLASTIC",IfcDoorStyleConstructionEnum.PLASTIC="PLASTIC",IfcDoorStyleConstructionEnum.USERDEFINED="USERDEFINED",IfcDoorStyleConstructionEnum.NOTDEFINED="NOTDEFINED";var IfcDoorStyleOperationEnum=class{constructor(e){this.value=e}};IfcDoorStyleOperationEnum.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",IfcDoorStyleOperationEnum.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",IfcDoorStyleOperationEnum.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",IfcDoorStyleOperationEnum.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",IfcDoorStyleOperationEnum.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",IfcDoorStyleOperationEnum.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",IfcDoorStyleOperationEnum.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",IfcDoorStyleOperationEnum.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",IfcDoorStyleOperationEnum.SLIDING_TO_LEFT="SLIDING_TO_LEFT",IfcDoorStyleOperationEnum.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",IfcDoorStyleOperationEnum.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",IfcDoorStyleOperationEnum.FOLDING_TO_LEFT="FOLDING_TO_LEFT",IfcDoorStyleOperationEnum.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",IfcDoorStyleOperationEnum.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",IfcDoorStyleOperationEnum.REVOLVING="REVOLVING",IfcDoorStyleOperationEnum.ROLLINGUP="ROLLINGUP",IfcDoorStyleOperationEnum.USERDEFINED="USERDEFINED",IfcDoorStyleOperationEnum.NOTDEFINED="NOTDEFINED";var IfcDoorTypeEnum=class{constructor(e){this.value=e}};IfcDoorTypeEnum.DOOR="DOOR",IfcDoorTypeEnum.GATE="GATE",IfcDoorTypeEnum.TRAPDOOR="TRAPDOOR",IfcDoorTypeEnum.USERDEFINED="USERDEFINED",IfcDoorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDoorTypeOperationEnum=class{constructor(e){this.value=e}};IfcDoorTypeOperationEnum.SINGLE_SWING_LEFT="SINGLE_SWING_LEFT",IfcDoorTypeOperationEnum.SINGLE_SWING_RIGHT="SINGLE_SWING_RIGHT",IfcDoorTypeOperationEnum.DOUBLE_DOOR_SINGLE_SWING="DOUBLE_DOOR_SINGLE_SWING",IfcDoorTypeOperationEnum.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT",IfcDoorTypeOperationEnum.DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT="DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT",IfcDoorTypeOperationEnum.DOUBLE_SWING_LEFT="DOUBLE_SWING_LEFT",IfcDoorTypeOperationEnum.DOUBLE_SWING_RIGHT="DOUBLE_SWING_RIGHT",IfcDoorTypeOperationEnum.DOUBLE_DOOR_DOUBLE_SWING="DOUBLE_DOOR_DOUBLE_SWING",IfcDoorTypeOperationEnum.SLIDING_TO_LEFT="SLIDING_TO_LEFT",IfcDoorTypeOperationEnum.SLIDING_TO_RIGHT="SLIDING_TO_RIGHT",IfcDoorTypeOperationEnum.DOUBLE_DOOR_SLIDING="DOUBLE_DOOR_SLIDING",IfcDoorTypeOperationEnum.FOLDING_TO_LEFT="FOLDING_TO_LEFT",IfcDoorTypeOperationEnum.FOLDING_TO_RIGHT="FOLDING_TO_RIGHT",IfcDoorTypeOperationEnum.DOUBLE_DOOR_FOLDING="DOUBLE_DOOR_FOLDING",IfcDoorTypeOperationEnum.REVOLVING="REVOLVING",IfcDoorTypeOperationEnum.ROLLINGUP="ROLLINGUP",IfcDoorTypeOperationEnum.SWING_FIXED_LEFT="SWING_FIXED_LEFT",IfcDoorTypeOperationEnum.SWING_FIXED_RIGHT="SWING_FIXED_RIGHT",IfcDoorTypeOperationEnum.USERDEFINED="USERDEFINED",IfcDoorTypeOperationEnum.NOTDEFINED="NOTDEFINED";var IfcDuctFittingTypeEnum=class{constructor(e){this.value=e}};IfcDuctFittingTypeEnum.BEND="BEND",IfcDuctFittingTypeEnum.CONNECTOR="CONNECTOR",IfcDuctFittingTypeEnum.ENTRY="ENTRY",IfcDuctFittingTypeEnum.EXIT="EXIT",IfcDuctFittingTypeEnum.JUNCTION="JUNCTION",IfcDuctFittingTypeEnum.OBSTRUCTION="OBSTRUCTION",IfcDuctFittingTypeEnum.TRANSITION="TRANSITION",IfcDuctFittingTypeEnum.USERDEFINED="USERDEFINED",IfcDuctFittingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDuctSegmentTypeEnum=class{constructor(e){this.value=e}};IfcDuctSegmentTypeEnum.RIGIDSEGMENT="RIGIDSEGMENT",IfcDuctSegmentTypeEnum.FLEXIBLESEGMENT="FLEXIBLESEGMENT",IfcDuctSegmentTypeEnum.USERDEFINED="USERDEFINED",IfcDuctSegmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcDuctSilencerTypeEnum=class{constructor(e){this.value=e}};IfcDuctSilencerTypeEnum.FLATOVAL="FLATOVAL",IfcDuctSilencerTypeEnum.RECTANGULAR="RECTANGULAR",IfcDuctSilencerTypeEnum.ROUND="ROUND",IfcDuctSilencerTypeEnum.USERDEFINED="USERDEFINED",IfcDuctSilencerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricApplianceTypeEnum=class{constructor(e){this.value=e}};IfcElectricApplianceTypeEnum.DISHWASHER="DISHWASHER",IfcElectricApplianceTypeEnum.ELECTRICCOOKER="ELECTRICCOOKER",IfcElectricApplianceTypeEnum.FREESTANDINGELECTRICHEATER="FREESTANDINGELECTRICHEATER",IfcElectricApplianceTypeEnum.FREESTANDINGFAN="FREESTANDINGFAN",IfcElectricApplianceTypeEnum.FREESTANDINGWATERHEATER="FREESTANDINGWATERHEATER",IfcElectricApplianceTypeEnum.FREESTANDINGWATERCOOLER="FREESTANDINGWATERCOOLER",IfcElectricApplianceTypeEnum.FREEZER="FREEZER",IfcElectricApplianceTypeEnum.FRIDGE_FREEZER="FRIDGE_FREEZER",IfcElectricApplianceTypeEnum.HANDDRYER="HANDDRYER",IfcElectricApplianceTypeEnum.KITCHENMACHINE="KITCHENMACHINE",IfcElectricApplianceTypeEnum.MICROWAVE="MICROWAVE",IfcElectricApplianceTypeEnum.PHOTOCOPIER="PHOTOCOPIER",IfcElectricApplianceTypeEnum.REFRIGERATOR="REFRIGERATOR",IfcElectricApplianceTypeEnum.TUMBLEDRYER="TUMBLEDRYER",IfcElectricApplianceTypeEnum.VENDINGMACHINE="VENDINGMACHINE",IfcElectricApplianceTypeEnum.WASHINGMACHINE="WASHINGMACHINE",IfcElectricApplianceTypeEnum.USERDEFINED="USERDEFINED",IfcElectricApplianceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricDistributionBoardTypeEnum=class{constructor(e){this.value=e}};IfcElectricDistributionBoardTypeEnum.CONSUMERUNIT="CONSUMERUNIT",IfcElectricDistributionBoardTypeEnum.DISTRIBUTIONBOARD="DISTRIBUTIONBOARD",IfcElectricDistributionBoardTypeEnum.MOTORCONTROLCENTRE="MOTORCONTROLCENTRE",IfcElectricDistributionBoardTypeEnum.SWITCHBOARD="SWITCHBOARD",IfcElectricDistributionBoardTypeEnum.USERDEFINED="USERDEFINED",IfcElectricDistributionBoardTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricFlowStorageDeviceTypeEnum=class{constructor(e){this.value=e}};IfcElectricFlowStorageDeviceTypeEnum.BATTERY="BATTERY",IfcElectricFlowStorageDeviceTypeEnum.CAPACITORBANK="CAPACITORBANK",IfcElectricFlowStorageDeviceTypeEnum.HARMONICFILTER="HARMONICFILTER",IfcElectricFlowStorageDeviceTypeEnum.INDUCTORBANK="INDUCTORBANK",IfcElectricFlowStorageDeviceTypeEnum.UPS="UPS",IfcElectricFlowStorageDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcElectricFlowStorageDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricGeneratorTypeEnum=class{constructor(e){this.value=e}};IfcElectricGeneratorTypeEnum.CHP="CHP",IfcElectricGeneratorTypeEnum.ENGINEGENERATOR="ENGINEGENERATOR",IfcElectricGeneratorTypeEnum.STANDALONE="STANDALONE",IfcElectricGeneratorTypeEnum.USERDEFINED="USERDEFINED",IfcElectricGeneratorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricMotorTypeEnum=class{constructor(e){this.value=e}};IfcElectricMotorTypeEnum.DC="DC",IfcElectricMotorTypeEnum.INDUCTION="INDUCTION",IfcElectricMotorTypeEnum.POLYPHASE="POLYPHASE",IfcElectricMotorTypeEnum.RELUCTANCESYNCHRONOUS="RELUCTANCESYNCHRONOUS",IfcElectricMotorTypeEnum.SYNCHRONOUS="SYNCHRONOUS",IfcElectricMotorTypeEnum.USERDEFINED="USERDEFINED",IfcElectricMotorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElectricTimeControlTypeEnum=class{constructor(e){this.value=e}};IfcElectricTimeControlTypeEnum.TIMECLOCK="TIMECLOCK",IfcElectricTimeControlTypeEnum.TIMEDELAY="TIMEDELAY",IfcElectricTimeControlTypeEnum.RELAY="RELAY",IfcElectricTimeControlTypeEnum.USERDEFINED="USERDEFINED",IfcElectricTimeControlTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElementAssemblyTypeEnum=class{constructor(e){this.value=e}};IfcElementAssemblyTypeEnum.ACCESSORY_ASSEMBLY="ACCESSORY_ASSEMBLY",IfcElementAssemblyTypeEnum.ARCH="ARCH",IfcElementAssemblyTypeEnum.BEAM_GRID="BEAM_GRID",IfcElementAssemblyTypeEnum.BRACED_FRAME="BRACED_FRAME",IfcElementAssemblyTypeEnum.GIRDER="GIRDER",IfcElementAssemblyTypeEnum.REINFORCEMENT_UNIT="REINFORCEMENT_UNIT",IfcElementAssemblyTypeEnum.RIGID_FRAME="RIGID_FRAME",IfcElementAssemblyTypeEnum.SLAB_FIELD="SLAB_FIELD",IfcElementAssemblyTypeEnum.TRUSS="TRUSS",IfcElementAssemblyTypeEnum.ABUTMENT="ABUTMENT",IfcElementAssemblyTypeEnum.PIER="PIER",IfcElementAssemblyTypeEnum.PYLON="PYLON",IfcElementAssemblyTypeEnum.CROSS_BRACING="CROSS_BRACING",IfcElementAssemblyTypeEnum.DECK="DECK",IfcElementAssemblyTypeEnum.USERDEFINED="USERDEFINED",IfcElementAssemblyTypeEnum.NOTDEFINED="NOTDEFINED";var IfcElementCompositionEnum=class{constructor(e){this.value=e}};IfcElementCompositionEnum.COMPLEX="COMPLEX",IfcElementCompositionEnum.ELEMENT="ELEMENT",IfcElementCompositionEnum.PARTIAL="PARTIAL";var IfcEngineTypeEnum=class{constructor(e){this.value=e}};IfcEngineTypeEnum.EXTERNALCOMBUSTION="EXTERNALCOMBUSTION",IfcEngineTypeEnum.INTERNALCOMBUSTION="INTERNALCOMBUSTION",IfcEngineTypeEnum.USERDEFINED="USERDEFINED",IfcEngineTypeEnum.NOTDEFINED="NOTDEFINED";var IfcEvaporativeCoolerTypeEnum=class{constructor(e){this.value=e}};IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER="DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER",IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER="DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER",IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER="DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER",IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER="DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER",IfcEvaporativeCoolerTypeEnum.DIRECTEVAPORATIVEAIRWASHER="DIRECTEVAPORATIVEAIRWASHER",IfcEvaporativeCoolerTypeEnum.INDIRECTEVAPORATIVEPACKAGEAIRCOOLER="INDIRECTEVAPORATIVEPACKAGEAIRCOOLER",IfcEvaporativeCoolerTypeEnum.INDIRECTEVAPORATIVEWETCOIL="INDIRECTEVAPORATIVEWETCOIL",IfcEvaporativeCoolerTypeEnum.INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER="INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER",IfcEvaporativeCoolerTypeEnum.INDIRECTDIRECTCOMBINATION="INDIRECTDIRECTCOMBINATION",IfcEvaporativeCoolerTypeEnum.USERDEFINED="USERDEFINED",IfcEvaporativeCoolerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcEvaporatorTypeEnum=class{constructor(e){this.value=e}};IfcEvaporatorTypeEnum.DIRECTEXPANSION="DIRECTEXPANSION",IfcEvaporatorTypeEnum.DIRECTEXPANSIONSHELLANDTUBE="DIRECTEXPANSIONSHELLANDTUBE",IfcEvaporatorTypeEnum.DIRECTEXPANSIONTUBEINTUBE="DIRECTEXPANSIONTUBEINTUBE",IfcEvaporatorTypeEnum.DIRECTEXPANSIONBRAZEDPLATE="DIRECTEXPANSIONBRAZEDPLATE",IfcEvaporatorTypeEnum.FLOODEDSHELLANDTUBE="FLOODEDSHELLANDTUBE",IfcEvaporatorTypeEnum.SHELLANDCOIL="SHELLANDCOIL",IfcEvaporatorTypeEnum.USERDEFINED="USERDEFINED",IfcEvaporatorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcEventTriggerTypeEnum=class{constructor(e){this.value=e}};IfcEventTriggerTypeEnum.EVENTRULE="EVENTRULE",IfcEventTriggerTypeEnum.EVENTMESSAGE="EVENTMESSAGE",IfcEventTriggerTypeEnum.EVENTTIME="EVENTTIME",IfcEventTriggerTypeEnum.EVENTCOMPLEX="EVENTCOMPLEX",IfcEventTriggerTypeEnum.USERDEFINED="USERDEFINED",IfcEventTriggerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcEventTypeEnum=class{constructor(e){this.value=e}};IfcEventTypeEnum.STARTEVENT="STARTEVENT",IfcEventTypeEnum.ENDEVENT="ENDEVENT",IfcEventTypeEnum.INTERMEDIATEEVENT="INTERMEDIATEEVENT",IfcEventTypeEnum.USERDEFINED="USERDEFINED",IfcEventTypeEnum.NOTDEFINED="NOTDEFINED";var IfcExternalSpatialElementTypeEnum=class{constructor(e){this.value=e}};IfcExternalSpatialElementTypeEnum.EXTERNAL="EXTERNAL",IfcExternalSpatialElementTypeEnum.EXTERNAL_EARTH="EXTERNAL_EARTH",IfcExternalSpatialElementTypeEnum.EXTERNAL_WATER="EXTERNAL_WATER",IfcExternalSpatialElementTypeEnum.EXTERNAL_FIRE="EXTERNAL_FIRE",IfcExternalSpatialElementTypeEnum.USERDEFINED="USERDEFINED",IfcExternalSpatialElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFanTypeEnum=class{constructor(e){this.value=e}};IfcFanTypeEnum.CENTRIFUGALFORWARDCURVED="CENTRIFUGALFORWARDCURVED",IfcFanTypeEnum.CENTRIFUGALRADIAL="CENTRIFUGALRADIAL",IfcFanTypeEnum.CENTRIFUGALBACKWARDINCLINEDCURVED="CENTRIFUGALBACKWARDINCLINEDCURVED",IfcFanTypeEnum.CENTRIFUGALAIRFOIL="CENTRIFUGALAIRFOIL",IfcFanTypeEnum.TUBEAXIAL="TUBEAXIAL",IfcFanTypeEnum.VANEAXIAL="VANEAXIAL",IfcFanTypeEnum.PROPELLORAXIAL="PROPELLORAXIAL",IfcFanTypeEnum.USERDEFINED="USERDEFINED",IfcFanTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFastenerTypeEnum=class{constructor(e){this.value=e}};IfcFastenerTypeEnum.GLUE="GLUE",IfcFastenerTypeEnum.MORTAR="MORTAR",IfcFastenerTypeEnum.WELD="WELD",IfcFastenerTypeEnum.USERDEFINED="USERDEFINED",IfcFastenerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFilterTypeEnum=class{constructor(e){this.value=e}};IfcFilterTypeEnum.AIRPARTICLEFILTER="AIRPARTICLEFILTER",IfcFilterTypeEnum.COMPRESSEDAIRFILTER="COMPRESSEDAIRFILTER",IfcFilterTypeEnum.ODORFILTER="ODORFILTER",IfcFilterTypeEnum.OILFILTER="OILFILTER",IfcFilterTypeEnum.STRAINER="STRAINER",IfcFilterTypeEnum.WATERFILTER="WATERFILTER",IfcFilterTypeEnum.USERDEFINED="USERDEFINED",IfcFilterTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFireSuppressionTerminalTypeEnum=class{constructor(e){this.value=e}};IfcFireSuppressionTerminalTypeEnum.BREECHINGINLET="BREECHINGINLET",IfcFireSuppressionTerminalTypeEnum.FIREHYDRANT="FIREHYDRANT",IfcFireSuppressionTerminalTypeEnum.HOSEREEL="HOSEREEL",IfcFireSuppressionTerminalTypeEnum.SPRINKLER="SPRINKLER",IfcFireSuppressionTerminalTypeEnum.SPRINKLERDEFLECTOR="SPRINKLERDEFLECTOR",IfcFireSuppressionTerminalTypeEnum.USERDEFINED="USERDEFINED",IfcFireSuppressionTerminalTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFlowDirectionEnum=class{constructor(e){this.value=e}};IfcFlowDirectionEnum.SOURCE="SOURCE",IfcFlowDirectionEnum.SINK="SINK",IfcFlowDirectionEnum.SOURCEANDSINK="SOURCEANDSINK",IfcFlowDirectionEnum.NOTDEFINED="NOTDEFINED";var IfcFlowInstrumentTypeEnum=class{constructor(e){this.value=e}};IfcFlowInstrumentTypeEnum.PRESSUREGAUGE="PRESSUREGAUGE",IfcFlowInstrumentTypeEnum.THERMOMETER="THERMOMETER",IfcFlowInstrumentTypeEnum.AMMETER="AMMETER",IfcFlowInstrumentTypeEnum.FREQUENCYMETER="FREQUENCYMETER",IfcFlowInstrumentTypeEnum.POWERFACTORMETER="POWERFACTORMETER",IfcFlowInstrumentTypeEnum.PHASEANGLEMETER="PHASEANGLEMETER",IfcFlowInstrumentTypeEnum.VOLTMETER_PEAK="VOLTMETER_PEAK",IfcFlowInstrumentTypeEnum.VOLTMETER_RMS="VOLTMETER_RMS",IfcFlowInstrumentTypeEnum.USERDEFINED="USERDEFINED",IfcFlowInstrumentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFlowMeterTypeEnum=class{constructor(e){this.value=e}};IfcFlowMeterTypeEnum.ENERGYMETER="ENERGYMETER",IfcFlowMeterTypeEnum.GASMETER="GASMETER",IfcFlowMeterTypeEnum.OILMETER="OILMETER",IfcFlowMeterTypeEnum.WATERMETER="WATERMETER",IfcFlowMeterTypeEnum.USERDEFINED="USERDEFINED",IfcFlowMeterTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFootingTypeEnum=class{constructor(e){this.value=e}};IfcFootingTypeEnum.CAISSON_FOUNDATION="CAISSON_FOUNDATION",IfcFootingTypeEnum.FOOTING_BEAM="FOOTING_BEAM",IfcFootingTypeEnum.PAD_FOOTING="PAD_FOOTING",IfcFootingTypeEnum.PILE_CAP="PILE_CAP",IfcFootingTypeEnum.STRIP_FOOTING="STRIP_FOOTING",IfcFootingTypeEnum.USERDEFINED="USERDEFINED",IfcFootingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcFurnitureTypeEnum=class{constructor(e){this.value=e}};IfcFurnitureTypeEnum.CHAIR="CHAIR",IfcFurnitureTypeEnum.TABLE="TABLE",IfcFurnitureTypeEnum.DESK="DESK",IfcFurnitureTypeEnum.BED="BED",IfcFurnitureTypeEnum.FILECABINET="FILECABINET",IfcFurnitureTypeEnum.SHELF="SHELF",IfcFurnitureTypeEnum.SOFA="SOFA",IfcFurnitureTypeEnum.USERDEFINED="USERDEFINED",IfcFurnitureTypeEnum.NOTDEFINED="NOTDEFINED";var IfcGeographicElementTypeEnum=class{constructor(e){this.value=e}};IfcGeographicElementTypeEnum.TERRAIN="TERRAIN",IfcGeographicElementTypeEnum.SOIL_BORING_POINT="SOIL_BORING_POINT",IfcGeographicElementTypeEnum.USERDEFINED="USERDEFINED",IfcGeographicElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcGeometricProjectionEnum=class{constructor(e){this.value=e}};IfcGeometricProjectionEnum.GRAPH_VIEW="GRAPH_VIEW",IfcGeometricProjectionEnum.SKETCH_VIEW="SKETCH_VIEW",IfcGeometricProjectionEnum.MODEL_VIEW="MODEL_VIEW",IfcGeometricProjectionEnum.PLAN_VIEW="PLAN_VIEW",IfcGeometricProjectionEnum.REFLECTED_PLAN_VIEW="REFLECTED_PLAN_VIEW",IfcGeometricProjectionEnum.SECTION_VIEW="SECTION_VIEW",IfcGeometricProjectionEnum.ELEVATION_VIEW="ELEVATION_VIEW",IfcGeometricProjectionEnum.USERDEFINED="USERDEFINED",IfcGeometricProjectionEnum.NOTDEFINED="NOTDEFINED";var IfcGlobalOrLocalEnum=class{constructor(e){this.value=e}};IfcGlobalOrLocalEnum.GLOBAL_COORDS="GLOBAL_COORDS",IfcGlobalOrLocalEnum.LOCAL_COORDS="LOCAL_COORDS";var IfcGridTypeEnum=class{constructor(e){this.value=e}};IfcGridTypeEnum.RECTANGULAR="RECTANGULAR",IfcGridTypeEnum.RADIAL="RADIAL",IfcGridTypeEnum.TRIANGULAR="TRIANGULAR",IfcGridTypeEnum.IRREGULAR="IRREGULAR",IfcGridTypeEnum.USERDEFINED="USERDEFINED",IfcGridTypeEnum.NOTDEFINED="NOTDEFINED";var IfcHeatExchangerTypeEnum=class{constructor(e){this.value=e}};IfcHeatExchangerTypeEnum.PLATE="PLATE",IfcHeatExchangerTypeEnum.SHELLANDTUBE="SHELLANDTUBE",IfcHeatExchangerTypeEnum.USERDEFINED="USERDEFINED",IfcHeatExchangerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcHumidifierTypeEnum=class{constructor(e){this.value=e}};IfcHumidifierTypeEnum.STEAMINJECTION="STEAMINJECTION",IfcHumidifierTypeEnum.ADIABATICAIRWASHER="ADIABATICAIRWASHER",IfcHumidifierTypeEnum.ADIABATICPAN="ADIABATICPAN",IfcHumidifierTypeEnum.ADIABATICWETTEDELEMENT="ADIABATICWETTEDELEMENT",IfcHumidifierTypeEnum.ADIABATICATOMIZING="ADIABATICATOMIZING",IfcHumidifierTypeEnum.ADIABATICULTRASONIC="ADIABATICULTRASONIC",IfcHumidifierTypeEnum.ADIABATICRIGIDMEDIA="ADIABATICRIGIDMEDIA",IfcHumidifierTypeEnum.ADIABATICCOMPRESSEDAIRNOZZLE="ADIABATICCOMPRESSEDAIRNOZZLE",IfcHumidifierTypeEnum.ASSISTEDELECTRIC="ASSISTEDELECTRIC",IfcHumidifierTypeEnum.ASSISTEDNATURALGAS="ASSISTEDNATURALGAS",IfcHumidifierTypeEnum.ASSISTEDPROPANE="ASSISTEDPROPANE",IfcHumidifierTypeEnum.ASSISTEDBUTANE="ASSISTEDBUTANE",IfcHumidifierTypeEnum.ASSISTEDSTEAM="ASSISTEDSTEAM",IfcHumidifierTypeEnum.USERDEFINED="USERDEFINED",IfcHumidifierTypeEnum.NOTDEFINED="NOTDEFINED";var IfcInterceptorTypeEnum=class{constructor(e){this.value=e}};IfcInterceptorTypeEnum.CYCLONIC="CYCLONIC",IfcInterceptorTypeEnum.GREASE="GREASE",IfcInterceptorTypeEnum.OIL="OIL",IfcInterceptorTypeEnum.PETROL="PETROL",IfcInterceptorTypeEnum.USERDEFINED="USERDEFINED",IfcInterceptorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcInternalOrExternalEnum=class{constructor(e){this.value=e}};IfcInternalOrExternalEnum.INTERNAL="INTERNAL",IfcInternalOrExternalEnum.EXTERNAL="EXTERNAL",IfcInternalOrExternalEnum.EXTERNAL_EARTH="EXTERNAL_EARTH",IfcInternalOrExternalEnum.EXTERNAL_WATER="EXTERNAL_WATER",IfcInternalOrExternalEnum.EXTERNAL_FIRE="EXTERNAL_FIRE",IfcInternalOrExternalEnum.NOTDEFINED="NOTDEFINED";var IfcInventoryTypeEnum=class{constructor(e){this.value=e}};IfcInventoryTypeEnum.ASSETINVENTORY="ASSETINVENTORY",IfcInventoryTypeEnum.SPACEINVENTORY="SPACEINVENTORY",IfcInventoryTypeEnum.FURNITUREINVENTORY="FURNITUREINVENTORY",IfcInventoryTypeEnum.USERDEFINED="USERDEFINED",IfcInventoryTypeEnum.NOTDEFINED="NOTDEFINED";var IfcJunctionBoxTypeEnum=class{constructor(e){this.value=e}};IfcJunctionBoxTypeEnum.DATA="DATA",IfcJunctionBoxTypeEnum.POWER="POWER",IfcJunctionBoxTypeEnum.USERDEFINED="USERDEFINED",IfcJunctionBoxTypeEnum.NOTDEFINED="NOTDEFINED";var IfcKnotType=class{constructor(e){this.value=e}};IfcKnotType.UNIFORM_KNOTS="UNIFORM_KNOTS",IfcKnotType.QUASI_UNIFORM_KNOTS="QUASI_UNIFORM_KNOTS",IfcKnotType.PIECEWISE_BEZIER_KNOTS="PIECEWISE_BEZIER_KNOTS",IfcKnotType.UNSPECIFIED="UNSPECIFIED";var IfcLaborResourceTypeEnum=class{constructor(e){this.value=e}};IfcLaborResourceTypeEnum.ADMINISTRATION="ADMINISTRATION",IfcLaborResourceTypeEnum.CARPENTRY="CARPENTRY",IfcLaborResourceTypeEnum.CLEANING="CLEANING",IfcLaborResourceTypeEnum.CONCRETE="CONCRETE",IfcLaborResourceTypeEnum.DRYWALL="DRYWALL",IfcLaborResourceTypeEnum.ELECTRIC="ELECTRIC",IfcLaborResourceTypeEnum.FINISHING="FINISHING",IfcLaborResourceTypeEnum.FLOORING="FLOORING",IfcLaborResourceTypeEnum.GENERAL="GENERAL",IfcLaborResourceTypeEnum.HVAC="HVAC",IfcLaborResourceTypeEnum.LANDSCAPING="LANDSCAPING",IfcLaborResourceTypeEnum.MASONRY="MASONRY",IfcLaborResourceTypeEnum.PAINTING="PAINTING",IfcLaborResourceTypeEnum.PAVING="PAVING",IfcLaborResourceTypeEnum.PLUMBING="PLUMBING",IfcLaborResourceTypeEnum.ROOFING="ROOFING",IfcLaborResourceTypeEnum.SITEGRADING="SITEGRADING",IfcLaborResourceTypeEnum.STEELWORK="STEELWORK",IfcLaborResourceTypeEnum.SURVEYING="SURVEYING",IfcLaborResourceTypeEnum.USERDEFINED="USERDEFINED",IfcLaborResourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcLampTypeEnum=class{constructor(e){this.value=e}};IfcLampTypeEnum.COMPACTFLUORESCENT="COMPACTFLUORESCENT",IfcLampTypeEnum.FLUORESCENT="FLUORESCENT",IfcLampTypeEnum.HALOGEN="HALOGEN",IfcLampTypeEnum.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",IfcLampTypeEnum.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",IfcLampTypeEnum.LED="LED",IfcLampTypeEnum.METALHALIDE="METALHALIDE",IfcLampTypeEnum.OLED="OLED",IfcLampTypeEnum.TUNGSTENFILAMENT="TUNGSTENFILAMENT",IfcLampTypeEnum.USERDEFINED="USERDEFINED",IfcLampTypeEnum.NOTDEFINED="NOTDEFINED";var IfcLayerSetDirectionEnum=class{constructor(e){this.value=e}};IfcLayerSetDirectionEnum.AXIS1="AXIS1",IfcLayerSetDirectionEnum.AXIS2="AXIS2",IfcLayerSetDirectionEnum.AXIS3="AXIS3";var IfcLightDistributionCurveEnum=class{constructor(e){this.value=e}};IfcLightDistributionCurveEnum.TYPE_A="TYPE_A",IfcLightDistributionCurveEnum.TYPE_B="TYPE_B",IfcLightDistributionCurveEnum.TYPE_C="TYPE_C",IfcLightDistributionCurveEnum.NOTDEFINED="NOTDEFINED";var IfcLightEmissionSourceEnum=class{constructor(e){this.value=e}};IfcLightEmissionSourceEnum.COMPACTFLUORESCENT="COMPACTFLUORESCENT",IfcLightEmissionSourceEnum.FLUORESCENT="FLUORESCENT",IfcLightEmissionSourceEnum.HIGHPRESSUREMERCURY="HIGHPRESSUREMERCURY",IfcLightEmissionSourceEnum.HIGHPRESSURESODIUM="HIGHPRESSURESODIUM",IfcLightEmissionSourceEnum.LIGHTEMITTINGDIODE="LIGHTEMITTINGDIODE",IfcLightEmissionSourceEnum.LOWPRESSURESODIUM="LOWPRESSURESODIUM",IfcLightEmissionSourceEnum.LOWVOLTAGEHALOGEN="LOWVOLTAGEHALOGEN",IfcLightEmissionSourceEnum.MAINVOLTAGEHALOGEN="MAINVOLTAGEHALOGEN",IfcLightEmissionSourceEnum.METALHALIDE="METALHALIDE",IfcLightEmissionSourceEnum.TUNGSTENFILAMENT="TUNGSTENFILAMENT",IfcLightEmissionSourceEnum.NOTDEFINED="NOTDEFINED";var IfcLightFixtureTypeEnum=class{constructor(e){this.value=e}};IfcLightFixtureTypeEnum.POINTSOURCE="POINTSOURCE",IfcLightFixtureTypeEnum.DIRECTIONSOURCE="DIRECTIONSOURCE",IfcLightFixtureTypeEnum.SECURITYLIGHTING="SECURITYLIGHTING",IfcLightFixtureTypeEnum.USERDEFINED="USERDEFINED",IfcLightFixtureTypeEnum.NOTDEFINED="NOTDEFINED";var IfcLoadGroupTypeEnum=class{constructor(e){this.value=e}};IfcLoadGroupTypeEnum.LOAD_GROUP="LOAD_GROUP",IfcLoadGroupTypeEnum.LOAD_CASE="LOAD_CASE",IfcLoadGroupTypeEnum.LOAD_COMBINATION="LOAD_COMBINATION",IfcLoadGroupTypeEnum.USERDEFINED="USERDEFINED",IfcLoadGroupTypeEnum.NOTDEFINED="NOTDEFINED";var IfcLogicalOperatorEnum=class{constructor(e){this.value=e}};IfcLogicalOperatorEnum.LOGICALAND="LOGICALAND",IfcLogicalOperatorEnum.LOGICALOR="LOGICALOR",IfcLogicalOperatorEnum.LOGICALXOR="LOGICALXOR",IfcLogicalOperatorEnum.LOGICALNOTAND="LOGICALNOTAND",IfcLogicalOperatorEnum.LOGICALNOTOR="LOGICALNOTOR";var IfcMechanicalFastenerTypeEnum=class{constructor(e){this.value=e}};IfcMechanicalFastenerTypeEnum.ANCHORBOLT="ANCHORBOLT",IfcMechanicalFastenerTypeEnum.BOLT="BOLT",IfcMechanicalFastenerTypeEnum.DOWEL="DOWEL",IfcMechanicalFastenerTypeEnum.NAIL="NAIL",IfcMechanicalFastenerTypeEnum.NAILPLATE="NAILPLATE",IfcMechanicalFastenerTypeEnum.RIVET="RIVET",IfcMechanicalFastenerTypeEnum.SCREW="SCREW",IfcMechanicalFastenerTypeEnum.SHEARCONNECTOR="SHEARCONNECTOR",IfcMechanicalFastenerTypeEnum.STAPLE="STAPLE",IfcMechanicalFastenerTypeEnum.STUDSHEARCONNECTOR="STUDSHEARCONNECTOR",IfcMechanicalFastenerTypeEnum.COUPLER="COUPLER",IfcMechanicalFastenerTypeEnum.USERDEFINED="USERDEFINED",IfcMechanicalFastenerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcMedicalDeviceTypeEnum=class{constructor(e){this.value=e}};IfcMedicalDeviceTypeEnum.AIRSTATION="AIRSTATION",IfcMedicalDeviceTypeEnum.FEEDAIRUNIT="FEEDAIRUNIT",IfcMedicalDeviceTypeEnum.OXYGENGENERATOR="OXYGENGENERATOR",IfcMedicalDeviceTypeEnum.OXYGENPLANT="OXYGENPLANT",IfcMedicalDeviceTypeEnum.VACUUMSTATION="VACUUMSTATION",IfcMedicalDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcMedicalDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcMemberTypeEnum=class{constructor(e){this.value=e}};IfcMemberTypeEnum.BRACE="BRACE",IfcMemberTypeEnum.CHORD="CHORD",IfcMemberTypeEnum.COLLAR="COLLAR",IfcMemberTypeEnum.MEMBER="MEMBER",IfcMemberTypeEnum.MULLION="MULLION",IfcMemberTypeEnum.PLATE="PLATE",IfcMemberTypeEnum.POST="POST",IfcMemberTypeEnum.PURLIN="PURLIN",IfcMemberTypeEnum.RAFTER="RAFTER",IfcMemberTypeEnum.STRINGER="STRINGER",IfcMemberTypeEnum.STRUT="STRUT",IfcMemberTypeEnum.STUD="STUD",IfcMemberTypeEnum.STIFFENING_RIB="STIFFENING_RIB",IfcMemberTypeEnum.ARCH_SEGMENT="ARCH_SEGMENT",IfcMemberTypeEnum.SUSPENSION_CABLE="SUSPENSION_CABLE",IfcMemberTypeEnum.SUSPENDER="SUSPENDER",IfcMemberTypeEnum.STAY_CABLE="STAY_CABLE",IfcMemberTypeEnum.USERDEFINED="USERDEFINED",IfcMemberTypeEnum.NOTDEFINED="NOTDEFINED";var IfcMotorConnectionTypeEnum=class{constructor(e){this.value=e}};IfcMotorConnectionTypeEnum.BELTDRIVE="BELTDRIVE",IfcMotorConnectionTypeEnum.COUPLING="COUPLING",IfcMotorConnectionTypeEnum.DIRECTDRIVE="DIRECTDRIVE",IfcMotorConnectionTypeEnum.USERDEFINED="USERDEFINED",IfcMotorConnectionTypeEnum.NOTDEFINED="NOTDEFINED";var IfcNullStyle=class{constructor(e){this.value=e}};IfcNullStyle.NULL="NULL";var IfcObjectTypeEnum=class{constructor(e){this.value=e}};IfcObjectTypeEnum.PRODUCT="PRODUCT",IfcObjectTypeEnum.PROCESS="PROCESS",IfcObjectTypeEnum.CONTROL="CONTROL",IfcObjectTypeEnum.RESOURCE="RESOURCE",IfcObjectTypeEnum.ACTOR="ACTOR",IfcObjectTypeEnum.GROUP="GROUP",IfcObjectTypeEnum.PROJECT="PROJECT",IfcObjectTypeEnum.NOTDEFINED="NOTDEFINED";var IfcObjectiveEnum=class{constructor(e){this.value=e}};IfcObjectiveEnum.CODECOMPLIANCE="CODECOMPLIANCE",IfcObjectiveEnum.CODEWAIVER="CODEWAIVER",IfcObjectiveEnum.DESIGNINTENT="DESIGNINTENT",IfcObjectiveEnum.EXTERNAL="EXTERNAL",IfcObjectiveEnum.HEALTHANDSAFETY="HEALTHANDSAFETY",IfcObjectiveEnum.MERGECONFLICT="MERGECONFLICT",IfcObjectiveEnum.MODELVIEW="MODELVIEW",IfcObjectiveEnum.PARAMETER="PARAMETER",IfcObjectiveEnum.REQUIREMENT="REQUIREMENT",IfcObjectiveEnum.SPECIFICATION="SPECIFICATION",IfcObjectiveEnum.TRIGGERCONDITION="TRIGGERCONDITION",IfcObjectiveEnum.USERDEFINED="USERDEFINED",IfcObjectiveEnum.NOTDEFINED="NOTDEFINED";var IfcOccupantTypeEnum=class{constructor(e){this.value=e}};IfcOccupantTypeEnum.ASSIGNEE="ASSIGNEE",IfcOccupantTypeEnum.ASSIGNOR="ASSIGNOR",IfcOccupantTypeEnum.LESSEE="LESSEE",IfcOccupantTypeEnum.LESSOR="LESSOR",IfcOccupantTypeEnum.LETTINGAGENT="LETTINGAGENT",IfcOccupantTypeEnum.OWNER="OWNER",IfcOccupantTypeEnum.TENANT="TENANT",IfcOccupantTypeEnum.USERDEFINED="USERDEFINED",IfcOccupantTypeEnum.NOTDEFINED="NOTDEFINED";var IfcOpeningElementTypeEnum=class{constructor(e){this.value=e}};IfcOpeningElementTypeEnum.OPENING="OPENING",IfcOpeningElementTypeEnum.RECESS="RECESS",IfcOpeningElementTypeEnum.USERDEFINED="USERDEFINED",IfcOpeningElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcOutletTypeEnum=class{constructor(e){this.value=e}};IfcOutletTypeEnum.AUDIOVISUALOUTLET="AUDIOVISUALOUTLET",IfcOutletTypeEnum.COMMUNICATIONSOUTLET="COMMUNICATIONSOUTLET",IfcOutletTypeEnum.POWEROUTLET="POWEROUTLET",IfcOutletTypeEnum.DATAOUTLET="DATAOUTLET",IfcOutletTypeEnum.TELEPHONEOUTLET="TELEPHONEOUTLET",IfcOutletTypeEnum.USERDEFINED="USERDEFINED",IfcOutletTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPerformanceHistoryTypeEnum=class{constructor(e){this.value=e}};IfcPerformanceHistoryTypeEnum.USERDEFINED="USERDEFINED",IfcPerformanceHistoryTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPermeableCoveringOperationEnum=class{constructor(e){this.value=e}};IfcPermeableCoveringOperationEnum.GRILL="GRILL",IfcPermeableCoveringOperationEnum.LOUVER="LOUVER",IfcPermeableCoveringOperationEnum.SCREEN="SCREEN",IfcPermeableCoveringOperationEnum.USERDEFINED="USERDEFINED",IfcPermeableCoveringOperationEnum.NOTDEFINED="NOTDEFINED";var IfcPermitTypeEnum=class{constructor(e){this.value=e}};IfcPermitTypeEnum.ACCESS="ACCESS",IfcPermitTypeEnum.BUILDING="BUILDING",IfcPermitTypeEnum.WORK="WORK",IfcPermitTypeEnum.USERDEFINED="USERDEFINED",IfcPermitTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPhysicalOrVirtualEnum=class{constructor(e){this.value=e}};IfcPhysicalOrVirtualEnum.PHYSICAL="PHYSICAL",IfcPhysicalOrVirtualEnum.VIRTUAL="VIRTUAL",IfcPhysicalOrVirtualEnum.NOTDEFINED="NOTDEFINED";var IfcPileConstructionEnum=class{constructor(e){this.value=e}};IfcPileConstructionEnum.CAST_IN_PLACE="CAST_IN_PLACE",IfcPileConstructionEnum.COMPOSITE="COMPOSITE",IfcPileConstructionEnum.PRECAST_CONCRETE="PRECAST_CONCRETE",IfcPileConstructionEnum.PREFAB_STEEL="PREFAB_STEEL",IfcPileConstructionEnum.USERDEFINED="USERDEFINED",IfcPileConstructionEnum.NOTDEFINED="NOTDEFINED";var IfcPileTypeEnum=class{constructor(e){this.value=e}};IfcPileTypeEnum.BORED="BORED",IfcPileTypeEnum.DRIVEN="DRIVEN",IfcPileTypeEnum.JETGROUTING="JETGROUTING",IfcPileTypeEnum.COHESION="COHESION",IfcPileTypeEnum.FRICTION="FRICTION",IfcPileTypeEnum.SUPPORT="SUPPORT",IfcPileTypeEnum.USERDEFINED="USERDEFINED",IfcPileTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPipeFittingTypeEnum=class{constructor(e){this.value=e}};IfcPipeFittingTypeEnum.BEND="BEND",IfcPipeFittingTypeEnum.CONNECTOR="CONNECTOR",IfcPipeFittingTypeEnum.ENTRY="ENTRY",IfcPipeFittingTypeEnum.EXIT="EXIT",IfcPipeFittingTypeEnum.JUNCTION="JUNCTION",IfcPipeFittingTypeEnum.OBSTRUCTION="OBSTRUCTION",IfcPipeFittingTypeEnum.TRANSITION="TRANSITION",IfcPipeFittingTypeEnum.USERDEFINED="USERDEFINED",IfcPipeFittingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPipeSegmentTypeEnum=class{constructor(e){this.value=e}};IfcPipeSegmentTypeEnum.CULVERT="CULVERT",IfcPipeSegmentTypeEnum.FLEXIBLESEGMENT="FLEXIBLESEGMENT",IfcPipeSegmentTypeEnum.RIGIDSEGMENT="RIGIDSEGMENT",IfcPipeSegmentTypeEnum.GUTTER="GUTTER",IfcPipeSegmentTypeEnum.SPOOL="SPOOL",IfcPipeSegmentTypeEnum.USERDEFINED="USERDEFINED",IfcPipeSegmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPlateTypeEnum=class{constructor(e){this.value=e}};IfcPlateTypeEnum.CURTAIN_PANEL="CURTAIN_PANEL",IfcPlateTypeEnum.SHEET="SHEET",IfcPlateTypeEnum.FLANGE_PLATE="FLANGE_PLATE",IfcPlateTypeEnum.WEB_PLATE="WEB_PLATE",IfcPlateTypeEnum.STIFFENER_PLATE="STIFFENER_PLATE",IfcPlateTypeEnum.GUSSET_PLATE="GUSSET_PLATE",IfcPlateTypeEnum.COVER_PLATE="COVER_PLATE",IfcPlateTypeEnum.SPLICE_PLATE="SPLICE_PLATE",IfcPlateTypeEnum.BASE_PLATE="BASE_PLATE",IfcPlateTypeEnum.USERDEFINED="USERDEFINED",IfcPlateTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPreferredSurfaceCurveRepresentation=class{constructor(e){this.value=e}};IfcPreferredSurfaceCurveRepresentation.CURVE3D="CURVE3D",IfcPreferredSurfaceCurveRepresentation.PCURVE_S1="PCURVE_S1",IfcPreferredSurfaceCurveRepresentation.PCURVE_S2="PCURVE_S2";var IfcProcedureTypeEnum=class{constructor(e){this.value=e}};IfcProcedureTypeEnum.ADVICE_CAUTION="ADVICE_CAUTION",IfcProcedureTypeEnum.ADVICE_NOTE="ADVICE_NOTE",IfcProcedureTypeEnum.ADVICE_WARNING="ADVICE_WARNING",IfcProcedureTypeEnum.CALIBRATION="CALIBRATION",IfcProcedureTypeEnum.DIAGNOSTIC="DIAGNOSTIC",IfcProcedureTypeEnum.SHUTDOWN="SHUTDOWN",IfcProcedureTypeEnum.STARTUP="STARTUP",IfcProcedureTypeEnum.USERDEFINED="USERDEFINED",IfcProcedureTypeEnum.NOTDEFINED="NOTDEFINED";var IfcProfileTypeEnum=class{constructor(e){this.value=e}};IfcProfileTypeEnum.CURVE="CURVE",IfcProfileTypeEnum.AREA="AREA";var IfcProjectOrderTypeEnum=class{constructor(e){this.value=e}};IfcProjectOrderTypeEnum.CHANGEORDER="CHANGEORDER",IfcProjectOrderTypeEnum.MAINTENANCEWORKORDER="MAINTENANCEWORKORDER",IfcProjectOrderTypeEnum.MOVEORDER="MOVEORDER",IfcProjectOrderTypeEnum.PURCHASEORDER="PURCHASEORDER",IfcProjectOrderTypeEnum.WORKORDER="WORKORDER",IfcProjectOrderTypeEnum.USERDEFINED="USERDEFINED",IfcProjectOrderTypeEnum.NOTDEFINED="NOTDEFINED";var IfcProjectedOrTrueLengthEnum=class{constructor(e){this.value=e}};IfcProjectedOrTrueLengthEnum.PROJECTED_LENGTH="PROJECTED_LENGTH",IfcProjectedOrTrueLengthEnum.TRUE_LENGTH="TRUE_LENGTH";var IfcProjectionElementTypeEnum=class{constructor(e){this.value=e}};IfcProjectionElementTypeEnum.BLISTER="BLISTER",IfcProjectionElementTypeEnum.DEVIATOR="DEVIATOR",IfcProjectionElementTypeEnum.USERDEFINED="USERDEFINED",IfcProjectionElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPropertySetTemplateTypeEnum=class{constructor(e){this.value=e}};IfcPropertySetTemplateTypeEnum.PSET_TYPEDRIVENONLY="PSET_TYPEDRIVENONLY",IfcPropertySetTemplateTypeEnum.PSET_TYPEDRIVENOVERRIDE="PSET_TYPEDRIVENOVERRIDE",IfcPropertySetTemplateTypeEnum.PSET_OCCURRENCEDRIVEN="PSET_OCCURRENCEDRIVEN",IfcPropertySetTemplateTypeEnum.PSET_PERFORMANCEDRIVEN="PSET_PERFORMANCEDRIVEN",IfcPropertySetTemplateTypeEnum.QTO_TYPEDRIVENONLY="QTO_TYPEDRIVENONLY",IfcPropertySetTemplateTypeEnum.QTO_TYPEDRIVENOVERRIDE="QTO_TYPEDRIVENOVERRIDE",IfcPropertySetTemplateTypeEnum.QTO_OCCURRENCEDRIVEN="QTO_OCCURRENCEDRIVEN",IfcPropertySetTemplateTypeEnum.NOTDEFINED="NOTDEFINED";var IfcProtectiveDeviceTrippingUnitTypeEnum=class{constructor(e){this.value=e}};IfcProtectiveDeviceTrippingUnitTypeEnum.ELECTRONIC="ELECTRONIC",IfcProtectiveDeviceTrippingUnitTypeEnum.ELECTROMAGNETIC="ELECTROMAGNETIC",IfcProtectiveDeviceTrippingUnitTypeEnum.RESIDUALCURRENT="RESIDUALCURRENT",IfcProtectiveDeviceTrippingUnitTypeEnum.THERMAL="THERMAL",IfcProtectiveDeviceTrippingUnitTypeEnum.USERDEFINED="USERDEFINED",IfcProtectiveDeviceTrippingUnitTypeEnum.NOTDEFINED="NOTDEFINED";var IfcProtectiveDeviceTypeEnum=class{constructor(e){this.value=e}};IfcProtectiveDeviceTypeEnum.CIRCUITBREAKER="CIRCUITBREAKER",IfcProtectiveDeviceTypeEnum.EARTHLEAKAGECIRCUITBREAKER="EARTHLEAKAGECIRCUITBREAKER",IfcProtectiveDeviceTypeEnum.EARTHINGSWITCH="EARTHINGSWITCH",IfcProtectiveDeviceTypeEnum.FUSEDISCONNECTOR="FUSEDISCONNECTOR",IfcProtectiveDeviceTypeEnum.RESIDUALCURRENTCIRCUITBREAKER="RESIDUALCURRENTCIRCUITBREAKER",IfcProtectiveDeviceTypeEnum.RESIDUALCURRENTSWITCH="RESIDUALCURRENTSWITCH",IfcProtectiveDeviceTypeEnum.VARISTOR="VARISTOR",IfcProtectiveDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcProtectiveDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcPumpTypeEnum=class{constructor(e){this.value=e}};IfcPumpTypeEnum.CIRCULATOR="CIRCULATOR",IfcPumpTypeEnum.ENDSUCTION="ENDSUCTION",IfcPumpTypeEnum.SPLITCASE="SPLITCASE",IfcPumpTypeEnum.SUBMERSIBLEPUMP="SUBMERSIBLEPUMP",IfcPumpTypeEnum.SUMPPUMP="SUMPPUMP",IfcPumpTypeEnum.VERTICALINLINE="VERTICALINLINE",IfcPumpTypeEnum.VERTICALTURBINE="VERTICALTURBINE",IfcPumpTypeEnum.USERDEFINED="USERDEFINED",IfcPumpTypeEnum.NOTDEFINED="NOTDEFINED";var IfcRailingTypeEnum=class{constructor(e){this.value=e}};IfcRailingTypeEnum.HANDRAIL="HANDRAIL",IfcRailingTypeEnum.GUARDRAIL="GUARDRAIL",IfcRailingTypeEnum.BALUSTRADE="BALUSTRADE",IfcRailingTypeEnum.USERDEFINED="USERDEFINED",IfcRailingTypeEnum.NOTDEFINED="NOTDEFINED";var IfcRampFlightTypeEnum=class{constructor(e){this.value=e}};IfcRampFlightTypeEnum.STRAIGHT="STRAIGHT",IfcRampFlightTypeEnum.SPIRAL="SPIRAL",IfcRampFlightTypeEnum.USERDEFINED="USERDEFINED",IfcRampFlightTypeEnum.NOTDEFINED="NOTDEFINED";var IfcRampTypeEnum=class{constructor(e){this.value=e}};IfcRampTypeEnum.STRAIGHT_RUN_RAMP="STRAIGHT_RUN_RAMP",IfcRampTypeEnum.TWO_STRAIGHT_RUN_RAMP="TWO_STRAIGHT_RUN_RAMP",IfcRampTypeEnum.QUARTER_TURN_RAMP="QUARTER_TURN_RAMP",IfcRampTypeEnum.TWO_QUARTER_TURN_RAMP="TWO_QUARTER_TURN_RAMP",IfcRampTypeEnum.HALF_TURN_RAMP="HALF_TURN_RAMP",IfcRampTypeEnum.SPIRAL_RAMP="SPIRAL_RAMP",IfcRampTypeEnum.USERDEFINED="USERDEFINED",IfcRampTypeEnum.NOTDEFINED="NOTDEFINED";var IfcRecurrenceTypeEnum=class{constructor(e){this.value=e}};IfcRecurrenceTypeEnum.DAILY="DAILY",IfcRecurrenceTypeEnum.WEEKLY="WEEKLY",IfcRecurrenceTypeEnum.MONTHLY_BY_DAY_OF_MONTH="MONTHLY_BY_DAY_OF_MONTH",IfcRecurrenceTypeEnum.MONTHLY_BY_POSITION="MONTHLY_BY_POSITION",IfcRecurrenceTypeEnum.BY_DAY_COUNT="BY_DAY_COUNT",IfcRecurrenceTypeEnum.BY_WEEKDAY_COUNT="BY_WEEKDAY_COUNT",IfcRecurrenceTypeEnum.YEARLY_BY_DAY_OF_MONTH="YEARLY_BY_DAY_OF_MONTH",IfcRecurrenceTypeEnum.YEARLY_BY_POSITION="YEARLY_BY_POSITION";var IfcReferentTypeEnum=class{constructor(e){this.value=e}};IfcReferentTypeEnum.KILOPOINT="KILOPOINT",IfcReferentTypeEnum.MILEPOINT="MILEPOINT",IfcReferentTypeEnum.STATION="STATION",IfcReferentTypeEnum.USERDEFINED="USERDEFINED",IfcReferentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcReflectanceMethodEnum=class{constructor(e){this.value=e}};IfcReflectanceMethodEnum.BLINN="BLINN",IfcReflectanceMethodEnum.FLAT="FLAT",IfcReflectanceMethodEnum.GLASS="GLASS",IfcReflectanceMethodEnum.MATT="MATT",IfcReflectanceMethodEnum.METAL="METAL",IfcReflectanceMethodEnum.MIRROR="MIRROR",IfcReflectanceMethodEnum.PHONG="PHONG",IfcReflectanceMethodEnum.PLASTIC="PLASTIC",IfcReflectanceMethodEnum.STRAUSS="STRAUSS",IfcReflectanceMethodEnum.NOTDEFINED="NOTDEFINED";var IfcReinforcingBarRoleEnum=class{constructor(e){this.value=e}};IfcReinforcingBarRoleEnum.MAIN="MAIN",IfcReinforcingBarRoleEnum.SHEAR="SHEAR",IfcReinforcingBarRoleEnum.LIGATURE="LIGATURE",IfcReinforcingBarRoleEnum.STUD="STUD",IfcReinforcingBarRoleEnum.PUNCHING="PUNCHING",IfcReinforcingBarRoleEnum.EDGE="EDGE",IfcReinforcingBarRoleEnum.RING="RING",IfcReinforcingBarRoleEnum.ANCHORING="ANCHORING",IfcReinforcingBarRoleEnum.USERDEFINED="USERDEFINED",IfcReinforcingBarRoleEnum.NOTDEFINED="NOTDEFINED";var IfcReinforcingBarSurfaceEnum=class{constructor(e){this.value=e}};IfcReinforcingBarSurfaceEnum.PLAIN="PLAIN",IfcReinforcingBarSurfaceEnum.TEXTURED="TEXTURED";var IfcReinforcingBarTypeEnum=class{constructor(e){this.value=e}};IfcReinforcingBarTypeEnum.ANCHORING="ANCHORING",IfcReinforcingBarTypeEnum.EDGE="EDGE",IfcReinforcingBarTypeEnum.LIGATURE="LIGATURE",IfcReinforcingBarTypeEnum.MAIN="MAIN",IfcReinforcingBarTypeEnum.PUNCHING="PUNCHING",IfcReinforcingBarTypeEnum.RING="RING",IfcReinforcingBarTypeEnum.SHEAR="SHEAR",IfcReinforcingBarTypeEnum.STUD="STUD",IfcReinforcingBarTypeEnum.SPACEBAR="SPACEBAR",IfcReinforcingBarTypeEnum.USERDEFINED="USERDEFINED",IfcReinforcingBarTypeEnum.NOTDEFINED="NOTDEFINED";var IfcReinforcingMeshTypeEnum=class{constructor(e){this.value=e}};IfcReinforcingMeshTypeEnum.USERDEFINED="USERDEFINED",IfcReinforcingMeshTypeEnum.NOTDEFINED="NOTDEFINED";var IfcRoleEnum=class{constructor(e){this.value=e}};IfcRoleEnum.SUPPLIER="SUPPLIER",IfcRoleEnum.MANUFACTURER="MANUFACTURER",IfcRoleEnum.CONTRACTOR="CONTRACTOR",IfcRoleEnum.SUBCONTRACTOR="SUBCONTRACTOR",IfcRoleEnum.ARCHITECT="ARCHITECT",IfcRoleEnum.STRUCTURALENGINEER="STRUCTURALENGINEER",IfcRoleEnum.COSTENGINEER="COSTENGINEER",IfcRoleEnum.CLIENT="CLIENT",IfcRoleEnum.BUILDINGOWNER="BUILDINGOWNER",IfcRoleEnum.BUILDINGOPERATOR="BUILDINGOPERATOR",IfcRoleEnum.MECHANICALENGINEER="MECHANICALENGINEER",IfcRoleEnum.ELECTRICALENGINEER="ELECTRICALENGINEER",IfcRoleEnum.PROJECTMANAGER="PROJECTMANAGER",IfcRoleEnum.FACILITIESMANAGER="FACILITIESMANAGER",IfcRoleEnum.CIVILENGINEER="CIVILENGINEER",IfcRoleEnum.COMMISSIONINGENGINEER="COMMISSIONINGENGINEER",IfcRoleEnum.ENGINEER="ENGINEER",IfcRoleEnum.OWNER="OWNER",IfcRoleEnum.CONSULTANT="CONSULTANT",IfcRoleEnum.CONSTRUCTIONMANAGER="CONSTRUCTIONMANAGER",IfcRoleEnum.FIELDCONSTRUCTIONMANAGER="FIELDCONSTRUCTIONMANAGER",IfcRoleEnum.RESELLER="RESELLER",IfcRoleEnum.USERDEFINED="USERDEFINED";var IfcRoofTypeEnum=class{constructor(e){this.value=e}};IfcRoofTypeEnum.FLAT_ROOF="FLAT_ROOF",IfcRoofTypeEnum.SHED_ROOF="SHED_ROOF",IfcRoofTypeEnum.GABLE_ROOF="GABLE_ROOF",IfcRoofTypeEnum.HIP_ROOF="HIP_ROOF",IfcRoofTypeEnum.HIPPED_GABLE_ROOF="HIPPED_GABLE_ROOF",IfcRoofTypeEnum.GAMBREL_ROOF="GAMBREL_ROOF",IfcRoofTypeEnum.MANSARD_ROOF="MANSARD_ROOF",IfcRoofTypeEnum.BARREL_ROOF="BARREL_ROOF",IfcRoofTypeEnum.RAINBOW_ROOF="RAINBOW_ROOF",IfcRoofTypeEnum.BUTTERFLY_ROOF="BUTTERFLY_ROOF",IfcRoofTypeEnum.PAVILION_ROOF="PAVILION_ROOF",IfcRoofTypeEnum.DOME_ROOF="DOME_ROOF",IfcRoofTypeEnum.FREEFORM="FREEFORM",IfcRoofTypeEnum.USERDEFINED="USERDEFINED",IfcRoofTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSIPrefix=class{constructor(e){this.value=e}};IfcSIPrefix.EXA="EXA",IfcSIPrefix.PETA="PETA",IfcSIPrefix.TERA="TERA",IfcSIPrefix.GIGA="GIGA",IfcSIPrefix.MEGA="MEGA",IfcSIPrefix.KILO="KILO",IfcSIPrefix.HECTO="HECTO",IfcSIPrefix.DECA="DECA",IfcSIPrefix.DECI="DECI",IfcSIPrefix.CENTI="CENTI",IfcSIPrefix.MILLI="MILLI",IfcSIPrefix.MICRO="MICRO",IfcSIPrefix.NANO="NANO",IfcSIPrefix.PICO="PICO",IfcSIPrefix.FEMTO="FEMTO",IfcSIPrefix.ATTO="ATTO";var IfcSIUnitName=class{constructor(e){this.value=e}};IfcSIUnitName.AMPERE="AMPERE",IfcSIUnitName.BECQUEREL="BECQUEREL",IfcSIUnitName.CANDELA="CANDELA",IfcSIUnitName.COULOMB="COULOMB",IfcSIUnitName.CUBIC_METRE="CUBIC_METRE",IfcSIUnitName.DEGREE_CELSIUS="DEGREE_CELSIUS",IfcSIUnitName.FARAD="FARAD",IfcSIUnitName.GRAM="GRAM",IfcSIUnitName.GRAY="GRAY",IfcSIUnitName.HENRY="HENRY",IfcSIUnitName.HERTZ="HERTZ",IfcSIUnitName.JOULE="JOULE",IfcSIUnitName.KELVIN="KELVIN",IfcSIUnitName.LUMEN="LUMEN",IfcSIUnitName.LUX="LUX",IfcSIUnitName.METRE="METRE",IfcSIUnitName.MOLE="MOLE",IfcSIUnitName.NEWTON="NEWTON",IfcSIUnitName.OHM="OHM",IfcSIUnitName.PASCAL="PASCAL",IfcSIUnitName.RADIAN="RADIAN",IfcSIUnitName.SECOND="SECOND",IfcSIUnitName.SIEMENS="SIEMENS",IfcSIUnitName.SIEVERT="SIEVERT",IfcSIUnitName.SQUARE_METRE="SQUARE_METRE",IfcSIUnitName.STERADIAN="STERADIAN",IfcSIUnitName.TESLA="TESLA",IfcSIUnitName.VOLT="VOLT",IfcSIUnitName.WATT="WATT",IfcSIUnitName.WEBER="WEBER";var IfcSanitaryTerminalTypeEnum=class{constructor(e){this.value=e}};IfcSanitaryTerminalTypeEnum.BATH="BATH",IfcSanitaryTerminalTypeEnum.BIDET="BIDET",IfcSanitaryTerminalTypeEnum.CISTERN="CISTERN",IfcSanitaryTerminalTypeEnum.SHOWER="SHOWER",IfcSanitaryTerminalTypeEnum.SINK="SINK",IfcSanitaryTerminalTypeEnum.SANITARYFOUNTAIN="SANITARYFOUNTAIN",IfcSanitaryTerminalTypeEnum.TOILETPAN="TOILETPAN",IfcSanitaryTerminalTypeEnum.URINAL="URINAL",IfcSanitaryTerminalTypeEnum.WASHHANDBASIN="WASHHANDBASIN",IfcSanitaryTerminalTypeEnum.WCSEAT="WCSEAT",IfcSanitaryTerminalTypeEnum.USERDEFINED="USERDEFINED",IfcSanitaryTerminalTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSectionTypeEnum=class{constructor(e){this.value=e}};IfcSectionTypeEnum.UNIFORM="UNIFORM",IfcSectionTypeEnum.TAPERED="TAPERED";var IfcSensorTypeEnum=class{constructor(e){this.value=e}};IfcSensorTypeEnum.COSENSOR="COSENSOR",IfcSensorTypeEnum.CO2SENSOR="CO2SENSOR",IfcSensorTypeEnum.CONDUCTANCESENSOR="CONDUCTANCESENSOR",IfcSensorTypeEnum.CONTACTSENSOR="CONTACTSENSOR",IfcSensorTypeEnum.FIRESENSOR="FIRESENSOR",IfcSensorTypeEnum.FLOWSENSOR="FLOWSENSOR",IfcSensorTypeEnum.FROSTSENSOR="FROSTSENSOR",IfcSensorTypeEnum.GASSENSOR="GASSENSOR",IfcSensorTypeEnum.HEATSENSOR="HEATSENSOR",IfcSensorTypeEnum.HUMIDITYSENSOR="HUMIDITYSENSOR",IfcSensorTypeEnum.IDENTIFIERSENSOR="IDENTIFIERSENSOR",IfcSensorTypeEnum.IONCONCENTRATIONSENSOR="IONCONCENTRATIONSENSOR",IfcSensorTypeEnum.LEVELSENSOR="LEVELSENSOR",IfcSensorTypeEnum.LIGHTSENSOR="LIGHTSENSOR",IfcSensorTypeEnum.MOISTURESENSOR="MOISTURESENSOR",IfcSensorTypeEnum.MOVEMENTSENSOR="MOVEMENTSENSOR",IfcSensorTypeEnum.PHSENSOR="PHSENSOR",IfcSensorTypeEnum.PRESSURESENSOR="PRESSURESENSOR",IfcSensorTypeEnum.RADIATIONSENSOR="RADIATIONSENSOR",IfcSensorTypeEnum.RADIOACTIVITYSENSOR="RADIOACTIVITYSENSOR",IfcSensorTypeEnum.SMOKESENSOR="SMOKESENSOR",IfcSensorTypeEnum.SOUNDSENSOR="SOUNDSENSOR",IfcSensorTypeEnum.TEMPERATURESENSOR="TEMPERATURESENSOR",IfcSensorTypeEnum.WINDSENSOR="WINDSENSOR",IfcSensorTypeEnum.USERDEFINED="USERDEFINED",IfcSensorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSequenceEnum=class{constructor(e){this.value=e}};IfcSequenceEnum.START_START="START_START",IfcSequenceEnum.START_FINISH="START_FINISH",IfcSequenceEnum.FINISH_START="FINISH_START",IfcSequenceEnum.FINISH_FINISH="FINISH_FINISH",IfcSequenceEnum.USERDEFINED="USERDEFINED",IfcSequenceEnum.NOTDEFINED="NOTDEFINED";var IfcShadingDeviceTypeEnum=class{constructor(e){this.value=e}};IfcShadingDeviceTypeEnum.JALOUSIE="JALOUSIE",IfcShadingDeviceTypeEnum.SHUTTER="SHUTTER",IfcShadingDeviceTypeEnum.AWNING="AWNING",IfcShadingDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcShadingDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSimplePropertyTemplateTypeEnum=class{constructor(e){this.value=e}};IfcSimplePropertyTemplateTypeEnum.P_SINGLEVALUE="P_SINGLEVALUE",IfcSimplePropertyTemplateTypeEnum.P_ENUMERATEDVALUE="P_ENUMERATEDVALUE",IfcSimplePropertyTemplateTypeEnum.P_BOUNDEDVALUE="P_BOUNDEDVALUE",IfcSimplePropertyTemplateTypeEnum.P_LISTVALUE="P_LISTVALUE",IfcSimplePropertyTemplateTypeEnum.P_TABLEVALUE="P_TABLEVALUE",IfcSimplePropertyTemplateTypeEnum.P_REFERENCEVALUE="P_REFERENCEVALUE",IfcSimplePropertyTemplateTypeEnum.Q_LENGTH="Q_LENGTH",IfcSimplePropertyTemplateTypeEnum.Q_AREA="Q_AREA",IfcSimplePropertyTemplateTypeEnum.Q_VOLUME="Q_VOLUME",IfcSimplePropertyTemplateTypeEnum.Q_COUNT="Q_COUNT",IfcSimplePropertyTemplateTypeEnum.Q_WEIGHT="Q_WEIGHT",IfcSimplePropertyTemplateTypeEnum.Q_TIME="Q_TIME";var IfcSlabTypeEnum=class{constructor(e){this.value=e}};IfcSlabTypeEnum.FLOOR="FLOOR",IfcSlabTypeEnum.ROOF="ROOF",IfcSlabTypeEnum.LANDING="LANDING",IfcSlabTypeEnum.BASESLAB="BASESLAB",IfcSlabTypeEnum.APPROACH_SLAB="APPROACH_SLAB",IfcSlabTypeEnum.PAVING="PAVING",IfcSlabTypeEnum.WEARING="WEARING",IfcSlabTypeEnum.SIDEWALK="SIDEWALK",IfcSlabTypeEnum.USERDEFINED="USERDEFINED",IfcSlabTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSolarDeviceTypeEnum=class{constructor(e){this.value=e}};IfcSolarDeviceTypeEnum.SOLARCOLLECTOR="SOLARCOLLECTOR",IfcSolarDeviceTypeEnum.SOLARPANEL="SOLARPANEL",IfcSolarDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcSolarDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSpaceHeaterTypeEnum=class{constructor(e){this.value=e}};IfcSpaceHeaterTypeEnum.CONVECTOR="CONVECTOR",IfcSpaceHeaterTypeEnum.RADIATOR="RADIATOR",IfcSpaceHeaterTypeEnum.USERDEFINED="USERDEFINED",IfcSpaceHeaterTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSpaceTypeEnum=class{constructor(e){this.value=e}};IfcSpaceTypeEnum.SPACE="SPACE",IfcSpaceTypeEnum.PARKING="PARKING",IfcSpaceTypeEnum.GFA="GFA",IfcSpaceTypeEnum.INTERNAL="INTERNAL",IfcSpaceTypeEnum.EXTERNAL="EXTERNAL",IfcSpaceTypeEnum.USERDEFINED="USERDEFINED",IfcSpaceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSpatialZoneTypeEnum=class{constructor(e){this.value=e}};IfcSpatialZoneTypeEnum.CONSTRUCTION="CONSTRUCTION",IfcSpatialZoneTypeEnum.FIRESAFETY="FIRESAFETY",IfcSpatialZoneTypeEnum.LIGHTING="LIGHTING",IfcSpatialZoneTypeEnum.OCCUPANCY="OCCUPANCY",IfcSpatialZoneTypeEnum.SECURITY="SECURITY",IfcSpatialZoneTypeEnum.THERMAL="THERMAL",IfcSpatialZoneTypeEnum.TRANSPORT="TRANSPORT",IfcSpatialZoneTypeEnum.VENTILATION="VENTILATION",IfcSpatialZoneTypeEnum.USERDEFINED="USERDEFINED",IfcSpatialZoneTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStackTerminalTypeEnum=class{constructor(e){this.value=e}};IfcStackTerminalTypeEnum.BIRDCAGE="BIRDCAGE",IfcStackTerminalTypeEnum.COWL="COWL",IfcStackTerminalTypeEnum.RAINWATERHOPPER="RAINWATERHOPPER",IfcStackTerminalTypeEnum.USERDEFINED="USERDEFINED",IfcStackTerminalTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStairFlightTypeEnum=class{constructor(e){this.value=e}};IfcStairFlightTypeEnum.STRAIGHT="STRAIGHT",IfcStairFlightTypeEnum.WINDER="WINDER",IfcStairFlightTypeEnum.SPIRAL="SPIRAL",IfcStairFlightTypeEnum.CURVED="CURVED",IfcStairFlightTypeEnum.FREEFORM="FREEFORM",IfcStairFlightTypeEnum.USERDEFINED="USERDEFINED",IfcStairFlightTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStairTypeEnum=class{constructor(e){this.value=e}};IfcStairTypeEnum.STRAIGHT_RUN_STAIR="STRAIGHT_RUN_STAIR",IfcStairTypeEnum.TWO_STRAIGHT_RUN_STAIR="TWO_STRAIGHT_RUN_STAIR",IfcStairTypeEnum.QUARTER_WINDING_STAIR="QUARTER_WINDING_STAIR",IfcStairTypeEnum.QUARTER_TURN_STAIR="QUARTER_TURN_STAIR",IfcStairTypeEnum.HALF_WINDING_STAIR="HALF_WINDING_STAIR",IfcStairTypeEnum.HALF_TURN_STAIR="HALF_TURN_STAIR",IfcStairTypeEnum.TWO_QUARTER_WINDING_STAIR="TWO_QUARTER_WINDING_STAIR",IfcStairTypeEnum.TWO_QUARTER_TURN_STAIR="TWO_QUARTER_TURN_STAIR",IfcStairTypeEnum.THREE_QUARTER_WINDING_STAIR="THREE_QUARTER_WINDING_STAIR",IfcStairTypeEnum.THREE_QUARTER_TURN_STAIR="THREE_QUARTER_TURN_STAIR",IfcStairTypeEnum.SPIRAL_STAIR="SPIRAL_STAIR",IfcStairTypeEnum.DOUBLE_RETURN_STAIR="DOUBLE_RETURN_STAIR",IfcStairTypeEnum.CURVED_RUN_STAIR="CURVED_RUN_STAIR",IfcStairTypeEnum.TWO_CURVED_RUN_STAIR="TWO_CURVED_RUN_STAIR",IfcStairTypeEnum.USERDEFINED="USERDEFINED",IfcStairTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStateEnum=class{constructor(e){this.value=e}};IfcStateEnum.READWRITE="READWRITE",IfcStateEnum.READONLY="READONLY",IfcStateEnum.LOCKED="LOCKED",IfcStateEnum.READWRITELOCKED="READWRITELOCKED",IfcStateEnum.READONLYLOCKED="READONLYLOCKED";var IfcStructuralCurveActivityTypeEnum=class{constructor(e){this.value=e}};IfcStructuralCurveActivityTypeEnum.CONST="CONST",IfcStructuralCurveActivityTypeEnum.LINEAR="LINEAR",IfcStructuralCurveActivityTypeEnum.POLYGONAL="POLYGONAL",IfcStructuralCurveActivityTypeEnum.EQUIDISTANT="EQUIDISTANT",IfcStructuralCurveActivityTypeEnum.SINUS="SINUS",IfcStructuralCurveActivityTypeEnum.PARABOLA="PARABOLA",IfcStructuralCurveActivityTypeEnum.DISCRETE="DISCRETE",IfcStructuralCurveActivityTypeEnum.USERDEFINED="USERDEFINED",IfcStructuralCurveActivityTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStructuralCurveMemberTypeEnum=class{constructor(e){this.value=e}};IfcStructuralCurveMemberTypeEnum.RIGID_JOINED_MEMBER="RIGID_JOINED_MEMBER",IfcStructuralCurveMemberTypeEnum.PIN_JOINED_MEMBER="PIN_JOINED_MEMBER",IfcStructuralCurveMemberTypeEnum.CABLE="CABLE",IfcStructuralCurveMemberTypeEnum.TENSION_MEMBER="TENSION_MEMBER",IfcStructuralCurveMemberTypeEnum.COMPRESSION_MEMBER="COMPRESSION_MEMBER",IfcStructuralCurveMemberTypeEnum.USERDEFINED="USERDEFINED",IfcStructuralCurveMemberTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStructuralSurfaceActivityTypeEnum=class{constructor(e){this.value=e}};IfcStructuralSurfaceActivityTypeEnum.CONST="CONST",IfcStructuralSurfaceActivityTypeEnum.BILINEAR="BILINEAR",IfcStructuralSurfaceActivityTypeEnum.DISCRETE="DISCRETE",IfcStructuralSurfaceActivityTypeEnum.ISOCONTOUR="ISOCONTOUR",IfcStructuralSurfaceActivityTypeEnum.USERDEFINED="USERDEFINED",IfcStructuralSurfaceActivityTypeEnum.NOTDEFINED="NOTDEFINED";var IfcStructuralSurfaceMemberTypeEnum=class{constructor(e){this.value=e}};IfcStructuralSurfaceMemberTypeEnum.BENDING_ELEMENT="BENDING_ELEMENT",IfcStructuralSurfaceMemberTypeEnum.MEMBRANE_ELEMENT="MEMBRANE_ELEMENT",IfcStructuralSurfaceMemberTypeEnum.SHELL="SHELL",IfcStructuralSurfaceMemberTypeEnum.USERDEFINED="USERDEFINED",IfcStructuralSurfaceMemberTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSubContractResourceTypeEnum=class{constructor(e){this.value=e}};IfcSubContractResourceTypeEnum.PURCHASE="PURCHASE",IfcSubContractResourceTypeEnum.WORK="WORK",IfcSubContractResourceTypeEnum.USERDEFINED="USERDEFINED",IfcSubContractResourceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSurfaceFeatureTypeEnum=class{constructor(e){this.value=e}};IfcSurfaceFeatureTypeEnum.MARK="MARK",IfcSurfaceFeatureTypeEnum.TAG="TAG",IfcSurfaceFeatureTypeEnum.TREATMENT="TREATMENT",IfcSurfaceFeatureTypeEnum.DEFECT="DEFECT",IfcSurfaceFeatureTypeEnum.USERDEFINED="USERDEFINED",IfcSurfaceFeatureTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSurfaceSide=class{constructor(e){this.value=e}};IfcSurfaceSide.POSITIVE="POSITIVE",IfcSurfaceSide.NEGATIVE="NEGATIVE",IfcSurfaceSide.BOTH="BOTH";var IfcSwitchingDeviceTypeEnum=class{constructor(e){this.value=e}};IfcSwitchingDeviceTypeEnum.CONTACTOR="CONTACTOR",IfcSwitchingDeviceTypeEnum.DIMMERSWITCH="DIMMERSWITCH",IfcSwitchingDeviceTypeEnum.EMERGENCYSTOP="EMERGENCYSTOP",IfcSwitchingDeviceTypeEnum.KEYPAD="KEYPAD",IfcSwitchingDeviceTypeEnum.MOMENTARYSWITCH="MOMENTARYSWITCH",IfcSwitchingDeviceTypeEnum.SELECTORSWITCH="SELECTORSWITCH",IfcSwitchingDeviceTypeEnum.STARTER="STARTER",IfcSwitchingDeviceTypeEnum.SWITCHDISCONNECTOR="SWITCHDISCONNECTOR",IfcSwitchingDeviceTypeEnum.TOGGLESWITCH="TOGGLESWITCH",IfcSwitchingDeviceTypeEnum.USERDEFINED="USERDEFINED",IfcSwitchingDeviceTypeEnum.NOTDEFINED="NOTDEFINED";var IfcSystemFurnitureElementTypeEnum=class{constructor(e){this.value=e}};IfcSystemFurnitureElementTypeEnum.PANEL="PANEL",IfcSystemFurnitureElementTypeEnum.WORKSURFACE="WORKSURFACE",IfcSystemFurnitureElementTypeEnum.USERDEFINED="USERDEFINED",IfcSystemFurnitureElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTankTypeEnum=class{constructor(e){this.value=e}};IfcTankTypeEnum.BASIN="BASIN",IfcTankTypeEnum.BREAKPRESSURE="BREAKPRESSURE",IfcTankTypeEnum.EXPANSION="EXPANSION",IfcTankTypeEnum.FEEDANDEXPANSION="FEEDANDEXPANSION",IfcTankTypeEnum.PRESSUREVESSEL="PRESSUREVESSEL",IfcTankTypeEnum.STORAGE="STORAGE",IfcTankTypeEnum.VESSEL="VESSEL",IfcTankTypeEnum.USERDEFINED="USERDEFINED",IfcTankTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTaskDurationEnum=class{constructor(e){this.value=e}};IfcTaskDurationEnum.ELAPSEDTIME="ELAPSEDTIME",IfcTaskDurationEnum.WORKTIME="WORKTIME",IfcTaskDurationEnum.NOTDEFINED="NOTDEFINED";var IfcTaskTypeEnum=class{constructor(e){this.value=e}};IfcTaskTypeEnum.ATTENDANCE="ATTENDANCE",IfcTaskTypeEnum.CONSTRUCTION="CONSTRUCTION",IfcTaskTypeEnum.DEMOLITION="DEMOLITION",IfcTaskTypeEnum.DISMANTLE="DISMANTLE",IfcTaskTypeEnum.DISPOSAL="DISPOSAL",IfcTaskTypeEnum.INSTALLATION="INSTALLATION",IfcTaskTypeEnum.LOGISTIC="LOGISTIC",IfcTaskTypeEnum.MAINTENANCE="MAINTENANCE",IfcTaskTypeEnum.MOVE="MOVE",IfcTaskTypeEnum.OPERATION="OPERATION",IfcTaskTypeEnum.REMOVAL="REMOVAL",IfcTaskTypeEnum.RENOVATION="RENOVATION",IfcTaskTypeEnum.USERDEFINED="USERDEFINED",IfcTaskTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTendonAnchorTypeEnum=class{constructor(e){this.value=e}};IfcTendonAnchorTypeEnum.COUPLER="COUPLER",IfcTendonAnchorTypeEnum.FIXED_END="FIXED_END",IfcTendonAnchorTypeEnum.TENSIONING_END="TENSIONING_END",IfcTendonAnchorTypeEnum.USERDEFINED="USERDEFINED",IfcTendonAnchorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTendonConduitTypeEnum=class{constructor(e){this.value=e}};IfcTendonConduitTypeEnum.DUCT="DUCT",IfcTendonConduitTypeEnum.COUPLER="COUPLER",IfcTendonConduitTypeEnum.GROUTING_DUCT="GROUTING_DUCT",IfcTendonConduitTypeEnum.TRUMPET="TRUMPET",IfcTendonConduitTypeEnum.DIABOLO="DIABOLO",IfcTendonConduitTypeEnum.USERDEFINED="USERDEFINED",IfcTendonConduitTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTendonTypeEnum=class{constructor(e){this.value=e}};IfcTendonTypeEnum.BAR="BAR",IfcTendonTypeEnum.COATED="COATED",IfcTendonTypeEnum.STRAND="STRAND",IfcTendonTypeEnum.WIRE="WIRE",IfcTendonTypeEnum.USERDEFINED="USERDEFINED",IfcTendonTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTextPath=class{constructor(e){this.value=e}};IfcTextPath.LEFT="LEFT",IfcTextPath.RIGHT="RIGHT",IfcTextPath.UP="UP",IfcTextPath.DOWN="DOWN";var IfcTimeSeriesDataTypeEnum=class{constructor(e){this.value=e}};IfcTimeSeriesDataTypeEnum.CONTINUOUS="CONTINUOUS",IfcTimeSeriesDataTypeEnum.DISCRETE="DISCRETE",IfcTimeSeriesDataTypeEnum.DISCRETEBINARY="DISCRETEBINARY",IfcTimeSeriesDataTypeEnum.PIECEWISEBINARY="PIECEWISEBINARY",IfcTimeSeriesDataTypeEnum.PIECEWISECONSTANT="PIECEWISECONSTANT",IfcTimeSeriesDataTypeEnum.PIECEWISECONTINUOUS="PIECEWISECONTINUOUS",IfcTimeSeriesDataTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTransformerTypeEnum=class{constructor(e){this.value=e}};IfcTransformerTypeEnum.CURRENT="CURRENT",IfcTransformerTypeEnum.FREQUENCY="FREQUENCY",IfcTransformerTypeEnum.INVERTER="INVERTER",IfcTransformerTypeEnum.RECTIFIER="RECTIFIER",IfcTransformerTypeEnum.VOLTAGE="VOLTAGE",IfcTransformerTypeEnum.USERDEFINED="USERDEFINED",IfcTransformerTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTransitionCode=class{constructor(e){this.value=e}};IfcTransitionCode.DISCONTINUOUS="DISCONTINUOUS",IfcTransitionCode.CONTINUOUS="CONTINUOUS",IfcTransitionCode.CONTSAMEGRADIENT="CONTSAMEGRADIENT",IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE="CONTSAMEGRADIENTSAMECURVATURE";var IfcTransitionCurveType=class{constructor(e){this.value=e}};IfcTransitionCurveType.BIQUADRATICPARABOLA="BIQUADRATICPARABOLA",IfcTransitionCurveType.BLOSSCURVE="BLOSSCURVE",IfcTransitionCurveType.CLOTHOIDCURVE="CLOTHOIDCURVE",IfcTransitionCurveType.COSINECURVE="COSINECURVE",IfcTransitionCurveType.CUBICPARABOLA="CUBICPARABOLA",IfcTransitionCurveType.SINECURVE="SINECURVE";var IfcTransportElementTypeEnum=class{constructor(e){this.value=e}};IfcTransportElementTypeEnum.ELEVATOR="ELEVATOR",IfcTransportElementTypeEnum.ESCALATOR="ESCALATOR",IfcTransportElementTypeEnum.MOVINGWALKWAY="MOVINGWALKWAY",IfcTransportElementTypeEnum.CRANEWAY="CRANEWAY",IfcTransportElementTypeEnum.LIFTINGGEAR="LIFTINGGEAR",IfcTransportElementTypeEnum.USERDEFINED="USERDEFINED",IfcTransportElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcTrimmingPreference=class{constructor(e){this.value=e}};IfcTrimmingPreference.CARTESIAN="CARTESIAN",IfcTrimmingPreference.PARAMETER="PARAMETER",IfcTrimmingPreference.UNSPECIFIED="UNSPECIFIED";var IfcTubeBundleTypeEnum=class{constructor(e){this.value=e}};IfcTubeBundleTypeEnum.FINNED="FINNED",IfcTubeBundleTypeEnum.USERDEFINED="USERDEFINED",IfcTubeBundleTypeEnum.NOTDEFINED="NOTDEFINED";var IfcUnitEnum=class{constructor(e){this.value=e}};IfcUnitEnum.ABSORBEDDOSEUNIT="ABSORBEDDOSEUNIT",IfcUnitEnum.AMOUNTOFSUBSTANCEUNIT="AMOUNTOFSUBSTANCEUNIT",IfcUnitEnum.AREAUNIT="AREAUNIT",IfcUnitEnum.DOSEEQUIVALENTUNIT="DOSEEQUIVALENTUNIT",IfcUnitEnum.ELECTRICCAPACITANCEUNIT="ELECTRICCAPACITANCEUNIT",IfcUnitEnum.ELECTRICCHARGEUNIT="ELECTRICCHARGEUNIT",IfcUnitEnum.ELECTRICCONDUCTANCEUNIT="ELECTRICCONDUCTANCEUNIT",IfcUnitEnum.ELECTRICCURRENTUNIT="ELECTRICCURRENTUNIT",IfcUnitEnum.ELECTRICRESISTANCEUNIT="ELECTRICRESISTANCEUNIT",IfcUnitEnum.ELECTRICVOLTAGEUNIT="ELECTRICVOLTAGEUNIT",IfcUnitEnum.ENERGYUNIT="ENERGYUNIT",IfcUnitEnum.FORCEUNIT="FORCEUNIT",IfcUnitEnum.FREQUENCYUNIT="FREQUENCYUNIT",IfcUnitEnum.ILLUMINANCEUNIT="ILLUMINANCEUNIT",IfcUnitEnum.INDUCTANCEUNIT="INDUCTANCEUNIT",IfcUnitEnum.LENGTHUNIT="LENGTHUNIT",IfcUnitEnum.LUMINOUSFLUXUNIT="LUMINOUSFLUXUNIT",IfcUnitEnum.LUMINOUSINTENSITYUNIT="LUMINOUSINTENSITYUNIT",IfcUnitEnum.MAGNETICFLUXDENSITYUNIT="MAGNETICFLUXDENSITYUNIT",IfcUnitEnum.MAGNETICFLUXUNIT="MAGNETICFLUXUNIT",IfcUnitEnum.MASSUNIT="MASSUNIT",IfcUnitEnum.PLANEANGLEUNIT="PLANEANGLEUNIT",IfcUnitEnum.POWERUNIT="POWERUNIT",IfcUnitEnum.PRESSUREUNIT="PRESSUREUNIT",IfcUnitEnum.RADIOACTIVITYUNIT="RADIOACTIVITYUNIT",IfcUnitEnum.SOLIDANGLEUNIT="SOLIDANGLEUNIT",IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT="THERMODYNAMICTEMPERATUREUNIT",IfcUnitEnum.TIMEUNIT="TIMEUNIT",IfcUnitEnum.VOLUMEUNIT="VOLUMEUNIT",IfcUnitEnum.USERDEFINED="USERDEFINED";var IfcUnitaryControlElementTypeEnum=class{constructor(e){this.value=e}};IfcUnitaryControlElementTypeEnum.ALARMPANEL="ALARMPANEL",IfcUnitaryControlElementTypeEnum.CONTROLPANEL="CONTROLPANEL",IfcUnitaryControlElementTypeEnum.GASDETECTIONPANEL="GASDETECTIONPANEL",IfcUnitaryControlElementTypeEnum.INDICATORPANEL="INDICATORPANEL",IfcUnitaryControlElementTypeEnum.MIMICPANEL="MIMICPANEL",IfcUnitaryControlElementTypeEnum.HUMIDISTAT="HUMIDISTAT",IfcUnitaryControlElementTypeEnum.THERMOSTAT="THERMOSTAT",IfcUnitaryControlElementTypeEnum.WEATHERSTATION="WEATHERSTATION",IfcUnitaryControlElementTypeEnum.USERDEFINED="USERDEFINED",IfcUnitaryControlElementTypeEnum.NOTDEFINED="NOTDEFINED";var IfcUnitaryEquipmentTypeEnum=class{constructor(e){this.value=e}};IfcUnitaryEquipmentTypeEnum.AIRHANDLER="AIRHANDLER",IfcUnitaryEquipmentTypeEnum.AIRCONDITIONINGUNIT="AIRCONDITIONINGUNIT",IfcUnitaryEquipmentTypeEnum.DEHUMIDIFIER="DEHUMIDIFIER",IfcUnitaryEquipmentTypeEnum.SPLITSYSTEM="SPLITSYSTEM",IfcUnitaryEquipmentTypeEnum.ROOFTOPUNIT="ROOFTOPUNIT",IfcUnitaryEquipmentTypeEnum.USERDEFINED="USERDEFINED",IfcUnitaryEquipmentTypeEnum.NOTDEFINED="NOTDEFINED";var IfcValveTypeEnum=class{constructor(e){this.value=e}};IfcValveTypeEnum.AIRRELEASE="AIRRELEASE",IfcValveTypeEnum.ANTIVACUUM="ANTIVACUUM",IfcValveTypeEnum.CHANGEOVER="CHANGEOVER",IfcValveTypeEnum.CHECK="CHECK",IfcValveTypeEnum.COMMISSIONING="COMMISSIONING",IfcValveTypeEnum.DIVERTING="DIVERTING",IfcValveTypeEnum.DRAWOFFCOCK="DRAWOFFCOCK",IfcValveTypeEnum.DOUBLECHECK="DOUBLECHECK",IfcValveTypeEnum.DOUBLEREGULATING="DOUBLEREGULATING",IfcValveTypeEnum.FAUCET="FAUCET",IfcValveTypeEnum.FLUSHING="FLUSHING",IfcValveTypeEnum.GASCOCK="GASCOCK",IfcValveTypeEnum.GASTAP="GASTAP",IfcValveTypeEnum.ISOLATING="ISOLATING",IfcValveTypeEnum.MIXING="MIXING",IfcValveTypeEnum.PRESSUREREDUCING="PRESSUREREDUCING",IfcValveTypeEnum.PRESSURERELIEF="PRESSURERELIEF",IfcValveTypeEnum.REGULATING="REGULATING",IfcValveTypeEnum.SAFETYCUTOFF="SAFETYCUTOFF",IfcValveTypeEnum.STEAMTRAP="STEAMTRAP",IfcValveTypeEnum.STOPCOCK="STOPCOCK",IfcValveTypeEnum.USERDEFINED="USERDEFINED",IfcValveTypeEnum.NOTDEFINED="NOTDEFINED";var IfcVibrationDamperTypeEnum=class{constructor(e){this.value=e}};IfcVibrationDamperTypeEnum.BENDING_YIELD="BENDING_YIELD",IfcVibrationDamperTypeEnum.SHEAR_YIELD="SHEAR_YIELD",IfcVibrationDamperTypeEnum.AXIAL_YIELD="AXIAL_YIELD",IfcVibrationDamperTypeEnum.FRICTION="FRICTION",IfcVibrationDamperTypeEnum.VISCOUS="VISCOUS",IfcVibrationDamperTypeEnum.RUBBER="RUBBER",IfcVibrationDamperTypeEnum.USERDEFINED="USERDEFINED",IfcVibrationDamperTypeEnum.NOTDEFINED="NOTDEFINED";var IfcVibrationIsolatorTypeEnum=class{constructor(e){this.value=e}};IfcVibrationIsolatorTypeEnum.COMPRESSION="COMPRESSION",IfcVibrationIsolatorTypeEnum.SPRING="SPRING",IfcVibrationIsolatorTypeEnum.BASE="BASE",IfcVibrationIsolatorTypeEnum.USERDEFINED="USERDEFINED",IfcVibrationIsolatorTypeEnum.NOTDEFINED="NOTDEFINED";var IfcVoidingFeatureTypeEnum=class{constructor(e){this.value=e}};IfcVoidingFeatureTypeEnum.CUTOUT="CUTOUT",IfcVoidingFeatureTypeEnum.NOTCH="NOTCH",IfcVoidingFeatureTypeEnum.HOLE="HOLE",IfcVoidingFeatureTypeEnum.MITER="MITER",IfcVoidingFeatureTypeEnum.CHAMFER="CHAMFER",IfcVoidingFeatureTypeEnum.EDGE="EDGE",IfcVoidingFeatureTypeEnum.USERDEFINED="USERDEFINED",IfcVoidingFeatureTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWallTypeEnum=class{constructor(e){this.value=e}};IfcWallTypeEnum.MOVABLE="MOVABLE",IfcWallTypeEnum.PARAPET="PARAPET",IfcWallTypeEnum.PARTITIONING="PARTITIONING",IfcWallTypeEnum.PLUMBINGWALL="PLUMBINGWALL",IfcWallTypeEnum.SHEAR="SHEAR",IfcWallTypeEnum.SOLIDWALL="SOLIDWALL",IfcWallTypeEnum.STANDARD="STANDARD",IfcWallTypeEnum.POLYGONAL="POLYGONAL",IfcWallTypeEnum.ELEMENTEDWALL="ELEMENTEDWALL",IfcWallTypeEnum.RETAININGWALL="RETAININGWALL",IfcWallTypeEnum.USERDEFINED="USERDEFINED",IfcWallTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWasteTerminalTypeEnum=class{constructor(e){this.value=e}};IfcWasteTerminalTypeEnum.FLOORTRAP="FLOORTRAP",IfcWasteTerminalTypeEnum.FLOORWASTE="FLOORWASTE",IfcWasteTerminalTypeEnum.GULLYSUMP="GULLYSUMP",IfcWasteTerminalTypeEnum.GULLYTRAP="GULLYTRAP",IfcWasteTerminalTypeEnum.ROOFDRAIN="ROOFDRAIN",IfcWasteTerminalTypeEnum.WASTEDISPOSALUNIT="WASTEDISPOSALUNIT",IfcWasteTerminalTypeEnum.WASTETRAP="WASTETRAP",IfcWasteTerminalTypeEnum.USERDEFINED="USERDEFINED",IfcWasteTerminalTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWindowPanelOperationEnum=class{constructor(e){this.value=e}};IfcWindowPanelOperationEnum.SIDEHUNGRIGHTHAND="SIDEHUNGRIGHTHAND",IfcWindowPanelOperationEnum.SIDEHUNGLEFTHAND="SIDEHUNGLEFTHAND",IfcWindowPanelOperationEnum.TILTANDTURNRIGHTHAND="TILTANDTURNRIGHTHAND",IfcWindowPanelOperationEnum.TILTANDTURNLEFTHAND="TILTANDTURNLEFTHAND",IfcWindowPanelOperationEnum.TOPHUNG="TOPHUNG",IfcWindowPanelOperationEnum.BOTTOMHUNG="BOTTOMHUNG",IfcWindowPanelOperationEnum.PIVOTHORIZONTAL="PIVOTHORIZONTAL",IfcWindowPanelOperationEnum.PIVOTVERTICAL="PIVOTVERTICAL",IfcWindowPanelOperationEnum.SLIDINGHORIZONTAL="SLIDINGHORIZONTAL",IfcWindowPanelOperationEnum.SLIDINGVERTICAL="SLIDINGVERTICAL",IfcWindowPanelOperationEnum.REMOVABLECASEMENT="REMOVABLECASEMENT",IfcWindowPanelOperationEnum.FIXEDCASEMENT="FIXEDCASEMENT",IfcWindowPanelOperationEnum.OTHEROPERATION="OTHEROPERATION",IfcWindowPanelOperationEnum.NOTDEFINED="NOTDEFINED";var IfcWindowPanelPositionEnum=class{constructor(e){this.value=e}};IfcWindowPanelPositionEnum.LEFT="LEFT",IfcWindowPanelPositionEnum.MIDDLE="MIDDLE",IfcWindowPanelPositionEnum.RIGHT="RIGHT",IfcWindowPanelPositionEnum.BOTTOM="BOTTOM",IfcWindowPanelPositionEnum.TOP="TOP",IfcWindowPanelPositionEnum.NOTDEFINED="NOTDEFINED";var IfcWindowStyleConstructionEnum=class{constructor(e){this.value=e}};IfcWindowStyleConstructionEnum.ALUMINIUM="ALUMINIUM",IfcWindowStyleConstructionEnum.HIGH_GRADE_STEEL="HIGH_GRADE_STEEL",IfcWindowStyleConstructionEnum.STEEL="STEEL",IfcWindowStyleConstructionEnum.WOOD="WOOD",IfcWindowStyleConstructionEnum.ALUMINIUM_WOOD="ALUMINIUM_WOOD",IfcWindowStyleConstructionEnum.PLASTIC="PLASTIC",IfcWindowStyleConstructionEnum.OTHER_CONSTRUCTION="OTHER_CONSTRUCTION",IfcWindowStyleConstructionEnum.NOTDEFINED="NOTDEFINED";var IfcWindowStyleOperationEnum=class{constructor(e){this.value=e}};IfcWindowStyleOperationEnum.SINGLE_PANEL="SINGLE_PANEL",IfcWindowStyleOperationEnum.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",IfcWindowStyleOperationEnum.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",IfcWindowStyleOperationEnum.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",IfcWindowStyleOperationEnum.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",IfcWindowStyleOperationEnum.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",IfcWindowStyleOperationEnum.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",IfcWindowStyleOperationEnum.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",IfcWindowStyleOperationEnum.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",IfcWindowStyleOperationEnum.USERDEFINED="USERDEFINED",IfcWindowStyleOperationEnum.NOTDEFINED="NOTDEFINED";var IfcWindowTypeEnum=class{constructor(e){this.value=e}};IfcWindowTypeEnum.WINDOW="WINDOW",IfcWindowTypeEnum.SKYLIGHT="SKYLIGHT",IfcWindowTypeEnum.LIGHTDOME="LIGHTDOME",IfcWindowTypeEnum.USERDEFINED="USERDEFINED",IfcWindowTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWindowTypePartitioningEnum=class{constructor(e){this.value=e}};IfcWindowTypePartitioningEnum.SINGLE_PANEL="SINGLE_PANEL",IfcWindowTypePartitioningEnum.DOUBLE_PANEL_VERTICAL="DOUBLE_PANEL_VERTICAL",IfcWindowTypePartitioningEnum.DOUBLE_PANEL_HORIZONTAL="DOUBLE_PANEL_HORIZONTAL",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_VERTICAL="TRIPLE_PANEL_VERTICAL",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_BOTTOM="TRIPLE_PANEL_BOTTOM",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_TOP="TRIPLE_PANEL_TOP",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_LEFT="TRIPLE_PANEL_LEFT",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_RIGHT="TRIPLE_PANEL_RIGHT",IfcWindowTypePartitioningEnum.TRIPLE_PANEL_HORIZONTAL="TRIPLE_PANEL_HORIZONTAL",IfcWindowTypePartitioningEnum.USERDEFINED="USERDEFINED",IfcWindowTypePartitioningEnum.NOTDEFINED="NOTDEFINED";var IfcWorkCalendarTypeEnum=class{constructor(e){this.value=e}};IfcWorkCalendarTypeEnum.FIRSTSHIFT="FIRSTSHIFT",IfcWorkCalendarTypeEnum.SECONDSHIFT="SECONDSHIFT",IfcWorkCalendarTypeEnum.THIRDSHIFT="THIRDSHIFT",IfcWorkCalendarTypeEnum.USERDEFINED="USERDEFINED",IfcWorkCalendarTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWorkPlanTypeEnum=class{constructor(e){this.value=e}};IfcWorkPlanTypeEnum.ACTUAL="ACTUAL",IfcWorkPlanTypeEnum.BASELINE="BASELINE",IfcWorkPlanTypeEnum.PLANNED="PLANNED",IfcWorkPlanTypeEnum.USERDEFINED="USERDEFINED",IfcWorkPlanTypeEnum.NOTDEFINED="NOTDEFINED";var IfcWorkScheduleTypeEnum=class{constructor(e){this.value=e}};IfcWorkScheduleTypeEnum.ACTUAL="ACTUAL",IfcWorkScheduleTypeEnum.BASELINE="BASELINE",IfcWorkScheduleTypeEnum.PLANNED="PLANNED",IfcWorkScheduleTypeEnum.USERDEFINED="USERDEFINED",IfcWorkScheduleTypeEnum.NOTDEFINED="NOTDEFINED";var IfcActionRequest=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcActionRequest(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},IfcActor=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.TheActor=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcActor(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e}},IfcActorRole=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Role=r,this.UserDefinedRole=i,this.Description=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcActorRole(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Role),e.push(this.UserDefinedRole),e.push(this.Description),e}},IfcActuator=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcActuator(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcActuatorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcActuatorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAddress=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Purpose=r,this.Description=i,this.UserDefinedPurpose=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcAddress(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e}},IfcAdvancedBrep=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Outer=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcAdvancedBrep(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},IfcAdvancedBrepWithVoids=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Outer=r,this.Voids=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcAdvancedBrepWithVoids(e,t,n,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},IfcAdvancedFace=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Bounds=r,this.FaceSurface=i,this.SameSense=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcAdvancedFace(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},IfcAirTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAirTerminal(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcAirTerminalBox=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAirTerminalBox(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcAirTerminalBoxType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAirTerminalBoxType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAirTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAirTerminalType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAirToAirHeatRecovery=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAirToAirHeatRecovery(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcAirToAirHeatRecoveryType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAirToAirHeatRecoveryType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAlarm=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAlarm(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcAlarmType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAlarmType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAlignment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAlignment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e.push(this.PredefinedType),e}},IfcAlignment2DHorizontal=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.StartDistAlong=r,this.Segments=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcAlignment2DHorizontal(e,t,n,s)}ToTape(){let e=[];return e.push(this.StartDistAlong),e.push(this.Segments),e}},IfcAlignment2DHorizontalSegment=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n,this.CurveGeometry=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcAlignment2DHorizontalSegment(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}},IfcAlignment2DSegment=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcAlignment2DSegment(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e}},IfcAlignment2DVerSegCircularArc=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.Radius=c,this.IsConvex=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAlignment2DVerSegCircularArc(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.Radius),e.push(this.IsConvex),e}},IfcAlignment2DVerSegLine=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcAlignment2DVerSegLine(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},IfcAlignment2DVerSegParabolicArc=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l,this.ParabolaConstant=c,this.IsConvex=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAlignment2DVerSegParabolicArc(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e.push(this.ParabolaConstant),e.push(this.IsConvex),e}},IfcAlignment2DVertical=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Segments=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcAlignment2DVertical(e,t,n)}ToTape(){let e=[];return e.push(this.Segments),e}},IfcAlignment2DVerticalSegment=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.TangentialContinuity=r,this.StartTag=i,this.EndTag=n,this.StartDistAlong=s,this.HorizontalLength=a,this.StartHeight=o,this.StartGradient=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcAlignment2DVerticalSegment(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TangentialContinuity),e.push(this.StartTag),e.push(this.EndTag),e.push(this.StartDistAlong),e.push(this.HorizontalLength),e.push(this.StartHeight),e.push(this.StartGradient),e}},IfcAlignmentCurve=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Horizontal=r,this.Vertical=i,this.Tag=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcAlignmentCurve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Horizontal),e.push(this.Vertical),e.push(this.Tag),e}},IfcAnnotation=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcAnnotation(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcAnnotationFillArea=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.OuterBoundary=r,this.InnerBoundaries=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcAnnotationFillArea(e,t,n,s)}ToTape(){let e=[];return e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},IfcApplication=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ApplicationDeveloper=r,this.Version=i,this.ApplicationFullName=n,this.ApplicationIdentifier=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcApplication(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}},IfcAppliedValue=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.AppliedValue=n,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=c,this.ArithmeticOperator=u,this.Components=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAppliedValue(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},IfcApproval=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Identifier=r,this.Name=i,this.Description=n,this.TimeOfApproval=s,this.Status=a,this.Level=o,this.Qualifier=l,this.RequestingApproval=c,this.GivingApproval=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcApproval(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Identifier),e.push(this.Name),e.push(this.Description),e.push(this.TimeOfApproval),e.push(this.Status),e.push(this.Level),e.push(this.Qualifier),e.push(this.RequestingApproval),e.push(this.GivingApproval),e}},IfcApprovalRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingApproval=n,this.RelatedApprovals=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcApprovalRelationship(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}},IfcArbitraryClosedProfileDef=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.OuterCurve=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcArbitraryClosedProfileDef(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.OuterCurve),e}},IfcArbitraryOpenProfileDef=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Curve=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcArbitraryOpenProfileDef(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Curve),e}},IfcArbitraryProfileDefWithVoids=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.OuterCurve=n,this.InnerCurves=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcArbitraryProfileDefWithVoids(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}},IfcAsset=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.OriginalValue=l,this.CurrentValue=c,this.TotalReplacementCost=u,this.Owner=h,this.User=p,this.ResponsiblePerson=d,this.IncorporationDate=m,this.DepreciatedValue=f}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++];return new IfcAsset(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.OriginalValue),e.push(this.CurrentValue),e.push(this.TotalReplacementCost),e.push(this.Owner),e.push(this.User),e.push(this.ResponsiblePerson),e.push(this.IncorporationDate),e.push(this.DepreciatedValue),e}},IfcAsymmetricIShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.BottomFlangeWidth=s,this.OverallDepth=a,this.WebThickness=o,this.BottomFlangeThickness=l,this.BottomFlangeFilletRadius=c,this.TopFlangeWidth=u,this.TopFlangeThickness=h,this.TopFlangeFilletRadius=p,this.BottomFlangeEdgeRadius=d,this.BottomFlangeSlope=m,this.TopFlangeEdgeRadius=f,this.TopFlangeSlope=g}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++];return new IfcAsymmetricIShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y)}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}},IfcAudioVisualAppliance=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcAudioVisualAppliance(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcAudioVisualApplianceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcAudioVisualApplianceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcAxis1Placement=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Location=r,this.Axis=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcAxis1Placement(e,t,n,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e}},IfcAxis2Placement2D=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Location=r,this.RefDirection=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcAxis2Placement2D(e,t,n,s)}ToTape(){let e=[];return e.push(this.Location),e.push(this.RefDirection),e}},IfcAxis2Placement3D=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Location=r,this.Axis=i,this.RefDirection=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcAxis2Placement3D(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Axis),e.push(this.RefDirection),e}},IfcBSplineCurve=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Degree=r,this.ControlPointsList=i,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcBSplineCurve(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}},IfcBSplineCurveWithKnots=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Degree=r,this.ControlPointsList=i,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcBSplineCurveWithKnots(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e}},IfcBSplineSurface=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.UDegree=r,this.VDegree=i,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcBSplineSurface(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e}},IfcBSplineSurfaceWithKnots=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.UDegree=r,this.VDegree=i,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=c,this.VMultiplicities=u,this.UKnots=h,this.VKnots=p,this.KnotSpec=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcBSplineSurfaceWithKnots(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e}},IfcBeam=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBeam(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBeamStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBeamStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBeamType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBeamType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcBearing=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBearing(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBearingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBearingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcBlobTexture=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.RepeatS=r,this.RepeatT=i,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.RasterFormat=o,this.RasterCode=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcBlobTexture(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.RasterFormat),e.push(this.RasterCode),e}},IfcBlock=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Position=r,this.XLength=i,this.YLength=n,this.ZLength=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcBlock(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}},IfcBoiler=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBoiler(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBoilerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBoilerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcBooleanClippingResult=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Operator=r,this.FirstOperand=i,this.SecondOperand=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcBooleanClippingResult(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},IfcBooleanResult=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Operator=r,this.FirstOperand=i,this.SecondOperand=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcBooleanResult(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Operator),e.push(this.FirstOperand),e.push(this.SecondOperand),e}},IfcBoundaryCondition=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcBoundaryCondition(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcBoundaryCurve=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Segments=r,this.SelfIntersect=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcBoundaryCurve(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},IfcBoundaryEdgeCondition=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.TranslationalStiffnessByLengthX=i,this.TranslationalStiffnessByLengthY=n,this.TranslationalStiffnessByLengthZ=s,this.RotationalStiffnessByLengthX=a,this.RotationalStiffnessByLengthY=o,this.RotationalStiffnessByLengthZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcBoundaryEdgeCondition(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessByLengthX),e.push(this.TranslationalStiffnessByLengthY),e.push(this.TranslationalStiffnessByLengthZ),e.push(this.RotationalStiffnessByLengthX),e.push(this.RotationalStiffnessByLengthY),e.push(this.RotationalStiffnessByLengthZ),e}},IfcBoundaryFaceCondition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.TranslationalStiffnessByAreaX=i,this.TranslationalStiffnessByAreaY=n,this.TranslationalStiffnessByAreaZ=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcBoundaryFaceCondition(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}},IfcBoundaryNodeCondition=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.TranslationalStiffnessX=i,this.TranslationalStiffnessY=n,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcBoundaryNodeCondition(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e}},IfcBoundaryNodeConditionWarping=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.TranslationalStiffnessX=i,this.TranslationalStiffnessY=n,this.TranslationalStiffnessZ=s,this.RotationalStiffnessX=a,this.RotationalStiffnessY=o,this.RotationalStiffnessZ=l,this.WarpingStiffness=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcBoundaryNodeConditionWarping(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TranslationalStiffnessX),e.push(this.TranslationalStiffnessY),e.push(this.TranslationalStiffnessZ),e.push(this.RotationalStiffnessX),e.push(this.RotationalStiffnessY),e.push(this.RotationalStiffnessZ),e.push(this.WarpingStiffness),e}},IfcBoundedCurve=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcBoundedCurve(e,t)}ToTape(){return[]}},IfcBoundedSurface=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcBoundedSurface(e,t)}ToTape(){return[]}},IfcBoundingBox=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Corner=r,this.XDim=i,this.YDim=n,this.ZDim=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcBoundingBox(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}},IfcBoxedHalfSpace=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BaseSurface=r,this.AgreementFlag=i,this.Enclosure=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcBoxedHalfSpace(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e.push(this.Enclosure),e}},IfcBridge=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBridge(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},IfcBridgePart=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBridgePart(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e}},IfcBuilding=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.ElevationOfRefHeight=h,this.ElevationOfTerrain=p,this.BuildingAddress=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcBuilding(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.ElevationOfRefHeight),e.push(this.ElevationOfTerrain),e.push(this.BuildingAddress),e}},IfcBuildingElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcBuildingElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcBuildingElementPart=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBuildingElementPart(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBuildingElementPartType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBuildingElementPartType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcBuildingElementProxy=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBuildingElementProxy(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBuildingElementProxyType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBuildingElementProxyType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcBuildingElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBuildingElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcBuildingStorey=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.Elevation=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBuildingStorey(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.Elevation),e}},IfcBuildingSystem=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.LongName=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcBuildingSystem(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.LongName),e}},IfcBurner=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcBurner(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcBurnerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcBurnerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Depth=s,this.Width=a,this.WallThickness=o,this.Girth=l,this.InternalFilletRadius=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcCShapeProfileDef(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.WallThickness),e.push(this.Girth),e.push(this.InternalFilletRadius),e}},IfcCableCarrierFitting=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCableCarrierFitting(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCableCarrierFittingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCableCarrierFittingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCableCarrierSegment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCableCarrierSegment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCableCarrierSegmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCableCarrierSegmentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCableFitting=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCableFitting(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCableFittingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCableFittingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCableSegment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCableSegment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCableSegmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCableSegmentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCaissonFoundation=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCaissonFoundation(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCaissonFoundationType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCaissonFoundationType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCartesianPoint=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Coordinates=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcCartesianPoint(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},IfcCartesianPointList=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcCartesianPointList(e,t)}ToTape(){return[]}},IfcCartesianPointList2D=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.CoordList=r,this.TagList=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCartesianPointList2D(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},IfcCartesianPointList3D=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.CoordList=r,this.TagList=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCartesianPointList3D(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordList),e.push(this.TagList),e}},IfcCartesianTransformationOperator=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Axis1=r,this.Axis2=i,this.LocalOrigin=n,this.Scale=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCartesianTransformationOperator(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}},IfcCartesianTransformationOperator2D=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Axis1=r,this.Axis2=i,this.LocalOrigin=n,this.Scale=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCartesianTransformationOperator2D(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}},IfcCartesianTransformationOperator2DnonUniform=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Axis1=r,this.Axis2=i,this.LocalOrigin=n,this.Scale=s,this.Scale2=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcCartesianTransformationOperator2DnonUniform(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}},IfcCartesianTransformationOperator3D=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Axis1=r,this.Axis2=i,this.LocalOrigin=n,this.Scale=s,this.Axis3=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcCartesianTransformationOperator3D(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}},IfcCartesianTransformationOperator3DnonUniform=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Axis1=r,this.Axis2=i,this.LocalOrigin=n,this.Scale=s,this.Axis3=a,this.Scale2=o,this.Scale3=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcCartesianTransformationOperator3DnonUniform(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Axis1),e.push(this.Axis2),e.push(this.LocalOrigin),e.push(this.Scale),e.push(this.Axis3),e.push(this.Scale2),e.push(this.Scale3),e}},IfcCenterLineProfileDef=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Curve=n,this.Thickness=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCenterLineProfileDef(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}},IfcChiller=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcChiller(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcChillerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcChillerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcChimney=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcChimney(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcChimneyType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcChimneyType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCircle=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Position=r,this.Radius=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCircle(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},IfcCircleHollowProfileDef=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Radius=s,this.WallThickness=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcCircleHollowProfileDef(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}},IfcCircleProfileDef=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Radius=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCircleProfileDef(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}},IfcCircularArcSegment2D=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.StartPoint=r,this.StartDirection=i,this.SegmentLength=n,this.Radius=s,this.IsCCW=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcCircularArcSegment2D(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}},IfcCivilElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcCivilElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcCivilElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCivilElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcClassification=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Source=r,this.Edition=i,this.EditionDate=n,this.Name=s,this.Description=a,this.Location=o,this.ReferenceTokens=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcClassification(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Source),e.push(this.Edition),e.push(this.EditionDate),e.push(this.Name),e.push(this.Description),e.push(this.Location),e.push(this.ReferenceTokens),e}},IfcClassificationReference=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n,this.ReferencedSource=s,this.Description=a,this.Sort=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcClassificationReference(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.ReferencedSource),e.push(this.Description),e.push(this.Sort),e}},IfcClosedShell=class{constructor(e,t,r){this.expressID=e,this.type=t,this.CfsFaces=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcClosedShell(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},IfcCoil=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCoil(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCoilType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCoilType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcColourRgb=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Red=i,this.Green=n,this.Blue=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcColourRgb(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}},IfcColourRgbList=class{constructor(e,t,r){this.expressID=e,this.type=t,this.ColourList=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcColourRgbList(e,t,n)}ToTape(){let e=[];return e.push(this.ColourList),e}},IfcColourSpecification=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcColourSpecification(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcColumn=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcColumn(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcColumnStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcColumnStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcColumnType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcColumnType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCommunicationsAppliance=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCommunicationsAppliance(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCommunicationsApplianceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCommunicationsApplianceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcComplexProperty=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.UsageName=n,this.HasProperties=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcComplexProperty(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}},IfcComplexPropertyTemplate=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.UsageName=a,this.TemplateType=o,this.HasPropertyTemplates=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcComplexPropertyTemplate(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.UsageName),e.push(this.TemplateType),e.push(this.HasPropertyTemplates),e}},IfcCompositeCurve=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Segments=r,this.SelfIntersect=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCompositeCurve(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},IfcCompositeCurveOnSurface=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Segments=r,this.SelfIntersect=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCompositeCurveOnSurface(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},IfcCompositeCurveSegment=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Transition=r,this.SameSense=i,this.ParentCurve=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcCompositeCurveSegment(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Transition),e.push(this.SameSense),e.push(this.ParentCurve),e}},IfcCompositeProfileDef=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Profiles=n,this.Label=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCompositeProfileDef(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}},IfcCompressor=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCompressor(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCompressorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCompressorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCondenser=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCondenser(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCondenserType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCondenserType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcConic=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Position=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcConic(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},IfcConnectedFaceSet=class{constructor(e,t,r){this.expressID=e,this.type=t,this.CfsFaces=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcConnectedFaceSet(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},IfcConnectionCurveGeometry=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.CurveOnRelatingElement=r,this.CurveOnRelatedElement=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcConnectionCurveGeometry(e,t,n,s)}ToTape(){let e=[];return e.push(this.CurveOnRelatingElement),e.push(this.CurveOnRelatedElement),e}},IfcConnectionGeometry=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcConnectionGeometry(e,t)}ToTape(){return[]}},IfcConnectionPointEccentricity=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.PointOnRelatingElement=r,this.PointOnRelatedElement=i,this.EccentricityInX=n,this.EccentricityInY=s,this.EccentricityInZ=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcConnectionPointEccentricity(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}},IfcConnectionPointGeometry=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.PointOnRelatingElement=r,this.PointOnRelatedElement=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcConnectionPointGeometry(e,t,n,s)}ToTape(){let e=[];return e.push(this.PointOnRelatingElement),e.push(this.PointOnRelatedElement),e}},IfcConnectionSurfaceGeometry=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SurfaceOnRelatingElement=r,this.SurfaceOnRelatedElement=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcConnectionSurfaceGeometry(e,t,n,s)}ToTape(){let e=[];return e.push(this.SurfaceOnRelatingElement),e.push(this.SurfaceOnRelatedElement),e}},IfcConnectionVolumeGeometry=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.VolumeOnRelatingElement=r,this.VolumeOnRelatedElement=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcConnectionVolumeGeometry(e,t,n,s)}ToTape(){let e=[];return e.push(this.VolumeOnRelatingElement),e.push(this.VolumeOnRelatedElement),e}},IfcConstraint=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcConstraint(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e}},IfcConstructionEquipmentResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcConstructionEquipmentResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionEquipmentResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcConstructionEquipmentResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionMaterialResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcConstructionMaterialResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionMaterialResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcConstructionMaterialResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionProductResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcConstructionProductResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionProductResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcConstructionProductResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcConstructionResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcConstructionResource(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},IfcConstructionResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcConstructionResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e}},IfcContext=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcContext(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},IfcContextDependentUnit=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Dimensions=r,this.UnitType=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcContextDependentUnit(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e.push(this.Name),e}},IfcControl=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcControl(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e}},IfcController=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcController(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcControllerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcControllerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcConversionBasedUnit=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Dimensions=r,this.UnitType=i,this.Name=n,this.ConversionFactor=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcConversionBasedUnit(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}},IfcConversionBasedUnitWithOffset=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Dimensions=r,this.UnitType=i,this.Name=n,this.ConversionFactor=s,this.ConversionOffset=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcConversionBasedUnitWithOffset(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}},IfcCooledBeam=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCooledBeam(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCooledBeamType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCooledBeamType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCoolingTower=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCoolingTower(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCoolingTowerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCoolingTowerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCoordinateOperation=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SourceCRS=r,this.TargetCRS=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCoordinateOperation(e,t,n,s)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e}},IfcCoordinateReferenceSystem=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.GeodeticDatum=n,this.VerticalDatum=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcCoordinateReferenceSystem(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}},IfcCostItem=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.CostValues=c,this.CostQuantities=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCostItem(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.CostValues),e.push(this.CostQuantities),e}},IfcCostSchedule=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.SubmittedOn=u,this.UpdateDate=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCostSchedule(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.SubmittedOn),e.push(this.UpdateDate),e}},IfcCostValue=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.AppliedValue=n,this.UnitBasis=s,this.ApplicableDate=a,this.FixedUntilDate=o,this.Category=l,this.Condition=c,this.ArithmeticOperator=u,this.Components=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCostValue(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AppliedValue),e.push(this.UnitBasis),e.push(this.ApplicableDate),e.push(this.FixedUntilDate),e.push(this.Category),e.push(this.Condition),e.push(this.ArithmeticOperator),e.push(this.Components),e}},IfcCovering=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCovering(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCoveringType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCoveringType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCrewResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcCrewResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcCrewResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcCrewResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcCsgPrimitive3D=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Position=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcCsgPrimitive3D(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},IfcCsgSolid=class{constructor(e,t,r){this.expressID=e,this.type=t,this.TreeRootExpression=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcCsgSolid(e,t,n)}ToTape(){let e=[];return e.push(this.TreeRootExpression),e}},IfcCurrencyRelationship=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingMonetaryUnit=n,this.RelatedMonetaryUnit=s,this.ExchangeRate=a,this.RateDateTime=o,this.RateSource=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcCurrencyRelationship(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.RelatingMonetaryUnit),e.push(this.RelatedMonetaryUnit),e.push(this.ExchangeRate),e.push(this.RateDateTime),e.push(this.RateSource),e}},IfcCurtainWall=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcCurtainWall(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcCurtainWallType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcCurtainWallType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcCurve=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcCurve(e,t)}ToTape(){return[]}},IfcCurveBoundedPlane=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BasisSurface=r,this.OuterBoundary=i,this.InnerBoundaries=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcCurveBoundedPlane(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.OuterBoundary),e.push(this.InnerBoundaries),e}},IfcCurveBoundedSurface=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BasisSurface=r,this.Boundaries=i,this.ImplicitOuter=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcCurveBoundedSurface(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.Boundaries),e.push(this.ImplicitOuter),e}},IfcCurveSegment2D=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.StartPoint=r,this.StartDirection=i,this.SegmentLength=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcCurveSegment2D(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},IfcCurveStyle=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.CurveFont=i,this.CurveWidth=n,this.CurveColour=s,this.ModelOrDraughting=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcCurveStyle(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}},IfcCurveStyleFont=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Name=r,this.PatternList=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCurveStyleFont(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.PatternList),e}},IfcCurveStyleFontAndScaling=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.CurveFont=i,this.CurveFontScaling=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcCurveStyleFontAndScaling(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.CurveFont),e.push(this.CurveFontScaling),e}},IfcCurveStyleFontPattern=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.VisibleSegmentLength=r,this.InvisibleSegmentLength=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCurveStyleFontPattern(e,t,n,s)}ToTape(){let e=[];return e.push(this.VisibleSegmentLength),e.push(this.InvisibleSegmentLength),e}},IfcCylindricalSurface=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Position=r,this.Radius=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcCylindricalSurface(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},IfcDamper=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDamper(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDamperType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDamperType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcDeepFoundation=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcDeepFoundation(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcDeepFoundationType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDeepFoundationType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcDerivedProfileDef=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.ParentProfile=n,this.Operator=s,this.Label=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcDerivedProfileDef(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}},IfcDerivedUnit=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Elements=r,this.UnitType=i,this.UserDefinedType=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcDerivedUnit(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Elements),e.push(this.UnitType),e.push(this.UserDefinedType),e}},IfcDerivedUnitElement=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Unit=r,this.Exponent=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcDerivedUnitElement(e,t,n,s)}ToTape(){let e=[];return e.push(this.Unit),e.push(this.Exponent),e}},IfcDimensionalExponents=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.LengthExponent=r,this.MassExponent=i,this.TimeExponent=n,this.ElectricCurrentExponent=s,this.ThermodynamicTemperatureExponent=a,this.AmountOfSubstanceExponent=o,this.LuminousIntensityExponent=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcDimensionalExponents(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.LengthExponent),e.push(this.MassExponent),e.push(this.TimeExponent),e.push(this.ElectricCurrentExponent),e.push(this.ThermodynamicTemperatureExponent),e.push(this.AmountOfSubstanceExponent),e.push(this.LuminousIntensityExponent),e}},IfcDirection=class{constructor(e,t,r){this.expressID=e,this.type=t,this.DirectionRatios=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcDirection(e,t,n)}ToTape(){let e=[];return e.push(this.DirectionRatios),e}},IfcDiscreteAccessory=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDiscreteAccessory(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDiscreteAccessoryType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDiscreteAccessoryType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcDistanceExpression=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.DistanceAlong=r,this.OffsetLateral=i,this.OffsetVertical=n,this.OffsetLongitudinal=s,this.AlongHorizontal=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcDistanceExpression(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}},IfcDistributionChamberElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDistributionChamberElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDistributionChamberElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDistributionChamberElementType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcDistributionCircuit=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcDistributionCircuit(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},IfcDistributionControlElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcDistributionControlElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcDistributionControlElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDistributionControlElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcDistributionElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcDistributionElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcDistributionElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDistributionElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcDistributionFlowElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcDistributionFlowElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcDistributionFlowElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDistributionFlowElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcDistributionPort=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.FlowDirection=c,this.PredefinedType=u,this.SystemType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDistributionPort(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.FlowDirection),e.push(this.PredefinedType),e.push(this.SystemType),e}},IfcDistributionSystem=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.PredefinedType=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcDistributionSystem(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.PredefinedType),e}},IfcDocumentInformation=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y){this.expressID=e,this.type=t,this.Identification=r,this.Name=i,this.Description=n,this.Location=s,this.Purpose=a,this.IntendedUse=o,this.Scope=l,this.Revision=c,this.DocumentOwner=u,this.Editors=h,this.CreationTime=p,this.LastRevisionTime=d,this.ElectronicFormat=m,this.ValidFrom=f,this.ValidUntil=g,this.Confidentiality=_,this.Status=y}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++];return new IfcDocumentInformation(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v)}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}},IfcDocumentInformationRelationship=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingDocument=n,this.RelatedDocuments=s,this.RelationshipType=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcDocumentInformationRelationship(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}},IfcDocumentReference=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n,this.Description=s,this.ReferencedDocument=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcDocumentReference(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}},IfcDoor=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcDoor(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},IfcDoorLiningProperties=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.ThresholdDepth=l,this.ThresholdThickness=c,this.TransomThickness=u,this.TransomOffset=h,this.LiningOffset=p,this.ThresholdOffset=d,this.CasingThickness=m,this.CasingDepth=f,this.ShapeAspectStyle=g,this.LiningToPanelOffsetX=_,this.LiningToPanelOffsetY=y}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++];return new IfcDoorLiningProperties(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v)}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}},IfcDoorPanelProperties=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.PanelDepth=a,this.PanelOperation=o,this.PanelWidth=l,this.PanelPosition=c,this.ShapeAspectStyle=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDoorPanelProperties(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.PanelDepth),e.push(this.PanelOperation),e.push(this.PanelWidth),e.push(this.PanelPosition),e.push(this.ShapeAspectStyle),e}},IfcDoorStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.OperationType=d,this.UserDefinedOperationType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcDoorStandardCase(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.UserDefinedOperationType),e}},IfcDoorStyle=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.OperationType=u,this.ConstructionType=h,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcDoorStyle(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.OperationType),e.push(this.ConstructionType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},IfcDoorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.OperationType=p,this.ParameterTakesPrecedence=d,this.UserDefinedOperationType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcDoorType(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedOperationType),e}},IfcDraughtingPreDefinedColour=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcDraughtingPreDefinedColour(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcDraughtingPreDefinedCurveFont=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcDraughtingPreDefinedCurveFont(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcDuctFitting=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDuctFitting(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDuctFittingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDuctFittingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcDuctSegment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDuctSegment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDuctSegmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDuctSegmentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcDuctSilencer=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcDuctSilencer(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcDuctSilencerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcDuctSilencerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcEdge=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.EdgeStart=r,this.EdgeEnd=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcEdge(e,t,n,s)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e}},IfcEdgeCurve=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.EdgeStart=r,this.EdgeEnd=i,this.EdgeGeometry=n,this.SameSense=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcEdgeCurve(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}},IfcEdgeLoop=class{constructor(e,t,r){this.expressID=e,this.type=t,this.EdgeList=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcEdgeLoop(e,t,n)}ToTape(){let e=[];return e.push(this.EdgeList),e}},IfcElectricAppliance=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricAppliance(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricApplianceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricApplianceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElectricDistributionBoard=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricDistributionBoard(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricDistributionBoardType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricDistributionBoardType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElectricFlowStorageDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricFlowStorageDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricFlowStorageDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricFlowStorageDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElectricGenerator=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricGenerator(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricGeneratorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricGeneratorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElectricMotor=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricMotor(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricMotorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricMotorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElectricTimeControl=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElectricTimeControl(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcElectricTimeControlType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElectricTimeControlType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcElementAssembly=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.AssemblyPlace=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElementAssembly(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},IfcElementAssemblyType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcElementAssemblyType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcElementComponent=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcElementComponent(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcElementComponentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElementComponentType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcElementQuantity=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.MethodOfMeasurement=a,this.Quantities=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcElementQuantity(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.MethodOfMeasurement),e.push(this.Quantities),e}},IfcElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcElementarySurface=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Position=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcElementarySurface(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},IfcEllipse=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Position=r,this.SemiAxis1=i,this.SemiAxis2=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcEllipse(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.SemiAxis1),e.push(this.SemiAxis2),e}},IfcEllipseProfileDef=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.SemiAxis1=s,this.SemiAxis2=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcEllipseProfileDef(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}},IfcEnergyConversionDevice=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcEnergyConversionDevice(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcEnergyConversionDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcEnergyConversionDeviceType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcEngine=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcEngine(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcEngineType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcEngineType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcEvaporativeCooler=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcEvaporativeCooler(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcEvaporativeCoolerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcEvaporativeCoolerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcEvaporator=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcEvaporator(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcEvaporatorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcEvaporatorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcEvent=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=c,this.EventTriggerType=u,this.UserDefinedEventTriggerType=h,this.EventOccurenceTime=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcEvent(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e.push(this.EventOccurenceTime),e}},IfcEventTime=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.ActualDate=s,this.EarlyDate=a,this.LateDate=o,this.ScheduleDate=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcEventTime(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.ActualDate),e.push(this.EarlyDate),e.push(this.LateDate),e.push(this.ScheduleDate),e}},IfcEventType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h,this.EventTriggerType=p,this.UserDefinedEventTriggerType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcEventType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.EventTriggerType),e.push(this.UserDefinedEventTriggerType),e}},IfcExtendedProperties=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Properties=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcExtendedProperties(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Properties),e}},IfcExternalInformation=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcExternalInformation(e,t)}ToTape(){return[]}},IfcExternalReference=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcExternalReference(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},IfcExternalReferenceRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingReference=n,this.RelatedResourceObjects=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcExternalReferenceRelationship(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}},IfcExternalSpatialElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcExternalSpatialElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},IfcExternalSpatialStructureElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcExternalSpatialStructureElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},IfcExternallyDefinedHatchStyle=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcExternallyDefinedHatchStyle(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},IfcExternallyDefinedSurfaceStyle=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcExternallyDefinedSurfaceStyle(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},IfcExternallyDefinedTextFont=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcExternallyDefinedTextFont(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e}},IfcExtrudedAreaSolid=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.ExtrudedDirection=n,this.Depth=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcExtrudedAreaSolid(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}},IfcExtrudedAreaSolidTapered=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.ExtrudedDirection=n,this.Depth=s,this.EndSweptArea=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcExtrudedAreaSolidTapered(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}},IfcFace=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Bounds=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcFace(e,t,n)}ToTape(){let e=[];return e.push(this.Bounds),e}},IfcFaceBasedSurfaceModel=class{constructor(e,t,r){this.expressID=e,this.type=t,this.FbsmFaces=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcFaceBasedSurfaceModel(e,t,n)}ToTape(){let e=[];return e.push(this.FbsmFaces),e}},IfcFaceBound=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Bound=r,this.Orientation=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcFaceBound(e,t,n,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},IfcFaceOuterBound=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Bound=r,this.Orientation=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcFaceOuterBound(e,t,n,s)}ToTape(){let e=[];return e.push(this.Bound),e.push(this.Orientation),e}},IfcFaceSurface=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Bounds=r,this.FaceSurface=i,this.SameSense=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcFaceSurface(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Bounds),e.push(this.FaceSurface),e.push(this.SameSense),e}},IfcFacetedBrep=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Outer=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcFacetedBrep(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},IfcFacetedBrepWithVoids=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Outer=r,this.Voids=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcFacetedBrepWithVoids(e,t,n,s)}ToTape(){let e=[];return e.push(this.Outer),e.push(this.Voids),e}},IfcFacility=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFacility(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},IfcFacilityPart=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFacilityPart(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},IfcFailureConnectionCondition=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.TensionFailureX=i,this.TensionFailureY=n,this.TensionFailureZ=s,this.CompressionFailureX=a,this.CompressionFailureY=o,this.CompressionFailureZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcFailureConnectionCondition(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.TensionFailureX),e.push(this.TensionFailureY),e.push(this.TensionFailureZ),e.push(this.CompressionFailureX),e.push(this.CompressionFailureY),e.push(this.CompressionFailureZ),e}},IfcFan=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFan(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFanType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFanType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFastener=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFastener(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFastenerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFastenerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFeatureElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFeatureElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFeatureElementAddition=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFeatureElementAddition(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFeatureElementSubtraction=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFeatureElementSubtraction(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFillAreaStyle=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.FillStyles=i,this.ModelorDraughting=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcFillAreaStyle(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FillStyles),e.push(this.ModelorDraughting),e}},IfcFillAreaStyleHatching=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.HatchLineAppearance=r,this.StartOfNextHatchLine=i,this.PointOfReferenceHatchLine=n,this.PatternStart=s,this.HatchLineAngle=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcFillAreaStyleHatching(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}},IfcFillAreaStyleTiles=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.TilingPattern=r,this.Tiles=i,this.TilingScale=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcFillAreaStyleTiles(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.TilingPattern),e.push(this.Tiles),e.push(this.TilingScale),e}},IfcFilter=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFilter(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFilterType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFilterType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFireSuppressionTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFireSuppressionTerminal(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFireSuppressionTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFireSuppressionTerminalType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFixedReferenceSweptAreaSolid=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.Directrix=n,this.StartParam=s,this.EndParam=a,this.FixedReference=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcFixedReferenceSweptAreaSolid(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FixedReference),e}},IfcFlowController=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowController(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowControllerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowControllerType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowFitting=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowFitting(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowFittingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowFittingType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowInstrument=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowInstrument(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFlowInstrumentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFlowInstrumentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFlowMeter=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowMeter(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFlowMeterType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFlowMeterType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFlowMovingDevice=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowMovingDevice(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowMovingDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowMovingDeviceType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowSegment=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowSegment(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowSegmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowSegmentType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowStorageDevice=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowStorageDevice(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowStorageDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowStorageDeviceType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowTerminal(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowTerminalType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFlowTreatmentDevice=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFlowTreatmentDevice(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFlowTreatmentDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFlowTreatmentDeviceType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFooting=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFooting(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFootingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcFootingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcFurnishingElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcFurnishingElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcFurnishingElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFurnishingElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcFurniture=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcFurniture(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcFurnitureType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.AssemblyPlace=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcFurnitureType(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.AssemblyPlace),e.push(this.PredefinedType),e}},IfcGeographicElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcGeographicElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcGeographicElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcGeographicElementType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcGeometricCurveSet=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Elements=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcGeometricCurveSet(e,t,n)}ToTape(){let e=[];return e.push(this.Elements),e}},IfcGeometricRepresentationContext=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.ContextIdentifier=r,this.ContextType=i,this.CoordinateSpaceDimension=n,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcGeometricRepresentationContext(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e}},IfcGeometricRepresentationItem=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcGeometricRepresentationItem(e,t)}ToTape(){return[]}},IfcGeometricRepresentationSubContext=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ContextIdentifier=r,this.ContextType=i,this.CoordinateSpaceDimension=n,this.Precision=s,this.WorldCoordinateSystem=a,this.TrueNorth=o,this.ParentContext=l,this.TargetScale=c,this.TargetView=u,this.UserDefinedTargetView=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcGeometricRepresentationSubContext(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e.push(this.CoordinateSpaceDimension),e.push(this.Precision),e.push(this.WorldCoordinateSystem),e.push(this.TrueNorth),e.push(this.ParentContext),e.push(this.TargetScale),e.push(this.TargetView),e.push(this.UserDefinedTargetView),e}},IfcGeometricSet=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Elements=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcGeometricSet(e,t,n)}ToTape(){let e=[];return e.push(this.Elements),e}},IfcGrid=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.UAxes=c,this.VAxes=u,this.WAxes=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcGrid(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.UAxes),e.push(this.VAxes),e.push(this.WAxes),e.push(this.PredefinedType),e}},IfcGridAxis=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.AxisTag=r,this.AxisCurve=i,this.SameSense=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcGridAxis(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.AxisTag),e.push(this.AxisCurve),e.push(this.SameSense),e}},IfcGridPlacement=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.PlacementRelTo=r,this.PlacementLocation=i,this.PlacementRefDirection=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcGridPlacement(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.PlacementLocation),e.push(this.PlacementRefDirection),e}},IfcGroup=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcGroup(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}},IfcHalfSpaceSolid=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.BaseSurface=r,this.AgreementFlag=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcHalfSpaceSolid(e,t,n,s)}ToTape(){let e=[];return e.push(this.BaseSurface),e.push(this.AgreementFlag),e}},IfcHeatExchanger=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcHeatExchanger(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcHeatExchangerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcHeatExchangerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcHumidifier=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcHumidifier(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcHumidifierType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcHumidifierType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcIShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.OverallWidth=s,this.OverallDepth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.FlangeEdgeRadius=u,this.FlangeSlope=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcIShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.OverallWidth),e.push(this.OverallDepth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.FlangeSlope),e}},IfcImageTexture=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.RepeatS=r,this.RepeatT=i,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.URLReference=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcImageTexture(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.URLReference),e}},IfcIndexedColourMap=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.MappedTo=r,this.Opacity=i,this.Colours=n,this.ColourIndex=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcIndexedColourMap(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}},IfcIndexedPolyCurve=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Points=r,this.Segments=i,this.SelfIntersect=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcIndexedPolyCurve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Points),e.push(this.Segments),e.push(this.SelfIntersect),e}},IfcIndexedPolygonalFace=class{constructor(e,t,r){this.expressID=e,this.type=t,this.CoordIndex=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcIndexedPolygonalFace(e,t,n)}ToTape(){let e=[];return e.push(this.CoordIndex),e}},IfcIndexedPolygonalFaceWithVoids=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.CoordIndex=r,this.InnerCoordIndices=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcIndexedPolygonalFaceWithVoids(e,t,n,s)}ToTape(){let e=[];return e.push(this.CoordIndex),e.push(this.InnerCoordIndices),e}},IfcIndexedTextureMap=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Maps=r,this.MappedTo=i,this.TexCoords=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcIndexedTextureMap(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.MappedTo),e.push(this.TexCoords),e}},IfcIndexedTriangleTextureMap=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Maps=r,this.MappedTo=i,this.TexCoords=n,this.TexCoordIndex=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcIndexedTriangleTextureMap(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}},IfcInterceptor=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcInterceptor(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcInterceptorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcInterceptorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcIntersectionCurve=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Curve3D=r,this.AssociatedGeometry=i,this.MasterRepresentation=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcIntersectionCurve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},IfcInventory=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.Jurisdiction=l,this.ResponsiblePersons=c,this.LastUpdateDate=u,this.CurrentValue=h,this.OriginalValue=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcInventory(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.Jurisdiction),e.push(this.ResponsiblePersons),e.push(this.LastUpdateDate),e.push(this.CurrentValue),e.push(this.OriginalValue),e}},IfcIrregularTimeSeries=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c,this.Values=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcIrregularTimeSeries(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.Values),e}},IfcIrregularTimeSeriesValue=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.TimeStamp=r,this.ListValues=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcIrregularTimeSeriesValue(e,t,n,s)}ToTape(){let e=[];return e.push(this.TimeStamp),e.push(this.ListValues),e}},IfcJunctionBox=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcJunctionBox(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcJunctionBoxType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcJunctionBoxType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcLShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Depth=s,this.Width=a,this.Thickness=o,this.FilletRadius=l,this.EdgeRadius=c,this.LegSlope=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcLShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.Width),e.push(this.Thickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.LegSlope),e}},IfcLaborResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcLaborResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcLaborResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcLaborResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcLagTime=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.LagValue=s,this.DurationType=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcLagTime(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}},IfcLamp=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcLamp(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcLampType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcLampType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcLibraryInformation=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.Version=i,this.Publisher=n,this.VersionDate=s,this.Location=a,this.Description=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcLibraryInformation(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Version),e.push(this.Publisher),e.push(this.VersionDate),e.push(this.Location),e.push(this.Description),e}},IfcLibraryReference=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Location=r,this.Identification=i,this.Name=n,this.Description=s,this.Language=a,this.ReferencedLibrary=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcLibraryReference(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Location),e.push(this.Identification),e.push(this.Name),e.push(this.Description),e.push(this.Language),e.push(this.ReferencedLibrary),e}},IfcLightDistributionData=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.MainPlaneAngle=r,this.SecondaryPlaneAngle=i,this.LuminousIntensity=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcLightDistributionData(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.MainPlaneAngle),e.push(this.SecondaryPlaneAngle),e.push(this.LuminousIntensity),e}},IfcLightFixture=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcLightFixture(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcLightFixtureType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcLightFixtureType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcLightIntensityDistribution=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.LightDistributionCurve=r,this.DistributionData=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcLightIntensityDistribution(e,t,n,s)}ToTape(){let e=[];return e.push(this.LightDistributionCurve),e.push(this.DistributionData),e}},IfcLightSource=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcLightSource(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}},IfcLightSourceAmbient=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcLightSourceAmbient(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}},IfcLightSourceDirectional=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s,this.Orientation=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcLightSourceDirectional(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}},IfcLightSourceGoniometric=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.ColourAppearance=o,this.ColourTemperature=l,this.LuminousFlux=c,this.LightEmissionSource=u,this.LightDistributionDataSource=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcLightSourceGoniometric(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.ColourAppearance),e.push(this.ColourTemperature),e.push(this.LuminousFlux),e.push(this.LightEmissionSource),e.push(this.LightDistributionDataSource),e}},IfcLightSourcePositional=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=c,this.QuadricAttenuation=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcLightSourcePositional(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e}},IfcLightSourceSpot=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.Name=r,this.LightColour=i,this.AmbientIntensity=n,this.Intensity=s,this.Position=a,this.Radius=o,this.ConstantAttenuation=l,this.DistanceAttenuation=c,this.QuadricAttenuation=u,this.Orientation=h,this.ConcentrationExponent=p,this.SpreadAngle=d,this.BeamWidthAngle=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcLightSourceSpot(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LightColour),e.push(this.AmbientIntensity),e.push(this.Intensity),e.push(this.Position),e.push(this.Radius),e.push(this.ConstantAttenuation),e.push(this.DistanceAttenuation),e.push(this.QuadricAttenuation),e.push(this.Orientation),e.push(this.ConcentrationExponent),e.push(this.SpreadAngle),e.push(this.BeamWidthAngle),e}},IfcLine=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Pnt=r,this.Dir=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcLine(e,t,n,s)}ToTape(){let e=[];return e.push(this.Pnt),e.push(this.Dir),e}},IfcLineSegment2D=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.StartPoint=r,this.StartDirection=i,this.SegmentLength=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcLineSegment2D(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e}},IfcLinearPlacement=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.PlacementRelTo=r,this.PlacementMeasuredAlong=i,this.Distance=n,this.Orientation=s,this.CartesianPosition=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcLinearPlacement(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}},IfcLinearPositioningElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Axis=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcLinearPositioningElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Axis),e}},IfcLocalPlacement=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.PlacementRelTo=r,this.RelativePlacement=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcLocalPlacement(e,t,n,s)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e.push(this.RelativePlacement),e}},IfcLoop=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcLoop(e,t)}ToTape(){return[]}},IfcManifoldSolidBrep=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Outer=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcManifoldSolidBrep(e,t,n)}ToTape(){let e=[];return e.push(this.Outer),e}},IfcMapConversion=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.SourceCRS=r,this.TargetCRS=i,this.Eastings=n,this.Northings=s,this.OrthogonalHeight=a,this.XAxisAbscissa=o,this.XAxisOrdinate=l,this.Scale=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcMapConversion(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.SourceCRS),e.push(this.TargetCRS),e.push(this.Eastings),e.push(this.Northings),e.push(this.OrthogonalHeight),e.push(this.XAxisAbscissa),e.push(this.XAxisOrdinate),e.push(this.Scale),e}},IfcMappedItem=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.MappingSource=r,this.MappingTarget=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcMappedItem(e,t,n,s)}ToTape(){let e=[];return e.push(this.MappingSource),e.push(this.MappingTarget),e}},IfcMaterial=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Category=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcMaterial(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Category),e}},IfcMaterialClassificationRelationship=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.MaterialClassifications=r,this.ClassifiedMaterial=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcMaterialClassificationRelationship(e,t,n,s)}ToTape(){let e=[];return e.push(this.MaterialClassifications),e.push(this.ClassifiedMaterial),e}},IfcMaterialConstituent=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Material=n,this.Fraction=s,this.Category=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcMaterialConstituent(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}},IfcMaterialConstituentSet=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.MaterialConstituents=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcMaterialConstituentSet(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.MaterialConstituents),e}},IfcMaterialDefinition=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcMaterialDefinition(e,t)}ToTape(){return[]}},IfcMaterialDefinitionRepresentation=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Representations=n,this.RepresentedMaterial=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcMaterialDefinitionRepresentation(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}},IfcMaterialLayer=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Material=r,this.LayerThickness=i,this.IsVentilated=n,this.Name=s,this.Description=a,this.Category=o,this.Priority=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcMaterialLayer(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e}},IfcMaterialLayerSet=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.MaterialLayers=r,this.LayerSetName=i,this.Description=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcMaterialLayerSet(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.MaterialLayers),e.push(this.LayerSetName),e.push(this.Description),e}},IfcMaterialLayerSetUsage=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ForLayerSet=r,this.LayerSetDirection=i,this.DirectionSense=n,this.OffsetFromReferenceLine=s,this.ReferenceExtent=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcMaterialLayerSetUsage(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}},IfcMaterialLayerWithOffsets=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Material=r,this.LayerThickness=i,this.IsVentilated=n,this.Name=s,this.Description=a,this.Category=o,this.Priority=l,this.OffsetDirection=c,this.OffsetValues=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcMaterialLayerWithOffsets(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Material),e.push(this.LayerThickness),e.push(this.IsVentilated),e.push(this.Name),e.push(this.Description),e.push(this.Category),e.push(this.Priority),e.push(this.OffsetDirection),e.push(this.OffsetValues),e}},IfcMaterialList=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Materials=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcMaterialList(e,t,n)}ToTape(){let e=[];return e.push(this.Materials),e}},IfcMaterialProfile=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Material=n,this.Profile=s,this.Priority=a,this.Category=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcMaterialProfile(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e}},IfcMaterialProfileSet=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.MaterialProfiles=n,this.CompositeProfile=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcMaterialProfileSet(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}},IfcMaterialProfileSetUsage=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.ForProfileSet=r,this.CardinalPoint=i,this.ReferenceExtent=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcMaterialProfileSetUsage(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ForProfileSet),e.push(this.CardinalPoint),e.push(this.ReferenceExtent),e}},IfcMaterialProfileSetUsageTapering=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ForProfileSet=r,this.CardinalPoint=i,this.ReferenceExtent=n,this.ForProfileEndSet=s,this.CardinalEndPoint=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcMaterialProfileSetUsageTapering(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}},IfcMaterialProfileWithOffsets=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Material=n,this.Profile=s,this.Priority=a,this.Category=o,this.OffsetValues=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcMaterialProfileWithOffsets(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Material),e.push(this.Profile),e.push(this.Priority),e.push(this.Category),e.push(this.OffsetValues),e}},IfcMaterialProperties=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Properties=n,this.Material=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcMaterialProperties(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}},IfcMaterialRelationship=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingMaterial=n,this.RelatedMaterials=s,this.Expression=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcMaterialRelationship(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}},IfcMaterialUsageDefinition=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcMaterialUsageDefinition(e,t)}ToTape(){return[]}},IfcMeasureWithUnit=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.ValueComponent=r,this.UnitComponent=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcMeasureWithUnit(e,t,n,s)}ToTape(){let e=[];return e.push(this.ValueComponent),e.push(this.UnitComponent),e}},IfcMechanicalFastener=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.NominalDiameter=u,this.NominalLength=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcMechanicalFastener(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NominalDiameter),e.push(this.NominalLength),e.push(this.PredefinedType),e}},IfcMechanicalFastenerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.NominalLength=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcMechanicalFastenerType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.NominalLength),e}},IfcMedicalDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcMedicalDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcMedicalDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcMedicalDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcMember=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcMember(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcMemberStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcMemberStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcMemberType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcMemberType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcMetric=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.Benchmark=c,this.ValueSource=u,this.DataValue=h,this.ReferencePath=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcMetric(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.Benchmark),e.push(this.ValueSource),e.push(this.DataValue),e.push(this.ReferencePath),e}},IfcMirroredProfileDef=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.ParentProfile=n,this.Operator=s,this.Label=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcMirroredProfileDef(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}},IfcMonetaryUnit=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Currency=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcMonetaryUnit(e,t,n)}ToTape(){let e=[];return e.push(this.Currency),e}},IfcMotorConnection=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcMotorConnection(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcMotorConnectionType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcMotorConnectionType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcNamedUnit=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Dimensions=r,this.UnitType=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcNamedUnit(e,t,n,s)}ToTape(){let e=[];return e.push(this.Dimensions),e.push(this.UnitType),e}},IfcObject=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcObject(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}},IfcObjectDefinition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcObjectDefinition(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}},IfcObjectPlacement=class{constructor(e,t,r){this.expressID=e,this.type=t,this.PlacementRelTo=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcObjectPlacement(e,t,n)}ToTape(){let e=[];return e.push(this.PlacementRelTo),e}},IfcObjective=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.ConstraintGrade=n,this.ConstraintSource=s,this.CreatingActor=a,this.CreationTime=o,this.UserDefinedGrade=l,this.BenchmarkValues=c,this.LogicalAggregator=u,this.ObjectiveQualifier=h,this.UserDefinedQualifier=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcObjective(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.ConstraintGrade),e.push(this.ConstraintSource),e.push(this.CreatingActor),e.push(this.CreationTime),e.push(this.UserDefinedGrade),e.push(this.BenchmarkValues),e.push(this.LogicalAggregator),e.push(this.ObjectiveQualifier),e.push(this.UserDefinedQualifier),e}},IfcOccupant=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.TheActor=o,this.PredefinedType=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcOccupant(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheActor),e.push(this.PredefinedType),e}},IfcOffsetCurve=class{constructor(e,t,r){this.expressID=e,this.type=t,this.BasisCurve=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcOffsetCurve(e,t,n)}ToTape(){let e=[];return e.push(this.BasisCurve),e}},IfcOffsetCurve2D=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BasisCurve=r,this.Distance=i,this.SelfIntersect=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcOffsetCurve2D(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.Distance),e.push(this.SelfIntersect),e}},IfcOffsetCurve3D=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.BasisCurve=r,this.Distance=i,this.SelfIntersect=n,this.RefDirection=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcOffsetCurve3D(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}},IfcOffsetCurveByDistances=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BasisCurve=r,this.OffsetValues=i,this.Tag=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcOffsetCurveByDistances(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.OffsetValues),e.push(this.Tag),e}},IfcOpenShell=class{constructor(e,t,r){this.expressID=e,this.type=t,this.CfsFaces=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcOpenShell(e,t,n)}ToTape(){let e=[];return e.push(this.CfsFaces),e}},IfcOpeningElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcOpeningElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcOpeningStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcOpeningStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcOrganization=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Identification=r,this.Name=i,this.Description=n,this.Roles=s,this.Addresses=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcOrganization(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}},IfcOrganizationRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingOrganization=n,this.RelatedOrganizations=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcOrganizationRelationship(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}},IfcOrientationExpression=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.LateralAxisDirection=r,this.VerticalAxisDirection=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcOrientationExpression(e,t,n,s)}ToTape(){let e=[];return e.push(this.LateralAxisDirection),e.push(this.VerticalAxisDirection),e}},IfcOrientedEdge=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.EdgeStart=r,this.EdgeEnd=i,this.EdgeElement=n,this.Orientation=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcOrientedEdge(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}},IfcOuterBoundaryCurve=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Segments=r,this.SelfIntersect=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcOuterBoundaryCurve(e,t,n,s)}ToTape(){let e=[];return e.push(this.Segments),e.push(this.SelfIntersect),e}},IfcOutlet=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcOutlet(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcOutletType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcOutletType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcOwnerHistory=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.OwningUser=r,this.OwningApplication=i,this.State=n,this.ChangeAction=s,this.LastModifiedDate=a,this.LastModifyingUser=o,this.LastModifyingApplication=l,this.CreationDate=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcOwnerHistory(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.OwningUser),e.push(this.OwningApplication),e.push(this.State),e.push(this.ChangeAction),e.push(this.LastModifiedDate),e.push(this.LastModifyingUser),e.push(this.LastModifyingApplication),e.push(this.CreationDate),e}},IfcParameterizedProfileDef=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcParameterizedProfileDef(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e}},IfcPath=class{constructor(e,t,r){this.expressID=e,this.type=t,this.EdgeList=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPath(e,t,n)}ToTape(){let e=[];return e.push(this.EdgeList),e}},IfcPcurve=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.BasisSurface=r,this.ReferenceCurve=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcPcurve(e,t,n,s)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.ReferenceCurve),e}},IfcPerformanceHistory=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LifeCyclePhase=l,this.PredefinedType=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcPerformanceHistory(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LifeCyclePhase),e.push(this.PredefinedType),e}},IfcPermeableCoveringProperties=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=c,this.ShapeAspectStyle=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPermeableCoveringProperties(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},IfcPermit=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPermit(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},IfcPerson=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Identification=r,this.FamilyName=i,this.GivenName=n,this.MiddleNames=s,this.PrefixTitles=a,this.SuffixTitles=o,this.Roles=l,this.Addresses=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcPerson(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Identification),e.push(this.FamilyName),e.push(this.GivenName),e.push(this.MiddleNames),e.push(this.PrefixTitles),e.push(this.SuffixTitles),e.push(this.Roles),e.push(this.Addresses),e}},IfcPersonAndOrganization=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.ThePerson=r,this.TheOrganization=i,this.Roles=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcPersonAndOrganization(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.ThePerson),e.push(this.TheOrganization),e.push(this.Roles),e}},IfcPhysicalComplexQuantity=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.HasQuantities=n,this.Discrimination=s,this.Quality=a,this.Usage=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcPhysicalComplexQuantity(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.HasQuantities),e.push(this.Discrimination),e.push(this.Quality),e.push(this.Usage),e}},IfcPhysicalQuantity=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Name=r,this.Description=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcPhysicalQuantity(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},IfcPhysicalSimpleQuantity=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcPhysicalSimpleQuantity(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Unit),e}},IfcPile=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u,this.ConstructionType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPile(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e.push(this.ConstructionType),e}},IfcPileType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPileType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcPipeFitting=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPipeFitting(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcPipeFittingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPipeFittingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcPipeSegment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPipeSegment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcPipeSegmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPipeSegmentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcPixelTexture=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.RepeatS=r,this.RepeatT=i,this.Mode=n,this.TextureTransform=s,this.Parameter=a,this.Width=o,this.Height=l,this.ColourComponents=c,this.Pixel=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPixelTexture(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.RepeatS),e.push(this.RepeatT),e.push(this.Mode),e.push(this.TextureTransform),e.push(this.Parameter),e.push(this.Width),e.push(this.Height),e.push(this.ColourComponents),e.push(this.Pixel),e}},IfcPlacement=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Location=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPlacement(e,t,n)}ToTape(){let e=[];return e.push(this.Location),e}},IfcPlanarBox=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.SizeInX=r,this.SizeInY=i,this.Placement=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcPlanarBox(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e.push(this.Placement),e}},IfcPlanarExtent=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SizeInX=r,this.SizeInY=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcPlanarExtent(e,t,n,s)}ToTape(){let e=[];return e.push(this.SizeInX),e.push(this.SizeInY),e}},IfcPlane=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Position=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPlane(e,t,n)}ToTape(){let e=[];return e.push(this.Position),e}},IfcPlate=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPlate(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcPlateStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPlateStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcPlateType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPlateType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcPoint=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcPoint(e,t)}ToTape(){return[]}},IfcPointOnCurve=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.BasisCurve=r,this.PointParameter=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcPointOnCurve(e,t,n,s)}ToTape(){let e=[];return e.push(this.BasisCurve),e.push(this.PointParameter),e}},IfcPointOnSurface=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.BasisSurface=r,this.PointParameterU=i,this.PointParameterV=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcPointOnSurface(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.PointParameterU),e.push(this.PointParameterV),e}},IfcPolyLoop=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Polygon=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPolyLoop(e,t,n)}ToTape(){let e=[];return e.push(this.Polygon),e}},IfcPolygonalBoundedHalfSpace=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.BaseSurface=r,this.AgreementFlag=i,this.Position=n,this.PolygonalBoundary=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPolygonalBoundedHalfSpace(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}},IfcPolygonalFaceSet=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Coordinates=r,this.Closed=i,this.Faces=n,this.PnIndex=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPolygonalFaceSet(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}},IfcPolyline=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Points=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPolyline(e,t,n)}ToTape(){let e=[];return e.push(this.Points),e}},IfcPort=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcPort(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcPositioningElement=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcPositioningElement(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcPostalAddress=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Purpose=r,this.Description=i,this.UserDefinedPurpose=n,this.InternalLocation=s,this.AddressLines=a,this.PostalBox=o,this.Town=l,this.Region=c,this.PostalCode=u,this.Country=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPostalAddress(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.InternalLocation),e.push(this.AddressLines),e.push(this.PostalBox),e.push(this.Town),e.push(this.Region),e.push(this.PostalCode),e.push(this.Country),e}},IfcPreDefinedColour=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPreDefinedColour(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcPreDefinedCurveFont=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPreDefinedCurveFont(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcPreDefinedItem=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPreDefinedItem(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcPreDefinedProperties=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcPreDefinedProperties(e,t)}ToTape(){return[]}},IfcPreDefinedPropertySet=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPreDefinedPropertySet(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}},IfcPreDefinedTextFont=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPreDefinedTextFont(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcPresentationItem=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcPresentationItem(e,t)}ToTape(){return[]}},IfcPresentationLayerAssignment=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.AssignedItems=n,this.Identifier=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPresentationLayerAssignment(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}},IfcPresentationLayerWithStyle=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.AssignedItems=n,this.Identifier=s,this.LayerOn=a,this.LayerFrozen=o,this.LayerBlocked=l,this.LayerStyles=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcPresentationLayerWithStyle(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.AssignedItems),e.push(this.Identifier),e.push(this.LayerOn),e.push(this.LayerFrozen),e.push(this.LayerBlocked),e.push(this.LayerStyles),e}},IfcPresentationStyle=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPresentationStyle(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcPresentationStyleAssignment=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Styles=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcPresentationStyleAssignment(e,t,n)}ToTape(){let e=[];return e.push(this.Styles),e}},IfcProcedure=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.PredefinedType=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcProcedure(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.PredefinedType),e}},IfcProcedureType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcProcedureType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e}},IfcProcess=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcProcess(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},IfcProduct=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcProduct(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcProductDefinitionShape=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Representations=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcProductDefinitionShape(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},IfcProductRepresentation=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Representations=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcProductRepresentation(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.Representations),e}},IfcProfileDef=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcProfileDef(e,t,n,s)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e}},IfcProfileProperties=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Properties=n,this.ProfileDefinition=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcProfileProperties(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}},IfcProject=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProject(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},IfcProjectLibrary=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o,this.Phase=l,this.RepresentationContexts=c,this.UnitsInContext=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProjectLibrary(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e.push(this.Phase),e.push(this.RepresentationContexts),e.push(this.UnitsInContext),e}},IfcProjectOrder=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.PredefinedType=l,this.Status=c,this.LongDescription=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProjectOrder(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.PredefinedType),e.push(this.Status),e.push(this.LongDescription),e}},IfcProjectedCRS=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.GeodeticDatum=n,this.VerticalDatum=s,this.MapProjection=a,this.MapZone=o,this.MapUnit=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcProjectedCRS(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.GeodeticDatum),e.push(this.VerticalDatum),e.push(this.MapProjection),e.push(this.MapZone),e.push(this.MapUnit),e}},IfcProjectionElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProjectionElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcProperty=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Name=r,this.Description=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcProperty(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},IfcPropertyAbstraction=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcPropertyAbstraction(e,t)}ToTape(){return[]}},IfcPropertyBoundedValue=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.UpperBoundValue=n,this.LowerBoundValue=s,this.Unit=a,this.SetPointValue=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcPropertyBoundedValue(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.UpperBoundValue),e.push(this.LowerBoundValue),e.push(this.Unit),e.push(this.SetPointValue),e}},IfcPropertyDefinition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyDefinition(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}},IfcPropertyDependencyRelationship=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.DependingProperty=n,this.DependantProperty=s,this.Expression=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcPropertyDependencyRelationship(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}},IfcPropertyEnumeratedValue=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.EnumerationValues=n,this.EnumerationReference=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyEnumeratedValue(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}},IfcPropertyEnumeration=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.EnumerationValues=i,this.Unit=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcPropertyEnumeration(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.EnumerationValues),e.push(this.Unit),e}},IfcPropertyListValue=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.ListValues=n,this.Unit=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyListValue(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}},IfcPropertyReferenceValue=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.UsageName=n,this.PropertyReference=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyReferenceValue(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}},IfcPropertySet=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.HasProperties=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcPropertySet(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}},IfcPropertySetDefinition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertySetDefinition(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}},IfcPropertySetTemplate=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.TemplateType=a,this.ApplicableEntity=o,this.HasPropertyTemplates=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcPropertySetTemplate(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.ApplicableEntity),e.push(this.HasPropertyTemplates),e}},IfcPropertySingleValue=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.NominalValue=n,this.Unit=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertySingleValue(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}},IfcPropertyTableValue=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.DefiningValues=n,this.DefinedValues=s,this.Expression=a,this.DefiningUnit=o,this.DefinedUnit=l,this.CurveInterpolation=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcPropertyTableValue(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.DefiningValues),e.push(this.DefinedValues),e.push(this.Expression),e.push(this.DefiningUnit),e.push(this.DefinedUnit),e.push(this.CurveInterpolation),e}},IfcPropertyTemplate=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyTemplate(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}},IfcPropertyTemplateDefinition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcPropertyTemplateDefinition(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}},IfcProtectiveDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProtectiveDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcProtectiveDeviceTrippingUnit=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProtectiveDeviceTrippingUnit(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcProtectiveDeviceTrippingUnitType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcProtectiveDeviceTrippingUnitType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcProtectiveDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcProtectiveDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcProxy=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.ProxyType=c,this.Tag=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcProxy(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.ProxyType),e.push(this.Tag),e}},IfcPump=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcPump(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcPumpType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcPumpType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcQuantityArea=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.AreaValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityArea(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}},IfcQuantityCount=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.CountValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityCount(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}},IfcQuantityLength=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.LengthValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityLength(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}},IfcQuantitySet=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcQuantitySet(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}},IfcQuantityTime=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.TimeValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityTime(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}},IfcQuantityVolume=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.VolumeValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityVolume(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}},IfcQuantityWeight=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.Unit=n,this.WeightValue=s,this.Formula=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcQuantityWeight(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}},IfcRailing=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRailing(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcRailingType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRailingType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcRamp=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRamp(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcRampFlight=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRampFlight(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcRampFlightType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRampFlightType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcRampType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRampType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcRationalBSplineCurveWithKnots=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Degree=r,this.ControlPointsList=i,this.CurveForm=n,this.ClosedCurve=s,this.SelfIntersect=a,this.KnotMultiplicities=o,this.Knots=l,this.KnotSpec=c,this.WeightsData=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRationalBSplineCurveWithKnots(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Degree),e.push(this.ControlPointsList),e.push(this.CurveForm),e.push(this.ClosedCurve),e.push(this.SelfIntersect),e.push(this.KnotMultiplicities),e.push(this.Knots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},IfcRationalBSplineSurfaceWithKnots=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.UDegree=r,this.VDegree=i,this.ControlPointsList=n,this.SurfaceForm=s,this.UClosed=a,this.VClosed=o,this.SelfIntersect=l,this.UMultiplicities=c,this.VMultiplicities=u,this.UKnots=h,this.VKnots=p,this.KnotSpec=d,this.WeightsData=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcRationalBSplineSurfaceWithKnots(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.UDegree),e.push(this.VDegree),e.push(this.ControlPointsList),e.push(this.SurfaceForm),e.push(this.UClosed),e.push(this.VClosed),e.push(this.SelfIntersect),e.push(this.UMultiplicities),e.push(this.VMultiplicities),e.push(this.UKnots),e.push(this.VKnots),e.push(this.KnotSpec),e.push(this.WeightsData),e}},IfcRectangleHollowProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.XDim=s,this.YDim=a,this.WallThickness=o,this.InnerFilletRadius=l,this.OuterFilletRadius=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcRectangleHollowProfileDef(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.WallThickness),e.push(this.InnerFilletRadius),e.push(this.OuterFilletRadius),e}},IfcRectangleProfileDef=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.XDim=s,this.YDim=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcRectangleProfileDef(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}},IfcRectangularPyramid=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Position=r,this.XLength=i,this.YLength=n,this.Height=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRectangularPyramid(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}},IfcRectangularTrimmedSurface=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.BasisSurface=r,this.U1=i,this.V1=n,this.U2=s,this.V2=a,this.Usense=o,this.Vsense=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRectangularTrimmedSurface(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.BasisSurface),e.push(this.U1),e.push(this.V1),e.push(this.U2),e.push(this.V2),e.push(this.Usense),e.push(this.Vsense),e}},IfcRecurrencePattern=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.RecurrenceType=r,this.DayComponent=i,this.WeekdayComponent=n,this.MonthComponent=s,this.Position=a,this.Interval=o,this.Occurrences=l,this.TimePeriods=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcRecurrencePattern(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.RecurrenceType),e.push(this.DayComponent),e.push(this.WeekdayComponent),e.push(this.MonthComponent),e.push(this.Position),e.push(this.Interval),e.push(this.Occurrences),e.push(this.TimePeriods),e}},IfcReference=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.TypeIdentifier=r,this.AttributeIdentifier=i,this.InstanceName=n,this.ListPositions=s,this.InnerReference=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcReference(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}},IfcReferent=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.RestartDistance=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcReferent(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.RestartDistance),e}},IfcRegularTimeSeries=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c,this.TimeStep=u,this.Values=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRegularTimeSeries(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e.push(this.TimeStep),e.push(this.Values),e}},IfcReinforcementBarProperties=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.TotalCrossSectionArea=r,this.SteelGrade=i,this.BarSurface=n,this.EffectiveDepth=s,this.NominalBarDiameter=a,this.BarCount=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcReinforcementBarProperties(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.TotalCrossSectionArea),e.push(this.SteelGrade),e.push(this.BarSurface),e.push(this.EffectiveDepth),e.push(this.NominalBarDiameter),e.push(this.BarCount),e}},IfcReinforcementDefinitionProperties=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.DefinitionType=a,this.ReinforcementSectionDefinitions=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcReinforcementDefinitionProperties(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.DefinitionType),e.push(this.ReinforcementSectionDefinitions),e}},IfcReinforcingBar=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.NominalDiameter=h,this.CrossSectionArea=p,this.BarLength=d,this.PredefinedType=m,this.BarSurface=f}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++];return new IfcReinforcingBar(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.BarLength),e.push(this.PredefinedType),e.push(this.BarSurface),e}},IfcReinforcingBarType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.BarLength=m,this.BarSurface=f,this.BendingShapeCode=g,this.BendingParameters=_}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++];return new IfcReinforcingBarType(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,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}},IfcReinforcingElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcReinforcingElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e}},IfcReinforcingElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcReinforcingElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcReinforcingMesh=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.MeshLength=h,this.MeshWidth=p,this.LongitudinalBarNominalDiameter=d,this.TransverseBarNominalDiameter=m,this.LongitudinalBarCrossSectionArea=f,this.TransverseBarCrossSectionArea=g,this.LongitudinalBarSpacing=_,this.TransverseBarSpacing=y,this.PredefinedType=T}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++],E=r[i++];return new IfcReinforcingMesh(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.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}},IfcReinforcingMeshType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.MeshLength=p,this.MeshWidth=d,this.LongitudinalBarNominalDiameter=m,this.TransverseBarNominalDiameter=f,this.LongitudinalBarCrossSectionArea=g,this.TransverseBarCrossSectionArea=_,this.LongitudinalBarSpacing=y,this.TransverseBarSpacing=T,this.BendingShapeCode=v,this.BendingParameters=E}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++],E=r[i++],I=r[i++],b=r[i++];return new IfcReinforcingMeshType(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E,I,b)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.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}},IfcRelAggregates=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAggregates(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},IfcRelAssigns=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssigns(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e}},IfcRelAssignsToActor=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingActor=l,this.ActingRole=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcRelAssignsToActor(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingActor),e.push(this.ActingRole),e}},IfcRelAssignsToControl=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingControl=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelAssignsToControl(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingControl),e}},IfcRelAssignsToGroup=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelAssignsToGroup(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e}},IfcRelAssignsToGroupByFactor=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingGroup=l,this.Factor=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcRelAssignsToGroupByFactor(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingGroup),e.push(this.Factor),e}},IfcRelAssignsToProcess=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProcess=l,this.QuantityInProcess=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcRelAssignsToProcess(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProcess),e.push(this.QuantityInProcess),e}},IfcRelAssignsToProduct=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingProduct=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelAssignsToProduct(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingProduct),e}},IfcRelAssignsToResource=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatedObjectsType=o,this.RelatingResource=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelAssignsToResource(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatedObjectsType),e.push(this.RelatingResource),e}},IfcRelAssociates=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcRelAssociates(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}},IfcRelAssociatesApproval=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingApproval=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssociatesApproval(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingApproval),e}},IfcRelAssociatesClassification=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingClassification=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssociatesClassification(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingClassification),e}},IfcRelAssociatesConstraint=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.Intent=o,this.RelatingConstraint=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelAssociatesConstraint(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.Intent),e.push(this.RelatingConstraint),e}},IfcRelAssociatesDocument=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingDocument=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssociatesDocument(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingDocument),e}},IfcRelAssociatesLibrary=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingLibrary=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssociatesLibrary(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingLibrary),e}},IfcRelAssociatesMaterial=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingMaterial=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelAssociatesMaterial(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingMaterial),e}},IfcRelConnects=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRelConnects(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}},IfcRelConnectsElements=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelConnectsElements(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e}},IfcRelConnectsPathElements=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RelatingPriorities=c,this.RelatedPriorities=u,this.RelatedConnectionType=h,this.RelatingConnectionType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcRelConnectsPathElements(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RelatingPriorities),e.push(this.RelatedPriorities),e.push(this.RelatedConnectionType),e.push(this.RelatingConnectionType),e}},IfcRelConnectsPortToElement=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingPort=a,this.RelatedElement=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelConnectsPortToElement(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedElement),e}},IfcRelConnectsPorts=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingPort=a,this.RelatedPort=o,this.RealizingElement=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcRelConnectsPorts(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPort),e.push(this.RelatedPort),e.push(this.RealizingElement),e}},IfcRelConnectsStructuralActivity=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedStructuralActivity=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelConnectsStructuralActivity(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedStructuralActivity),e}},IfcRelConnectsStructuralMember=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=c,this.SupportedLength=u,this.ConditionCoordinateSystem=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRelConnectsStructuralMember(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e}},IfcRelConnectsWithEccentricity=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingStructuralMember=a,this.RelatedStructuralConnection=o,this.AppliedCondition=l,this.AdditionalConditions=c,this.SupportedLength=u,this.ConditionCoordinateSystem=h,this.ConnectionConstraint=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcRelConnectsWithEccentricity(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingStructuralMember),e.push(this.RelatedStructuralConnection),e.push(this.AppliedCondition),e.push(this.AdditionalConditions),e.push(this.SupportedLength),e.push(this.ConditionCoordinateSystem),e.push(this.ConnectionConstraint),e}},IfcRelConnectsWithRealizingElements=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ConnectionGeometry=a,this.RelatingElement=o,this.RelatedElement=l,this.RealizingElements=c,this.ConnectionType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRelConnectsWithRealizingElements(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ConnectionGeometry),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.RealizingElements),e.push(this.ConnectionType),e}},IfcRelContainedInSpatialStructure=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelContainedInSpatialStructure(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},IfcRelCoversBldgElements=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingBuildingElement=a,this.RelatedCoverings=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelCoversBldgElements(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedCoverings),e}},IfcRelCoversSpaces=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedCoverings=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelCoversSpaces(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedCoverings),e}},IfcRelDeclares=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingContext=a,this.RelatedDefinitions=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelDeclares(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingContext),e.push(this.RelatedDefinitions),e}},IfcRelDecomposes=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRelDecomposes(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}},IfcRelDefines=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRelDefines(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}},IfcRelDefinesByObject=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingObject=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelDefinesByObject(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingObject),e}},IfcRelDefinesByProperties=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingPropertyDefinition=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelDefinesByProperties(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingPropertyDefinition),e}},IfcRelDefinesByTemplate=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedPropertySets=a,this.RelatingTemplate=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelDefinesByTemplate(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedPropertySets),e.push(this.RelatingTemplate),e}},IfcRelDefinesByType=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedObjects=a,this.RelatingType=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelDefinesByType(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedObjects),e.push(this.RelatingType),e}},IfcRelFillsElement=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingOpeningElement=a,this.RelatedBuildingElement=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelFillsElement(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingOpeningElement),e.push(this.RelatedBuildingElement),e}},IfcRelFlowControlElements=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedControlElements=a,this.RelatingFlowElement=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelFlowControlElements(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedControlElements),e.push(this.RelatingFlowElement),e}},IfcRelInterferesElements=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedElement=o,this.InterferenceGeometry=l,this.InterferenceType=c,this.ImpliedOrder=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRelInterferesElements(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedElement),e.push(this.InterferenceGeometry),e.push(this.InterferenceType),e.push(this.ImpliedOrder),e}},IfcRelNests=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingObject=a,this.RelatedObjects=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelNests(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingObject),e.push(this.RelatedObjects),e}},IfcRelPositions=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingPositioningElement=a,this.RelatedProducts=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelPositions(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingPositioningElement),e.push(this.RelatedProducts),e}},IfcRelProjectsElement=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingElement=a,this.RelatedFeatureElement=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelProjectsElement(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingElement),e.push(this.RelatedFeatureElement),e}},IfcRelReferencedInSpatialStructure=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatedElements=a,this.RelatingStructure=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelReferencedInSpatialStructure(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatedElements),e.push(this.RelatingStructure),e}},IfcRelSequence=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingProcess=a,this.RelatedProcess=o,this.TimeLag=l,this.SequenceType=c,this.UserDefinedSequenceType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRelSequence(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingProcess),e.push(this.RelatedProcess),e.push(this.TimeLag),e.push(this.SequenceType),e.push(this.UserDefinedSequenceType),e}},IfcRelServicesBuildings=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingSystem=a,this.RelatedBuildings=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelServicesBuildings(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSystem),e.push(this.RelatedBuildings),e}},IfcRelSpaceBoundary=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRelSpaceBoundary(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e}},IfcRelSpaceBoundary1stLevel=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u,this.ParentBoundary=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRelSpaceBoundary1stLevel(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e}},IfcRelSpaceBoundary2ndLevel=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingSpace=a,this.RelatedBuildingElement=o,this.ConnectionGeometry=l,this.PhysicalOrVirtualBoundary=c,this.InternalOrExternalBoundary=u,this.ParentBoundary=h,this.CorrespondingBoundary=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcRelSpaceBoundary2ndLevel(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingSpace),e.push(this.RelatedBuildingElement),e.push(this.ConnectionGeometry),e.push(this.PhysicalOrVirtualBoundary),e.push(this.InternalOrExternalBoundary),e.push(this.ParentBoundary),e.push(this.CorrespondingBoundary),e}},IfcRelVoidsElement=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.RelatingBuildingElement=a,this.RelatedOpeningElement=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRelVoidsElement(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.RelatingBuildingElement),e.push(this.RelatedOpeningElement),e}},IfcRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRelationship(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}},IfcReparametrisedCompositeCurveSegment=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Transition=r,this.SameSense=i,this.ParentCurve=n,this.ParamLength=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcReparametrisedCompositeCurveSegment(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}},IfcRepresentation=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRepresentation(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}},IfcRepresentationContext=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.ContextIdentifier=r,this.ContextType=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcRepresentationContext(e,t,n,s)}ToTape(){let e=[];return e.push(this.ContextIdentifier),e.push(this.ContextType),e}},IfcRepresentationItem=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcRepresentationItem(e,t)}ToTape(){return[]}},IfcRepresentationMap=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.MappingOrigin=r,this.MappedRepresentation=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcRepresentationMap(e,t,n,s)}ToTape(){let e=[];return e.push(this.MappingOrigin),e.push(this.MappedRepresentation),e}},IfcResource=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcResource(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e}},IfcResourceApprovalRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatedResourceObjects=n,this.RelatingApproval=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcResourceApprovalRelationship(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}},IfcResourceConstraintRelationship=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.RelatingConstraint=n,this.RelatedResourceObjects=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcResourceConstraintRelationship(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}},IfcResourceLevelRelationship=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Name=r,this.Description=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcResourceLevelRelationship(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},IfcResourceTime=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.ScheduleWork=s,this.ScheduleUsage=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.ScheduleContour=c,this.LevelingDelay=u,this.IsOverAllocated=h,this.StatusTime=p,this.ActualWork=d,this.ActualUsage=m,this.ActualStart=f,this.ActualFinish=g,this.RemainingWork=_,this.RemainingUsage=y,this.Completion=T}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++],E=r[i++];return new IfcResourceTime(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E)}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}},IfcRevolvedAreaSolid=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.Axis=n,this.Angle=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRevolvedAreaSolid(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}},IfcRevolvedAreaSolidTapered=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.Axis=n,this.Angle=s,this.EndSweptArea=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcRevolvedAreaSolidTapered(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}},IfcRightCircularCone=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Position=r,this.Height=i,this.BottomRadius=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcRightCircularCone(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.BottomRadius),e}},IfcRightCircularCylinder=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Position=r,this.Height=i,this.Radius=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcRightCircularCylinder(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Height),e.push(this.Radius),e}},IfcRoof=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcRoof(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcRoofType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcRoofType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcRoot=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcRoot(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}},IfcRoundedRectangleProfileDef=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.XDim=s,this.YDim=a,this.RoundingRadius=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcRoundedRectangleProfileDef(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.XDim),e.push(this.YDim),e.push(this.RoundingRadius),e}},IfcSIUnit=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Dimensions=r,this.UnitType=i,this.Prefix=n,this.Name=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSIUnit(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}},IfcSanitaryTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSanitaryTerminal(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSanitaryTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSanitaryTerminalType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcSchedulingTime=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSchedulingTime(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e}},IfcSeamCurve=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Curve3D=r,this.AssociatedGeometry=i,this.MasterRepresentation=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSeamCurve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},IfcSectionProperties=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.SectionType=r,this.StartProfile=i,this.EndProfile=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSectionProperties(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SectionType),e.push(this.StartProfile),e.push(this.EndProfile),e}},IfcSectionReinforcementProperties=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.LongitudinalStartPosition=r,this.LongitudinalEndPosition=i,this.TransversePosition=n,this.ReinforcementRole=s,this.SectionDefinition=a,this.CrossSectionReinforcementDefinitions=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcSectionReinforcementProperties(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.LongitudinalStartPosition),e.push(this.LongitudinalEndPosition),e.push(this.TransversePosition),e.push(this.ReinforcementRole),e.push(this.SectionDefinition),e.push(this.CrossSectionReinforcementDefinitions),e}},IfcSectionedSolid=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Directrix=r,this.CrossSections=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSectionedSolid(e,t,n,s)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.CrossSections),e}},IfcSectionedSolidHorizontal=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Directrix=r,this.CrossSections=i,this.CrossSectionPositions=n,this.FixedAxisVertical=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSectionedSolidHorizontal(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}},IfcSectionedSpine=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.SpineCurve=r,this.CrossSections=i,this.CrossSectionPositions=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSectionedSpine(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SpineCurve),e.push(this.CrossSections),e.push(this.CrossSectionPositions),e}},IfcSensor=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSensor(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSensorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSensorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcShadingDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcShadingDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcShadingDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcShadingDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcShapeAspect=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.ShapeRepresentations=r,this.Name=i,this.Description=n,this.ProductDefinitional=s,this.PartOfProductDefinitionShape=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcShapeAspect(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}},IfcShapeModel=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcShapeModel(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}},IfcShapeRepresentation=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcShapeRepresentation(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}},IfcShellBasedSurfaceModel=class{constructor(e,t,r){this.expressID=e,this.type=t,this.SbsmBoundary=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcShellBasedSurfaceModel(e,t,n)}ToTape(){let e=[];return e.push(this.SbsmBoundary),e}},IfcSimpleProperty=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Name=r,this.Description=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSimpleProperty(e,t,n,s)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e}},IfcSimplePropertyTemplate=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.TemplateType=a,this.PrimaryMeasureType=o,this.SecondaryMeasureType=l,this.Enumerators=c,this.PrimaryUnit=u,this.SecondaryUnit=h,this.Expression=p,this.AccessState=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcSimplePropertyTemplate(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.TemplateType),e.push(this.PrimaryMeasureType),e.push(this.SecondaryMeasureType),e.push(this.Enumerators),e.push(this.PrimaryUnit),e.push(this.SecondaryUnit),e.push(this.Expression),e.push(this.AccessState),e}},IfcSite=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.RefLatitude=h,this.RefLongitude=p,this.RefElevation=d,this.LandTitleNumber=m,this.SiteAddress=f}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++];return new IfcSite(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.RefLatitude),e.push(this.RefLongitude),e.push(this.RefElevation),e.push(this.LandTitleNumber),e.push(this.SiteAddress),e}},IfcSlab=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSlab(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSlabElementedCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSlabElementedCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSlabStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSlabStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSlabType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSlabType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcSlippageConnectionCondition=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.SlippageX=i,this.SlippageY=n,this.SlippageZ=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSlippageConnectionCondition(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}},IfcSolarDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSolarDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSolarDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSolarDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcSolidModel=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcSolidModel(e,t)}ToTape(){return[]}},IfcSpace=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u,this.PredefinedType=h,this.ElevationWithFlooring=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcSpace(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e.push(this.PredefinedType),e.push(this.ElevationWithFlooring),e}},IfcSpaceHeater=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSpaceHeater(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSpaceHeaterType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSpaceHeaterType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcSpaceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.LongName=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcSpaceType(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},IfcSpatialElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcSpatialElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e}},IfcSpatialElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSpatialElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcSpatialStructureElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.CompositionType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSpatialStructureElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.CompositionType),e}},IfcSpatialStructureElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSpatialStructureElementType(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e}},IfcSpatialZone=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.LongName=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSpatialZone(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.LongName),e.push(this.PredefinedType),e}},IfcSpatialZoneType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.LongName=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcSpatialZoneType(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.LongName),e}},IfcSphere=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Position=r,this.Radius=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSphere(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},IfcSphericalSurface=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Position=r,this.Radius=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSphericalSurface(e,t,n,s)}ToTape(){let e=[];return e.push(this.Position),e.push(this.Radius),e}},IfcStackTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStackTerminal(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcStackTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStackTerminalType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcStair=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStair(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcStairFlight=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.NumberOfRisers=u,this.NumberOfTreads=h,this.RiserHeight=p,this.TreadLength=d,this.PredefinedType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcStairFlight(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.NumberOfRisers),e.push(this.NumberOfTreads),e.push(this.RiserHeight),e.push(this.TreadLength),e.push(this.PredefinedType),e}},IfcStairFlightType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStairFlightType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcStairType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStairType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcStructuralAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralAction(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},IfcStructuralActivity=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralActivity(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},IfcStructuralAnalysisModel=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.OrientationOf2DPlane=l,this.LoadedBy=c,this.HasResults=u,this.SharedPlacement=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralAnalysisModel(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.OrientationOf2DPlane),e.push(this.LoadedBy),e.push(this.HasResults),e.push(this.SharedPlacement),e}},IfcStructuralConnection=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcStructuralConnection(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},IfcStructuralConnectionCondition=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcStructuralConnectionCondition(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcStructuralCurveAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcStructuralCurveAction(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},IfcStructuralCurveConnection=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c,this.Axis=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralCurveConnection(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.Axis),e}},IfcStructuralCurveMember=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Axis=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralCurveMember(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},IfcStructuralCurveMemberVarying=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Axis=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralCurveMemberVarying(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Axis),e}},IfcStructuralCurveReaction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralCurveReaction(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},IfcStructuralItem=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcStructuralItem(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcStructuralLinearAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcStructuralLinearAction(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},IfcStructuralLoad=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcStructuralLoad(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcStructuralLoadCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=c,this.Coefficient=u,this.Purpose=h,this.SelfWeightCoefficients=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcStructuralLoadCase(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e.push(this.SelfWeightCoefficients),e}},IfcStructuralLoadConfiguration=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Values=i,this.Locations=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcStructuralLoadConfiguration(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Values),e.push(this.Locations),e}},IfcStructuralLoadGroup=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.PredefinedType=o,this.ActionType=l,this.ActionSource=c,this.Coefficient=u,this.Purpose=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralLoadGroup(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.PredefinedType),e.push(this.ActionType),e.push(this.ActionSource),e.push(this.Coefficient),e.push(this.Purpose),e}},IfcStructuralLoadLinearForce=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.LinearForceX=i,this.LinearForceY=n,this.LinearForceZ=s,this.LinearMomentX=a,this.LinearMomentY=o,this.LinearMomentZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcStructuralLoadLinearForce(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.LinearForceX),e.push(this.LinearForceY),e.push(this.LinearForceZ),e.push(this.LinearMomentX),e.push(this.LinearMomentY),e.push(this.LinearMomentZ),e}},IfcStructuralLoadOrResult=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcStructuralLoadOrResult(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcStructuralLoadPlanarForce=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.PlanarForceX=i,this.PlanarForceY=n,this.PlanarForceZ=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcStructuralLoadPlanarForce(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}},IfcStructuralLoadSingleDisplacement=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.DisplacementX=i,this.DisplacementY=n,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcStructuralLoadSingleDisplacement(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e}},IfcStructuralLoadSingleDisplacementDistortion=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.DisplacementX=i,this.DisplacementY=n,this.DisplacementZ=s,this.RotationalDisplacementRX=a,this.RotationalDisplacementRY=o,this.RotationalDisplacementRZ=l,this.Distortion=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcStructuralLoadSingleDisplacementDistortion(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DisplacementX),e.push(this.DisplacementY),e.push(this.DisplacementZ),e.push(this.RotationalDisplacementRX),e.push(this.RotationalDisplacementRY),e.push(this.RotationalDisplacementRZ),e.push(this.Distortion),e}},IfcStructuralLoadSingleForce=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.Name=r,this.ForceX=i,this.ForceY=n,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcStructuralLoadSingleForce(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e}},IfcStructuralLoadSingleForceWarping=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.ForceX=i,this.ForceY=n,this.ForceZ=s,this.MomentX=a,this.MomentY=o,this.MomentZ=l,this.WarpingMoment=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcStructuralLoadSingleForceWarping(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.ForceX),e.push(this.ForceY),e.push(this.ForceZ),e.push(this.MomentX),e.push(this.MomentY),e.push(this.MomentZ),e.push(this.WarpingMoment),e}},IfcStructuralLoadStatic=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Name=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcStructuralLoadStatic(e,t,n)}ToTape(){let e=[];return e.push(this.Name),e}},IfcStructuralLoadTemperature=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.DeltaTConstant=i,this.DeltaTY=n,this.DeltaTZ=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcStructuralLoadTemperature(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}},IfcStructuralMember=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcStructuralMember(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e}},IfcStructuralPlanarAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcStructuralPlanarAction(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},IfcStructuralPointAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralPointAction(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e}},IfcStructuralPointConnection=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c,this.ConditionCoordinateSystem=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralPointConnection(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e.push(this.ConditionCoordinateSystem),e}},IfcStructuralPointReaction=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralPointReaction(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},IfcStructuralReaction=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralReaction(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e}},IfcStructuralResultGroup=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.TheoryType=o,this.ResultForLoadGroup=l,this.IsLinear=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcStructuralResultGroup(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.TheoryType),e.push(this.ResultForLoadGroup),e.push(this.IsLinear),e}},IfcStructuralSurfaceAction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.DestabilizingLoad=h,this.ProjectedOrTrue=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcStructuralSurfaceAction(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.DestabilizingLoad),e.push(this.ProjectedOrTrue),e.push(this.PredefinedType),e}},IfcStructuralSurfaceConnection=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedCondition=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcStructuralSurfaceConnection(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedCondition),e}},IfcStructuralSurfaceMember=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Thickness=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralSurfaceMember(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},IfcStructuralSurfaceMemberVarying=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.PredefinedType=c,this.Thickness=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcStructuralSurfaceMemberVarying(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.PredefinedType),e.push(this.Thickness),e}},IfcStructuralSurfaceReaction=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.AppliedLoad=c,this.GlobalOrLocal=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcStructuralSurfaceReaction(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.AppliedLoad),e.push(this.GlobalOrLocal),e.push(this.PredefinedType),e}},IfcStyleModel=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcStyleModel(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}},IfcStyledItem=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Item=r,this.Styles=i,this.Name=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcStyledItem(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Item),e.push(this.Styles),e.push(this.Name),e}},IfcStyledRepresentation=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcStyledRepresentation(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}},IfcSubContractResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Usage=c,this.BaseCosts=u,this.BaseQuantity=h,this.PredefinedType=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcSubContractResource(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Usage),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcSubContractResourceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u,this.BaseCosts=h,this.BaseQuantity=p,this.PredefinedType=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcSubContractResourceType(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e.push(this.BaseCosts),e.push(this.BaseQuantity),e.push(this.PredefinedType),e}},IfcSubedge=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.EdgeStart=r,this.EdgeEnd=i,this.ParentEdge=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSubedge(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.EdgeStart),e.push(this.EdgeEnd),e.push(this.ParentEdge),e}},IfcSurface=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcSurface(e,t)}ToTape(){return[]}},IfcSurfaceCurve=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Curve3D=r,this.AssociatedGeometry=i,this.MasterRepresentation=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSurfaceCurve(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Curve3D),e.push(this.AssociatedGeometry),e.push(this.MasterRepresentation),e}},IfcSurfaceCurveSweptAreaSolid=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i,this.Directrix=n,this.StartParam=s,this.EndParam=a,this.ReferenceSurface=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcSurfaceCurveSweptAreaSolid(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e.push(this.Directrix),e.push(this.StartParam),e.push(this.EndParam),e.push(this.ReferenceSurface),e}},IfcSurfaceFeature=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSurfaceFeature(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSurfaceOfLinearExtrusion=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.SweptCurve=r,this.Position=i,this.ExtrudedDirection=n,this.Depth=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSurfaceOfLinearExtrusion(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}},IfcSurfaceOfRevolution=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.SweptCurve=r,this.Position=i,this.AxisPosition=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSurfaceOfRevolution(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e.push(this.AxisPosition),e}},IfcSurfaceReinforcementArea=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.Name=r,this.SurfaceReinforcement1=i,this.SurfaceReinforcement2=n,this.ShearReinforcement=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSurfaceReinforcementArea(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}},IfcSurfaceStyle=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Side=i,this.Styles=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcSurfaceStyle(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Side),e.push(this.Styles),e}},IfcSurfaceStyleLighting=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.DiffuseTransmissionColour=r,this.DiffuseReflectionColour=i,this.TransmissionColour=n,this.ReflectanceColour=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcSurfaceStyleLighting(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}},IfcSurfaceStyleRefraction=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.RefractionIndex=r,this.DispersionFactor=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSurfaceStyleRefraction(e,t,n,s)}ToTape(){let e=[];return e.push(this.RefractionIndex),e.push(this.DispersionFactor),e}},IfcSurfaceStyleRendering=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.SurfaceColour=r,this.Transparency=i,this.DiffuseColour=n,this.TransmissionColour=s,this.DiffuseTransmissionColour=a,this.ReflectionColour=o,this.SpecularColour=l,this.SpecularHighlight=c,this.ReflectanceMethod=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSurfaceStyleRendering(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e.push(this.DiffuseColour),e.push(this.TransmissionColour),e.push(this.DiffuseTransmissionColour),e.push(this.ReflectionColour),e.push(this.SpecularColour),e.push(this.SpecularHighlight),e.push(this.ReflectanceMethod),e}},IfcSurfaceStyleShading=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SurfaceColour=r,this.Transparency=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSurfaceStyleShading(e,t,n,s)}ToTape(){let e=[];return e.push(this.SurfaceColour),e.push(this.Transparency),e}},IfcSurfaceStyleWithTextures=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Textures=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcSurfaceStyleWithTextures(e,t,n)}ToTape(){let e=[];return e.push(this.Textures),e}},IfcSurfaceTexture=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.RepeatS=r,this.RepeatT=i,this.Mode=n,this.TextureTransform=s,this.Parameter=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcSurfaceTexture(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}},IfcSweptAreaSolid=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SweptArea=r,this.Position=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSweptAreaSolid(e,t,n,s)}ToTape(){let e=[];return e.push(this.SweptArea),e.push(this.Position),e}},IfcSweptDiskSolid=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Directrix=r,this.Radius=i,this.InnerRadius=n,this.StartParam=s,this.EndParam=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcSweptDiskSolid(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}},IfcSweptDiskSolidPolygonal=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Directrix=r,this.Radius=i,this.InnerRadius=n,this.StartParam=s,this.EndParam=a,this.FilletRadius=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcSweptDiskSolidPolygonal(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Directrix),e.push(this.Radius),e.push(this.InnerRadius),e.push(this.StartParam),e.push(this.EndParam),e.push(this.FilletRadius),e}},IfcSweptSurface=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.SweptCurve=r,this.Position=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcSweptSurface(e,t,n,s)}ToTape(){let e=[];return e.push(this.SweptCurve),e.push(this.Position),e}},IfcSwitchingDevice=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSwitchingDevice(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSwitchingDeviceType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSwitchingDeviceType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcSystem=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcSystem(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}},IfcSystemFurnitureElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcSystemFurnitureElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcSystemFurnitureElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcSystemFurnitureElementType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.FlangeEdgeRadius=u,this.WebEdgeRadius=h,this.WebSlope=p,this.FlangeSlope=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcTShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.FlangeEdgeRadius),e.push(this.WebEdgeRadius),e.push(this.WebSlope),e.push(this.FlangeSlope),e}},IfcTable=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Name=r,this.Rows=i,this.Columns=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcTable(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Rows),e.push(this.Columns),e}},IfcTableColumn=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Identifier=r,this.Name=i,this.Description=n,this.Unit=s,this.ReferencePath=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcTableColumn(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}},IfcTableRow=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.RowCells=r,this.IsHeading=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcTableRow(e,t,n,s)}ToTape(){let e=[];return e.push(this.RowCells),e.push(this.IsHeading),e}},IfcTank=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTank(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcTankType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTankType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTask=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.LongDescription=l,this.Status=c,this.WorkMethod=u,this.IsMilestone=h,this.Priority=p,this.TaskTime=d,this.PredefinedType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcTask(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.LongDescription),e.push(this.Status),e.push(this.WorkMethod),e.push(this.IsMilestone),e.push(this.Priority),e.push(this.TaskTime),e.push(this.PredefinedType),e}},IfcTaskTime=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=c,this.EarlyFinish=u,this.LateStart=h,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=m,this.IsCritical=f,this.StatusTime=g,this.ActualDuration=_,this.ActualStart=y,this.ActualFinish=T,this.RemainingTime=v,this.Completion=E}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++],E=r[i++],I=r[i++],b=r[i++];return new IfcTaskTime(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E,I,b)}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}},IfcTaskTimeRecurring=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E,I){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.DurationType=s,this.ScheduleDuration=a,this.ScheduleStart=o,this.ScheduleFinish=l,this.EarlyStart=c,this.EarlyFinish=u,this.LateStart=h,this.LateFinish=p,this.FreeFloat=d,this.TotalFloat=m,this.IsCritical=f,this.StatusTime=g,this.ActualDuration=_,this.ActualStart=y,this.ActualFinish=T,this.RemainingTime=v,this.Completion=E,this.Recurrence=I}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++],E=r[i++],I=r[i++],b=r[i++],x=r[i++];return new IfcTaskTimeRecurring(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v,E,I,b,x)}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}},IfcTaskType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u,this.PredefinedType=h,this.WorkMethod=p}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++];return new IfcTaskType(e,t,n,s,a,o,l,c,u,h,p,d,m)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e.push(this.PredefinedType),e.push(this.WorkMethod),e}},IfcTelecomAddress=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.Purpose=r,this.Description=i,this.UserDefinedPurpose=n,this.TelephoneNumbers=s,this.FacsimileNumbers=a,this.PagerNumber=o,this.ElectronicMailAddresses=l,this.WWWHomePageURL=c,this.MessagingIDs=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTelecomAddress(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.Purpose),e.push(this.Description),e.push(this.UserDefinedPurpose),e.push(this.TelephoneNumbers),e.push(this.FacsimileNumbers),e.push(this.PagerNumber),e.push(this.ElectronicMailAddresses),e.push(this.WWWHomePageURL),e.push(this.MessagingIDs),e}},IfcTendon=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.TensionForce=m,this.PreStress=f,this.FrictionCoefficient=g,this.AnchorageSlip=_,this.MinCurvatureRadius=y}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++],v=r[i++];return new IfcTendon(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,T,v)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.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}},IfcTendonAnchor=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTendonAnchor(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},IfcTendonAnchorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTendonAnchorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTendonConduit=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.SteelGrade=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTendonConduit(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.SteelGrade),e.push(this.PredefinedType),e}},IfcTendonConduitType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTendonConduitType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTendonType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.NominalDiameter=p,this.CrossSectionArea=d,this.SheathDiameter=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcTendonType(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.NominalDiameter),e.push(this.CrossSectionArea),e.push(this.SheathDiameter),e}},IfcTessellatedFaceSet=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Coordinates=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcTessellatedFaceSet(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},IfcTessellatedItem=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcTessellatedItem(e,t)}ToTape(){return[]}},IfcTextLiteral=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Literal=r,this.Placement=i,this.Path=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcTextLiteral(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Literal),e.push(this.Placement),e.push(this.Path),e}},IfcTextLiteralWithExtent=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Literal=r,this.Placement=i,this.Path=n,this.Extent=s,this.BoxAlignment=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcTextLiteralWithExtent(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}},IfcTextStyle=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Name=r,this.TextCharacterAppearance=i,this.TextStyle=n,this.TextFontStyle=s,this.ModelOrDraughting=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcTextStyle(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}},IfcTextStyleFontModel=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.FontFamily=i,this.FontStyle=n,this.FontVariant=s,this.FontWeight=a,this.FontSize=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcTextStyleFontModel(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.FontFamily),e.push(this.FontStyle),e.push(this.FontVariant),e.push(this.FontWeight),e.push(this.FontSize),e}},IfcTextStyleForDefinedFont=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Colour=r,this.BackgroundColour=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcTextStyleForDefinedFont(e,t,n,s)}ToTape(){let e=[];return e.push(this.Colour),e.push(this.BackgroundColour),e}},IfcTextStyleTextModel=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.TextIndent=r,this.TextAlign=i,this.TextDecoration=n,this.LetterSpacing=s,this.WordSpacing=a,this.TextTransform=o,this.LineHeight=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcTextStyleTextModel(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.TextIndent),e.push(this.TextAlign),e.push(this.TextDecoration),e.push(this.LetterSpacing),e.push(this.WordSpacing),e.push(this.TextTransform),e.push(this.LineHeight),e}},IfcTextureCoordinate=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Maps=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcTextureCoordinate(e,t,n)}ToTape(){let e=[];return e.push(this.Maps),e}},IfcTextureCoordinateGenerator=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Maps=r,this.Mode=i,this.Parameter=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcTextureCoordinateGenerator(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Mode),e.push(this.Parameter),e}},IfcTextureMap=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Maps=r,this.Vertices=i,this.MappedTo=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcTextureMap(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Maps),e.push(this.Vertices),e.push(this.MappedTo),e}},IfcTextureVertex=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Coordinates=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcTextureVertex(e,t,n)}ToTape(){let e=[];return e.push(this.Coordinates),e}},IfcTextureVertexList=class{constructor(e,t,r){this.expressID=e,this.type=t,this.TexCoordsList=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcTextureVertexList(e,t,n)}ToTape(){let e=[];return e.push(this.TexCoordsList),e}},IfcTimePeriod=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.StartTime=r,this.EndTime=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcTimePeriod(e,t,n,s)}ToTape(){let e=[];return e.push(this.StartTime),e.push(this.EndTime),e}},IfcTimeSeries=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.Name=r,this.Description=i,this.StartTime=n,this.EndTime=s,this.TimeSeriesDataType=a,this.DataOrigin=o,this.UserDefinedDataOrigin=l,this.Unit=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcTimeSeries(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.Name),e.push(this.Description),e.push(this.StartTime),e.push(this.EndTime),e.push(this.TimeSeriesDataType),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.Unit),e}},IfcTimeSeriesValue=class{constructor(e,t,r){this.expressID=e,this.type=t,this.ListValues=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcTimeSeriesValue(e,t,n)}ToTape(){let e=[];return e.push(this.ListValues),e}},IfcTopologicalRepresentationItem=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcTopologicalRepresentationItem(e,t)}ToTape(){return[]}},IfcTopologyRepresentation=class{constructor(e,t,r,i,n,s){this.expressID=e,this.type=t,this.ContextOfItems=r,this.RepresentationIdentifier=i,this.RepresentationType=n,this.Items=s}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++];return new IfcTopologyRepresentation(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}},IfcToroidalSurface=class{constructor(e,t,r,i,n){this.expressID=e,this.type=t,this.Position=r,this.MajorRadius=i,this.MinorRadius=n}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++];return new IfcToroidalSurface(e,t,n,s,a)}ToTape(){let e=[];return e.push(this.Position),e.push(this.MajorRadius),e.push(this.MinorRadius),e}},IfcTransformer=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTransformer(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcTransformerType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTransformerType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTransitionCurveSegment2D=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.StartPoint=r,this.StartDirection=i,this.SegmentLength=n,this.StartRadius=s,this.EndRadius=a,this.IsStartRadiusCCW=o,this.IsEndRadiusCCW=l,this.TransitionCurveType=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcTransitionCurveSegment2D(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.StartPoint),e.push(this.StartDirection),e.push(this.SegmentLength),e.push(this.StartRadius),e.push(this.EndRadius),e.push(this.IsStartRadiusCCW),e.push(this.IsEndRadiusCCW),e.push(this.TransitionCurveType),e}},IfcTransportElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTransportElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcTransportElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTransportElementType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTrapeziumProfileDef=class{constructor(e,t,r,i,n,s,a,o,l){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.BottomXDim=s,this.TopXDim=a,this.YDim=o,this.TopXOffset=l}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++];return new IfcTrapeziumProfileDef(e,t,n,s,a,o,l,c,u)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.BottomXDim),e.push(this.TopXDim),e.push(this.YDim),e.push(this.TopXOffset),e}},IfcTriangulatedFaceSet=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.Coordinates=r,this.Normals=i,this.Closed=n,this.CoordIndex=s,this.PnIndex=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcTriangulatedFaceSet(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}},IfcTriangulatedIrregularNetwork=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Coordinates=r,this.Normals=i,this.Closed=n,this.CoordIndex=s,this.PnIndex=a,this.Flags=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcTriangulatedIrregularNetwork(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Coordinates),e.push(this.Normals),e.push(this.Closed),e.push(this.CoordIndex),e.push(this.PnIndex),e.push(this.Flags),e}},IfcTrimmedCurve=class{constructor(e,t,r,i,n,s,a){this.expressID=e,this.type=t,this.BasisCurve=r,this.Trim1=i,this.Trim2=n,this.SenseAgreement=s,this.MasterRepresentation=a}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++];return new IfcTrimmedCurve(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}},IfcTubeBundle=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTubeBundle(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcTubeBundleType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcTubeBundleType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcTypeObject=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcTypeObject(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e}},IfcTypeProcess=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ProcessType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTypeProcess(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ProcessType),e}},IfcTypeProduct=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcTypeProduct(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e}},IfcTypeResource=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.Identification=l,this.LongDescription=c,this.ResourceType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcTypeResource(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.Identification),e.push(this.LongDescription),e.push(this.ResourceType),e}},IfcUShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.EdgeRadius=u,this.FlangeSlope=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcUShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e.push(this.FlangeSlope),e}},IfcUnitAssignment=class{constructor(e,t,r){this.expressID=e,this.type=t,this.Units=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcUnitAssignment(e,t,n)}ToTape(){let e=[];return e.push(this.Units),e}},IfcUnitaryControlElement=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcUnitaryControlElement(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcUnitaryControlElementType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcUnitaryControlElementType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcUnitaryEquipment=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcUnitaryEquipment(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcUnitaryEquipmentType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcUnitaryEquipmentType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcValve=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcValve(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcValveType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcValveType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcVector=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.Orientation=r,this.Magnitude=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcVector(e,t,n,s)}ToTape(){let e=[];return e.push(this.Orientation),e.push(this.Magnitude),e}},IfcVertex=class{constructor(e,t){this.expressID=e,this.type=t}static FromTape(e,t,r){return new IfcVertex(e,t)}ToTape(){return[]}},IfcVertexLoop=class{constructor(e,t,r){this.expressID=e,this.type=t,this.LoopVertex=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcVertexLoop(e,t,n)}ToTape(){let e=[];return e.push(this.LoopVertex),e}},IfcVertexPoint=class{constructor(e,t,r){this.expressID=e,this.type=t,this.VertexGeometry=r}static FromTape(e,t,r){let i=0,n=r[i++];return new IfcVertexPoint(e,t,n)}ToTape(){let e=[];return e.push(this.VertexGeometry),e}},IfcVibrationDamper=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcVibrationDamper(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcVibrationDamperType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcVibrationDamperType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcVibrationIsolator=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcVibrationIsolator(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcVibrationIsolatorType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcVibrationIsolatorType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcVirtualElement=class{constructor(e,t,r,i,n,s,a,o,l,c){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++];return new IfcVirtualElement(e,t,n,s,a,o,l,c,u,h)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e}},IfcVirtualGridIntersection=class{constructor(e,t,r,i){this.expressID=e,this.type=t,this.IntersectingAxes=r,this.OffsetDistances=i}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++];return new IfcVirtualGridIntersection(e,t,n,s)}ToTape(){let e=[];return e.push(this.IntersectingAxes),e.push(this.OffsetDistances),e}},IfcVoidingFeature=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcVoidingFeature(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcWall=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWall(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcWallElementedCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWallElementedCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcWallStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWallStandardCase(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcWallType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcWallType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcWasteTerminal=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWasteTerminal(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.PredefinedType),e}},IfcWasteTerminalType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++];return new IfcWasteTerminalType(e,t,n,s,a,o,l,c,u,h,p,d)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e}},IfcWindow=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcWindow(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},IfcWindowLiningProperties=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f,g,_){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.LiningDepth=a,this.LiningThickness=o,this.TransomThickness=l,this.MullionThickness=c,this.FirstTransomOffset=u,this.SecondTransomOffset=h,this.FirstMullionOffset=p,this.SecondMullionOffset=d,this.ShapeAspectStyle=m,this.LiningOffset=f,this.LiningToPanelOffsetX=g,this.LiningToPanelOffsetY=_}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++],y=r[i++],T=r[i++];return new IfcWindowLiningProperties(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_,y,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}},IfcWindowPanelProperties=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.OperationType=a,this.PanelPosition=o,this.FrameDepth=l,this.FrameThickness=c,this.ShapeAspectStyle=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWindowPanelProperties(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.OperationType),e.push(this.PanelPosition),e.push(this.FrameDepth),e.push(this.FrameThickness),e.push(this.ShapeAspectStyle),e}},IfcWindowStandardCase=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.ObjectPlacement=o,this.Representation=l,this.Tag=c,this.OverallHeight=u,this.OverallWidth=h,this.PredefinedType=p,this.PartitioningType=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcWindowStandardCase(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.ObjectPlacement),e.push(this.Representation),e.push(this.Tag),e.push(this.OverallHeight),e.push(this.OverallWidth),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.UserDefinedPartitioningType),e}},IfcWindowStyle=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ConstructionType=u,this.OperationType=h,this.ParameterTakesPrecedence=p,this.Sizeable=d}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++];return new IfcWindowStyle(e,t,n,s,a,o,l,c,u,h,p,d,m,f)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ConstructionType),e.push(this.OperationType),e.push(this.ParameterTakesPrecedence),e.push(this.Sizeable),e}},IfcWindowType=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ApplicableOccurrence=a,this.HasPropertySets=o,this.RepresentationMaps=l,this.Tag=c,this.ElementType=u,this.PredefinedType=h,this.PartitioningType=p,this.ParameterTakesPrecedence=d,this.UserDefinedPartitioningType=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcWindowType(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ApplicableOccurrence),e.push(this.HasPropertySets),e.push(this.RepresentationMaps),e.push(this.Tag),e.push(this.ElementType),e.push(this.PredefinedType),e.push(this.PartitioningType),e.push(this.ParameterTakesPrecedence),e.push(this.UserDefinedPartitioningType),e}},IfcWorkCalendar=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.WorkingTimes=l,this.ExceptionTimes=c,this.PredefinedType=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcWorkCalendar(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.WorkingTimes),e.push(this.ExceptionTimes),e.push(this.PredefinedType),e}},IfcWorkControl=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++];return new IfcWorkControl(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e}},IfcWorkPlan=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m,this.PredefinedType=f}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++];return new IfcWorkPlan(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},IfcWorkSchedule=class{constructor(e,t,r,i,n,s,a,o,l,c,u,h,p,d,m,f){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.Identification=o,this.CreationDate=l,this.Creators=c,this.Purpose=u,this.Duration=h,this.TotalFloat=p,this.StartTime=d,this.FinishTime=m,this.PredefinedType=f}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++],d=r[i++],m=r[i++],f=r[i++],g=r[i++],_=r[i++];return new IfcWorkSchedule(e,t,n,s,a,o,l,c,u,h,p,d,m,f,g,_)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.Identification),e.push(this.CreationDate),e.push(this.Creators),e.push(this.Purpose),e.push(this.Duration),e.push(this.TotalFloat),e.push(this.StartTime),e.push(this.FinishTime),e.push(this.PredefinedType),e}},IfcWorkTime=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.Name=r,this.DataOrigin=i,this.UserDefinedDataOrigin=n,this.RecurrencePattern=s,this.Start=a,this.Finish=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcWorkTime(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.Name),e.push(this.DataOrigin),e.push(this.UserDefinedDataOrigin),e.push(this.RecurrencePattern),e.push(this.Start),e.push(this.Finish),e}},IfcZShapeProfileDef=class{constructor(e,t,r,i,n,s,a,o,l,c,u){this.expressID=e,this.type=t,this.ProfileType=r,this.ProfileName=i,this.Position=n,this.Depth=s,this.FlangeWidth=a,this.WebThickness=o,this.FlangeThickness=l,this.FilletRadius=c,this.EdgeRadius=u}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++],u=r[i++],h=r[i++],p=r[i++];return new IfcZShapeProfileDef(e,t,n,s,a,o,l,c,u,h,p)}ToTape(){let e=[];return e.push(this.ProfileType),e.push(this.ProfileName),e.push(this.Position),e.push(this.Depth),e.push(this.FlangeWidth),e.push(this.WebThickness),e.push(this.FlangeThickness),e.push(this.FilletRadius),e.push(this.EdgeRadius),e}},IfcZone=class{constructor(e,t,r,i,n,s,a,o){this.expressID=e,this.type=t,this.GlobalId=r,this.OwnerHistory=i,this.Name=n,this.Description=s,this.ObjectType=a,this.LongName=o}static FromTape(e,t,r){let i=0,n=r[i++],s=r[i++],a=r[i++],o=r[i++],l=r[i++],c=r[i++];return new IfcZone(e,t,n,s,a,o,l,c)}ToTape(){let e=[];return e.push(this.GlobalId),e.push(this.OwnerHistory),e.push(this.Name),e.push(this.Description),e.push(this.ObjectType),e.push(this.LongName),e}},WebIFCWasm=require_web_ifc(),IfcAPI=class{constructor(){this.wasmModule=void 0,this.fs=void 0}Init(){return __async2(this,null,(function*(){WebIFCWasm?(this.wasmModule=yield WebIFCWasm({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 r=__spreadValues2({COORDINATE_TO_ORIGIN:!1,USE_FAST_BOOLS:!1,CIRCLE_SEGMENTS_LOW:5,CIRCLE_SEGMENTS_MEDIUM:8,CIRCLE_SEGMENTS_HIGH:12},t),i=this.wasmModule.OpenModel(r);return this.wasmModule.FS_unlink("/filename"),i}CreateModel(e){let t=__spreadValues2({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,r=!1){let i=this.GetRawLineData(e,t),n=FromRawLineData[i.type](i);return r&&this.FlattenLine(e,n),n}WriteLine(e,t){Object.keys(t).forEach((r=>{let i=t[r];if(i&&void 0!==i.expressID)this.WriteLine(e,i),t[r]={type:5,value:i.expressID};else if(Array.isArray(i)&&i.length>0)for(let n=0;n{let i=t[r];if(i&&5===i.type)t[r]=this.GetLine(e,i.value,!0);else if(Array.isArray(i)&&i.length>0&&5===i[0].type)for(let n=0;nmergeBufferGeometries(e,t),newFloatAttr=(e,t)=>new BufferAttribute(new Float32Array(e),t),newIntAttr=(e,t)=>new BufferAttribute(new Uint32Array(e),t),DEFAULT="default",PropsNames={aggregates:{name:IFCRELAGGREGATES,relating:"RelatingObject",related:"RelatedObjects",key:"children"},spatial:{name:IFCRELCONTAINEDINSPATIALSTRUCTURE,relating:"RelatingStructure",related:"RelatedElements",key:"children"},psets:{name:IFCRELDEFINESBYPROPERTIES,relating:"RelatingPropertyDefinition",related:"RelatedObjects",key:"hasPsets"},materials:{name:IFCRELASSOCIATESMATERIAL,relating:"RelatingMaterial",related:"RelatedObjects",key:"hasMaterial"},type:{name:IFCRELDEFINESBYTYPE,relating:"RelatingType",related:"RelatedObjects",key:"hasType"}},IFCParser=class{constructor(e,t){this.state=e,this.BVH=t,this.loadedModels=0,this.currentWebIfcID=-1,this.currentModelID=-1}parse(e){return __async(this,null,(function*(){return void 0===this.state.api.wasmModule&&(yield this.state.api.Init()),this.newIfcModel(e),this.loadedModels++,this.loadAllGeometry()}))}newIfcModel(e){const t=new Uint8Array(e);this.currentWebIfcID=this.state.api.OpenModel(t,this.state.webIfcSettings),this.currentModelID=this.state.useJSON?this.loadedModels:this.currentWebIfcID,this.state.models[this.currentModelID]={modelID:this.currentModelID,mesh:{},items:{},types:{},jsonData:{}}}loadAllGeometry(){return this.saveAllPlacedGeometriesByMaterial(),this.generateAllGeometriesByMaterial()}generateAllGeometriesByMaterial(){const{geometry:e,materials:t}=this.getGeometryAndMaterials();this.BVH.applyThreeMeshBVH(e);const r=new Mesh(e,t);return r.modelID=this.currentModelID,this.state.models[this.currentModelID].mesh=r,r}getGeometryAndMaterials(){const e=this.state.models[this.currentModelID].items,t=[],r=[];for(const i in e){r.push(e[i].material);const n=Object.values(e[i].geometries);t.push(merge(n))}return{geometry:merge(t,!0),materials:r}}saveAllPlacedGeometriesByMaterial(){const e=this.state.api.LoadAllGeometry(this.currentWebIfcID);for(let t=0;t0?merge(e,t):new BufferGeometry}isConfigValid(e){return this.isValid(e.scene)&&this.isValid(e.modelID)&&this.isValid(e.ids)&&this.isValid(e.removePrevious)}isValid(e){return null!=e&&null!=e}getGeomAndMat(e){const t=[],r=[];for(const i in e){const n=Object.values(e[i].geometries);n.length&&(r.push(e[i].material),n.length>1?t.push(merge(n)):t.push(...n))}return{geomsByMaterial:t,materials:r}}updatePreviousSelection(e,t){const r=this.selected[this.matID(t)];if(!r)return this.newSelectionGroup(t);e.remove(r.mesh),t.removePrevious?r.ids=new Set(t.ids):t.ids.forEach((e=>r.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;const t=this.selected[this.matID(e)].ids;return JSON.stringify(e.ids)===JSON.stringify(t)}containsIds(e){const t=e.ids,r=Array.from(this.selected[this.matID(e)].ids);return t.every((e=>t=>e=r.indexOf(t,e)+1)(0))}addToPreviousSelection(e){const t=this.selected[this.matID(e)],r=this.filter(e),i=Object.values(r).map((e=>Object.values(e.geometries))).flat(),n=t.mesh.geometry;t.mesh.geometry=merge([n,...i]),e.ids.forEach((e=>t.ids.add(e)))}filter(e){const t=this.selected[this.matID(e)].ids,r=this.state.models[e.modelID].items,i={};for(const e in r)i[e]={material:r[e].material,geometries:this.filterGeometries(t,r[e].geometries)};return i}filterGeometries(e,t){const r=Array.from(e);return Object.keys(t).filter((e=>r.includes(parseInt(e,10)))).reduce(((e,r)=>__spreadProps(__spreadValues({},e),{[r]:t[r]})),{})}isEasySelection(e){const t=this.matID(e);if(!e.removePrevious&&!this.isDefaultMat(e)&&this.selected[t])return!0}isDefaultMat(e){return this.matIDNoConfig(e.modelID)===this.matID(e)}matID(e){let t;return t=e.material&&e.material.uuid||DEFAULT,t.concat(" - ").concat(e.modelID.toString())}matIDNoConfig(e,t){let r=DEFAULT;return t&&(r=t.uuid),r.concat(" - ").concat(e.toString())}},IfcElements={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"},IfcTypesMap={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"},PropertyManager=class{constructor(e){this.state=e}getExpressId(e,t){if(!e.index)return;const r=e.index.array;return e.attributes[IdAttrName].getX(r[3*t])}getItemProperties(e,t,r=!1){return this.state.useJSON?__spreadValues({},this.state.models[e].jsonData[t]):this.state.api.GetLine(e,t,r)}getAllItemsOfType(e,t,r){return this.state.useJSON?this.getAllItemsOfTypeJSON(e,t,r):this.getAllItemsOfTypeWebIfcAPI(e,t,r)}getPropertySets(e,t,r=!1){return this.state.useJSON?this.getPropertyJSON(e,t,r,PropsNames.psets):this.getPropertyWebIfcAPI(e,t,r,PropsNames.psets)}getTypeProperties(e,t,r=!1){return this.state.useJSON?this.getPropertyJSON(e,t,r,PropsNames.type):this.getPropertyWebIfcAPI(e,t,r,PropsNames.type)}getMaterialsProperties(e,t,r=!1){return this.state.useJSON?this.getPropertyJSON(e,t,r,PropsNames.materials):this.getPropertyWebIfcAPI(e,t,r,PropsNames.materials)}getSpatialStructure(e){return this.state.useJSON?this.getSpatialStructureJSON(e):this.getSpatialStructureWebIfcAPI(e)}getSpatialStructureJSON(e){const t=this.getSpatialTreeChunks(e),r=this.getAllItemsOfTypeJSON(e,IFCPROJECT,!1)[0],i=this.newIfcProject(r);return this.getSpatialNode(e,i,t),__spreadValues({},i)}getSpatialStructureWebIfcAPI(e){const t=this.getSpatialTreeChunks(e),r=this.state.api.GetLineIDsWithType(e,IFCPROJECT).get(0),i=this.newIfcProject(r);return this.getSpatialNode(e,i,t),i}getAllItemsOfTypeJSON(e,t,r){const i=this.state.models[e].jsonData,n=IfcTypesMap[t];if(!n)throw new Error(`Type not found: ${t}`);return this.filterJSONItemsByType(i,n,r)}filterJSONItemsByType(e,t,r){const i=[];return Object.keys(e).forEach((n=>{const s=parseInt(n);e[s].type.toUpperCase()===t&&i.push(r?__spreadValues({},e[s]):s)})),i}getItemsByIDJSON(e,t){const r=this.state.models[e].jsonData,i=[];return t.forEach((e=>i.push(__spreadValues({},r[e])))),i}getPropertyJSON(e,t,r=!1,i){const n=this.getAllRelatedItemsOfTypeJSON(e,t,i),s=this.getItemsByIDJSON(e,n);return r&&s.forEach((t=>this.getJSONReferencesRecursively(e,t))),s}getJSONReferencesRecursively(e,t){if(null==t)return;const r=Object.keys(t);for(let i=0;i(5===t.type&&(t=this.getItemsByIDJSON(e,[t.value])[0],this.getJSONReferencesRecursively(e,t)),t)))}getPropertyWebIfcAPI(e,t,r=!1,i){return this.getAllRelatedItemsOfTypeWebIfcAPI(e,t,i).map((t=>this.state.api.GetLine(e,t,r)))}getAllItemsOfTypeWebIfcAPI(e,t,r){const i=[],n=this.state.api.GetLineIDsWithType(e,t);for(let e=0;ethis.state.api.GetLine(e,t))):i}newIfcProject(e){return{expressID:e,type:"IFCPROJECT",children:[]}}getSpatialTreeChunks(e){const t={};return this.state.useJSON?(this.getChunksJSON(e,t,PropsNames.aggregates),this.getChunksJSON(e,t,PropsNames.spatial)):(this.getChunksWebIfcAPI(e,t,PropsNames.aggregates),this.getChunksWebIfcAPI(e,t,PropsNames.spatial)),t}getChunksJSON(e,t,r){this.getAllItemsOfTypeJSON(e,r.name,!0).forEach((e=>{this.saveChunk(t,r,e)}))}getChunksWebIfcAPI(e,t,r){const i=this.state.api.GetLineIDsWithType(e,r.name);for(let n=0;ne.value));null==e[i]?e[i]=n:e[i]=e[i].concat(n)}getSpatialNode(e,t,r){this.getChildren(e,t,r,PropsNames.aggregates),this.getChildren(e,t,r,PropsNames.spatial)}getChildren(e,t,r,i){const n=r[t.expressID];if(null==n)return;t[i.key]=n.map((t=>{const i=this.newNode(e,t);return this.getSpatialNode(e,i,r),i}))}newNode(e,t){return{expressID:t,type:this.getNodeType(e,t),children:[]}}getNodeType(e,t){if(this.state.useJSON)return this.state.models[e].jsonData[t].type;const r=this.state.models[e].types[t];return IfcElements[r]}getAllRelatedItemsOfTypeJSON(e,t,r){const i=this.getAllItemsOfTypeJSON(e,r.name,!0),n=[];return i.forEach((e=>{this.isRelated(t,e,r)&&this.getRelated(e,r,n)})),n}getAllRelatedItemsOfTypeWebIfcAPI(e,t,r){const i=this.state.api.GetLineIDsWithType(e,r.name),n=[];for(let s=0;sr.push(e.value))):r.push(i.value)}isRelated(e,t,r){const i=t[r.related];if(Array.isArray(i)){return i.map((e=>e.value)).includes(e)}return i.value===e}},TypeManager=class{constructor(e){this.state=e}getAllTypes(){for(const e in this.state.models){const t=this.state.models[e].types;0==Object.keys(t).length&&this.getAllTypesOfModel(parseInt(e))}}getAllTypesOfModel(e){this.state.models[e].types;const t=Object.keys(IfcElements).map((e=>parseInt(e))),r=this.state.models[e].types;t.forEach((t=>{const i=this.state.api.GetLineIDsWithType(e,t);for(let e=0;e{i[e]&&n.push(...i[e])}));const s=this.getCoordinates(e),a=this.modelCoordinates[e];r?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){const t=this.getCoordinates(e);this.modelCoordinates[e]||(this.modelCoordinates[e]=new Float32Array(t))}resetCoordinates(e){const t=this.modelCoordinates[e];this.getCoordinates(e).set(t)}getCoordinates(e){return this.getAttributes(e).position.array}getAttributes(e){return this.state.models[e].mesh.geometry.attributes}},IFCManager=class{constructor(){this.state={models:[],api:new IfcAPI,useJSON:!1},this.BVH=new BvhManager,this.parser=new IFCParser(this.state,this.BVH),this.subsets=new SubsetManager(this.state,this.BVH),this.properties=new PropertyManager(this.state),this.types=new TypeManager(this.state),this.hider=new ItemsHider(this.state)}parse(e){return __async(this,null,(function*(){const t=yield this.parser.parse(e);this.state.useJSON?this.disposeMemory():this.types.getAllTypes(),this.hider.processCoordinates(t.modelID);const r=new IFCModel(t.geometry,t.material);return r.setIFCManager(this),r}))}setWasmPath(e){this.state.api.SetWasmPath(e)}applyWebIfcConfig(e){this.state.webIfcSettings=e}useJSONData(e=!0){this.state.useJSON=e,this.disposeMemory()}addModelJSONData(e,t){const r=this.state.models[e];r&&(r.jsonData=t)}disposeMemory(){this.state.api=null,this.state.api=new IfcAPI}setupThreeMeshBVH(e,t,r){this.BVH.initializeMeshBVH(e,t,r)}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,r){return this.properties.getAllItemsOfType(e,t,r)}getItemProperties(e,t,r=!1){return this.properties.getItemProperties(e,t,r)}getPropertySets(e,t,r=!1){return this.properties.getPropertySets(e,t,r)}getTypeProperties(e,t,r=!1){return this.properties.getTypeProperties(e,t,r)}getMaterialsProperties(e,t,r=!1){return this.properties.getMaterialsProperties(e,t,r)}getIfcType(e,t){const r=this.state.models[e].types[t];return IfcElements[r]}getSpatialStructure(e){return this.properties.getSpatialStructure(e)}getSubset(e,t){return this.subsets.getSubset(e,t)}removeSubset(e,t,r){this.subsets.removeSubset(e,t,r)}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)}},IFCLoader=class extends Loader{constructor(e){super(e),this.ifcManager=new IFCManager}load(e,t,r,i){const n=this,s=new FileLoader(n.manager);s.setPath(n.path),s.setResponseType("arraybuffer"),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(e,(function(r){return __async(this,null,(function*(){try{if("string"==typeof r)throw new Error("IFC files must be given as a buffer!");t(yield n.parse(r))}catch(t){i?i(t):console.error(t),n.manager.itemError(e)}}))}),r,i)}parse(e){return this.ifcManager.parse(e)}},MTLLoader=class extends Loader{constructor(e){super(e)} /** * Loads and parses a MTL asset from a URL. * * @param {String} url - URL to the MTL file. * @param {Function} [onLoad] - Callback invoked with the loaded object. * @param {Function} [onProgress] - Callback for download progress. * @param {Function} [onError] - Callback for download errors. * * @see setPath setResourcePath * * @note In order for relative texture references to resolve correctly * you must call setResourcePath() explicitly prior to load. */load(e,t,r,i){const n=this,s=""===this.path?LoaderUtils.extractUrlBase(e):this.path,a=new FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(r){try{t(n.parse(r,s))}catch(t){i?i(t):console.error(t),n.manager.itemError(e)}}),r,i)}setMaterialOptions(e){return this.materialOptions=e,this} /** * Parses a MTL file. * * @param {String} text - Content of MTL file * @return {MaterialCreator} * * @see setPath setResourcePath * * @note In order for relative texture references to resolve correctly * you must call setResourcePath() explicitly prior to parse. */parse(e,t){const r=e.split("\n");let i={};const n=/\s+/,s={};for(let e=0;e=0?t.substring(0,a):t;o=o.toLowerCase();let l=a>=0?t.substring(a+1):"";if(l=l.trim(),"newmtl"===o)i={name:l},s[l]=i;else if("ka"===o||"kd"===o||"ks"===o||"ke"===o){const e=l.split(n,3);i[o]=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]}else i[o]=l}const a=new MaterialCreator(this.resourcePath||t,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(s),a}},MaterialCreator=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:FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const r in e){const i=e[r],n={};t[r]=n;for(const e in i){let t=!0,r=i[e];const s=e.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(r=[r[0]/255,r[1]/255,r[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===r[0]&&0===r[1]&&0===r[2]&&(t=!1)}t&&(n[s]=r)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,r=this.materialsInfo[e],i={name:e,side:this.side};function n(e,r){if(i[e])return;const n=t.getTextureParams(r,i),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(o=n.url)||""===o?"":/^https?:\/\//i.test(o)?o:a+o));var a,o;s.repeat.copy(n.scale),s.offset.copy(n.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,"map"!==e&&"emissiveMap"!==e||(s.encoding=sRGBEncoding),i[e]=s}for(const e in r){const t=r[e];let s;if(""!==t)switch(e.toLowerCase()){case"kd":i.color=(new Color).fromArray(t).convertSRGBToLinear();break;case"ks":i.specular=(new Color).fromArray(t).convertSRGBToLinear();break;case"ke":i.emissive=(new Color).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),i.transparent=!0;break;case"ns":i.shininess=parseFloat(t);break;case"d":s=parseFloat(t),s<1&&(i.opacity=s,i.transparent=!0);break;case"tr":s=parseFloat(t),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(i.opacity=1-s,i.transparent=!0)}}return this.materials[e]=new MeshPhongMaterial(i),this.materials[e]}getTextureParams(e,t){const r={scale:new Vector2(1,1),offset:new Vector2(0,0)},i=e.split(/\s+/);let n;return n=i.indexOf("-bm"),n>=0&&(t.bumpScale=parseFloat(i[n+1]),i.splice(n,2)),n=i.indexOf("-s"),n>=0&&(r.scale.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),n=i.indexOf("-o"),n>=0&&(r.offset.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),r.url=i.join(" ").trim(),r}loadTexture(e,t,r,i,n){const s=void 0!==this.manager?this.manager:DefaultLoadingManager;let a=s.getHandler(e);null===a&&(a=new TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);const o=a.load(e,r,i,n);return void 0!==t&&(o.mapping=t),o}},_object_pattern=/^[og]\s*(.+)?/,_material_library_pattern=/^mtllib /,_material_use_pattern=/^usemtl /,_map_use_pattern=/^usemap /,_face_vertex_data_separator_pattern=/\s+/,_vA3=new Vector3,_vB3=new Vector3,_vC3=new Vector3,_ab2=new Vector3,_cb2=new Vector3,_color=new Color;function ParserState(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);const i={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const 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(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){const e=r.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){const r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){const r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){const i=this.vertices,n=this.object.geometry.vertices;n.push(i[e+0],i[e+1],i[e+2]),n.push(i[t+0],i[t+1],i[t+2]),n.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){const i=this.normals,n=this.object.geometry.normals;n.push(i[e+0],i[e+1],i[e+2]),n.push(i[t+0],i[t+1],i[t+2]),n.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,t,r){const i=this.vertices,n=this.object.geometry.normals;_vA3.fromArray(i,e),_vB3.fromArray(i,t),_vC3.fromArray(i,r),_cb2.subVectors(_vC3,_vB3),_ab2.subVectors(_vA3,_vB3),_cb2.cross(_ab2),_cb2.normalize(),n.push(_cb2.x,_cb2.y,_cb2.z),n.push(_cb2.x,_cb2.y,_cb2.z),n.push(_cb2.x,_cb2.y,_cb2.z)},addColor:function(e,t,r){const i=this.colors,n=this.object.geometry.colors;void 0!==i[e]&&n.push(i[e+0],i[e+1],i[e+2]),void 0!==i[t]&&n.push(i[t+0],i[t+1],i[t+2]),void 0!==i[r]&&n.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,t,r){const i=this.uvs,n=this.object.geometry.uvs;n.push(i[e+0],i[e+1]),n.push(i[t+0],i[t+1]),n.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,i,n,s,a,o,l){const c=this.vertices.length;let u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(r,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),void 0!==a&&""!==a){const e=this.normals.length;u=this.parseNormalIndex(a,e),h=this.parseNormalIndex(o,e),p=this.parseNormalIndex(l,e),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(void 0!==i&&""!==i){const e=this.uvs.length;u=this.parseUVIndex(i,e),h=this.parseUVIndex(n,e),p=this.parseUVIndex(s,e),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let r=0,i=e.length;r=7?(_color.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])).convertSRGBToLinear(),t.colors.push(_color.r,_color.g,_color.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===s){const e=n.slice(1).trim().split(_face_vertex_data_separator_pattern),r=[];for(let t=0,i=e.length;t0){const e=i.split("/");r.push(e)}}const i=r[0];for(let e=1,n=r.length-1;e1){const e=i[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===n)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}}t.finalize();const n=new Group;n.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let e=0,r=t.objects.length;e0&&c.setAttribute("normal",new Float32BufferAttribute(i.normals,3)),i.colors.length>0&&(l=!0,c.setAttribute("color",new Float32BufferAttribute(i.colors,3))),!0===i.hasUVIndices&&c.setAttribute("uv",new Float32BufferAttribute(i.uvs,2));const u=[];for(let e=0,r=s.length;e1){for(let e=0,t=s.length;e0){const e=new PointsMaterial({size:1,sizeAttenuation:!1}),r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(r.setAttribute("color",new Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);const i=new Points(r,e);n.add(i)}return n}},_color3=new Color,PLYLoader=class extends Loader{constructor(e){super(e),this.propertyNameMapping={}}load(e,t,r,i){const n=this,s=new FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(r){try{t(n.parse(r))}catch(t){i?i(t):console.error(t),n.manager.itemError(e)}}),r,i)}setPropertyNameMapping(e){this.propertyNameMapping=e}parse(e){function t(e){let t="",r=0;const i=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==i&&(t=i[1],r=new Blob([i[0]]).size);const n={comments:[],elements:[],headerLength:r,objInfo:""},s=t.split(/\r\n|\r|\n/);let a;function o(e,t){const r={type:e[0]};return"list"===r.type?(r.name=e[3],r.countType=e[1],r.itemType=e[2]):r.name=e[1],r.name in t&&(r.name=t[r.name]),r}for(let e=0;e=t.elements[c].count&&(c++,u=0);const s=i(t.elements[c].properties,n);a(r,t.elements[c].name,s),u++}return s(r)}function s(e){let t=new BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new Float32BufferAttribute(e.colors,3)),e.faceVertexUvs.length>0&&(t=t.toNonIndexed(),t.setAttribute("uv",new Float32BufferAttribute(e.faceVertexUvs,2))),t.computeBoundingSphere(),t}function a(e,t,r){function i(e){for(let t=0,i=e.length;t>5&31)/31,s=(e>>10&31)/31):(i=o,n=l,s=c)}for(let o=1;o<=3;o++){const l=r+12*o,c=3*e*3+3*(o-1);d[c]=t.getFloat32(l,!0),d[c+1]=t.getFloat32(l+4,!0),d[c+2]=t.getFloat32(l+8,!0),m[c]=u,m[c+1]=p,m[c+2]=f,h&&(a[c]=i,a[c+1]=n,a[c+2]=s)}}return p.setAttribute("position",new BufferAttribute(d,3)),p.setAttribute("normal",new BufferAttribute(m,3)),h&&(p.setAttribute("color",new BufferAttribute(a,3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){const t=new BufferGeometry,r=/solid([\s\S]*?)endsolid/g,i=/facet([\s\S]*?)endfacet/g;let n=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),o=new RegExp("normal"+s+s+s,"g"),l=[],c=[],u=new Vector3;let h,p=0,d=0,m=0;for(;null!==(h=r.exec(e));){d=m;const e=h[0];for(;null!==(h=i.exec(e));){let e=0,t=0;const r=h[0];for(;null!==(h=o.exec(r));)u.x=parseFloat(h[1]),u.y=parseFloat(h[2]),u.z=parseFloat(h[3]),t++;for(;null!==(h=a.exec(r));)l.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3])),c.push(u.x,u.y,u.z),e++,m++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+n),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+n),n++}const r=d,s=m-d;t.addGroup(r,s,p),p++}return t.setAttribute("position",new Float32BufferAttribute(l,3)),t.setAttribute("normal",new Float32BufferAttribute(c,3)),t}("string"!=typeof(i=e)?LoaderUtils.decodeText(new Uint8Array(i)):i);var i}},import_stream=__toESM(require_stream(),1),BYLAYER="BYLAYER",BYBLOCK="BYBLOCK",NestCompareTypes=["INSERT","DIMENSION"],import_jsbi=__toESM(require_jsbi_umd(),1),BinaryReader2=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=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 buf2hex(this.ReadBinaryData())}if(e>=320&&e<=369)return this.readNullTerminatedString();if(e>=370&&e<=389)return this.reader.readInt16();if(e>=390&&e<=399)return this.readNullTerminatedString();if(e>=400&&e<=409)return this.reader.readInt16();if(e>=410&&e<=419)return this.readNullTerminatedString();if(e>=420&&e<=429)return this.reader.readInt32();if(e>=430&&e<=439)return this.readNullTerminatedString();if(e>=440&&e<=459)return this.reader.readInt32();if(e>=460&&e<=469)return this.reader.readFloat64();if(e>=470&&e<=481)return this.readNullTerminatedString();if(999===e)throw new Error("The comment group 999, is not used in binary DXF files at byte address!");if(1004===e){return buf2hex(this.ReadBinaryData())}return e>=1e3&&e<=1009?this.readNullTerminatedString():e>=1010&&e<=1059?this.reader.readFloat64():e>=1060&&e<=1070?this.reader.readInt16():1071===e?this.reader.readInt32():void log.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,r=this.reader.readInt8();for(;0!==r;)this.int8Array[t++]=r,r=this.reader.readInt8();if(0===t)return"";if(t>MAX_BYTES_COUNT)return log.warn(`[DxfBinReader] Failed to read string! The number of bytes is ${t} !`),"";const i=this.int8Array.subarray(0,t),n=i.toString();if(this.caches[n])return this.caches[n];const s=null==(e=this.decoder)?void 0:e.decode(i);return this.caches[n]=s,s}ReadBinaryData(){const e=this.reader.readUint8();return this.reader.readBytes(e)}}; // node_modules/three/examples/jsm/loaders/PLYLoader.js function buf2hex(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")} // src/core/dxf-parser/DxfTextReader.ts var DxfTextRender=class extends DxfBaseReader{constructor(e){super(),this.data=e} /** * Gets the next group (code, value) from the array. A group is two consecutive elements * in the array. The first is the code, the second is the value. * @returns {{code: Number}|*} */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]);const e={code:parseInt(this.data[this.pointer])};return this.pointer++,e.value=parseGroupValue(e.code,this.data[this.pointer].trim()),this.pointer++,0===e.code&&"EOF"===e.value&&(this.eof=!0),this.lastReadGroup=e,e} /** * Returns true if there is another code/value pair (2 elements in the array). * @returns {boolean} */hasNext(){return!this.eof&&!(this.pointer>this.data.length-2)} /** * Returns true if the scanner is at the end of the array * @returns {boolean} */isEOF(){return this.eof}};function parseGroupValue(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?parseBoolean(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):(log.info("WARNING: Group code does not have a defined type: %j",{code:e,value:t}),t)}function parseBoolean(e){if("0"===e)return!1;if("1"===e)return!0;throw TypeError("String '"+e+"' cannot be cast to Boolean type")} // src/core/dxf-parser/entities/3dface.ts var import_lodash5=__toESM(require_lodash(),1),XDATA_KEY_ORIGINAL_HANDLE="OriginalHandle",XDATA_KEY_ORIGINAL_TYPE="OriginalType",XDATA_KEY_OUTLINES="Outlines",originalTypes=["PROXY","REGION","INSERT","HATCH"]; // src/core/dxf-parser/ParseHelpers.ts function getAcadColor(e){return AutoCadColorIndex_default[e]}function parsePoint(e){const t={};let r=e.lastReadGroup,i=r.code;if(t.x=r.value,i+=10,r=e.next(),r.code!=i)throw new Error(`Expected code for point value to be ${i} but got ${r.code}`);return t.y=r.value,i+=10,r=e.next(),r.code!=i||(t.z=r.value,e.next()),t}function parseMatrix(e,t){let r=e.lastReadGroup;const i=[];for(let n=0;n<16;n++){if(r.code!==t)throw new Error(`Expected code for matrix value to be ${t} but got ${r.code}`);i.push(r.value),r=e.next()}return i}function checkCommonEntityProperties(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&&log.warn("[DxfParser] a negative value of colorIndex indicates that the layer is turned off"),e.color=getAcadColor(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(XDATA_KEY_ORIGINAL_HANDLE)){const r=t.value.split(":").map((e=>e.trim()));e.extendedData||(e.extendedData={}),e.extendedData.originalHandle=r[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(XDATA_KEY_OUTLINES)&&(e.extendedData||(e.extendedData={}),e.extendedData.outlines=[]),t.value&&t.value.includes(XDATA_KEY_ORIGINAL_TYPE)){const r=t.value.split(":").map((e=>e.trim()));e.extendedData||(e.extendedData={}),e.extendedData.originalType=r[1]}break;default:return!1}return!0}function checkCommonObjectProperties(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} // src/core/dxf-parser/entities/3dface.ts var ThreeDface=class{constructor(){this.ForEntityName="3DFACE"}parseEntity(e,t){const r={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:if(0!==t.value){const e=Math.log2(t.value)-1;r.vertices.splice(e,1)}t=e.next();break;case 10:r.vertices=parse3dFaceVertices(e,t),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}};function parse3dFaceVertices(e,t){const r=[];let i=!1,n=!1;for(let s=0;s<=4;s++){const s={};for(;!e.isEOF()&&0!==t.code&&!n;){switch(t.code){case 10:case 11:case 12:case 13:if(i){n=!0;continue}s.x=t.value,i=!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 r}t=e.next()}(0,import_lodash5.isEmpty)(s)||r.push(s),i=!1,n=!1}return r} // src/core/dxf-parser/entities/arc.ts var Arc=class{constructor(){this.ForEntityName="ARC"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.center=parsePoint(e),t=e.lastReadGroup;break;case 40:r.radius=t.value,t=e.next();break;case 50:r.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:r.endAngle=Math.PI/180*t.value,r.angleLength=r.endAngle-r.startAngle,t=e.next();break;case 210:r.extrusionDirectionX=t.value,t=e.next();break;case 220:r.extrusionDirectionY=t.value,t=e.next();break;case 230:r.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Attdef=class{constructor(){this.ForEntityName="ATTDEF"}parseEntity(e,t){const r={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:r.text=t.value,t=e.next();break;case 2:r.tag=t.value,t=e.next();break;case 3:r.prompt=t.value,t=e.next();break;case 7:r.textStyle=t.value,t=e.next();break;case 10:r.startPoint=parsePoint(e),t=e.lastReadGroup;break;case 11:r.endPoint=parsePoint(e),t=e.lastReadGroup;break;case 39:r.thickness=t.value,t=e.next();break;case 40:r.textHeight=t.value,t=e.next();break;case 41:r.xScale=t.value,t=e.next();break;case 50:r.rotation=t.value,t=e.next();break;case 51:r.obliqueAngle=t.value,t=e.next();break;case 70:r.invisible=!!(1&t.value),r.constant=!!(2&t.value),r.verificationRequired=!!(4&t.value),r.preset=!!(8&t.value),t=e.next();break;case 71:r.backwards=!!(2&t.value),r.mirrored=!!(4&t.value),t=e.next();break;case 72:r.horizontalJustification=t.value,t=e.next();break;case 73:r.fieldLength=t.value,t=e.next();break;case 74:r.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:r.extrusionDirectionX=t.value,t=e.next();break;case 220:r.extrusionDirectionY=t.value,t=e.next();break;case 230:r.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Attrib=class{constructor(){this.ForEntityName="ATTRIB"}parseEntity(e,t){const r={type:t.value,xScale:1,textStyle:"STANDARD"};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 1:r.text=t.value,t=e.next();break;case 2:r.tag=t.value,t=e.next();break;case 3:r.prompt=t.value,t=e.next();break;case 7:r.textStyle=t.value,t=e.next();break;case 10:r.startPoint=parsePoint(e),t=e.lastReadGroup;break;case 11:r.endPoint=parsePoint(e),t=e.lastReadGroup;break;case 39:r.thickness=t.value,t=e.next();break;case 40:r.textHeight=t.value,t=e.next();break;case 41:r.xScale=t.value,t=e.next();break;case 50:r.rotation=t.value,t=e.next();break;case 51:r.obliqueAngle=t.value,t=e.next();break;case 70:r.invisible=!!(1&t.value),r.constant=!!(2&t.value),r.verificationRequired=!!(4&t.value),r.preset=!!(8&t.value),t=e.next();break;case 71:r.backwards=!!(2&t.value),r.mirrored=!!(4&t.value),t=e.next();break;case 72:r.horizontalJustification=t.value,t=e.next();break;case 73:r.fieldLength=t.value,t=e.next();break;case 74:r.verticalJustification=t.value,t=e.next();break;case 100:t=e.next();break;case 210:r.extrusionDirectionX=t.value,t=e.next();break;case 220:r.extrusionDirectionY=t.value,t=e.next();break;case 230:r.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Circle=class{constructor(){this.ForEntityName="CIRCLE"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.center=parsePoint(e),t=e.lastReadGroup;break;case 40:r.radius=t.value,t=e.next();break;case 50:r.startAngle=Math.PI/180*t.value,t=e.next();break;case 51:const i=Math.PI/180*t.value;i=0&&r.push({angle:e,origin:n,delta:s,dashPattern:o})}return r}function parseGradientColors(e,t){const r=[];let i=t.next();for(;r.length0&&(r.colorIndex=t.value,r.color=getAcadColor(Math.abs(t.value)))))}t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}}; // src/core/dxf-parser/entities/leader.ts function getDimStylePropertyName(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}} // src/core/dxf-parser/entities/line.ts var Line2=class{constructor(){this.ForEntityName="LINE"}parseEntity(e,t){const r={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.vertices.unshift(parsePoint(e)),t=e.lastReadGroup;break;case 11:r.vertices.push(parsePoint(e)),t=e.lastReadGroup;break;case 210:r.extrusionDirection=parsePoint(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Lwpolyline=class{constructor(){this.ForEntityName="LWPOLYLINE"}parseEntity(e,t){const r={type:t.value,vertices:[]};let i=0;for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 38:r.elevation=t.value,t=e.next();break;case 39:r.thickness=t.value,t=e.next();break;case 70:r.shape=1==(1&t.value),r.hasContinuousLinetypePattern=128==(128&t.value),t=e.next();break;case 90:i=t.value,t=e.next();break;case 10:r.vertices.push(...parseLWPolylineVertices(i,e)),t=e.lastReadGroup;break;case 43:0!==t.value&&(r.constantWidth=t.value),t=e.next();break;case 210:r.extrusionDirectionX=t.value,t=e.next();break;case 220:r.extrusionDirectionY=t.value,t=e.next();break;case 230:r.extrusionDirectionZ=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}}; // src/core/dxf-parser/entities/lwpolyline.ts function parseLWPolylineVertices(e,t){if(!e||e<=0)throw Error("n must be greater than 0 verticies");const r=[];let i=!1,n=!1,s=t.lastReadGroup;const a={};for(;!t.isEOF()&&0!==s.code&&!n;)switch(s.code){case 10:if(i){n=!0;continue}a.x=s.value,i=!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 i&&r.push(a),r}return r.push(a),i=!1,n=!1,r} // src/core/dxf-parser/entities/mleader.ts var MLeader=class{constructor(){this.ForEntityName="MULTILEADER"}parseEntity(e,t){const r={type:t.value};function i(){for(;!e.isEOF();)switch(t.code){case 40:r.contextData.contentScale=t.value,t=e.next();break;case 10:r.contextData.contentBasePosition=parsePoint(e),t=e.lastReadGroup;break;case 145:r.contextData.landingGap=t.value,t=e.next();break;case 290:r.contextData.hasMText=t.value,t=e.next();break;case 304:r.contextData.defaultTextContents=t.value,t=e.next();break;case 11:r.contextData.textNormalDirection=parsePoint(e),t=e.lastReadGroup;break;case 12:r.contextData.textLocation=parsePoint(e),t=e.lastReadGroup;break;case 13:r.contextData.textDirection=parsePoint(e),t=e.lastReadGroup;break;case 140:r.contextData.arrowHeadSize=t.value,t=e.next();break;case 41:r.contextData.textHeight=t.value,t=e.next();break;case 42:r.contextData.textRotation=t.value,t=e.next();break;case 43:r.contextData.textWidth=t.value,t=e.next();break;case 44:default:t=e.next();break;case 45:r.contextData.textLineSpacingFactor=t.value,t=e.next();break;case 90:r.contextData.textColor=t.value,t=e.next();break;case 170:r.contextData.textLineSpacingStyle=t.value,t=e.next();break;case 171:r.contextData.textAttachment=t.value,t=e.next();break;case 172:r.contextData.textFlowDirection=t.value,t=e.next();break;case 141:r.contextData.textBackgroundScaleFactor=t.value,t=e.next();break;case 92:r.contextData.textBackgroundTransparency=t.value,t=e.next();break;case 291:r.contextData.textBackgroundColorOn=t.value,t=e.next();break;case 292:r.contextData.textBackgroundFillOn=t.value,t=e.next();break;case 293:r.contextData.textUseAutoHeight=t.value,t=e.next();break;case 173:r.contextData.textColumnType=t.value,t=e.next();break;case 142:r.contextData.textColumnWidth=t.value,t=e.next();break;case 143:r.contextData.textColumnGutterWidth=t.value,t=e.next();break;case 144:r.contextData.textColumnHeight=t.value,t=e.next();break;case 295:r.contextData.textUseWordBreak=t.value,t=e.next();break;case 296:r.contextData.hasBlock=t.value,t=e.next();break;case 341:r.contextData.blockContentId=t.value,t=e.next();break;case 14:r.contextData.blockContentNormalDirection=parsePoint(e),t=e.lastReadGroup;break;case 15:r.contextData.blockContentPosition=parsePoint(e),t=e.lastReadGroup;break;case 16:r.contextData.blockContentScale=t.value,t=e.next();break;case 46:r.contextData.blockContentRotation=t.value,t=e.next();break;case 93:r.contextData.blockContentColor=t.value,t=e.next();break;case 47:r.contextData.blockTransformationMatrix=parseMatrix(e,47),t=e.lastReadGroup;break;case 110:r.contextData.planeOriginPoint=parsePoint(e),t=e.lastReadGroup;break;case 111:r.contextData.planeXAxisDirection=parsePoint(e),t=e.lastReadGroup;break;case 112:r.contextData.planeYAxisDirection=parsePoint(e),t=e.lastReadGroup;break;case 297:r.contextData.planeNormalReversed=t.value,t=e.next();break;case 301:return;case 302:n(),t=e.lastReadGroup}}function n(){const i={leaderLines:[]};for(r.contextData.leaders.push(i);!e.isEOF();)switch(t.code){case 290:i.hasSetLastLeaderLinePoint=t.value,t=e.next();break;case 291:i.hasSetDoglegVector=t.value,t=e.next();break;case 10:i.lastLeaderLinePoint=parsePoint(e),t=e.lastReadGroup;break;case 11:i.doglegVector=parsePoint(e),t=e.lastReadGroup;break;case 90:i.leaderBranchIndex=t.value,t=e.next();break;case 40:i.doglegLength=t.value,t=e.next();break;case 303:return;case 304:s(),t=e.lastReadGroup;break;default:t=e.next()}}function s(){const i={vertices:[[]]};for(r.contextData.leaders[r.contextData.leaders.length-1].leaderLines.push(i);!e.isEOF();)switch(t.code){case 10:i.vertices[0].push(parsePoint(e)),t=e.lastReadGroup;break;case 305:return;default:t=e.next()}}return r.contextData={leaders:[]},t=e.next(),function(){for(;!e.isEOF();)switch(t.code){case 0:return;case 340:r.leaderStyleId=t.value,t=e.next();break;case 170:r.leaderLineType=t.value,t=e.next();break;case 91:r.leaderLineColor=t.value,t=e.next();break;case 341:r.leaderLineTypeId=t.value,t=e.next();break;case 171:r.leaderLineWeight=t.value,t=e.next();break;case 41:r.doglegLength=t.value,t=e.next();break;case 290:r.enableLanding=t.value,t=e.next();break;case 291:r.enableDogLeg=t.value,t=e.next();break;case 342:r.arrowHeadId=t.value,t=e.next();break;case 42:r.arrowHeadSize=t.value,t=e.next();break;case 172:r.contentType=t.value,t=e.next();break;case 173:case 95:r.textLeftAttachmentType=t.value,t=e.next();break;case 174:r.textAngleType=t.value,t=e.next();break;case 175:r.textAlignmentType=t.value,t=e.next();break;case 343:r.textStyleId=t.value,t=e.next();break;case 92:r.textColor=t.value,t=e.next();break;case 292:r.enableFrameText=t.value,t=e.next();break;case 344:r.blockContentId=t.value,t=e.next();break;case 93:r.blockContentColor=t.value,t=e.next();break;case 10:r.blockContentScale=parsePoint(e),t=e.lastReadGroup;break;case 43:r.blockContentRotation=t.value,t=e.next();break;case 176:r.blockContentConnectionType=t.value,t=e.next();break;case 293:r.enableAnotationScale=t.value,t=e.next();break;case 94:r.arrowHeadIndex=t.value,t=e.next();break;case 177:r.blockAttributeIndex=t.value,t=e.next();break;case 44:r.blockAttributeWidth=t.value,t=e.next();break;case 302:r.blockAttributeTextString=t.value,t=e.next();break;case 294:r.textDirectionNegative=t.value,t=e.next();break;case 178:r.textAlignInIPE=t.value,t=e.next();break;case 179:r.textAttachmentPoint=t.value,t=e.next();break;case 271:r.textAttachmentDirectionMText=t.value,t=e.next();break;case 272:r.textAttachmentDirectionBottom=t.value,t=e.next();break;case 273:r.textAttachmentDirectionTop=t.value,t=e.next();break;case 300:i(),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}}(),r}},Mtext=class{constructor(){this.ForEntityName="MTEXT"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 3:case 1:r.text?r.text+=t.value:r.text=t.value,t=e.next();break;case 10:r.position=parsePoint(e),t=e.lastReadGroup;break;case 7:r.textStyle=t.value,t=e.next();break;case 44:r.lineSpaceFactor=t.value,t=e.next();break;case 11:r.directionVector=parsePoint(e),t=e.lastReadGroup;break;case 40:r.height=t.value,t=e.next();break;case 41:r.width=t.value,t=e.next();break;case 50:r.rotation=t.value,t=e.next();break;case 71:r.attachmentPoint=t.value,t=e.next();break;case 72:r.drawingDirection=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Ole=class{constructor(){this.ForEntityName="OLE2FRAME"}parseEntity(e,t){const r={type:t.value,binaryData:""};for(t=e.next();"OLE"!==t.value&&0!==t.code;)switch(t.code){case 3:r.documentType=t.value,t=e.next();break;case 70:r.version=t.value,t=e.next();break;case 10:r.leftUpX=t.value,t=e.next();break;case 20:r.leftUpY=t.value,t=e.next();break;case 30:r.leftUpZ=t.value,t=e.next();break;case 11:r.rightDownX=t.value,t=e.next();break;case 21:r.rightDownY=t.value,t=e.next();break;case 31:r.rightDownZ=t.value,t=e.next();break;case 90:r.lengthOfBinaryData=t.value,t=e.next();break;case 310:r.binaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Point=class{constructor(){this.ForEntityName="POINT"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.position=parsePoint(e),t=e.lastReadGroup;break;case 39:r.thickness=t.value,t=e.next();break;case 210:r.extrusionDirection=parsePoint(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Vertex2=class{constructor(){this.ForEntityName="VERTEX"}parseEntity(e,t){var r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.x=t.value,t=e.next();break;case 20:r.y=t.value,t=e.next();break;case 30:r.z=t.value,t=e.next();break;case 40:case 41:case 50:t=e.next();break;case 42:0!=t.value&&(r.bulge=t.value),t=e.next();break;case 70:r.curveFittingVertex=0!=(1&t.value),r.curveFitTangent=0!=(2&t.value),r.splineVertex=0!=(8&t.value),r.splineControlPoint=0!=(16&t.value),r.threeDPolylineVertex=0!=(32&t.value),r.threeDPolylineMesh=0!=(64&t.value),r.polyfaceMeshVertex=0!=(128&t.value),t=e.next();break;case 71:r.faceA=t.value,t=e.next();break;case 72:r.faceB=t.value,t=e.next();break;case 73:r.faceC=t.value,t=e.next();break;case 74:r.faceD=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Polyline=class{constructor(){this.ForEntityName="POLYLINE"}parseEntity(e,t){var r={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(),r.thickness=t.value;break;case 70:r.shape=0!=(1&t.value),r.includesCurveFitVertices=0!=(2&t.value),r.includesSplineFitVertices=0!=(4&t.value),r.is3dPolyline=0!=(8&t.value),r.is3dPolygonMesh=0!=(16&t.value),r.is3dPolygonMeshClosed=0!=(32&t.value),r.isPolyfaceMesh=0!=(64&t.value),r.hasContinuousLinetypePattern=0!=(128&t.value),t=e.next();break;case 210:r.extrusionDirection=parsePoint(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r.vertices=parsePolylineVertices(e,t),r}}; // src/core/dxf-parser/entities/mtext.ts function parsePolylineVertices(e,t){const r=new Vertex2,i=[];for(;!e.isEOF();)if(0===t.code)if("VERTEX"===t.value)i.push(r.parseEntity(e,t)),t=e.lastReadGroup;else if("SEQEND"===t.value){parseSeqEnd(e,t);break}return i}function parseSeqEnd(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)if(101===t.code)for(;0!=t.code;)t=e.next();else checkCommonEntityProperties(r,t),t=e.next();return r} // src/core/dxf-parser/entities/ray.ts var Ray2=class{constructor(){this.ForEntityName="RAY"}parseEntity(e,t){const r={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.vertices.unshift(parsePoint(e)),t=e.lastReadGroup;break;case 11:r.directionVector=parsePoint(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Region=class{constructor(){this.ForEntityName="REGION"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 70:r.modelerVersion=t.value,t=e.next();break;case 1:r.proprietaryData=t.value,t=e.next();break;case 3:r.proprietaryData+=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Seqend=class{constructor(){this.ForEntityName="SEQEND"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)if(-2===t.code);else checkCommonEntityProperties(r,t),t=e.next();return r}},Solid=class{constructor(){this.ForEntityName="SOLID"}parseEntity(e,t){const r={type:t.value,points:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.points[0]=parsePoint(e),t=e.lastReadGroup;break;case 11:r.points[1]=parsePoint(e),t=e.lastReadGroup;break;case 12:r.points[2]=parsePoint(e),t=e.lastReadGroup;break;case 13:r.points[3]=parsePoint(e),t=e.lastReadGroup;break;case 210:r.extrusionDirection=parsePoint(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Spline=class{constructor(){this.ForEntityName="SPLINE"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.controlPoints||(r.controlPoints=[]),r.controlPoints.push(parsePoint(e)),t=e.lastReadGroup;break;case 11:r.fitPoints||(r.fitPoints=[]),r.fitPoints.push(parsePoint(e)),t=e.lastReadGroup;break;case 12:r.startTangent=parsePoint(e),t=e.lastReadGroup;break;case 13:r.endTangent=parsePoint(e),t=e.lastReadGroup;break;case 40:r.knotValues||(r.knotValues=[]),r.knotValues.push(t.value),t=e.next();break;case 70:0!=(1&t.value)&&(r.closed=!0),0!=(2&t.value)&&(r.periodic=!0),0!=(4&t.value)&&(r.rational=!0),0!=(8&t.value)&&(r.planar=!0),0!=(16&t.value)&&(r.planar=!0,r.linear=!0),t=e.next();break;case 71:r.degreeOfSplineCurve=t.value,t=e.next();break;case 72:r.numberOfKnots=t.value,t=e.next();break;case 73:r.numberOfControlPoints=t.value,t=e.next();break;case 74:r.numberOfFitPoints=t.value,t=e.next();break;case 210:r.normalVector=parsePoint(e),t=e.lastReadGroup;break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Text=class{constructor(){this.ForEntityName="TEXT"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.startPoint=parsePoint(e),t=e.lastReadGroup;break;case 11:r.endPoint=parsePoint(e),t=e.lastReadGroup;break;case 40:r.textHeight=t.value,t=e.next();break;case 41:r.xScale=t.value,t=e.next();break;case 50:r.rotation=t.value,t=e.next();break;case 1:r.text=t.value,t=e.next();break;case 72:r.halign=t.value,t=e.next();break;case 73:r.valign=t.value,t=e.next();break;case 7:r.textStyle=t.value,t=e.next();break;case 71:r.mirrored=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Viewport=class{constructor(){this.ForEntityName="VIEWPORT"}parseEntity(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 68:r.viewportStatus=t.value,t=e.next();break;case 40:r.width_paperSpace=t.value,t=e.next();break;case 41:r.height_paperSpace=t.value,t=e.next();break;case 69:r.viewportId=t.value,t=e.next();break;case 10:r.centerPoint=parsePoint(e),t=e.lastReadGroup;break;case 12:r.centerPoint_dcs=parsePoint(e),t=e.lastReadGroup;break;case 13:r.snapBasePoint_dcs=parsePoint(e),t=e.lastReadGroup;break;case 14:r.snapSpacing_dcs=parsePoint(e),t=e.lastReadGroup;break;case 15:r.gridSpacing_dcs=parsePoint(e),t=e.lastReadGroup;break;case 16:r.viewDirection=parsePoint(e),t=e.lastReadGroup;break;case 17:r.viewTarget=parsePoint(e),t=e.lastReadGroup;break;case 42:r.perspectiveLens=t.value,t=e.next();break;case 43:r.frontClippingPlaneZ=t.value,t=e.next();break;case 44:r.backClippingPlaneZ=t.value,t=e.next();break;case 45:r.viewHeight=t.value,t=e.next();break;case 50:r.snapAngle=t.value,t=e.next();break;case 51:r.viewTwistAngle=t.value,t=e.next();break;case 72:r.circleZoomPercent=t.value,t=e.next();break;case 331:r.frozenLayerHandles=r.frozenLayerHandles||[],r.frozenLayerHandles.push(t.value),t=e.next();break;case 90:r.viewportStatusFlags=t.value,t=e.next();break;case 340:r.viewportClippingBoundaryhandleId=t.value,t=e.next();break;case 1:r.plotStyleSheetName=t.value,t=e.next();break;case 281:r.renderMode=t.value,t=e.next();break;case 71:r.viewportFlag_ucs=t.value,t=e.next();break;case 74:r.ucsIcon=t.value,t=e.next();break;case 110:r.ucsOrigin=parsePoint(e),t=e.lastReadGroup;break;case 111:r.ucsXAxis=parsePoint(e),t=e.lastReadGroup;break;case 112:r.ucsYAxis=parsePoint(e),t=e.lastReadGroup;break;case 345:r.ucsTableRecordHandle=t.value,t=e.next();break;case 346:r.baseUcsTableRecordHandle=t.value,t=e.next();break;case 79:r.orthographicType=t.value,t=e.next();break;case 146:r.elevation=t.value,t=e.next();break;case 170:r.shadePlotMode=t.value,t=e.next();break;case 61:r.frequency=t.value,t=e.next();break;case 292:r.lightingFlag=t.value,t=e.next();break;case 282:r.lightingType=t.value,t=e.next();break;case 141:r.viewBrightness=t.value,t=e.next();break;case 142:r.viewContrast=t.value,t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},XLine=class{constructor(){this.ForEntityName="XLINE"}parseEntity(e,t){const r={type:t.value,vertices:[]};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 10:r.vertices.unshift(parsePoint(e)),t=e.lastReadGroup;break;case 11:r.directionVector=parsePoint(e),t=e.lastReadGroup;break;case 100:t=e.next();break;case 101:for(;0!=t.code;)t=e.next();break;default:checkCommonEntityProperties(r,t),t=e.next()}return r}},Dictionary=class{constructor(){this.ForObjectName="DICTIONARY"}parseObject(e,t){const r={type:t.value},i=[],n=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 280:r.isHardOwner=1===t.value,t=e.next();break;case 281:r.cloningFlag=t.value,t=e.next();break;case 3:i.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:checkCommonObjectProperties(r,t /*, scanner*/),t=e.next()}if(i.length!==n.length)throw new Error("The number of Dictionary entries does not match !");return r.entries={},i.forEach(((e,t)=>{r.entries[n[t]]=e})),r}},Layout=class{constructor(){this.ForObjectName="LAYOUT"}parseObject(e,t){const r={type:t.value};for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 100:t=e.next();break;case 1:r.layoutName=t.value,t=e.next();break;case 70:r.flag=t.value,t=e.next();break;case 71:r.tabOrder=t.value,t=e.next();break;case 76:r.orthographicType=t.value,t=e.next();break;case 10:r.minLimit=parsePoint(e),t=e.lastReadGroup;break;case 11:r.maxLimit=parsePoint(e),t=e.lastReadGroup;break;case 12:r.basePoint=parsePoint(e),t=e.lastReadGroup;break;case 13:r.origin=parsePoint(e),t=e.lastReadGroup;break;case 14:r.minExtent=parsePoint(e),t=e.lastReadGroup;break;case 15:r.maxExtent=parsePoint(e),t=e.lastReadGroup;break;case 16:r.XAxis=parsePoint(e),t=e.lastReadGroup;break;case 17:r.YAxis=parsePoint(e),t=e.lastReadGroup;break;case 146:r.elevation=t.value,t=e.next();break;case 331:r.viewportHandle=t.value,t=e.next();break;default:checkCommonObjectProperties(r,t /*, scanner*/),t=e.next()}return r.blockTableHandle=r.ownerHandle,r}},SortEntsTable=class{constructor(){this.ForObjectName="SORTENTSTABLE"}parseObject(e,t){const r={type:t.value};let i=!1;r.sortEntsObject={},r.sortEntsObject.entityHandles=[];let n=[];for(t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 5:i?(n.push(t.value),r.sortEntsObject.entityHandles.push(n),n=[]):r.handle=t.value,t=e.next();break;case 100:t=e.next(),i=!0;break;case 102:t=e.next();break;case 330:i?r.sortEntsObject.ownerHandle=t.value:r.ownerHandle=t.value,t=e.next();break;case 331:n.push(t.value),t=e.next();break;default:checkCommonObjectProperties(r,t /*, scanner*/),t=e.next()}return r}},SpatialFilter=class{constructor(){this.ForObjectName="SPATIAL_FILTER"}parseObject(e,t){const r={type:t.value};let i,n;for(r.vertices=[],t=e.next();!e.isEOF()&&0!==t.code;)switch(t.code){case 11:r.origin=parsePoint(e),t=e.lastReadGroup;break;case 70:r.numberOfPointsOnClipBoundary=t.value,2===r.numberOfPointsOnClipBoundary?(t=e.next(),i=parsePoint(e),t=e.lastReadGroup,n=parsePoint(e),t=e.lastReadGroup,r.vertices.push(i,{x:n.x,y:i.y},n,{x:i.x,y:n.y},i)):r.numberOfPointsOnClipBoundary>2?(r.vertices=parsePolylineVertices2(r.numberOfPointsOnClipBoundary,e),t=e.lastReadGroup):t=e.next();break;case 71:r.clipBoundaryVisible=1===t.value,t=e.next();break;case 72:r.frontClippingPlaneFlag=1===t.value,t=e.next(),r.frontClippingPlaneFlag&&40===t.code&&(r.frontClippingPlaneDistance=t.value,t=e.next());break;case 73:r.backClippingPlaneFlag=1===t.value,t=e.next(),r.backClippingPlaneFlag&&41===t.code&&(r.backClippingPlaneDistance=t.value,t=e.next());break;case 100:case 102:t=e.next();break;case 210:r.extrusionDirectionX=t.value,t=e.next();break;case 220:r.extrusionDirectionY=t.value,t=e.next();break;case 230:r.extrusionDirectionZ=t.value,t=e.next();break;case 40:r.invertBlockMatrix=parseMatrix2(e,40),r.matrix=parseMatrix2(e,40),t=e.lastReadGroup;break;default:checkCommonObjectProperties(r,t /*, scanner*/),t=e.next()}return r}}; // src/core/dxf-parser/entities/region.ts function parsePolylineVertices2(e,t){t.next();const r=[];for(;r.length{e.on("data",(e=>{t+=e})),e.on("end",(()=>{try{i(r.parse(t))}catch(e){n(e)}})),e.on("error",(e=>{n(e)}))}))}_parse(e){const t={};let r=0;if(!e.hasNext())throw Error("Empty file");const i=this;let n;function s(){let t=null,r=null;const i={};for(n=e.next();;){if(groupIs(n,0,"ENDSEC")){t&&(i[t]=r);break}9===n.code?(t&&(i[t]=r),t=n.value):10===n.code?r={x:n.value}:20===n.code?r.y=n.value:30===n.code?r.z=n.value:r=n.value,n=e.next()}return n=e.next(),i}function a(){const t={};for(n=e.next();"EOF"!==n.value&&!groupIs(n,0,"ENDSEC");)if(groupIs(n,0,"BLOCK")){log.trace("block {");const e=o();log.trace("}"),f(e),e.name?t[e.name]=e:log.error(`[DxfParser] Block with handle '${e.handle}' is missing a name, ignored!`)}else logUnhandledGroup(n),n=e.next();return t}function o(){const t={};for(n=e.next();"EOF"!==n.value;){switch(n.code){case 1:t.xrefPath=n.value,n=e.next();break;case 2:t.name=n.value,n=e.next();break;case 3:t.name2=n.value,n=e.next();break;case 4:t.description=n.value,n=e.next();break;case 5:t.handle=n.value,n=e.next();break;case 8:t.layer=n.value,n=e.next();break;case 10:t.position=m(n),n=e.lastReadGroup;break;case 67:t.paperSpace=!(!n.value||1!==n.value),n=e.next();break;case 70:t.blockType=n.value,n=e.next();break;case 100:n=e.next();break;case 330:t.ownerHandle=n.value,n=e.next();break;case 0:if("ENDBLK"==n.value)break;t.entities=p(!0);break;default:logUnhandledGroup(n),n=e.next()}if(groupIs(n,0,"ENDBLK")){n=e.next();break}}return t}function l(){const t={};for(n=e.next();"EOF"!==n.value&&!groupIs(n,0,"ENDSEC");)if(groupIs(n,0,"TABLE")){n=e.next();h[n.value]?(log.trace(n.value+" Table {"),t[h[n.value].tableName]=u(n),log.trace("}")):log.trace("Unhandled Table "+n.value)}else n=e.next();return n=e.next(),t}const c="ENDTAB";function u(t){const r=h[t.value],i={};let s=0;for(n=e.next();!groupIs(n,0,c);)switch(n.code){case 5:i.handle=n.value,n=e.next();break;case 330:i.ownerHandle=n.value,n=e.next();break;case 100:"AcDbSymbolTable"===n.value||logUnhandledGroup(n),n=e.next();break;case 70:s=n.value,n=e.next();break;case 0:n.value===r.dxfSymbolName?i[r.tableRecordsProperty]=r.parseTableRecords():(logUnhandledGroup(n),n=e.next());break;default:logUnhandledGroup(n),n=e.next()}const a=i[r.tableRecordsProperty];if(a){const e=a.constructor===Array?a.length:"object"==typeof a?Object.keys(a).length:void 0;s!==e&&log.warn(`[DxfParser] Parsed ${e} ${r.dxfSymbolName}s but expected ${s}`)}return n=e.next(),i}const h={VPORT:{tableRecordsProperty:"viewPorts",tableName:"viewPort",dxfSymbolName:"VPORT",parseTableRecords:function(){const t=[];let r={};for(log.trace("ViewPort {"),n=e.next();!groupIs(n,0,c);)switch(n.code){case 2:r.name=n.value,n=e.next();break;case 10:r.lowerLeftCorner=m(n),n=e.lastReadGroup;break;case 11:r.upperRightCorner=m(n),n=e.lastReadGroup;break;case 12:r.center=m(n),n=e.lastReadGroup;break;case 13:r.snapBasePoint=m(n),n=e.lastReadGroup;break;case 14:r.snapSpacing=m(n),n=e.lastReadGroup;break;case 15:r.gridSpacing=m(n),n=e.lastReadGroup;break;case 16:r.viewDirectionFromTarget=m(n),n=e.lastReadGroup;break;case 17:r.viewTarget=m(n),n=e.lastReadGroup;break;case 40:case 45:r.viewHeight=n.value,n=e.next();break;case 41:r.aspectRatio=n.value,n=e.next();break;case 42:r.lensLength=n.value,n=e.next();break;case 43:r.frontClippingPlane=n.value,n=e.next();break;case 44:r.backClippingPlane=n.value,n=e.next();break;case 50:r.snapRotationAngle=n.value,n=e.next();break;case 51:r.viewTwistAngle=n.value,n=e.next();break;case 79:r.orthographicType=n.value,n=e.next();break;case 110:r.ucsOrigin=m(n),n=e.lastReadGroup;break;case 111:r.ucsXAxis=m(n),n=e.lastReadGroup;break;case 112:r.ucsYAxis=m(n),n=e.lastReadGroup;break;case 281:r.renderMode=n.value,n=e.next();break;case 282:r.defaultLightingType=n.value,n=e.next();break;case 292:r.defaultLightingOn=n.value,n=e.next();break;case 330:r.ownerHandle=n.value,n=e.next();break;case 63:case 421:case 431:r.ambientColor=n.value,n=e.next();break;case 0:"VPORT"===n.value&&(log.trace("}"),t.push(r),log.trace("ViewPort {"),r={},n=e.next());break;default:logUnhandledGroup(n),n=e.next()}return log.trace("}"),t.push(r),t}},LTYPE:{tableRecordsProperty:"lineTypes",tableName:"lineType",dxfSymbolName:"LTYPE",parseTableRecords:function(){const t={};let r={},s=0,a="",o=!1;for(log.trace("LType {"),n=e.next();!groupIs(n,0,"ENDTAB");)switch(n.code){case 2:r.name=n.value.toUpperCase(),a=r.name,n=e.next();break;case 3:r.description=n.value,n=e.next();break;case 9:case 44:case 45:case 46:case 70:case 75:default:n=e.next();break;case 40:r.patternLength=n.value,n=e.next();break;case 49:let l=n.value;o&&(l=Math.abs(l),o=!1),r.pattern.push(l),n=e.next();break;case 73:s=n.value,s>0&&(r.pattern=[]),n=e.next();break;case 74:0!==n.value&&(o=!0,i.unsupportedLineTypes[r.name]?i.unsupportedLineTypes[r.name]++:i.unsupportedLineTypes[r.name]=1),n=e.next();break;case 0:log.trace("}"),s>0&&s!==r.pattern.length&&log.warn("[DxfParser] lengths do not match on LTYPE pattern"),t[a]=r,r={},log.trace("LType {"),n=e.next()}return log.trace("}"),t[a]=r,t}},LAYER:{tableRecordsProperty:"layers",tableName:"layer",dxfSymbolName:"LAYER",parseTableRecords:function(){const t={};let r,i={};for(log.trace("Layer {"),n=e.next();!groupIs(n,0,"ENDTAB");)switch(n.code){case 2:i.name=n.value,r=n.value,n=e.next();break;case 5:i.handle=n.value,n=e.next();break;case 62:i.visible=n.value>=0,i.colorIndex=Math.abs(n.value),i.color=getAcadColor2(i.colorIndex),n=e.next();break;case 70:i.flag=n.value,i.frozen=(1&i.flag)>0,n=e.next();break;case 420:i.color=Math.abs(n.value),n=e.next();break;case 6:i.lineType=n.value.toUpperCase(),n=e.next();break;case 370:i.lineweight=n.value,n=e.next();break;case 0:"LAYER"===n.value&&(log.trace("}"),r&&(t[r]=i),log.trace("Layer {"),i={},r=void 0,n=e.next());break;default:logUnhandledGroup(n),n=e.next()}return log.trace("}"),r&&(t[r]=i),t}},BLOCK_RECORD:{tableRecordsProperty:"blockRecords",tableName:"blockRecord",dxfSymbolName:"BLOCK_RECORD",parseTableRecords:function(){const t={};let r,s={};for(log.trace("BlockRecord {"),n=e.next();!groupIs(n,0,"ENDTAB");)switch(n.code){case 5:s.handle=n.value,n=e.next();break;case 330:s.ownerHandle=n.value,n=e.next();break;case 2:s.blockName=n.value,r=s.blockName,n=e.next();break;case 340:s.layoutHandle=n.value,n=e.next();break;case 70:s.blockInsertUnits=n.value,n=e.next();break;case 280:s.blockExplodability=n.value,n=e.next();break;case 281:s.blockScalability=n.value,n=e.next();break;case 310:s.bitmap=n.value,n=e.next();break;case 0:if("BLOCK_RECORD"===n.value){log.trace("}"),r&&(t[r]=s);const a=s.layoutHandle;r&&a&&a.length>0&&"0"!==a&&(i._layoutBlocks[a]=s),log.trace("BlockRecord {"),s={},r=void 0,n=e.next()}else logUnhandledGroup(n),n=e.next();break;default:logUnhandledGroup(n),n=e.next()}log.trace("}"),r&&(t[r]=s);const a=s.layoutHandle;return r&&a&&a.length>0&&"0"!==a&&(i._layoutBlocks[a]=s),t}},STYLE:{tableRecordsProperty:"styles",tableName:"style",dxfSymbolName:"STYLE",parseTableRecords:function(){const t={};let r,i={};for(log.trace("Style {"),n=e.next();!groupIs(n,0,"ENDTAB");)switch(n.code){case 2:i.styleName=n.value,r=n.value,n=e.next();break;case 3:i.fontFile=n.value,n=e.next();break;case 4:i.bigFontFile=n.value,n=e.next();break;case 5:i.handle=n.value,n=e.next();break;case 7:i.textStyle=n.value,n=e.next();break;case 40:i.textHeight=n.value,n=e.next();break;case 41:i.xScale=n.value,n=e.next();break;case 42:i.priorTextHeight=n.value,n=e.next();break;case 50:i.rotation=n.value,n=e.next();break;case 70:default:n=e.next();break;case 71:i.mirroreType=n.value,n=e.next();break;case 330:i.ownerHandle=n.value,n=e.next();break;case 0:"STYLE"===n.value&&(log.trace("}"),r&&(t[r]=i),log.trace("Style {"),i={},r=void 0,n=e.next())}return log.trace("}"),r&&(t[r]=i),t}},DIMSTYLE:{tableRecordsProperty:"dimStyles",tableName:"dimStyle",dxfSymbolName:"DIMSTYLE",parseTableRecords:function(){const t={};let r,i={};for(log.trace("DimStyle {"),n=e.next();!groupIs(n,0,"ENDTAB");)switch(n.code){case 2:i.styleName=n.value,r=n.value,n=e.next();break;case 40:i.DIMSCALE=n.value,n=e.next();break;case 41:i.DIMASZ=n.value,n=e.next();break;case 42:i.DIMEXO=n.value,n=e.next();break;case 44:i.DIMEXE=n.value,n=e.next();break;case 75:i.DIMSE1=n.value,n=e.next();break;case 76:i.DIMSE2=n.value,n=e.next();break;case 77:i.DIMTAD=n.value,n=e.next();break;case 140:i.DIMTXT=n.value,n=e.next();break;case 144:i.DIMLFAC=n.value,n=e.next();break;case 147:i.DIMGAP=n.value,n=e.next();break;case 176:i.DIMCLRD=n.value,n=e.next();break;case 178:i.DIMCLRT=n.value,n=e.next();break;case 271:i.DIMDEC=n.value,n=e.next();break;case 341:i.DIMLDRBLK=n.value,n=e.next();break;case 70:default:n=e.next();break;case 0:"DIMSTYLE"===n.value&&(log.trace("}"),r&&(t[r]=i),log.trace("DimStyle {"),i={},r=void 0,n=e.next())}return log.trace("}"),r&&(t[r]=i),t}}};function p(t){const r=[],s=t?"ENDBLK":"ENDSEC";for(t||(n=e.next());;)if(0===n.code){if(n.value===s)break;const t=i._entityHandlers[n.value];if(null==t){const t=n.value;i.unhandledEntities[t]||(i.unhandledEntities[t]=0),i.unhandledEntities[t]++,n=e.next();continue}{log.trace(n.value+" {");const i=t.parseEntity(e,n);i&&(i.layer||(i.layer="0"),void 0===i.colorIndex&&(i.colorIndex=256),i.lineType||(i.lineType=BYLAYER)),n=e.lastReadGroup,log.trace("}"),f(i),r.push(i)}}else n=e.next();return"ENDSEC"==s&&(n=e.next()),r}function d(){const t={};for(n=e.next();"EOF"!==n.value;)if(0===n.code){if("ENDSEC"===n.value)break;const r=i._objectHandlers[n.value];if(null==r){const t=n.value;i.unhandledObjects[t]||(i.unhandledObjects[t]=0),i.unhandledObjects[t]++,n=e.next();continue}{log.trace(n.value+" {");const i=r.parseObject(e,n),s=n.value;n=e.lastReadGroup,log.trace("}"),f(i),t[s]||(t[s]=[]),t[s].push(i)}}else n=e.next();return n=e.next(),t.LAYOUT&&(Object.keys(i._layoutBlocks).length!==t.LAYOUT.length&&log.warn("[DxfParser] The number of layout and block associations does not match!"),t.LAYOUT.forEach((e=>{i._layoutBlocks[e.handle]&&(e.associatedBlockName=i._layoutBlocks[e.handle].blockName)})),t.LAYOUT.sort(((e,t)=>e.tabOrder-t.tabOrder))),t}function m(t){const r={};let i=t.code;if(r.x=t.value,i+=10,(t=e.next()).code!=i)throw new Error(`Expected code for point value to be ${i} but got ${t.code}.`);return r.y=t.value,i+=10,(t=e.next()).code!=i||(r.z=t.value,t=e.next()),r}function f(e){if(!e)throw new TypeError("entity cannot be undefined or null");e.handle||(e.handle=(r++).toString())}return function(){for(n=e.next();999===n.code;)n=e.next();for(;!e.isEOF();)if(0===n.code&&"SECTION"===n.value){if(n=e.next(),2!==n.code){log.error("Unexpected code %s after 0:SECTION",debugCode(n)),n=e.next();continue}if("HEADER"===n.value)log.trace("> HEADER"),t.header=s(),log.trace("<");else if("TABLES"===n.value)log.trace("> TABLES"),t.tables=l(),log.trace("<");else if("BLOCKS"===n.value)log.trace("> BLOCKS"),t.blocks=a(),log.trace("<");else if("ENTITIES"===n.value)log.trace("> ENTITIES"),t.entities=p(!1),log.trace("<");else if("OBJECTS"===n.value)log.trace("> OBJECTS"),t.objects=d(),log.trace("<");else if("EOF"===n.value)log.trace("EOF");else{const e=n.value;i.unhandledSections[e]?i.unhandledSections[e]++:i.unhandledSections[e]=1}}else n=e.next();i.unhandledSections={},i.unhandledEntities={},i.unhandledObjects={},i.unsupportedLineTypes={}}(),t}};function groupIs(e,t,r){return e.code===t&&e.value===r}function logUnhandledGroup(e){log.trace("unhandled group "+debugCode(e))}function debugCode(e){return e.code+":"+e.value}function getAcadColor2(e){return AutoCadColorIndex_default[e]} // src/core/dxf/DXFLoader.ts var import_concaveman=__toESM(require_concaveman(),1),version2="3.7.2",VERSION=version2,_hasatob="function"==typeof atob,_hasbtoa="function"==typeof btoa,_hasBuffer="function"==typeof Buffer,_TD="function"==typeof TextDecoder?new TextDecoder:void 0,_TE="function"==typeof TextEncoder?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(e=>{let t={};return b64chs.forEach(((e,r)=>t[e]=r)),t})(),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),_mkUriSafe=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),_tidyB64=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=e=>{let t,r,i,n,s="";const a=e.length%3;for(let a=0;a255||(i=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|i<<8|n,s+=b64chs[t>>18&63]+b64chs[t>>12&63]+b64chs[t>>6&63]+b64chs[63&t]}return a?s.slice(0,a-3)+"===".substring(a):s},_btoa=_hasbtoa?e=>btoa(e):_hasBuffer?e=>Buffer.from(e,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,i=e.length;rt?_mkUriSafe(_fromUint8Array(e)):_fromUint8Array(e),cb_utob=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?_fromCC(192|t>>>6)+_fromCC(128|63&t):_fromCC(224|t>>>12&15)+_fromCC(128|t>>>6&63)+_fromCC(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return _fromCC(240|t>>>18&7)+_fromCC(128|t>>>12&63)+_fromCC(128|t>>>6&63)+_fromCC(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=e=>e.replace(re_utob,cb_utob),_encode=_hasBuffer?e=>Buffer.from(e,"utf8").toString("base64"):_TE?e=>_fromUint8Array(_TE.encode(e)):e=>_btoa(utob(e)),encode=(e,t=!1)=>t?_mkUriSafe(_encode(e)):_encode(e),encodeURI2=e=>encode(e,!0),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=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 _fromCC(55296+(t>>>10))+_fromCC(56320+(1023&t));case 3:return _fromCC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _fromCC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=e=>e.replace(re_btou,cb_btou),atobPolyfill=e=>{if(e=e.replace(/\s+/g,""),!b64re.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,i,n="";for(let s=0;s>16&255):64===i?_fromCC(t>>16&255,t>>8&255):_fromCC(t>>16&255,t>>8&255,255&t);return n},_atob=_hasatob?e=>atob(_tidyB64(e)):_hasBuffer?e=>Buffer.from(e,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?e=>_U8Afrom(Buffer.from(e,"base64")):e=>_U8Afrom(_atob(e),(e=>e.charCodeAt(0))),toUint8Array=e=>_toUint8Array(_unURI(e)),_decode=_hasBuffer?e=>Buffer.from(e,"base64").toString("utf8"):_TD?e=>_TD.decode(_toUint8Array(e)):e=>btou(_atob(e)),_unURI=e=>_tidyB64(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),decode=e=>_decode(_unURI(e)),isValid=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},_noEnum=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),extendString=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,_noEnum(t));e("fromBase64",(function(){return decode(this)})),e("toBase64",(function(e){return encode(this,e)})),e("toBase64URI",(function(){return encode(this,!0)})),e("toBase64URL",(function(){return encode(this,!0)})),e("toUint8Array",(function(){return toUint8Array(this)}))},extendUint8Array=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,_noEnum(t));e("toBase64",(function(e){return fromUint8Array(this,e)})),e("toBase64URI",(function(){return fromUint8Array(this,!0)})),e("toBase64URL",(function(){return fromUint8Array(this,!0)}))},extendBuiltins=()=>{extendString(),extendUint8Array()},gBase64={version:version2,VERSION:VERSION,atob:_atob,atobPolyfill:atobPolyfill,btoa:_btoa,btoaPolyfill:btoaPolyfill,fromBase64:decode,toBase64:encode,encode:encode,encodeURI:encodeURI2,encodeURL:encodeURI2,utob:utob,btou:btou,decode:decode,isValid:isValid,fromUint8Array:fromUint8Array,toUint8Array:toUint8Array,extendString:extendString,extendUint8Array:extendUint8Array,extendBuiltins:extendBuiltins},polybooljs=__toESM(require_polybooljs(),1),TextGeometry=class extends ExtrudeGeometry{constructor(e,t={}){const r=t.font;if(void 0===r)super();else{const i=r.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(i,t)}this.type="TextGeometry"}},unitScaleToMeter=e=>"Unitless"/* Unitless */===e?1:"Inches"/* Inches */===e?.0254:"Feet"/* Feet */===e?.3048:"Millimeters"/* Millimeters */===e?.001:"Centimeters"/* Centimeters */===e?.01:("Meters"/* Meters */===e||console.warn(`[Units] Unsupported unit '${e}', will return 1 for unit scale.`),1),unitScaleConversion=(e,t)=>unitScaleToMeter(e)/unitScaleToMeter(t),versionKey="VERSION",getVersionFromLocalStorage=()=>window.localStorage.getItem(versionKey),setVersionToLocalStorage=()=>{window.localStorage.setItem(versionKey,version)},checkIsNewVersion=()=>getVersionFromLocalStorage()!==version&&(setVersionToLocalStorage(),!0),_IndexedDbManager=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 _IndexedDbManager._instance||(_IndexedDbManager._instance=new _IndexedDbManager),_IndexedDbManager._instance} /** * Make sure to open database, and the table is already created before add/put/delete, etc. */getDatabase(){return __async(this,null,(function*(){let e=yield this.getDB(this.DATABASE_NAME);return this.db||(e.close(),checkIsNewVersion()&&(yield this.deleteDataBase(this.DATABASE_NAME)),e=yield this.getUpgradedDB(e)),e.onclose=()=>{this.db=void 0,log.debug(`[DB] Db ${e.name} is closed.`)},e.onerror=t=>{this.db=void 0,log.debug(`[DB] Db ${e.name} encountered error.`,t)},e.onabort=t=>{this.db=void 0,log.debug(`[DB] Db ${e.name} aborted.`,t)},e.onversionchange=e=>{log.debug("onversionchange",e)},this.db=e,Promise.resolve(this.db)}))} /** * Close database. */closeDatabase(){this.db&&this.db.close()}deleteDataBase(e){return new Promise(((t,r)=>{const i=window.indexedDB.deleteDatabase(e);i.onerror=e=>{log.debug(e),r(e)},i.onsuccess=r=>{const i=r.target;log.debug(`[DB] Db ${e} delete old version ${r.oldVersion}.`),t(i)}}))}getDB(e){return __async(this,null,(function*(){return new Promise(((t,r)=>{const i=window.indexedDB.open(e);i.onerror=r,i.onsuccess=e=>{const r=e.target.result;log.debug(`[DB] Db ${r.name} opened (version ${r.version}).`),t(r)}}))}))}getUpgradedDB(e){return __async(this,null,(function*(){return new Promise(((t,r)=>{log.debug(`[DB] Upgrading db ${e.name} (version ${e.version})`);const i=window.indexedDB.open(e.name,e.version+1);i.onerror=r,i.onblocked=e=>{log.debug("onblocked",e)},i.onupgradeneeded=e=>{e.target.transaction.oncomplete=()=>{log.debug(`[DB] Upgrade is done (new version: ${t.version}).`)};const t=e.target.result,r=[];for(let e=0;e0&&Promise.all(r).then((()=>{log.debug(`[DB] All(${r.length}) tables created.`)}))},i.onsuccess=e=>{const r=e.target.result;log.debug(`[DB] Db ${r.name} opened (version ${r.version}).`),t(r)}}))}))}createTable(e,t,r,i){return __async(this,null,(function*(){return new Promise((n=>{const s=e.createObjectStore(t,r);i&&i.forEach((e=>{s.createIndex(e.name,e.fields,{unique:e.unique})})),log.debug(`[DB] Table ${t} created.`),n(e)}))}))}},IndexedDbManager=_IndexedDbManager; // node_modules/js-base64/base64.mjs /** * Singleton design pattern */ IndexedDbManager._instance=void 0; // src/core/indexeddb/BaseTable.ts var BaseTable=class{constructor(){this.db=void 0,this.isCreatingTable=!1;if(-1===IndexedDbManager.instance().TABLES.findIndex((e=>e.name===this.tableName())))throw new Error(`Make sure to add table '${this.tableName()}' to IndexedDbManager.TABLES!`)} /** * Derived class have to override this method and return a table name! */tableName(){throw new Error("Derived class have to override 'tableName', and set a proper table name!")} /** * Adds a record to a table */add(e,t,r){const i=this.tableName();IndexedDbManager.instance().getDatabase().then((n=>{const s=n.transaction([i],"readwrite").objectStore(i).add(e);s.onsuccess=t,s.onerror=r})).finally((()=>{IndexedDbManager.instance().closeDatabase()})).catch((e=>{r&&r(e)}))} /** * Saves a record */save(e,t,r){const i=this.tableName();IndexedDbManager.instance().getDatabase().then((n=>{const s=n.transaction([i],"readwrite").objectStore(i).put(e);s.onsuccess=t,s.onerror=r})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))} /** * Deletes a record */delete(e,t,r){const i=this.tableName();IndexedDbManager.instance().getDatabase().then((n=>{const s=n.transaction([i],"readwrite").objectStore(i).delete(e);s.onsuccess=t,s.onerror=r})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))} /** * Updates a record */update(){IndexedDbManager.instance().getDatabase().then((()=>{}))} /** * Queries records in a table * @param cursorHandler callback to handle records one by one */query(e,t){const r=this.tableName();IndexedDbManager.instance().getDatabase().then((i=>{const n=i.transaction([r],"readonly").objectStore(r).openCursor();n.onsuccess=t=>{const r=t.target.result;r&&r.continue(),e&&e(r)},n.onerror=t})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))}queryAll(e,t){const r=this.tableName();IndexedDbManager.instance().getDatabase().then((i=>{const n=i.transaction([r],"readonly").objectStore(r).getAll();n.onsuccess=t=>{e&&e(n.result)},n.onerror=t})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))}clearAll(e,t){const r=this.tableName();IndexedDbManager.instance().getDatabase().then((i=>{const n=i.transaction([r],"readwrite").objectStore(r).clear();n.onsuccess=t=>{e&&e(t)},n.onerror=e=>{t&&t(e)}})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))}},_DxfDataTable=class extends BaseTable{tableName(){return"dxfdata"}static instance(){return _DxfDataTable._instance||(_DxfDataTable._instance=new _DxfDataTable),_DxfDataTable._instance} /** * Queires a dxf data * @param dxfDataId should be a unique id to identify different dxf files */ // eslint-disable-next-line query(e,t,r){const i=[],n=this.tableName();IndexedDbManager.instance().getDatabase().then((s=>{const a=s.transaction([n],"readonly").objectStore(n).get(e);a.onerror=e=>{r&&r(e),log.info("[DxfDataTable] Failed to query !",e)},a.onsuccess=()=>{a.result&&i.push(a.result),t&&t(i)}})).finally((()=>{IndexedDbManager.instance().closeDatabase()}))}},DxfDataTable=_DxfDataTable; // src/core/indexeddb/DxfDataTable.ts /** * Singleton design pattern */ DxfDataTable._instance=void 0; // src/core/indexeddb/FontDataTable.ts var _FontDataTable=class extends BaseTable{tableName(){return"fontdata"}static instance(){return _FontDataTable._instance||(_FontDataTable._instance=new _FontDataTable),_FontDataTable._instance} /** * Queires a dxf data * @param fileId should be a unique id to identify different dxf files */ // eslint-disable-next-line query(e,t,r){let i;super.query((r=>{r?r.value&&r.value.url===e&&(i=r.value):t&&t(i)}),(e=>{r&&r(),console.log(e)}))}queryAll(){return __async(this,null,(function*(){return new Promise(((e,t)=>{__superGet(_FontDataTable.prototype,this,"queryAll").call(this,(t=>{e(t)}),(e=>{t(e)}))}))}))}},FontDataTable=_FontDataTable; /** * Singleton design pattern */ FontDataTable._instance=void 0; // src/core/shx-parser/TextShape.ts var table,TextShape=class extends Shape{constructor(e,t){super(),this.width=0,this.lastPoint=e,this.polyLines=t,this.width=this.calcWidth(t)}offset(e){const t=[];for(let r=0;r = new Map(); this.datas={}, // text shape this.graphicData=new Map,this.url=e}getGraphicDataByCode(e,t){if(0===e)return;const r=this.datas;if(!this.graphicData.has(e)){if(!r[e]){if(letters[e]){const r=[];for(let t=0;tnew Vector2(e[0],e[1]))));const i=new TextShape(new Vector2,r),n=t/ShxFont.DEFAULT_SIZE;return transform.identity().scale(n,n),i.transform(transform)}return}{const t=r[e],i=ShxFont.DEFAULT_SIZE/this.baseUp,n=ShxParser.parserCode(this,t,i);this.graphicData.set(e,n)}}if(this.graphicData.has(e)){const r=t/ShxFont.DEFAULT_SIZE;return transform.identity().scale(r,r),this.graphicData.get(e).transform(transform)}}getGraphicTextShape(e,t,r){var i;return null==(i=this.getGraphicDataByCode(e,t))?void 0:i.offset(r)}getFontFile(){return{url:this.url,type:this.type,datas:this.datas,info:this.info,orientation:this.orientation,baseUp:this.baseUp,baseDown:this.baseDown,fileHeader:this.fileHeader,fileVersion:this.fileVersion}}setFontFile(e){this.url=e.url,this.type=e.type,this.datas=e.datas,this.info=e.info,this.orientation=e.orientation,this.baseUp=e.baseUp,this.baseDown=e.baseDown,this.fileHeader=e.fileHeader,this.fileVersion=e.fileVersion}releaseFontData(){this.datas={},this.graphicData.clear()} /** * Catches dxf data into indexedDb */ // eslint-disable-next-line @typescript-eslint/no-explicit-any setFontDataToIndexedDb(){return __async(this,null,(function*(){const e=this.getFontFile();return new Promise(((t,r)=>{FontDataTable.instance().save(e,(()=>{console.log(`[FontFile] Saved '${this.url}' (${this.fileHeader}) to indexedDb`),t()}),(e=>r(`[FontFile] Failed to save '${this.url}' (${this.fileHeader}) to indexedDb! ${e}`)))}))}))}getFontDataByIndexedDb(){return __async(this,null,(function*(){return new Promise(((e,t)=>{FontDataTable.instance().query(this.url,(t=>{e(t)}),(()=>t("[FontFile] Failed to get FontData from IndexedDB")))}))}))}}; // src/core/shx-parser/ExtraLettersTemplate.ts function initTable(){const e=[[161,169,161,254],[176,247,161,254],[129,160,64,254],[170,254,64,160],[168,169,64,160],[170,175,161,254],[248,254,161,254],[161,167,64,160]],t=new Uint16Array(23940);let r=0;for(const[i,n,s,a]of e)for(let e=s;e<=a;e++)if(127!==e)for(let s=i;s<=n;s++)t[r++]=e<<8|s;const i=new TextDecoder("gbk").decode(t);for(table=new Uint16Array(65536),r=0;r>8}}return t.subarray(0,r)}var SIMPLIFIED_CHINESE_TABLE="啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸尽劲荆兢觉决诀绝均菌钧军君峻俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座锕嗳嫒瑷暧霭谙铵鹌媪骜鳌钯呗钣鸨龅鹎贲锛荜哔滗铋筚跸苄缏笾骠飑飙镖镳鳔傧缤槟殡膑镔髌鬓禀饽钹鹁钸骖黪恻锸侪钗冁谄谶蒇忏婵骣觇禅镡伥苌怅阊鲳砗伧谌榇碜龀枨柽铖铛饬鸱铳俦帱雠刍绌蹰钏怆缍鹑辍龊鹚苁骢枞辏撺锉鹾哒鞑骀绐殚赕瘅箪谠砀裆焘镫籴诋谛绨觌镝巅钿癫铫鲷鲽铤铥岽鸫窦渎椟牍笃黩簖怼镦炖趸铎谔垩阏轭锇锷鹗颚颛鳄诶迩铒鸸鲕钫鲂绯镄鲱偾沣凫驸绂绋赙麸鲋鳆钆赅尴擀绀戆睾诰缟锆纥镉颍亘赓绠鲠诟缑觏诂毂钴锢鸪鹄鹘鸹掴诖掼鹳鳏犷匦刿妫桧鲑鳜衮绲鲧埚呙帼椁蝈铪阚绗颉灏颢诃阖蛎黉讧荭闳鲎浒鹕骅桦铧奂缳锾鲩鳇诙荟哕浍缋珲晖诨馄阍钬镬讦诘荠叽哜骥玑觊齑矶羁虿跻霁鲚鲫郏浃铗镓蛲谏缣戋戬睑鹣笕鲣鞯绛缰挢峤鹪鲛疖颌鲒卺荩馑缙赆觐刭泾迳弪胫靓阄鸠鹫讵屦榉飓钜锔窭龃锩镌隽谲珏皲剀垲忾恺铠锴龛闶钪铐骒缂轲钶锞颔龈铿喾郐哙脍狯髋诓诳邝圹纩贶匮蒉愦聩篑阃锟鲲蛴崃徕涞濑赉睐铼癞籁岚榄斓镧褴阆锒唠崂铑铹痨鳓诔缧俪郦坜苈莅蓠呖逦骊缡枥栎轹砺锂鹂疠粝跞雳鲡鳢蔹奁潋琏殓裢裣鲢魉缭钌鹩蔺廪檩辚躏绫棂蛏鲮浏骝绺镏鹨茏泷珑栊胧砻偻蒌喽嵝镂瘘耧蝼髅垆撸噜闾泸渌栌橹轳辂辘氇胪鸬鹭舻鲈脔娈栾鸾銮囵荦猡泺椤脶镙榈褛锊呒唛嬷杩劢缦镘颡鳗麽扪焖懑钔芈谧猕祢渑腼黾缈缪闵缗谟蓦馍殁镆钼铙讷铌鲵辇鲶茑袅陧蘖嗫颟蹑苎咛聍侬哝驽钕傩讴怄瓯蹒疱辔纰罴铍谝骈缥嫔钋镤镨蕲骐绮桤碛颀颃鳍佥荨悭骞缱椠钤嫱樯戗炝锖锵镪羟跄诮谯荞缲硗跷惬锲箧锓揿鲭茕蛱巯赇虮鳅诎岖阒觑鸲诠绻辁铨阕阙悫荛娆桡饪轫嵘蝾缛铷颦蚬飒毵糁缫啬铯穑铩鲨酾讪姗骟钐鳝垧殇觞厍滠畲诜谂渖谥埘莳弑轼贳铈鲥绶摅纾闩铄厮驷缌锶鸶薮馊飕锼谡稣谇荪狲唢睃闼铊鳎钛鲐昙钽锬顸傥饧铴镗韬铽缇鹈阗粜龆鲦恸钭钍抟饨箨鼍娲腽纨绾辋诿帏闱沩涠玮韪炜鲔阌莴龌邬庑怃妩骛鹉鹜饩阋玺觋硖苋莶藓岘猃娴鹇痫蚝籼跹芗饷骧缃飨哓潇骁绡枭箫亵撷绁缬陉荥馐鸺诩顼谖铉镟谑泶鳕埙浔鲟垭娅桠氩厣赝俨兖谳恹闫酽魇餍鼹炀轺鹞鳐靥谒邺晔烨诒呓峄饴怿驿缢轶贻钇镒镱瘗舣铟瘾茔莺萦蓥撄嘤滢潆璎鹦瘿颏罂镛莸铕鱿伛俣谀谕蓣嵛饫阈妪纡觎欤钰鹆鹬龉橼鸢鼋钺郓芸恽愠纭韫殒氲瓒趱錾驵赜啧帻箦谮缯谵诏钊谪辄鹧浈缜桢轸赈祯鸩诤峥钲铮筝骘栉栀轵轾贽鸷蛳絷踬踯觯锺纣绉伫槠铢啭馔颞骓缒诼镯谘缁辎赀眦锱龇鲻偬诹驺鲰镞缵躜鳟讠谫郄勐凼坂垅垴埯埝苘荬荮莜莼菰藁揸吒吣咔咝咴噘噼嚯幞岙嵴彷徼犸狍馀馇馓馕愣憷懔丬溆滟溷漤潴澹甯纟绔绱珉枧桊桉槔橥轱轷赍肷胨飚煳煅熘愍淼砜磙眍钚钷铘铞锃锍锎锏锘锝锪锫锿镅镎镢镥镩镲稆鹋鹛鹱疬疴痖癯裥襁耢颥螨麴鲅鲆鲇鲞鲴鲺鲼鳊鳋鳘鳙鞒鞴齄",TRADITIONAL_CHINESE_TABLE="啊阿埃挨哎唉哀皚癌藹矮艾礙愛隘鞍氨安俺按暗岸胺案骯昂盎凹敖熬翺襖傲奧懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙壩霸罷爸白柏百擺佰敗拜稗斑班搬扳般頒板版扮拌伴瓣半辦絆邦幫梆榜膀綁棒磅蚌鎊傍謗苞胞包褒剝薄雹保堡飽寶抱報暴豹鮑爆杯碑悲卑北輩背貝鋇倍狽備憊焙被奔苯本笨崩繃甭泵蹦迸逼鼻比鄙筆彼碧蓖蔽畢斃毖幣庇痹閉敝弊必辟壁臂避陛鞭邊編貶扁便變卞辨辯辮遍標彪膘表鱉憋別癟彬斌瀕濱賓擯兵冰柄丙秉餅炳病並玻菠播撥缽波博勃搏鉑箔伯帛舶脖膊渤泊駁捕蔔哺補埠不布步簿部怖擦猜裁材才財睬踩采彩菜蔡餐參蠶殘慚慘燦蒼艙倉滄藏操糙槽曹草廁策側冊測層蹭插叉茬茶查碴搽察岔差詫拆柴豺攙摻蟬饞讒纏鏟產闡顫昌猖場嘗常長償腸廠敞暢唱倡超抄鈔朝嘲潮巢吵炒車扯撤掣徹澈郴臣辰塵晨忱沈陳趁襯撐稱城橙成呈乘程懲澄誠承逞騁秤吃癡持匙池遲弛馳恥齒侈尺赤翅斥熾充沖蟲崇寵抽酬疇躊稠愁籌仇綢瞅醜臭初出櫥廚躇鋤雛滁除楚礎儲矗搐觸處揣川穿椽傳船喘串瘡窗幢床闖創吹炊捶錘垂春椿醇唇淳純蠢戳綽疵茨磁雌辭慈瓷詞此刺賜次聰蔥囪匆從叢湊粗醋簇促躥篡竄摧崔催脆瘁粹淬翠村存寸磋撮搓措挫錯搭達答瘩打大呆歹傣戴帶殆代貸袋待逮怠耽擔丹單鄲撣膽旦氮但憚淡誕彈蛋當擋黨蕩檔刀搗蹈倒島禱導到稻悼道盜德得的蹬燈登等瞪凳鄧堤低滴迪敵笛狄滌翟嫡抵底地蒂第帝弟遞締顛掂滇碘點典靛墊電佃甸店惦奠澱殿碉叼雕雕刁掉吊釣調跌爹碟蝶叠諜疊丁盯叮釘頂鼎錠定訂丟東冬董懂動棟侗恫凍洞兜抖鬥陡豆逗痘都督毒犢獨讀堵睹賭杜鍍肚度渡妒端短鍛段斷緞堆兌隊對墩噸蹲敦頓囤鈍盾遁掇哆多奪垛躲朵跺舵剁惰墮蛾峨鵝俄額訛娥惡厄扼遏鄂餓恩而兒耳爾餌洱二貳發罰筏伐乏閥法琺藩帆番翻樊礬釩繁凡煩反返範販犯飯泛坊芳方肪房防妨仿訪紡放菲非啡飛肥匪誹吠肺廢沸費芬酚吩氛分紛墳焚汾粉奮份忿憤糞豐封楓蜂峰鋒風瘋烽逢馮縫諷奉鳳佛否夫敷膚孵扶拂輻幅氟符伏俘服浮涪福袱弗甫撫輔俯釜斧脯腑府腐赴副覆賦復傅付阜父腹負富訃附婦縛咐噶嘎該改概鈣蓋溉幹甘桿柑竿肝趕感稈敢贛岡剛鋼缸肛綱崗港杠篙臯高膏羔糕搞鎬稿告哥歌擱戈鴿胳疙割革葛格蛤閣隔鉻個各給根跟耕更庚羹埂耿梗工攻功恭龔供躬公宮弓鞏汞拱貢共鉤勾溝茍狗垢構購夠辜菇咕箍估沽孤姑鼓古蠱骨谷股故顧固雇刮瓜剮寡掛褂乖拐怪棺關官冠觀管館罐慣灌貫光廣逛瑰規圭矽歸龜閨軌鬼詭癸桂櫃跪貴劊輥滾棍鍋郭國果裹過哈骸孩海氦亥害駭酣憨邯韓含涵寒函喊罕翰撼捍旱憾悍焊汗漢夯杭航壕嚎豪毫郝好耗號浩呵喝荷菏核禾和何合盒貉閡河涸赫褐鶴賀嘿黑痕很狠恨哼亨橫衡恒轟哄烘虹鴻洪宏弘紅喉侯猴吼厚候後呼乎忽瑚壺葫胡蝴狐糊湖弧虎唬護互滬戶花嘩華猾滑畫劃化話槐徊懷淮壞歡環桓還緩換患喚瘓豢煥渙宦幻荒慌黃磺蝗簧皇凰惶煌晃幌恍謊灰揮輝徽恢蛔回毀悔慧卉惠晦賄穢會燴匯諱誨繪葷昏婚魂渾混豁活夥火獲或惑霍貨禍擊圾基機畸稽積箕肌饑跡激譏雞姬績緝吉極棘輯籍集及急疾汲即嫉級擠幾脊己薊技冀季伎祭劑悸濟寄寂計記既忌際繼紀嘉枷夾佳家加莢頰賈甲鉀假稼價架駕嫁殲監堅尖箋間煎兼肩艱奸緘繭檢柬堿鹼揀撿簡儉剪減薦檻鑒踐賤見鍵箭件健艦劍餞漸濺澗建僵姜將漿江疆蔣槳獎講匠醬降蕉椒礁焦膠交郊澆驕嬌嚼攪鉸矯僥腳狡角餃繳絞剿教酵轎較叫窖揭接皆稭街階截劫節莖睛晶鯨京驚精粳經井警景頸靜境敬鏡徑痙靖竟競凈炯窘揪究糾玖韭久灸九酒廄救舊臼舅咎就疚鞠拘狙疽居駒菊局咀矩舉沮聚拒據巨具距踞鋸俱句懼炬劇捐鵑娟倦眷卷絹撅攫抉掘倔爵桔傑捷睫竭潔結解姐戒藉芥界借介疥誡屆巾筋斤金今津襟緊錦僅謹進靳晉禁近燼浸盡勁荊兢覺決訣絕均菌鈞軍君峻俊竣浚郡駿喀咖卡咯開揩楷凱慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕顆科殼咳可渴克刻客課肯啃墾懇坑吭空恐孔控摳口扣寇枯哭窟苦酷庫褲誇垮挎跨胯塊筷儈快寬款匡筐狂框礦眶曠況虧盔巋窺葵奎魁傀饋愧潰坤昆捆困括擴廓闊垃拉喇蠟臘辣啦萊來賴藍婪欄攔籃闌蘭瀾讕攬覽懶纜爛濫瑯榔狼廊郎朗浪撈勞牢老佬姥酪烙澇勒樂雷鐳蕾磊累儡壘擂肋類淚棱楞冷厘梨犁黎籬貍離漓理李裏鯉禮莉荔吏栗麗厲勵礫歷利傈例俐痢立粒瀝隸力璃哩倆聯蓮連鐮廉憐漣簾斂臉鏈戀煉練糧涼梁粱良兩輛量晾亮諒撩聊僚療燎寥遼潦了撂鐐廖料列裂烈劣獵琳林磷霖臨鄰鱗淋凜賃吝拎玲菱零齡鈴伶羚淩靈陵嶺領另令溜琉榴硫餾留劉瘤流柳六龍聾嚨籠窿隆壟攏隴樓婁摟簍漏陋蘆盧顱廬爐擄鹵虜魯麓碌露路賂鹿潞祿錄陸戮驢呂鋁侶旅履屢縷慮氯律率濾綠巒攣孿灤卵亂掠略掄輪倫侖淪綸論蘿螺羅邏鑼籮騾裸落洛駱絡媽麻瑪碼螞馬罵嘛嗎埋買麥賣邁脈瞞饅蠻滿蔓曼慢漫謾芒茫盲氓忙莽貓茅錨毛矛鉚卯茂冒帽貌貿麽玫枚梅酶黴煤沒眉媒鎂每美昧寐妹媚門悶們萌蒙檬盟錳猛夢孟瞇醚靡糜迷謎彌米秘覓泌蜜密冪棉眠綿冕免勉娩緬面苗描瞄藐秒渺廟妙蔑滅民抿皿敏憫閩明螟鳴銘名命謬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌謀牟某拇牡畝姆母墓暮幕募慕木目睦牧穆拿哪吶鈉那娜納氖乃奶耐奈南男難囊撓腦惱鬧淖呢餒內嫩能妮霓倪泥尼擬妳匿膩逆溺蔫拈年碾攆撚念娘釀鳥尿捏聶孽嚙鑷鎳涅您檸獰凝寧擰濘牛扭鈕紐膿濃農弄奴努怒女暖虐瘧挪懦糯諾哦歐鷗毆藕嘔偶漚啪趴爬帕怕琶拍排牌徘湃派攀潘盤磐盼畔判叛乓龐旁耪胖拋咆刨炮袍跑泡呸胚培裴賠陪配佩沛噴盆砰抨烹澎彭蓬棚硼篷膨朋鵬捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片騙飄漂瓢票撇瞥拼頻貧品聘乒坪蘋萍平憑瓶評屏坡潑頗婆破魄迫粕剖撲鋪仆莆葡菩蒲埔樸圃普浦譜曝瀑期欺棲戚妻七淒漆柒沏其棋奇歧畦崎臍齊旗祈祁騎起豈乞企啟契砌器氣迄棄汽泣訖掐洽牽扡釬鉛千遷簽仟謙乾黔錢鉗前潛遣淺譴塹嵌欠歉槍嗆腔羌墻薔強搶橇鍬敲悄橋瞧喬僑巧鞘撬翹峭俏竅切茄且怯竊欽侵親秦琴勤芹擒禽寢沁青輕氫傾卿清擎晴氰情頃請慶瓊窮秋丘邱球求囚酋泅趨區蛆曲軀屈驅渠取娶齲趣去圈顴權醛泉全痊拳犬券勸缺炔瘸卻鵲榷確雀裙群然燃冉染瓤壤攘嚷讓饒擾繞惹熱壬仁人忍韌任認刃妊紉扔仍日戎茸蓉榮融熔溶容絨冗揉柔肉茹蠕儒孺如辱乳汝入褥軟阮蕊瑞銳閏潤若弱撒灑薩腮鰓塞賽三三傘散桑嗓喪搔騷掃嫂瑟色澀森僧莎砂殺剎沙紗傻啥煞篩曬珊苫杉山刪煽衫閃陜擅贍膳善汕扇繕墑傷商賞晌上尚裳梢捎稍燒芍勺韶少哨邵紹奢賒蛇舌舍赦攝射懾涉社設砷申呻伸身深娠紳神沈審嬸甚腎慎滲聲生甥牲升繩省盛剩勝聖師失獅施濕詩屍虱十石拾時什食蝕實識史矢使屎駛始式示士世柿事拭誓逝勢是嗜噬適仕侍釋飾氏市恃室視試收手首守壽授售受瘦獸蔬樞梳殊抒輸叔舒淑疏書贖孰熟薯暑曙署蜀黍鼠屬術述樹束戍豎墅庶數漱恕刷耍摔衰甩帥栓拴霜雙爽誰水睡稅吮瞬順舜說碩朔爍斯撕嘶思私司絲死肆寺嗣四伺似飼巳松聳慫頌送宋訟誦搜艘擻嗽蘇酥俗素速粟僳塑溯宿訴肅酸蒜算雖隋隨綏髓碎歲穗遂隧祟孫損筍蓑梭唆縮瑣索鎖所塌他它她塔獺撻蹋踏胎苔擡臺泰酞太態汰坍攤貪癱灘壇檀痰潭譚談坦毯袒碳探嘆炭湯塘搪堂棠膛唐糖倘躺淌趟燙掏濤滔絳萄桃逃淘陶討套特藤騰疼謄梯剔踢銻提題蹄啼體替嚏惕涕剃屜天添填田甜恬舔腆挑條迢眺跳貼鐵帖廳聽烴汀廷停亭庭挺艇通桐酮瞳同銅彤童桶捅筒統痛偷投頭透凸禿突圖徒途塗屠土吐兔湍團推頹腿蛻褪退吞屯臀拖托脫鴕陀馱駝橢妥拓唾挖哇蛙窪娃瓦襪歪外豌彎灣玩頑丸烷完碗挽晚皖惋宛婉萬腕汪王亡枉網往旺望忘妄威巍微危韋違桅圍唯惟為濰維葦萎委偉偽尾緯未蔚味畏胃餵魏位渭謂尉慰衛瘟溫蚊文聞紋吻穩紊問嗡翁甕撾蝸渦窩我斡臥握沃巫嗚鎢烏汙誣屋無蕪梧吾吳毋武五捂午舞伍侮塢戊霧晤物勿務悟誤昔熙析西硒矽晰嘻吸錫犧稀息希悉膝夕惜熄烯溪汐犀檄襲席習媳喜銑洗系隙戲細瞎蝦匣霞轄暇峽俠狹下廈夏嚇掀鍁先仙鮮纖鹹賢銜舷閑涎弦嫌顯險現獻縣腺餡羨憲陷限線相廂鑲香箱襄湘鄉翔祥詳想響享項巷橡像向象蕭硝霄削哮囂銷消宵淆曉小孝校肖嘯笑效楔些歇蠍鞋協挾攜邪斜脅諧寫械卸蟹懈泄瀉謝屑薪芯鋅欣辛新忻心信釁星腥猩惺興刑型形邢行醒幸杏性姓兄兇胸匈洶雄熊休修羞朽嗅銹秀袖繡墟戌需虛噓須徐許蓄酗敘旭序畜恤絮婿緒續軒喧宣懸旋玄選癬眩絢靴薛學穴雪血勛熏循旬詢尋馴巡殉汛訓訊遜迅壓押鴉鴨呀丫芽牙蚜崖衙涯雅啞亞訝焉咽閹煙淹鹽嚴研蜒巖延言顏閻炎沿奄掩眼衍演艷堰燕厭硯雁唁彥焰宴諺驗殃央鴦秧楊揚佯瘍羊洋陽氧仰癢養樣漾邀腰妖瑤搖堯遙窯謠姚咬舀藥要耀椰噎耶爺野冶也頁掖業葉曳腋夜液壹壹醫揖銥依伊衣頤夷遺移儀胰疑沂宜姨彜椅蟻倚已乙矣以藝抑易邑屹億役臆逸肄疫亦裔意毅憶義益溢詣議誼譯異翼翌繹茵蔭因殷音陰姻吟銀淫寅飲尹引隱印英櫻嬰鷹應纓瑩螢營熒蠅迎贏盈影穎硬映喲擁傭臃癰庸雍踴蛹詠泳湧永恿勇用幽優悠憂尤由郵鈾猶油遊酉有友右佑釉誘又幼迂淤於盂榆虞愚輿余俞逾魚愉渝漁隅予娛雨與嶼禹宇語羽玉域芋郁籲遇喻峪禦愈欲獄育譽浴寓裕預豫馭鴛淵冤元垣袁原援轅園員圓猿源緣遠苑願怨院曰約越躍鑰嶽粵月悅閱耘雲鄖勻隕允運蘊醞暈韻孕匝砸雜栽哉災宰載再在咱攢暫贊贓臟葬遭糟鑿藻棗早澡蚤躁噪造皂竈燥責擇則澤賊怎增憎曾贈紮喳渣劄軋鍘閘眨柵榨咋乍炸詐摘齋宅窄債寨瞻氈詹粘沾盞斬輾嶄展蘸棧占戰站湛綻樟章彰漳張掌漲杖丈帳賬仗脹瘴障招昭找沼趙照罩兆肇召遮折哲蟄轍者鍺蔗這浙珍斟真甄砧臻貞針偵枕疹診震振鎮陣蒸掙睜征猙爭怔整拯正政幀癥鄭證芝枝支吱蜘知肢脂汁之織職直植殖執值侄址指止趾只旨紙誌摯擲至致置幟峙制智秩稚質炙痔滯治窒中盅忠鐘衷終種腫重仲眾舟周州洲謅粥軸肘帚咒皺宙晝驟珠株蛛朱豬諸誅逐竹燭煮拄矚囑主著柱助蛀貯鑄築住註祝駐抓爪拽專磚轉撰賺篆樁莊裝妝撞壯狀椎錐追贅墜綴諄準捉拙卓桌琢茁酌啄著灼濁茲咨資姿滋淄孜紫仔籽滓子自漬字鬃棕蹤宗綜總縱鄒走奏揍租足卒族祖詛阻組鉆纂嘴醉最罪尊遵昨左佐柞做作坐座錒噯嬡璦曖靄諳銨鵪媼驁鰲鈀唄鈑鴇齙鵯賁錛蓽嗶潷鉍篳蹕芐緶籩驃颮飆鏢鑣鰾儐繽檳殯臏鑌髕鬢稟餑鈸鵓鈽驂黲惻鍤儕釵囅諂讖蕆懺嬋驏覘禪鐔倀萇悵閶鯧硨傖諶櫬磣齔棖檉鋮鐺飭鴟銃儔幬讎芻絀躕釧愴綞鶉輟齪鶿蓯驄樅輳攛銼鹺噠韃駘紿殫賧癉簞讜碭襠燾鐙糴詆諦綈覿鏑巔鈿癲銚鯛鰈鋌銩崠鶇竇瀆櫝牘篤黷籪懟鐓燉躉鐸諤堊閼軛鋨鍔鶚顎顓鱷誒邇鉺鴯鮞鈁魴緋鐨鯡僨灃鳧駙紱紼賻麩鮒鰒釓賅尷搟紺戇睪誥縞鋯紇鎘潁亙賡綆鯁詬緱覯詁轂鈷錮鴣鵠鶻鴰摑詿摜鸛鰥獷匭劌媯檜鮭鱖袞緄鯀堝咼幗槨蟈鉿闞絎頡灝顥訶闔蠣黌訌葒閎鱟滸鶘驊樺鏵奐繯鍰鯇鰉詼薈噦澮繢琿暉諢餛閽鈥鑊訐詰薺嘰嚌驥璣覬齏磯羈蠆躋霽鱭鯽郟浹鋏鎵蟯諫縑戔戩瞼鶼筧鰹韉絳韁撟嶠鷦鮫癤頜鮚巹藎饉縉贐覲剄涇逕弳脛靚鬮鳩鷲詎屨櫸颶鉅鋦窶齟錈鐫雋譎玨皸剴塏愾愷鎧鍇龕閌鈧銬騍緙軻鈳錁頷齦鏗嚳鄶噲膾獪髖誆誑鄺壙纊貺匱蕢憒聵簣閫錕鯤蠐崍徠淶瀨賚睞錸癩籟嵐欖斕鑭襤閬鋃嘮嶗銠鐒癆鰳誄縲儷酈壢藶蒞蘺嚦邐驪縭櫪櫟轢礪鋰鸝癘糲躒靂鱺鱧蘞奩瀲璉殮褳襝鰱魎繚釕鷯藺廩檁轔躪綾欞蟶鯪瀏騮綹鎦鷚蘢瀧瓏櫳朧礱僂蔞嘍嶁鏤瘺耬螻髏壚擼嚕閭瀘淥櫨櫓轤輅轆氌臚鸕鷺艫鱸臠孌欒鸞鑾圇犖玀濼欏腡鏍櫚褸鋝嘸嘜嬤榪勱縵鏝顙鰻麼捫燜懣鍆羋謐獼禰澠靦黽緲繆閔緡謨驀饃歿鏌鉬鐃訥鈮鯢輦鯰蔦裊隉蘗囁顢躡苧嚀聹儂噥駑釹儺謳慪甌蹣皰轡紕羆鈹諞駢縹嬪釙鏷鐠蘄騏綺榿磧頎頏鰭僉蕁慳騫繾槧鈐嬙檣戧熗錆鏘鏹羥蹌誚譙蕎繰磽蹺愜鍥篋鋟撳鯖煢蛺巰賕蟣鰍詘嶇闃覷鴝詮綣輇銓闋闕愨蕘嬈橈飪軔嶸蠑縟銣顰蜆颯毿糝繅嗇銫穡鎩鯊釃訕姍騸釤鱔坰殤觴厙灄畬詵諗瀋謚塒蒔弒軾貰鈰鰣綬攄紓閂鑠廝駟緦鍶鷥藪餿颼鎪謖穌誶蓀猻嗩脧闥鉈鰨鈦鮐曇鉭錟頇儻餳鐋鏜韜鋱緹鵜闐糶齠鰷慟鈄釷摶飩籜鼉媧膃紈綰輞諉幃闈溈潿瑋韙煒鮪閿萵齷鄔廡憮嫵騖鵡鶩餼鬩璽覡硤莧薟蘚峴獫嫻鷴癇蠔秈躚薌餉驤緗饗嘵瀟驍綃梟簫褻擷紲纈陘滎饈鵂詡頊諼鉉鏇謔澩鱈塤潯鱘埡婭椏氬厴贗儼兗讞懨閆釅魘饜鼴煬軺鷂鰩靨謁鄴曄燁詒囈嶧飴懌驛縊軼貽釔鎰鐿瘞艤銦癮塋鶯縈鎣攖嚶瀅瀠瓔鸚癭頦罌鏞蕕銪魷傴俁諛諭蕷崳飫閾嫗紆覦歟鈺鵒鷸齬櫞鳶黿鉞鄆蕓惲慍紜韞殞氳瓚趲鏨駔賾嘖幘簀譖繒譫詔釗謫輒鷓湞縝楨軫賑禎鴆諍崢鉦錚箏騭櫛梔軹輊贄鷙螄縶躓躑觶鍾紂縐佇櫧銖囀饌顳騅縋諑鐲諮緇輜貲眥錙齜鯔傯諏騶鯫鏃纘躦鱒訁譾郤猛氹阪壟堖垵墊檾蕒葤蓧蒓菇槁摣咤唚哢噝噅撅劈謔襆嶴脊仿僥獁麅餘餷饊饢楞怵懍爿漵灩混濫瀦淡寧糸絝緔瑉梘棬案橰櫫軲軤賫膁腖飈糊煆溜湣渺碸滾瞘鈈鉕鋣銱鋥鋶鐦鐧鍩鍀鍃錇鎄鎇鎿鐝鑥鑹鑔穭鶓鶥鸌癧屙瘂臒襇繈耮顬蟎麯鮁鮃鮎鯗鯝鯴鱝鯿鰠鰵鱅鞽韝齇";function traditionalChineseToSimpliled(e){return SIMPLIFIED_CHINESE_TABLE.charAt(TRADITIONAL_CHINESE_TABLE.indexOf(e.charAt(0)))}var reg=new RegExp("[一-龥]+");function isTraditionalChinese(e){return TRADITIONAL_CHINESE_TABLE.includes(e)} // src/core/shx-parser/util/BitConverter.ts var BitConverter=class{static GetBytes(e){switch(typeof e){case"string":{const t=new Uint16Array(e.length);for(let r=0;r4294967295?((t=new Float64Array(1))[0]=e,new Uint8Array(t.buffer)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Int32Array(1)):function(t){return t[0]=e,new Uint8Array(t.buffer)}(new Float64Array(1));case"boolean":return function(t){return t[0]=Number(e),t}(new Uint8Array(1));default:if(e instanceof Array){const t=[];for(let r=0;re.length&&(r-=t);let i="";for(let n=0;ne.length&&(r-=t);const i=new Uint8Array(r);for(let n=0;n1&&(n.push(s.slice()),s=[]);break;case 3:l++,r/=t[l];break;case 4:l++,r*=t[l];break;case 5:if(4===a.length)throw"The position stack is only four locations deep";a.push(i);break;case 6:i=a.pop(),s.length>1&&(n.push(s.slice()),s=[]),o&&s.push(i.clone());break;case 7:{let a,o=0,c=r*e.baseUp;const u=i.clone();switch(s.length>1&&(n.push(s.slice()),s=[]),e.type){case 0/* Shapes */:l++,o=t[l];break;case 1/* Bigfont */:if(l++,o=t[l],0==o){l++,o=BitConverter.ToUInt16(new Uint8Array([t[l++],t[l++]]),0),u.x=t[l++]*r,u.y=t[l++]*r;c=t[l]*r}break;case 2/* Unifont */:l+=2,o=BitConverter.ToUInt16(new Uint8Array([t[l-1],t[l]]),0)}0!==o&&(a=e.getGraphicTextShape(o,c,u),a&&(n.push(...a.polyLines.slice()),i=a.lastPoint.clone()))}break;case 8:{const e=new Vector2;e.x=BitConverter.byteTosbyte(t[++l]),e.y=BitConverter.byteTosbyte(t[++l]),i.add(e.multiplyScalar(r)),o&&s.push(i.clone())}break;case 9:{const e=!0;for(;e;){const e=new Vector2;if(e.x=BitConverter.byteTosbyte(t[++l]),e.y=BitConverter.byteTosbyte(t[++l]),0==e.x&&0==e.y)break;i.add(e.multiplyScalar(r)),o&&s.push(i.clone())}}break;case 10:{const e=t[++l]*r,n=BitConverter.byteTosbyte(t[++l]),a=(112&n)>>4;let c=7&n;0==c&&(c=8);const u=Math.PI/4;let h=u*c,p=_ShxParser.CICLESPAN;n<0&&(p=-p,h=-h);const d=u*a,m=d+h,f=i.clone().sub(new Vector2(Math.cos(d)*e,Math.sin(d)*e));if(i=f.clone().add(new Vector2(Math.cos(m)*e,Math.sin(m)*e)),o){let t=d;const r=!0;for(;r&&(t+=p,n>=0&&tm);)s.push(f.clone().add(new Vector2(e*Math.cos(t),e*Math.sin(t))));s.push(i.clone())}}break;case 11:{const e=t[++l],n=t[++l],a=(255*t[++l]+t[++l])*r,c=BitConverter.byteTosbyte(t[++l]),u=(112&c)>>4;let h=7&c;0==h&&(h=8),0!=n&&h--;const p=Math.PI/4;let d=p*h,m=_ShxParser.CICLESPAN,f=1;c<0&&(m=-m,d=-d,f=-1);let g=p*u,_=g+d;g+=p*e/256*f,_+=p*n/256*f;const y=i.clone().sub(new Vector2(a*Math.cos(g),a*Math.sin(g)));if(i=y.clone().add(new Vector2(a*Math.cos(_),a*Math.sin(_))),o){let e=g;const t=!0;for(;t&&(e+=m,c>0&&e<_||c<0&&e>_);)s.push(y.clone().add(new Vector2(a*Math.cos(e),a*Math.sin(e))));s.push(i.clone())}}break;case 12:{const e=new Vector2;e.x=BitConverter.byteTosbyte(t[++l])*r,e.y=BitConverter.byteTosbyte(t[++l])*r;let n=BitConverter.byteTosbyte(t[++l]);n<-127&&(n=-127),o&&(0==n?s.push(i.clone().add(e)):s.push(_ShxParser._generateArcPoints(i,e,n/127))),i.add(e)}break;case 13:{const e=!0;for(;e;){const e=new Vector2;if(e.x=BitConverter.byteTosbyte(t[++l])*r,e.y=BitConverter.byteTosbyte(t[++l])*r,0==e.x&&0==e.y)break;let n=BitConverter.byteTosbyte(t[++l]);n<-127&&(n=-127),o&&(0==n?s.push(i.clone().add(e)):s.push(_ShxParser._generateArcPoints(i.clone(),e,n/127))),i.add(e)}}break;case 14:l=_ShxParser.skipCode(e,t,++l);break;default:if(c>15){const e=(240&c)>>4,t=15&c,n=new Vector2;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}i.add(n.multiplyScalar(e*r)),o&&s.push(i.clone())}}}return new TextShape(i,n)}static skipCode(e,t,r){switch(t[r]){case 0:case 1:case 2:case 5:case 6:case 14:default:break;case 3:case 4:r++;break;case 7:switch(e.type){case 0/* Shapes */:r++;break;case 1/* Bigfont */:0==t[++r]&&(r+=6);break;case 2/* Unifont */:r+=2}break;case 8:case 10:r+=2;break;case 9:{const e=!0;for(;e;){const e=t[++r],i=t[++r];if(0==e&&0==i)break}}break;case 11:r+=5;break;case 12:r+=3;break;case 13:{const e=!0;for(;e;){const e=t[++r],i=t[++r];if(0==e&&0==i)break;t[++r]}}}return r}static _generateArcPoints(e,t,r){const i=e.clone().add(t),n=r<0;r=Math.abs(r);const s=t.length()/2,a=s*r,o=2*Math.atan(1/r),l=new Vector2(t.y,-t.x);l.normalize(),l.multiplyScalar(a);const c=Math.abs(s/Math.sin(o/2)),u=e.add(t.divideScalar(2));!1!==n?u.add(l):u.sub(l);const h=e.sub(u),p=i.sub(u);let d=Math.atan2(h.y,h.x);const m=Math.atan2(p.y,p.x);let f=_ShxParser.CICLESPAN;n?(f=-f,dm&&(d-=2*Math.PI);let g=d;for(;;){if(g+=f,!n&&gm)return u.add(new Vector2(c*Math.cos(g),c*Math.sin(g)));break}return i}},ShxParser=_ShxParser; // src/core/shx-parser/ShxParser.ts ShxParser.stopFlag="0x00",ShxParser.FILE_STOP_FLAG=["\r","\n",""], //0x0d, 0x0a, 0x1a ShxParser.CICLESPAN=Math.PI/18; // src/core/shx-parser/files/BigFontFile.ts var BigFontFile=class extends FontFile{constructor(e){super(e),this.isExtend=!1,this.type=1/* Bigfont */}init(e){BitConverter.ToInt16(e.readBytes(2),0);const t=BitConverter.ToInt16(e.readBytes(2),0),r=BitConverter.ToInt16(e.readBytes(2),0);for(let t=0;t>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(i);break;case 12:case 13:n=e[r++],t+=String.fromCharCode((31&i)<<6|63&n);break;case 14:n=e[r++],s=e[r++],t+=String.fromCharCode((15&i)<<12|(63&n)<<6|(63&s)<<0)}return t} // src/core/shx-parser/files/ShapeFontFile.ts var ShapeFontFile=class extends FontFile{constructor(e){super(e),this.type=0/* Shapes */}init(e){e.readBytes(2),e.readBytes(2);const t=BitConverter.ToInt16(e.readBytes(2),0),r=[];for(let i=0;is){h?(u+=p.width+n,h=!1):(h=!0,u=0,c-=i+r),tempVec22.set(u,c);const e=p.offset(tempVec22);o.push(e),!h&&(u+=p.width+n)}else{tempVec22.set(u,c);const e=p.offset(tempVec22);o.push(e),u+=p.width+n}else this.addUnsupportedChar(l)}h=!1,u=0,c-=i+r}return o}getNotFoundTextShape(e){const t=ShxParser.getCode("?");return this.getGraphicDataByCode(t,e)} /** * * @param str * @param size * @param lineHeight * @param lineSpace * @param wordSpace * @returns * @describe override methods */generateShapes(e,t=_ShxFont.DEFAULT_SIZE,r=0,i=0,n=0){return this.getGraphicData(e,t,r,i,n)} /** * Just for log usage */addUnsupportedChar(e){this.unsupportedChars[e]||(this.unsupportedChars[e]=0),this.unsupportedChars[e]++}static checkFontIsLoaded(e){return __async(this,null,(function*(){let t=!1;const r=yield FontDataTable.instance().queryAll();if(r.length!==e.length)return!1;for(let i=0;ie.setFontDataToIndexedDb()));return yield Promise.all(e).then((()=>{log.debug("[ShxFont] Saves font data to IndexDB")}))}))}getFontData(){return __async(this,null,(function*(){const e=yield FontDataTable.instance().queryAll(),t=[],r=new Map;for(let i=0;i\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 \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 ShaderMaterial({uniforms:n,vertexShader: /*glsl*/ "\n varying vec3 v_pos;\n\n #include \n void main() {\n //vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n v_pos = position;\n\n #include \n #include \n #include \n }",fragmentShader:s,clipping:!0})} // src/core/dxf/LinePatternShaders.ts ShxFont.DEFAULT_SIZE=12;var LinePatternShaders=class{ /** * Creates line shader by given pattern. * Note: remember to call line.computeLineDistances() in order to make it work! */ static createLineShaderMaterial(e,t,r,i,n){let s=0;const a=[];for(let t=0;t\n\n vec2 getWorldScale() {\n return vec2(length(modelMatrix[0].xyz), length(modelMatrix[1].xyz));\n }\n\n void main() {\n\n #include \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 ShaderMaterial({uniforms:o,vertexShader: /*glsl*/ "\n attribute float lineDistance;\n varying float vLineDistance;\n\n #include \n\n void main() {\n vLineDistance = lineDistance;\n\n #include \n #include \n #include \n }",fragmentShader:l,clipping:!0})}},round10_default=(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)))),bspline_default=(e,t,r,i,n)=>{const s=r.length,a=r[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(i){if(i.length!==s+t+1)throw new Error("bad knot vector length")}else{i=[];for(let e=0;e=i[u]&&e<=i[u+1]);u++);const h=[];for(let e=0;eu-t-1+r;n--){p=(e-i[n])/(i[n+t+1-r]-i[n]);for(let e=0;e{e=e.replace(/%%(.)/g,((e,t)=>dxfTextControlCodeSymbolMap[t]||t));const r=null==t?void 0:t.encoding;let i,n=r instanceof TextDecoder?r:void 0,s="";const a=[],o=e=>{s&&(a.push(s),s=""),a.push(e)};for(let t=0;t(e=decodeDxfTextUnicodeCodePoints(e),t?decodeDxfTextMbcsCharacterCodes(e,t):e),decodeDxfTextUnicodeCodePoints=e=>e.replace(/\\[uU]\+([0-9a-fA-F]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))),decodeDxfTextMbcsCharacterCodes=(e,t)=>{let r=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,i,n)=>(r=r||new TextDecoder(t)).decode(new Uint8Array([parseInt(i,16),parseInt(n,16)]))))},parseDxfTextContent=(e,t)=>{let r=0,i={text:""};const n=[i],s=(e=decodeDxfTextCharacterCodes(e,null==t?void 0:t.encoding)).matchAll(/%%(\d\d\d|.)/g);for(const t of s){i.text+=e.slice(r,t.index);const s=t[1].toLowerCase(),a=dxfTextControlCodeSymbolMap2[s];a?i.text+=a:3===s.length?i.text+=String.fromCodePoint(+s):"k"===s||"o"===s||"u"===s?(i=__spreadProps(__spreadValues({},i),{text:""}),i[s]?delete i[s]:i[s]=1,n.push(i)):i.text+=s,r=t.index+t[0].length}return i.text+=e.slice(r),n.filter((e=>e.text))},XAxis=new Vector3(1,0,0),YAxis=new Vector3(0,1,0),ZAxis=new Vector3(0,0,1),Origin=new Vector3(0,0,0),Default_Color=0,Default_LineType="CONTINUOUS",Default_PointMaterial=new PointsMaterial({color:Default_Color}),Default_LineMaterial=new LineBasicMaterial({color:Default_Color}),Default_MeshMaterial=new MeshBasicMaterial({color:Default_Color}),scaleTempMatrix=new Matrix4,translateTempMatrix=new Matrix4,tempMatrix3=new Matrix4,tempVector2=new Vector3,tempVector22=new Vector3,tempVec23=new Vector2,tempQuaternion=new Quaternion,isIViewport=e=>void 0!==e.viewDirectionFromTarget,decodeDataUri=e=>{if(e){const t=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);if(t&&t.length>0){const r=t[1],i=e.replace("data:"+r+";","").split(",");if(i&&2===i.length&&"base64"===i[0]){const e=i[1];return gBase64.decode(e)}}}return null},THREEx={Math:{}}; // src/core/dxf/round10.ts THREEx.Math.angle2=function(e,t){const r=new Vector2(e.x,e.y),i=new Vector2(t.x,t.y);return i.sub(r),i.normalize(),i.y<0?-Math.acos(i.x):Math.acos(i.x)},THREEx.Math.polar=function(e,t,r){return{x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}};var getBulgeCurvePoints=(e,t,r,i)=>{const n=e?new Vector2(e.x,e.y):new Vector2(0,0),s=t?new Vector2(t.x,t.y):new Vector2(1,0);r=r||1;const a=4*Math.atan(r),o=n.distanceTo(s)/2/Math.sin(a/2),l=THREEx.Math.polar(e,o,THREEx.Math.angle2(n,s)+(Math.PI/2-a/2));i=i||Math.max(Math.abs(Math.ceil(a/(Math.PI/18))),6);const c=THREEx.Math.angle2(l,n),u=a/i,h=[];h.push(new Vector3(n.x,n.y,0));for(let e=1;e<=i-1;e++){const t=THREEx.Math.polar(l,Math.abs(o),c+u*e);h.push(new Vector3(t.x,t.y,0))}return h},getLinePoints=(e,t=!1)=>{const r=[],i=e.length;for(let n=0;n{const t=[];return e.faceA&&t.push(e.faceA),e.faceB&&t.push(e.faceB),e.faceC&&t.push(e.faceC),e.faceD&&t.push(e.faceD),t},getPolyfaceMeshPoints=e=>{const t=[],r=[];e.forEach((e=>{e.polyfaceMeshVertex&&(e.threeDPolylineMesh?t.push(new Vector3(e.x,e.y,e.z)):r.push(getFaceIndex(e)))}));const i=[];for(let e=0;e=t.length||r<0){a=!1;break}s.push(t[r])}a&&0!==s.length&&(s.push(s[0]),i.push(s))}return i},_DXFLoader=class extends Loader{ /** * @param ignorePaperSpace if true, only load model space */ constructor(e=!1,t=!0){super(),this.timer=Date.now(),this.ignorePaperSpace=!1,this.angBase=0,this.angDir=0,this.header=void 0, // for better performance, let's instantiate materials as much as possible this.pointsMaterials={},this.lineBasicMaterials={},this.lineShaderMaterials={}, // key: `${linePattern}_${color}_${lineTypeScale}` this.meshBasicMaterials={},this.meshTextureMaterials={}, // for ole this.hatchShaderMaterials=[],this.entityCount=0, // count circle/arc/ellipse, etc. save their average size, so we can intelligently // adjust curve division. this.curveCount=0,this.averageCurveSize=0,this.enableRenderOrder=!1, // enable to render order, TODO: There are still problems, use it with caution this.enableLocalCache=!0, // enable to cache data into indexedDb this.enableReleaseData=!0, // enable to release data this.enableMerge=!0, // enable to merge this.enableSimplify=!0, // enable to simplify polyline/polygon this.enableRTC=!0, // enable to offset relative to center this.enableWidthLine=!1, // enable to render width line this.dxfDataId=void 0, // Indicates the modelId passed in from the outside /** * Use a context in order to easily know if it is compare mode, * and, get compare result from it. */ this.compareContext=void 0, // private scale = 1.0; this.statsInfo={unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0},this.blockReferencesCache={}, /** * Adds this data member just in order to improve the performence of getLayoutName. * Its key is blockrecord's handle, value is its layoutHandle. */ this.blockRecordsCache=void 0, /** * Adds this data member just in order to improve the performence of getLayoutName. * Its key is entity's handle, value is itself. */ this.entitiesCache=void 0, /** * Adds this data member just in order to improve the performence of getBlockByHandle. * Its key is block's ownerHandle, value is IBlock. */ this.blocksCache=void 0, /** * Adds this in order to improve performance of findSpatialFilterByHandle. * Key is dictionaryObject's ownerHandle(entity's handle), value is spatial filter's ownerHandle */ this.dictionaryOwnerHandleAndSpatialFilterHandlesCache=void 0, /** * Adds this in order to improve performance of findSpatialFilterByHandle. * Key is ISpatialFilterObject's ownerHandle, value is ISpatialFilterObject */ this.spatialFiltersCache=void 0, /** * Adds this in order to improve performance of creating threejs object * Key is entity's handle, value is threejs object. */ this.entityThreejsCache=void 0,this.entityTypesAndTimes=void 0, // put these objects into "layerForNonSnapableObjects" layer, so they won't be osnap-able. this.nonSnapableTypes=new Set(["ATTDEF","ATTRIB","LEADER","MTEXT","MULTILEADER","OLE2FRAME","TEXT"]), // the former one has bigger render order, thus will be cover later ones. // This list should contain all entity handlers, ordered by the value of handle by default. // The list should be adjusted according to "SORTENTSTABLE". this.entityHandlesWithRenderOrder={},this.addViewport=(e,t)=>{if("VIEWPORT"===e.type){t[e.ownerHandle]||(t[e.ownerHandle]=[]);const r=e;t[e.ownerHandle].push(r)}},_DXFLoader.abortJobs=!1,this.ignorePaperSpace=e,this.enableLocalCache=t,this.pointsMaterials[Default_Color]=Default_PointMaterial,this.lineBasicMaterials[Default_Color]=Default_LineMaterial,this.meshBasicMaterials[Default_Color]=Default_MeshMaterial}setFont(e){return this.font=e,this} /** * Downloads dxf file content */download(e,t){return __async(this,null,(function*(){let r=decodeDataUri(e);if(!r){const i=Date.now(),n=new FileLoader(this.manager);n.setResponseType("arraybuffer"),n.setPath(this.path),r=yield n.loadAsync(e,t),log.info(`[DxfLoader] ${e} dxf file downloaded in ${(Date.now()-i)/1e3}s`)}return r}))}load(e,t,r){return __async(this,null,(function*(){return this.enableLocalCache&&t&&(t=t.trim()).length>0&&(this.dxfDataId=t),this.loadAsync(e,r)}))} /** * Loads dxf asynchronously. It mainly contains 2 steps: * 1. parses file content * 2. generates/load threejs objects * @param url url of the dxf file * @param onProgress on progress callback */loadAsync(e,t){return __async(this,null,(function*(){const r=(e,r,i)=>{let n=100*e.loaded/e.total;n=n*(i-r)/100+r,t&&t(new ProgressEvent(e.type,{loaded:n,total:100}))},i=e=>r(e,10,100);if(this.enableLocalCache&&this.dxfDataId){let e;try{if(this.timer=Date.now(),e=yield this.getDxfDataFromIndexedDb(this.dxfDataId),e){log.info(`[DxfLoader] Loaded DxfData from indexedDb in ${(Date.now()-this.timer)/1e3}s`);const t=yield this.loadEntities(e,i);return Promise.resolve(t)}}catch(e){log.warn("[DxfLoader] Failed to parse data from indexedDb",e)}}const n=yield this.parse(e,(e=>r(e,0,50)));return yield this.loadEntities(n,(e=>r(e,50,100)))}))} /** * Parses dxf contents */parse(e,t){return __async(this,null,(function*(){const r=e=>{t&&t(new ProgressEvent("",{loaded:e,total:100}))},i=yield this.download(e,(e=>((e,r,i)=>{let n=100*e.loaded/e.total;n=n*(i-r)/100+r,n>i&&(log.warn("[DxfLoader] Invalid ProgressEvent:",e),n=i),t&&t(new ProgressEvent(e.type,{loaded:n,total:100}))})(e,0,40)));if(!i)return Promise.reject(`[DxfLoader] Failed to download ${e}`);if(_DXFLoader.abortJobs)return Promise.reject("[DXFLoader] Job aborted");this.timer=Date.now(),log.info("[DxfLoader] Start parsing...");const n=(new DxfParser).parseSync(i);if(r(80),log.info(`[DxfLoader] Parsed in ${(Date.now()-this.timer)/1e3}s, creating entities...`),_DXFLoader.abortJobs)return Promise.reject("[DXFLoader] Job aborted");if(n&&(n.objects.LAYOUT||(log.warn("[DxfLoader] No layout defined! Will add a default 'Model' layout!"),n.objects.LAYOUT=[{layoutName:_DXFLoader.MODEL_LAYOUT_NAME}]),this.enableLocalCache&&this.dxfDataId)){const e=Date.now();try{yield this.setDxfDataToIndexedDb(this.dxfDataId,n),log.info(`[DxfLoader] Saved to indexedDb in ${(Date.now()-e)/1e3}s`)}catch(e){log.warn(`[DxfLoader] Failed to save '${this.dxfDataId}' to indexedDb!`,e)}}return r(100),n}))}parseHeader(e){if(!e)return void log.error("[DxfLoader]: Invalid header!");this.header=e;const t=e.$ACADVER.toString();"AC1032"!==t&&log.warn(`[DxfLoader] Unexpected version: ${t}. But we'll try to continue.`),this.angBase=e.$ANGBASE||0,this.angDir=e.$ANGDIR||0} /** * Generates/load threejs objects according to dxf data. * @param data * @param onProgress * @returns * @describe load dxf entities */loadEntities(e,t){return __async(this,null,(function*(){const r=Date.now();this.parseHeader(e.header),this.enableRenderOrder&&(this.initRenderOrderInfo(e),this.enableMerge=!1);let i=0;const n=e.entities.length;this.entityCount=n,Object.keys(e.blocks).forEach((t=>{var r;this.entityCount+=(null==(r=e.blocks[t].entities)?void 0:r.length)||0}));const s=Math.round(Math.pow(n,.5));let a=Date.now();const o=e=>__async(this,null,(function*(){if(t&&(e%s==0||e===n-1)){t(new ProgressEvent("parseProgress",{loaded:e+1,total:n}));const r=500,i=Date.now();(i-a>r||e===n-1)&&(yield Viewer3DUtils.sleep(0),a=i)}})),l={};e.objects.LAYOUT.forEach((e=>{const t=e;l[t.layoutName]=t}));const c={},u=e=>{const t=e.userData.layerName;let r=c[t];r||(r=[],c[t]=r),r.push(e)},h={},p={},d=new Group;ObjectUtils.setSharedVariablesOfObject(d);for(let t=0;te.name===s));a||(a=new Group,ObjectUtils.setSharedVariablesOfObject(a),a.name=s,a.userData.isLayoutLevelObject=!0,d.add(a)),i++,p[s]||(p[s]={object:a,layerObjects:{}});const c=p[s];let m;if(s!==_DXFLoader.MODEL_LAYOUT_NAME){const e=l[s];e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new Set),m=e.directAssociatedLeafObjectSet}if(this.enableMerge&&n.geometry){ObjectUtils.setSharedVariablesOfObject(n);const t=n.userData.layerName;!1===this.getLayerVisible(e,t)&&(n.visible=!1),c.layerObjects[t]||(c.layerObjects[t]=[]),c.layerObjects[t].push(n)}else a.add(n),n.traverse((t=>{if(ObjectUtils.setSharedVariablesOfObject(t),t.geometry){const r=t.userData.layerName;!1===this.getLayerVisible(e,r)&&(t.visible=!1),u(t),m&&m.add(t)}}));yield o(t)}e.objects.LAYOUT.forEach((t=>{const r=t,i=r.layoutName;if(this.ignorePaperSpace&&i!==_DXFLoader.MODEL_LAYOUT_NAME)return;const n=r.associatedBlockName,s=e.blocks[n];s&&this.drawLayout(s,e,r,d,c,h)})),log.debug(`[DxfLoader] drawEntities in ${(Date.now()-r)/1e3}s`);for(const e in p){const t=p[e],r=t.object;let i;if(e!==_DXFLoader.MODEL_LAYOUT_NAME){const t=l[e];t.directAssociatedLeafObjectSet||(t.directAssociatedLeafObjectSet=new Set),i=t.directAssociatedLeafObjectSet}for(const e in t.layerObjects){const n=t.layerObjects[e],s=MergeUtils.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));const t=t=>Array.isArray(e)?e.indexOf(t)>=0:e.has(t);for(let e=0,s=n.length;e{m+=e})),this.enableRTC&&log.debug(`[DxfLoader] Totally rebased ${this.statsInfo.rebasedEntityCount}(out of ${m}) entities`),this.enableMerge){const e=MergeUtils.mergeInfo;log.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`)}const f=(e,t,...r)=>{Object.keys(t).length,0};f(0,this.statsInfo.unsupportedEntityTypes),f(0,this.statsInfo.unsupportedTextStyles),f(0,this.statsInfo.unsupportedHatchPatterns),f(0,this.statsInfo.invisibleEntities),f(0,this.statsInfo.ignoredFrozenLayersAndEntityCount),f(0,this.statsInfo.ignoredInserts),this.ignorePaperSpace&&f(0,this.statsInfo.ignoredPaperSpaceEntityTypesAndCount),this.font.unsupportedChars&&f(0,this.font.unsupportedChars),this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(e)),log.info(`[DxfLoader] LoadEntities() done in ${(Date.now()-r)/1e3}s`);const g=__spreadProps(__spreadValues({},e),{threejsObject:d,layersAndThreejsObjects:c,loadedEntityCount:i,layoutViewportsMap:h});return Promise.resolve(g)}))} /** * Loads entities from two dxf data for comparing. * It also creates markup for each change. */loadEntitiesForCompare(e,t,r,i){return __async(this,null,(function*(){const n=e.entities.length,s=t.entities.length,a=()=>__async(this,null,(function*(){var a;const o=this.compareContext,l=o.isTheFirstFile,c=l?e:t,u=new Group,h=l?n:s,p=c.entities.length;this.entityCount=p,Object.keys(c.blocks).forEach((e=>{var t;this.entityCount+=(null==(t=c.blocks[e].entities)?void 0:t.length)||0}));const d=Math.round(Math.pow(h,.5));let m=Date.now();const f=e=>__async(this,null,(function*(){if(i&&(e%d==0||e===h-1)){let t=e+1;l||(t+=n),i(new ProgressEvent("parseProgress",{loaded:t,total:n+s}));const r=500,a=Date.now();(a-m>r||e===h-1)&&(yield Viewer3DUtils.sleep(0),m=a)}}));this.parseHeader(c.header);const g={};for(let e=0;e{if(e.geometry){const t=e.userData.layerName;!1===this.getLayerVisible(c,t)&&(e.visible=!1);let r=g[t];r||(r=[],g[t]=r),r.push(e)}})),yield f(e)}const _=c;_.threejsObject=u,u.updateMatrixWorld(!0),_.layersAndThreejsObjects=g,_.layoutViewportsMap={},l&&(o.preservedHandles||(o.preservedHandles=new Set));for(const e in r){const t=r[e];!l||"Added"/* Added */!==t.type&&"Modified"/* 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 i=this.entityThreejsCache&&this.entityThreejsCache[t.handle];t.parentHandles&&(i=this.entityThreejsCache&&this.entityThreejsCache[t.parentHandles[t.parentHandles.length-1]]),i&&(i=this.setObjectColorByChange(i,t)),"NoChange"/* NoChange */!==t.type&&i&&("Added"/* Added */===t.type?!l&&(t.box=(new Box3).setFromObject(i)):"Removed"/* Removed */===t.type?l&&(t.box=(new Box3).setFromObject(i)):"Modified"/* Modified */===t.type&&(t.box?t.box.union((new Box3).setFromObject(i)):t.box=(new Box3).setFromObject(i)))}_DXFLoader.merge(_)}));let o=Date.now();this.compareContext={changes:r,isTheFirstFile:!0},CommonUtils.printMemory("Before loading entities for first dxf"),yield a(),log.info(`[DxfLoader] loadEntities for first dxf in ${(Date.now()-o)/1e3}s`),CommonUtils.printMemory("After loading entities for first dxf"),this.releaseCachedData(!1),this.releaseDxfData(e),CommonUtils.printMemory("Before loading entities for second dxf"),o=Date.now(),this.compareContext.isTheFirstFile=!1,yield a(),log.info(`[DxfLoader] loadEntities for second dxf in ${(Date.now()-o)/1e3}s`);for(const e of Object.values(r))e.box||delete r[e.handle];this.compareContext.preservedHandles=void 0,this.enableReleaseData&&(this.releaseCachedData(),this.releaseDxfData(t)),CommonUtils.printMemory("After loading entities for second dxf")}))} // eslint-disable-next-line @typescript-eslint/no-explicit-any setObjectColorByChange(e,t){const r=(e,t)=>{e.traverse((e=>{if(e.material)if(e.material instanceof LineBasicMaterial)e.material=this.getLineBasicMaterial(t);else if(e.material instanceof MeshBasicMaterial)e.material=this.getMeshBasicMaterial(t);else if(e.material instanceof PointsMaterial)e.material=this.getPointsMaterial(t);else if(e.material instanceof ShaderMaterial){const r=e.material.clone();this.updateMaterialUniforms(r),r.uniforms.u_color.value.set(t),e.material=r}}))},i=(e=>{var t;let r=DxfCompare.ENTITY_COLOR_NO_CHANGE;return"Added"/* Added */===e.type?r=DxfCompare.ENTITY_COLOR_ADDED:"Removed"/* Removed */===e.type?r=DxfCompare.ENTITY_COLOR_REMOVED:"Modified"/* Modified */===e.type&&(r=(null==(t=this.compareContext)?void 0:t.isTheFirstFile)?DxfCompare.ENTITY_COLOR_REMOVED:DxfCompare.ENTITY_COLOR_ADDED),r})(t);return e.traverse((n=>{t.parentHandles?n.userData&&n.userData.handle&&n.userData.handle===t.handle&&(r(n,i),e=n):r(n,i)})),e} // Manual release 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.statsInfo={unsupportedEntity:{},unsupportedEntityTypes:{},unsupportedTextStyles:{},unsupportedHatchPatterns:{},invisibleEntities:{},ignoredFrozenLayersAndEntityCount:{},ignoredInserts:{},entityTypesAndMeshCount:{},ignoredPaperSpaceEntityTypesAndCount:{},rebasedEntityCount:0}} /** * Releases memory-costy elements of an entity */releaseEntity(e){e.vertices&&(e.vertices=void 0),e.knotValues&&(e.knotValues=void 0),e.controlPoints&&(e.controlPoints=void 0),e.binaryData&&(e.binaryData=void 0),e.text&&(e.text=void 0),e.extendedData&&(e.extendedData=void 0),e.contextData&&(e.contextData=void 0);const t=e;t.boundaryPaths&&(t.boundaryPaths=[]),t.patternLines&&(t.patternLines=void 0)} /** * Releases memory-costy elements of dxf data */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={}} /** * We'll need to pass in the blockEntity when drawEntity is called from a block. * So that, when an entity's color is ByLayer, and its layer is "0", it should use block's layer, * rather than the layer of the entity itself! * We don't know if there is other similar case in future, so pass in blockEntity here. */drawEntity(e,t,r,i=!1){if(this.compareContext&&this.compareContext.preservedHandles&&this.compareContext.preservedHandles.has(e.handle)&&NestCompareTypes.includes(e.type)&&(i=!0),!i&&this.compareContext&&this.compareContext.preservedHandles&&// filter certain types !NestCompareTypes.includes(e.type)&&!this.compareContext.preservedHandles.has(e.handle)&&(!r||r&&!this.compareContext.preservedHandles.has(r.handle)))return;if(!0===this.getLayerFrozen(t,e)){const t=e.layer;return this.statsInfo.ignoredFrozenLayersAndEntityCount[t]||(this.statsInfo.ignoredFrozenLayersAndEntityCount[t]=0),void this.statsInfo.ignoredFrozenLayersAndEntityCount[t]++}if(!1===e.visible||e.invisible)return this.statsInfo.invisibleEntities[e.type]||(this.statsInfo.invisibleEntities[e.type]=0),void this.statsInfo.invisibleEntities[e.type]++;if(this.ignorePaperSpace&&e.inPaperSpace)return this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]||(this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]=0),void this.statsInfo.ignoredPaperSpaceEntityTypesAndCount[e.type]++;this.entityThreejsCache||(this.entityThreejsCache={});const n=Date.now();let s,a=!1;if(!this.compareContext&&this.entityThreejsCache[e.handle])s=this.entityThreejsCache[e.handle].clone(),a=!0;else if(!this.statsInfo.unsupportedEntity[e.handle]){if("CIRCLE"===e.type||"ARC"===e.type)s=this.drawArc(e,t,r);else if("LINE"===e.type||"POLYLINE"===e.type)s=this.drawLine(e /*, data, blockEntity*/);else if("XLINE"===e.type)s=this.drawXLine(e /*, data, blockEntity*/);else if("SEQEND"===e.type);else if("RAY"===e.type)s=this.drawRay(e /*, data, blockEntity*/);else if("LWPOLYLINE"===e.type)s=this.drawLWPolyline(e,t,r);else if("3DFACE"===e.type)s=this.draw3DFace(e /* data, parentEntity */);else if("TEXT"===e.type)s=this.drawText(e,t,r);else if("SOLID"===e.type)s=this.drawSolid(e,t,r);else if("POINT"===e.type)s=this.drawPoint(e,t,r);else if("INSERT"===e.type)s=this.drawInsert(e,t,i);else if("SPLINE"===e.type)s=this.drawSpline(e /*, data, blockEntity*/);else if("MTEXT"===e.type)s=this.drawMText(e,t,r);else if("ELLIPSE"===e.type)s=this.drawEllipse(e,t,r);else if("DIMENSION"===e.type)s=this.drawDimension(e,t);else if("REGION"===e.type);else if("ATTDEF"===e.type)s=this.drawAttDef(e,t,r);else if("ATTRIB"===e.type){if(!r)for(let i=0;i{ObjectUtils.setSharedVariablesOfObject(s),s.matrixAutoUpdate=matrixAutoUpdate,s.updateMatrix(),s.geometry&&(!1===n&&(s.userData.layerVisible=!1),s.userData.layerName=i,this.setMaterial(s,e,t,r))})),a||(this.nonSnapableTypes.has(e.type)&&s.traverse((e=>{e.layers.set(layerForNonSnapableObjects)})),this.enableRenderOrder&&(this.entityHandlesWithRenderOrder[e.handle]?s.renderOrder=parseInt(this.entityHandlesWithRenderOrder[e.handle],16)+.1:s.renderOrder=parseInt(e.handle,16)))}return NestCompareTypes.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()-n),s?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,NestCompareTypes.includes(e.type)||(this.statsInfo.unsupportedEntity[e.handle]?this.statsInfo.unsupportedEntity[e.handle]++:this.statsInfo.unsupportedEntity[e.handle]=1)),s}drawEllipse(e,t,r){if(!e.majorAxisEndPoint||!e.center||void 0===e.axisRatio||void 0===e.startAngle||void 0===e.endAngle)return;let i=e.startAngle,n=e.endAngle;if(e.extrusionDirection&&e.extrusionDirection.z<0&&(i=2*Math.PI-e.endAngle,n=2*Math.PI-e.startAngle),MathUtils2.areNumbersEqual(i,n,1e-5))return void log.warn("[DxfLoader] Ellipse entity (handle '%s') contains the same start and end angle, ignored!",e.handle);let s=n-i;for(;s>2*Math.PI;)s-=2*Math.PI;Math.abs(s)<=1e-5&&(n=MathUtils2.floorNumber(i+2*Math.PI,5));const a=Math.sqrt(Math.pow(e.majorAxisEndPoint.x,2)+Math.pow(e.majorAxisEndPoint.y,2)),o=a*e.axisRatio,l=Math.atan2(e.majorAxisEndPoint.y,e.majorAxisEndPoint.x),c=new EllipseCurve(e.center.x,e.center.y,a,o,i,n,!1, // Always counterclockwise l);let u=1;const h=r;(null==h?void 0:h.xScale)&&(null==h?void 0:h.yScale)&&(u=Math.max(Math.abs(h.xScale),Math.abs(h.yScale)));const p=this.getDivision(i,n,Math.max(a,o)*u),d=c.getPoints(p),m=[],f=d.length;for(let e=0;e{e.geometry&&e.geometry.translate(u,h,0)})),e.rotation&&(a.rotation.z=e.rotation*Math.PI/180),e.directionVector){const t=e.directionVector,r=new Vector3(t.x,t.y,t.z),i=r.clone().cross(XAxis),n=new Vector3(1,0,0).angleTo(r);a.rotateZ(i.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,r,i,n){var s;if(0===e.length)return;let a=(n?n.style.textHeight:t.textHeight)||0;if(t.textStyle){const e=r.tables.style.styles[t.textStyle];a=a||e.textHeight}const o=a/1.5,l=a/2,c=new Group;for(let a=0;a{n&&n[n.length-1]&&n[n.length-1].colorIndex===e.colorIndex?n[n.length-1].text+=e.text:n.push(e)})),i=e.lineLength}else if("object"==typeof a)if(a.S&&3===a.S.length){const 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({ // colorIndex: 256, // default color is ByLayer text:a.S[0]+"/"+a.S[2],lineNum:i}),i+=t}else if(void 0!==a.C&&(s++,"string"==typeof e[s])){const 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:i}),i+=t}}return{text:n,lineLength:i,style:r}}getTextLineNum(e){const t=e.match(new RegExp("\\n","g"));return t?t.length:0}draw3DFace(e){if(!e.vertices||0===e.vertices.length)return void log.warn("[DxfLoader] Entity is missing vertices:",e.handle);const t=e.vertices.map((e=>new Vector3(e.x,e.y,e.z)));if(0===t.length)return;MathUtils2.areVector3sEqual(t[0],t[t.length-1])||t.push(t[0]);const r=new Vector3;let i=!1;this.enableRTC&&(i=GeometryUtils.checkAndRebasePositionsOnRTC(t,r));const n=(new BufferGeometry).setFromPoints(t),s=new Line(n,Default_LineMaterial);return i&&(this.setRTCUserData(s),s.position.x+=r.x,s.position.y+=r.y),s.renderOrder=2/* Line */,s}drawSpline(e){if(!e.controlPoints||!e.degreeOfSplineCurve||!e.knotValues)return;const t=this.getBSplinePolyline(e.controlPoints,e.degreeOfSplineCurve,e.knotValues,2*e.numberOfControlPoints),r=new Vector3;let i=!1;this.enableRTC&&(i=GeometryUtils.checkAndRebasePositionsOnRTC(t,r));const n=GeometryUtils.getAdjacentNonRepeatPoints(t);if(n.length<2)return void log.warn("[DxfLoader] Spline entity (handle '%s') contains less than 2 points, ignored!",e.handle);const s=(new BufferGeometry).setFromPoints(n),a=new Line(s,Default_LineMaterial);return i&&(this.setRTCUserData(a),a.position.x+=r.x,a.position.y+=r.y),a} /** * Interpolate a b-spline. The algorithm examins the knot vector * to create segments for interpolation. The parameterisation value * is re-normalised back to [0,1] as that is what the lib expects ( * and t i de-normalised in the b-spline library) * * @param controlPoints the control points * @param degree the b-spline degree * @param knots the knot vector * @returns the polyline */getBSplinePolyline(e,t,r,i,n){const s=[],a=e.map((e=>[e.x,e.y])),o=[r[t]],l=[r[t],r[r.length-1-t]];for(let e=t+1;enew Vector3(e.x,e.y,0)));if(r.push(t.multiplyScalar(1e6).add(r[0])),0===r.length)return;const i=new Vector3;let n=!1;this.enableRTC&&(n=GeometryUtils.checkAndRebasePositionsOnRTC(r,i));const s=(new BufferGeometry).setFromPoints(r),a=new Line(s,Default_LineMaterial);return n&&(this.setRTCUserData(a),a.position.x+=i.x,a.position.y+=i.y),a.renderOrder=2/* Line */,a}drawLine(e){if(!e.vertices||0===e.vertices.length)return void log.warn("[DxfLoader] Entity is missing vertices:",e.handle);let t=[];if(e.isPolyfaceMesh)t=getPolyfaceMeshPoints(e.vertices);else{const r=getLinePoints(e.vertices,e.shape);e.shape&&r.length>0&&r.push(r[0]),r.length>0&&(t=[r])}if(0===t.length)return;const r=[];for(let e=0;e0){if(this.enableRTC){let e=0;t.forEach((t=>{t.forEach((t=>{i.add(t),e++}))})),i.divideScalar(e),s=GeometryUtils.shouldRebasePositionOnRTC(i)}const e=[],r=[];let a=0,o=0,l=0,c=0;t.forEach((t=>{for(let n=0;n0&&r.push(a+n-1,a+n);a=t.length}));const u=(new BufferGeometry).setFromPoints(e);u.setIndex(r),n=new LineSegments(u,Default_LineMaterial)}if(r.length>0){this.enableRTC&&(s=GeometryUtils.checkAndRebasePositionsOnRTC(r,i));const e=(new BufferGeometry).setFromPoints(r);n=new Points(e,Default_PointMaterial)}return n?(s&&(this.setRTCUserData(n),n.position.x+=i.x,n.position.y+=i.y),n):void 0}drawLWPolyline(e,t,r){var i;if(!e.vertices||e.vertices.length<2)return void log.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);const n=e;if(void 0!==n.extrusionDirectionX&&void 0!==n.extrusionDirectionY&&void 0!==n.extrusionDirectionZ){tempVector2.set(n.extrusionDirectionX,n.extrusionDirectionY,n.extrusionDirectionZ);const e=_DXFLoader.getOcsMatrix(tempVector2).invert();let t=0;void 0!==n.elevation&&n.elevation>0&&(t=n.elevation),n.vertices.forEach((r=>{const i=tempVector2.set(r.x,r.y,t).applyMatrix4(e);r.x=i.x,r.y=i.y}))}const s=getLinePoints(e.vertices,e.shape);if(e.shape&&s.length>0&&!MathUtils2.areVector3sEqual(s[0],s[s.length-1])&&s.push(s[0]),s.length<2)return void log.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);if(null==(i=e.extendedData)?void 0:i.outlines){e.extendedData.outlines.forEach((e=>{const t=e.map((e=>new Vector3(e[0],e[1],0)));MathUtils2.areVectorsClose(t[0],t[t.length-1])||t.push(t[0]),s.push(...t)}))}const a=new Vector3;let o=!1;this.enableRTC&&(o=GeometryUtils.checkAndRebasePositionsOnRTC(s,a));const l=GeometryUtils.getAdjacentNonRepeatPoints(s);if(l.length<2)return void log.warn("[DxfLoader] Invalid LWPolyline entity (handle '%s'), ignored!",e.handle);let c;if(this.enableWidthLine&&void 0!==n.constantWidth&&n.constantWidth>1){const i=t.tables.lineType.lineTypes[this.getLineType(e,t,r)];if(!i||!i.pattern||0===i.pattern.length){const t=GeometryUtils.convertWidthLineToMeshGeometry(l,n.constantWidth);if(t){const e=new Mesh(t,Default_MeshMaterial);c=new Group,c.add(e);const r=ObjectUtils.createOutlineSync(t,e.matrix,Default_LineMaterial);r.layers.set(layerForNonSnapableObjects),c.add(r)}else log.warn("[DxfLoader] Failed to convert width line to mesh geometry: %s ",e.handle)}}return c||(c=new Line((new BufferGeometry).setFromPoints(l),Default_LineMaterial)),o&&(this.setRTCUserData(c),c.position.x+=a.x,c.position.y+=a.y,c.position.z+=a.z),c}drawMLeader(e,t,r){var i,n,s,a,o,l,c,u;const h=t.tables.dimStyle.dimStyles[e.dimensionStyle]||this.getDefaultDimensionStyle(t),p=new Group,d=parseDxfMTextContent(null==(i=e.contextData)?void 0:i.defaultTextContents),m=this.mtextContentAndFormattingToTextAndStyle(d,e),f=this.getMTextGroup(m.text,e,t,r,m);if(f){(null==(n=e.contextData)?void 0:n.textLocation)&&(f.position.x+=e.contextData.textLocation.x,f.position.y+=e.contextData.textLocation.y);const t=(null==(s=e.contextData)?void 0:s.textWidth)||1;switch(m.style.horizontalAlignment){case"left":default:break;case"center":t&&(f.position.x+=t/2);break;case"right":t&&(f.position.x+=t)}const r=(new Box3).setFromObject(f).getSize(tempVector2),i=r.x,c=r.y;let u=0,h=0;switch(null==(a=e.contextData)?void 0:a.textAttachment){case 1:u=0,h=0;break;case 2:u-=i/2,h=0;break;case 3:u-=i,h=0;break;case 4:u=0,h+=c/2;break;case 5:u-=i/2,h+=c/2;break;case 6:u-=i,h+=c/2;break;case 7:u=0,h+=c;break;case 8:u-=i/2,h+=c;break;case 9:u-=i,h+=c;break;default:return}if(f.traverse((e=>{e.geometry&&e.geometry.translate(u,h,0)})),(null==(o=e.contextData)?void 0:o.textRotation)&&(f.rotation.z=e.contextData.textRotation*Math.PI/180),null==(l=e.contextData)?void 0:l.textDirection){const t=e.contextData.textDirection,r=new Vector3(t.x,t.y,t.z),i=r.clone().cross(new Vector3(1,0,0)),n=new Vector3(1,0,0).angleTo(r);f.rotateZ(i.z>0?-n:n)}f.renderOrder=5/* Text */,p.add(f)}if(0===e.leaderLineType)return f;{const r=[],i=null==(c=e.contextData)?void 0:c.leaders[0];if(!i)return p;const n=i.lastLeaderLinePoint;if(e.enableDogLeg){const e=new Vector3(n.x,n.y,n.z),t=i.doglegLength,s=new Vector3(i.doglegVector.x,i.doglegVector.y,i.doglegVector.z).multiplyScalar(t),a=e.clone().add(s);r.push(a,e)}const s=(null==(u=e.contextData)?void 0:u.leaders[0].leaderLines)||[];for(let i=0;inew Vector3(e.x,e.y,e.z)));let o=new Vector3(n.x,n.y,n.z);for(let e=0;e0?(l.add(p),MergeUtils.merge(l,!1),l):p}drawDefaultLeadArrow(e,t,r,i){const n=r*(e.x-t.x),s=r*(e.y-t.y),a=s,o=-n,l=new Vector3(t.x+n+a/6,t.y+s+o/6,0),c=new Vector3(t.x+n-a/6,t.y+s-o/6,0);i.push(t,l),i.push(t,c),i.push(l,c)}getBlockByHandle(e,t){if(!this.blocksCache){this.blocksCache={};for(const t in e){const r=e[t];this.blocksCache[r.ownerHandle]||(this.blocksCache[r.ownerHandle]=r)}}return this.blocksCache[t]}static transformAngleByOcsMatrix(e,t){const r=tempVector2.set(1*Math.cos(t),1*Math.sin(t),0).applyMatrix4(e);return Math.atan2(r.y,r.x)}static getArcAnglesByOcsMatrix(e,t,r){let i=MathUtils2.getArcAngleSpanRad(t,r);const n=_DXFLoader.transformAngleByOcsMatrix(e,t),s=_DXFLoader.transformAngleByOcsMatrix(e,r);let a;if(MathUtils2.areNumbersClose(i,Math.PI)){i=1;const r=_DXFLoader.transformAngleByOcsMatrix(e,t+i);a=MathUtils2.getArcAngleSpanRad(n,r)}else{if(MathUtils2.areNumbersClose(i,2*Math.PI))return[n,n+2*Math.PI];a=MathUtils2.getArcAngleSpanRad(n,s)}return MathUtils2.areNumbersClose(i,a,1e-8)?[n,s]:[s,n]}drawArc(e,t,r){var i,n,s;if(!e.radius||e.radius<.001)return void log.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is undefined, ignored!`);if(!e.radius||e.radius<.001)return void log.warn(`[DxfLoader] The radius of arc (handle '${e.handle}') is too small, ignored!`);const a=new Vector3(0,0,1);void 0!==e.extrusionDirectionX&&void 0!==e.extrusionDirectionY&&void 0!==e.extrusionDirectionZ&&a.set(e.extrusionDirectionX,e.extrusionDirectionY,e.extrusionDirectionZ);const o=_DXFLoader.getOcsMatrix(a);let l,c;if("CIRCLE"===e.type)l=e.startAngle||0,c=l+2*Math.PI;else{if(null==e.startAngle||null==e.endAngle)return;if(l=e.startAngle,c=e.endAngle,MathUtils2.areNumbersEqual(l,c,.001))return;if(!MathUtils2.areNumbersClose(MathUtils2.getArcAngleSpanRad(l,c),2*Math.PI)){const e=_DXFLoader.getArcAnglesByOcsMatrix(o,l,c);l=e[0],c=e[1]}}const u=new ArcCurve(0,0,e.radius,l,c,0!==this.angBase);let h=1;const p=r;(null==p?void 0:p.xScale)&&(null==p?void 0:p.yScale)&&(h=Math.max(Math.abs(p.xScale),Math.abs(p.yScale)));const d=this.getDivision(l,c,e.radius*h),m=u.getPoints(d),f=new Vector3;let g=!1;this.enableRTC&&(g=GeometryUtils.checkAndRebasePositionsOnRTC(m,f));const _=(new BufferGeometry).setFromPoints(m),y=new Line(_,Default_LineMaterial),T=new Vector3;e.center&&(T.x=e.center.x,T.y=e.center.y);const v=new Vector3(null==(i=e.center)?void 0:i.x,null==(n=e.center)?void 0:n.y,null==(s=e.center)?void 0:s.z).applyMatrix4(o.invert());return T.x=v.x,T.y=v.y,y.position.copy(T),g?(this.setRTCUserData(y),y.position.x+=f.x,y.position.y+=f.y):GeometryUtils.shouldRebasePositionOnRTC(y.position)&&this.setRTCUserData(y),y}addTriangleFacingCamera(e,t,r,i){const n=new Vector3,s=new Vector3;n.subVectors(r,t),s.subVectors(i,t),n.cross(s);const a=new Vector3(t.x,t.y,t.z),o=new Vector3(r.x,r.y,r.z),l=new Vector3(i.x,i.y,i.z);n.z<0?e.push(l,o,a):e.push(a,o,l)}drawSolid(e,t,r){const i=e.points;if(!i||i.length<4)return;if(e.extrusionDirection&&e.extrusionDirection.z){tempVector2.set(0,0,e.extrusionDirection.z);const t=_DXFLoader.getOcsMatrix(tempVector2).invert();i.forEach((e=>{const r=tempVector2.set(e.x,e.y,0).applyMatrix4(t);e.x=r.x,e.y=r.y}))}const n=[],s=[];this.addTriangleFacingCamera(n,i[0],i[1],i[2]),s.push(0,1,2),this.addTriangleFacingCamera(n,i[1],i[2],i[3]),s.push(3,4,5);const a=new Vector3;let o=!1;this.enableRTC&&(o=GeometryUtils.checkAndRebasePositionsOnRTC(n,a));const l=(new BufferGeometry).setFromPoints(n);l.setIndex(s);const c=new Mesh(l,Default_MeshMaterial);return o&&(this.setRTCUserData(c),c.position.x+=a.x,c.position.y+=a.y),c}getDefaultTextStyle(e){return e.tables.style.styles.STANDARD||e.tables.style.styles.Standard||{}}getDefaultDimensionStyle(e){return e.tables.dimStyle.dimStyles.STANDARD||e.tables.dimStyle.dimStyles.Standard||{}}getTextEncoding(e){return e.bigFontFile&&e.bigFontFile.toUpperCase().startsWith("GB")?"gbk":"utf8"}getTextMesh(e,t,r,i,n){if(!e)return;let s;t.textStyle&&(this.statsInfo.unsupportedTextStyles[t.textStyle]||(this.statsInfo.unsupportedTextStyles[t.textStyle]=0),this.statsInfo.unsupportedTextStyles[t.textStyle]++);let a=(n?n.style.textHeight:t.textHeight)||0,o=.67;const l={_TCH_DIM:1.45};if(t.textStyle&&l[t.textStyle]&&(o=l[t.textStyle]),t.xScale&&(o*=t.xScale),t.textStyle){const e=r.tables.style.styles[t.textStyle];o*=(null==e?void 0:e.xScale)||1,a=a||e.textHeight}let c=0;if(t.width&&(c=t.width/o+2),t.contextData&&t.contextData.textWidth&&t.contextData.textHeighte.toThreeGeometry())));i.scale(o,1,1),s=new LineSegments(i,Default_LineMaterial)}else if(this.font instanceof Font){const t={font:this.font,height:0,size:a||12,curveSegments:3, // change this to increase/decrease display precision bevelSegments:3},r=new TextGeometry(e,t);s=new Mesh(r,Default_MeshMaterial)}return s}transformTextMesh(e,t){const r=(new Box3).setFromObject(t).getSize(tempVector2),{halign:i,valign:n}=e,s=e.width||r.x,a=r.y;if(void 0===i&&void 0===n&&e.startPoint||[3,5].includes(i)&&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!==i&&5!==i){if(e.rotation){const r=e.rotation*Math.PI/180;t.rotateZ(r)}2===e.mirrored?t.rotateY(Math.PI):4===e.mirrored&&t.rotateX(Math.PI)}switch(i){case 0:default:break;case 1:t.translateX(-s/2);break;case 2:t.translateX(-s);break;case 3:if(e.startPoint&&e.endPoint){const r=new Vector3(e.startPoint.x,e.startPoint.y,e.startPoint.z),i=new Vector3(e.endPoint.x,e.endPoint.y,e.endPoint.z),n=(new Vector3).subVectors(r,i),a=n.length()/s;t.scale.multiplyScalar(a);const o=n.clone().cross(XAxis),l=n.angleTo(XAxis);t.rotateZ(o.z>0?Math.PI-l:l-Math.PI),(2===e.mirrored||4===e.mirrored)&&t.rotateX(Math.PI)}break;case 4:t.translateX(-s/2),t.translateY(-a/2);break;case 5:if(e.startPoint&&e.endPoint){const r=new Vector3(e.startPoint.x,e.startPoint.y,e.startPoint.z),i=new Vector3(e.endPoint.x,e.endPoint.y,e.endPoint.z),n=(new Vector3).subVectors(r,i),a=n.length()/s;t.scale.setX(a);const o=n.clone().cross(XAxis),l=n.angleTo(XAxis);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,r){let i=e.text;if(!i||!this.font)return;const n=t.tables.style.styles[e.textStyle]||this.getDefaultTextStyle(t);i=parseDxfTextContent(i,{encoding:this.getTextEncoding(n)}).map((e=>e.text)).join("");const s=this.getTextMesh(i,e,t,r);if(!s)return;const a=s.geometry;if(s instanceof Mesh&&!a.getIndex()){const e=a.getAttribute("position"),t=[];for(let r=0;re.text)).join();const n=this.getTextMesh(i,e,t,r);if(!n)return;const s=n.geometry;if(s.hasAttribute("uv")&&s.deleteAttribute("uv"),s.hasAttribute("normal")&&s.deleteAttribute("normal"),this.transformTextMesh(e,n),GeometryUtils.shouldRebasePositionOnRTC(n.position))this.setRTCUserData(n);else{const e=GeometryUtils.caculateGeometryCenter(s);e&&GeometryUtils.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(n)}return n}drawAttrib(e,t,r){let i=e.text;if(!i||!this.font)return;i=parseDxfTextContent(i).map((e=>e.text)).join();const n=this.getTextMesh(i,e,t,r);if(!n)return;const s=n.geometry;if(s.hasAttribute("uv")&&s.deleteAttribute("uv"),s.hasAttribute("normal")&&s.deleteAttribute("normal"),this.transformTextMesh(e,n),GeometryUtils.shouldRebasePositionOnRTC(n.position))this.setRTCUserData(n);else{const e=GeometryUtils.caculateGeometryCenter(s);e&&GeometryUtils.shouldRebasePositionOnRTC(e)&&this.setRTCUserData(n)}return n}drawPoint(e,t,r){if(!e.position)return;const i=new BufferGeometry,n=[new Vector3(e.position.x,e.position.y,e.position.z)];tempVector2.set(0,0,0);const s=tempVector2;let a=!1;this.enableRTC&&(a=GeometryUtils.checkAndRebasePositionsOnRTC(n,s)),i.setFromPoints(n);const o=new Points(i,Default_PointMaterial);return a&&(this.setRTCUserData(o),o.position.x+=s.x,o.position.y+=s.y),o}drawDimension(e,t){if(!e.block)return;const r=t.blocks[e.block];if(!r||!r.entities)return;const i=t.tables.dimStyle.dimStyles[e.dimStyleName]||this.getDefaultDimensionStyle(t);i&&i.DIMCLRD>0&&(e.colorIndex=i.DIMCLRD,e.color=getAcadColor(e.colorIndex));let n=new Group;for(let i=0;i`,n.userData.entityType=e.type;const s=null==e?void 0:e.insertionPoint;return s&&(n.position.x+=s.x,n.position.y+=s.y),GeometryUtils.shouldRebasePositionOnRTC(n.position)&&this.setRTCUserData(n),n}drawInsert(e,t,r=!1){if(!e.block)return;const i=t.blocks[e.block];if(!i.entities)return;e.blockPosition=i.position;let n=new Group;for(let s=0;s`,n.userData.entityType=e.type,(null==e?void 0:e.blockPosition)&&(n.position.x-=e.blockPosition.x,n.position.y-=e.blockPosition.y,n.updateMatrix());const s=tempVector2.set(1,1,1);e.xScale&&(s.x=e.xScale),e.yScale&&(s.y=e.yScale);const a=new Euler;e.rotation&&(a.z=e.rotation*Math.PI/180),tempQuaternion.setFromEuler(a,!1);const o=tempVector22.set(0,0,0);e.position&&(o.x=e.position.x,o.y=e.position.y),tempMatrix3.compose(o,tempQuaternion,s),e.extrusionDirection&&e.extrusionDirection.z<0&&tempMatrix3.premultiply(scaleTempMatrix.identity().makeScale(-1,1,1)),translateTempMatrix.copy(n.matrix),n.applyMatrix4(tempMatrix3),GeometryUtils.shouldRebasePositionOnRTC(n.position)&&this.setRTCUserData(n);const l=this.findSpatialFilterByHandle(e.handle,t);if(l){const t=this.drawSpatialFilter(l),r=l;r&&r.clipPolylines&&r.clipPolylines.length>0&&(n.userData.spatialFilterHandle=l.handle,this.cloneMaterialsForSpatialFilter(n),t&&t.applyMatrix4(translateTempMatrix.invert()),log.debug("[DxfLoader] Spatial filter:",e.associatedSpatialFilter))}return n}drawSpatialFilter(e){const t=e;if(t.threejsObject)return t.threejsObject.clone();const r=e.invertBlockMatrix;tempMatrix3.set(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],0,0,0,1);const i=[];e.vertices.forEach((e=>{i.push(new Vector3(e.x,e.y,0))}));const n={polyline:[],bConcave:!1,bReversed:!1};if(2===e.numberOfPointsOnClipBoundary)n.polyline=i;else{const t=e.numberOfPointsOnClipBoundary,r=3;if(te;n--){const o=i[n];if(MathUtils2.areVector3sEqual(r,o)&&e+10)break;s.push(r)}if(a>0)for(let e=a+1;e{o.push(new Vector2(e.x,e.y)),l.push([e.x,e.y])})),!GeometryUtils.isConvex(o)){log.warn(`[DxfLoader] Concave polygon is not supported for spatial filter (handle '${e.handle}'), converting to convex polygon!`);const t=(0,import_concaveman.default)(l,1/0);s=[],t.forEach((e=>{s.push(new Vector3(e[0],e[1],0))}))}MathUtils2.areVector3sEqual(s[0],s[s.length-1])||s.push(s[0]),n.polyline=s,n.bReversed=a>0}this.enableReleaseData&&(e.vertices=[],e.matrix=[],e.invertBlockMatrix=[]),t.localMatrix=tempMatrix3.clone(),t.clipPolylines=[],t.clipPolylines.push(n)}drawLayout(e,t,r,i,n,s){if(!e.entities)return;let a;if(r.layoutName!==_DXFLoader.MODEL_LAYOUT_NAME){const e=r;e.directAssociatedLeafObjectSet||(e.directAssociatedLeafObjectSet=new Set),a=e.directAssociatedLeafObjectSet}const o=new Group;ObjectUtils.setSharedVariablesOfObject(o);for(let r=0;r{if(e.geometry){const r=e.userData.layerName;!1===this.getLayerVisible(t,r)&&(e.visible=!1);let i=n[r];i||(i=[],n[r]=i),i.push(e),a&&a.add(e)}}))}}if(0===o.children.length)return;o.userData.layerName=e.layer;const l=r.layoutName;let c=i.children.find((e=>e.name===l));c||(c=new Group,ObjectUtils.setSharedVariablesOfObject(c),c.name=l,c.userData.isLayoutLevelObject=!0,i.add(c)),c.add(o),e.position&&o.position.set(e.position.x,e.position.y,e.position.z||0),o.matrixAutoUpdate=matrixAutoUpdate,o.updateMatrix()}convertEdgeToPoints(e){const t=[];switch(e.type){case 1/* Line */:{const r=e;t.push(new Vector2(r.startPoint.x,r.startPoint.y)),t.push(new Vector2(r.endPoint.x,r.endPoint.y));break}case 2/* Arc */:{const r=e;let i=r.startAngle*MathUtils.DEG2RAD,n=r.endAngle*MathUtils.DEG2RAD;r.bCounterclockwise||(i=2*Math.PI-i,n=2*Math.PI-n);const s=new ArcCurve(r.center.x,r.center.y,r.radius,i,n,!r.bCounterclockwise),a=this.getDivision(i,n,r.radius);t.push(...s.getPoints(a));break}case 3/* Ellipse */:{const r=e,i=Math.sqrt(Math.pow(r.majorAxisEndPoint.x,2)+Math.pow(r.majorAxisEndPoint.y,2)),n=i*r.minorRatio,s=Math.atan2(r.majorAxisEndPoint.y,r.majorAxisEndPoint.x);let a=r.startAngle*MathUtils.DEG2RAD,o=r.endAngle*MathUtils.DEG2RAD;r.bCounterclockwise||(a=2*Math.PI-a,o=2*Math.PI-o);const l=new EllipseCurve(r.center.x,r.center.y,i,n,a,o,!r.bCounterclockwise,s),c=this.getDivision(a,o,Math.max(i,n));t.push(...l.getPoints(c));break}case 4/* Spline */:{const r=e;t.push(...r.controlPoints);break}case 0/* Polyline */:{const r=e;t.push(...getLinePoints(r.points,r.isClosed));break}}return t}drawHatch(e,t,r){var i;const n=e;if(0==n.boundaryPaths.length)return;const s=[],a=[],o=[];if(n.boundaryPaths.forEach(((e,t)=>{if(this.IsfilteredByPathTypeFlag(e.pathTypeFlag)){const r="[DxfLoader] The %d path type flag is filtered at the %dth boundrayPath (hatch handle '%s')";return void log.info(r,e.pathTypeFlag,t,n.handle)}const r=e.edges;if(0===r.length)return;const i=[];for(let e=0;e31/* MaxFlags */){const r=e=>{for(let t=1;tnew Vector2(CommonUtils.roundNumber(e.x,7),CommonUtils.roundNumber(e.y,7))));if((null==l?void 0:l.length)>0){s.push(l);const e=(new Box2).setFromPoints(l);a.push(e);const t=e.getSize(tempVec23),r=t.x*t.y;o.push({area:r,index:s.length-1})}})),0===s.length)return;const l=new Vector2,c=this.checkAndRebasePolygonsOnRTC(s,l);o.sort(((e,t)=>e.area-t.area));const u=[];o.forEach((e=>{u.push(e.index)}));const h=this.buildContainHierarchyTree(s,a,u),p=[];let d;if(this.buildHatchGeometry(s,h,p),p.length>0&&(d=mergeBufferGeometries(p)),!d||!d.getIndex()||0===(null==(i=d.getIndex())?void 0:i.count))return void log.warn("[DxfLoader] Failed to convert hatch boundaries!");const m=new Mesh(d,Default_MeshMaterial);m.layers.set(layerForNonSnapableObjects),this.setHatchMaterial(m,n,t,l,r);const f=m;return c?(this.setRTCUserData(m),f.position.x+=l.x,f.position.y+=l.y):GeometryUtils.shouldRebasePositionOnRTC(f.position)&&this.setRTCUserData(f),f}drawOle2frame(e,t){const{leftUpX:r,leftUpY:i,rightDownX:n,rightDownY:s}=e;if(!(r&&i&&n&&s))return;const a=[new Vector2(r,i),new Vector2(r,s),new Vector2(n,s),new Vector2(n,i),new Vector2(r,i)],o=new Vector3;let l=!1;this.enableRTC&&(l=GeometryUtils.checkAndRebasePositionsOnRTC(a,o));const c=(new BufferGeometry).setFromPoints(a),u=this.getLineBasicMaterial(16777215),h=new Line(c,u);l&&(this.setRTCUserData(h),h.position.x+=o.x,h.position.y+=o.y);const p=new Group;let d;p.add(h);const m=t.objects.DICTIONARY;for(const t of m){const r=t;for(const t in r.entries)if(r.entries[t]===e.handle){d=t;break}}let f;if(d)if(this.meshTextureMaterials[d])f=this.meshTextureMaterials[d];else for(let e=0;e1?p:h} // base on https://github.com/mozman/ezdxf/blob/master/src/ezdxf/math/ucs.py#L34 static getOcsMatrix(e){let t=XAxis,r=YAxis,i=ZAxis;const n=new Vector3(0,1,0),s=new Vector3(0,0,1);if(!MathUtils2.areVectorsClose(e,s)){i=e.clone().normalize();return MathUtils2.areVectorsClose(i,s)||(t=Math.abs(i.x)<1/64&&Math.abs(i.y)<1/64?n.cross(i).normalize():s.cross(i).normalize(),r=i.clone().cross(t).normalize()),tempMatrix3.set(t.x,t.y,t.z,0,r.x,r.y,r.z,0,i.x,i.y,i.z,0,0,0,0,1)}return tempMatrix3.identity()}static getDcs2WcsMatrix(e,t){let r;r=isIViewport(e)?e.viewDirectionFromTarget:e.viewDirection;const i=new Vector3(r.x,r.y,r.z),n=new Vector3(e.viewTarget.x,e.viewTarget.y,e.viewTarget.z),s=e.viewTwistAngle;let a,o,l;l=i.clone().normalize(),a=ZAxis.clone().cross(i),a.length()>0?(a.normalize(),o=l.clone().cross(a)):l.z<0?(a=XAxis.clone().negate(),o=YAxis,l=ZAxis.clone().negate()):(a=XAxis,o=YAxis,l=ZAxis);const c=new Matrix4,u=tempMatrix3.identity();return u.makeBasis(a,o,l),c.premultiply(u),c.premultiply(tempMatrix3.identity().compose(n.clone(),(new Quaternion).setFromAxisAngle(new Vector3(0,0,1),MathUtils.degToRad(t?s:-s)),new Vector3(1,1,1))),c}getViewportMsToPsMatrix(e){const t=new Vector3(e.centerPoint_dcs.x,e.centerPoint_dcs.y,0),r=new Vector3(e.centerPoint.x,e.centerPoint.y,e.centerPoint.z),i=e.viewHeight/e.height_paperSpace,n=_DXFLoader.getDcs2WcsMatrix(e,this.angDir),s=new Matrix4;s.setPosition(Origin.clone().sub(r));const a=scaleTempMatrix.identity();a.scale(tempVector2.set(i,i,i));const o=translateTempMatrix.identity().setPosition(Origin.clone().sub(r));a.premultiply(o.clone().invert()).multiply(o),s.multiply(a);const l=tempMatrix3.identity();l.setPosition(t),n.multiply(l);const c=tempMatrix3.identity();return s.invert().multiply(c).multiply(n.invert())}drawViewport(e,t,r){const i=e;if("1"==i.viewportId)return e.psBBox=new Box3,void(e.msToPsMatrix=new Matrix4);const n=[],s=i.centerPoint,a=i.width_paperSpace/2,o=i.height_paperSpace/2;n.push(new Vector3(s.x-a,s.y-o,0)),n.push(new Vector3(s.x-a,s.y+o,0)),n.push(new Vector3(s.x+a,s.y+o,0)),n.push(new Vector3(s.x+a,s.y-o,0)),n.push(n[0]),e.psBBox=new Box3(n[0],n[2]),e.msToPsMatrix=this.getViewportMsToPsMatrix(i);const l=new Vector3;let c=!1;this.enableRTC&&(c=GeometryUtils.checkAndRebasePositionsOnRTC(n,l));const u=(new BufferGeometry).setFromPoints(n),h=new Line(u,Default_LineMaterial);c&&(this.setRTCUserData(h),h.position.x+=l.x,h.position.y+=l.y),h.userData.entityType=e.type;const p=new Group;p.add(h);const d=e.psBBox.clone();d.applyMatrix4(e.msToPsMatrix.clone().invert()),d.min.z=0,d.max.z=0;const m=[];m.push(d.min),m.push(new Vector3(d.min.x,d.max.y,0)),m.push(d.max),m.push(new Vector3(d.max.x,d.min.y,0)),m.push(m[0]);const f=new Vector3;let g=!1;this.enableRTC&&(g=GeometryUtils.checkAndRebasePositionsOnRTC(m,f));const _=(new BufferGeometry).setFromPoints(m),y=new Line(_,Default_LineMaterial);return g&&(this.setRTCUserData(y),y.position.x+=f.x,y.position.y+=f.y),y.userData.entityType=e.type,y.userData.inPaperSpace=!0,p.add(y),h}getColor(e,t,r){var i,n,s,a,o,l;if(this.compareContext){const t=e.compareChangeType;if("Added"/* Added */===t)return DxfCompare.ENTITY_COLOR_ADDED;if("Removed"/* Removed */===t)return DxfCompare.ENTITY_COLOR_REMOVED;if("Modified"/* Modified */===t){return this.compareContext.isTheFirstFile?DxfCompare.ENTITY_COLOR_REMOVED:DxfCompare.ENTITY_COLOR_ADDED}return DxfCompare.ENTITY_COLOR_NO_CHANGE}const c=e;if(c&&c.isGradientColor){const t=c.gradientColors;if(t&&t.length>=2){if(t[0]!==t[1]){const t=`[DxfLoader] Gradient colors are not supported for hatch '${e.handle}', will use the first color!`;log.warn(t)}return t[0]}}if(e.isTrueColor)return e.color;if(e.colorIndex>0&&e.colorIndex<256)return e.color;if(0===e.colorIndex)return r?this.getColor(r,t):null==(n=null==(i=t.tables)?void 0:i.layer)?void 0:n.layers[0].color;if(256===e.colorIndex){const i=null==(a=null==(s=t.tables)?void 0:s.layer)?void 0:a.layers,n=i&&i[e.layer],c=i&&r&&i[r.layer];let u=Default_Color;return u=n&&"0"!==n.name?n.color:c?c.color:n?n.color:null==(l=null==(o=t.tables)?void 0:o.layer)?void 0:l.layers[0].color,u}return log.warn("[DxfLoader] Unknown colorIndex"),Default_Color}getLineType(e,t,r){var i,n;if(r&&"DIMENSION"===r.type)return this.getLineType(r,t);if(e.lineType!==BYLAYER&&e.lineType!==BYBLOCK)return e.lineType;if(e.lineType===BYBLOCK)return r?this.getLineType(r,t):e.lineType;const s=null==(n=null==(i=t.tables)?void 0:i.layer)?void 0:n.layers,a=Default_LineType;if("0"!==e.layer){const t=s&&s[e.layer];if(t)return t.lineType}else if(r){const e=s&&s[r.layer];if(e)return e.lineType}return a} /** * Gets entity's layer name. * Note that, when entity is in layer "0", it tries to get its parent blockEntity's layer name. */getLayerName(e,t,r){var i,n;const s=null==(n=null==(i=t.tables)?void 0:i.layer)?void 0:n.layers,a=s&&s[e.layer],o=s&&r&&s[r.layer];let l=a.name;return a&&"0"===a.name&&o&&(l=o.name),l||"0"} // TODO: hatch is handled separately setMaterial(e,t,r,i){const n=e;if(!n.geometry)return;if(this.setRenderOrderByObjectType(e),"OLE2FRAME"===t.type)return;if("MTEXT"===t.type)return void(e.renderOrder=5/* Text */);if("HATCH"===t.type)return tempVec23.set(0,0),void this.setHatchMaterial(e,t,r,tempVec23,i);let s;const a=this.getColor(t,r,i);if("LWPOLYLINE"===t.type&&(n.isMesh?(s=this.getMeshBasicMaterial(a),e.renderOrder=1/* LineWithWidth */):e.userData.isOutline&&(s=this.getLineBasicMaterial(a),e.renderOrder=3/* LineWithPattern */),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/* Text */;else if("LEADER"===t.type||"MULTILEADER"===t.type||"VIEWPORT"===t.type)s=this.getLineBasicMaterial(a);else if("POINT"===t.type)s=this.getPointsMaterial(a);else{if(e.material instanceof PointsMaterial)return s=this.getPointsMaterial(a),void(n.material=s);const o=r.tables.lineType.lineTypes[this.getLineType(t,r,i)],l=t.lineTypeScale||1;o&&o.pattern&&0!==o.pattern.length?(s=this.getLineShaderMaterial(o,a,l),e.renderOrder=3/* LineWithPattern */):s=this.getLineBasicMaterial(a)}n.material=s}}setHatchMaterial(e,t,r,i,n){const s=e;if(!s.geometry)return;const a=this.getColor(t,r,n);if(s.isLine)return void(s.material=this.getLineBasicMaterial(a));let o,l=-1/* Mesh */;if(t.solidFill)o=this.getMeshBasicMaterial(a);else{if(s.material instanceof ShaderMaterial){o=s.material;const e=new Color(a);s.material.uniforms.u_color.value.equals(e)||(o=s.material.clone(),this.updateMaterialUniforms(o),o.uniforms.u_color.value.set(a))}else o=this.getHatchShaderMaterial(t,a,i);l=0/* MeshWithPattern */}o||(o=this.getMeshBasicMaterial(a),l=-1/* Mesh */),s.material=o,s.renderOrder=l}setRenderOrderByObjectType(e){const t=e;let r=0;t.isMesh?r=-1/* Mesh */:t.isLine?r=2/* Line */:t.isPoints&&(r=4/* Point */),e.renderOrder=r}getPointsMaterial(e){return this.pointsMaterials[e]||(this.pointsMaterials[e]=new PointsMaterial({size:.2,color:e})),this.pointsMaterials[e]}getLineBasicMaterial(e){return this.lineBasicMaterials[e]||(this.lineBasicMaterials[e]=new LineBasicMaterial({color:e})),this.lineBasicMaterials[e]}getLineShaderMaterial(e,t,r){const i=`${e.name}_${t}_${r}`;if(!this.lineShaderMaterials[i]){const n=this.getLineTypeScales(),s=n.ltScale*n.celtScale*r;this.lineShaderMaterials[i]=LinePatternShaders.createLineShaderMaterial(e.pattern,t,s,_DXFLoader.viewportScaleUniform,_DXFLoader.cameraZoomUniform)}return this.lineShaderMaterials[i]}getMeshBasicMaterial(e){return this.meshBasicMaterials[e]||(this.meshBasicMaterials[e]=new MeshBasicMaterial({color:e})),this.meshBasicMaterials[e]} /** * Gets shader material for drawing a hatch with pattern */getHatchShaderMaterial(e,t,r){if(!e.patternLines||e.patternLines.length<1)return;const i=this.findMatchedHatchShaderMaterial(e,t);if(i)return i;let n=2;e.patternLines.forEach((e=>{n=Math.max(e.dashPattern.length,n)}));let s=0;const a=[],o=new Vector2;for(const t of e.patternLines){const i=new Vector2(t.origin.x,t.origin.y).sub(r).rotateAround(o,-MathUtils.degToRad(e.patternAngle)),l=new Vector2(t.delta.x,t.delta.y).rotateAround(o,-MathUtils.degToRad(t.angle));if(0===l.y)return void log.warn("[DxfLoader] delta.y is equal to zero !");const c=t.dashPattern.length;let u=!0,h=0;for(let e=0;e0&&(u=!1),h+=Math.abs(r)}const p=u?.05:.005,d=[],m=[];let f=0;m[0]=f;for(let e=0;e_DXFLoader.maxFragmentUniforms){log.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)}const l=createHatchPatternShaderMaterial(a,e.patternAngle,_DXFLoader.cameraZoomUniform,new Color(t));return l.defines={MAX_PATTERN_SEGMENT_COUNT:n},this.hatchShaderMaterials.push({patternLines:e.patternLines,patternAngle:e.patternAngle,color:t,material:l}),l} /** * Gets a proper division for curve by entity count, entity size and theta angle, etc. * @param size may not be accurate, can be the radius, long size of bbox, etc. */getDivision(e,t,r){let i=Math.round(5e4/this.entityCount);i=Math.max(i,2),i=Math.min(i,10);const n=5*i;let s=2*i;if(this.averageCurveSize){s*=Math.pow(r/this.averageCurveSize,.5),s=Math.max(s,i),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+r)/(this.curveCount+1),this.curveCount++,Math.max(s,12)} /** * Gets proper simplify tolerance. * If tolerance is bigger, more points are simpified. */getSimplifyTolerance(){return.03} /** * Catches dxf data into indexedDb */setDxfDataToIndexedDb(e,t){return __async(this,null,(function*(){const r={dxfDataId:e,dxf:t};return new Promise(((t,i)=>{DxfDataTable.instance().add(r,(()=>{log.info(`[DxfLoader] Saved '${e}' to indexedDb`),t()}),(e=>{i(e)}))}))}))} /** * Gets dxf data into indexedDb */getDxfDataFromIndexedDb(e){return __async(this,null,(function*(){return new Promise(((t,r)=>{DxfDataTable.instance().query(e,(e=>{e&&e.length>0&&t(e[0].dxf),t(void 0)}),(()=>r()))}))}))}buildContainHierarchyTree(e,t,r){var i;const n=new Map,s=r.length;for(let e=0;e{0===e.children.length?i.push(e.index):n.set(e.index,e.children.map((e=>e.index)))}));const s=e=>{try{const t=new ShapeGeometry(e);t.hasAttribute("uv")&&t.deleteAttribute("uv"),t.hasAttribute("normal")&&t.deleteAttribute("normal"),r.push(t)}catch(t){log.warn(`[DxfLoader] triangulate shape error: ${e.getPoints().map((e=>e.toArray())).toString()}`)}};i.forEach((t=>{const r=e[t];if(0===r.length)return;const i=new Shape(r);s(i)}));const a=e=>e.map((e=>e.toArray()));for(const t of n){const r=new Shape(e[t[0]]);let i={regions:[],inverted:!1};const n=this.findIntersectHole(e,t[1]);n.forEach((t=>{let n={regions:[],inverted:!1};try{t.forEach(((t,s)=>{if(polybooljs.epsilon(MathUtils2.getVector2RelativeEps(e[t][0]),1e-6),0===s)n=polybooljs.segments({regions:[a(e[t])],inverted:!1});else{const s=polybooljs.segments({regions:[a(e[t])],inverted:!1}),o=polybooljs.combine(n,s);i=polybooljs.polygon(polybooljs.selectUnion(o)),i.regions.length>0?i.regions.forEach((e=>{if(0===e.length)return;const t=e.map((e=>new Vector2(e[0],e[1])));r.holes.push(new Path(t))})):log.warn("[DxfLoader] mergedHoles.regions is empty")}}))}catch(e){log.warn(`[DxfLoader] polybooljs has error: ${e}, epsilon is ${polybooljs.epsilon()}`)}}));const o=n.flat(2);for(let i=0;i{t.children.forEach((t=>{this.buildHatchGeometry(e,t,r)}))}))}findIntersectHole(e,t){const r=t.length,i=[];for(let n=0;n{e.forEach((e=>{t.add(e),r++}))})),t.divideScalar(r);let i=!1;if(this.enableRTC&&GeometryUtils.shouldRebasePositionOnRTC(t)){i=!0;for(let r=0;r{r.entries[e]&&"ACAD_SORTENTS"===r.entries[e]&&t.add(e)}))}if(0===t.size)return;const i=e.objects.SORTENTSTABLE;if(i)for(let e=0;eMath.abs(e-t)<1e-5,n=(e,t)=>i(e.angle,t.angle)&&i(e.delta.x,t.delta.x)&&i(e.delta.y,t.delta.y)&&i(e.origin.x,t.origin.x)&&i(e.origin.y,t.origin.y)&&((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;ri.color===t&&i.patternAngle===e.patternAngle&&((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r].entities */getLayout(e,t){if(!this.blockRecordsCache){this.blockRecordsCache={};const t=this.blockRecordsCache,r=e.tables.blockRecord.blockRecords;Object.values(r).forEach((e=>{t[e.handle]=e.layoutHandle}))}const r=this.blockRecordsCache[t.ownerHandle];if(r){const t=e.objects.LAYOUT.find((e=>e.handle===r));if(t)return t}if(!this.entitiesCache){this.entitiesCache={};const t=this.entitiesCache;Object.values(e.entities).forEach((e=>{t[e.handle]=e}))}const i=this.entitiesCache[t.ownerHandle];return i?this.getLayout(e,i):(log.warn("[DxfLoader] Failed to find layout name for entity:",t),e.objects.LAYOUT.find((e=>e.layoutName===_DXFLoader.MODEL_LAYOUT_NAME)))}getLayerVisible(e,t){var r,i,n;const s=null==(i=null==(r=e.tables)?void 0:r.layer)?void 0:i.layers;return s&&(null==(n=s[t])?void 0:n.visible)}getLayerFrozen(e,t){var r,i,n;const s=null==(i=null==(r=e.tables)?void 0:r.layer)?void 0:i.layers;return s&&(null==(n=s[t.layer])?void 0:n.frozen)}updateMaterialUniforms(e){e instanceof ShaderMaterial&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=_DXFLoader.cameraZoomUniform),e.uniforms.u_viewportScale&&(e.uniforms.u_viewportScale=_DXFLoader.viewportScaleUniform))}cloneMaterialsForSpatialFilter(e){const t=new Map,r=e=>{let r;return Array.isArray(e)?(r=[],e.forEach((e=>{if(t.has(e.id))r.push(t.get(e.id));else{const i=e.clone();this.updateMaterialUniforms(i),t.set(e.id,i),r.push(i)}}))):e&&(t.has(e.id)?r=t.get(e.id):(r=e.clone(),this.updateMaterialUniforms(r),t.set(e.id,r))),r};e.traverse((e=>{e.material&&(e.material=r(e.material))}))} //References https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/AutoCAD-LT/files/GUID-4323BBAD-2757-4E92-B2E4-E0E550BB37CB-htm.html getLineTypeScales(){const e={ltScale:1,celtScale:1};return this.header?(e.ltScale=this.header.$LTSCALE||1,e.celtScale=this.header.$CELTSCALE||1,e):e}static getDxfUnits(e){switch(e||0){case 0:return"Unitless"/* Unitless */;case 1:return"Inches"/* Inches */;case 2:return"Feet"/* Feet */;case 4:return"Millimeters"/* Millimeters */;case 5:return"Centimeters"/* Centimeters */;case 6:return"Meters"/* Meters */;default:log.warn(`[DxfLoader] Unsupported $INSUNITS '${e}'`)}return"Unitless"/* Unitless */} // Calculates line distances in world space static computeLineDistance(e){const t=!0===e.isLineSegments;let r=e.geometry;const i=e.matrixWorld;if(r.index&&(log.debug(`[DxfLoader] Line with id '${e.id}' contains index buffer, going to convert it to non-indexed.`),r=GeometryUtils.convertGeometryWithIndexedToNonIndexed(r)),null===r.index){const e=r.attributes.position;if(!e||0===e.count)return;const n=[];if(t)for(let t=0,r=e.count;t{let t=e;t.isLine&&t.material instanceof ShaderMaterial&&_DXFLoader.computeLineDistance(t)})),log.debug(`[DxfLoader] Computed line distances in ${(Date.now()-t)/1e3}s`)} /** * Merges objects by layer and layout. */static merge(e){const t={};e.objects.LAYOUT.forEach((e=>{var r;const i=e;t[i.layoutName]=i,null==(r=i.directAssociatedLeafObjectSet)||r.clear()}));const r=Date.now(),i={},n={};let s=0,a=0;const o=()=>{const e=Date.now();for(const e in i){const t=i[e];_DXFLoader.removeEmptyObjectsFromRemovingMarkedObjects(t.children,t.object),t.children=[]}s=0,a+=Date.now()-e};for(const r in e.layersAndThreejsObjects){const l=e.layersAndThreejsObjects[r];if(l.length<=1)continue;const c=Date.now(),u={};for(const e of l){let t,r=e;for(;r;){if(r.userData.isLayoutLevelObject){t=r;break}r=r.parent}if(!t)continue;const i=t.name;u[i]||(u[i]={object:t,children:[]}),u[i].children.push(e)}const h=[];for(const e in u){let r;if(e!==_DXFLoader.MODEL_LAYOUT_NAME){const i=t[e];i.directAssociatedLeafObjectSet||(i.directAssociatedLeafObjectSet=new Set),r=i.directAssociatedLeafObjectSet}const l=u[e],c=MergeUtils.deepMerge(l.children,l.object,!1,!1,!0),p=c.added,d=c.removed;i[e]||(i[e]={object:l.object,children:[]}),n[e]||(n[e]={object:l.object,children:[]});const m=d.length>15e3;if(m){const e=Date.now();_DXFLoader.removeEmptyObjectsFromRemovingMarkedObjects(d,l.object),a+=Date.now()-e}else s+=d.length;if(d.length===l.children.length)m||d.forEach((t=>{i[e].children.push(t)}));else{let t=d;d.length>=100&&(t=new Set(d));const n=e=>Array.isArray(t)?t.indexOf(e)>=0:t.has(e);for(let t=0;t15e3&&o()}e.layersAndThreejsObjects[r]=h,log.debug(`[DxfLoader] Merged layer '${r}' in ${(Date.now()-c)/1e3}s`)}s>0&&o();for(const t in n){const r=n[t];e.threejsObject.children.find((e=>e.name===t))||e.threejsObject.add(r.object),r.children.forEach((e=>{r.object.add(e),e.updateWorldMatrix(!1,!1)})),r.children=[]}log.debug(`[DxfLoader] MergeUtils.deepMerge costed ${MergeUtils.mergeInfo.elapsedTime/1e3}s`),log.debug(`[DxfLoader] The remove operation of deep merge costed ${a/1e3}s`),log.debug(`[DxfLoader] Deep merge totally costed ${(Date.now()-r)/1e3}s`);const l=MergeUtils.mergeInfo;log.debug(`[DxfLoader] Totally merged ${l.removedObjects} objects to ${l.mergedMeshes} meshes, ${l.mergedLines} lines, ${l.mergedPoints} points, ${l.mergedUnknownTypeObjects?l.mergedUnknownTypeObjects+" unknown type,":""} `)} // for debugging static statLayoutAndLayerObjects(e){const t=new WeakSet;let r=0;for(const i in e.layersAndThreejsObjects){e.layersAndThreejsObjects[i].forEach((e=>{e.geometry&&(r++,t.has(e)?console.warn(e):t.add(e))}))}const i=new WeakSet;let n=0;if(e.threejsObject.traverse((e=>{e.geometry&&(n++,i.has(e)?console.warn(e):i.add(e))})),r!=n)for(const t in e.layersAndThreejsObjects){e.layersAndThreejsObjects[t].forEach((e=>{e.geometry&&(i.has(e)||console.warn(e))}))}log.info(`[DxfLoader] The count of layer objects is ${r},The count of layout objects is ${n} `)} /** * First marks the objects to be removed from bottom to top, * and then removes empty objects from top to bottom */static removeEmptyObjectsFromRemovingMarkedObjects(e,t){if(0===e.length)return;const r=e=>{const i=[];for(const r of e){r.userData.validCount=0;const e=r.parent;e&&e!==t&&(void 0===e.userData.validCount&&(e.userData.validCount=e.children.length),0==--e.userData.validCount&&i.push(e))}i.length>0&&r(i)};r(e),this.removeEmptyObjectsFromMark(t)}static removeEmptyObjectsFromMark(e){if(0===e.userData.validCount||ObjectUtils.isEmptyObject(e))return e.removeFromParent(),!0;for(let t=0;t(e.Added="Added",e.Removed="Removed",e.Modified="Modified",e.NoChange="NoChange",e))(DxfChangeType||{}),id2=1,_DxfCompare=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 r,i,n;const s=null==(i=null==(r=e.tables)?void 0:r.layer)?void 0:i.layers;return s&&(null==(n=s[t.layer])?void 0:n.frozen)} /** * Compares model spaces of two dxf files. * Returns DxfChange map, the key is entity handle. */compare(e){return __async(this,null,(function*(){this.changes={};const t=[],r=new Map;return this.dxf1.entities.forEach((e=>{if(!0!==e.inPaperSpace){const r=!0===this.getLayerFrozen(this.dxf1,e);_DxfCompare.ignoreEntityTypes.includes(e.type)||r||t.push(e)}})),this.dxf2.entities.forEach((e=>{if(!0!==e.inPaperSpace){const t=!0===this.getLayerFrozen(this.dxf2,e);_DxfCompare.ignoreEntityTypes.includes(e.type)||t||r.set(e.handle,e)}})),yield this.compareEntities(t,r,void 0,e),Promise.resolve(this.changes)}))}isDimensionBlock(e){return e.includes("*D")}compareInsertOrDemensionEntities(e,t,r,i){if(!e.block||!t.block)return;const n=e.block;let s;if(this.isComparingBlock=!0,this.isDimensionBlock(n)){const r=this.dxf1.blocks[e.block],i=this.dxf2.blocks[t.block],a=Date.now();this.isComparingDimension=!0,s=this.compareBlock(r,i),this.isComparingDimension=!1,log.debug(`[DxfCompare] compare block: ${n} cost ${(Date.now()-a)/1e3}s`)}else{if(!this.comparedBlocks.has(n)){const e=this.dxf1.blocks[n],t=this.dxf2.blocks[n],r=Date.now(),i=this.compareBlock(e,t);this.comparedBlocks.set(n,i),log.debug(`[DxfCompare] compare block: ${n} cost ${(Date.now()-r)/1e3}s`)}s=this.comparedBlocks.get(n)}return null==s||s.forEach((t=>{if(t.parentHandles||(t.parentHandles=[]),r&&i)"Added"/* Added */===t.type?t.parentHandles.push(i):"Removed"/* Removed */===t.type&&t.parentHandles.push(r);else{const r=[...t.parentHandles,e.handle];("Added"/* Added */===t.type||"Removed"/* Removed */===t.type)&&(this.changes[id2]=__spreadProps(__spreadValues({id:id2},t),{parentHandles:r})),id2++}})),r||i||(this.isComparingBlock=!1),s}compareBlock(e,t){var r,i;const n=[],s=[];null==(r=null==e?void 0:e.entities)||r.forEach((e=>{"ATTDEF"===e.type||this.bIgnoreChildEntitiesOriginalType(e)||n.push(e)})),null==(i=null==t?void 0:t.entities)||i.forEach((e=>{"ATTDEF"===e.type||this.bIgnoreChildEntitiesOriginalType(e)||s.push(e)}));const a=[],o=[];for(let e=0;e0&&a.push(...n),r=!1,s.splice(e--,1);break}r=!1,s.splice(e--,1);break}r=!0}r&&(a.push({type:"Removed"/* Removed */,handle:t.handle}),o.push(t.handle))}return s.forEach((e=>{o.includes(e.handle)||a.push({type:"Added"/* Added */,handle:e.handle})})),a}compareEntities(e,t,r,i){return __async(this,null,(function*(){var n,s;const a=e.length,o=Math.round(Math.pow(a,.5));let l=Date.now();const c=e=>__async(this,null,(function*(){if(i&&(e%o==0||e===a-1)){i(new ProgressEvent("compareProgress",{loaded:e+1,total:a}));const t=500,r=Date.now();(r-l>t||e===a-1)&&(yield Viewer3DUtils.sleep(0),l=r)}}));for(let i=0;i { // // console.log(xhr.response) // var d = this.parse(xhr.response) // callback(d) // } // xhr.onerror = onerror // xhr.open("GET", src) // xhr.send(null) // } parse(e){var t={},r=new DataView(e),i=0;if(t.fileCode=r.getInt32(i,!1),9994!=t.fileCode)throw new Error("Unknown file code: "+t.fileCode);for(i+=24,t.wordLength=r.getInt32(i,!1),t.byteLength=2*t.wordLength,i+=4,t.version=r.getInt32(i,!0),i+=4,t.shapeType=r.getInt32(i,!0),i+=4,t.minX=r.getFloat64(i,!0),t.minY=r.getFloat64(i+8,!0),t.maxX=r.getFloat64(i+16,!0),t.maxY=r.getFloat64(i+24,!0),t.minZ=r.getFloat64(i+32,!0),t.maxZ=r.getFloat64(i+40,!0),t.minM=r.getFloat64(i+48,!0),t.maxM=r.getFloat64(i+56,!0),i+=64,t.records=[];i>3]&128>>t)>>7-t}setBit(e,t){var r=e>>3,i=this.u8[r],n=7&e;this.u8[r]=t?i|128>>n:i&~(128>>n)}getInt12(e){var t=e/8|0,r=this.u8[t],i=this.u8[t+1],n=this.u8[t+2],s=e%8,a=8-s,o=Math.min(12-a,8);return(((r&=~(255<>12-s)-2048}setInt12(e,t){var r=e/8|0,i=e%8,n=(t+=2048)<<12-i,s=(16711680&n)>>16,a=(65280&n)>>8,o=255&n,l=8-i,c=Math.min(12-l,8),u=Math.max(12-l-c,0),h=255<>8-(2-n))))<<8)+(i&=255<<8-Math.max(6-s,0))>>10-n)-32}setInt6(e,t){var r=e/8|0,i=e%8,n=(t+=32)<<10-i,s=(65280&n)>>8,a=255&n,o=8-i,l=Math.max(6-o,0),c=(255<>8-(2-i));this.u8[r]=(this.u8[r]&c)+s;var u=~(255<<8-l);this.u8[r+1]=(this.u8[r+1]&u)+a}test(){var e,t,r=new ArrayBuffer(3),i=new BitView(r);for(t=0;t<12;t++)for(e=-2048;e<2048;e++)if(i.setInt12(t,e),i.getInt12(t)!=e){console.log("12-bit prob at",t,e),console.log("expected",e,"got",i.getInt12(t));break}for(t=0;t<18;t++)for(e=-32;e<32;e++)if(i.setInt6(t,e),i.getInt6(t)!=e){console.log("6-bit prob at",t,e),console.log("expected",e,"got",i.getInt6(t));break}return i}},ShpThree=class{constructor(){this.LINE_MATERIAL=new LineBasicMaterial({color:0,linewidth:2,opacity:.8,transparent:!0}),this.MESH_MATERIAL=new MeshBasicMaterial({color:1926655,opacity:.8,transparent:!0})} // just one side for now /** * * @param shp * @param spherize is spherize or not. This only works well for the sameple shp for now! */ createModel(e){for(var t=[],r=[],i=0;in.push(...e)));const s=new BufferGeometry;s.setFromPoints(e),s.setIndex(n),t.push(s);const a=new BufferGeometry;e.length>2&&!e[0].equals(e[e.length-1])&&e.push(e[0]),a.setFromPoints(e),r.push(a)}else{const t=new BufferGeometry;t.setFromPoints(e),r.push(t)}}}var p=new Object3D;for(i=0;i1023||Math.abs(s-e[o+1])>1023?(r.push(i),a+=1,i=[],n=e[o],s=e[o+1],i.push(n,s),a+=4,o++):(i.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++):(r.push(i),t.push(r),r=[],i=[],a+=3);return this.storeDeltas(a,t)}deltaEncode6(e){var t=[],r=[],i=[],n=0,s=0,a=0,o=0;for(a=0;a31||Math.abs(s-e[a+1])>31?(r.push(i),o+=1,i=[],n=e[a],s=e[a+1],i.push(n,s),o+=4,a++):(i.push(e[a]-n,e[a+1]-s),n+=e[a]-n,s+=e[a+1]-s,o+=2,a++):(r.push(i),t.push(r),r=[],i=[],o+=3);return this.storeDeltas6(o,t)}storeDeltas(e,t){for(var r=new ArrayBuffer(e),i=new DataView(r),n=0,s=0;s{this.updateProgress(r,50);const e=(new SHPParser).parse(n.response),i=(new ShpThree).createModel(e);this.updateProgress(r,99),t(i)},n.onerror=i,n.open("GET",e),n.send(null)}))} /** * * @param percent a number between [0, 100] */updateProgress(e,t){if(e){e(new ProgressEvent("progress",{lengthComputable:!0,loaded:t,total:100}))}}},decoderPath="three/js/libs/draco/gltf/",LoadingHelper=class{constructor(e){this.manager=e} /** * Loads a model from local * @param url Created by URL.createObjectURL(file) * @param src Source filename, used to find out format * @param onProgress On progress callback * @returns Loaded object */loadLocalModel(e,t,r){return __async(this,null,(function*(){const i=t.toLowerCase();return i.endsWith("fbx")?this.loadFbx(e,r):i.endsWith("obj")?this.loadObj(e,r):i.endsWith("stl")?this.loadStl(e,r):i.endsWith("ifc")?this.loadIfc(e,r):i.endsWith("shp")?this.loadShp(e,r):i.endsWith("dae")?this.loadDae(e,r):i.endsWith("dxf")?this.loadDxf(e,r):i.endsWith("jpg")||i.endsWith("jpeg")||i.endsWith("png")?this.loadImage(e,r):this.loadGltf(e,r)}))}loadModel(e,t,r){return __async(this,null,(function*(){const i=e;if(!i)return Promise.resolve();let n=(null==t?void 0:t.toLowerCase())||"";if(!n){const e=i.split("?")[0].toLowerCase();if(e){const t=e.lastIndexOf(".");-1!==t&&(n=e.slice(t+1))}}return n.endsWith("fbx")?this.loadFbx(i,r):n.endsWith("obj")?this.loadObj(i,r):n.endsWith("stl")?this.loadStl(i,r):n.endsWith("ifc")?this.loadIfc(i,r):n.endsWith("shp")?this.loadShp(i,r):n.endsWith("dae")?this.loadDae(i,r):n.endsWith("dxf")?this.loadDxf(i,r):n.endsWith("jpg")||n.endsWith("jpeg")||n.endsWith("png")?this.loadImage(i,r):this.loadGltf(i,r)}))}loadGltf(e,t){return __async(this,null,(function*(){const r=this.getGltfLoader();-1!==e.indexOf("#")&&console.warn(`[LoadingHelper] '#' is not allowed in filename ${e}`),e=e.replace(/#/g,encodeURIComponent("#"));const i=yield r.loadAsync(e,t);return Promise.resolve(i.scene)}))}parseGltf(e,t,r,i){return this.getGltfLoader().parse(e,t,(e=>r(e.scene)),i)}loadFbx(e,t){return __async(this,null,(function*(){const r=new FBXLoader(this.manager),i=yield r.loadAsync(e,t);return Promise.resolve(i)}))}loadObj(e,t){return __async(this,null,(function*(){const r=new OBJLoader(this.manager),i=new MTLLoader(this.manager),n=e.replace(".obj",".mtl"),s=yield i.loadAsync(n,t);s.preload(),r.setMaterials(s);const a=yield r.loadAsync(e,t);return Promise.resolve(a)}))}loadStl(e,t){return __async(this,null,(function*(){const r=new STLLoader(this.manager),i=yield r.loadAsync(e,t);return Promise.resolve(new Mesh(i))}))}loadIfc(e,t){return __async(this,null,(function*(){const r=new IFCLoader(this.manager),i=r.ifcManager;i&&"function"==typeof i.setWasmPath&&i.setWasmPath("../three/js/libs/ifc/");const n=yield r.loadAsync(e,t);return Promise.resolve(n.mesh)}))}loadShp(e,t){return __async(this,null,(function*(){const r=new SHPLoader;return new Promise(((i,n)=>{r.load(e,(e=>{i(e)}),t,(e=>{n(e)}))}))}))}loadDae(e,t){return __async(this,null,(function*(){const r=new ColladaLoader(this.manager),i=yield r.loadAsync(e,t);return Promise.resolve(i.scene)}))}loadDxf(e,t){return __async(this,null,(function*(){this.font||console.warn("[LoadingHelper] Should set font first!");const r=new DXFLoader;try{const i=yield r.loadAsync(e,t);return Promise.resolve(i.threejsObject)}catch(e){const t=new ErrorEvent("");return Promise.reject(t)}}))}loadPly(e,t){return __async(this,null,(function*(){const r=new PLYLoader(this.manager),i=yield r.loadAsync(e,t);return Promise.resolve(new Mesh(i))}))} /** * It is kind of tricky to load image into scene, but we'll do this by creating a sprite. */loadImage(e,t){return __async(this,null,(function*(){const r=new TextureLoader(this.manager),i=yield r.loadAsync(e,t);if(!i)return Promise.reject("Failed to load image!");const n=i.image;let s=n&&n.height||10,a=n&&n.width||10;s*=10/a,a=10;const o=new MeshBasicMaterial({map:i,side:DoubleSide,transparent:!0}),l=new PlaneGeometry(a,s),c=new Mesh(l,o);return Promise.resolve(c)}))} /** * Loads dxf data, including entities, tables(layers, blocks), etc. */loadDxfDataAsync(e,t,r,i,n,s){return __async(this,null,(function*(){var a;this.font||console.warn("[LoadingHelper] Should set font first!");const o=new DXFLoader(n,s);return o.setFont(this.font),o.manager.onLoad=()=>{i&&i()},this.font.getFontData&&(yield null==(a=this.font)?void 0:a.getFontData()),o.load(e,t,r)}))} /** * Sets font. * Font is required for DxfViewer to view Chinese, etc. */setFont(e){this.font=e}getGltfLoader(){if(!this.gltfLoader){this.gltfLoader=new GLTFLoader(this.manager);const e=new DRACOLoader(this.manager);e.setDecoderPath(decoderPath),this.gltfLoader.setDRACOLoader(e)}return this.gltfLoader}}; // src/core/shp-js/BitView.ts // src/core/workers/CreateMeshBvh.worker.ts function Worker3(){return inlineWorker('var bc=Object.defineProperty,wc=Object.defineProperties;var Sc=Object.getOwnPropertyDescriptors;var Ao=Object.getOwnPropertySymbols;var Tc=Object.prototype.hasOwnProperty,Ac=Object.prototype.propertyIsEnumerable;var Eo=(r,t,e)=>t in r?bc(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ji=(r,t)=>{for(var e in t||(t={}))Tc.call(t,e)&&Eo(r,e,t[e]);if(Ao)for(var e of Ao(t))Ac.call(t,e)&&Eo(r,e,t[e]);return r},Co=(r,t)=>wc(r,Sc(t));var oo="146";var Ec=0,Po=1,Cc=2;var Ga=1,Pc=2,Oi=3,nn=0,ue=1,Ve=2,xn=0,fi=1,Lo=2,Ro=3,Io=4,Lc=5,li=100,Rc=101,Ic=102,Do=103,No=104,Dc=200,Nc=201,Fc=202,zc=203,Wa=204,qa=205,Oc=206,Bc=207,Uc=208,kc=209,Vc=210,Hc=0,Gc=1,Wc=2,Cr=3,qc=4,Xc=5,Yc=6,Zc=7,Xa=0,Jc=1,$c=2,tn=0,Kc=1,Qc=2,jc=3,tl=4,el=5,Ya=300,mi=301,gi=302,Pr=303,Lr=304,Ds=306,Rr=1e3,Ne=1001,Ir=1002,ce=1003,Fo=1004;var zo=1005;var Ee=1006,nl=1007;var Ns=1008;var zn=1009,il=1010,sl=1011,Za=1012,rl=1013,Rn=1014,In=1015,ki=1016,ol=1017,al=1018,di=1020,cl=1021,ll=1022,Fe=1023,hl=1024,ul=1025,Nn=1026,xi=1027,fl=1028,dl=1029,pl=1030,ml=1031,gl=1033,$s=33776,Ks=33777,Qs=33778,js=33779,Oo=35840,Bo=35841,Uo=35842,ko=35843,xl=36196,Vo=37492,Ho=37496,Go=37808,Wo=37809,qo=37810,Xo=37811,Yo=37812,Zo=37813,Jo=37814,$o=37815,Ko=37816,Qo=37817,jo=37818,ta=37819,ea=37820,na=37821,ia=36492;var ys=2300,vs=2301,tr=2302,sa=2400,ra=2401,oa=2402;var On=3e3,Vt=3001,_l=3200,yl=3201,vl=0,Ml=1;var je="srgb",Dn="srgb-linear";var er=7680;var bl=519,aa=35044;var ca="300 es",Dr=1035,_n=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>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 le(r,t,e){return Math.max(t,Math.min(e,r))}function wl(r,t){return(r%t+t)%t}function ir(r,t,e){return(1-e)*r+e*t}function ha(r){return(r&r-1)===0&&r!==0}function Nr(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $i(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 _e(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}},he=class{constructor(){he.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],b=i[1],y=i[4],_=i[7],M=i[2],T=i[5],C=i[8];return s[0]=a*p+o*b+c*M,s[3]=a*d+o*y+c*T,s[6]=a*g+o*_+c*C,s[1]=l*p+h*b+f*M,s[4]=l*d+h*y+f*T,s[7]=l*g+h*_+f*C,s[2]=u*p+m*b+x*M,s[5]=u*d+m*y+x*T,s[8]=u*g+m*_+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){let n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){let e=Math.cos(t),n=Math.sin(t),i=this.elements,s=i[0],a=i[3],o=i[6],c=i[1],l=i[4],h=i[7];return i[0]=e*s+n*c,i[3]=e*a+n*l,i[6]=e*o+n*h,i[1]=-n*s+e*c,i[4]=-n*a+e*l,i[7]=-n*o+e*h,this}translate(t,e){let n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],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)}};function Ja(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function Ms(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Fn(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function _s(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var sr={[je]:{[Dn]:Fn},[Dn]:{[je]:_s}},Le={legacyMode:!0,get workingColorSpace(){return Dn},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(sr[t]&&sr[t][e]!==void 0){let n=sr[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},Re={h:0,s:0,l:0},Ki={h:0,s:0,l:0};function rr(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 Qi(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=je){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Le.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Dn){return this.r=t,this.g=e,this.b=n,Le.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Dn){if(t=wl(t,1),e=le(e,0,1),n=le(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=rr(a,s,t+1/3),this.g=rr(a,s,t),this.b=rr(a,s,t-1/3)}return Le.toWorkingColorSpace(this,i),this}setStyle(t,e=je){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,Le.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,Le.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,Le.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,Le.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=je){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=Fn(t.r),this.g=Fn(t.g),this.b=Fn(t.b),this}copyLinearToSRGB(t){return this.r=_s(t.r),this.g=_s(t.g),this.b=_s(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=je){return Le.fromWorkingColorSpace(Qi(this,Wt),t),le(Wt.r*255,0,255)<<16^le(Wt.g*255,0,255)<<8^le(Wt.b*255,0,255)<<0}getHexString(t=je){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Dn){Le.fromWorkingColorSpace(Qi(this,Wt),e);let n=Wt.r,i=Wt.g,s=Wt.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+(i2048||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=Ms("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;a1)switch(this.wrapS){case Rr:t.x=t.x-Math.floor(t.x);break;case Ne:t.x=t.x<0?0:1;break;case Ir: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 Ne:t.y=t.y<0?0:1;break;case Ir: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)}};we.DEFAULT_IMAGE=null;we.DEFAULT_MAPPING=Ya;var qt=class{constructor(t=0,e=0,n=0,i=1){qt.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 y=(l+1)/2,_=(m+1)/2,M=(g+1)/2,T=(h+u)/4,C=(f+p)/4,v=(x+d)/4;return y>_&&y>M?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=T/n,s=C/n):_>M?_<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(_),n=T/i,s=v/i):M<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(M),n=C/s,i=v/s),this.set(n,i,s,e),this}let b=Math.sqrt((d-x)*(d-x)+(f-p)*(f-p)+(u-h)*(u-h));return Math.abs(b)<.001&&(b=1),this.x=(d-x)/b,this.y=(f-p)/b,this.z=(u-h)/b,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}},sn=class extends _n{constructor(t=1,e=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new qt(0,0,t,e),this.scissorTest=!1,this.viewport=new qt(0,0,t,e);let i={width:t,height:e,depth:1};this.texture=new we(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:Ee,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 ws(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"})}},Ss=class extends we{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=Ne,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Fr=class extends we{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=Ne,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var yn=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,b=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){let M=Math.sqrt(y),T=Math.atan2(M,g*b);d=Math.sin(d*T)/M,o=Math.sin(o*T)/M}let _=o*b;if(c=c*d+u*_,l=l*d+m*_,h=h*d+x*_,f=f*d+p*_,d===1-o){let M=1/Math.sqrt(c*c+l*l+h*h+f*f);c*=M,l*=M,h*=M,f*=M}}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 nMath.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(le(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}},P=class{constructor(t=0,e=0,n=0){P.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,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 ar.copy(this).projectOnVector(t),this.sub(ar)}reflect(t){return this.sub(ar.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(le(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}},ar=new P,ua=new yn,oe=class{constructor(t=new P(1/0,1/0,1/0),e=new P(-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;cs&&(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;cs&&(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;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,An),An.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(Di),ji.subVectors(this.max,Di),$n.subVectors(t.a,Di),Kn.subVectors(t.b,Di),Qn.subVectors(t.c,Di),ln.subVectors(Kn,$n),hn.subVectors(Qn,Kn),En.subVectors($n,Qn);let e=[0,-ln.z,ln.y,0,-hn.z,hn.y,0,-En.z,En.y,ln.z,0,-ln.x,hn.z,0,-hn.x,En.z,0,-En.x,-ln.y,ln.x,0,-hn.y,hn.x,0,-En.y,En.x,0];return!lr(e,$n,Kn,Qn,ji)||(e=[1,0,0,0,1,0,0,0,1],!lr(e,$n,Kn,Qn,ji))?!1:(ts.crossVectors(ln,hn),e=[ts.x,ts.y,ts.z],lr(e,$n,Kn,Qn,ji))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return An.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize(An).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:(Ze[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ze[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ze[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ze[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ze[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ze[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ze[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ze[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ze),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)}},Ze=[new P,new P,new P,new P,new P,new P,new P,new P],An=new P,cr=new oe,$n=new P,Kn=new P,Qn=new P,ln=new P,hn=new P,En=new P,Di=new P,ji=new P,ts=new P,Cn=new P;function lr(r,t,e,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Cn.fromArray(r,s);let o=i.x*Math.abs(Cn.x)+i.y*Math.abs(Cn.y)+i.z*Math.abs(Cn.z),c=t.dot(Cn),l=e.dot(Cn),h=n.dot(Cn);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>o)return!1}return!0}var Tl=new oe,Ni=new P,hr=new P,Bn=class{constructor(t=new P,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):Tl.setFromPoints(t).getCenter(n);let i=0;for(let s=0,a=t.length;sthis.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):(hr.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Ni.copy(t.center).add(hr)),this.expandByPoint(Ni.copy(t.center).sub(hr))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Je=new P,ur=new P,es=new P,un=new P,fr=new P,ns=new P,dr=new P,zr=class{constructor(t=new P,e=new P(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){ur.copy(t).add(e).multiplyScalar(.5),es.copy(e).sub(t).normalize(),un.copy(this.origin).sub(ur);let s=t.distanceTo(e)*.5,a=-this.direction.dot(es),o=un.dot(this.direction),c=-un.dot(es),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(es).multiplyScalar(u).add(ur),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=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=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,Je)!==null}intersectTriangle(t,e,n,i,s){fr.subVectors(e,t),ns.subVectors(n,t),dr.crossVectors(fr,ns);let a=this.direction.dot(dr),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(ns.crossVectors(un,ns));if(c<0)return null;let l=o*this.direction.dot(fr.cross(un));if(l<0||c+l>a)return null;let h=-o*un.dot(dr);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/jn.setFromMatrixColumn(t,0).length(),s=1/jn.setFromMatrixColumn(t,1).length(),a=1/jn.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(Al,t,El)}lookAt(t,e,n){let i=this.elements;return ye.subVectors(t,e),ye.lengthSq()===0&&(ye.z=1),ye.normalize(),fn.crossVectors(n,ye),fn.lengthSq()===0&&(Math.abs(n.z)===1?ye.x+=1e-4:ye.z+=1e-4,ye.normalize(),fn.crossVectors(n,ye)),fn.normalize(),is.crossVectors(ye,fn),i[0]=fn.x,i[4]=is.x,i[8]=ye.x,i[1]=fn.y,i[5]=is.y,i[9]=ye.y,i[2]=fn.z,i[6]=is.z,i[10]=ye.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],b=n[3],y=n[7],_=n[11],M=n[15],T=i[0],C=i[4],v=i[8],A=i[12],L=i[1],B=i[5],q=i[9],F=i[13],I=i[2],U=i[6],Z=i[10],J=i[14],G=i[3],N=i[7],O=i[11],et=i[15];return s[0]=a*T+o*L+c*I+l*G,s[4]=a*C+o*B+c*U+l*N,s[8]=a*v+o*q+c*Z+l*O,s[12]=a*A+o*F+c*J+l*et,s[1]=h*T+f*L+u*I+m*G,s[5]=h*C+f*B+u*U+m*N,s[9]=h*v+f*q+u*Z+m*O,s[13]=h*A+f*F+u*J+m*et,s[2]=x*T+p*L+d*I+g*G,s[6]=x*C+p*B+d*U+g*N,s[10]=x*v+p*q+d*Z+g*O,s[14]=x*A+p*F+d*J+g*et,s[3]=b*T+y*L+_*I+M*G,s[7]=b*C+y*B+_*U+M*N,s[11]=b*v+y*q+_*Z+M*O,s[15]=b*A+y*F+_*J+M*et,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],b=f*d*l-p*u*l+p*c*m-o*d*m-f*c*g+o*u*g,y=x*u*l-h*d*l-x*c*m+a*d*m+h*c*g-a*u*g,_=h*p*l-x*f*l+x*o*m-a*p*m-h*o*g+a*f*g,M=x*f*c-h*p*c-x*o*u+a*p*u+h*o*d-a*f*d,T=e*b+n*y+i*_+s*M;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let C=1/T;return t[0]=b*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]=y*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]=_*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]=M*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,b=c*l,y=c*h,_=c*f,M=n.x,T=n.y,C=n.z;return i[0]=(1-(p+g))*M,i[1]=(m+_)*M,i[2]=(x-y)*M,i[3]=0,i[4]=(m-_)*T,i[5]=(1-(u+g))*T,i[6]=(d+b)*T,i[7]=0,i[8]=(x+y)*C,i[9]=(d-b)*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=jn.set(i[0],i[1],i[2]).length(),a=jn.set(i[4],i[5],i[6]).length(),o=jn.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],Ie.copy(this);let l=1/s,h=1/a,f=1/o;return Ie.elements[0]*=l,Ie.elements[1]*=l,Ie.elements[2]*=l,Ie.elements[4]*=h,Ie.elements[5]*=h,Ie.elements[6]*=h,Ie.elements[8]*=f,Ie.elements[9]*=f,Ie.elements[10]*=f,e.setFromRotationMatrix(Ie),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}},jn=new P,Ie=new zt,Al=new P(0,0,0),El=new P(1,1,1),fn=new P,is=new P,ye=new P,fa=new zt,da=new yn,Un=class{constructor(t=0,e=0,n=0,i=Un.DefaultOrder){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(le(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(-le(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(le(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(-le(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(le(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(-le(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 fa.makeRotationFromQuaternion(t),this.setFromRotationMatrix(fa,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return da.setFromEuler(this),this.setFromQuaternion(da,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}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}};Un.DefaultOrder="XYZ";Un.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Ts=class{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let n=0;n0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(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;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){De.subVectors(i,e),Ke.subVectors(n,e),pr.subVectors(t,e);let a=De.dot(De),o=De.dot(Ke),c=De.dot(pr),l=Ke.dot(Ke),h=Ke.dot(pr),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,Qe),Qe.x>=0&&Qe.y>=0&&Qe.x+Qe.y<=1}static getUV(t,e,n,i,s,a,o,c){return this.getBarycoord(t,e,n,i,Qe),c.set(0,0),c.addScaledVector(s,Qe.x),c.addScaledVector(a,Qe.y),c.addScaledVector(o,Qe.z),c}static isFrontFacing(t,e,n,i){return De.subVectors(n,e),Ke.subVectors(t,e),De.cross(Ke).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 De.subVectors(this.c,this.b),Ke.subVectors(this.a,this.b),De.cross(Ke).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ne.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ne.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,s){return ne.getUV(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return ne.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ne.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;ei.subVectors(i,n),ni.subVectors(s,n),mr.subVectors(t,n);let c=ei.dot(mr),l=ni.dot(mr);if(c<=0&&l<=0)return e.copy(n);gr.subVectors(t,i);let h=ei.dot(gr),f=ni.dot(gr);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(ei,a);xr.subVectors(t,s);let m=ei.dot(xr),x=ni.dot(xr);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(ni,o);let d=h*x-m*f;if(d<=0&&f-h>=0&&m-x>=0)return ya.subVectors(s,i),o=(f-h)/(f-h+(m-x)),e.copy(i).addScaledVector(ya,o);let g=1/(d+p+u);return a=p*g,o=u*g,e.copy(n).addScaledVector(ei,a).addScaledVector(ni,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},Il=0,_i=class extends _n{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Il++}),this.uuid=Gi(),this.name="",this.type="Material",this.blending=fi,this.side=nn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Wa,this.blendDst=qa,this.blendEquation=li,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Cr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=bl,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.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!==fi&&(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.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),JSON.stringify(this.userData)!=="{}"&&(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.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++}},As=class extends _i{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 P,rs=new At,Xt=class{constructor(t,e,n){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===!0,this.usage=aa,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;i0&&(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;f0&&(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;u0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;se.far?null:{distance:l,point:fs.clone(),object:r}}function ds(r,t,e,n,i,s,a,o,c,l,h,f){dn.fromBufferAttribute(i,l),pn.fromBufferAttribute(i,h),mn.fromBufferAttribute(i,f);let u=r.morphTargetInfluences;if(s&&u){os.set(0,0,0),as.set(0,0,0),cs.set(0,0,0);for(let x=0,p=s.length;x0?1:-1,h.push(N.x,N.y,N.z),f.push($/C),f.push(1-O/v),J+=1}}for(let O=0;O0&&(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}},Ps=class extends fe{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)}},Me=class extends Ps{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=la*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(nr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return la*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}},ri=90,oi=1,Or=class extends fe{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;let i=new Me(ri,oi,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new P(1,0,0)),this.add(i);let s=new Me(ri,oi,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new P(-1,0,0)),this.add(s);let a=new Me(ri,oi,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new P(0,1,0)),this.add(a);let o=new Me(ri,oi,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new P(0,-1,0)),this.add(o);let c=new Me(ri,oi,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new P(0,0,1)),this.add(c);let l=new Me(ri,oi,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new P(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=tn,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}},Ls=class extends we{constructor(t,e,n,i,s,a,o,c,l,h){t=t!==void 0?t:[],e=e!==void 0?e:mi,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}},Br=class extends sn{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 Ls(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:Ee}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 \n\t\t\t\t\t#include \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 \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 kn(5,5,5),s=new rn({name:"CubemapFromEquirect",uniforms:yi(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:ue,blending:xn});s.uniforms.tEquirect.value=e;let a=new He(i,s),o=e.minFilter;return e.minFilter===Ns&&(e.minFilter=Ee),new Or(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)}},Sr=new P,Ul=new P,kl=new he,be=class{constructor(t=new P(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=Sr.subVectors(n,e).cross(Ul.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(Sr),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||kl.getNormalMatrix(t),i=this.coplanarPoint(Sr).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)}},ai=new Bn,ps=new P,Rs=class{constructor(t=new be,e=new be,n=new be,i=new be,s=new be,a=new be){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],b=n[14],y=n[15];return e[0].setComponents(o-i,f-c,p-u,y-d).normalize(),e[1].setComponents(o+i,f+c,p+u,y+d).normalize(),e[2].setComponents(o+s,f+l,p+m,y+g).normalize(),e[3].setComponents(o-s,f-l,p-m,y-g).normalize(),e[4].setComponents(o-a,f-h,p-x,y-b).normalize(),e[5].setComponents(o+a,f+h,p+x,y+b).normalize(),this}intersectsObject(t){let e=t.geometry;return e.boundingSphere===null&&e.computeBoundingSphere(),ai.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ai)}intersectsSprite(t){return ai.center.set(0,0,0),ai.radius=.7071067811865476,ai.applyMatrix4(t.matrixWorld),this.intersectsSphere(ai)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)0?t.max.x:t.min.x,ps.y=i.normal.y>0?t.max.y:t.min.y,ps.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(ps)<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 Ka(){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 Vl(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)}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 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`,Kl=`#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`,Ql=`#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`,th=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,eh=`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`,nh=`#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`,ih=`#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif`,sh=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif`,rh=`#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif`,oh=`#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`,ah=`#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}`,ch=`#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`,lh=`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`,hh=`#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`,uh=`#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif`,fh=`#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,dh=`#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`,ph="gl_FragColor = linearToOutputTexel( gl_FragColor );",mh=`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}`,gh=`#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`,xh=`#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`,_h=`#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`,yh=`#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`,vh=`#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`,Mh=`#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`,bh=`#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`,wh=`#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`,Sh=`#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`,Th=`#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}`,Ah=`#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif`,Eh=`#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`,Ch=`LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`,Ph=`varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)`,Lh=`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`,Rh=`#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`,Ih=`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`,Dh=`varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)`,Nh=`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,Fh=`varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)`,zh=`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`,Oh=`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}`,Bh=`\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,Uh=`#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`,kh=`#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`,Vh=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,Hh=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,Gh=`#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`,Wh=`#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`,qh=`#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`,Xh=`#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`,Yh=`#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`,Zh=`#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`,Jh=`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`,$h=`#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`,Kh=`#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`,Qh=`#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`,jh=`#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`,tu=`#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`,eu=`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;`,nu=`#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`,iu=`#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`,su=`#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`,ru=`#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`,ou=`#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`,au=`#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif`,cu=`#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`,lu=`#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`,hu=`#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`,uu=`#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 );`,fu=`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}`,du=`#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`,pu=`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,mu=`#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,gu=`#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`,xu=`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`,_u=`#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`,yu=`#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif`,vu=`#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`,Mu=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif`,bu=`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}`,wu=`#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`,Su=`#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`,Tu=`#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`,Au=`#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`,Eu=`float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`,Cu=`#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`,Pu=`#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,Lu=`#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; }`,Ru=`#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`,Iu=`#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`,Du=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif`,Nu=`#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`,Fu=`#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif`,zu=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif`,Ou=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif`,Bu=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif`,Uu=`#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`,ku=`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}`,Vu=`uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include \n\t#include \n}`,Hu=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`,Gu=`#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}`,Wu=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}`,qu=`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 \n\t#include \n}`,Xu=`#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}`,Yu=`#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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}`,Zu=`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}`,Ju=`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}`,$u=`varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}`,Ku=`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}`,Qu=`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,ju=`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,tf=`#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,ef=`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,nf=`#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,sf=`#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,rf=`#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}`,of=`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,af=`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}`,cf=`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}`,lf=`#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,hf=`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,uf=`#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}`,ff=`#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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,df=`#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}`,pf=`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,mf=`uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}`,gf=`uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,xf=`#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}`,_f=`uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}`,yf=`uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}`,vf=`uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}`,bt={alphamap_fragment:Hl,alphamap_pars_fragment:Gl,alphatest_fragment:Wl,alphatest_pars_fragment:ql,aomap_fragment:Xl,aomap_pars_fragment:Yl,begin_vertex:Zl,beginnormal_vertex:Jl,bsdfs:$l,iridescence_fragment:Kl,bumpmap_pars_fragment:Ql,clipping_planes_fragment:jl,clipping_planes_pars_fragment:th,clipping_planes_pars_vertex:eh,clipping_planes_vertex:nh,color_fragment:ih,color_pars_fragment:sh,color_pars_vertex:rh,color_vertex:oh,common:ah,cube_uv_reflection_fragment:ch,defaultnormal_vertex:lh,displacementmap_pars_vertex:hh,displacementmap_vertex:uh,emissivemap_fragment:fh,emissivemap_pars_fragment:dh,encodings_fragment:ph,encodings_pars_fragment:mh,envmap_fragment:gh,envmap_common_pars_fragment:xh,envmap_pars_fragment:_h,envmap_pars_vertex:yh,envmap_physical_pars_fragment:Rh,envmap_vertex:vh,fog_vertex:Mh,fog_pars_vertex:bh,fog_fragment:wh,fog_pars_fragment:Sh,gradientmap_pars_fragment:Th,lightmap_fragment:Ah,lightmap_pars_fragment:Eh,lights_lambert_fragment:Ch,lights_lambert_pars_fragment:Ph,lights_pars_begin:Lh,lights_toon_fragment:Ih,lights_toon_pars_fragment:Dh,lights_phong_fragment:Nh,lights_phong_pars_fragment:Fh,lights_physical_fragment:zh,lights_physical_pars_fragment:Oh,lights_fragment_begin:Bh,lights_fragment_maps:Uh,lights_fragment_end:kh,logdepthbuf_fragment:Vh,logdepthbuf_pars_fragment:Hh,logdepthbuf_pars_vertex:Gh,logdepthbuf_vertex:Wh,map_fragment:qh,map_pars_fragment:Xh,map_particle_fragment:Yh,map_particle_pars_fragment:Zh,metalnessmap_fragment:Jh,metalnessmap_pars_fragment:$h,morphcolor_vertex:Kh,morphnormal_vertex:Qh,morphtarget_pars_vertex:jh,morphtarget_vertex:tu,normal_fragment_begin:eu,normal_fragment_maps:nu,normal_pars_fragment:iu,normal_pars_vertex:su,normal_vertex:ru,normalmap_pars_fragment:ou,clearcoat_normal_fragment_begin:au,clearcoat_normal_fragment_maps:cu,clearcoat_pars_fragment:lu,iridescence_pars_fragment:hu,output_fragment:uu,packing:fu,premultiplied_alpha_fragment:du,project_vertex:pu,dithering_fragment:mu,dithering_pars_fragment:gu,roughnessmap_fragment:xu,roughnessmap_pars_fragment:_u,shadowmap_pars_fragment:yu,shadowmap_pars_vertex:vu,shadowmap_vertex:Mu,shadowmask_pars_fragment:bu,skinbase_vertex:wu,skinning_pars_vertex:Su,skinning_vertex:Tu,skinnormal_vertex:Au,specularmap_fragment:Eu,specularmap_pars_fragment:Cu,tonemapping_fragment:Pu,tonemapping_pars_fragment:Lu,transmission_fragment:Ru,transmission_pars_fragment:Iu,uv_pars_fragment:Du,uv_pars_vertex:Nu,uv_vertex:Fu,uv2_pars_fragment:zu,uv2_pars_vertex:Ou,uv2_vertex:Bu,worldpos_vertex:Uu,background_vert:ku,background_frag:Vu,backgroundCube_vert:Hu,backgroundCube_frag:Gu,cube_vert:Wu,cube_frag:qu,depth_vert:Xu,depth_frag:Yu,distanceRGBA_vert:Zu,distanceRGBA_frag:Ju,equirect_vert:$u,equirect_frag:Ku,linedashed_vert:Qu,linedashed_frag:ju,meshbasic_vert:tf,meshbasic_frag:ef,meshlambert_vert:nf,meshlambert_frag:sf,meshmatcap_vert:rf,meshmatcap_frag:of,meshnormal_vert:af,meshnormal_frag:cf,meshphong_vert:lf,meshphong_frag:hf,meshphysical_vert:uf,meshphysical_frag:ff,meshtoon_vert:df,meshtoon_frag:pf,points_vert:mf,points_frag:gf,shadow_vert:xf,shadow_frag:_f,sprite_vert:yf,sprite_frag:vf},tt={common:{diffuse:{value:new Ot(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new he},uv2Transform:{value:new he},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 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 he}},sprite:{diffuse:{value:new Ot(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 he}}},ke={basic:{uniforms:re([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.fog]),vertexShader:bt.meshbasic_vert,fragmentShader:bt.meshbasic_frag},lambert:{uniforms:re([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,tt.lights,{emissive:{value:new Ot(0)}}]),vertexShader:bt.meshlambert_vert,fragmentShader:bt.meshlambert_frag},phong:{uniforms:re([tt.common,tt.specularmap,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,tt.lights,{emissive:{value:new Ot(0)},specular:{value:new Ot(1118481)},shininess:{value:30}}]),vertexShader:bt.meshphong_vert,fragmentShader:bt.meshphong_frag},standard:{uniforms:re([tt.common,tt.envmap,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.roughnessmap,tt.metalnessmap,tt.fog,tt.lights,{emissive:{value:new Ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag},toon:{uniforms:re([tt.common,tt.aomap,tt.lightmap,tt.emissivemap,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.gradientmap,tt.fog,tt.lights,{emissive:{value:new Ot(0)}}]),vertexShader:bt.meshtoon_vert,fragmentShader:bt.meshtoon_frag},matcap:{uniforms:re([tt.common,tt.bumpmap,tt.normalmap,tt.displacementmap,tt.fog,{matcap:{value:null}}]),vertexShader:bt.meshmatcap_vert,fragmentShader:bt.meshmatcap_frag},points:{uniforms:re([tt.points,tt.fog]),vertexShader:bt.points_vert,fragmentShader:bt.points_frag},dashed:{uniforms:re([tt.common,tt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bt.linedashed_vert,fragmentShader:bt.linedashed_frag},depth:{uniforms:re([tt.common,tt.displacementmap]),vertexShader:bt.depth_vert,fragmentShader:bt.depth_frag},normal:{uniforms:re([tt.common,tt.bumpmap,tt.normalmap,tt.displacementmap,{opacity:{value:1}}]),vertexShader:bt.meshnormal_vert,fragmentShader:bt.meshnormal_frag},sprite:{uniforms:re([tt.sprite,tt.fog]),vertexShader:bt.sprite_vert,fragmentShader:bt.sprite_frag},background:{uniforms:{uvTransform:{value:new he},t2D:{value:null}},vertexShader:bt.background_vert,fragmentShader:bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0}},vertexShader:bt.backgroundCube_vert,fragmentShader:bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bt.cube_vert,fragmentShader:bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bt.equirect_vert,fragmentShader:bt.equirect_frag},distanceRGBA:{uniforms:re([tt.common,tt.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bt.distanceRGBA_vert,fragmentShader:bt.distanceRGBA_frag},shadow:{uniforms:re([tt.lights,tt.fog,{color:{value:new Ot(0)},opacity:{value:1}}]),vertexShader:bt.shadow_vert,fragmentShader:bt.shadow_frag}};ke.physical={uniforms:re([ke.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 Ot(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 Ot(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ot(1,1,1)},specularColorMap:{value:null}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag};function Mf(r,t,e,n,i,s,a){let o=new Ot(0),c=s===!0?0:1,l,h,f=null,u=0,m=null;function x(d,g){let b=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?e:t).get(y));let _=r.xr,M=_.getSession&&_.getSession();M&&M.environmentBlendMode==="additive"&&(y=null),y===null?p(o,c):y&&y.isColor&&(p(y,1),b=!0),(r.autoClear||b)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ds)?(h===void 0&&(h=new He(new kn(1,1,1),new rn({name:"BackgroundCubeMaterial",uniforms:yi(ke.backgroundCube.uniforms),vertexShader:ke.backgroundCube.vertexShader,fragmentShader:ke.backgroundCube.fragmentShader,side:ue,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(T,C,v){this.matrixWorld.copyPosition(v.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),h.material.uniforms.envMap.value=y,h.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,(f!==y||u!==y.version||m!==r.toneMapping)&&(h.material.needsUpdate=!0,f=y,u=y.version,m=r.toneMapping),h.layers.enableAll(),d.unshift(h,h.geometry,h.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new He(new Vi(2,2),new rn({name:"BackgroundMaterial",uniforms:yi(ke.background.uniforms),vertexShader:ke.background.vertexShader,fragmentShader:ke.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=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(f!==y||u!==y.version||m!==r.toneMapping)&&(l.material.needsUpdate=!0,f=y,u=y.version,m=r.toneMapping),l.layers.enableAll(),d.unshift(l,l.geometry,l.material,0,0,null))}function p(d,g){n.buffers.color.setClear(d.r,d.g,d.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 bf(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,U,Z,J,G){let N=!1;if(a){let O=p(J,Z,U);l!==O&&(l=O,m(l.object)),N=g(I,J,Z,G),N&&b(I,J,Z,G)}else{let O=U.wireframe===!0;(l.geometry!==J.id||l.program!==Z.id||l.wireframe!==O)&&(l.geometry=J.id,l.program=Z.id,l.wireframe=O,N=!0)}G!==null&&e.update(G,34963),(N||h)&&(h=!1,v(I,U,Z,J),G!==null&&r.bindBuffer(34963,e.get(G).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,U,Z){let J=Z.wireframe===!0,G=o[I.id];G===void 0&&(G={},o[I.id]=G);let N=G[U.id];N===void 0&&(N={},G[U.id]=N);let O=N[J];return O===void 0&&(O=d(u()),N[J]=O),O}function d(I){let U=[],Z=[],J=[];for(let G=0;G=0){let at=G[$],yt=N[$];if(yt===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(yt=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(yt=I.instanceColor)),at===void 0||at.attribute!==yt||yt&&at.data!==yt.data)return!0;O++}return l.attributesNum!==O||l.index!==J}function b(I,U,Z,J){let G={},N=U.attributes,O=0,et=Z.getAttributes();for(let $ in et)if(et[$].location>=0){let at=N[$];at===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(at=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(at=I.instanceColor));let yt={};yt.attribute=at,at&&at.data&&(yt.data=at.data),G[$]=yt,O++}l.attributes=G,l.attributesNum=O,l.index=J}function y(){let I=l.newAttributes;for(let U=0,Z=I.length;U=0){let nt=G[et];if(nt===void 0&&(et==="instanceMatrix"&&I.instanceMatrix&&(nt=I.instanceMatrix),et==="instanceColor"&&I.instanceColor&&(nt=I.instanceColor)),nt!==void 0){let at=nt.normalized,yt=nt.itemSize,Y=e.get(nt);if(Y===void 0)continue;let Dt=Y.buffer,gt=Y.type,vt=Y.bytesPerElement;if(nt.isInterleavedBufferAttribute){let ot=nt.data,Ft=ot.stride,St=nt.offset;if(ot.isInstancedInterleavedBuffer){for(let pt=0;pt<$.locationSize;pt++)M($.location+pt,ot.meshPerAttribute);I.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=ot.meshPerAttribute*ot.count)}else for(let pt=0;pt<$.locationSize;pt++)_($.location+pt);r.bindBuffer(34962,Dt);for(let pt=0;pt<$.locationSize;pt++)C($.location+pt,yt/$.locationSize,gt,at,Ft*vt,(St+yt/$.locationSize*pt)*vt)}else{if(nt.isInstancedBufferAttribute){for(let ot=0;ot<$.locationSize;ot++)M($.location+ot,nt.meshPerAttribute);I.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=nt.meshPerAttribute*nt.count)}else for(let ot=0;ot<$.locationSize;ot++)_($.location+ot);r.bindBuffer(34962,Dt);for(let ot=0;ot<$.locationSize;ot++)C($.location+ot,yt/$.locationSize,gt,at,yt*vt,yt/$.locationSize*ot*vt)}}else if(O!==void 0){let at=O[et];if(at!==void 0)switch(at.length){case 2:r.vertexAttrib2fv($.location,at);break;case 3:r.vertexAttrib3fv($.location,at);break;case 4:r.vertexAttrib4fv($.location,at);break;default:r.vertexAttrib1fv($.location,at)}}}}T()}function A(){q();for(let I in o){let U=o[I];for(let Z in U){let J=U[Z];for(let G in J)x(J[G].object),delete J[G];delete U[Z]}delete o[I]}}function L(I){if(o[I.id]===void 0)return;let U=o[I.id];for(let Z in U){let J=U[Z];for(let G in J)x(J[G].object),delete J[G];delete U[Z]}delete o[I.id]}function B(I){for(let U in o){let Z=o[U];if(Z[I.id]===void 0)continue;let J=Z[I.id];for(let G in J)x(J[G].object),delete J[G];delete Z[I.id]}}function q(){F(),h=!0,l!==c&&(l=c,m(l.object))}function F(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:f,reset:q,resetDefaultState:F,dispose:A,releaseStatesOfGeometry:L,releaseStatesOfProgram:B,initAttributes:y,enableAttribute:_,disableUnusedAttributes:T}}function wf(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 Sf(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||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,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),b=r.getParameter(36349),y=u>0,_=a||t.has("OES_texture_float"),M=y&&_,T=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:b,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:M,maxSamples:T}}function Tf(r){let t=this,e=null,n=0,i=!1,s=!1,a=new be,o=new he,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u,m){let x=f.length!==0||u||n!==0||i;return i=u,e=h(f,m,0),n=f.length,x},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1,l()},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 b=s?0:n,y=b*4,_=g.clippingState||null;c.value=_,_=h(x,u,y,m);for(let M=0;M!==y;++M)_[M]=e[M];g.clippingState=_,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=b}};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,b=u.matrixWorldInverse;o.getNormalMatrix(b),(d===null||d.length0){let l=new Br(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 Ur=class extends Ps{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}},hi=4,Ma=[.125,.215,.35,.446,.526,.582],Ln=20,Tr=new Ur,ba=new Ot,Ar=null,Pn=(1+Math.sqrt(5))/2,ci=1/Pn,wa=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,Pn,ci),new P(0,Pn,-ci),new P(ci,0,Pn),new P(-ci,0,Pn),new P(Pn,ci,0),new P(-Pn,ci,0)],Is=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){Ar=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;t2?y:0,y,y),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===mi||t.mapping===gi;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,a=new He(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;let c=this._cubeSize;ms(e,0,0,3*c,2*c),n.setRenderTarget(e),n.render(a,Tr)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;iLn&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${d} samples when the maximum is set to ${Ln}`);let g=[],b=0;for(let C=0;Cy-hi?i-y+hi:0),T=4*(this._cubeSize-_);ms(e,M,T,3*_,2*_),c.setRenderTarget(e),c.render(f,Tr)}};function Ef(r){let t=[],e=[],n=[],i=r,s=r-hi+1+Ma.length;for(let a=0;ar-hi?c=Ma[a-r+hi-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,b=new Float32Array(p*x*m),y=new Float32Array(d*x*m),_=new Float32Array(g*x*m);for(let T=0;T2?0:-1,A=[C,v,0,C+2/3,v,0,C+2/3,v+1,0,C,v,0,C+2/3,v+1,0,C,v+1,0];b.set(A,p*x*T),y.set(u,d*x*T);let L=[T,T,T,T,T,T];_.set(L,g*x*T)}let M=new ze;M.setAttribute("position",new Xt(b,p)),M.setAttribute("uv",new Xt(y,d)),M.setAttribute("faceIndex",new Xt(_,g)),t.push(M),i>hi&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function Sa(r,t,e){let n=new sn(r,t,e);return n.texture.mapping=Ds,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ms(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function Cf(r,t,e){let n=new Float32Array(Ln),i=new P(0,1,0);return new rn({name:"SphericalGaussianBlur",defines:{n:Ln,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:ao(),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 \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:xn,depthTest:!1,depthWrite:!1})}function Ta(){return new rn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ao(),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 \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:xn,depthTest:!1,depthWrite:!1})}function Aa(){return new rn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ao(),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:xn,depthTest:!1,depthWrite:!1})}function ao(){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 Pf(r){let t=new WeakMap,e=null;function n(o){if(o&&o.isTexture){let c=o.mapping,l=c===Pr||c===Lr,h=c===mi||c===gi;if(l||h)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let f=t.get(o);return e===null&&(e=new Is(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 Is(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;ht.maxTextureSize&&(B=Math.ceil(L/t.maxTextureSize),L=t.maxTextureSize);let q=new Float32Array(L*B*4*p),F=new Ss(q,L,B,p);F.type=In,F.needsUpdate=!0;let I=A*4;for(let Z=0;Z0)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 a=1,o=0;a!==t;++a)o+=e,r[a].toArray(s,o)}return s}function Yt(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e":" "} ${o}: ${e[a]}`)}return n.join(`\n`)}function Ed(r){switch(r){case On:return["Linear","( value )"];case Vt: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 a=parseInt(s[1]);return e.toUpperCase()+`\n\n`+i+`\n\n`+Ad(r.getShaderSource(t),a)}else return i}function Cd(r,t){let e=Ed(t);return"vec4 "+r+"( vec4 value ) { return LinearTo"+e[0]+e[1]+"; }"}function Pd(r,t){let e;switch(t){case Kc:e="Linear";break;case Qc:e="Reinhard";break;case jc:e="OptimizedCineon";break;case tl:e="ACESFilmic";break;case el:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function Ld(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(Bi).join(`\n`)}function Rd(r){let t=[];for(let e in r){let n=r[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`\n`)}function Id(r,t){let e={},n=r.getProgramParameter(t,35721);for(let i=0;i/gm;function Gr(r){return r.replace(Dd,Nd)}function Nd(r,t){let e=bt[t];if(e===void 0)throw new Error("Can not resolve #include <"+t+">");return Gr(e)}var Fd=/#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(Fd,zd)}function zd(r,t,e,n){let i="";for(let s=parseInt(t);s0&&(d+=`\n`),g=[m,x].filter(Bi).join(`\n`),g.length>0&&(g+=`\n`)):(d=[Ba(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(Bi).join(`\n`),g=[m,Ba(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!==tn?"#define TONE_MAPPING":"",e.toneMapping!==tn?bt.tonemapping_pars_fragment:"",e.toneMapping!==tn?Pd("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",bt.encodings_pars_fragment,Cd("linearToOutputTexel",e.outputEncoding),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`\n`].filter(Bi).join(`\n`)),a=Gr(a),a=Fa(a,e),a=za(a,e),o=Gr(o),o=Fa(o,e),o=za(o,e),a=Oa(a),o=Oa(o),e.isWebGL2&&e.isRawShaderMaterial!==!0&&(b=`#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===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`+g);let y=b+d+a,_=b+g+o,M=Da(i,35633,y),T=Da(i,35632,_);if(i.attachShader(p,M),i.attachShader(p,T),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 A=i.getProgramInfoLog(p).trim(),L=i.getShaderInfoLog(M).trim(),B=i.getShaderInfoLog(T).trim(),q=!0,F=!0;if(i.getProgramParameter(p,35714)===!1){q=!1;let I=Na(i,M,"vertex"),U=Na(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(p,35715)+`\n\nProgram Info Log: `+A+`\n`+I+`\n`+U)}else A!==""?console.warn("THREE.WebGLProgram: Program Info Log:",A):(L===""||B==="")&&(F=!1);F&&(this.diagnostics={runnable:q,programLog:A,vertexShader:{log:L,prefix:d},fragmentShader:{log:B,prefix:g}})}i.deleteShader(M),i.deleteShader(T);let C;this.getUniforms=function(){return C===void 0&&(C=new pi(i,p)),C};let v;return this.getAttributes=function(){return v===void 0&&(v=Id(i,p)),v},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=Td++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=M,this.fragmentShader=T,this}var Gd=0,Wr=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 qr(t),e.set(t,n)),n}},qr=class{constructor(t){this.id=Gd++,this.code=t,this.usedTimes=0}};function Wd(r,t,e,n,i,s,a){let o=new Ts,c=new Wr,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(v,A,L,B,q){let F=B.fog,I=q.geometry,U=v.isMeshStandardMaterial?B.environment:null,Z=(v.isMeshStandardMaterial?e:t).get(v.envMap||U),J=Z&&Z.mapping===Ds?Z.image.height:null,G=x[v.type];v.precision!==null&&(m=i.getMaxPrecision(v.precision),m!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",m,"instead."));let N=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,O=N!==void 0?N.length:0,et=0;I.morphAttributes.position!==void 0&&(et=1),I.morphAttributes.normal!==void 0&&(et=2),I.morphAttributes.color!==void 0&&(et=3);let $,nt,at,yt;if(G){let Ft=ke[G];$=Ft.vertexShader,nt=Ft.fragmentShader}else $=v.vertexShader,nt=v.fragmentShader,c.update(v),at=c.getVertexShaderID(v),yt=c.getFragmentShaderID(v);let Y=r.getRenderTarget(),Dt=v.alphaTest>0,gt=v.clearcoat>0,vt=v.iridescence>0;return{isWebGL2:h,shaderID:G,shaderName:v.type,vertexShader:$,fragmentShader:nt,defines:v.defines,customVertexShaderID:at,customFragmentShaderID:yt,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:m,instancing:q.isInstancedMesh===!0,instancingColor:q.isInstancedMesh===!0&&q.instanceColor!==null,supportsVertexTextures:u,outputEncoding:Y===null?r.outputEncoding:Y.isXRRenderTarget===!0?Y.texture.encoding:On,map:!!v.map,matcap:!!v.matcap,envMap:!!Z,envMapMode:Z&&Z.mapping,envMapCubeUVHeight:J,lightMap:!!v.lightMap,aoMap:!!v.aoMap,emissiveMap:!!v.emissiveMap,bumpMap:!!v.bumpMap,normalMap:!!v.normalMap,objectSpaceNormalMap:v.normalMapType===Ml,tangentSpaceNormalMap:v.normalMapType===vl,decodeVideoTexture:!!v.map&&v.map.isVideoTexture===!0&&v.map.encoding===Vt,clearcoat:gt,clearcoatMap:gt&&!!v.clearcoatMap,clearcoatRoughnessMap:gt&&!!v.clearcoatRoughnessMap,clearcoatNormalMap:gt&&!!v.clearcoatNormalMap,iridescence:vt,iridescenceMap:vt&&!!v.iridescenceMap,iridescenceThicknessMap:vt&&!!v.iridescenceThicknessMap,displacementMap:!!v.displacementMap,roughnessMap:!!v.roughnessMap,metalnessMap:!!v.metalnessMap,specularMap:!!v.specularMap,specularIntensityMap:!!v.specularIntensityMap,specularColorMap:!!v.specularColorMap,opaque:v.transparent===!1&&v.blending===fi,alphaMap:!!v.alphaMap,alphaTest:Dt,gradientMap:!!v.gradientMap,sheen:v.sheen>0,sheenColorMap:!!v.sheenColorMap,sheenRoughnessMap:!!v.sheenRoughnessMap,transmission:v.transmission>0,transmissionMap:!!v.transmissionMap,thicknessMap:!!v.thicknessMap,combine:v.combine,vertexTangents:!!v.normalMap&&!!I.attributes.tangent,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,vertexUvs:!!v.map||!!v.bumpMap||!!v.normalMap||!!v.specularMap||!!v.alphaMap||!!v.emissiveMap||!!v.roughnessMap||!!v.metalnessMap||!!v.clearcoatMap||!!v.clearcoatRoughnessMap||!!v.clearcoatNormalMap||!!v.iridescenceMap||!!v.iridescenceThicknessMap||!!v.displacementMap||!!v.transmissionMap||!!v.thicknessMap||!!v.specularIntensityMap||!!v.specularColorMap||!!v.sheenColorMap||!!v.sheenRoughnessMap,uvsVertexOnly:!(v.map||v.bumpMap||v.normalMap||v.specularMap||v.alphaMap||v.emissiveMap||v.roughnessMap||v.metalnessMap||v.clearcoatNormalMap||v.iridescenceMap||v.iridescenceThicknessMap||v.transmission>0||v.transmissionMap||v.thicknessMap||v.specularIntensityMap||v.specularColorMap||v.sheen>0||v.sheenColorMap||v.sheenRoughnessMap)&&!!v.displacementMap,fog:!!F,useFog:v.fog===!0,fogExp2:F&&F.isFogExp2,flatShading:!!v.flatShading,sizeAttenuation:v.sizeAttenuation,logarithmicDepthBuffer:f,skinning:q.isSkinnedMesh===!0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:O,morphTextureStride:et,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:v.toneMapped?r.toneMapping:tn,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Ve,flipSided:v.side===ue,useDepthPacking:!!v.depthPacking,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionDerivatives:v.extensions&&v.extensions.derivatives,extensionFragDepth:v.extensions&&v.extensions.fragDepth,extensionDrawBuffers:v.extensions&&v.extensions.drawBuffers,extensionShaderTextureLOD:v.extensions&&v.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:v.customProgramCacheKey()}}function d(v){let A=[];if(v.shaderID?A.push(v.shaderID):(A.push(v.customVertexShaderID),A.push(v.customFragmentShaderID)),v.defines!==void 0)for(let L in v.defines)A.push(L),A.push(v.defines[L]);return v.isRawShaderMaterial===!1&&(g(A,v),b(A,v),A.push(r.outputEncoding)),A.push(v.customProgramCacheKey),A.join()}function g(v,A){v.push(A.precision),v.push(A.outputEncoding),v.push(A.envMapMode),v.push(A.envMapCubeUVHeight),v.push(A.combine),v.push(A.vertexUvs),v.push(A.fogExp2),v.push(A.sizeAttenuation),v.push(A.morphTargetsCount),v.push(A.morphAttributeCount),v.push(A.numDirLights),v.push(A.numPointLights),v.push(A.numSpotLights),v.push(A.numSpotLightMaps),v.push(A.numHemiLights),v.push(A.numRectAreaLights),v.push(A.numDirLightShadows),v.push(A.numPointLightShadows),v.push(A.numSpotLightShadows),v.push(A.numSpotLightShadowsWithMaps),v.push(A.shadowMapType),v.push(A.toneMapping),v.push(A.numClippingPlanes),v.push(A.numClipIntersection),v.push(A.depthPacking)}function b(v,A){o.disableAll(),A.isWebGL2&&o.enable(0),A.supportsVertexTextures&&o.enable(1),A.instancing&&o.enable(2),A.instancingColor&&o.enable(3),A.map&&o.enable(4),A.matcap&&o.enable(5),A.envMap&&o.enable(6),A.lightMap&&o.enable(7),A.aoMap&&o.enable(8),A.emissiveMap&&o.enable(9),A.bumpMap&&o.enable(10),A.normalMap&&o.enable(11),A.objectSpaceNormalMap&&o.enable(12),A.tangentSpaceNormalMap&&o.enable(13),A.clearcoat&&o.enable(14),A.clearcoatMap&&o.enable(15),A.clearcoatRoughnessMap&&o.enable(16),A.clearcoatNormalMap&&o.enable(17),A.iridescence&&o.enable(18),A.iridescenceMap&&o.enable(19),A.iridescenceThicknessMap&&o.enable(20),A.displacementMap&&o.enable(21),A.specularMap&&o.enable(22),A.roughnessMap&&o.enable(23),A.metalnessMap&&o.enable(24),A.gradientMap&&o.enable(25),A.alphaMap&&o.enable(26),A.alphaTest&&o.enable(27),A.vertexColors&&o.enable(28),A.vertexAlphas&&o.enable(29),A.vertexUvs&&o.enable(30),A.vertexTangents&&o.enable(31),A.uvsVertexOnly&&o.enable(32),v.push(o.mask),o.disableAll(),A.fog&&o.enable(0),A.useFog&&o.enable(1),A.flatShading&&o.enable(2),A.logarithmicDepthBuffer&&o.enable(3),A.skinning&&o.enable(4),A.morphTargets&&o.enable(5),A.morphNormals&&o.enable(6),A.morphColors&&o.enable(7),A.premultipliedAlpha&&o.enable(8),A.shadowMapEnabled&&o.enable(9),A.physicallyCorrectLights&&o.enable(10),A.doubleSided&&o.enable(11),A.flipSided&&o.enable(12),A.useDepthPacking&&o.enable(13),A.dithering&&o.enable(14),A.specularIntensityMap&&o.enable(15),A.specularColorMap&&o.enable(16),A.transmission&&o.enable(17),A.transmissionMap&&o.enable(18),A.thicknessMap&&o.enable(19),A.sheen&&o.enable(20),A.sheenColorMap&&o.enable(21),A.sheenRoughnessMap&&o.enable(22),A.decodeVideoTexture&&o.enable(23),A.opaque&&o.enable(24),v.push(o.mask)}function y(v){let A=x[v.type],L;if(A){let B=ke[A];L=zl.clone(B.uniforms)}else L=v.uniforms;return L}function _(v,A){let L;for(let B=0,q=l.length;B0?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||Xd),n.length>1&&n.sort(u||Ua),i.length>1&&i.sort(u||Ua)}function h(){for(let f=t,u=r.length;f=s.length?(a=new ka,s.push(a)):a=s[i],a}function e(){r=new WeakMap}return{get:t,dispose:e}}function Zd(){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 P,color:new Ot};break;case"SpotLight":e={position:new P,direction:new P,color:new Ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new P,color:new Ot,distance:0,decay:0};break;case"HemisphereLight":e={direction:new P,skyColor:new Ot,groundColor:new Ot};break;case"RectAreaLight":e={color:new Ot,position:new P,halfWidth:new P,halfHeight:new P};break}return r[t.id]=e,e}}}function Jd(){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 $d=0;function Kd(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function Qd(r,t){let e=new Zd,n=Jd(),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 P);let s=new P,a=new zt,o=new zt;function c(h,f){let u=0,m=0,x=0;for(let B=0;B<9;B++)i.probe[B].set(0,0,0);let p=0,d=0,g=0,b=0,y=0,_=0,M=0,T=0,C=0,v=0;h.sort(Kd);let A=f!==!0?Math.PI:1;for(let B=0,q=h.length;B0&&(t.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=tt.LTC_FLOAT_1,i.rectAreaLTC2=tt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=tt.LTC_HALF_1,i.rectAreaLTC2=tt.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 L=i.hash;(L.directionalLength!==p||L.pointLength!==d||L.spotLength!==g||L.rectAreaLength!==b||L.hemiLength!==y||L.numDirectionalShadows!==_||L.numPointShadows!==M||L.numSpotShadows!==T||L.numSpotMaps!==C)&&(i.directional.length=p,i.spot.length=g,i.rectArea.length=b,i.point.length=d,i.hemi.length=y,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=T,i.spotShadowMap.length=T,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=M,i.spotLightMatrix.length=T+C-v,i.spotLightMap.length=C,i.numSpotLightShadowsWithMaps=v,L.directionalLength=p,L.pointLength=d,L.spotLength=g,L.rectAreaLength=b,L.hemiLength=y,L.numDirectionalShadows=_,L.numPointShadows=M,L.numSpotShadows=T,L.numSpotMaps=C,i.version=$d++)}function l(h,f){let u=0,m=0,x=0,p=0,d=0,g=f.matrixWorldInverse;for(let b=0,y=h.length;b=o.length?(c=new Va(r,t),o.push(c)):c=o[a],c}function i(){e=new WeakMap}return{get:n,dispose:i}}var Xr=class extends _i{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_l,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}},Yr=class extends _i{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new P,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}},tp=`void main() {\n\tgl_Position = vec4( position, 1.0 );\n}`,ep=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \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 np(r,t,e){let n=new Rs,i=new At,s=new At,a=new qt,o=new Xr({depthPacking:yl}),c=new Yr,l={},h=e.maxTextureSize,f={0:ue,1:nn,2:Ve},u=new rn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new At},radius:{value:4}},vertexShader:tp,fragmentShader:ep}),m=u.clone();m.defines.HORIZONTAL_PASS=1;let x=new ze;x.setAttribute("position",new Xt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new He(x,u),d=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ga,this.render=function(_,M,T){if(d.enabled===!1||d.autoUpdate===!1&&d.needsUpdate===!1||_.length===0)return;let C=r.getRenderTarget(),v=r.getActiveCubeFace(),A=r.getActiveMipmapLevel(),L=r.state;L.setBlending(xn),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let B=0,q=_.length;Bh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/U.x),i.x=s.x*U.x,I.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/U.y),i.y=s.y*U.y,I.mapSize.y=s.y)),I.map===null){let J=this.type!==Oi?{minFilter:ce,magFilter:ce}:{};I.map=new sn(i.x,i.y,J),I.map.texture.name=F.name+".shadowMap",I.camera.updateProjectionMatrix()}r.setRenderTarget(I.map),r.clear();let Z=I.getViewportCount();for(let J=0;J0){let q=L.uuid,F=M.uuid,I=l[q];I===void 0&&(I={},l[q]=I);let U=I[F];U===void 0&&(U=L.clone(),I[F]=U),L=U}return L.visible=M.visible,L.wireframe=M.wireframe,A===Oi?L.side=M.shadowSide!==null?M.shadowSide:M.side:L.side=M.shadowSide!==null?M.shadowSide:f[M.side],L.alphaMap=M.alphaMap,L.alphaTest=M.alphaTest,L.clipShadows=M.clipShadows,L.clippingPlanes=M.clippingPlanes,L.clipIntersection=M.clipIntersection,L.displacementMap=M.displacementMap,L.displacementScale=M.displacementScale,L.displacementBias=M.displacementBias,L.wireframeLinewidth=M.wireframeLinewidth,L.linewidth=M.linewidth,T.isPointLight===!0&&L.isMeshDistanceMaterial===!0&&(L.referencePosition.setFromMatrixPosition(T.matrixWorld),L.nearDistance=C,L.farDistance=v),L}function y(_,M,T,C,v){if(_.visible===!1)return;if(_.layers.test(M.layers)&&(_.isMesh||_.isLine||_.isPoints)&&(_.castShadow||_.receiveShadow&&v===Oi)&&(!_.frustumCulled||n.intersectsObject(_))){_.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,_.matrixWorld);let B=t.update(_),q=_.material;if(Array.isArray(q)){let F=B.groups;for(let I=0,U=F.length;I=1):G.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\\d)/.exec(G)[1]),Z=J>=2);let N=null,O={},et=r.getParameter(3088),$=r.getParameter(2978),nt=new qt().fromArray(et),at=new qt().fromArray($);function yt(R,H,K){let rt=new Uint8Array(4),lt=r.createTexture();r.bindTexture(R,lt),r.texParameteri(R,10241,9728),r.texParameteri(R,10240,9728);for(let Pt=0;PtQ||E.height>Q)&&(j=Q/Math.max(E.width,E.height)),j<1||w===!0)if(typeof HTMLImageElement!="undefined"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&E instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&E instanceof ImageBitmap){let it=w?Nr:Math.floor,xt=it(j*E.width),st=it(j*E.height);p===void 0&&(p=b(xt,st));let X=V?b(xt,st):p;return X.width=xt,X.height=st,X.getContext("2d").drawImage(E,0,0,xt,st),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+E.width+"x"+E.height+") to ("+xt+"x"+st+")."),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 _(E){return ha(E.width)&&ha(E.height)}function M(E){return o?!1:E.wrapS!==Ne||E.wrapT!==Ne||E.minFilter!==ce&&E.minFilter!==Ee}function T(E,w){return E.generateMipmaps&&w&&E.minFilter!==ce&&E.minFilter!==Ee}function C(E){r.generateMipmap(E)}function v(E,w,V,Q,j=!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 it=w;return w===6403&&(V===5126&&(it=33326),V===5131&&(it=33325),V===5121&&(it=33321)),w===33319&&(V===5126&&(it=33328),V===5131&&(it=33327),V===5121&&(it=33323)),w===6408&&(V===5126&&(it=34836),V===5131&&(it=34842),V===5121&&(it=Q===Vt&&j===!1?35907:32856),V===32819&&(it=32854),V===32820&&(it=32855)),(it===33325||it===33326||it===33327||it===33328||it===34842||it===34836)&&t.get("EXT_color_buffer_float"),it}function A(E,w,V){return T(E,V)===!0||E.isFramebufferTexture&&E.minFilter!==ce&&E.minFilter!==Ee?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 L(E){return E===ce||E===Fo||E===zo?9728:9729}function B(E){let w=E.target;w.removeEventListener("dispose",B),F(w),w.isVideoTexture&&x.delete(w)}function q(E){let w=E.target;w.removeEventListener("dispose",q),U(w)}function F(E){let w=n.get(E);if(w.__webglInit===void 0)return;let V=E.source,Q=d.get(V);if(Q){let j=Q[w.__cacheKey];j.usedTimes--,j.usedTimes===0&&I(E),Object.keys(Q).length===0&&d.delete(V)}n.remove(E)}function I(E){let w=n.get(E);r.deleteTexture(w.__webglTexture);let V=E.source,Q=d.get(V);delete Q[w.__cacheKey],a.memory.textures--}function U(E){let w=E.texture,V=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 j=0;j<6;j++)r.deleteFramebuffer(V.__webglFramebuffer[j]),V.__webglDepthbuffer&&r.deleteRenderbuffer(V.__webglDepthbuffer[j]);else{if(r.deleteFramebuffer(V.__webglFramebuffer),V.__webglDepthbuffer&&r.deleteRenderbuffer(V.__webglDepthbuffer),V.__webglMultisampledFramebuffer&&r.deleteFramebuffer(V.__webglMultisampledFramebuffer),V.__webglColorRenderbuffer)for(let j=0;j=c&&console.warn("THREE.WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+c),Z+=1,E}function N(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 O(E,w){let V=n.get(E);if(E.isVideoTexture&&qe(E),E.isRenderTargetTexture===!1&&E.version>0&&V.__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{gt(V,E,w);return}}e.bindTexture(3553,V.__webglTexture,33984+w)}function et(E,w){let V=n.get(E);if(E.version>0&&V.__version!==E.version){gt(V,E,w);return}e.bindTexture(35866,V.__webglTexture,33984+w)}function $(E,w){let V=n.get(E);if(E.version>0&&V.__version!==E.version){gt(V,E,w);return}e.bindTexture(32879,V.__webglTexture,33984+w)}function nt(E,w){let V=n.get(E);if(E.version>0&&V.__version!==E.version){vt(V,E,w);return}e.bindTexture(34067,V.__webglTexture,33984+w)}let at={[Rr]:10497,[Ne]:33071,[Ir]:33648},yt={[ce]:9728,[Fo]:9984,[zo]:9986,[Ee]:9729,[nl]:9985,[Ns]:9987};function Y(E,w,V){if(V?(r.texParameteri(E,10242,at[w.wrapS]),r.texParameteri(E,10243,at[w.wrapT]),(E===32879||E===35866)&&r.texParameteri(E,32882,at[w.wrapR]),r.texParameteri(E,10240,yt[w.magFilter]),r.texParameteri(E,10241,yt[w.minFilter])):(r.texParameteri(E,10242,33071),r.texParameteri(E,10243,33071),(E===32879||E===35866)&&r.texParameteri(E,32882,33071),(w.wrapS!==Ne||w.wrapT!==Ne)&&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,L(w.magFilter)),r.texParameteri(E,10241,L(w.minFilter)),w.minFilter!==ce&&w.minFilter!==Ee&&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.type===In&&t.has("OES_texture_float_linear")===!1||o===!1&&w.type===ki&&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 Dt(E,w){let V=!1;E.__webglInit===void 0&&(E.__webglInit=!0,w.addEventListener("dispose",B));let Q=w.source,j=d.get(Q);j===void 0&&(j={},d.set(Q,j));let it=N(w);if(it!==E.__cacheKey){j[it]===void 0&&(j[it]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,V=!0),j[it].usedTimes++;let xt=j[E.__cacheKey];xt!==void 0&&(j[E.__cacheKey].usedTimes--,xt.usedTimes===0&&I(w)),E.__cacheKey=it,E.__webglTexture=j[it].texture}return V}function gt(E,w,V){let Q=3553;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(Q=35866),w.isData3DTexture&&(Q=32879);let j=Dt(E,w),it=w.source;e.bindTexture(Q,E.__webglTexture,33984+V);let xt=n.get(it);if(it.version!==xt.__version||j===!0){e.activeTexture(33984+V),r.pixelStorei(37440,w.flipY),r.pixelStorei(37441,w.premultiplyAlpha),r.pixelStorei(3317,w.unpackAlignment),r.pixelStorei(37443,0);let st=M(w)&&_(w.image)===!1,X=y(w.image,st,!1,h);X=Xe(w,X);let ft=_(X)||o,mt=s.convert(w.format,w.encoding),ct=s.convert(w.type),dt=v(w.internalFormat,mt,ct,w.encoding,w.isVideoTexture);Y(Q,w,ft);let ht,Ct=w.mipmaps,Bt=o&&w.isVideoTexture!==!0,Jt=xt.__version===void 0||j===!0,R=A(w,X,ft);if(w.isDepthTexture)dt=6402,o?w.type===In?dt=36012:w.type===Rn?dt=33190:w.type===di?dt=35056:dt=33189:w.type===In&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===Nn&&dt===6402&&w.type!==Za&&w.type!==Rn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=Rn,ct=s.convert(w.type)),w.format===xi&&dt===6402&&(dt=34041,w.type!==di&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=di,ct=s.convert(w.type))),Jt&&(Bt?e.texStorage2D(3553,1,dt,X.width,X.height):e.texImage2D(3553,0,dt,X.width,X.height,0,mt,ct,null));else if(w.isDataTexture)if(Ct.length>0&&ft){Bt&&Jt&&e.texStorage2D(3553,R,dt,Ct[0].width,Ct[0].height);for(let H=0,K=Ct.length;H>=1,K>>=1}}else if(Ct.length>0&&ft){Bt&&Jt&&e.texStorage2D(3553,R,dt,Ct[0].width,Ct[0].height);for(let H=0,K=Ct.length;H0&&Jt++,e.texStorage2D(34067,Jt,ht,X[0].width,X[0].height));for(let H=0;H<6;H++)if(st){Ct?e.texSubImage2D(34069+H,0,0,0,X[H].width,X[H].height,ct,dt,X[H].data):e.texImage2D(34069+H,0,ht,X[H].width,X[H].height,0,ct,dt,X[H].data);for(let K=0;K=34069&&j<=34074)&&r.framebufferTexture2D(36160,Q,j,n.get(V).__webglTexture,0),e.bindFramebuffer(36160,null)}function Ft(E,w,V){if(r.bindRenderbuffer(36161,E),w.depthBuffer&&!w.stencilBuffer){let Q=33189;if(V||Nt(w)){let j=w.depthTexture;j&&j.isDepthTexture&&(j.type===In?Q=36012:j.type===Rn&&(Q=33190));let it=jt(w);Nt(w)?u.renderbufferStorageMultisampleEXT(36161,it,Q,w.width,w.height):r.renderbufferStorageMultisample(36161,it,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=jt(w);V&&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 j=0;j0&&Nt(E)===!1){let st=it?w:[w];V.__webglMultisampledFramebuffer=r.createFramebuffer(),V.__webglColorRenderbuffer=[],e.bindFramebuffer(36160,V.__webglMultisampledFramebuffer);for(let X=0;X0&&Nt(E)===!1){let w=E.isWebGLMultipleRenderTargets?E.texture:[E.texture],V=E.width,Q=E.height,j=16384,it=[],xt=E.stencilBuffer?33306:36096,st=n.get(E),X=E.isWebGLMultipleRenderTargets===!0;if(X)for(let ft=0;ft0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function qe(E){let w=a.render.frame;x.get(E)!==w&&(x.set(E,w),E.update())}function Xe(E,w){let V=E.encoding,Q=E.format,j=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||E.format===Dr||V!==On&&(V===Vt?o===!1?t.has("EXT_sRGB")===!0&&Q===Fe?(E.format=Dr,E.minFilter=Ee,E.generateMipmaps=!1):w=bs.sRGBToLinear(w):(Q!==Fe||j!==zn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",V)),w}this.allocateTextureUnit=G,this.resetTextureUnits=J,this.setTexture2D=O,this.setTexture2DArray=et,this.setTexture3D=$,this.setTextureCube=nt,this.rebindTextures=Qt,this.setupRenderTarget=ae,this.updateRenderTargetMipmap=ie,this.updateMultisampleRenderTarget=Be,this.setupDepthRenderbuffer=pt,this.setupFrameBufferTexture=ot,this.useMultisampledRTT=Nt}function rp(r,t,e){let n=e.isWebGL2;function i(s,a=null){let o;if(s===zn)return 5121;if(s===ol)return 32819;if(s===al)return 32820;if(s===il)return 5120;if(s===sl)return 5122;if(s===Za)return 5123;if(s===rl)return 5124;if(s===Rn)return 5125;if(s===In)return 5126;if(s===ki)return n?5131:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===cl)return 6406;if(s===Fe)return 6408;if(s===hl)return 6409;if(s===ul)return 6410;if(s===Nn)return 6402;if(s===xi)return 34041;if(s===fl)return 6403;if(s===ll)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===Dr)return o=t.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===dl)return 36244;if(s===pl)return 33319;if(s===ml)return 33320;if(s===gl)return 36249;if(s===$s||s===Ks||s===Qs||s===js)if(a===Vt)if(o=t.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===$s)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Ks)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Qs)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===$s)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Ks)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Qs)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===js)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Oo||s===Bo||s===Uo||s===ko)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===Oo)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Bo)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Uo)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===ko)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===xl)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Vo||s===Ho)if(o=t.get("WEBGL_compressed_texture_etc"),o!==null){if(s===Vo)return a===Vt?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===Ho)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Go||s===Wo||s===qo||s===Xo||s===Yo||s===Zo||s===Jo||s===$o||s===Ko||s===Qo||s===jo||s===ta||s===ea||s===na)if(o=t.get("WEBGL_compressed_texture_astc"),o!==null){if(s===Go)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Wo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===qo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Xo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Yo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Zo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Jo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===$o)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Ko)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Qo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===jo)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ta)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ea)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===na)return a===Vt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===ia)if(o=t.get("EXT_texture_compression_bptc"),o!==null){if(s===ia)return a===Vt?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===di?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 Zr=class extends Me{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},ui=class extends fe{constructor(){super(),this.isGroup=!0,this.type="Group"}},op={type:"move"},Ui=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ui,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 ui,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ui,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),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}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);if(l.joints[p.jointName]===void 0){let b=new ui;b.matrixAutoUpdate=!1,b.visible=!1,l.joints[p.jointName]=b,l.add(b)}let g=l.joints[p.jointName];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(op)))}return o!==null&&(o.visible=i!==null),c!==null&&(c.visible=s!==null),l!==null&&(l.visible=a!==null),this}},Jr=class extends we{constructor(t,e,n,i,s,a,o,c,l,h){if(h=h!==void 0?h:Nn,h!==Nn&&h!==xi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Nn&&(n=Rn),n===void 0&&h===xi&&(n=di),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}},$r=class extends _n{constructor(t,e){super();let n=this,i=null,s=1,a=null,o="local-floor",c=null,l=null,h=null,f=null,u=null,m=null,x=e.getContextAttributes(),p=null,d=null,g=[],b=[],y=new Me;y.layers.enable(1),y.viewport=new qt;let _=new Me;_.layers.enable(2),_.viewport=new qt;let M=[y,_],T=new Zr;T.layers.enable(1),T.layers.enable(2);let C=null,v=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(N){let O=g[N];return O===void 0&&(O=new Ui,g[N]=O),O.getTargetRaySpace()},this.getControllerGrip=function(N){let O=g[N];return O===void 0&&(O=new Ui,g[N]=O),O.getGripSpace()},this.getHand=function(N){let O=g[N];return O===void 0&&(O=new Ui,g[N]=O),O.getHandSpace()};function A(N){let O=b.indexOf(N.inputSource);if(O===-1)return;let et=g[O];et!==void 0&&et.dispatchEvent({type:N.type,data:N.inputSource})}function L(){i.removeEventListener("select",A),i.removeEventListener("selectstart",A),i.removeEventListener("selectend",A),i.removeEventListener("squeeze",A),i.removeEventListener("squeezestart",A),i.removeEventListener("squeezeend",A),i.removeEventListener("end",L),i.removeEventListener("inputsourceschange",B);for(let N=0;N=0&&(b[$]=null,g[$].dispatchEvent({type:"disconnected",data:et}))}for(let O=0;O=b.length){b.push(et),$=at;break}else if(b[at]===null){b[at]=et,$=at;break}if($===-1)break}let nt=g[$];nt&&nt.dispatchEvent({type:"connected",data:et})}}let q=new P,F=new P;function I(N,O,et){q.setFromMatrixPosition(O.matrixWorld),F.setFromMatrixPosition(et.matrixWorld);let $=q.distanceTo(F),nt=O.projectionMatrix.elements,at=et.projectionMatrix.elements,yt=nt[14]/(nt[10]-1),Y=nt[14]/(nt[10]+1),Dt=(nt[9]+1)/nt[5],gt=(nt[9]-1)/nt[5],vt=(nt[8]-1)/nt[0],ot=(at[8]+1)/at[0],Ft=yt*vt,St=yt*ot,pt=$/(-vt+ot),Qt=pt*-vt;O.matrixWorld.decompose(N.position,N.quaternion,N.scale),N.translateX(Qt),N.translateZ(pt),N.matrixWorld.compose(N.position,N.quaternion,N.scale),N.matrixWorldInverse.copy(N.matrixWorld).invert();let ae=yt+pt,ie=Y+pt,Be=Ft-Qt,jt=St+($-Qt),Nt=Dt*Y/ie*ae,qe=gt*Y/ie*ae;N.projectionMatrix.makePerspective(Be,jt,Nt,qe,ae,ie)}function U(N,O){O===null?N.matrixWorld.copy(N.matrix):N.matrixWorld.multiplyMatrices(O.matrixWorld,N.matrix),N.matrixWorldInverse.copy(N.matrixWorld).invert()}this.updateCamera=function(N){if(i===null)return;T.near=_.near=y.near=N.near,T.far=_.far=y.far=N.far,(C!==T.near||v!==T.far)&&(i.updateRenderState({depthNear:T.near,depthFar:T.far}),C=T.near,v=T.far);let O=N.parent,et=T.cameras;U(T,O);for(let nt=0;nt0&&(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 _=r.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=d.lightMapIntensity*_}d.aoMap&&(p.aoMap.value=d.aoMap,p.aoMapIntensity.value=d.aoMapIntensity);let b;d.map?b=d.map:d.specularMap?b=d.specularMap:d.displacementMap?b=d.displacementMap:d.normalMap?b=d.normalMap:d.bumpMap?b=d.bumpMap:d.roughnessMap?b=d.roughnessMap:d.metalnessMap?b=d.metalnessMap:d.alphaMap?b=d.alphaMap:d.emissiveMap?b=d.emissiveMap:d.clearcoatMap?b=d.clearcoatMap:d.clearcoatNormalMap?b=d.clearcoatNormalMap:d.clearcoatRoughnessMap?b=d.clearcoatRoughnessMap:d.iridescenceMap?b=d.iridescenceMap:d.iridescenceThicknessMap?b=d.iridescenceThicknessMap:d.specularIntensityMap?b=d.specularIntensityMap:d.specularColorMap?b=d.specularColorMap:d.transmissionMap?b=d.transmissionMap:d.thicknessMap?b=d.thicknessMap:d.sheenColorMap?b=d.sheenColorMap:d.sheenRoughnessMap&&(b=d.sheenRoughnessMap),b!==void 0&&(b.isWebGLRenderTarget&&(b=b.texture),b.matrixAutoUpdate===!0&&b.updateMatrix(),p.uvTransform.value.copy(b.matrix));let y;d.aoMap?y=d.aoMap:d.lightMap&&(y=d.lightMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uv2Transform.value.copy(y.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,b){p.diffuse.value.copy(d.color),p.opacity.value=d.opacity,p.size.value=d.size*g,p.scale.value=b*.5,d.map&&(p.map.value=d.map),d.alphaMap&&(p.alphaMap.value=d.alphaMap),d.alphaTest>0&&(p.alphaTest.value=d.alphaTest);let y;d.map?y=d.map:d.alphaMap&&(y=d.alphaMap),y!==void 0&&(y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uvTransform.value.copy(y.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===ue&&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 cp(r,t,e,n){let i={},s={},a=[],o=e.isWebGL2?r.getParameter(35375):0;function c(b,y){let _=y.program;n.uniformBlockBinding(b,_)}function l(b,y){let _=i[b.id];_===void 0&&(x(b),_=h(b),i[b.id]=_,b.addEventListener("dispose",d));let M=y.program;n.updateUBOMapping(b,M);let T=t.render.frame;s[b.id]!==T&&(u(b),s[b.id]=T)}function h(b){let y=f();b.__bindingPointIndex=y;let _=r.createBuffer(),M=b.__size,T=b.usage;return r.bindBuffer(35345,_),r.bufferData(35345,M,T),r.bindBuffer(35345,null),r.bindBufferBase(35345,y,_),_}function f(){for(let b=0;b0){T=_%M;let B=M-T;T!==0&&B-L.boundary<0&&(_+=M-T,A.__offset=_)}_+=L.storage}return T=_%M,T>0&&(_+=M-T),b.__size=_,b.__cache={},this}function p(b){let y=b.value,_={boundary:0,storage:0};return typeof y=="number"?(_.boundary=4,_.storage=4):y.isVector2?(_.boundary=8,_.storage=8):y.isVector3||y.isColor?(_.boundary=16,_.storage=12):y.isVector4?(_.boundary=16,_.storage=16):y.isMatrix3?(_.boundary=48,_.storage=48):y.isMatrix4?(_.boundary=64,_.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),_}function d(b){let y=b.target;y.removeEventListener("dispose",d);let _=a.indexOf(y.__bindingPointIndex);a.splice(_,1),r.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function g(){for(let b in i)r.deleteBuffer(i[b]);a=[],i={},s={}}return{bind:c,update:l,dispose:g}}function lp(){let r=Ms("canvas");return r.style.display="block",r}function hp(r={}){this.isWebGLRenderer=!0;let t=r.canvas!==void 0?r.canvas:lp(),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=On,this.physicallyCorrectLights=!1,this.toneMapping=tn,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});let p=this,d=!1,g=0,b=0,y=null,_=-1,M=null,T=new qt,C=new qt,v=null,A=t.width,L=t.height,B=1,q=null,F=null,I=new qt(0,0,A,L),U=new qt(0,0,A,L),Z=!1,J=new Rs,G=!1,N=!1,O=null,et=new zt,$=new At,nt=new P,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function yt(){return y===null?B:1}let Y=e;function Dt(S,z){for(let k=0;k0?u=x[x.length-1]:u=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function $t(S,z,k,D){if(S.visible===!1)return;if(S.layers.test(z.layers)){if(S.isGroup)k=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(z);else if(S.isLight)u.pushLight(S),S.castShadow&&u.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||J.intersectsSprite(S)){D&&nt.setFromMatrixPosition(S.matrixWorld).applyMatrix4(et);let _t=jt.update(S),wt=S.material;wt.visible&&f.push(S,_t,wt,k,nt.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==Ft.render.frame&&(S.skeleton.update(),S.skeleton.frame=Ft.render.frame),!S.frustumCulled||J.intersectsObject(S))){D&&nt.setFromMatrixPosition(S.matrixWorld).applyMatrix4(et);let _t=jt.update(S),wt=S.material;if(Array.isArray(wt)){let Mt=_t.groups;for(let Lt=0,Tt=Mt.length;Lt0&&wn(W,z,k),D&&ot.viewport(T.copy(D)),W.length>0&&Ut(W,z,k),ut.length>0&&Ut(ut,z,k),_t.length>0&&Ut(_t,z,k),ot.buffers.depth.setTest(!0),ot.buffers.depth.setMask(!0),ot.buffers.color.setMask(!0),ot.setPolygonOffset(!1)}function wn(S,z,k){let D=vt.isWebGL2;O===null&&(O=new sn(1,1,{generateMipmaps:!0,type:gt.has("EXT_color_buffer_half_float")?ki:zn,minFilter:Ns,samples:D&&s===!0?4:0})),p.getDrawingBufferSize($),D?O.setSize($.x,$.y):O.setSize(Nr($.x),Nr($.y));let W=p.getRenderTarget();p.setRenderTarget(O),p.clear();let ut=p.toneMapping;p.toneMapping=tn,Ut(S,z,k),p.toneMapping=ut,pt.updateMultisampleRenderTarget(O),pt.updateRenderTargetMipmap(O),p.setRenderTarget(W)}function Ut(S,z,k){let D=z.isScene===!0?z.overrideMaterial:null;for(let W=0,ut=S.length;W0&&pt.useMultisampledRTT(S)===!1?W=St.get(S).__webglMultisampledFramebuffer:W=Tt,T.copy(S.viewport),C.copy(S.scissor),v=S.scissorTest}else T.copy(I).multiplyScalar(B).floor(),C.copy(U).multiplyScalar(B).floor(),v=Z;if(ot.bindFramebuffer(36160,W)&&vt.drawBuffers&&D&&ot.drawBuffers(S,W),ot.viewport(T),ot.scissor(C),ot.setScissorTest(v),ut){let Mt=St.get(S.texture);Y.framebufferTexture2D(36160,36064,34069+z,Mt.__webglTexture,k)}else if(_t){let Mt=St.get(S.texture),Lt=z||0;Y.framebufferTextureLayer(36160,36064,Mt.__webglTexture,k||0,Lt)}_=-1},this.readRenderTargetPixels=function(S,z,k,D,W,ut,_t){if(!(S&&S.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let wt=St.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&_t!==void 0&&(wt=wt[_t]),wt){ot.bindFramebuffer(36160,wt);try{let Mt=S.texture,Lt=Mt.format,Tt=Mt.type;if(Lt!==Fe&&st.convert(Lt)!==Y.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Et=Tt===ki&&(gt.has("EXT_color_buffer_half_float")||vt.isWebGL2&>.has("EXT_color_buffer_float"));if(Tt!==zn&&st.convert(Tt)!==Y.getParameter(35738)&&!(Tt===In&&(vt.isWebGL2||gt.has("OES_texture_float")||gt.has("WEBGL_color_buffer_float")))&&!Et){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=S.width-D&&k>=0&&k<=S.height-W&&Y.readPixels(z,k,D,W,st.convert(Lt),st.convert(Tt),ut)}finally{let Mt=y!==null?St.get(y).__webglFramebuffer:null;ot.bindFramebuffer(36160,Mt)}}},this.copyFramebufferToTexture=function(S,z,k=0){let D=Math.pow(2,-k),W=Math.floor(z.image.width*D),ut=Math.floor(z.image.height*D);pt.setTexture2D(z,0),Y.copyTexSubImage2D(3553,k,0,0,S.x,S.y,W,ut),ot.unbindTexture()},this.copyTextureToTexture=function(S,z,k,D=0){let W=z.image.width,ut=z.image.height,_t=st.convert(k.format),wt=st.convert(k.type);pt.setTexture2D(k,0),Y.pixelStorei(37440,k.flipY),Y.pixelStorei(37441,k.premultiplyAlpha),Y.pixelStorei(3317,k.unpackAlignment),z.isDataTexture?Y.texSubImage2D(3553,D,S.x,S.y,W,ut,_t,wt,z.image.data):z.isCompressedTexture?Y.compressedTexSubImage2D(3553,D,S.x,S.y,z.mipmaps[0].width,z.mipmaps[0].height,_t,z.mipmaps[0].data):Y.texSubImage2D(3553,D,S.x,S.y,_t,wt,z.image),D===0&&k.generateMipmaps&&Y.generateMipmap(3553),ot.unbindTexture()},this.copyTextureToTexture3D=function(S,z,k,D,W=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let ut=S.max.x-S.min.x+1,_t=S.max.y-S.min.y+1,wt=S.max.z-S.min.z+1,Mt=st.convert(D.format),Lt=st.convert(D.type),Tt;if(D.isData3DTexture)pt.setTexture3D(D,0),Tt=32879;else if(D.isDataArrayTexture)pt.setTexture2DArray(D,0),Tt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(37440,D.flipY),Y.pixelStorei(37441,D.premultiplyAlpha),Y.pixelStorei(3317,D.unpackAlignment);let Et=Y.getParameter(3314),kt=Y.getParameter(32878),Sn=Y.getParameter(3316),Xn=Y.getParameter(3315),Yn=Y.getParameter(32877),Ue=k.isCompressedTexture?k.mipmaps[0]:k.image;Y.pixelStorei(3314,Ue.width),Y.pixelStorei(32878,Ue.height),Y.pixelStorei(3316,S.min.x),Y.pixelStorei(3315,S.min.y),Y.pixelStorei(32877,S.min.z),k.isDataTexture||k.isData3DTexture?Y.texSubImage3D(Tt,W,z.x,z.y,z.z,ut,_t,wt,Mt,Lt,Ue.data):k.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Y.compressedTexSubImage3D(Tt,W,z.x,z.y,z.z,ut,_t,wt,Mt,Ue.data)):Y.texSubImage3D(Tt,W,z.x,z.y,z.z,ut,_t,wt,Mt,Lt,Ue),Y.pixelStorei(3314,Et),Y.pixelStorei(32878,kt),Y.pixelStorei(3316,Sn),Y.pixelStorei(3315,Xn),Y.pixelStorei(32877,Yn),W===0&&D.generateMipmaps&&Y.generateMipmap(Tt),ot.unbindTexture()},this.initTexture=function(S){S.isCubeTexture?pt.setTextureCube(S,0):S.isData3DTexture?pt.setTexture3D(S,0):S.isDataArrayTexture||S.isCompressedArrayTexture?pt.setTexture2DArray(S,0):pt.setTexture2D(S,0),ot.unbindTexture()},this.resetState=function(){g=0,b=0,y=null,ot.reset(),X.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Kr=class extends hp{};Kr.prototype.isWebGL1Renderer=!0;function gn(r,t,e){return nc(r)?new r.constructor(r.subarray(t,e!==void 0?e:r.length)):r.slice(t,e)}function gs(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 nc(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var vi=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=s)){let o=e[1];t=s)break t}a=n,n=0;break e}break n}for(;n>>1;te;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);let o=this.getValueSize();this.times=gn(n,s,a),this.values=gn(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&&nc(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=gn(this.times),e=gn(this.values),n=this.getValueSize(),i=this.getInterpolation()===tr,s=t.length-1,a=1;for(let o=1;o0){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=gn(t,0,a),this.values=gn(e,0,a*n)):(this.times=t,this.values=e),this}clone(){let t=gn(this.times,0),e=gn(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Oe.prototype.TimeBufferType=Float32Array;Oe.prototype.ValueBufferType=Float32Array;Oe.prototype.DefaultInterpolation=vs;var Vn=class extends Oe{};Vn.prototype.ValueTypeName="bool";Vn.prototype.ValueBufferType=Array;Vn.prototype.DefaultInterpolation=ys;Vn.prototype.InterpolantFactoryMethodLinear=void 0;Vn.prototype.InterpolantFactoryMethodSmooth=void 0;var eo=class extends Oe{};eo.prototype.ValueTypeName="color";var no=class extends Oe{};no.prototype.ValueTypeName="number";var io=class extends vi{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)yn.slerpFlat(s,0,a,l-o,a,l,c);return s}},Hi=class extends Oe{InterpolantFactoryMethodLinear(t){return new io(this.times,this.values,this.getValueSize(),t)}};Hi.prototype.ValueTypeName="quaternion";Hi.prototype.DefaultInterpolation=vs;Hi.prototype.InterpolantFactoryMethodSmooth=void 0;var Hn=class extends Oe{};Hn.prototype.ValueTypeName="string";Hn.prototype.ValueBufferType=Array;Hn.prototype.DefaultInterpolation=ys;Hn.prototype.InterpolantFactoryMethodLinear=void 0;Hn.prototype.InterpolantFactoryMethodSmooth=void 0;var so=class extends Oe{};so.prototype.ValueTypeName="vector";var co="\\\\[\\\\]\\\\.:\\\\/",up=new RegExp("["+co+"]","g"),lo="[^"+co+"]",fp="[^"+co.replace("\\\\.","")+"]",dp=/((?:WC+[\\/:])*)/.source.replace("WC",lo),pp=/(WCOD+)?/.source.replace("WCOD",fp),mp=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",lo),gp=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",lo),xp=new RegExp("^"+dp+pp+mp+gp+"$"),_p=["material","materials","bones","map"],ro=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(up,"")}static parseTrackName(t){let e=xp.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);_p.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;ae&&(e=i,t=n)}return t}function uo(r,t){t.set(r)}function fo(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]=ni?n:i}}function Wi(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;ae[n+3]&&(e[n+3]=o)}}function bi(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 Mp(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 Xt(i,1));for(let s=0;si-s);for(let i=0;ic&&(c=C),g&&_x&&(x=_);let v=r[b+2],A=r[b+3],L=v-A,B=v+A;Ll&&(l=B),g&&vp&&(p=v);let q=r[b+4],F=r[b+5],I=q-F,U=q+F;Ih&&(h=U),g&&qd&&(d=q)}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 wp(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;ho&&(o=u);let m=r[h+2];mc&&(c=m);let x=r[h+4];xl&&(l=x)}n[0]=i,n[1]=s,n[2]=a,n[3]=o,n[4]=c,n[5]=l}function Sp(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;)a--;if(sr.candidate-t.candidate,vn=new Array(on).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),zs=new Float32Array(6);function Ap(r,t,e,n,i,s){let a=-1,o=0;if(s===0)a=ho(t),a!==-1&&(o=(t[a]+t[a+3])/2);else if(s===1)a=ho(r),a!==-1&&(o=Ep(e,n,i,a));else if(s===2){let c=bi(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)/on;if(i=C.candidate?Wi(_,e,C.rightCacheBounds):(Wi(_,e,C.leftCacheBounds),C.count++)}}for(let _=0;_=on&&(T=on-1);let C=vn[T];C.count++,Wi(y,e,C.bounds)}let g=vn[on-1];uo(g.bounds,g.rightCacheBounds);for(let y=on-2;y>=0;y--){let _=vn[y],M=vn[y+1];fo(_.bounds,M.rightCacheBounds,_.rightCacheBounds)}let b=0;for(let y=0;yT&&(T=y),_>T&&(T=_);let C=(T-M)/2,v=g*2;s[m+v+0]=M+C,s[m+v+1]=C+(Math.abs(M)+C)*ic,Mt[g+3]&&(t[g+3]=T)}}return s}function Pp(r,t){function e(g){u&&u(g/m)}function n(g,b,y,_=null,M=0){if(!x&&M>=c&&(x=!0,l&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(r))),y<=h||M>=c)return e(b+y),g.offset=b,g.count=y,g;let T=Ap(g.boundingData,_,a,b,y,f);if(T.axis===-1)return e(b+y),g.offset=b,g.count=y,g;let C=Sp(o,a,b,y,T);if(C===b||C===b+y)e(b+y),g.offset=b,g.count=y;else{g.splitAxis=T.axis;let v=new Gn,A=b,L=C-b;g.left=v,v.boundingData=new Float32Array(6),mo(a,A,L,v.boundingData,s),n(v,A,L,s,M+1);let B=new Gn,q=C,F=y-L;g.right=B,B.boundingData=new Float32Array(6),mo(a,q,F,B.boundingData,s),n(B,q,F,s,M+1)}return g}Mp(r,t);let i=new Float32Array(6),s=new Float32Array(6),a=Cp(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=bp(r);if(d.length===1){let g=d[0],b=new Gn;b.boundingData=i,wp(a,g.offset,g.count,s),n(b,g.offset,g.count,s),p.push(b)}else for(let g of d){let b=new Gn;b.boundingData=new Float32Array(6),mo(a,g.offset,g.count,b.boundingData,s),n(b,g.offset,g.count,s),p.push(b)}return p}function oc(r,t){let e=Pp(r,t),n,i,s,a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let h=0;hMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[u+6]=y/4,y=l(y,g),i[u+7]=b,y}}}var pe=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;si?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;si?c:i}this.min=n,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}};pe.prototype.setFromBox=function(){let r=new P;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 Kp=function(){let r=new pe;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 Lp=function(){let r=new P,t=new P,e=new P;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,b;d!==0?g=(f*u-x*m)/d:g=0,b=(f+g*u)/m,a.x=g,a.y=b}}(),qi=function(){let r=new At,t=new P,e=new P;return function(i,s,a,o){Lp(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}}}}(),ac=function(){let r=new P,t=new P,e=new be,n=new de;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 Rp=1e-15;function wi(r){return Math.abs(r)new P),this.satBounds=new Array(4).fill().map(()=>new pe),this.points=[this.a,this.b,this.c],this.sphere=new Bn,this.plane=new be,this.needsUpdate=!0}intersectsSphere(t){return ac(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}};me.prototype.closestPointToSegment=function(){let r=new P,t=new P,e=new de;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]),qi(e,i,r,t),h=r.distanceToSquared(t),h1-1e-10){let g=this.satBounds,b=this.satAxes;e[0]=m.a,e[1]=m.b,e[2]=m.c;for(let M=0;M<4;M++){let T=g[M],C=b[M];if(n.setFromPoints(C,e),T.isSeparated(n))return!1}let y=m.satBounds,_=m.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let M=0;M<4;M++){let T=y[M],C=_[M];if(n.setFromPoints(C,t),T.isSeparated(n))return!1}for(let M=0;M<4;M++){let T=b[M];for(let C=0;C<4;C++){let v=_[C];if(s.crossVectors(T,v),n.setFromPoints(s,t),i.setFromPoints(s,e),n.isSeparated(i))return!1}}return x&&(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 g=this.points,b=!1,y=0;for(let F=0;F<3;F++){let I=g[F],U=g[(F+1)%3];l.start.copy(I),l.end.copy(U),l.delta(a);let Z=b?h.start:h.end,J=wi(d.distanceToPoint(I));if(wi(d.normal.dot(a))&&J){h.copy(l),y=2;break}if((d.intersectLine(l,Z)||J)&&!wi(Z.distanceTo(U))){if(y++,b)break;b=!0}}if(y===1&&m.containsPoint(h.end))return x&&(x.start.copy(h.end),x.end.copy(h.end)),!0;if(y!==2)return!1;let _=m.points,M=!1,T=0;for(let F=0;F<3;F++){let I=_[F],U=_[(F+1)%3];l.start.copy(I),l.end.copy(U),l.delta(o);let Z=M?f.start:f.end,J=wi(p.distanceToPoint(I));if(wi(p.normal.dot(o))&&J){f.copy(l),T=2;break}if((p.intersectLine(l,Z)||J)&&!wi(Z.distanceTo(U))){if(T++,M)break;M=!0}}if(T===1&&this.containsPoint(f.end))return x&&(x.start.copy(f.end),x.end.copy(f.end)),!0;if(T!==2)return!1;if(h.delta(a),f.delta(o),a.dot(o)<0){let F=f.start;f.start=f.end,f.end=F}let C=h.start.dot(a),v=h.end.dot(a),A=f.start.dot(a),L=f.end.dot(a),B=v0?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)}}}();me.prototype.distanceToPoint=function(){let r=new P;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}();me.prototype.distanceToTriangle=function(){let r=new P,t=new P,e=["a","b","c"],n=new de,i=new de;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),unew P),this.satAxes=new Array(3).fill().map(()=>new P),this.satBounds=new Array(3).fill().map(()=>new pe),this.alignedSatBounds=new Array(3).fill().map(()=>new pe),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}};ge.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<new de),e=new Array(12).fill().map(()=>new de),n=new P,i=new P;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 b=g.distanceToSquared(i);if(b=0,m,x;u?(m=Ai(r),x=Ei(r,o)):(m=Ei(r,o),x=Ai(r));let d=qs(m,s,n,Hs)?Ws(m,t,e,n):null;if(d){let y=d.point[h];if(u?y<=s[x+l]:y>=s[x+l+3])return d}let b=qs(x,s,n,Hs)?Ws(x,t,e,n):null;return d&&b?d.distance<=b.distance?d:b:d||b||null}}var mc=function(){let r,t,e=[],n=new Si(()=>new oe);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(y){let _=y*2,M=Mn,T=bn;for(;!an(_,M);)y=Ai(y),_=y*2;return Wn(y,T)}function m(y){let _=y*2,M=Mn,T=bn;for(;!an(_,M);)y=Ei(y,T),_=y*2;return Wn(y,T)+Ti(_,M)}let x=s*2,p=Pi,d=Mn,g=bn;if(an(x,d)){let y=Wn(s,g),_=Ti(x,d);return Ce(s,p,r),c(y,_,!1,f,h+s,r)}else{let y=Ai(s),_=Ei(s,g),M=y,T=_,C,v,A,L;if(l&&(A=r,L=t,Ce(M,p,A),Ce(T,p,L),C=l(A),v=l(L),vi.intersectsBox(v),intersectsTriangle:v=>{v.a.applyMatrix4(l),v.b.applyMatrix4(l),v.c.applyMatrix4(l),v.needsUpdate=!0;for(let A=M*3,L=(T+M)*3;Anew me),We=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."),We.serialize(arguments[0],{cloneBuffers:arguments[2]===void 0?!0:arguments[2]});e=Ji({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."),We.deserialize(arguments[0],arguments[1],{setIndex:arguments[2]===void 0?!0:arguments[2]});n=Ji({setIndex:!0},n);let{index:i,roots:s}=t,a=new We(e,Co(Ji({},n),{[vo]:!0}));if(a._roots=s,n.setIndex){let o=e.getIndex();if(o===null){let c=new Xt(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,[vo]:!1},e),e.useSharedArrayBuffer&&typeof SharedArrayBuffer=="undefined")throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,e[vo]||(this._roots=oc(t,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new oe))),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;uT&&(T=q),F<_&&(_=F),F>C&&(C=F),Iv&&(v=I)}return c[u+0]!==y||c[u+1]!==_||c[u+2]!==M||c[u+3]!==T||c[u+4]!==C||c[u+5]!==v?(c[u+0]=y,c[u+1]=_,c[u+2]=M,c[u+3]=T,c[u+4]=C,c[u+5]=v,!0):!1}else{let g=u+8,b=a[u+6],y=g+m,_=b+m,M=x,T=!1,C=!1;t?M||(T=t.has(y),C=t.has(_),M=!T&&!C):(T=!0,C=!0);let v=M||T,A=M||C,L=!1;v&&(L=f(g,m,M));let B=!1;A&&(B=f(b,m,M));let q=L||B;if(q)for(let F=0;F<3;F++){let I=g+F,U=b+F,Z=c[I],J=c[I+3],G=c[U],N=c[U+3];c[u+F]=ZN?J:N}return q}}}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=nn){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{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=Ge.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:_o(m,x,i,l,p,d,s)}else c||(l?c=(u,m,x,p)=>_o(u,m,i,l,x,p,s):c=(u,m,x)=>x);let h=!1,f=0;for(let u of this._roots){if(Li(u),h=mc(0,i,o,c,a,f),Xi(),h)break;f+=u.byteLength}return Ge.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;Ri.copy(e).invert();let h=Ge.getPrimitive(),f=Ge.getPrimitive();if(s){let m=function(x,p,d,g,b,y,_,M){for(let T=d,C=d+g;Tbo.intersectsBox(m),intersectsRange:(m,x,p,d,g,b)=>(Mo.copy(b),Mo.applyMatrix4(Ri),t.shapecast({intersectsBounds:y=>Mo.intersectsBox(y),intersectsRange:(y,_,M,T,C)=>i(m,x,y,_,d,g,T,C)}))});return Ge.releasePrimitive(h),Ge.releasePrimitive(f),u}intersectsBox(t,e){return qn.set(t.min,t.max,e),qn.needsUpdate=!0,this.shapecast({intersectsBounds:n=>qn.intersectsBox(n),intersectsTriangle:n=>qn.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(),qn.set(t.boundingBox.min,t.boundingBox.max,e),qn.needsUpdate=!0;let o=this.geometry,c=o.attributes.position,l=o.index,h=t.attributes.position,f=t.index,u=Ge.getPrimitive(),m=Ge.getPrimitive(),x=Xs,p=zp,d=null,g=null;i&&(d=Op,g=Bp);let b=1/0,y=null,_=null;return Ri.copy(e).invert(),Yi.matrix.copy(Ri),this.shapecast({boundsTraverseOrder:M=>qn.distanceToBox(M),intersectsBounds:(M,T,C)=>C{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:C=>Yi.distanceToBox(C),intersectsBounds:(C,v,A)=>A{for(let A=C*3,L=(C+v)*3;A(Zi.copy(t).clamp(h.min,h.max),Zi.distanceToSquared(t)),intersectsBounds:(h,f,u)=>u{h.closestPointToPoint(t,Zi);let u=t.distanceToSquared(Zi);return u{Ce(0,new Float32Array(n),xc),t.union(xc)}),t}};var wo=self;wo.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 ze;if(o.setAttribute("position",new Xt(s,3,!1)),i&&o.setIndex(new Xt(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 We(o,a),l=We.serialize(c,{cloneBuffers:!1});wo.postMessage({id:n,error:void 0,serialized:l,position:s,progress:1},[l.index.buffer,s.buffer,...l.roots])}catch(o){wo.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-2022 Three.js Authors\n * SPDX-License-Identifier: MIT\n *)\n*/\n')} // src/core/workers/GenerateMeshBvhWorker.ts var GenerateMeshBvhWorker=class{constructor(){this.running=!1,this.worker=new Worker3,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 log.warn("[GenerateMeshBVHWorker] Already running job.");if(!this.worker)return void log.warn("[GenerateMeshBVHWorker] Worker has been disposed.");const{worker:r}=this;this.running=!0;const i=new Map;e.forEach((e=>{i.set(e.id,e)}));let n=0;return new Promise(((e,s)=>{const a=()=>{++n===i.size&&(this.running=!1,r.onmessage=null,e())};r.onerror=e=>{log.warn(`[GenerateMeshBVHWorker] ${e.message}`),s(new Error(`[GenerateMeshBVHWorker] ${e.message}`)),this.running=!1},r.onmessage=e=>{this.running=!1;const{data:r}=e;if(r.error)log.warn(r.error),a();else if(r.serialized){const{serialized:e,position:n,id:s}=r,o=i.get(s),l=MeshBVH.deserialize(e,o,{setIndex:!1}),c=Object.assign({setBoundingBox:!0},t);if(c.transferred&&(o.attributes.position.array=n),o.index)t.saveOriginalIndex&&!o.userData.originalIndex&&(o.userData.originalIndex=o.index.array),log.debug("before update, index:",o.index.array),o.index.array=e.index;else{const t=new BufferAttribute(e.index,1,!1);o.setIndex(t)}o.index&&(log.debug("after update, index:",o.index.array),o.index.needsUpdate=!0),c.setBoundingBox&&!o.boundingBox&&(o.boundingBox=l.getBoundingBox(new Box3)),o.boundsTree=l,a()}else t.onProgress&&t.onProgress(r.progress)};for(const e of i){const i=e[0],n=e[1],s=n.index?n.index.array:void 0,o=n.attributes.position,l=o.array;if(o.isInterleavedBufferAttribute||s&&s.isInterleavedBufferAttribute){log.warn("[GenerateMeshBVHWorker] InterleavedBufferAttribute are not supported for the geometry attributes."),a();continue}const c=[];t.transferred&&(c.push(l),s&&(c.push(s),t.saveOriginalIndex&&(n.userData.originalIndex=s.slice()))),r.postMessage({id:i,index:s,position:l,options:__spreadProps(__spreadValues({},t),{onProgress:null,includedProgressCallback:Boolean(t.onProgress),groups:[...n.groups]})}, // @ts-ignore c.length>0?c.map((e=>e.buffer)):[])}}))}dispose(){this.worker.terminate(),this.worker=void 0}},MeshBvhHelper=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 e=0;e{const i=this.workers.length,n=e.length,s=[],a=Math.floor(n/i),o=n%i;let l=0,c=0;for(let r=0;r=c)break;log.debug("startIndex: "+l+" endIndex: "+c),s.push(i.generate(e.slice(l,c),t))}Promise.allSettled(s).then((()=>{this.running=!1,r()}))}));log.warn("[BVHHelper] Worker has been disposed.")}}))}dispose(){for(let e=0;e{e.traverse((e=>{const i=e;if(i.isMesh&&i.geometry&&MergeUtils.isMergedMesh(i)&&!(i instanceof InstancedMesh)){if(r.has(i.geometry.id))return;i.geometry.index&&t.saveOriginalIndex&&(i.geometry.userData.originalIndex=i.geometry.index.array.slice()),i.geometry.boundsTree=new MeshBVH(i.geometry,t),r.add(i.geometry.id)}}))}))}static createMeshBvhAsync(e,t={}){const r=new Set,i=[];e.forEach((e=>{e.traverse((e=>{const t=e;if(t.isMesh&&t.geometry&&MergeUtils.isMergedMesh(t)&&!(t instanceof InstancedMesh)){if(r.has(t.geometry.id))return;i.push(t.geometry),r.add(t.geometry.id)}}))}));const n=new MeshBvhHelper;n.generate(i,t).then((()=>{n.dispose()}))}},RafHelper=class{constructor(){this.TIMEOUT="timeout",this.INTERVAL="interval", // eslint-disable-next-line this.timeoutMap={}, // timeout map, key is symbol // eslint-disable-next-line this.intervalMap={}} // interval map run(e=this.INTERVAL,t,r=16.7){const i=Date.now;let n=i(),s=n;const a=Symbol(""),o=()=>{this.setIdMap(a,e,o),s=i(),s-n>=r&&(e===this.intervalMap&&(n=i(),s=n),t(),e===this.TIMEOUT&&this.clearTimeout(a))};return this.setIdMap(a,e,o),a}setIdMap(e,t,r){const i=requestAnimationFrame(r);t===this.INTERVAL?this.intervalMap[e]=i:t===this.TIMEOUT&&(this.timeoutMap[e]=i)}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])}},_ZoomToRectHelper=class{constructor(e){this.mouseDown=!1,this.mouseMove=!1,this.mouseDownPositionX=-1, // -1 means invalid point this.mouseDownPositionY=-1,this.tempEnableRotate=!1,this.actived=!1,this.mousedown=e=>{if(e.preventDefault(),0===e.button){this.mouseDown=!0;const t=CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer);this.mouseDownPositionX=t.x,this.mouseDownPositionY=t.y}},this.mousemove=e=>{if(e.preventDefault(),!this.mouseDown)return;const t=CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer);if(this.mouseDownPositionX>=0&&this.mouseDownPositionY>=0){const e=5;if(Math.abs(t.x-this.mouseDownPositionX)>=e||Math.abs(t.y-this.mouseDownPositionY)>=e){this.mouseMove=!0;const e=new Vector2(Math.min(this.mouseDownPositionX,t.x),Math.min(this.mouseDownPositionY,t.y)),r=new Vector2(Math.max(this.mouseDownPositionX,t.x),Math.max(this.mouseDownPositionY,t.y));this.drawRect(e,r)}}},this.mouseup=e=>{if(e.preventDefault(),this.mouseDown&&this.mouseMove){const t=CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer),r=new Vector2(Math.min(this.mouseDownPositionX,t.x),Math.min(this.mouseDownPositionY,t.y)),i=new Vector2(Math.max(this.mouseDownPositionX,t.x),Math.max(this.mouseDownPositionY,t.y));this.handleZoomToRect(r,i),this.deactivate(),this.setRectDomVisible(!1)}this.mouseDown=!1,this.mouseMove=!1,this.mouseDownPositionX=-1,this.mouseDownPositionY=-1},this.viewer=e}get viewerContainer(){return this.viewer.viewerContainer}get camera(){return this.viewer.camera}get raycaster(){return this.viewer.getRaycaster()}isActived(){return this.actived}activate(){if(this.isActived())return;this.actived=!0,this.viewerContainer.addEventListener("pointerdown",this.mousedown),this.viewerContainer.addEventListener("pointermove",this.mousemove),this.viewerContainer.addEventListener("pointerup",this.mouseup);const e=this.viewer.controls;this.tempKey=e.mouseButtons.LEFT,this.tempEnableRotate=e.enableRotate,e.mouseButtons.LEFT=-1,e.enableRotate=!1}deactivate(){this.actived=!1,this.viewerContainer.removeEventListener("pointerdown",this.mousedown),this.viewerContainer.removeEventListener("pointermove",this.mousemove),this.viewerContainer.removeEventListener("pointerup",this.mouseup),this.viewer.controls.mouseButtons.LEFT=this.tempKey,this.viewer.controls.enableRotate=this.tempEnableRotate}pickPositionByScreenPoint(e){const t=CoordinateConversionUtils.screenPoint2NdcPoint(e,this.camera,this.viewerContainer);this.raycaster.setFromCamera(t,this.camera);let r=[];this.viewer instanceof BimViewer?r=this.viewer.getRaycastableObjectsByMouse({clientX:e.x,clientY:e.y}):this.viewer instanceof DxfViewer&&(r=[this.viewer.groundPlane]);const i=this.raycaster.intersectObjects(r)||[];if(i.length>0)return i[0].point}handleZoomToRect(e,t){const r=this.pickPositionByScreenPoint(e),i=this.pickPositionByScreenPoint(t);if(r&&i){const e=new Vector3(Math.min(r.x,i.x),Math.min(r.y,i.y),Math.min(r.z,i.z)),t=new Vector3(Math.max(r.x,i.x),Math.max(r.y,i.y),Math.max(r.z,i.z)),n=new Box3(e,t);this.viewer.zoomToBBox(n)}}drawRect(e,t){this.rectDom||(this.rectDom=document.createElement("div"),this.rectDom.style.cssText=`position: absolute;border: ${_ZoomToRectHelper.BORDER_WIDTH} solid ${_ZoomToRectHelper.BORDER_COLOR};`,this.viewerContainer.appendChild(this.rectDom)),this.setRectDomVisible(!0),this.rectDom.style.left=`${e.x}px`,this.rectDom.style.top=`${e.y}px`;const r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);this.rectDom.style.width=`${r}px`,this.rectDom.style.height=`${i}px`}setRectDomVisible(e){this.rectDom&&(this.rectDom.style.display=e?"inline-block":"none")}destroy(){var e;this.deactivate(),null==(e=this.rectDom)||e.remove(),this.rectDom=void 0}},ZoomToRectHelper=_ZoomToRectHelper; // src/core/helpers/MeshBvhHelper.ts ZoomToRectHelper.BORDER_COLOR="#fff000",ZoomToRectHelper.BORDER_WIDTH="2px"; // src/core/measure/AngleMeasureDrawable.ts var AngleMeasureDrawable=class extends BaseMeasureDrawable{constructor(e,t){super(e,t),this.type="Angle"/* Angle */,this.update(t)}draw(e,t){e.save(),e.lineWidth=BaseMeasureDrawable.LINE_WIDTH,e.strokeStyle=BaseMeasureDrawable.MAJOR_COLOR;const r=this.points;if(e.beginPath(),r.forEach(((r,i)=>{const n=this.transToScreenCoord(r,t);0===i?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),3===this.points.length){const[r,i,n]=this.points.map((e=>this.transToScreenCoord(e,t))),s=(new Vector2).subVectors(r,i).normalize(),a=(new Vector2).subVectors(n,i).normalize(),o=Math.min(r.distanceTo(i),n.distanceTo(i)),l=s.angle(),c=a.angle();e.moveTo(i.x,i.y),e.arc(i.x,i.y,o/5,l,c,s.cross(a)<0)}e.stroke(),e.restore(),this.drawing&&this.drawPoints(e,t,this.points.slice(0,this.points.length-1)),this.drawText(e,t)}drawText(e,t){if(this.points.length<3)return;const[r,i,n]=this.points,s=this.getAngleBisector(r,i,n),a=this.calculateAngle(r,i,n);this.label=`${showPrecisionValue(a,2)} ${this.getUnitString()}`;const o=.3*Math.min(r.distanceTo(i),n.distanceTo(i));this.labelPositon=this.transToScreenCoord(i.clone().add(new Vector3(s.x*o,s.y*o,s.z*o)),t),super.drawText(e,t)}getAngleBisector(e,t,r){const i=e,n=t,s=r,a=new Vector3(i.x-n.x,i.y-n.y,i.z-n.z).normalize(),o=new Vector3(s.x-n.x,s.y-n.y,s.z-n.z).normalize();return new Vector3(a.x+o.x,a.y+o.y,a.z+o.z).normalize()}calculateAngle(e,t,r){const i=e,n=t,s=r,a=new Vector3(i.x-n.x,i.y-n.y,i.z-n.z),o=new Vector3(s.x-n.x,s.y-n.y,s.z-n.z);return 180*a.angleTo(o)/Math.PI}getClassType(){return"Angle"}};CanvasRender._registerDrawableClass(AngleMeasureDrawable); // src/core/measure/AngleMeasurement.ts var AngleMeasurement=class extends BaseMeasurement{constructor(e,t,r){super("Angle"/* Angle */,e,t,r)}onMouseMove(e){this.createOrUpdateAngleMeasureDrawable(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),e.button===MOUSE.RIGHT)return this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,void(this.lastMouseDownPosition=void 0);const r=this.getIntersections(e)[0];if(!r)return;const i=null!=(t=this.snapPoint)?t:null==r?void 0:r.point,n=this.drawingPoints;n.push(i),this.lastMouseDownPosition=i,1===n.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdateAngleMeasureDrawable(),n.length>=3&&this.complete()}complete(){var e;null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("complete",this.currentMeasureDrawable),this.completed=!0,this.currentMeasureDrawable=void 0,this.drawingPoints=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.drawingPoints;if(e&&e.length>0){if(e.pop(),0===e.length&&(this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.lastMouseDownPosition=void 0}deactivate(){super.deactivate(),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)}setTooltipContent(){var e;const t=this.viewer.translate;if(!t)return;const r=t("Tooltip.measure");r&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(r))}createOrUpdateAngleMeasureDrawable(e){if(!this.drawingPoints)return;if(this.drawingPoints&&this.drawingPoints.length<1)return;const t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new AngleMeasureDrawable(CommonUtils.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},import_d_polygon_self_intersections=__toESM(require_intersections(),1),Earcut2={triangulate:function(e,t,r=2){const i=t&&t.length,n=i?t[0]*r:e.length;let s=linkedList2(e,0,n,r,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c,u,h,p,d;if(i&&(s=eliminateHoles2(e,t,s,r)),e.length>80*r){o=c=e[0],l=u=e[1];for(let t=r;tc&&(c=h),p>u&&(u=p);d=Math.max(c-o,u-l),d=0!==d?32767/d:0}return earcutLinked2(s,a,r,o,l,d,0),a}}; // src/core/utils/PolygonUtils.ts function linkedList2(e,t,r,i,n){let s,a;if(n===signedArea2(e,t,r,i)>0)for(s=t;s=t;s-=i)a=insertNode2(s,e[s],e[s+1],a);return a&&equals3(a,a.next)&&(removeNode2(a),a=a.next),a}function filterPoints2(e,t){if(!e)return e;t||(t=e);let r,i=e;do{if(r=!1,i.steiner||!equals3(i,i.next)&&0!==area2(i.prev,i,i.next))i=i.next;else{if(removeNode2(i),i=t=i.prev,i===i.next)break;r=!0}}while(r||i!==t);return t}function earcutLinked2(e,t,r,i,n,s,a){if(!e)return;!a&&s&&indexCurve2(e,i,n,s);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,s?isEarHashed2(e,i,n,s):isEar2(e))t.push(o.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),removeNode2(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?earcutLinked2(e=cureLocalIntersections2(filterPoints2(e),t,r),t,r,i,n,s,2):2===a&&splitEarcut2(e,t,r,i,n,s):earcutLinked2(filterPoints2(e),t,r,i,n,s,1);break}}function isEar2(e){const t=e.prev,r=e,i=e.next;if(area2(t,r,i)>=0)return!1;const n=t.x,s=r.x,a=i.x,o=t.y,l=r.y,c=i.y,u=ns?n>a?n:a:s>a?s:a,d=o>l?o>c?o:c:l>c?l:c;let m=i.next;for(;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&pointInTriangle2(n,o,s,l,a,c,m.x,m.y)&&area2(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function isEarHashed2(e,t,r,i){const n=e.prev,s=e,a=e.next;if(area2(n,s,a)>=0)return!1;const o=n.x,l=s.x,c=a.x,u=n.y,h=s.y,p=a.y,d=ol?o>c?o:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,_=zOrder2(d,m,t,r,i),y=zOrder2(f,g,t,r,i);let T=e.prevZ,v=e.nextZ;for(;T&&T.z>=_&&v&&v.z<=y;){if(T.x>=d&&T.x<=f&&T.y>=m&&T.y<=g&&T!==n&&T!==a&&pointInTriangle2(o,u,l,h,c,p,T.x,T.y)&&area2(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,v.x>=d&&v.x<=f&&v.y>=m&&v.y<=g&&v!==n&&v!==a&&pointInTriangle2(o,u,l,h,c,p,v.x,v.y)&&area2(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;T&&T.z>=_;){if(T.x>=d&&T.x<=f&&T.y>=m&&T.y<=g&&T!==n&&T!==a&&pointInTriangle2(o,u,l,h,c,p,T.x,T.y)&&area2(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=m&&v.y<=g&&v!==n&&v!==a&&pointInTriangle2(o,u,l,h,c,p,v.x,v.y)&&area2(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function cureLocalIntersections2(e,t,r){let i=e;do{const n=i.prev,s=i.next.next;!equals3(n,s)&&intersects2(n,i,i.next,s)&&locallyInside2(n,s)&&locallyInside2(s,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(s.i/r|0),removeNode2(i),removeNode2(i.next),i=e=s),i=i.next}while(i!==e);return filterPoints2(i)}function splitEarcut2(e,t,r,i,n,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&isValidDiagonal2(a,e)){let o=splitPolygon2(a,e);return a=filterPoints2(a,a.next),o=filterPoints2(o,o.next),earcutLinked2(a,t,r,i,n,s,0),void earcutLinked2(o,t,r,i,n,s,0)}e=e.next}a=a.next}while(a!==e)}function eliminateHoles2(e,t,r,i){const n=[];let s,a,o,l,c;for(s=0,a=t.length;s=i.next.y&&i.next.y!==i.y){const e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=s&&e>n&&(n=e,r=i.x=i.x&&i.x>=l&&s!==i.x&&pointInTriangle2(ar.x||i.x===r.x&§orContainsSector2(r,i)))&&(r=i,h=u)),i=i.next}while(i!==o);return r}function sectorContainsSector2(e,t){return area2(e.prev,e,t.prev)<0&&area2(t.next,e,e.next)<0}function indexCurve2(e,t,r,i){let n=e;do{0===n.z&&(n.z=zOrder2(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,sortLinked2(n)}function sortLinked2(e){let t,r,i,n,s,a,o,l,c=1;do{for(r=e,e=null,s=null,a=0;r;){for(a++,i=r,o=0,t=0;t0||l>0&&i;)0!==o&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(a>1);return e}function zOrder2(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function getLeftmost2(e){let t=e,r=e;do{(t.x=(e-a)*(s-o)&&(e-a)*(i-o)>=(r-a)*(t-o)&&(r-a)*(s-o)>=(n-a)*(i-o)}function isValidDiagonal2(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!intersectsPolygon2(e,t)&&(locallyInside2(e,t)&&locallyInside2(t,e)&&middleInside2(e,t)&&(area2(e.prev,e,t.prev)||area2(e,t.prev,t))||// does not create opposite-facing sectors equals3(e,t)&&area2(e.prev,e,e.next)>0&&area2(t.prev,t,t.next)>0)}function area2(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function equals3(e,t){return e.x===t.x&&e.y===t.y}function intersects2(e,t,r,i){const n=sign2(area2(e,t,r)),s=sign2(area2(e,t,i)),a=sign2(area2(r,i,e)),o=sign2(area2(r,i,t));return n!==s&&a!==o||(!(0!==n||!onSegment2(e,r,t))||(!(0!==s||!onSegment2(e,i,t))||(!(0!==a||!onSegment2(r,e,i))||!(0!==o||!onSegment2(r,t,i)))))}function onSegment2(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function sign2(e){return e>0?1:e<0?-1:0}function intersectsPolygon2(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&intersects2(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function locallyInside2(e,t){return area2(e.prev,e,e.next)<0?area2(e,t,e.next)>=0&&area2(e,e.prev,t)>=0:area2(e,t,e.prev)<0||area2(e,e.next,t)<0}function middleInside2(e,t){let r=e,i=!1;const n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function splitPolygon2(e,t){const r=new Node3(e.i,e.x,e.y),i=new Node3(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function insertNode2(e,t,r,i){const n=new Node3(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function removeNode2(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 Node3(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea2(e,t,r,i){let n=0;for(let s=t,a=r-i;se.toArray())).reduce(((e,t)=>(e.push(...t),e)),[]),r=[];return Earcut2.triangulate(t,[],3).forEach((e=>r.push(e))),r} // Determines whether points are coplanar static arePointsCoplanar(e){if(e.length<4)return!0;const t=e[1].clone().sub(e[0]),r=e[2].clone().sub(e[0]).cross(t).normalize();for(let t=3;tEPSILON3)return!1}return!0} // Determines whether the polygon making up of the points is self-intersecting static isSelfIntersecting(e){const t=e.map((e=>e.toArray().slice(0,-1)));return(0,import_d_polygon_self_intersections.default)(t).length>0}},AreaMeasureDrawable=class extends BaseMeasureDrawable{constructor(e,t){super(e,t),this.type="Area"/* Area */,this.update(t)}draw(e,t){const r=this.points;e.save(),e.lineWidth=BaseMeasureDrawable.LINE_WIDTH,e.strokeStyle=BaseMeasureDrawable.MAJOR_COLOR,e.fillStyle=BaseMeasureDrawable.AREA_FILL_COLOR,e.beginPath(),r.forEach(((r,i)=>{const n=this.transToScreenCoord(r,t);0===i?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.fill(),e.stroke(),e.restore(),this.drawing&&this.drawPoints(e,t,this.points.slice(0,this.points.length-1)),this.drawText(e,t)}drawText(e,t){const r=this.points,i=this.calculateArea(r);this.label=`${showPrecisionValue(i,2)}`,this.labelPositon=this.transToScreenCoord(this.getBarycenter(r),t),super.drawText(e,t)}calculateArea(e){let t=0;const r=PolygonUtils.getFaces(e);for(let i=0;i{r+=e.x,i+=e.y,n+=e.z})),new Vector3(r/t,i/t,n/t)}isPointInPath(e,t){const r=null==t?void 0:t.ray;if(!r)return!1;const i=this.transToScreenCoord(e,t.camera);if(this.labelBounds.containsPoint(i))return!0;const n=PolygonUtils.getFaces(this.points);for(let t=0;t=3&&!PolygonUtils.arePointsCoplanar([...i,s])?log.warn("[Measure] The position is not coplanar with other points"):(i.push(s),this.lastMouseDownPosition=s,1===i.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdateAreaMeasureDrawable())}complete(){var e;null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("complete",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.drawingPoints;if(e&&e.length>0){if(e.pop(),0===e.length&&(this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.lastMouseDownPosition=void 0}deactivate(){super.deactivate(),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)}setTooltipContent(){var e;const t=this.viewer.translate;if(t){const r=t("Tooltip.areaMeasurement");r&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(r))}}createOrUpdateAreaMeasureDrawable(e){if(!this.drawingPoints)return;if(this.drawingPoints&&this.drawingPoints.length<1)return;const t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new AreaMeasureDrawable(CommonUtils.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},CoordinateMeasureDrawable=class extends BaseMeasureDrawable{constructor(e,t){super(e,t),this.type="Coordinate"/* Coordinate */,this.update(t)}draw(e,t){this.drawText(e,t),e.save(),e.lineWidth=BaseMeasureDrawable.LINE_WIDTH,e.strokeStyle=BaseMeasureDrawable.MAJOR_COLOR,e.fillStyle=BaseMeasureDrawable.AREA_FILL_COLOR;const r=this.points;e.beginPath(),r.forEach((r=>{const i=this.transToScreenCoord(r,t);e.arc(i.x,i.y,BaseMeasureDrawable.POINT_RADIUS,0,2*Math.PI)})),e.fill(),e.stroke(),e.restore()}drawText(e,t){const r=this.points[0];MathUtils2.areNumbersEqual(r.x,0);const i=MathUtils2.areNumbersEqual(r.x,0)?0:r.x,n=MathUtils2.areNumbersEqual(r.y,0)?0:r.y,s=MathUtils2.areNumbersEqual(r.z,0)?0:r.z;this.label=`${showPrecisionValue(i,2)}, ${showPrecisionValue(n,2)}, ${showPrecisionValue(s,2)}`,e.font=`${BaseMeasureDrawable.LABEL_FONT_SIZE}px Arial`;const a=1.2*e.measureText(this.label).width,o=1.5*BaseMeasureDrawable.LABEL_FONT_SIZE;this.labelPositon=this.transToScreenCoord(r,t),this.labelPositon.y-=o/2,this.labelBounds.setFromCenterAndSize(this.labelPositon,new Vector2(a,o)),this.drawRoundRect(e,this.labelPositon.x-a/2,this.labelPositon.y-o/2,a,o,4),e.save(),e.fillStyle=BaseMeasureDrawable.MINOR_COLOR,e.textBaseline="middle",e.textAlign="center",e.fillText(this.label,this.labelPositon.x,this.labelPositon.y),e.restore()}getClassType(){return"Coordinate"}}; // src/core/measure/CoordinateMeasureDrawable.ts CanvasRender._registerDrawableClass(CoordinateMeasureDrawable); // src/core/measure/CoordinateMeasurement.ts var CoordinateMeasurement=class extends BaseMeasurement{constructor(e,t,r){super("Coordinate"/* Coordinate */,e,t,r)}onMouseMove(e){this.createOrUpdatePointMarker(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),e.button===MOUSE.RIGHT)return this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,void(this.lastMouseDownPosition=void 0);const r=this.getIntersections(e)[0];if(!r)return;const i=null!=(t=this.snapPoint)?t:null==r?void 0:r.point,n=this.drawingPoints;n.push(i),this.lastMouseDownPosition=i,1===n.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdatePointMarker(i),n.length>=1&&this.complete()}complete(){this.dispatchEvent("complete",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.drawingPoints;if(e&&e.length>0){if(e.pop(),0===e.length&&(this.completed=!0),this.lastMoveEvent){const e=this.getIntersections(this.lastMoveEvent)[0];e&&this.onMouseMove(e.point)}}else this.deactivate(),this.dispatchEvent("deactivate",this.type);this.osnapHelper.deactivate(),this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}setTooltipContent(){var e;const t=this.viewer.translate;if(t){const r=t("Tooltip.measure");r&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(r))}}createOrUpdatePointMarker(e){if(!this.drawingPoints)return;if(this.drawingPoints&&this.drawingPoints.length<1)return;const t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new CoordinateMeasureDrawable(CommonUtils.guid(),this.drawingPoints),this.currentMeasureDrawable.selected=!0,this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t)}},_DistanceMeasureDrawable=class extends BaseMeasureDrawable{constructor(e,t){super(e,t),this.type="Distance"/* Distance */,this.update(t)}draw(e,t){const r=this.points;e.save(),e.lineWidth=BaseMeasureDrawable.LINE_WIDTH,e.strokeStyle=BaseMeasureDrawable.MAJOR_COLOR,e.beginPath(),r.forEach(((r,i)=>{const n=this.transToScreenCoord(r,t);0===i?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore(),this.drawing?this.drawPoints(e,t,this.points.slice(0,this.points.length-1)):this.selected||this.drawVerticalLine(e,t),this.drawText(e,t)}drawText(e,t){if(this.points.length<2)return;const[r,i]=this.points,n=r.distanceTo(i);this.label=`${showPrecisionValue(n,2)}`,this.labelPositon=this.transToScreenCoord(r.clone().add(i).divideScalar(2),t),super.drawText(e,t)}drawVerticalLine(e,t){if(this.points.length<2)return;const[r,i]=this.points.map((e=>this.transToScreenCoord(e,t))),[n,s]=this.getShortLineBySegments(r,i),[a,o]=this.getShortLineBySegments(i,r);e.save(),e.lineWidth=BaseMeasureDrawable.LINE_WIDTH,e.strokeStyle=BaseMeasureDrawable.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){const r=(new Vector2).subVectors(t,e).normalize(),i=_DistanceMeasureDrawable.SHORT_LINE_LENGTH/2,n=Math.PI/2;return[r.clone().rotateAround(new Vector2,n).normalize().multiplyScalar(i).add(e),r.clone().rotateAround(new Vector2,-n).normalize().multiplyScalar(i).add(e)]}getClassType(){return"Distance"}},DistanceMeasureDrawable=_DistanceMeasureDrawable; // src/core/measure/DistanceMeasureDrawable.ts DistanceMeasureDrawable.SHORT_LINE_LENGTH=12,CanvasRender._registerDrawableClass(DistanceMeasureDrawable); // src/core/measure/DistanceMeasurement.ts var DistanceMeasurement=class extends BaseMeasurement{constructor(e,t,r){super("Distance"/* Distance */,e,t,r)}onMouseMove(e){this.createOrUpdateDistanceMeasureDrawable(e)}onMouseClick(e){var t;if(super.onMouseClick(e),this.clickedOnMeasurementDrawable)return;if(this.drawingPoints||(this.drawingPoints=[]),e.button===MOUSE.RIGHT)return this.drawingPoints=void 0,this.currentMeasureDrawable&&(this.removeDrawable(this.currentMeasureDrawable),this.currentMeasureDrawable=void 0),this.completed=void 0,void(this.lastMouseDownPosition=void 0);const r=this.getIntersections(e)[0];if(!r)return;const i=null!=(t=this.snapPoint)?t:null==r?void 0:r.point,n=this.drawingPoints;n.length<2&&n.push(i),this.lastMouseDownPosition=i,1===n.length&&(this.dispatchEvent("firstpointpicked"),this.completed=!1),this.createOrUpdateDistanceMeasureDrawable(),n.length>=2&&this.complete()}complete(){var e;null==(e=this.currentMeasureDrawable)||e.setDrawingState(!1),this.dispatchEvent("complete",this.currentMeasureDrawable),this.completed=!0,this.drawingPoints=void 0,this.currentMeasureDrawable=void 0,this.lastMouseDownPosition=void 0}cancel(){const e=this.drawingPoints;e&&e.length>0?(e.pop(),0===e.length&&(this.completed=!0),this.currentMeasureDrawable&&this.removeDrawable(this.currentMeasureDrawable)):(this.deactivate(),this.dispatchEvent("deactivate",this.type)),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;const t=this.viewer.translate;if(t){const r=t("Tooltip.measure");r&&this.tooltip&&(null==(e=this.tooltip)||e.setContent(r))}}createOrUpdateDistanceMeasureDrawable(e){if(!this.drawingPoints)return;if(this.drawingPoints&&this.drawingPoints.length<1)return;const t=[...this.drawingPoints];this.currentMeasureDrawable||(this.currentMeasureDrawable=new DistanceMeasureDrawable(CommonUtils.guid(),this.drawingPoints),this.drawList.addDrawable(this.currentMeasureDrawable)),e&&t.push(e),this.currentMeasureDrawable.update(t),this.currentMeasureDrawable.setDrawingState(!0)}},import_lodash6=__toESM(require_lodash(),1),UndoRedoHelper=class{constructor(e){this.history=[],this.step=0,this.maxCount=50,this.maxCount=e||this.maxCount}addRecord(e,t){this.history.length===this.maxCount&&this.history.shift(),this.step!==this.history.length&&this.history.splice(this.step),this.history.push({type:e,payload:(0,import_lodash6.cloneDeep)(t)}),this.step++}undo(){if(0!==this.step)return this.step--,this.history[this.step]}redo(){if(this.step!==this.history.length)return this.step++,this.history[this.step-1]}clear(){this.history=[],this.step=0}destroy(){this.clear(),this.maxCount=0}},MeasurementUndoRedo=class extends UndoRedoHelper{constructor(e,t=30){super(t),this.manager=e}undo(){const e=super.undo();switch(null==e?void 0:e.type){case"ADD"/* Add */:{const t=e.payload.id;t&&this.manager.removeMeasurementById(t,!1)}break;case"REMOVE"/* Remove */:{const t=e.payload,r=this.manager.createMeasurement(t);this.manager.addMeasurement(r,!1)}}return e}redo(){const e=super.redo();switch(null==e?void 0:e.type){case"ADD"/* Add */:{const t=e.payload,r=this.manager.createMeasurement(t);this.manager.addMeasurement(r,!1)}break;case"REMOVE"/* Remove */:{const t=e.payload.id;t&&this.manager.removeMeasurementById(t,!1)}}return e}},MeasurementManager2=class{constructor(e){var t;this.selectedMeasurementDrawable=void 0,this.drawableList=new DrawableList("measure"),this.measurements={}, // MeasurementType as key this.activeMeasurementType=void 0,this.undoRedoHelper=new MeasurementUndoRedo(this), /** * The closest intersection * @param e */ this.getIntersections=e=>{if(!this.raycaster)return[];this.raycaster&&this.raycaster.layers.disable(layerForNonSnapableObjects);const t=this.viewer.getRaycastableObjectsByMouse(e);log.debug(`[BaseMeasurement] The count of raycastable object is ${t.length}`,t);const r=Date.now(),i=this.raycaster.intersectObjects(t,!0)||[];return log.debug(`[BaseMeasurement] this.raycaster.intersectObjects costs ${(Date.now()-r)/1e3}s`),log.debug("intersects: ",i),i},this.keydown=e=>{const t=this.getActiveMeasurementType();let r;t&&(r=this.measurements[t]);const i=this.selectedMeasurementDrawable;i&&"Delete"===e.code&&(this.removeMeasurement(i),this.activeMeasurementType&&this.measurements[this.activeMeasurementType].clearClickedDrawable()),e.ctrlKey&&"KeyZ"===e.code&&((null==r?void 0:r.isMeasuring)?r.cancel():this.undo()),e.ctrlKey&&"KeyY"===e.code&&((null==r?void 0:r.isMeasuring)||this.redo()),this.viewer.enableRender()},this.viewer=e,this.overlayRender=this.viewer.overlayRender,null==(t=this.overlayRender)||t.addDrawableList(this.drawableList),this.scene=new Scene,this.osnapHelper=new OSnapHelper(this.overlayRender),this.measurements.Distance=new DistanceMeasurement(this.viewer,this.drawableList,this.osnapHelper),this.measurements.Area=new AreaMeasurement(this.viewer,this.drawableList,this.osnapHelper),this.measurements.Angle=new AngleMeasurement(this.viewer,this.drawableList,this.osnapHelper),this.measurements.Coordinate=new CoordinateMeasurement(this.viewer,this.drawableList,this.osnapHelper),this.canvas.addEventListener("wheel",(()=>{this.updateSnapTolerance()})),this.initEvents()}initEvents(){Object.values(this.measurements).forEach((e=>{e.addEventListener("complete",(e=>{this.undoRedoHelper.addRecord("ADD"/* Add */,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()}getPixelSizeInWorldCoord(){if(!this.viewer.viewerContainer)return log.error("[BaseMeasurement] Missing viewer.container"),0;const e=this.viewer.camera,{clientWidth:t,clientHeight:r}=this.viewer.viewerContainer;let i=0;if("OrthographicCamera"===e.type){const n=e;i=Math.max(n.right-n.left,n.top-n.bottom)/n.zoom/Math.max(t,r)}else if("PerspectiveCamera"===e.type){const t=e,n=this.viewer.cameraCfg,s=n&&CommonUtils.arrayToVector3(n.eye),a=n&&CommonUtils.arrayToVector3(n.look);i=2*(s.distanceTo(a)*Math.tan(t.fov/2*Math.PI/180))/r}return i}addMeasurement(e,t=!0){this.drawableList.addDrawable(e),this.selectedMeasurementDrawable=e,t&&this.undoRedoHelper.addRecord("ADD"/* Add */,e.getData()),this.viewer.enableRender()}createMeasurement(e){return CanvasRender.createDrawable(e)}removeMeasurement(e,t=!0){this.drawableList.removeDrawable(e),this.selectedMeasurementDrawable=void 0,t&&this.undoRedoHelper.addRecord("REMOVE"/* Remove */,e.getData()),this.viewer.enableRender()}updateSnapTolerance(e=3){const t=this.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,log.error("[Measure] Failed to activate measurement, type:",e)),window.addEventListener("keydown",this.keydown)}deactivateMeasurement(){this.unselectMeasurement();const e=this.activeMeasurementType;e&&this.measurements[e].deactivate(),this.activeMeasurementType=void 0,window.removeEventListener("keydown",this.keydown)}getActiveMeasurementType(){return this.activeMeasurementType}isMeasurementActive(){const e=this.activeMeasurementType;return e?this.measurements[e].isActive:!!this.getActiveMeasurementType()}getMeasurementsData(){return this.drawableList.getDrawableDatas()}setMeasurementsData(e){this.drawableList.clear(),e.forEach((e=>{this.measurements[e.type]?e.points.length>=2?this.addMeasurement(CanvasRender.createDrawable(e),!1):log.info("[Measure] Invalid points found in MeasurementData:",e):log.warn("[Measure] Failed to add measurement data for",e)}))}setMeasurementsVisibility(e){this.drawableList.getDrawables().forEach((t=>t.visible=e)),this.viewer.enableRender()}clearMeasurements(){this.drawableList.clear(),this.viewer.enableRender()}removeMeasurementById(e,t=!0){const r=this.drawableList.getDrawableById(e);r&&(this.removeMeasurement(r,t),log.warn("[Measure] Failed to find measurement by id:",e))}selectMeasurementById(e){this.unselectMeasurement();const 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.selectedMeasurementDrawable=void 0,this.viewer.enableRender()}undo(){this.undoRedoHelper.undo()}redo(){this.undoRedoHelper.redo()}clearUndoRedo(){this.undoRedoHelper.clear()}destroy(){var e;this.deactivateMeasurement(),this.clearMeasurements(),this.measurements={},null==(e=this.osnapHelper)||e.destroy(),this.scene.clear(),this.undoRedoHelper.destroy()}},_position3=new Vector3,_quaternion2=new Quaternion,_scale2=new Vector3,CSS3DObject=class extends Object3D{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}},_matrix2=new Matrix4,_matrix22=new Matrix4,CSS3DRenderer=class{constructor(e={}){const t=this;let r,i,n,s;const 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;const l=document.createElement("div");function c(e){return Math.abs(e)<1e-10?0:e}function u(e){const t=e.elements;return"matrix3d("+c(t[0])+","+c(-t[1])+","+c(t[2])+","+c(t[3])+","+c(t[4])+","+c(-t[5])+","+c(t[6])+","+c(t[7])+","+c(t[8])+","+c(-t[9])+","+c(t[10])+","+c(t[11])+","+c(t[12])+","+c(-t[13])+","+c(t[14])+","+c(t[15])+")"}function h(e){const t=e.elements;return"translate(-50%,-50%)"+("matrix3d("+c(t[0])+","+c(t[1])+","+c(t[2])+","+c(t[3])+","+c(-t[4])+","+c(-t[5])+","+c(-t[6])+","+c(-t[7])+","+c(t[8])+","+c(t[9])+","+c(t[10])+","+c(t[11])+","+c(t[12])+","+c(t[13])+","+c(t[14])+","+c(t[15])+")")}function p(e,r,i,n){if(e.isCSS3DObject){const n=!0===e.visible&&!0===e.layers.test(i.layers);if(e.element.style.display=!0===n?"":"none",!0===n){let n;e.onBeforeRender(t,r,i),e.isCSS3DSprite?(_matrix2.copy(i.matrixWorldInverse),_matrix2.transpose(),0!==e.rotation2D&&_matrix2.multiply(_matrix22.makeRotationZ(e.rotation2D)),e.matrixWorld.decompose(_position3,_quaternion2,_scale2),_matrix2.setPosition(_position3),_matrix2.scale(_scale2),_matrix2.elements[3]=0,_matrix2.elements[7]=0,_matrix2.elements[11]=0,_matrix2.elements[15]=1,n=h(_matrix2)):n=h(e.matrixWorld);const s=e.element,o=a.objects.get(e);if(void 0===o||o.style!==n){s.style.transform=n;const t={style:n};a.objects.set(e,t)}s.parentNode!==l&&l.appendChild(s),e.onAfterRender(t,r,i)}}for(let t=0,s=e.children.length;t({position:new Vector3(e,t,r),rotation:new Euler(i,n,s)}),plane={Front:__spreadProps(__spreadValues({},posAndRot([0,0,1],[0,0,0])),{label:"NavCube.front"}),Right:__spreadProps(__spreadValues({},posAndRot([1,0,0],[0,halfPI,0])),{label:"NavCube.right"}),Back:__spreadProps(__spreadValues({},posAndRot([0,0,-1],[0,Math.PI,0])),{label:"NavCube.back"}),Left:__spreadProps(__spreadValues({},posAndRot([-1,0,0],[0,-halfPI,0])),{label:"NavCube.left"}),Top:__spreadProps(__spreadValues({},posAndRot([0,1,0],[-halfPI,0,0])),{label:"NavCube.top"}),Bottom:__spreadProps(__spreadValues({},posAndRot([0,-1,0],[halfPI,0,0])),{label:"NavCube.bottom"})},edge=[posAndRot([0,1,1],[-quarterPI,0,-halfPI]),posAndRot([0,1,-1],[-3*quarterPI,0,-halfPI]),posAndRot([0,-1,1],[quarterPI,0,-halfPI]),posAndRot([0,-1,-1],[3*quarterPI,0,-halfPI]),posAndRot([1,1,0],[-halfPI,quarterPI,0]),posAndRot([1,-1,0],[-halfPI,3*quarterPI,0]),posAndRot([-1,1,0],[-halfPI,-quarterPI,0]),posAndRot([-1,-1,0],[-halfPI,-3*quarterPI,0]),posAndRot([1,0,1],[0,quarterPI,0]),posAndRot([1,0,-1],[0,3*quarterPI,0]),posAndRot([-1,0,1],[0,-quarterPI,0]),posAndRot([-1,0,-1],[0,-3*quarterPI,0])],corner=[{position:new Vector3(1,1,1),rotation:[new Euler(-halfPI,halfPI,-quarterPI),new Euler(-halfPI,0,quarterPI),new Euler(0,0,3*quarterPI)]},{position:new Vector3(1,1,-1),rotation:[new Euler(0,halfPI,3*quarterPI),new Euler(-halfPI,0,3*quarterPI),new Euler(0,Math.PI,-3*quarterPI)]},{position:new Vector3(-1,1,-1),rotation:[new Euler(Math.PI,-halfPI,quarterPI),new Euler(-halfPI,0,-3*quarterPI),new Euler(0,Math.PI,3*quarterPI)]},{position:new Vector3(-1,1,1),rotation:[new Euler(0,-halfPI,3*quarterPI),new Euler(-halfPI,0,-quarterPI),new Euler(0,0,-3*quarterPI)]},{position:new Vector3(1,-1,1),rotation:[new Euler(0,halfPI,-quarterPI),new Euler(-halfPI,Math.PI,-quarterPI),new Euler(0,0,quarterPI)]},{position:new Vector3(1,-1,-1),rotation:[new Euler(-halfPI,halfPI,3*quarterPI),new Euler(halfPI,0,quarterPI),new Euler(0,Math.PI,-quarterPI)]},{position:new Vector3(-1,-1,1),rotation:[new Euler(0,-halfPI,quarterPI),new Euler(halfPI,0,-3*quarterPI),new Euler(0,0,-quarterPI)]},{position:new Vector3(-1,-1,-1),rotation:[new Euler(0,-halfPI,-quarterPI),new Euler(halfPI,0,-quarterPI),new Euler(0,Math.PI,quarterPI)]}],NavCube=class extends Object3D{constructor(e={}){super(),this.NAVCUBE_SIZE=100,this.clickHandler=e.onClick,(0,import_lodash7.forEach)(plane,(e=>{this.createPlane(e)})),(0,import_lodash7.forEach)(edge,(e=>{this.createEdge(e)})),(0,import_lodash7.forEach)(corner,((e,t)=>{this.createCorner(e,t)}))}createPlane(e){const r=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),{rotation:i,label:n}=e,s=document.createElement("div");s.style.width=this.NAVCUBE_SIZE+"px",s.style.height=this.NAVCUBE_SIZE+"px",s.classList.add("navcube-plane"),s.classList.add("outer");const a=document.createElement("div");a.style.width=this.NAVCUBE_SIZE-4+"px",a.style.height=this.NAVCUBE_SIZE-4+"px",a.innerHTML=t(n),a.classList.add("navcube-plane"),a.classList.add("inner"),s.appendChild(a);const o=new CSS3DObject(s);o.position.copy(r),o.rotation.copy(i),this.add(o),s.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(r.clone().normalize(),i)}))}createEdge(e){const t=e.position.clone().multiplyScalar(this.NAVCUBE_SIZE/2),r=document.createElement("div");r.style.width="4px",r.style.height=this.NAVCUBE_SIZE-40+"px",r.style.background=navCubeColor,r.classList.add("navcube-edge");const i=new CSS3DObject(r);i.position.copy(t),i.rotation.copy(e.rotation),this.add(i),r.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(t.clone().normalize(),e.rotation)}))}createCorner(e,t){const r=r=>{r.addEventListener("click",(()=>{this.clickHandler&&this.clickHandler(e.position.clone().normalize(),new Euler)})),r.addEventListener("mouseenter",(()=>{const e=document.getElementsByClassName("group-"+t);(0,import_lodash7.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.add("highlight")}))})),r.addEventListener("mouseleave",(()=>{const e=document.getElementsByClassName("group-"+t);(0,import_lodash7.forEach)(e,(e=>{e instanceof HTMLElement&&e.classList.remove("highlight")}))}))},i=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);const s=new CSS3DObject(n);s.position.copy(i).lerp(e.position,.14);const a=Math.atan2(i.z,i.x);s.rotateY(i.z*i.x<0?Math.PI+a:a);const o=(new Euler).setFromVector3(i.clone().normalize());s.rotateX(-o.y),i.y<0&&s.rotateZ(Math.PI),this.add(s);const l=(t,n,s)=>{const a=document.createElement("div");a.style.borderTop=`13px solid ${navCubeColor}`,a.style.borderLeft="13px solid transparent",a.style.borderRight="13px solid transparent",a.classList.add("navcube-corner-plane"),a.classList.add("group-"+n);const o=new CSS3DObject(a),l=e.position.clone();l.setComponent(s,0),o.position.copy(i).sub(l),o.rotateX(t.x),o.rotateY(t.y),o.rotateZ(t.z),this.add(o),r(a)};(0,import_lodash7.forEach)(e.rotation,((e,r)=>{l(e,t,r)})),r(n)}},NavCubeViewport=class{constructor(e,t){this.height=150, // size of render area 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 CSS3DRenderer,this.renderer.setSize(this.width,this.height),this.renderer.domElement.classList.add("css3d-navcube"),document.body.appendChild(this.renderer.domElement)}initScene(){this.scene=new Scene;const e=window.innerWidth/window.innerHeight,t=200;this.camera=new OrthographicCamera(t*e/-2,t*e/2,100,-100,1,1e3),this.camera.position.set(-200,200,200),this.scene.add(this.camera);this.navCube=new NavCube({onClick:e=>{if(!(this.camera&&e&&this.hostViewer&&this.hostViewer.camera&&this.hostViewer.controls))return;const t=this.hostViewer.controls.target,r=this.hostViewer.camera.position.distanceTo(t);this.hostViewer.flyTo(t.clone().add(e.clone().multiplyScalar(r)),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;const e=this.hostViewer.camera;if(e){const t=new Vector3;e.getWorldDirection(t);const r=e.up;this.updateCameraDirection(t,r)}} /** * Update navCube according to camera direction. * Camera's direction is the only input factor for this class. It always look at the origin. * @param direction */updateCameraDirection(e,t){if(!this.camera||!e)return;e.normalize();this.camera.position.set(20*-e.x+0,20*-e.y+0,20*-e.z+0),this.camera.lookAt(0,0,0),this.camera.up=t}dispose(){this.scene&&this.camera&&this.navCube&&(this.scene.clear(),this.hostViewer=void 0,this.camera=void 0,this.navCube=void 0,this.scene=void 0)}},WebCam=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 }";const e=document.createElement("video");this.webcam=e;navigator.mediaDevices.getUserMedia({video:{width:600,height:400}}).then((t=>{e.srcObject=t,e.onloadedmetadata=()=>{e.setAttribute("autoplay","true"),e.setAttribute("playsinline","true"),e.play()}})).catch((function(e){alert(e.name+": "+e.message)})),this.webcamCanvas=document.createElement("canvas");const t=this.webcamCanvas.getContext("2d");this.canvasCtx=t,t.fillStyle="#000000",t.fillRect(0,0,this.webcamCanvas.width,this.webcamCanvas.height);const r=new Texture(this.webcamCanvas);this.webcamTexture=r,r.minFilter=LinearFilter,r.magFilter=LinearFilter,this.shaderMaterial=new ShaderMaterial({transparent:!0,uniforms:{map:{value:r},keyColor:{value:[0,1,0]},similarity:{value:.3},smoothness:{value:0}},vertexShader:this.vertexShader,fragmentShader:this.fragmentShader})} /** * Returns THREE.ShaderMaterial that can be used for PlaneGeometry, Mesh, etc. */getShaderMaterial(){return this.shaderMaterial} /** * Creates a plane to display webcam stream */createWebCamPlane(e=5,t=4){const r=new PlaneGeometry(e,t);return new Mesh(r,this.shaderMaterial)} /** * This should be called in renderer's animate method */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)}},tempVec32=new Vector3,tempSphere=new Sphere,BimViewer=class extends BaseViewer{ // eslint-disable-next-line constructor(e,t){var r;super(e),this.timer=Date.now(), /** * @internal */ this.selectedObject=void 0, /** * @internal */ this.sceneBackgroundColor=new Color(15463159), /** * @internal */ this.loadedModels={}, // a map to store model file and id /** * @internal */ this.loaded3dTiles={},this.composerRenderEnabled=!0, // if we should call composer.render() in render() this.composerEnabled=!1,this.savedMaterialsForOpacity=[],this.mouseMoved=!1,this.mouseDoubleClicked=!1, // RafHelper (requestAnimationFrame Helper) is used to improve render performance, // With this feature, it only renders when necessary, e.g. camera position changed, model loaded, etc. // We can disable this feature by assigning raf to undefined this.raf=new RafHelper,this.renderEnabled=!0, // used together with RafHelper this.isFrustumInsectChecking=!1,this.lastFrameExecuteTime=Date.now(), // used to limit max fps this.maxFps=60, // used to limit max fps. < 0 means no limitation // store events so that they can be removed before destroy // eslint-disable-next-line this.events=[],this.settings=defaultSettings,this.jobCount=0,this.twoDModelCount=0, /** * @internal */ this.bbox=new Box3,this.onResize=()=>{var e;const t=null==(e=this.renderer)?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)}, /** * In order to have a better performance, it should only render when necessary. * Usually, we should enable render for these cases: * - Anything added to, removed from scene, or objects' position, scale, rotation, opacity, material, etc. changed * - Anything selected/unselected * - Camera changed * - Render area resized * @internal */ 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))}, /** * Applies options and add object to scene. */ this.applyOptionsAndAddToScene=(e,t,r)=>{log.info(`[BimViewer] '${e}' is loaded in ${(Date.now()-this.timer)/1e3}s, adding to scene...`),this.timer=Date.now();const i=r.src&&r.src.toLowerCase();if(i&&i.endsWith("dxf")&&this.twoDModelCount++,r.matrix&&16===r.matrix.length){const e=new Matrix4;e.elements=r.matrix,t.applyMatrix4(e)}else{const e=r.position||[0,0,0],i=r.rotation||[0,0,0],n=r.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(i[0]*Math.PI/180,i[1]*Math.PI/180,i[2]*Math.PI/180),t.scale.set(n[0],n[1],n[2])}t.matrixAutoUpdate=matrixAutoUpdate,t.updateMatrix(),t.traverse((e=>{!matrixAutoUpdate&&e.matrixAutoUpdate&&(e.matrixAutoUpdate=matrixAutoUpdate,e.updateMatrix())}));const n=r.instantiate,s=r.merge;n?setTimeout((()=>{this.instantiate(t),setTimeout((()=>{s&&this.merge(t),this.addLoadedModelToScene(t,r)}),0)}),0):s?setTimeout((()=>{this.merge(t),setTimeout((()=>this.addLoadedModelToScene(t,r)),0)}),0):this.addLoadedModelToScene(t,r)},this.updateOrbPoint=()=>{var e;if(-1!==(null==(e=this.anchor)?void 0:e.className.indexOf("active"))&&this.lastOrbPoint&&this.controls){this.controls.setOrbitPoint(this.lastOrbPoint)}},this.onPointerDown=e=>{var t;(null==(t=this.controls)?void 0:t.enableRotate)&&this.renderer&&(e instanceof MouseEvent&&0!==e.button||e instanceof TouchEvent&&1!==e.touches.length||this.setOrbitPoint(e))},this.onAnchorPointerUp=()=>{this.anchor&&(this.anchor.className="anchor")},this.viewerCfg=__spreadValues(__spreadValues({},DEFAULT_BIM_VIEWER_CONFIG),e),log.info("[BimViewer]","viewerCfg:",this.viewerCfg),this.settings=defaultSettings,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==(r=this.viewerContainer)||r.append(this.renderer.domElement)),window.addEventListener("resize",this.onResize),window.addEventListener("keyup",(e=>{e.altKey&&"KeyR"===e.code&&this.flyToRandomObject()})),this.decreaseJobCount(),log.info(`[BimViewer] Initialized in ${(Date.now()-this.timer)/1e3}s`)} /** * Initialize everything it needs * @internal */init(){const e=this.viewerCfg;this.initSpinner(),this.initScene(),this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initPointerEvents(),!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.enableContextMenu&&(this.contextMenu=this.initContextMenu())}initScene(){this.scene=new Scene,this.scene.matrixAutoUpdate=matrixAutoUpdate}initRenderer(){this.renderer=new WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.outputEncoding=sRGBEncoding,this.renderer.toneMappingExposure=1,this.renderer.physicallyCorrectLights=!0,this.renderer.setClearColor(11119017,1),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=PCFSoftShadowMap,CommonUtils.printGpuInfo(this.renderer.getContext()),this.pmremGenerator=new PMREMGenerator(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.enableOverlayRenderer&&(this.overlayRender=new CanvasRender(this)),this.setEnvironmentFromDataArray()}initCamera(){this.scene&&(this.perspectiveCamera=new PerspectiveCamera(45,this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.perspectiveCamera.layers.enable(layerForUnselectableObjects),this.perspectiveCamera.position.set(0,100,0),this.scene.add(this.perspectiveCamera),this.camera=this.perspectiveCamera)}initControls(e=!1){if(!this.renderer)return;DeviceUtils.printDeviceInfo();const t=e?this.orthoCamera:this.perspectiveCamera;if(!t)return;const r=new OrbitControls2(t,this.renderer.domElement);r.dollyToCursor=!1,r.enableDamping=!0,r.dampingFactor=.5,r.enabled=!0,r.keyPanSpeed=10,r.keys={LEFT:"KeyD", // model goes left, camera goes right UP:"KeyE", // model goes up, camera goes down RIGHT:"KeyA", // model goes right, camera goes left BOTTOM:"KeyQ"},r.listenToKeyEvents(document.body),r.update(),e?this.orthoCameraConrols=r:this.perspectiveCameraControls=r,this.controls=r,this.addEvent(r,"update",this.onControlsChange(this)),this.addEvent(window,"keydown",this.onKeyDown(this))}initRotateToCursor(){var e,t,r,i;this.anchor=this.createAnchor(),null==(e=this.renderer)||e.domElement.addEventListener("mousedown",this.onPointerDown),null==(t=this.renderer)||t.domElement.addEventListener("touchstart",this.onPointerDown),null==(r=this.renderer)||r.domElement.addEventListener("pointerup",this.onAnchorPointerUp),null==(i=this.controls)||i.addEventListener("update",this.updateOrbPoint)}onControlsChange(e){return()=>{e.enableRender()}}onKeyDown(e){return t=>{const r=e.camera,i=e.controls;if(!r||!i)return;const n=this.settings.keyboard.sensitivity||3,s=i.position;let a=i.target;const o=a.clone();if("ArrowLeft"===t.code||"ArrowRight"===t.code){const e=n;let r=Math.PI*e/180;"ArrowLeft"===t.code&&(r=-r),o.x=(a.x-s.x)*Math.cos(r)-(a.z-s.z)*Math.sin(r)+s.x,o.z=(a.z-s.z)*Math.cos(r)+(a.x-s.x)*Math.sin(r)+s.z,i.target=o,i.update()}else if("ArrowUp"===t.code||"ArrowDown"===t.code){const e=n;let r=Math.PI*e/180;const l=new Vector3(a.x-s.x,a.y-s.y,a.z-s.z).length(),c=a.y-s.y;"ArrowDown"===t.code&&(r=-r);const u=Math.asin(c/l)+r;if(u<-Math.PI/2||u>Math.PI/2)return;const h=Math.sin(u)*l;o.y=a.y+(h-c),i.target=o,i.update()}else if("KeyW"===t.code){const e=.01*n,t=s.distanceTo(a);t<10*r.near&&(i.target=i.target.lerp(s,-r.near/t),a=i.target),s.lerp(a,e),i.setLookAt(s,a)}else if("KeyS"===t.code){const e=.01*n;s.lerp(a,-e),i.setLookAt(s,a)}else if("KeyF"===t.code)this.flyToSelectedObject();else if("KeyT"===t.code){const e=this.getIntersections();if(e.length>0){const t=e.find((e=>{const t=e.object;return t.visible&&t instanceof Mesh}));if(t&&t.point&&this.camera&&this.controls){const e=this.camera.position,i=t.point,n=this.controls.target,s=e.distanceTo(i);if(s>r.near&&s{if(!e.mouseDoubleClicked){switch(t.button){case MOUSE.LEFT:e.handleMouseClick(t);break;case MOUSE.MIDDLE:break;case MOUSE.RIGHT:e.handleRightClick(t)}e.enableRender()}}}initLights(){if(!this.scene)return;const e=16777215,t=new DirectionalLight(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 DirectionalLightHelper(this.directionalLight),this.directionalLightHelper.traverse((e=>{e.layers.set(layerForUnselectableObjects)})),this.directionalLightHelper.visible=!1,this.scene.add(this.directionalLightHelper),this.shadowCameraHelper=new CameraHelper(this.directionalLight.shadow.camera),this.shadowCameraHelper.layers.set(layerForUnselectableObjects),this.shadowCameraHelper.visible=!1,this.scene.add(this.shadowCameraHelper),this.ambientLight=new AmbientLight(3158064),this.hemisphereLight=new HemisphereLight(e,14540253,2),this.hemisphereLight.position.set(0,300,0),this.scene.add(this.ambientLight),this.scene.add(this.hemisphereLight)} /** * Initialize mouse/pointer events */initPointerEvents(){if(!this.renderer||!this.camera||!this.controls)return;let e=-1,t=-1;this.renderer.domElement.addEventListener("pointerdown",(r=>{e=r.x,t=r.y,this.mouseMoved=!1,setTimeout((()=>{this.dynamicallyUpdateControllerTarget()}),10),this.enableRender()})),this.renderer.domElement.addEventListener("pointermove",(r=>{if(this.section&&this.enableRender(),e>=0&&t>=0){const i=5;(Math.abs(r.x-e)>i||Math.abs(r.y-t)>i)&&(this.mouseMoved=!0)}})),this.renderer.domElement.addEventListener("pointerup",(r=>{var i;this.mouseMoved||this.mouseDoubleClicked||this.section||(null==(i=this.measurementManager)?void 0:i.isMeasurementActive())||setTimeout(this.onPointerUp(this,r),200),this.mouseDoubleClicked&&setTimeout((()=>{this.mouseDoubleClicked=!1}),200),e=-1,t=-1})),this.renderer.domElement.addEventListener("dblclick",(e=>{var t;this.mouseDoubleClicked=!0,this.mouseMoved||this.section||(null==(t=this.measurementManager)?void 0:t.isMeasurementActive())||(this.handleMouseClick(e),this.flyToSelectedObject(),this.enableRender())})),this.initRotateToCursor(),this.raycaster=new Raycaster}initDatGui(){this.datGui=new BimViewerDatGui(this),this.datGui.close()}initSpinner(){var e;if(!this.viewerCfg.enableSpinner)return;const t=document.createElement("div");t.classList.add("bim-viewer-spinner");const r=document.createElement("div");r.classList.add(ICON_FONT_CLASS,"icon-loading"),t.append(r),null==(e=this.widgetContainer)||e.appendChild(t),this.spinner=t,this.setSpinnerVisibility(this.jobCount>0)}initOthers(){if(!this.scene||!this.renderer||!this.camera)return;const e=this.datGui&&this.datGui.controls;e&&(e.showGroundGrid&&(this.groundGrid=GroundUtils.createGroundGrid(),this.scene.add(this.groundGrid)),e.showGrassGround&&(()=>{__async(this,null,(function*(){this.grassGround=yield GroundUtils.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;const t=document.createElement("div");t.id="navCube";const r=new NavCubeViewport;return r.renderer&&(t.appendChild(r.renderer.domElement),r.setHostViewer(this)),null==(e=this.widgetContainer)||e.appendChild(t),r}initAxes(){var e,t;const r=document.createElement("div");r.classList.add("axesRenderer");const i=new CoordinateAxesViewport(r,this.camera);return null==(e=this.widgetContainer)||e.append(r),this.axesInScene=new CoordinateAxes(!1),null==(t=this.scene)||t.add(this.axesInScene),i}initStats(){var e;const t=stats_module_default();t.setMode(0);const r=document.createElement("div");return r.classList.add("statsOutput"),r.appendChild(t.domElement),null==(e=this.widgetContainer)||e.append(r),t}initContextMenu(){const e=new ContextMenu({items:contextMenuItems,context:{bimViewer:this,toolbar:this.toolbar,section:this.section},container:this.widgetContainer});return window.oncontextmenu=e=>e.preventDefault(),e}initToolbar(){const e=this.viewerCfg;return new Toolbar2(this,(0,import_lodash8.merge)(DEFAULT_BIMVIEWER_TOOLBAR_CONFIG,e.toolbarMenuConfig))}initBottomBar(){return new BottomBar(this)} /** * If there is any 2d model loaded * @internal */get has2dModel(){return this.twoDModelCount>0}showContextMenu(e){if(!this.contextMenu)return;const t=this.getAllIntersections(e);log.debug("[BimViewer] showContextMenu intersections = ",t);const r=(0,import_lodash8.find)(t,(e=>{const t=e.object;return t instanceof Mesh&&t.visible})),i=this.contextMenu.context,n=null==r?void 0:r.instanceId,s=null==r?void 0:r.faceIndex;let a;s&&(a=MergeUtils.getBatchIdByFaceIndex(null==r?void 0:r.object,s)),this.contextMenu.context=__spreadProps(__spreadValues({},i),{hit:null==r?void 0:r.object,instanceId:n,batchId:a}),this.contextMenu.show(e.clientX,e.clientY)}handleRightClick(e){this.showContextMenu(e)}sycnCameraPosition(e,t){const r=e.position;if(t.position.set(r.x,r.y,r.z),this.scene){const e=this.scene.position;t.lookAt(e)}}sycnControls(e,t,r){const i=r,n=e.target;t.center?t.center.set(i.x,i.y,i.z):t.center=i.clone(),t.position=e.position,t.target=n,t.update()}setToOrthographicCamera(e=!1){var t;if(!this.scene||!this.controls)return;const r=this.perspectiveCamera,i=this.perspectiveCameraControls;let n=this.orthoCamera,s=this.orthoCameraConrols;e?(n||(n=new OrthographicCamera(-this.width/2,this.width/2,this.height/2,-this.height/2,this.settings.camera.near,this.settings.camera.far),n.layers.enable(layerForUnselectableObjects),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),r&&(this.sycnCameraPosition(r,n),n.zoom=10,n.updateProjectionMatrix()),i&&s&&r&&this.sycnControls(i,s,r.position),this.camera=n,this.controls=s):(r&&n&&this.sycnCameraPosition(n,r),i&&s&&n&&this.sycnControls(s,i,n.position),this.camera=r,this.controls=i),null==(t=this.axes)||t.setHostCamera(this.camera),this.resize()}animate(){var e,t;if(requestAnimationFrame(this.animate.bind(this)),this.maxFps>0){if(Date.now()-this.lastFrameExecuteTime<1e3/this.maxFps)return;this.lastFrameExecuteTime=Date.now()}this.webcam&&this.webcam.animate(),this.controls&&this.controls.update(),this.scene&&this.camera&&this.renderEnabled&&(this.update3dTiles(),this.renderer&&this.renderer.render(this.scene,this.camera),this.dispatchEvent("RenderAfter"/* RenderAfter */)),this.composerRenderEnabled&&this.composer&&this.composerEnabled&&(this.composer.render(),this.composerRenderEnabled=!1),this.frustrumCullingByModelBBox(),null==(e=this.stats)||e.update(),null==(t=this.bottomBar)||t.update()}update3dTiles(){if(!this.camera)return;const e=Object.values(this.loaded3dTiles);0!==e.length&&(this.camera.updateMatrixWorld(),e.forEach((e=>{e.renderer.update()})))} /** * This is a method called in animate() in order to optimize rendering speed. * The idea is to hide any model out of view frustrum. */frustrumCullingByModelBBox(){const e=new Frustum,t=new Matrix4;this.isFrustumInsectChecking=!0,this.camera&&(t.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),e.setFromProjectionMatrix(t),Object.values(this.loadedModels).forEach((t=>{const r=this.scene&&this.scene.getObjectById(t.id),i=t.bbox;r&&i&&this.scene&&(void 0===r.userData._visible&&(r.userData._visible=!0,Object.defineProperties(r,{visible:{set:e=>{r.userData._visible=e,this.isFrustumInsectChecking||(r.userData.userConfigVisibility=!0)},get:()=>r.userData._visible}})),void 0===r.userData.userConfigVisibility&&(i.geometry.computeBoundingBox(),i.geometry.boundingBox&&(r.visible=e.intersectsBox(i.geometry.boundingBox))))})),Object.values(this.loaded3dTiles).forEach((t=>{const r=t.renderer.group;r&&!t.bbox.isEmpty()&&this.scene&&(void 0===r.userData._visible&&(r.userData._visible=!0,Object.defineProperties(r,{visible:{set:e=>{r.userData._visible=e,this.isFrustumInsectChecking||(r.userData.userConfigVisibility=!0)},get:()=>r.userData._visible}})),void 0===r.userData.userConfigVisibility&&(r.visible=e.intersectsBox(t.bbox)))}))),this.isFrustumInsectChecking=!1}destroy(){var e;this.events.forEach((e=>e.node.removeEventListener(e.type,e.func))),this.events=[],this.datGui&&this.datGui.gui&&(this.datGui.beforeDestroy(),this.datGui=void 0);const t=this.webcamPlane;this.scene&&t&&(this.scene.remove(t),t.geometry.dispose(),t.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.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.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.spinner&&(this.spinner.remove(),this.spinner=void 0),this.bottomBar=void 0,this.pmremGenerator&&(this.pmremGenerator.dispose(),this.pmremGenerator=void 0),null==(e=this.zoomToRect)||e.destroy(),this.zoomToRect=void 0,window.removeEventListener("resize",this.onResize),super.destroy()} /** * Loads a 3d model from local * @internal */loadLocalModel(e,t,r,i){return __async(this,null,(function*(){let n;this.timer=Date.now(),this.increaseJobCount();try{const s=new LoadingHelper(r);n=yield s.loadLocalModel(e,t.src,i)}catch(e){const r=`Error loading ${t.src}`;return log.error(r,e),Promise.reject(r)}finally{this.decreaseJobCount()}return n?(this.applyOptionsAndAddToScene(e,n,t),Promise.resolve()):Promise.reject()}))} /** * Loads a 3d model */loadModel(e,t){return __async(this,null,(function*(){let r;this.timer=Date.now(),this.increaseJobCount();try{const i=new LoadingHelper;r=yield i.loadModel(e.src,e.fileFormat,t)}catch(t){const r=`Error loading ${e.src}`;return log.error(r,t),Promise.reject(r)}finally{this.decreaseJobCount()}return r?(this.applyOptionsAndAddToScene(e.src,r,e),Promise.resolve()):Promise.reject()}))} /** * Loads 3dtiles * TODO: Temporarily does not support 3dtiles version 1.0 above * The coordinate system is not processed yet */load3dTiles(e){return __async(this,null,(function*(){var t;this.timer=Date.now(),this.increaseJobCount();const r=new TilesRenderer(e.src),i=new Box3,n=yield new Promise(((t,n)=>{r.onLoadTileSet=()=>{r.getBounds(i)||(r.getBoundingSphere(tempSphere)?tempSphere.getBoundingBox(i):(log.warn(`[BimViewer] Can't get the correct bounding box of 3dTiles '${e.src}'!`),n())),log.debug(i),r.onLoadTileSet=null;const s=r.group;log.debug(s),t(s)},r.onLoadModel=e=>{e.traverse((e=>{!matrixAutoUpdate&&e.matrixAutoUpdate&&(e.matrixAutoUpdate=matrixAutoUpdate,e.updateMatrix()),e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0)})),e.updateWorldMatrix(!1,!0),this.updateDirectionalLightShadow(),this.enableRender()},r.setCamera(this.camera),r.setResolutionFromRenderer(this.camera,this.renderer),r.update()}));if(n){const s=Date.now();let a=e.modelId||e.src;if(this.loaded3dTiles[a]){let e=1;for(;this.loaded3dTiles[`${a}_${e}`];)e++;a=`${a}_${e}`,log.warn(`[BimViewer] 3dTiles '${a}' is loaded more than once!`)}if(this.loaded3dTiles[a]={id:n.id,bbox:i,renderer:r},e.matrix&&16===e.matrix.length){const t=new Matrix4;t.elements=e.matrix,n.applyMatrix4(t)}else{const t=e.position||[0,0,0],r=e.rotation||[0,0,0],i=e.scale||[1,1,1];n.position.set(t[0],t[1],t[2]),n.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),n.scale.set(i[0],i[1],i[2])}n.matrixAutoUpdate=matrixAutoUpdate,n.updateMatrix(),n.updateMatrixWorld(!0),null==(t=this.scene)||t.add(n),i.applyMatrix4(n.matrix),this.computeBoundingBox(),this.tryAdjustDirectionalLight();if(0===Object.keys(this.loadedModels).length&&1===Object.keys(this.loaded3dTiles).length){const e=this.datGui&&this.datGui.controls;this.regenSkyOfGradientRamp(),e&&e.showGroundGrid&&this.regenGroundGrid(),this.tryAdjustCameraNearAndFar(),this.goToHomeView()}return log.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()}))} /** * Add newly added object to scene. * Also, usually(but not always) we should regenerate sky and go to home view * @param object */addLoadedModelToScene(e,t){if(!this.scene)return;if(t.merge){const t=Date.now();MeshBvhHelper.createMeshBvhAsync([e],{saveOriginalIndex:!0}),log.info(`[BimViewer] Creates mesh bvh cost ${(Date.now()-t)/1e3}s`)}e.traverse((e=>{e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0)})),this.scene.add(e);const r=new BoxHelper(e);r.name="BIM_VIEWER_BOX_HELPER",r.visible=!1,r.matrixAutoUpdate=matrixAutoUpdate,r.material&&(r.material=void 0,r.layers.set(layerForUnselectableObjects));let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,log.warn(`[BimViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={id:e.id,bbox:r},this.computeBoundingBox(),this.tryAdjustDirectionalLight();const n=Object.values(this.loadedModels).map((e=>e.id));Object.values(this.loaded3dTiles).forEach((e=>n.push(e.id)));if(!n||n.length<=1){if(this.has2dModel)this.setToOrthographicCamera(!0),this.skyOfGradientRamp&&this.scene.remove(this.skyOfGradientRamp);else{const e=this.datGui&&this.datGui.controls;this.regenSkyOfGradientRamp(),e&&e.showGroundGrid&&this.regenGroundGrid()}this.tryAdjustCameraNearAndFar(),this.goToHomeView()}this.scene.add(r),t.edges&&ObjectUtils.addOutlines(e),log.info(`[BimViewer] Added '${t.src}' to scene in ${(Date.now()-this.timer)/1e3}s`),this.enableRender(),this.decreaseJobCount()} /** * We won't set a opacity directly, because that way will lose model's original opacity value * @param isAdd is add or remove the opacity we added * @param opacity */addOrRemoveObjectOpacity(e=!0,t=.3,r,i){if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;const 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&&ObjectUtils.revertObjectOpacityById(n,a,this.savedMaterialsForOpacity);const e=ObjectUtils.setObjectOpacityById(n,a,t,r,i);s.push(...e)}else this.savedMaterialsForOpacity&&ObjectUtils.revertObjectOpacityById(n,a,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?s:[],this.enableRender()} /** * @internal */hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)} /** * @internal */showVertexNormals(e,t=.1){var r,i,n;e?(this.vertexNormalsHelpers||(this.vertexNormalsHelpers=new Group),null==(r=this.scene)||r.traverseVisible((e=>{var r;if(e instanceof Mesh&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)){if(!e.geometry.attributes.normal)return;const i=new VertexNormalsHelper(e,t,16711680);null==(r=this.vertexNormalsHelpers)||r.add(i)}})),null==(i=this.scene)||i.add(this.vertexNormalsHelpers)):this.vertexNormalsHelpers&&(null==(n=this.scene)||n.remove(this.vertexNormalsHelpers),this.vertexNormalsHelpers=void 0)} // resize render area // if no width or height passed in, use window.innerWidth/window.innerHeight instead resize(e,t){const r=this.camera;r&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,r instanceof PerspectiveCamera?r.aspect=this.width/this.height:r instanceof OrthographicCamera&&(r.left=-this.width/2,r.right=this.width/2,r.top=this.height/2,r.bottom=-this.height/2),r.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.enableRender()} /** * @internal */getRaycaster(){return this.raycaster} /** * @internal */getRaycastableObjectsByMouse(e){let t,r=[];if(!(this.raycaster&&this.camera&&this.scene&&e&&this.viewerContainer))return r;t=e instanceof MouseEvent?CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer):CoordinateConversionUtils.getScreenPointByTouchEvent(e,this.viewerContainer);const i=CoordinateConversionUtils.screenPoint2NdcPoint(t,this.camera,this.viewerContainer);return this.raycaster.setFromCamera(i,this.camera),r=this.getRaycastableObjects(),r}getRaycastableObjects(){const e=[];return Object.values(this.loadedModels).forEach((t=>{const r=this.scene&&this.scene.getObjectById(t.id);r&&r.visible&&e.push(r)})),Object.values(this.loaded3dTiles).forEach((t=>{const r=this.scene&&this.scene.getObjectById(t.id);r&&r.visible&&e.push(r)})),e} /** * Gets intersections by given mouse location. * If no MouseEvent is passed in, use (0, 0) as the raycaster's origin. */getIntersections(e){const t=this.getRaycastableObjectsByMouse(e);return this.raycaster&&this.raycaster.intersectObjects(t,!0)||[]}getAllIntersections(e){if(!(this.raycaster&&this.camera&&this.scene&&this.viewerContainer))return[];let t=new Vector2;e&&(t=e instanceof MouseEvent?CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer):CoordinateConversionUtils.getScreenPointByTouchEvent(e,this.viewerContainer));const r=CoordinateConversionUtils.screenPoint2NdcPoint(t,this.camera,this.viewerContainer);this.raycaster.setFromCamera(r,this.camera);const i=this.scene.children;return this.raycaster.intersectObjects(i,!0)||[]} /** * Handles mouse click event */handleMouseClick(e){var t,r;if(null==(t=this.measurementManager)?void 0:t.isMeasurementActive())return;const i=Date.now(),n=this.getIntersections(e);log.debug(`[BimViewer] getIntersections costs ${(Date.now()-i)/1e3}s`);const s=n.find((e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Mesh)}));let a,o,l=s&&s.object||void 0;if(l)if(l instanceof InstancedMesh)a=s.instanceId,this.selectedObject&&this.selectedObject.id===l.id&&this.selectedObject.userData.instanceId===a&&(l=void 0);else if(MergeUtils.isMergedMesh(l)){const e=s&&s.faceIndex||-1;e>=0?(o=MergeUtils.getBatchIdByFaceIndex(l,e),this.selectedObject&&this.selectedObject.id===l.id&&this.selectedObject.userData.batchId===o&&(l=void 0)):l=void 0}else this.selectedObject&&this.selectedObject.id===l.id&&(l=void 0);if(n.length>0&&n[0].point){const e=null==(r=this.overlayRender)?void 0:r.getDrawablesByPosition(n[0].point,this.raycaster);if(e&&e.length>0)return this.clearSelection(),e[0].selected=!0,void(this.selectedObject=e[0])}this.selectedObject&&this.clearSelection(),l?this.selectObject(l,a,o):this.clearSelection()} /** * Select or unselect an object. * It doesn't support selecting more than one objects. * It doesn't support selecting a parent object which doesn't have material itself. * In order to support de-select, we'll need to store some information, we do this via userData: * For InstancedMesh, there are two cases: * 1) One Mesh in InstancedMesh is selected * it adds following to selected object: userData \{ * instanceId: number, * originalMatrix: THREE.Matrix4, * clonedMesh: THREE.Mesh * \} * 2) The whole InstancedMesh is selected. This case is no different from a normal Mesh is selected, so: * For Mesh, it adds: userData \{ * originalMaterial: THREE.Material * \} * @param object * @param instanceId pass in instanceId if an InstancedMesh is selected * @param depthTest set to false if caller want to make sure user can see it. When an object is * selected by user manually, we don't need to make sure user can see it. While if selection is * made by program, we parbably need to make sure user can see it, in other words, the selected * object won't be blocked by other objects. */selectObject(e,t,r,i){if(this.selectedObject){const t=this.selectedObject.userData;if(null!=t.instanceId&&t.originalMatrix&&t.clonedMesh){this.scene&&this.scene.remove(t.clonedMesh);const r=this.selectedObject;if(r.setMatrixAt(t.instanceId,t.originalMatrix),r.instanceMatrix.needsUpdate=!0,r.updateMatrix(),delete t.instanceId,delete t.originalMatrix,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(null!=t.batchId&&t.clonedMesh){if(this.scene&&this.scene.remove(t.clonedMesh),delete t.batchId,e===t.clonedMesh)return t.clonedMesh.geometry.dispose(),delete t.clonedMesh,this.selectedObject=void 0,void(this.outlinePass&&(this.outlinePass.selectedObjects=[]));t.clonedMesh.geometry.dispose(),delete t.clonedMesh}else if(t.originalMaterial){if(this.selectedObject.material){const e=this.selectedObject.material;Array.isArray(e)?e.forEach((e=>e.dispose())):e instanceof Material&&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 InstancedMesh&&null!=t){const r=e,n=new Matrix4,s=new Matrix4;s.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),r.getMatrixAt(t,n),this.selectedObject=e,this.outlinePass&&(this.outlinePass.selectedObjects=[e]);const a=MaterialUtils.clonedHighlightMaterials(e,{depthTest:i});if(a){const i=new Mesh(r.geometry.clone(),a);i.applyMatrix4(e.matrixWorld.multiply(n)),i.matrixWorldNeedsUpdate=!0,i.name="Cloned mesh for highlighting";const o=n.clone();o.multiplyMatrices(n,s),r.setMatrixAt(t,o),r.instanceMatrix.needsUpdate=!0,r.updateMatrix(),this.selectedObject.userData.instanceId=t,this.selectedObject.userData.originalMatrix=n,this.selectedObject.userData.clonedMesh=i,this.scene.add(i)}}else if(MergeUtils.isMergedMesh(e)&&null!=r){const t=MergeUtils.getBatchByBatchId(e,r);let n=`[BimViewer] Clicked on merged mesh(id: ${e.id}).`;n+=` Original mesh batchId: ${r}, name: ${null==t?void 0:t.name}`,log.info(n);const s=MaterialUtils.clonedHighlightMaterials(e,{depthTest:i}),a=MergeUtils.cloneGeometryForBatch(e,t);if(s&&a){const t=new Mesh(a,s);t.applyMatrix4(e.matrixWorld),t.matrixWorldNeedsUpdate=!0,t.name="Cloned mesh for highlighting",this.selectedObject=e,this.selectedObject.userData.batchId=r,this.selectedObject.userData.clonedMesh=t,this.scene.add(t)}}else{const t=MaterialUtils.clonedHighlightMaterials(e,{depthTest:i});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()} /** * Clears the current selection */clearSelection(){this.selectedObject&&this.selectedObject instanceof Drawable?this.selectedObject.selected=!1:this.selectObject(),this.selectedObject=void 0} /** * Gets bounding box * @internal */getBBox(){return this.bbox} /** * Make camera fly to objects */flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new Vector3,r=new Vector3,i=new Box3;e.forEach((e=>{const t=SceneUtils.getBoundingBox(e);i.union(t)}));const n=new Vector3;this.camera.getWorldDirection(n),Viewer3DUtils.getCameraPositionByBboxAndDirection(i,t,r,this.camera.projectionMatrix,n),this.flyTo(t,r)} /** * Make camera fly to an object */flyToObject(e){this.flyToObjects([e])} /** * Flies to current selected object if any */flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof InstancedMesh&&e.userData.clonedMesh||MergeUtils.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)} /** * Flies to a random object (by alt + r). * It is useful when either the data is wrong or there is bug in program, * then we cannot see anything in the scene! */flyToRandomObject(){var e,t,r;const i=Object.values(this.loadedModels).map((e=>e.id));Object.values(this.loaded3dTiles).forEach((e=>i.push(e.id)));const n=i.length;if(n<=0)return;const s=Math.floor(Math.random()*n),a=i[s];if(!(null==(e=this.scene)?void 0:e.getObjectById(a)))return;const o=[];if(null==(t=this.scene)||t.traverseVisible((e=>{(e instanceof Mesh||e instanceof Line)&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)&&o.push(e.id)})),o.length<1)return;const l=Math.floor(Math.random()*o.length),c=null==(r=this.scene)?void 0:r.getObjectById(o[l]);c&&(log.info(`[BimViewer] Flying to random object: ${c.name}, type: ${c.type}`),this.selectObject(c,void 0,void 0,!0),this.flyToObject(c))} /** * Make camera fly to target position with given lookAt position * @param position camera's target position * @param lookAt camera's new lookAt position */flyTo(e,t){const r=this.camera,i=this.controls;if(!r||!i)return;if(e.equals(t))return void log.error("[BimViewer] camera position and lookAt cannot be the same!");if(!CommonUtils.isVectorValid(e)||!CommonUtils.isVectorValid(t))return void log.error("[BimViewer] invalid position or lookAt!");const n=e.distanceTo(t);nr.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*r.far),log.warn("[BimViewer] camera could be too far to see the object!"));const s=(e,t)=>{i.setLookAt(e,t),i.update(),this.enableRender()},a=r.position.clone(),o=new Vector3;r.getWorldDirection(o);const l=i.target.distanceTo(a),c=a.clone().addScaledVector(o,l),u=500,h=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let r=Date.now()-h;r>u&&(r=u);const i=(e,t,r)=>{const i=e.x+(t.x-e.x)*r,n=e.y+(t.y-e.y)*r,s=e.z+(t.z-e.z)*r;return new Vector3(i,n,s)},n=i(a,e,r/u),o=i(c,t,r/u);s(n,o),r>=u&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)} /** * Fits the camera to view all objects in scene */viewFitAll(){var e;if(!this.scene||!this.camera)return;const t=new Vector3,r=new Vector3,i=SceneUtils.getVisibleObjectBoundingBox(this.scene),n=new Vector3;null==(e=this.camera)||e.getWorldDirection(n),Viewer3DUtils.getCameraPositionByBboxAndDirection(i,t,r,this.camera.projectionMatrix,n),this.flyTo(t,r)} /** * Goes to home view */goToHomeView(){const e=this.camera,t=this.cameraCfg,r=t&&CommonUtils.arrayToVector3(t.eye),i=t&&CommonUtils.arrayToVector3(t.look);if(r&&i)this.flyTo(r,i);else if(this.scene){const t=new Vector3,r=new Vector3,i=new Vector3(-1,-.5,-1);if(this.has2dModel){const e=this.bbox.max.x-this.bbox.min.x,t=this.bbox.max.y-this.bbox.min.y,r=this.bbox.max.z-this.bbox.min.z,n=Math.min(e,t,r);e-n<=0?i.set(1,0,0):t-n<=0?i.set(0,-1,0):r-n<=0&&i.set(0,0,-1)}if(Viewer3DUtils.getCameraPositionByBboxAndDirection(this.bbox,t,r,null==e?void 0:e.projectionMatrix,i),this.cameraCfg&&(!this.cameraCfg||this.cameraCfg.eye&&this.cameraCfg.look)||(this.cameraCfg={eye:t.toArray(),look:r.toArray()}),e instanceof OrthographicCamera){const t=this.bbox,r=t.max.x-t.min.x,i=t.max.z-t.min.z,n=e.right-e.left,s=e.top-e.bottom;e.zoom=Math.max(n,s)/Math.max(r,i),e.zoom/=2,e.updateProjectionMatrix()}t.equals(r)||this.flyTo(t,r)}}zoomToBBox(e){var t,r;const i=new Vector3,n=new Vector3,s=new Vector3;null==(t=this.camera)||t.getWorldDirection(s),Viewer3DUtils.getCameraPositionByBboxAndDirection(e,i,n,null==(r=this.camera)?void 0:r.projectionMatrix,s),i.equals(n)||this.flyTo(i,n)} /** * Tries to adjust camera near/far clip plane according to objects size in scene. * Do this to avoid the case when objects are too small or big thus clipped! */tryAdjustCameraNearAndFar(){const e=this.camera;if(!this.scene||!e)return;const t=this.bbox,r=e.near,i=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,c=5*o;if(r>l||iCommonUtils.numberToString(e);log.info(`[BimViewer] BBox's longest side is: ${t(o)}`),r>l&&(log.warn(`[BimViewer] camera.near(${t(r)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),ie.id));if(Object.values(this.loaded3dTiles).forEach((t=>e.push(t.id))),e){const t=this.cameraCfg,r=t&&CommonUtils.arrayToVector3(t.eye),i=t&&CommonUtils.arrayToVector3(t.look);let n=new Box3;if(r&&i){const e=r,t=i;n.expandByPoint(new Vector3(e.x,e.y,e.z)),n.expandByPoint(new Vector3(t.x,t.y,t.z))}else n=SceneUtils.getObjectsBoundingBox(this.scene,e);this.skyOfGradientRamp=SkyboxUtils.createSkyOfGradientRampByBoundingBox(n),this.scene.add(this.skyOfGradientRamp)}} /** * Regenerates ground grid according to models' location and size */regenGroundGrid(){if(!this.scene)return;this.groundGrid&&(this.groundGrid.geometry.dispose(),this.groundGrid.material.dispose(),this.scene.remove(this.groundGrid));const e=Object.values(this.loadedModels).map((e=>e.id));if(Object.values(this.loaded3dTiles).forEach((t=>e.push(t.id))),e){const e=this.cameraCfg,t=e&&CommonUtils.arrayToVector3(e.look);t&&(t.y=0),this.groundGrid=GroundUtils.createGroundGrid(void 0,void 0,t),this.scene.add(this.groundGrid)}} /**** Anchor rotation related interface start ****/setOrbitPoint(e){const t=this.controls;if(!(this.camera&&this.renderer&&this.controls&&this.scene&&this.raycaster&&this.viewerContainer))return;const r=this.getIntersections(e);let i;if(i=e instanceof MouseEvent?CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerContainer):CoordinateConversionUtils.getScreenPointByTouchEvent(e,this.viewerContainer),r&&0!==r.length)t.setOrbitPoint(r[0].point),this.setAnchorPosition(i),this.lastOrbPoint=r[0].point;else{const e=this.bbox.getCenter(new Vector3),r=CoordinateConversionUtils.worldPosition2ScreenPoint(e,this.camera,this.renderer.domElement);this.setAnchorPosition(r),t.setOrbitPoint(e),this.lastOrbPoint=e}}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;const 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(){var e,t,r,i;this.disposeAnchor(),null==(e=this.renderer)||e.domElement.removeEventListener("mousedown",this.onPointerDown),null==(t=this.renderer)||t.domElement.removeEventListener("touchstart",this.onPointerDown),null==(r=this.renderer)||r.domElement.removeEventListener("pointerup",this.onAnchorPointerUp),null==(i=this.controls)||i.removeEventListener("update",this.updateOrbPoint)} /******* Anchor rotation related interface end *********/ /** * Enables or disable Composer * @internal */enableComposer(e){this.scene&&this.camera&&this.renderer&&(this.composerEnabled=e,e&&!this.composer&&(this.composer=new EffectComposer(this.renderer)),this.enableRender())} /** * Enables or disable RenderPass * @internal */enableRenderPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.renderPass){const e=new RenderPass(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()}} /** * Enables or disable FxaaPass * @internal */enableFxaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.effectFxaaPass){const e=new ShaderPass(FXAAShader);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()}} /** * Enables or disable SAOPass * @internal */enableSaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.saoPass){const e=new SAOPass(this.scene,this.camera,!1,!0,new Vector2(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()}} /** * Enables or disable SSAOPass * @internal */enableSsaoPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaoPass){const e=new SSAOPass(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()}} /** * Enables or disable OutlinePass * @internal */enableOutlinePass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.outlinePass){const e=new OutlinePass(new Vector2(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()}} /** * Enables or disable SSAARenderPass * @internal */enableSsaaPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.ssaaRenderPass){const e=new SSAARenderPass(this.scene,this.camera,16777215,0);this.composer.addPass(e),this.ssaaRenderPass=e}this.ssaaRenderPass&&(this.ssaaRenderPass.enabled=e),this.enableRender()}} /** * Enables or disable BloomPass * @internal */enableBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.bloomPass){const e=new BloomPass(1, // strength 25, // kernel size 4);e.renderToScreen=!0,this.composer.addPass(e),this.bloomPass=e}this.bloomPass&&(this.bloomPass.enabled=e),this.enableRender()}} /** * Enables or disable UnrealBloomPass * @internal */enableUnrealBloomPass(e){if(this.scene&&this.camera&&this.renderer&&this.composer){if(e&&!this.unrealBloomPass){const e=new UnrealBloomPass(new Vector2(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()}} /** * Enable section. * Currently, it only implemented local(object) box section. */activateSection(e="ObjectsBoxSection"/* ObjectsBoxSection */){if(!(this.scene&&this.camera&&this.renderer&&this.controls))return;this.section&&this.deactivateSection();const t=Object.values(this.loadedModels).map((e=>e.id));if(Object.values(this.loaded3dTiles).forEach((e=>t.push(e.id))),!t||t.length<1)log.warn("[BimViewer] No object to section!");else{if(this.renderer.localClippingEnabled=!0,this.sectionType=e,"ObjectsBoxSection"/* ObjectsBoxSection */===e){const e=this.camera,r=this.controls;this.section=new ObjectsBoxSection(this.scene,e,this.renderer,r,t),this.section.open()}else"PickPlaneSection"/* PickPlaneSection */===e?(this.section=new PickPlaneSection(this,t,this.viewerContainer),this.section.open()):"AxisPlaneSection"/* AxisPlaneSection */===e&&(this.section=new AxisPlaneSection(this,t,this.viewerContainer),this.section.open());this.enableRender()}}deactivateSection(){this.renderer&&this.section&&(this.section.close(),this.section=void 0,this.enableRender())} /** * @deprecated Use deactivateSection instead */disableSection(){this.deactivateSection()} /** * @deprecated Use activateSection instead */enableSection(e="ObjectsBoxSection"/* ObjectsBoxSection */){this.activateSection(e)} /** * Activates one of "Distance", "Area" or "Angle" measurement * @param type "Distance", "Area" or "Angle" */activateMeasurement(e){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.activateMeasurement(e),this.clearSelection()} /** * Deactivates measurement */deactivateMeasurement(){var e,t;null==(e=this.measurementManager)||e.deactivateMeasurement(),null==(t=this.toolbar)||t.updateMenu("Measure"/* Measure */,DEFAULT_BIMVIEWER_TOOLBAR_CONFIG.Measure)} /** * Clears all measurement results */clearMeasurements(){var e;null==(e=this.measurementManager)||e.clearMeasurements()}activateZoomToRect(){this.zoomToRect||(this.zoomToRect=new ZoomToRectHelper(this)),this.zoomToRect.activate()}deactivateZoomToRect(){var e;null==(e=this.zoomToRect)||e.activate()} /** * @internal */enableWebCam(){this.scene&&(this.webcam||(this.webcam=new WebCam),this.webcamPlane||(this.webcamPlane=this.webcam.createWebCamPlane(),this.webcamPlane.position.set(10,2,0)),this.scene.add(this.webcamPlane))} /** * @internal */disableWebCam(){this.scene&&this.webcamPlane&&(this.webcamPlane.geometry.dispose(),this.webcamPlane.material.dispose(),this.scene.remove(this.webcamPlane))} /** * Sets environment for the scene. * @param hdrUrl Full path of picture url in hdr format */setEnvironment(e){TextureUtils.createEnvTexture(this.pmremGenerator,e).then((e=>{this.scene&&(this.scene.environment=e)}))} /** * Sets environment for the scene. * @param data Uint16Array of the hdr content * @internal */setEnvironmentFromDataArray(e){TextureUtils.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene&&(this.scene.environment=e)}))}takeObjectsScreenshot(e){return __async(this,null,(function*(){return new Promise(((t,r)=>{var i;this.renderer||r("renderer is undefined"),null==(i=this.scene)||i.traverse((t=>{t instanceof Mesh&&((0,import_lodash8.includes)(e,(0,import_lodash8.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)}))}))} /** * Updates raycaster threshold to a proper value, so user can easily pick points and lines */updateRaycasterThreshold(){const e=this.camera;if(!e||!this.raycaster)return;const t=12/e.zoom,r=this.raycaster.params;r.Line?r.Line.threshold=t:r.Line={threshold:t},r.Points?r.Points.threshold=t:r.Points={threshold:t}} /** * Instatiates leaf nodes of given object. * If objects' geometry and material are the same, they can be instanced. * @param object */instantiate(e){new InstantiateHelper(e).instantiate()} /** * Merges leaf nodes of given object. * If objects' materials are the same, they can be merged. * @param object */merge(e){this.increaseJobCount();try{const t=[];e.traverse((e=>{e.geometry&&e.material&&t.push(e)})),MergeUtils.deepMerge(t,e)}finally{this.decreaseJobCount()}} /** * Sets spinner visibility * @internal */setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))} /** * Increases job count, and show spinner accordingly * @internal */increaseJobCount(){this.setSpinnerVisibility(++this.jobCount>0)} /** * Decreases job count, and hide spinner accordingly * @internal */decreaseJobCount(){this.setSpinnerVisibility(--this.jobCount>0)} /** * Calls addEventListener of a node. * This makes sure to removeEventListener properly * @param node window, dom element, etc. * @param type 'change', 'keydown', etc. * @param func event callback */ // eslint-disable-next-line addEvent(e,t,r){e.addEventListener(t,r),this.events.push({node:e,type:t,func:r})} /** * Updates project settings * @internal */updateProjectSettings(e){this.settings=e;const t=(e,t)=>{e&&t&&(e.near=t.near,e.far=t.far,e.updateProjectionMatrix())};t(this.perspectiveCamera,this.settings.camera),t(this.orthoCamera,this.settings.camera),this.enableRender(10)}dynamicallyUpdateControllerTarget(e){const t=this.getIntersections(e);if(t.length<0)return;const r=this.camera,i=this.controls;if(!r||!i)return;const n=t.find((e=>{if(e.distancer.far)return!1;const t=e.object;return t.visible&&t instanceof Mesh}));if((null==n?void 0:n.point)&&i){const e=r.position,t=i.target,s=n.distance,a=e.distanceTo(t),o=e.clone().lerp(t,s/a);i.target=o}} /** * Compute bounding box of loaded models * @internal */computeBoundingBox(){const e=new Box3;return Object.values(this.loadedModels).forEach((t=>{if(t.bbox){t.bbox.geometry.computeBoundingBox();const r=t.bbox.geometry.boundingBox;r&&!r.isEmpty()&&e.union(r)}})),Object.values(this.loaded3dTiles).forEach((t=>{t.bbox.isEmpty()||e.union(t.bbox)})),this.bbox=e,e}},import_lodash9=__toESM(require_lodash(),1),DxfLayoutBar=class{constructor(e){this.viewer=e,this.itemList={},this.handleMouseWheel=e=>{e.preventDefault(),this.element&&(this.element.scrollLeft+=e.deltaY)},this.init()}init(){var e;const t=document.createElement("div");t.classList.add("model-layout-switch-bar");const r=document.createElement("div");r.classList.add("model-layout-switch-bar-content"),r.addEventListener("wheel",this.handleMouseWheel),this.viewer.getLayoutNames().forEach(((e,t)=>{const i=this.createItem(e,t);this.itemList[e]=i,i.resetActivate=()=>{for(const e in this.itemList){this.itemList[e].resetActive()}},null==r||r.appendChild(i.element)})),this.element=t,this.content=r,this.element.appendChild(this.content),null==(e=this.viewer.widgetContainer)||e.appendChild(this.element)}createItem(e,t){const r=new ModelLayoutSwitchItem(this.viewer,e);return 0===t&&r.setActive(!0),r}destroy(){var e,t;for(const t in this.itemList){const r=this.itemList[t];r.destroy(),null==(e=this.content)||e.removeChild(r.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")}},ModelLayoutSwitchItem=class{constructor(e,t){this.viewer=e,this.eventBus=mitt_default(),this.active=!1,this.element=this.createItem(t),this.eventBus.on("activechange",(e=>{this.resetActivate&&this.resetActivate(),e?(this.element.classList.add("activate"),this.viewer.activateLayout(t)):this.element.classList.remove("activate")}))}createItem(e){const t=document.createElement("div"),r=document.createElement("span");return t.classList.add("model-layout-switch-item"),t.onclick=()=>{this.active=!this.active,this.eventBus.emit("activechange",this.active)},r.innerText=e,t.appendChild(r),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")}},ProgressBar=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"))} /** * Adds a progress item * @param progressItemId * @param message Initial message * @param progress number between 0-100 */addProgressItem(e,t){let r=this.progresseItems.find((t=>t.id===e));if(!r){const i=document.createElement("div");i.classList.add("progress-bar-item"),i.innerHTML=t||"",this.element.append(i),r={id:e,div:i},this.progresseItems.push(r)}this.setVisibility(!0)} /** * Updates a progress item * @param progressItemId * @param message * @param progress number between 0-100 */updateProgress(e,t,r){const i=this.progresseItems.find((t=>t.id===e));if(!i)return;let n=t?`${t}`:"";t&&r&&(n+=": "),r&&(n+=`${r.toFixed(2)}%`),i.div.innerHTML=n} /** * Removes a progress item * @param progressItemId */removeProgressItem(e){const t=this.progresseItems.find((t=>t.id===e));t&&t.div.remove(),0===this.progresseItems.length&&this.setVisibility(!1)} /** * Removes a progress item after some time * @param progressItemId */delayRemoveProgressItem(e,t=3e3){setTimeout((()=>{this.removeProgressItem(e)}),t)}},BaseMarkup=class extends Drawable{constructor(e){super(e),this.editPointSize=3,this.editPointColor="#ffffff",this.id=e||CommonUtils.guid()}isSelected(){return this.selected}drawSelect(e,t){const r=this.getVertexs();this.drawPoints(e,t,r)}drawPoints(e,t,r){e.save(),e.fillStyle=this.editPointColor,e.beginPath(),r.forEach((r=>{const i=this.transToScreenCoord(r,t);e.moveTo(i.x,i.y),e.arc(i.x,i.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 Vector3)}isPointInPath(e){const t=this.getVertexs().map((e=>new Vector2(e.x,e.y)));return GeometryUtils.isPointInPolygon(new Vector2(e.x,e.y),t,!0)}setData(e){super.setData(e),this.update(e.points.map((e=>new Vector3(e[0],e[1],0))))}translate(e,t){const r=new Vector3(e,t,0);return this.points.forEach((e=>e.add(r))),this.update(this.points),this} // TODO:just markup can edit now rotate(){return this}scale(){return this}},ArrowMarkup=class extends BaseMarkup{constructor(e,t){super(e),this.type="ArrowMarkup"/* Arrow */,this.update(t)}draw(e,t){const r=this.points.map((e=>this.transToScreenCoord(e,t)));this.drawArrowLine(e,r),this.drawArrowHead(e,r[0],r[1],this.lineWidth+10,this.lineWidth+20)}drawArrowLine(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor;const[r,i]=t,n=(new Vector2).subVectors(i,r).normalize();e.beginPath(),e.moveTo(r.x,r.y);const s=i.clone().sub(n.multiplyScalar(this.lineWidth+5));e.lineTo(s.x,s.y),e.closePath(),e.stroke(),e.restore()}drawArrowHead(e,t,r,i,n){const s=180*Math.atan2(t.y-r.y,t.x-r.x)/Math.PI,a=(s+i)*Math.PI/180,o=(s-i)*Math.PI/180,l=n*Math.cos(a),c=n*Math.sin(a),u=n*Math.cos(o),h=n*Math.sin(o),p=new Vector2(r.x+l,r.y+c),d=new Vector2(r.x+u,r.y+h);e.save(),e.fillStyle=this.lineColor,e.beginPath(),e.moveTo(r.x,r.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){const[t,r]=e;return this.points=e,this.x=Math.min(t.x,r.x),this.y=Math.min(t.y,r.y),this.width=Math.abs(r.x-t.x),this.height=Math.abs(r.y-t.y),this}isPointInPath(e){return GeometryUtils.isPointOnLineSegments(e,this.points,this.tolerance)}getClassType(){return"ArrowMarkup"}}; // src/core/helpers/UndoRedoHelper.ts CanvasRender._registerDrawableClass(ArrowMarkup); // src/core/markup/CircleMarkup.ts var CircleMarkup=class extends BaseMarkup{constructor(e,t){super(e),this.radius=1,this.type="CircleMarkup"/* Circle */,this.update(t)}draw(e,t){const[r,i]=this.points.map((e=>this.transToScreenCoord(e,t)));this.radius=(new Vector2).subVectors(i,r).length(),e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.arc(r.x,r.y,this.radius,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){const[t,r]=e,i=(new Vector3).subVectors(r,t).length();return this.width=2*i,this.height=2*i,this.x=t.x-this.width/2,this.y=t.y-this.height/2,this.points=e,this}isPointInPath(e){const[t,r]=this.points,i=(new Vector3).subVectors(t,r).length();return Math.abs(e.distanceTo(t)-i)<=2*this.tolerance}getClassType(){return"CircleMarkup"}};CanvasRender._registerDrawableClass(CircleMarkup); // src/core/markup/CloudLineMarkup.ts var tempBox3=new Box3,CloudLineMarkup=class extends BaseMarkup{constructor(e,t){super(e),this.type="CloudLineMarkup"/* CloudLine */,this.update(t)}draw(e,t){const r=this.points,i=[];e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath();for(let n=0;nthis.transToScreenCoord(e,t))),n=(new Vector2).lerpVectors(r,i,.5);this.radiusX=Math.abs(i.x-r.x)/2,this.radiusY=Math.abs(i.y-r.y)/2,e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor,e.beginPath(),e.ellipse(n.x,n.y,this.radiusX,this.radiusY,0,0,2*Math.PI),e.closePath(),e.stroke(),e.restore()}update(e){const[t,r]=e;return this.x=Math.min(t.x,r.x),this.y=Math.min(t.y,r.y),this.width=Math.abs(r.x-t.x),this.height=Math.abs(r.y-t.y),this.points=e,this}isPointInPath(e){const[t,r]=this.points,i=(new Vector3).lerpVectors(t,r,.5),n=Math.abs(r.x-t.x)/2,s=Math.abs(r.y-t.y)/2,a=Math.pow(e.x-i.x,2)/(n*n),o=Math.pow(e.y-i.y,2)/(s*s);return Math.abs(a+o-1)<=.1}getClassType(){return"EllipseMarkup"}};CanvasRender._registerDrawableClass(EllipseMarkup); // src/core/markup/PolylineMarkup.ts var PolylineMarkup=class extends BaseMarkup{constructor(e,t){super(e),this.type="PolylineMarkup"/* PolyLine */,this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.fillStyle=this.fillColor;const r=this.points;e.beginPath(),r.forEach(((r,i)=>{const n=this.transToScreenCoord(r,t);0===i?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.stroke(),e.restore()}isPointInPath(e){const t=this.points,r=[];for(let e=0;e{const n=this.transToScreenCoord(r,t);0===i?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)})),e.closePath(),e.stroke(),e.restore()}update(e){const[t,r]=e;return this.x=Math.min(t.x,r.x),this.y=Math.min(t.y,r.y),this.width=Math.abs(r.x-t.x),this.height=Math.abs(r.y-t.y),this.points=e,this}isPointInPath(e){const t=this.getVertexs(),r=[];for(let e=0;ethis.textWidth&&(this.textWidth=s),i.push({lineWidth:s,lineText:n})}return this.textRow!==i.length&&(this.y-=(i.length-1)*this.fontSize),i.reverse()}setFontSize(e){this.fontSize=e}update(e){const t=e[0];return this.x=t.x,this.y=t.y,this.points=[t],this.textRow=1,this}setData(e){super.setData(e),this.text=e.text,this.setFontSize(e.fontSize)}updateText(e){this.text=e}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"}};CanvasRender._registerDrawableClass(TextMarkup); // src/core/markup/XMarkup.ts var XMarkup=class extends BaseMarkup{constructor(e,t){super(e),this.type="XMarkup"/* X */,this.update(t)}draw(e,t){e.save(),e.lineWidth=this.lineWidth,e.strokeStyle=this.lineColor,e.beginPath();const[r,i,n,s]=this.getVertexs().map((e=>this.transToScreenCoord(e,t)));e.moveTo(r.x,r.y),e.lineTo(n.x,n.y),e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.closePath(),e.stroke(),e.restore()}isPointInPath(e){const[t,r,i,n]=this.getVertexs();return GeometryUtils.isPointOnLineSegments(e,[t,i,r,n],.1)}update(e){const[t,r]=e;return this.points=e,this.x=Math.min(t.x,r.x),this.y=Math.min(t.y,r.y),this.width=Math.abs(r.x-t.x),this.height=Math.abs(r.y-t.y),this}getClassType(){return"XMarkup"}};CanvasRender._registerDrawableClass(XMarkup); // src/core/markup/MarkupUndoRedo.ts var MarkupUndoRedo=class extends UndoRedoHelper{constructor(e,t){super(t),this.manager=e}undo(){const e=super.undo();switch(null==e?void 0:e.type){case"Add"/* Add */:{const t=this.manager.getMarkupById(e.payload.id);t&&this.manager.removeMarkup(t,!1)}break;case"Remove"/* Remove */:{const t=this.manager.createMarkup(e.payload);t&&this.manager.addMarkup(t,!1)}break;case"Update"/* Update */:{const{from:t,to:r}=e.payload,i=this.manager.getMarkupById(t.id);i&&this.manager.updateMarkup(i,t,!1)}}return e}redo(){const e=super.redo();switch(null==e?void 0:e.type){case"Add"/* Add */:{const t=this.manager.createMarkup(e.payload);t&&this.manager.addMarkup(t,!1)}break;case"Remove"/* Remove */:{const t=this.manager.getMarkupById(e.payload.id);t&&this.manager.removeMarkup(t,!1)}break;case"Update"/* Update */:{const{from:t,to:r}=e.payload,i=this.manager.getMarkupById(r.id);i&&this.manager.updateMarkup(i,r,!1)}}return e}},tempVector3=new Vector3,MarkupManager2=class extends Event{constructor(e){var t;super(),this.drawableList=new DrawableList("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, // for drawing shape this.tempPoints=[], // for create text this.actived=!1,this.undoRedoHelper=new MarkupUndoRedo(this),this.mousedown=e=>{var t;let r=this.pickThreejsPositionByMouse(e);if(this.mouseDownPositionX=r.x,this.mouseDownPositionY=r.y,0===e.button&&(this.mouseDown=!0),2===e.button&&(this.creatingShape&&this.tempPoints.length<2?(this.removeMarkup(this.creatingShape,!1),this.creatingShape=void 0):null==(t=this.creatingShape)||t.update(this.tempPoints),this.isDrawing&&this.endDraw(this.creatingShape)),this.selectedShape&&(this.selectedShape.selected=!1,this.selectedShape=void 0,this.render()),!this.isDrawing){const e=this.drawableList.getDrawableByPosition(r);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=r.clone()),this.addInput(e.clientX,e.clientY)),this.isCreateLineMode()&&this.mouseDown&&!this.selectedShape){if(this.tempPoints.length>0){const e=this.tempPoints[0];if(tempVector3.subVectors(e,r).length(){e.preventDefault();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());const e=t.x-this.mouseDownPositionX,r=t.y-this.mouseDownPositionY;this.selectedShape.translate(e,r),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){const e=new Vector3(this.mouseDownPositionX,this.mouseDownPositionY,0);if(!this.creatingShape){const r=this.creatingShape=this.drawShape(e,t);r&&this.addMarkup(r,!1)}this.creatingShape.update([e,t]),this.isDrawing=!0,this.render()}if(this.isCreateLineMode()&&this.tempPoints.length>0&&this.isDrawing){if(!this.creatingShape){const e=this.creatingShape=this.drawLine([...this.tempPoints,t]);e&&this.addMarkup(e,!1)}const e=this.tempPoints[0];tempVector3.subVectors(e,t).length(){e.preventDefault(),this.mouseDown=!1,this.selectedShape&&this.isEditing()&&this.endEdit(this.selectedShape),this.isCreateShapeMode()&&this.isDrawing&&this.endDraw(this.creatingShape)},this.keydown=e=>{"Delete"===e.code?this.selectedShape&&this.removeMarkup(this.selectedShape):e.ctrlKey&&"KeyZ"===e.code?this.undo():e.ctrlKey&&"KeyY"===e.code?this.redo():"Escape"===e.code&&this.cancelDraw(this.creatingShape)},this.viewer=e,this.overlayRender=this.viewer.overlayRender,null==(t=this.overlayRender)||t.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()} // private addMarkupEventToViewer() { // // this.viewerCanvas.addEventListener("pointermove", (e) => { // // const point = this.pickThreePositionByMouse(e); // // const currentDrawable = this.drawableList.getDrawableByPosition(point.clone()); // // this.viewer.dispatchEvent(ViewerEvent.MarkupMouseMoved, { // // event: e, // // drawableData: currentDrawable?.getData(), // // point, // // }); // // }); // this.viewerCanvas?.addEventListener("pointerup", (e) => { // const point = this.pickThreejsPositionByMouse(e); // const currentDrawable = this.drawableList.getDrawableByPosition(point.clone()); // if (currentDrawable) { // this.viewer.dispatchEvent(ViewerEvent.MarkupClicked, { // markup: currentDrawable.getData(), // point, // }); // } // }); // } removeMarkupEventFromViewer(){}setMarkupsVisibility(e){this.drawableList.getDrawables().forEach((t=>t.visible=e))}clearAll(){this.drawableList.clear(),this.textInput&&(this.textInput.style.display="none"),this.undoRedoHelper.clear(),this.isDrawing&&this.endDraw(),this.render()}isMarkupActive(){return this.actived}activate(){this.actived=!0,this.viewerCanvas.addEventListener("pointerdown",this.mousedown),this.viewerCanvas.addEventListener("pointermove",this.mousemove),this.viewerCanvas.addEventListener("pointerup",this.mouseup),window.addEventListener("keydown",this.keydown);const e=this.viewer.controls;this.tempKey=e.mouseButtons.LEFT,e.mouseButtons.LEFT=-1,this.tempArrowKeys=e.keys,e.keys={},this.render()}deactivate(){this.actived=!1;const e=this.viewerCanvas;e&&(e.removeEventListener("pointerdown",this.mousedown),e.removeEventListener("pointermove",this.mousemove),e.removeEventListener("pointerup",this.mouseup)),window.removeEventListener("keydown",this.keydown),this.viewer.controls.mouseButtons.LEFT=this.tempKey,this.viewer.controls.keys=this.tempArrowKeys,this.textInput&&this.textInput.remove(),this.textInput=void 0,this.textInitialPosition=void 0,this.mouseDown=!1,this.selectedShape=void 0,this.tempPoints=[],this.isDrawing=!1,this.creatingShape=void 0}getActiveMarkupType(){return this.type}setDrawType(e){this.type=e,this.endDraw()}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){const t=new Vector3,r=CoordinateConversionUtils.screenPoint2NdcPoint(e,this.camera,this.viewerCanvas);this.raycaster.setFromCamera(r,this.camera);const i=this.viewer.scene,n=this.raycaster.intersectObject(this.viewer.groundPlane||i)||[];return n.length>0&&t.copy(n[0].point),t}pickThreejsPositionByMouse(e){const t=CoordinateConversionUtils.getScreenPointByEvent(e,this.viewerCanvas);return this.pickPositionByScreenPoint(t)}isEditing(){return!!this.initialDataForEditing}endEdit(e){this.undoRedoHelper.addRecord("Update"/* Update */,{from:this.initialDataForEditing,to:e.getData()}),this.initialDataForEditing=void 0}endDraw(e){e&&this.undoRedoHelper.addRecord("Add"/* Add */,e.getData()),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.render()}render(){var e;null==(e=this.overlayRender)||e.render()}addMarkup(e,t=!0){this.drawableList.addDrawable(e),this.render(),t&&this.undoRedoHelper.addRecord("Add"/* Add */,e.getData())}updateMarkup(e,t,r=!0){this.drawableList.updateDrawable(e,t),this.render(),r&&this.undoRedoHelper.addRecord("Update"/* Update */,e.getData())}removeMarkup(e,t=!0){this.drawableList.removeDrawable(e),this.render(),t&&this.undoRedoHelper.addRecord("Remove"/* Remove */,e.getData())}removeMarkupById(e,t=!0){const r=this.getMarkupById(e);this.drawableList.removeDrawable(r),this.render(),t&&this.undoRedoHelper.addRecord("Remove"/* Remove */,r.getData())}createMarkup(e){return CanvasRender.createDrawable(e)}getMarkupById(e){return this.drawableList.getDrawableById(e)}getMarkupData(){return this.drawableList.getDrawableDatas()}setMarkupData(e){this.drawableList.clear(),this.drawableList.setDrawableDatas(e),this.render()}isCreateLineMode(){return["PolylineMarkup"/* PolyLine */,"CloudLineMarkup"/* CloudLine */].includes(this.type)}isCreateDotMode(){return["DotMarkup"/* Dot */].includes(this.type)}isCreateTextMode(){return["TextMarkup"/* Text */].includes(this.type)}isCreateShapeMode(){return["XMarkup"/* X */,"RectMarkup"/* Rectangle */,"CloudRectMarkup"/* CloudLineRectangle */,"CircleMarkup"/* Circle */,"EllipseMarkup"/* Ellipse */,"ArrowMarkup"/* Arrow */,"DotMarkup"/* Dot */].includes(this.type)}drawShape(e,t){const r=[[e.x,e.y]];return t&&r.push([t.x,t.y]),CanvasRender.createDrawable({id:CommonUtils.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,type:this.type,points:r})}drawLine(e){return CanvasRender.createDrawable({id:CommonUtils.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 CanvasRender.createDrawable({id:CommonUtils.guid(),lineWidth:this.lineWidth,lineColor:this.lineColor,fillColor:this.fillColor,fontSize:this.fontSize*this.overlayRender.getPixelSize(1,this.camera),type:this.type,text:t,points:[[e.x,e.y]]})}addInput(e,t){var r;if(!this.textInput){const e=document.createElement("textarea");let t;e.style.cssText=`\n position: fixed;\n border: 1px solid red;\n background: transparent;\n outline: none;\n resize: none;\n overflow: hidden;\n z-index: 1000;\n box-sizing: content-box;\n padding: 0px 2px;\n color: ${this.lineColor}`,e.setAttribute("wrap","off"),e.onkeydown=t=>{if("Enter"===t.key){const t=parseInt(e.style.height);e.style.height=`${t+this.fontSize}px`}this.isDrawing=!0},e.onkeyup=e=>{var r;const i=e.target.value,n=(null==(r=this.overlayRender)?void 0:r.measureTextLength(i,`${this.fontSize}px Arial`))||0;n>50&&(t&&clearTimeout(t),t=setTimeout((()=>{e.target.style.width=`${n+4}px`}),0))},e.onfocus=()=>{},e.onblur=e=>{const t=e.target.value;if(t.length>0&&this.textInitialPosition){const e=this.creatingShape=this.drawText(this.textInitialPosition,t);e.setTolerance(this.overlayRender.getPixelSize(1,this.camera)),this.addMarkup(e,!1),this.endDraw(this.creatingShape)}},null==(r=this.viewer.viewerContainer)||r.appendChild(e),this.textInput=e}setTimeout((()=>{this.textInput.focus()}),0),this.textInput.style.width="50px",this.textInput.style.height=`${this.fontSize}px`,this.textInput.style.lineHeight=`${this.fontSize}px`,this.textInput.style.fontSize=`${this.fontSize}px`,this.textInput.style.color=this.lineColor,this.textInput.style.display="inline-block",this.textInput.style.left=e+4+"px",this.textInput.style.top=t-this.fontSize+"px"}undo(){this.undoRedoHelper.undo()}redo(){this.undoRedoHelper.redo()}clearUndoRedo(){this.undoRedoHelper.clear()}destroy(){this.deactivate(),this.clearAll()}},ShxFontLoader=class extends FontLoader{constructor(e){super(e)}load(e,t,r,i){Array.isArray(e)||(e=[e]);const n=[];for(let t=0;t{const r=this.parse(e);t&&t(r)})).catch((e=>{i&&i(e)}))}loadFile(e,t){return __async(this,null,(function*(){return new Promise(((r,i)=>{const n=new FileLoader(this.manager);n.setResponseType("arraybuffer"),n.load(e,(t=>{r({url:e,arrayBuffer:t})}),t,(e=>{i(e)}))}))}))}loadAsync(e,t){return __async(this,null,(function*(){Array.isArray(e)||(e=[e]);return(yield ShxFont.checkFontIsLoaded(e))?Promise.resolve(new ShxFont):new Promise(((r,i)=>{this.load(e,r,t,i)}))}))}parse(e){return new ShxFont(e)}static isShxFile(e){var t;return"shx"===(null==(t=e.split(".").pop())?void 0:t.toLowerCase())}},CSS2DObjectUtils=class{ /** * Creates CSS2DObject with HTMLElement */ static createCSS2DObject(e){const t=new CSS2DObject(e);return e.dataset.objectId=t.id.toString(),t}static createDefaultHotpoint(e=12){const t=document.createElement("div"),r=t.style;return r.width=`${e}px`,r.height=`${e}px`,r.opacity="0.8",r.cursor="pointer",r.top=-e/2+"px",r.left=-e/2+"px",r.backgroundColor="#ffffff",r.border="2px solid #00DAB7",r.borderRadius="50%",this.createCSS2DObject(t)}static createHotpoint(e){if(e){const t=document.createElement("div"),r=t.style;return r.top="0px",r.left="0px",t.innerHTML=e,this.createCSS2DObject(t)}return this.createDefaultHotpoint()}static createLabel(e,t=""){const r=document.createElement("div");if(r.innerHTML=e,t)r.classList.add(t);else{const e=r.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(r)} /** * Recursively find "dataset.objectId" of a HTMLElement */static tryFindObjectId(e){if(null!=e.dataset.objectId)return parseInt(e.dataset.objectId);const t=e.parentElement;return!t||t instanceof HTMLBodyElement?void 0:this.tryFindObjectId(t)}},SectionUtils=class{static setMaterialSection(e,t,r=!1,i=!1){const n=r&&e.clippingPlanes?e.clippingPlanes:[];n.push(...t),e.clippingPlanes=n,e.clipIntersection=i}static removeSection(e){e&&e.traverse((e=>{const t=e.material;Array.isArray(t)?t.forEach((e=>{e.clippingPlanes=void 0})):t&&(t.clippingPlanes=void 0)}))}static addSection(e,t,r=!1,i=!1){e&&e.traverse((e=>{const n=e.material;Array.isArray(n)?n.forEach((e=>{SectionUtils.setMaterialSection(e,t,r,i)})):n&&SectionUtils.setMaterialSection(n,t,r,i)}))}static generateSectionPlanesByBox(e){const t=e.min,r=e.max;return[new Plane(new Vector3(0,-1,0),r.y), // up new Plane(new Vector3(0,1,0),-t.y), // down new Plane(new Vector3(1,0,0),-t.x), // left new Plane(new Vector3(-1,0,0),r.x)]}static generateSectionPlanesByPoints(e,t=!0){const r=e.length;if(r<2)return;const i=[];for(let n=0;n{var e;const t=null==(e=this.renderer)?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)}, /** * In order to have a better performance, it should only render when necessary. * Usually, we should enable render for these cases: * - Anything added to, removed from scene, or objects' position, scale, rotation, opacity, material, etc. changed * - Anything selected/unselected * - Camera changed * - Render area resized * @internal */ 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))}, /** * Used to indicate how many dxf is loading */ this.loadingDxfCount=0, /** * If it is under compare mode */ this.compareMode=!1,this.viewerCfg=e,this.increaseJobCount(),this.init(),this.animate(),this.enableRender(),this.decreaseJobCount(),log.info(`[DxfViewer] Initialized in ${(Date.now()-this.timer)/1e3}s`)} /** * Initialize everything it needs * @internal */init(){const e=this.viewerCfg;this.initSpinner(),this.initScene(),this.initRenderer(),this.initCSS2DRenderer(),this.initCamera(),this.initControls(),this.initEvents(),this.initMouseWheel(),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.enableProgressBar&&(this.loadingProgressBar=this.initLoadingProgressBar()),this.enableSelection=e.enableSelection}initScene(){const e=new Scene;e.background=new Color(2172976),e.matrixAutoUpdate=matrixAutoUpdate,e.matrixWorldAutoUpdate=!1,this.scene=e}initRenderer(){var e;this.renderer=new WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0, // for screenshot alpha:!1,stencil:!1}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.renderer.setClearColor(11119017,1),this.renderer.localClippingEnabled=!0,this.renderer.domElement.classList.add("webgl-renderer"),null==(e=this.viewerContainer)||e.appendChild(this.renderer.domElement),CommonUtils.printGpuInfo(this.renderer.getContext()),DXFLoader.maxFragmentUniforms=this.renderer.capabilities.maxFragmentUniforms-20,this.enableOverlayRenderer&&(this.overlayRender=new CanvasRender(this))}initCSS2DRenderer(){var e;const t=new CSS2DRenderer;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} /** * @internal */ // public setCompareMarkupVisibility(visible: boolean) { // this.dxfCompareManager?.setCompareDrawableVisible(visible); // } initCamera(){if(!this.scene)return;const e=new OrthographicCamera(-this.width/2,this.width/2,this.height/2,-this.height/2,.1,1e5);e.layers.enable(layerForNonSnapableObjects),e.position.set(0,0,this.CAMERA_Z_POSITION),e.zoom=10,e.updateProjectionMatrix(),this.scene.add(e),this.camera=e} /** * @internal */initControls(){const e=this.camera;if(!this.renderer||!e)return;const t=new OrbitControls(e,this.renderer.domElement);t.enableDamping=!1,t.enableRotate=!1,t.dampingFactor=.5,t.zoomSpeed=6,t.enableZoom=!1,t.enabled=!0,t.keyPanSpeed=10,t.mouseButtons={LEFT:MOUSE.PAN, // since rotate is disabled, use both left and right button to pan MIDDLE:MOUSE.PAN,RIGHT:MOUSE.PAN},t.listenToKeyEvents(document.body),t.update(),this.controls=t,t.addEventListener("change",this.onControlsChange(this)),t.addEventListener("end",this.onControlsEnd(this))}onControlsChange(e){return()=>{e.enableRender()}}onControlsEnd(e){return()=>{e.enableRender()}}initSpinner(){var e;if(!this.viewerCfg.enableSpinner)return;const t=document.createElement("div");t.classList.add("bim-viewer-spinner");const r=document.createElement("div");r.classList.add(ICON_FONT_CLASS,"icon-loading"),t.append(r),null==(e=this.widgetContainer)||e.appendChild(t),this.spinner=t,this.setSpinnerVisibility(this.jobCount>0)} /** * Initialize mouse/pointer events */initEvents(){const e=this.renderer;if(!e||!this.camera||!this.controls)return;let t=-1,r=-1;e.domElement.addEventListener("pointerdown",(i=>{t=i.x,r=i.y,this.mouseMoved=!1,i.button===MOUSE.MIDDLE&&(e.domElement.style.cursor="move")})),e.domElement.addEventListener("pointermove",(i=>{if(t>=0&&r>=0){const n=5;(Math.abs(i.x-t)>n||Math.abs(i.y-r)>n)&&(this.mouseMoved=!0,e.domElement.style.cursor="move")}})),e.domElement.addEventListener("pointerup",(i=>{this.mouseMoved||this.mouseDoubleClicked||i.button!==MOUSE.LEFT||setTimeout((()=>{this.handleMouseClick(i)}),200),this.mouseDoubleClicked&&setTimeout((()=>{this.mouseDoubleClicked=!1}),200),t=-1,r=-1,e.domElement.style.cursor="auto"})),e.domElement.addEventListener("dblclick",(()=>{this.mouseDoubleClicked=!0,this.mouseMoved})),window.addEventListener("keydown",(e=>{e.altKey&&"KeyR"===e.code&&this.flyToRandomObject()})),window.addEventListener("resize",(()=>{var e;const t=null==(e=this.renderer)?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)}))}initMouseWheel(){const e=this.renderer;if(!e)return;let t=Date.now();e.domElement.addEventListener("wheel",(e=>{const r=this.camera,i=this.viewerContainer;if(!r||!this.controls)return;e.preventDefault(),e.stopPropagation();let n=this.controls.zoomSpeed;const s=Date.now(),a=s-t;if(a<10)return void log.debug("[DxfViewer] Ignore too frequent mouse wheel:");a<30&&(n*=a/30),t=s;const o=Math.pow(.95,n),l=r.zoom;let c=e.deltaY>0?l*o:l/o;const u=CoordinateConversionUtils.getScreenPointByEvent(e,i),h=CoordinateConversionUtils.screenPoint2NdcPoint(u,r,i),p=new Vector3(h.x,h.y,0),d=p.clone().unproject(r);c=this.checkAndGetLimitedCameraZoom(c),r.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,c)),r.updateProjectionMatrix();const m=p.clone().unproject(r),f=tempVec33.set(0,0,0);f.subVectors(m,d),f.z=0,this.updateHidableObjectsVisibility(),r.position.sub(f),this.controls.target.sub(f),this.controls.update()}))}initOthers(){this.scene&&this.renderer&&this.camera&&(this.renderer.domElement.style.outlineWidth="0")}initAxes(){var e;const t=document.createElement("div");t.classList.add("axesRenderer");const r=new CoordinateAxesViewport(t,this.camera,!0);return null==(e=this.widgetContainer)||e.append(t),r}initStats(){var e;const t=stats_module_default();t.setMode(0);const r=document.createElement("div");return r.classList.add("statsOutput"),r.appendChild(t.domElement),t.domElement.style.position="absolute",null==(e=this.widgetContainer)||e.append(r),t} /** * Shows the stats panel, which indicates current FPS, MS, MB, etc. * @internal */showStats(){this.stats||(this.stats=this.initStats()),this.stats.showPanel(0)} /** * Shows the stats panel, which indicates current FPS, MS, MB, etc. * @internal */hideStats(){this.stats&&this.stats.showPanel(-1)} // private initContextMenu() { // const contextMenu = new ContextMenu({ // items: contextMenuItems, // context: { dxfViewer: this }, // container: this.rootHtmlElement, // }); // window.oncontextmenu = (event: MouseEvent) => event.preventDefault(); // return contextMenu; // } initToolbar(){const e=this.viewerCfg;return new Toolbar2(this,(0,import_lodash9.merge)(DEFAULT_DXFVIEWER_TOOLBAR_CONFIG,e.toolbarMenuConfig))}initBottomBar(){return new BottomBar(this)}initLoadingProgressBar(){return new ProgressBar(this.widgetContainer)} /** * Shows the layout bar * @internal */showLayoutBar(){var e;null==(e=this.dxfLayoutBar)||e.show()} /** * Hides the layout bar * @internal */hideLayoutBar(){var e;null==(e=this.dxfLayoutBar)||e.hide()} // private showContextMenu(event: MouseEvent) { // if (!this.contextMenu) { // return; // } // this.contextMenu.show(event.clientX, event.clientY); // } // private handleRightClick(event: MouseEvent) { // this.showContextMenu(event); // } animate(){var e,t,r,i,n;requestAnimationFrame(this.animate.bind(this)),this.scene&&this.camera&&this.renderEnabled&&(DXFLoader.resolutionUniform.value.set(this.width,this.height),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("RenderAfter"/* RenderAfter */)),null==(r=this.controls)||r.update(),null==(i=this.stats)||i.update(),this.fpsUtils.update(),null==(n=this.bottomBar)||n.update()} /** * Gets current FPS value * @internal */getFps(){return this.fpsUtils.fps}is3d(){return!1} /** * Destroies DxfViewer */destroy(){var e,t,r,i;DXFLoader.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==(r=this.zoomToRect)||r.destroy(),this.zoomToRect=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==(i=this.viewerContainer)||i.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.spinner&&(this.spinner.remove(),this.spinner=void 0),this.bottomBar=void 0,this.font=void 0,window.removeEventListener("resize",this.onResize),super.destroy()} /** * Loads a dxf file. * The first loaded file will be taken as a "master" model. * Any other files are non-master, we call "overlay" model. * We'll load everything of a master model, including model and paper space. * For an overlay model, we'll only load its model space. And its model space can only * overly to master model's model space. * @example * ``` typescript * const viewerCfg = { * containerId: "myCanvas", * }; * const modelCfg = { * modelId: "id_0", * name: "dxf 0", * src: "http://www.abc.com/sample.dxf", * } * const viewer = new DxfViewer(viewerCfg); * await viewer.loadModelAsync(modelCfg, (event) => { * const progress = (event.loaded * 100) / event.total; * console.log(`${event.type}: ${progress}%`); * }); * console.log("Loaded"); * ``` */loadModelAsync(e,t){return __async(this,null,(function*(){var r,i;this.loadingDxfCount++,this.timer=Date.now(),this.increaseJobCount();const n=e.modelId||e.src;this.masterModelId||(this.masterModelId=n);const s=e.ignorePaperSpace||this.masterModelId!==n;!1===e.ignorePaperSpace&&s&&log.warn(`[DxfViewer] Paper space will be ignored for '${n}' although 'ignorePaperSpace' is false!`),CommonUtils.printMemory("Before loadModelAsync");const a=new LoadingHelper;a.setFont(this.font);const o=n,l=this.translate("ProgressBar.Loading"),c=e=>{var r;null==(r=this.loadingProgressBar)||r.updateProgress(o,l,e),t&&t(new ProgressEvent("LoadProgress",{loaded:e,total:100}))},u=(e,r,i)=>{var n;let s=100*e.loaded/e.total;s=s*(i-r)/100+r,null==(n=this.loadingProgressBar)||n.updateProgress(o,l,s),t&&t(new ProgressEvent("LoadProgress",{loaded:s,total:100}))};null==(r=this.loadingProgressBar)||r.addProgressItem(o),c(0);const h=this.viewerCfg,p=yield a.loadDxfDataAsync(e.src,e.modelId,(e=>u(e,0,90)),void 0,s,h.enableLocalCache).finally((()=>{this.loadingDxfCount--,0===this.loadingDxfCount&&this.font.releaseFontData&&this.font.releaseFontData()}));if(log.info(`[DxfViewer] Loaded '${e.src}' in ${(Date.now()-this.timer)/1e3}s, adding to scene...`),DXFLoader.abortJobs&&Promise.reject("[DxfViewer] abort load dxf"),0===p.threejsObject.children.length){const t=`[DxfViewer] Nothing was loaded from ${e.src}`;return log.warn(t),this.decreaseJobCount(),Promise.reject(t)}const d=p.threejsObject;d.name=n;const m=this.getDxfUnits(p);if(this.masterModelId===e.modelId&&(this.units=m),log.info(`[DxfViewer] Units of '${e.src}' is '${m}'`),m){let t=1;this.units&&m!==this.units&&(t=unitScaleConversion(m,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){const t=new Matrix4;t.elements=e.matrix,d.applyMatrix4(t)}else{const t=e.position||[0,0,0],r=e.rotation||[0,0,0],i=e.scale||[1,1,1];d.position.set(t[0],t[1],t[2]),d.rotation.set(r[0]*Math.PI/180,r[1]*Math.PI/180,r[2]*Math.PI/180),d.scale.set(i[0],i[1],i[2])}return this.addLoadedModelToScene(d,e,p),CommonUtils.printMemory("After addLoadedModelToScene"),log.info(`[DxfViewer] Added '${e.src}' to scene in ${(Date.now()-this.timer)/1e3}s`),h.enableLayoutBar&&!this.dxfLayoutBar&&this.masterModelId===n&&(this.dxfLayoutBar=new DxfLayoutBar(this)),this.decreaseJobCount(),c(100),null==(i=this.loadingProgressBar)||i.delayRemoveProgressItem(o),Promise.resolve()}))} /** * Unloads a dxf * @internal */unloadDxf(){throw new Error("Not implemented yet!")} /** * If it is under compare mode */isCompareMode(){return this.compareMode} /** * Compares two dxf files. Note that: * - It only compares model spaces. * - It shouldn't load anything else before and after compare. * @param model1 The first dxf to be compared * @param model2 The second dxf to be compared * @param onProgress loading progress * @internal */compare(e,t,r){return __async(this,null,(function*(){var i,n,s,a,o;const{src:l,modelId:c}=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!");const h=new DXFLoader(!0);h.setFont(this.font),this.font instanceof ShxFont&&this.font.getFontData&&(yield this.font.getFontData());const p=l+u,d=this.translate("ProgressBar.Comparing"),m=e=>{var t;null==(t=this.loadingProgressBar)||t.updateProgress(p,d,e),r&&r(new ProgressEvent("CompareProgress",{loaded:e,total:100}))},f=(e,t,i)=>{var n;let s=100*e.loaded/e.total;s=s*(i-t)/100+t,null==(n=this.loadingProgressBar)||n.updateProgress(p,d,s),r&&r(new ProgressEvent("CompareProgress",{loaded:s,total:100}))};CommonUtils.printMemory("Before comparing"),this.masterModelId=c||l,this.loadingDxfCount+=2,null==(i=this.loadingProgressBar)||i.addProgressItem(p),m(0);let g=Date.now();const _=yield h.parse(l,(e=>f(e,0,15))),y=yield h.parse(u,(e=>f(e,15,30))),[T,v]=yield Promise.allSettled([_,y]);if("rejected"===T.status)return Promise.reject(`[DxfViewer] Failed to parse ${l}`);if("rejected"===v.status)return Promise.reject(`[DxfViewer] Failed to parse ${u}`);if(log.info(`[DxfViewer] loadFiles in ${(Date.now()-g)/1e3}s`),DXFLoader.abortJobs)return Promise.reject("[DxfViewer] compare loadFile aborted");const E=T.value,I=v.value;g=Date.now();const b=yield new DxfCompare(E,I).compare((e=>f(e,30,60)));if(log.info(`[DxfViewer] Compared in ${(Date.now()-g)/1e3}s`),log.debug("Compared results:",b),DXFLoader.abortJobs)return Promise.reject("[DxfViewer] compare change aborted");CommonUtils.printMemory("After getting the comparison results"),g=Date.now(),yield h.loadEntitiesForCompare(E,I,b,(e=>f(e,60,95))),CommonUtils.printMemory("After Creating threejs objects based on comparison result"),null==(n=this.font)||n.releaseFontData(),this.changes=b,log.info(`[DxfViewer] Creates threejs objects based on comparison result in ${(Date.now()-g)/1e3}s`);const x=E,S=I;if(this.loadingDxfCount-=2,this.decreaseJobCount(),Object.keys(b).length||log.info("[DxfViewer] No change found"),0===(null==(s=x.threejsObject)?void 0:s.children.length)&&0===(null==(a=S.threejsObject)?void 0:a.children.length)){const e=`[DxfViewer] Nothing was loaded from ${l} and ${u}`;return log.warn(e),Promise.reject(e)}const w=x.threejsObject,C=S.threejsObject;return w.name=l,C.name=u,g=Date.now(),this.addLoadedModelToScene(w,__spreadValues({},e),x),CommonUtils.printMemory("After adding first loaded Model to scene"),m(95),this.addLoadedModelToScene(C,__spreadValues({},t),S),CommonUtils.printMemory("After adding second loaded Model to scene"),log.info(`[DxfViewer] Added compared objects to scene in ${(Date.now()-g)/1e3}s`),log.info(`[DxfViewer] The comparison between ${l}' and '${u}' is completed in ${(Date.now()-this.timer)/1e3}s !`),m(100),null==(o=this.loadingProgressBar)||o.delayRemoveProgressItem(p),Promise.resolve()}))} /** * Gets loaded entity count * @internal * @returns {number} */getEntitiesCount(){let e=0;return Object.values(this.loadedModels).forEach((t=>{var r;e+=(null==(r=t.dxfData)?void 0:r.loadedEntityCount)||0})),e} /** * Gets loaded dxf model id array */getLoadedDxfModelIds(){return Object.keys(this.loadedModels)} /** * Gets layouts */getLayoutNames(){const e=[];return this.getLayouts().forEach((t=>{e.push(t.layoutName)})),e} /** * Gets layouts. * Only returns master model's layouts. */getLayouts(){const e=[],t=this.loadedModels[this.masterModelId];if(t){const r=t.dxfData,i=null==r?void 0:r.objects.LAYOUT;null==i||i.forEach((t=>{e.push(t)}))}return e}handleOverlayDxf(e){var t;const r=this.loadedModels[e];if(!r)return void log.warn(`[DxfViewer] Can't find model for modelId '${e}'!`);this.increaseJobCount(),this.switchTransformMs(DXFLoader.MODEL_LAYOUT_NAME,e);const i=null==(t=r.dxfData)?void 0:t.threejsObject,n=null==i?void 0:i.children.find((e=>e.name===DXFLoader.MODEL_LAYOUT_NAME));n&&(n.traverse((e=>{this.addSpatialFilterSection(e,r.dxfData)})),this.calBoundingBoxOfLayoutChild(n)),this.showLayoutObjects(this.activeLayoutName),this.decreaseJobCount()} /** * Activates a layout */activateLayout(e){var t,r,i;if(this.increaseJobCount(),0==e.length)return log.warn("[DxfViewer] layout name is empty !"),void this.decreaseJobCount();if(e===this.activeLayoutName)return void this.decreaseJobCount();const n=Date.now(),s=this.camera,a=this.getLayoutByName(e);if(!a)return log.warn(`[DxfViewer] Can't find layout of ${e} !`),void this.decreaseJobCount();const o=this.loadedModels[this.masterModelId];if(!o)return log.warn(`[DxfViewer] Can't find master model for modelId '${this.masterModelId}'!`),void this.decreaseJobCount();if(this.raycastableObjects=void 0,this.activeLayoutName){const e=this.getActiveLayoutInfo();e.lastCameraPosition||(e.lastCameraPosition=new Vector3),null==(t=this.camera)||t.getWorldPosition(e.lastCameraPosition),e.lastCameraZoom=s.zoom}if(!(e=>{const t=this.layoutInfos[e];return!!(null==t?void 0:t.lastCameraZoom)})(e)){this.switchTransformMs(e,this.masterModelId);const t=this.getLayoutViewports(a);let n=[];t.length>0&&(n=t[0].frozenLayerHandles);const s=e!==DXFLoader.MODEL_LAYOUT_NAME,l=null==(r=o.dxfData)?void 0:r.threejsObject,c=null==l?void 0:l.children.find((t=>t.name===e));if(c){const t=[],r=null==(i=o.dxfData)?void 0:i.layersAndThreejsObjects;c.traverse((i=>{this.addSpatialFilterSection(i,o.dxfData);const a=i;if(s&&a.material&&a.geometry){const i=a.userData.layerName;if(!this.isLayerFrozenForViewport(o.dxfData,i,n))return;t.push(a);let s=-1;r&&r[i]&&(s=r[i].indexOf(a),s>=0&&r[i].splice(s,1)),s<0&&log.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${i}', layout '${e}'`)}})),t.forEach((e=>{e.removeFromParent()}))}const u=this.getFilteredViewports(a);log.debug("[DxfViewer] Active layout:",e,", viewports:",u),console.time("[DxfViewer] generateObjectsByViewport"),u.forEach((t=>{this.generateObjectsByViewport(e,t,o.dxfData)})),console.timeEnd("[DxfViewer] generateObjectsByViewport"),e!==DXFLoader.MODEL_LAYOUT_NAME&&this.switchTransformMs(DXFLoader.MODEL_LAYOUT_NAME,this.masterModelId),e!==DXFLoader.MODEL_LAYOUT_NAME&&c&&this.setLayoutHidableObjectArray(c),c&&this.calBoundingBoxOfLayoutChild(c)}let l=this.getActiveLayoutInfo();this.measurementManager&&(l.measurementData=this.measurementManager.getMeasurementsData()||[],l.measurementData.forEach((e=>e.layoutName=this.activeLayoutName)),this.setMeasurementsVisibility(!1),this.measurementManager.clearUndoRedo()),this.markupManager&&(l.markupData=this.markupManager.getMarkupData()||[],l.markupData.forEach((e=>e.layoutName=this.activeLayoutName)),this.setMarkupsVisibility(!1),this.markupManager.clearUndoRedo()),this.showLayoutObjects(e),this.activeLayoutName=e,l=this.getActiveLayoutInfo();const c=l.measurementData;this.measurementManager&&(this.measurementManager.setMeasurementsData(c||[]),this.setMeasurementsVisibility(!0));const u=l.markupData;if(this.markupManager&&(this.markupManager.setMarkupData(u||[]),this.setMarkupsVisibility(!0)),l.lastCameraPosition)this.goTo(l.lastCameraPosition,l.lastCameraZoom,!1);else{let e=this.getLayoutExtentEx(a);if(e){const t=1e-16,r=1e16,i=e.max.x-e.min.x,n=e.max.y-e.min.y;(ir||n>r)&&(log.warn(`[BimViewer] Got wired bbox, max: ${e.max.toArray()}, min: ${e.min.toArray()}, going to calculate one...`),e=this.computeBoundingBox()),l.bbox=e,this.activeLayoutName!==DXFLoader.MODEL_LAYOUT_NAME&&this.updateGroundPlane(),this.zoomToBBox(e)}}this.dispatchEvent("LayoutChanged"/* LayoutChanged */),CommonUtils.printMemory(`After activated layout '${this.activeLayoutName}'`),this.enableRender(),this.decreaseJobCount(),log.info(`[DxfViewer] Activated layout '${e}' in ${(Date.now()-n)/1e3}s`)} /** * Calculates the boundingBox of objects with child objects in the children of layoutLevelObject */calBoundingBoxOfLayoutChild(e){const t=e.children.length;for(let r=0;r0?t.userData.boundingBox=SceneUtils.getBoundingBox(t):t.userData.boundingBox&&delete t.userData.boundingBox}} /** * Gets active layout */getActiveLayoutName(){return this.activeLayoutName} /** * Gets dxf layers. * @example * ``` typescript * const dxfLayers = viewer.getLayers(); * for (let i = 0; i < dxfLayers.length; ++i) { * const layers = dxfLayers[i].layers; * const layerNames = Object.keys(layers).sort(); * console.log(layerNames); * } * ``` */getLayers(){var e,t;const r=[];if(this.masterModelId){const t=this.loadedModels[this.masterModelId],i=null==(e=null==t?void 0:t.dxfData)?void 0:e.tables.layer.layers;i&&r.push({modelId:this.masterModelId,layers:i})}for(const[e,i]of Object.entries(this.loadedModels)){if(e===this.masterModelId)continue;const n=null==(t=null==i?void 0:i.dxfData)?void 0:t.tables.layer.layers;n&&r.push({modelId:e,layers:n})}return r} /** * Sets model's (aka, a dxf file) visibility. * @throws Throws exception if modelId doesn't exist. * @internal */setModelVisibility(e,t){const r=this.loadedModels[e];if(!r||!r.dxfData)throw new Error(`Failed to find model by modelId '${e}'!`);r.dxfData.threejsObject.visible=t,this.enableRender()} /** * Sets layer's visibility. * @param layerName Layer's name to show or hide * @param visible Layer's target visibility * @param modelId Useful when more than one model is loaded, if not specified, will use the master model. * @throws Throws exception if given modelId doesn't exist. * @example * ``` typescript * // Hides layer "0" * viewer.setLayerVisibility("0", false); * ``` */setLayerVisibility(e,t,r){const i=this.camera;r=r||this.masterModelId;const n=this.loadedModels[r];if(!n)throw new Error(`Failed to find layer by modelId '${r}'!`);const s=n.dxfData,a=null==s?void 0:s.tables.layer.layers[e];a?a.visible=t:log.warn(`[DxfViewer] Layer '${e}' not found from dxfData!`);const o=null==s?void 0:s.layersAndThreejsObjects[e];if(o){const e=i.zoom;o.forEach((r=>{this.enableHideVisuallySmallObjects&&t&&e&&r.userData.visibleMinZoom&&e{let r=e;r.material&&MaterialUtils.setMaterialColor(r.material,new Color(t))})):log.warn(`[DxfViewer] No object found for layer '${e}'`),this.enableRender()} /** * Sets font. * This needs to be called before loading a dxf, it won't affect any loaded text. * It accepts shx or typeface formats. For typeface, it only support passing in 1 font file in the array for now. * @param urls font file urls */setFont(e){return __async(this,null,(function*(){console.time("[DxfViewer] Font file(s) load time"),ShxFontLoader.isShxFile(e[0])?this.font=yield(new ShxFontLoader).loadAsync(e):(e.length>1&&log.warn("[DxfViewer] Only support 1 typeface font file for now, others will be ignored!"),this.font=yield(new FontLoader).loadAsync(e[0])),console.timeEnd("[DxfViewer] Font file(s) load time")}))} /** * Sets display length units. * @internal Not implemented yet! * @default Millimeters */setDisplayLengthUnits(){throw new Error("Not implemented yet!")} /** * Sets display area units * @internal Not implemented yet! * @default Meters */setDisplayAreaUnits(){throw new Error("Not implemented yet!")} /** * Sets display decimal digits * @internal Not implemented yet! * @default 2 */setDisplayPrecision(){throw new Error("Not implemented yet!")} /** * Activates one of "Distance", "Area" or "Angle" measurement * @param type "Distance", "Area" or "Angle" * @example * ``` typescript * viewer.activateMeasurement(MeasurementType.Distance); * ``` */activateMeasurement(e){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.activateMeasurement(e),this.clearSelection()} /** * Deactivates measurement */deactivateMeasurement(){var e,t;null==(e=this.measurementManager)||e.deactivateMeasurement(),null==(t=this.toolbar)||t.updateMenu("Measure"/* Measure */,DEFAULT_DXFVIEWER_TOOLBAR_CONFIG.Measure)} /** * Gets active measurement type */getActiveMeasurementType(){var e;return null==(e=this.measurementManager)?void 0:e.getActiveMeasurementType()} /** * Gets all measurements * @example * ``` typescript * const measurementData = viewer.getMeasurements(); * console.log(measurementData); * ``` */getMeasurements(){var e,t;const r=this.getActiveLayoutInfo();r.measurementData=(null==(e=this.measurementManager)?void 0:e.getMeasurementsData())||[],r.measurementData.forEach((e=>{e.layoutName||(e.layoutName=this.activeLayoutName)}));const i=[];for(const e of Object.values(this.layoutInfos))null==(t=e.measurementData)||t.forEach((e=>i.push(e)));return i} /** * Sets measurement data. * User can set measurement data for all layouts, DxfViewer manages their visibilities * for different layouts. * @example * ``` typescript * const measurementData = [{ * type: "Distance", * id: "c6ea70a3-ddb0-4dd0-87c8-bd2491936428", * points: [[0, 1000], [5000, 1000]], * layoutName: "Model", * }]; * viewer.setMeasurements(measurementData); * ``` */setMeasurements(e){e.forEach((e=>{var t;const r=e.layoutName||DXFLoader.MODEL_LAYOUT_NAME;null==(t=this.getLayoutInfo(r).measurementData)||t.push(e)}));const t=this.getActiveLayoutInfo();this.measurementManager||(this.measurementManager=new MeasurementManager2(this));const r=this.measurementManager;t.measurementData&&r.setMeasurementsData(t.measurementData)} /** * Selects a measurement by id * @internal */selectMeasurement(e){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.selectMeasurementById(e)} /** * Unselects a measurement by id * @internal */unselectMeasurement(){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.unselectMeasurement()} /** * Removes a measurement */removeMeasurement(e){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.removeMeasurementById(e)}setMeasurementsVisibility(e){this.measurementManager||(this.measurementManager=new MeasurementManager2(this));this.measurementManager.setMeasurementsVisibility(e)} /** * Clears all measurement results */clearMeasurements(){var e;null==(e=this.measurementManager)||e.clearMeasurements()} /** markup start **/ /** * Activates markup feature * @param type MarkupType * @example * ``` typescript * viewer.activateMarkup(MarkupType.Arrow); * ``` */activateMarkup(e){this.markupManager||(this.markupManager=new MarkupManager2(this)),this.markupManager.isMarkupActive()||this.markupManager.activate(),this.markupManager.setDrawType(e),this.clearSelection()} /** * Deactivates markup */deactivateMarkup(){this.markupManager&&this.markupManager.deactivate()} /** * Gets active markup type */getActiveMarkupType(){var e;return null==(e=this.markupManager)?void 0:e.getActiveMarkupType()} /** * Set markup stroke color * @internal */setMarkupLineColor(e){var t;null==(t=this.markupManager)||t.setLineColor(e)} /** * @internal */getMarkupLineColor(){var e;return null==(e=this.markupManager)?void 0:e.getLineColor()} /** * Set markup fill color * @internal */setMarkupFillColor(e){var t;null==(t=this.markupManager)||t.setFillColor(e)} /** * @internal */getMarkupFillColor(){var e;return null==(e=this.markupManager)?void 0:e.getFillColor()} /** * Set markup stroke line width * @internal */setMarkupLineWidth(e){var t;null==(t=this.markupManager)||t.setLineWidth(e)} /** * @internal */getMarkupLineWidth(){var e;return null==(e=this.markupManager)?void 0:e.getLineWidth()} /** * Set markup font size * @internal */setMarkupFontSize(e){var t;null==(t=this.markupManager)||t.setFontSize(e)} /** * @internal */getMarkupFontSize(){var e;return null==(e=this.markupManager)?void 0:e.getFontSize()} /** * Gets all markups * @returns DxfMarkupData array */getMarkups(){var e,t;const r=this.getActiveLayoutInfo();r.markupData=(null==(e=this.markupManager)?void 0:e.getMarkupData())||[],r.markupData.forEach((e=>{e.layoutName||(e.layoutName=this.activeLayoutName)}));const i=[];for(const e of Object.values(this.layoutInfos))null==(t=e.markupData)||t.forEach((e=>i.push(e)));return i} /** * Sets markup data. * User can set markup data for all layouts, DxfViewer manages their visibilities * for different layouts. * @example * ``` typescript * const markupData = [{ * type: "ArrowMarkup", * id: "c6ea70a3-ddb0-4dd0-87c8-bd2491936428", * lineWidth: 2, * strokeStyle: "#ff0000", * fillStyle: "#ff000030", * points: [[0, 0], [1000, 1000]], * layoutName: "Model", * }]; * viewer.setMarkups(markupData); * ``` */setMarkups(e){e.forEach((e=>{var t;const r=e.layoutName||DXFLoader.MODEL_LAYOUT_NAME;null==(t=this.getLayoutInfo(r).markupData)||t.push(e)}));const t=this.getActiveLayoutInfo();this.markupManager||(this.markupManager=new MarkupManager2(this));const r=this.markupManager;t.markupData&&r.setMarkupData(t.markupData)}setMarkupsVisibility(e){this.markupManager||(this.markupManager=new MarkupManager2(this));this.markupManager.setMarkupsVisibility(e)} /** * Removes a markup */removeMarkup(e){this.markupManager||(this.markupManager=new MarkupManager2(this));this.markupManager.removeMarkupById(e)} /** * Clears markups */clearMarkups(){var e;null==(e=this.markupManager)||e.clearAll()} /** markup end **/ /** * Adds a hotpoint. */addHotpoint(e){var t;if(this.hasHotpoint(e.hotpointId))return void log.warn(`[DxfViewer] Hotpoint with id '${e.hotpointId}' already exist!`);const r=e.anchorPosition,i=CSS2DObjectUtils.createHotpoint(e.html);i.position.set(r[0]||0,r[1]||0,r[2]||0),i.visible=!1!==e.visible,i.userData.hotpoint=e,i.updateWorldMatrix(!1,!1),this.hotpointRoot||(this.hotpointRoot=new Group,this.hotpointRoot.matrixAutoUpdate=matrixAutoUpdate,this.hotpointRoot.matrixWorldAutoUpdate=!1,this.hotpointRoot.name="HotpointRoot",null==(t=this.scene)||t.add(this.hotpointRoot)),this.hotpointRoot.add(i),this.enableRender()} /** * Removes a hotpoint */removeHotpoint(e){var t,r;const i=(null==(t=this.hotpointRoot)?void 0:t.children)||[];for(let t=0;t{var r;return(null==(r=t.userData.hotpoint)?void 0:r.hotpointId)===e}))} /** * Gets mouse hit result in world coordinate * @example * ``` typescript * document.addEventListener("click", (event) => { * const result = viewer.getHitResult(event); * const loc = result?.location; * if (loc) { * console.log(`Clicked at x: ${loc[0]}, y: ${loc[1]}`); * } * }); * ``` */getHitResult(e){const t=this.viewerContainer;if(!this.camera||!this.raycaster||!this.groundPlane)return;const r=CoordinateConversionUtils.getScreenPointByEvent(e,t),i=CoordinateConversionUtils.screenPoint2NdcPoint(r,this.camera,t);this.raycaster.setFromCamera(i,this.camera),this.raycaster.layers.enable(layerForNonSnapableObjects);const n=this.raycaster.intersectObject(this.groundPlane,!0);if(n&&n.length>0){const e=n[0].point;return{location:[e.x,e.y]}}}activateZoomToRect(){this.zoomToRect||(this.zoomToRect=new ZoomToRectHelper(this)),this.zoomToRect.activate()}deactivateZoomToRect(){var e;null==(e=this.zoomToRect)||e.activate()} /** * draw compare markups */ // private drawCompareMarkups(changes: Record) { // if (!this.dxfCompareManager) { // this.dxfCompareManager = new DxfCompareMarkupManager(this); // } // this.dxfCompareManager.drawCompareDrawable(changes); // } getLayoutByName(e){let t;const r=this.getLayouts();for(const i of r)if(i.layoutName===e){t=i;break}return t} // private getLayoutExtentByName(layoutName: string): THREE.Box3 { // const targeLayout = this.getLayoutByName(layoutName); // if (!targeLayout) { // log.warn(`[DxfViewer] Can't find layout of ${layoutName} !`); // return this.bbox; // } // return this.getLayoutExtent(targeLayout); // } getActiveLayoutInfo(){return this.getLayoutInfo(this.activeLayoutName)}getMsTransformMatrix(e){var t,r;const i=this.loadedModels[e],n=null==(t=i.dxfData)?void 0:t.header;if(!n)return;const s=n.$ANGDIR,a=this.getDxfUnits(i.dxfData),o=null==(r=i.dxfData)?void 0:r.tables.viewPort.viewPorts.filter((e=>"*ACTIVE"===e.name.toLocaleUpperCase()));if(!o)return;const l=new Matrix4,c=DXFLoader.getDcs2WcsMatrix(o[0],s),u=new Vector3(o[0].center.x,o[0].center.y,0).applyMatrix4(c);let h=1;this.units&&a!==this.units&&(h=unitScaleConversion(a,this.units)),u.multiplyScalar(h),l.makeTranslation(u.x,u.y,0),l.multiply((new Matrix4).makeRotationZ(MathUtils.degToRad(o[0].viewTwistAngle))),l.multiply((new Matrix4).makeTranslation(-u.x,-u.y,0)),this.loadedModels[e].msTransformMatrix=l}switchTransformMs(e,t){var r;const i=this.loadedModels[t];if(!i)return void log.warn(`[DxfViewer] Can't find model whose modelId is ${t}`);const n=i.msTransformMatrix;if(tempMatrix4.identity(),!n||n.equals(tempMatrix4))return;const s=null==(r=i.dxfData)?void 0:r.threejsObject,a=null==s?void 0:s.children.find((e=>e.name===DXFLoader.MODEL_LAYOUT_NAME));a&&(e===DXFLoader.MODEL_LAYOUT_NAME?a.applyMatrix4(n):a.applyMatrix4(n.clone().invert()),a.updateMatrixWorld(!0))}getLayoutExtentEx(e){return e.layoutName===DXFLoader.MODEL_LAYOUT_NAME?this.getModelSpaceExtent():this.getLayoutExtent(e)}getModelSpaceExtent(){var e,t;const r=this.loadedModels[this.masterModelId],i=null==(e=r.dxfData)?void 0:e.header,n=new Vector3,s=new Vector3;if(!i)throw new Error(`Header is undefined in ${this.masterModelId}!`);const a=null==(t=r.dxfData)?void 0:t.tables.viewPort.viewPorts;let o=i.$EXTMIN,l=i.$EXTMAX;const c=i.$ANGDIR;if(a&&a.length>0){for(let e=0;e0){const e=s.filter((e=>1===parseInt(e.viewportId)));let t;t=e.length>0?e[0]:s[0];const{centerPoint:r,width_paperSpace:c,height_paperSpace:u}=t,h=DXFLoader.getDcs2WcsMatrix(t,l),p=new Vector3(r.x,r.y,0);return p.applyMatrix4(h),a={x:p.x-c/2,y:p.y-u/2,z:0},o={x:p.x+c/2,y:p.y+u/2,z:0},i.set(a.x,a.y,a.z),n.set(o.x,o.y,o.z),new Box3(i,n)}} // private getLayoutExtent(layout: ILayoutObject): THREE.Box3 | undefined { // const minPoint = new THREE.Vector3(layout.minExtent.x, layout.minExtent.y, layout.minExtent.z); // const maxPoint = new THREE.Vector3(layout.maxExtent.x, layout.maxExtent.y, layout.maxExtent.z); // let units = Units.Unitless; // if (minPoint.equals(maxPoint)) { // //TODO // const model = Object.values(this.loadedModels)[0]; // const header = model.dxfData?.header; // if (!header) { // throw new Error(`Header is undefined in ${model.id}!`); // } // let extMin: IPoint; // let extMax: IPoint; // if (layout.layoutName === DXFLoader.MODEL_LAYOUT_NAME) { // extMin = header["$EXTMIN"] as IPoint; // extMax = header["$EXTMAX"] as IPoint; // } else { // extMin = header["$PEXTMIN"] as IPoint; // extMax = header["$PEXTMAX"] as IPoint; // } // minPoint.set(extMin.x, extMin.y, extMin.z); // maxPoint.set(extMax.x, extMax.y, extMax.z); // units = this.getDxfUnits(model.dxfData); // } // if (minPoint.equals(maxPoint)) { // maxPoint.set(minPoint.x + 1, minPoint.y + 1, minPoint.z); // log.warn(`[DxfViewer] Failed to get the extent of layout ${layout.layoutName} !`); // return undefined; // } else if (minPoint.x > maxPoint.x || minPoint.y > maxPoint.y || minPoint.z > maxPoint.z) { // log.warn(`[DxfViewer] Invalid extention for ${layout.layoutName} \ // min: ${JSON.stringify(minPoint)}, max: ${JSON.stringify(maxPoint)}`); // return undefined; // } // return new THREE.Box3(minPoint, maxPoint); // } /** * Shows objects for given layout, and hide any other layouts. */ showLayoutObjects(e){Object.values(this.loadedModels).forEach((t=>{var r;let i=0,n=0;const s=null==(r=t.dxfData)?void 0:r.threejsObject;null==s||s.children.forEach((t=>{const r=t.name===e;t.visible=r,r?i++:n++})),log.debug(`[DxfViewer] showLayoutObjects('${e}') sets ${i} layout level object(s) to visible and ${n} to hidden for model '${null==s?void 0:s.name}'`)}))}getLayoutViewports(e){var t;const r=this.loadedModels[this.masterModelId],i=e.ownerHandle,n=null==(t=r.dxfData)?void 0:t.layoutViewportsMap[i];return n||[]}setMaterialUniforms(e,t){if(e instanceof ShaderMaterial&&(e.uniforms.u_cameraZoom&&(e.uniforms.u_cameraZoom=DXFLoader.cameraZoomUniform),e.uniforms.u_viewportScale)){1===(null==t?void 0:t.header.$PSLTSCALE)&&(e.uniforms.u_viewportScale=DXFLoader.viewportScaleUniform)}} /** * Checks if a layer is frozen for viewport (VP Freeze) */isLayerFrozenForViewport(e,t,r){if(!e||!t)return!1;const i=e.tables.layer.layers[t];return!!(i&&(1&i.flag)>0)||!(!r||r.length<=0)&&(i&&r.indexOf(i.handle)>=0)}getFilteredViewports(e){const t=this.getLayoutViewports(e);let r=t.filter((e=>"1"!==e.viewportId));return r.length===t.length&&(r=t.filter(((e,t)=>0!==t))),r}generateObjectsByViewport(e,t,r,i=[]){const n=t;if("1"==t.viewportId)return;if(!n.psBBox||!n.msToPsMatrix)throw new Error("The bbox or matrix is invalid in the viewport!");DXFLoader.transformMatrixUniform={value:n.msToPsMatrix},DXFLoader.viewportScaleUniform={value:t.viewHeight/t.height_paperSpace};const s=n.psBBox.clone();s.applyMatrix4(n.msToPsMatrix.clone().invert()),s.min.setZ(-1),s.max.setZ(1);const a=this.getObjectsByBoundingBox(s);if(0===a.length)return;const o=n.psBBox.min,l=n.psBBox.max,c=new Box2(new Vector2(o.x,o.y),new Vector2(l.x,l.y)),u=SectionUtils.generateSectionPlanesByBox(c),h=[],p=e=>(h[e.id]||(h[e.id]=e.clone(),this.setMaterialUniforms(h[e.id],r),SectionUtils.setMaterialSection(h[e.id],u)),h[e.id]),d=[...i,...t.frozenLayerHandles||[]];let m;if(e!==DXFLoader.MODEL_LAYOUT_NAME){const e=t;e.associatedLeafObjectSet||(e.associatedLeafObjectSet=new Set),m=e.associatedLeafObjectSet}const f=new Group;f.name=t.viewportId;const g=null==r?void 0:r.layersAndThreejsObjects,_=[];if(a.forEach((t=>{const i=t.clone();i.traverse((t=>{if(t.material&&t.geometry){const i=t.userData.layerName;if(this.isLayerFrozenForViewport(r,i,d))return void _.push(t);!1!==t.userData.layerVisible&&(t.visible=!0),t.material=(e=>{if(Array.isArray(e)){const t=[];return e.forEach((e=>{const r=p(e);t.push(r)})),t}return p(e)})(t.material),null==m||m.add(t),g&&g[i]?g[i].push(t):log.warn(`[DxfViewer] Failed to find object for modelId '${this.masterModelId}', layer '${i}', layout '${e}'`)}})),i.userData.boundingBox&&(i.visible=!0,delete i.userData.boundingBox),f.add(i)})),m&&0===m.size)return;ObjectUtils.removeEmptyObjectsFromRemovingObjects(_,f);const y=null==r?void 0:r.threejsObject;let T=null==y?void 0:y.children.find((t=>t.name===e));T||(T=new Group,ObjectUtils.setSharedVariablesOfObject(T),T.name=e,null==y||y.add(T)),T.add(f),f.applyMatrix4(n.msToPsMatrix),f.updateMatrixWorld(!0),f.traverse((e=>{ObjectUtils.setSharedVariablesOfObject(e),this.addSpatialFilterSection(e,r,!0)}))} // TODO:Uses cache later findSpatialFilter(e,t){const r=t.objects.SPATIAL_FILTER;if(!r)return;let i;for(const t of r)if(t.handle===e){i=t;break}return i}getAnyMaterial(e){let t,r=e;if(r.material)return Array.isArray(r.material)?r.material[0]:r.material;for(let r=0;r0),n=s.clipIntersection),t&&n!==i.clipPolylines[0].bReversed)return void log.warn("[DxfViewer] Material cannot set clipIntersection to different values at the same time. clipIntersection needs to be set to true here!");n=i.clipPolylines[0].bReversed;const a=this.generateSectionsBySpatialFilter(i,e.matrixWorld);if(a){const r=e=>{let t=0;return e.clippingPlanes&&(t=e.clippingPlanes.length),t+a.length>DXFLoader.maxFragmentUniforms},i=new Set,s=e=>{i.has(e.id)||(i.add(e.id),r(e)||SectionUtils.setMaterialSection(e,a,t,n))};e.traverse((e=>{const t=e.material;Array.isArray(t)?t.forEach((e=>{s(e)})):t&&s(t)}))}}}getObjectsByBoundingBox(e){var t;const r=[];if(e.isEmpty())return log.warn("[DxfViewer] bbox is empty !"),r;const i=null==(t=this.loadedModels[this.masterModelId].dxfData)?void 0:t.threejsObject,n=null==i?void 0:i.children.find((e=>e.name===DXFLoader.MODEL_LAYOUT_NAME));return n&&n.children.forEach((t=>{(t=>{const i=SceneUtils.getBoundingBox(t,!1);e.intersectsBox(i)&&r.push(t)})(t)})),r}getDxfUnits(e){if(e||Object.keys(this.loadedModels).length>0&&(e=this.loadedModels[this.masterModelId].dxfData),!e)return"Unitless"/* Unitless */;const t=null==e?void 0:e.header;if(!t)return log.warn("DxfData or its header is undefined!"),"Unitless"/* Unitless */;const r=t.$INSUNITS;return DXFLoader.getDxfUnits(r)}generateSectionsBySpatialFilter(e,t){const r=e.clipPolylines[0];if(r.bConcave)return void log.warn("[DxfViewer] clipPolyline.bConcave = true is not supported yet in spatialFilter !");tempMatrix4.copy(t),e.localMatrix&&tempMatrix4.multiply(e.localMatrix);const i=r.polyline,n=[];i.forEach((e=>{const t=e.clone().applyMatrix4(tempMatrix4);n.push(new Vector2(t.x,t.y))}));const s=ShapeUtils.isClockWise(n),a=!s&&!r.bReversed||s&&r.bReversed;return SectionUtils.generateSectionPlanesByPoints(n,a)} /** * Add newly added object to scene. * Also, usually(but not always) we should regenerate sky and go to home view * @param object */addLoadedModelToScene(e,t,r){if(!this.scene)return;let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,log.warn(`[DxfViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={dxfData:r},e.matrixAutoUpdate=matrixAutoUpdate,e.updateMatrix(),CommonUtils.printMemory("Before merge"),t.merge&&(DXFLoader.merge(r),CommonUtils.printMemory("After merged")),e.updateMatrixWorld(!0),DXFLoader.computeLineDistances(e),this.getMsTransformMatrix(i),this.masterModelId===i?this.activateLayout(DXFLoader.MODEL_LAYOUT_NAME):this.handleOverlayDxf(i),log.debug(r),this.scene.add(e);const n=null==r?void 0:r.threejsObject.children.find((e=>e.name===DXFLoader.MODEL_LAYOUT_NAME));n&&this.setLayoutHidableObjectArray(n),this.updateGroundPlane(),this.raycastableObjects=void 0,this.masterModelId===i?this.goToHomeView():this.enableRender()} // resize render area // if no width or height passed in, use window.innerWidth/window.innerHeight instead resize(e,t){const r=this.camera;if(r){const i=e||window.innerWidth,n=t||window.innerHeight,s=i/n;r.left=-this.height*s/2,r.right=this.height*s/2,r.top=this.height/2,r.bottom=-this.height/2,r.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(i,n),this.css2dRenderer&&(this.css2dRenderer.setSize(i,n),this.css2dRenderer.domElement.style.width="0",this.css2dRenderer.domElement.style.height="0"),this.overlayRender&&this.overlayRender.setSize(i,n)}this.enableRender()} /** * @internal */getRaycaster(){return this.raycaster} /** * Gets raycast-able objects. * Raycast-able objects should be visible objects in scene. */getRaycastableObjects(){var e;if(this.raycastableObjects)return this.raycastableObjects;const t=Date.now(),r=[];for(const t of Object.values(this.loadedModels)){const i=null==(e=t.dxfData)?void 0:e.threejsObject,n=i&&i.children.find((e=>e.name===this.activeLayoutName));n&&n.traverseVisible((e=>{ObjectUtils.isLeafObject(e)&&r.push(e)}))}return this.groundPlane&&r.push(this.groundPlane),this.raycastableObjects=r,log.debug(`[DxfViewer] getRaycastableObjects() finds ${r.length} objects`),log.debug(`[DxfViewer] getRaycastableObjects() costs ${(Date.now()-t)/1e3} s`),r} // TODO: Removes it later // /** // * Determines whether a point is filtered out by the viewport // */ // private isFilteredByViewport(point: THREE.Vector3) { // if (this.activeLayoutName.length === 0 || this.activeLayoutName === DXFLoader.MODEL_LAYOUT_NAME) { // return false; // } // const layout = this.getLayoutByName(this.activeLayoutName); // if (!layout) { // return false; // } // const isFiltered = (box: THREE.Box3) => { // return point.x < box.min.x || point.x > box.max.x || point.y < box.min.y || point.y > box.max.y ? true : false; // }; // const viewports = this.getFilteredViewports(layout); // for (let i = 0, l = viewports.length; i < l; i++) { // const dxfViewport = viewports[i] as IEntity as DxfEntity; // if (!isFiltered(dxfViewport.psBBox as THREE.Box3)) { // return false; // } // } // return viewports.length > 0; // } /** * Gets the corresponding viewport by judging that the point is in the viewport */ getViewportByPoint(e){if(0===this.activeLayoutName.length||this.activeLayoutName===DXFLoader.MODEL_LAYOUT_NAME)return;const t=this.getLayoutByName(this.activeLayoutName);if(!t)return;const r=this.getFilteredViewports(t);for(let t=0,n=r.length;ti.max.x||e.yi.max.y))return n}var i} /** * Gets raycast-able objects by mouseEvent. * @internal */getRaycastableObjectsByMouse(e){let t=[];const r=this.viewerContainer;if(!(this.raycaster&&this.camera&&this.scene&&e))return t;const i=Date.now(),n=CoordinateConversionUtils.getScreenPointByEvent(e,r),s=CoordinateConversionUtils.screenPoint2NdcPoint(n,this.camera,r);if(this.raycaster.setFromCamera(s,this.camera),log.debug("[DxfViewer] Space coordinates corresponding to the mouse position:",this.raycaster.ray.origin),this.activeLayoutName===DXFLoader.MODEL_LAYOUT_NAME)t=this.getRaycastableObjects(),log.debug("[DxfViewer] getRaycastableObjectsByMouse() from modelSpace");else{const e=new WeakSet,r=this.getLayoutByName(this.activeLayoutName);if(r){const i=r.directAssociatedLeafObjectSet;i&&i.forEach((r=>{r.visible&&(t.push(r),e.add(r))}))}const i=this.getViewportByPoint(this.raycaster.ray.origin);if(i&&i.associatedLeafObjectSet){this.getRaycastableObjects().forEach((r=>{var n;(null==(n=i.associatedLeafObjectSet)?void 0:n.has(r))&&!e.has(r)&&r.visible&&(t.push(r),e.add(r))})),log.debug("[DxfViewer] getRaycastableObjectsByMouse() from inside of viewport:",i.viewportId)}else log.debug("[DxfViewer] getRaycastableObjectsByMouse() from out of viewport");this.groundPlane&&t.push(this.groundPlane)}return log.debug(`[DxfViewer] getRaycastableObjectsByMouse() costs ${(Date.now()-i)/1e3} s`),t} /** * Gets intersections by given mouse location. * If no MouseEvent is passed in, use (0, 0) as the raycaster's origin. */getIntersections(e){this.raycaster&&this.raycaster.layers.enable(layerForNonSnapableObjects);const t=this.getRaycastableObjectsByMouse(e);return this.raycaster&&this.raycaster.intersectObjects(t,!0)||[]} /** * Handles mouse click event */handleMouseClick(e){var t;if(!this.enableSelection)return;if(this.measurementManager&&this.measurementManager.isMeasurementActive()||this.markupManager&&this.markupManager.isMarkupActive())return;const r=this.getIntersections(e);if(r.length>0){const e=e=>CommonUtils.vectorToString(e);log.debug(`[DxfViewer] Clicked at: ${e(r[0].point)}`)}const i=r.find((e=>{const t=e.object;return t.visible&&!1!==t.userData.selectable}));let n=i&&i.object||void 0;if(r.length>0&&r[0].point){const e=null==(t=this.overlayRender)?void 0:t.getDrawablesByPosition(r[0].point,this.raycaster);if(e&&e.length>0)return this.clearSelection(),e[0].selected=!0,void(this.selectedObject=e[0])}this.selectedObject&&this.clearSelection(),n&&this.selectedObject&&this.selectedObject.id===n.id&&(n=void 0),n?this.selectObject(n):this.clearSelection()} /** * Select or unselect an object. */selectObject(e,t){if(!this.enableSelection)return;const r=e=>{if(e.children.length>0&&e.children.forEach((e=>r(e))),e instanceof Mesh||e instanceof Line){const r=MaterialUtils.clonedHighlightMaterials(e,{depthTest:t});r&&(e.userData.originalMaterial=e.material,e.material=r)}},i=e=>{if(e.children.length>0&&e.children.forEach((e=>i(e))),(e instanceof Mesh||e instanceof Line)&&e.userData.originalMaterial){const t=e.material;e.material=e.userData.originalMaterial,delete e.userData.originalMaterial,Array.isArray(t)?t.forEach((e=>e.dispose())):t instanceof Material&&t.dispose()}};this.selectedObject&&(i(this.selectedObject),this.selectedObject=void 0),e&&(r(e),this.selectedObject=e,e.userData.dxfEntity?log.info("[DxfViewer] Selected entity:",e.userData.dxfEntity):log.info("[DxfViewer] Selected object:",e)),this.enableRender()} /** * Clears the current selection */clearSelection(){this.selectedObject&&this.selectedObject instanceof Drawable?this.selectedObject.selected=!1:this.selectObject(),this.selectedObject=void 0} /** * Makes camera fly to objects */flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new Box3;e.forEach((e=>{const r=SceneUtils.getBoundingBox(e);r.isEmpty()||t.union(r)})),this.zoomToBBox(t)} /** * Make camera fly to an object */flyToObject(e){this.flyToObjects([e])} /** * Flies to current selected object if any */flyToSelectedObject(){if(!this.selectedObject)return;let e=this.selectedObject;(e instanceof InstancedMesh&&e.userData.clonedMesh||e instanceof Mesh&&MergeUtils.isMergedMesh(e)&&e.userData.clonedMesh)&&(e=e.userData.clonedMesh),this.flyToObject(e)} /** * Flies to a random object (by alt + r). * It is useful when either the data is wrong or there is bug in program, * then we cannot see anything in the scene! */flyToRandomObject(){var e;const t=this.scene,r=[];for(const t of Object.values(this.loadedModels)){const i=null==(e=t.dxfData)?void 0:e.threejsObject;i&&r.push(i.id)}const i=r.length;if(i<=0)return;const n=r[Math.floor(Math.random()*i)];if(!t.getObjectByProperty("id",n.toString()))return;const s=[];if(t.traverseVisible((e=>{(e instanceof Mesh||e instanceof Line)&&!["SKYBOX","GROUND_GRID","GRASS_GROUND","BIM_VIEWER_BOX_HELPER"].includes(e.name)&&s.push(e.id)})),s.length<1)return;const a=Math.floor(Math.random()*s.length),o=t.getObjectById(s[a]);o&&(log.info(`[DxfViewer] Flying to random object: ${o.name}, type: ${o.type}`),this.selectObject(o,void 0),this.flyToObject(o))} /** * Makes camera fly to target position with given lookAt position * @param position camera's target position * @param lookAt camera's new lookAt position * @param targetCameraZoom camera's target zoom value */flyTo(e,t,r,i){const n=this.camera,s=this.controls;if(!n||!s)return;if(r&&(r=this.checkAndGetLimitedCameraZoom(r)),e.equals(t))return void log.error("[DxfViewer] Camera position and lookAt cannot be the same!");if(!CommonUtils.isVectorValid(e)||!CommonUtils.isVectorValid(t))return void log.error("[DxfViewer] Invalid position or lookAt!",e,t);const a=e.distanceTo(t);an.far&&(e=e.clone().sub(t).normalize().multiplyScalar(.9*n.far),log.warn("[DxfViewer] Camera could be too far to see the object!"));const o=(e,t,r)=>{n.lookAt(t),n.position.set(e.x,e.y,e.z),r&&Number.isFinite(r)&&(n.zoom=r,n.updateProjectionMatrix(),this.updateHidableObjectsVisibility()),s.target.set(t.x,t.y,t.z),s.update()};if(!1===i)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void o(e,t,r);const l=n.position.clone(),c=s.target.clone(),u=n.zoom,h=300,p=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let i=Date.now()-p;i>h&&(i=h);const n=(e,t,r)=>{const i=e.x+(t.x-e.x)*r,n=e.y+(t.y-e.y)*r,s=e.z+(t.z-e.z)*r;return new Vector3(i,n,s)},s=n(l,e,i/h),a=n(c,t,i/h);let d;r&&(d=u+(r-u)*i/h),o(s,a,d),i>=h&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)} /** * Moves camera to target position * @param position 2d position */goTo(e,t,r){const i=this.camera,n=this.controls;if(!i||!n)return;const s=new Vector3(e.x,e.y,i.position.z),a=new Vector3(e.x,e.y,n.target.z);this.flyTo(s,a,t,r)} /** * Moves camera to home view */goToHomeView(){const e=this.getActiveLayoutInfo();e.bbox?this.zoomToBBox(e.bbox):log.error(`[DxfViewer] Failed to find extent for ${this.activeLayoutName}`)} /** * Zooms to specific bounding box * @internal */zoomToBBox(e){const t=this.camera;if(!t)return;const r=e.max.x-e.min.x,i=e.max.y-e.min.y,n=t.right-t.left,s=t.top-t.bottom;let a=Math.min(n/r,s/i);a/=1.1;const o=new Vector3;e.getCenter(o),o.z=0;const l=o.clone().setZ(this.CAMERA_Z_POSITION);l.equals(o)||this.flyTo(l,o,a,!1)} /** * Zooms to a compare change * @param id a chang data id */zoomToCompareChange(e){if(this.changes){const t=this.changes[e];if(!t)return;const r=t.box;r&&this.zoomToBBox(r.clone().expandByScalar(1.2))}} /** * Gets compare changes */getCompareChanges(){return this.changes} /** * Sets background color * @param r value between 0-1 * @param g value between 0-1 * @param b value between 0-1 * @example * ``` typescript * // Sets background to gray * viewer.setBackgroundColor(0.5, 0.5, 0.5); * ``` */setBackgroundColor(e,t,r){this.scene&&(this.scene.background=new Color(e,t,r),this.enableRender())} /** * Sets spinner visibility */setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))} /** * Increases job count, and show spinner accordingly */increaseJobCount(){this.setSpinnerVisibility(++this.jobCount>0)} /** * Decreases job count, and hide spinner accordingly */decreaseJobCount(){this.setSpinnerVisibility(--this.jobCount>0)} /** * Gets LayoutInfo by layoutName. It creats LayoutInfo if doesn't exist. */getLayoutInfo(e){return this.layoutInfos[e]||(this.layoutInfos[e]={measurementData:[],markupData:[]}),this.layoutInfos[e]} /** * Creates a ground plane which is much bigger than bbox. */updateGroundPlane(){if(!this.scene)return;const e=this.getActiveLayoutInfo();if(!e.bbox)return;const t=e.bbox.clone();CommonUtils.expandBoxByScale(t,3);const r=t.min,i=t.max,n=i.x-r.x+i.y-r.y+i.z-r.z;CommonUtils.expandBoxByMinSize(t,n);const s=[],a=(e,t,r)=>{s.push(new Vector3(e,t,r))},o=t.getSize(new Vector3),l=t.getCenter(new Vector3);if(a(-o.x/2,-o.y/2,0),a(o.x/2,-o.y/2,0),a(o.x/2,o.y/2,0),a(-o.x/2,o.y/2,0),this.groundPlane)this.groundPlane.geometry.setFromPoints(s),this.groundPlane.geometry.computeBoundingSphere(),this.groundPlane.geometry.computeBoundingBox(),this.groundPlane.geometry.computeVertexNormals();else{const e=new BufferGeometry;e.setFromPoints(s),e.setIndex([0,3,2,0,2,1]),e.computeVertexNormals();const t=new MeshBasicMaterial({color:"#888",transparent:!0,opacity:0,side:DoubleSide});this.groundPlane=new Mesh(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=GROUND_PLANE_RENDER_ORDER,this.scene.add(this.groundPlane)}this.groundPlane.updateMatrixWorld()} /** * Compute bounding box of loaded models * @internal */computeBoundingBox(){var e;const t=new Box3;for(const r of Object.values(this.loadedModels)){const i=null==(e=r.dxfData)?void 0:e.threejsObject;if(i){const e=SceneUtils.getBoundingBox(i,!1);e.isEmpty()||t.union(e)}}return t.min.z=0,t.max.z=0,log.info(`[BimViewer] computeBoundingBox(), BBox's max: ${t.max.toArray()}, min: ${t.min.toArray()}`),t} /** * Checks if an expected zoom value is valid, and adjust its value if necessary. */checkAndGetLimitedCameraZoom(e){if(!e)return 1;let t=e;return e{e.visible&&e.children.forEach((e=>{e.userData.boundingBox&&(tempFrustum.intersectsBox(e.userData.boundingBox)?e.visible=!0:e.visible=!1)}))}))}log.debug(`[DxfViewer] setVisibilityByCameraFrustum cost: ${(Date.now()-t)/1e3}s`)}getVisiblePixelSize(e){const t=6.5*MathUtils.smoothstep(e,1e4,3e4)+.5;return log.debug("[DxfViewer] visiblePixelSize:",t),t}setLayoutHidableObjectArray(e){const t=this.camera;if(!this.enableHideVisuallySmallObjects||!t)return;const r=Date.now(),i=e.name;this.sortedHidableObjects[i]||(this.sortedHidableObjects[i]=[]);const n=this.sortedHidableObjects[i],s=t.zoom;this.lastCameraZoom=s;const a=e=>{if(!this.isCompareMode())return!1;if(!e.material)return!1;let t;return t=e.material instanceof ShaderMaterial?e.material.uniforms.u_color.value:e.material.color,t.equals(new Color(DxfCompare.ENTITY_COLOR_ADDED))||t.equals(new Color(DxfCompare.ENTITY_COLOR_REMOVED))};let o=1;e.traverse((e=>{if(this.isCompareMode()&&a(e))return;if(!ObjectUtils.isLeafObject(e))return;const t=e.geometry;t.boundingBox||t.computeBoundingBox();const r=t.boundingBox.clone();if(!r||!CommonUtils.isBoxValid(r))return;r.applyMatrix4(e.matrixWorld),r.getSize(tempVec33);const i=Math.max(tempVec33.x,tempVec33.y),s=o/i;s<1/0?n.push({visibleMinZoom:s,object:e}):e instanceof Points?n.push({visibleMinZoom:o,object:e}):log.warn("[DxfViewer] The size of bbox is 0 ! ",e)})),o=this.getVisiblePixelSize(n.length);let l=0;n.forEach((e=>{const 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)),log.debug(`[DxfViewer] setLayoutHidableObjectArray cost: ${(Date.now()-r)/1e3}s, ${l} objects changed to hidden`)} // TODO: use for debugging statObjects(e){const t=this.sortedHidableObjects[this.activeLayoutName],r=t.length,i={};let n=0;t.forEach((t=>{const r=t.object;if(r.geometry&&r.material){n++;const r=(t=>{let r=0,i=t;for(;i&&(r++,i!==e);)i=i.parent;return r})(t.object);i[r]||(i[r]=0),i[r]++}}));let s=0;e.traverse((e=>{const t=e;t.geometry&&t.material&&s++})),log.info(`[DxfViewer] hidableObjects count:${r}, real count:${n}, layout count: ${s}, level:`,i),log.info("[DxfViewer] scene:",this.scene)} /** * Updates hidable objects' visibility once camera.zoom changed. */updateHidableObjectsVisibility(){const e=this.camera;if(!e)return;const t=Date.now(),r=e.zoom;if(Math.abs(r-this.lastCameraZoom)<1e-5)return;if(this.updateRaycasterThreshold(),this.updateCameraZoomUniform(r),this.raycastableObjects=void 0,!this.sortedHidableObjects[this.activeLayoutName])return;const i=this.sortedHidableObjects[this.activeLayoutName];if(0===i.length)return;const n=r>this.lastCameraZoom,s=Math.min(r,this.lastCameraZoom),a=Math.max(r,this.lastCameraZoom),o=[];let l=0;for(let e=0;ea)break;i[e].object.visible=n,n&&o.push(i[e].object),l++}}this.lastCameraZoom=r,log.debug(`[DxfViewer] updateHidableObjectsVisibility cost: ${(Date.now()-t)/1e3}s, ${l}(out of ${i.length}) objects changed to ${n?"visible":"hidden"}`),this.groundPlane&&o.push(this.groundPlane),this.raycastableObjects=o} /** * Updates raycaster threshold to a proper value, so user can easily pick points and lines */updateRaycasterThreshold(){const e=this.camera;if(!e||!this.raycaster)return;const t=12/e.zoom,r=this.raycaster.params;r.Line?r.Line.threshold=t:r.Line={threshold:t},r.Points?r.Points.threshold=t:r.Points={threshold:t}} /** * Updates camera zoom value for shader materials, which are created in DXFLoader */updateCameraZoomUniform(e){DXFLoader.cameraZoomUniform.value=e}},import_lodash10=__toESM(require_lodash(),1),ViewerMode=(e=>(e[e.Browser=0]="Browser",e[e.Browserless=1]="Browserless",e[e.Headless=2]="Headless",e))(ViewerMode||{}),SimplifiedBimViewer=class{ // used to store transparent for isolated objects // eslint-disable-next-line constructor(e,t,r){if(this.scene=this.initScene(),this.selectedObject=void 0, // eslint-disable-line this.loadedModels={},this.viewerMode=0/* Browser */,this.raycaster=new Raycaster,this.savedMaterialsForOpacity=[],this.jobCount=0, // job count in order to identify if it should show spinner this.bbox=new Box3, // Outline material cannot have a opacity in this scenario, // there maybe bug in threejs so it doesn't display correctly! this.outlineMaterial=new LineBasicMaterial({color:1118481}),this.outlineRoot=new Group, // used to store outlines for isolated objects this.transparentObjectIds=[], /** * Applies options and add object to scene. */ this.applyOptionsAndAddToScene=(e,t,r)=>{if(log.info(`[SimplifiedBimViewer] '${e}' is loaded, adding to scene...`),r.matrix&&16===r.matrix.length){const e=new Matrix4;e.elements=r.matrix,t.applyMatrix4(e)}else{const e=r.position||[0,0,0],i=r.rotation||[0,0,0],n=r.scale||[1,1,1];t.position.set(e[0],e[1],e[2]),t.rotation.set(i[0]*Math.PI/180,i[1]*Math.PI/180,i[2]*Math.PI/180),t.scale.set(n[0],n[1],n[2])}this.addLoadedModelToScene(t,r)},this.getMeshes=e=>{const t=[];return e instanceof Mesh?t.push(e):e.traverseVisible((e=>{e instanceof Mesh&&t.push(e)})),t},this.containerOrCanvas=e,t&&(this.viewerMode=t),this.glContext=r,1/* Browserless */===this.viewerMode&&(e instanceof HTMLDivElement||!r))throw new Error("[SimplifiedBimViewer] Parameters don't match Browserless viewerMode !");this.increaseJobCount(),this.init(),this.decreaseJobCount(),log.info("[SimplifiedBimViewer] Initialized"),this.animate()} /** * Initialize everything it needs */init(){this.initRenderer(),this.initCamera(),this.initControls(),this.initLights(),this.initPointerEvents(),this.scene.add(this.outlineRoot)}initScene(){const e=new Scene;return e.background=new Color(7112861),e.matrixAutoUpdate=!0,e}isBrowserlessMode(){return 1/* Browserless */===this.viewerMode}isBrowserMode(){return 0/* Browser */===this.viewerMode}initRenderer(){const e={antialias:!0,preserveDrawingBuffer:!0},t=this.isBrowserlessMode();t&&Object.assign(e,{canvas:this.containerOrCanvas,context:this.glContext});const r=new WebGLRenderer(e);if(t){const e=this.containerOrCanvas.width,t=this.containerOrCanvas.height;log.info(`[SimplifiedBimViewer] Render target size: ${e} x ${t}`),this.renderTarget=new WebGLRenderTarget(e,t,{minFilter:LinearFilter,magFilter:NearestFilter,format:RGBAFormat,type:UnsignedByteType}),r.setRenderTarget(this.renderTarget)}else{const e=this.containerOrCanvas.clientWidth,t=this.containerOrCanvas.clientHeight;this.containerOrCanvas.append(r.domElement),r.setPixelRatio(window.devicePixelRatio),r.setSize(e,t)}r.outputEncoding=sRGBEncoding,r.toneMappingExposure=1,r.physicallyCorrectLights=!0,r.setClearColor(11119017,1),r.shadowMap.enabled=!0,r.shadowMap.type=PCFSoftShadowMap,this.renderer=r,t||(this.pmremGenerator=new PMREMGenerator(r),this.pmremGenerator.compileEquirectangularShader(),this.setEnvironmentFromDataArray())}initCamera(){if(!this.scene)return;const e=this.containerOrCanvas.clientWidth||this.containerOrCanvas.width||0,t=this.containerOrCanvas.clientHeight||this.containerOrCanvas.height||0;let r=1;e&&t&&(r=e/t),this.camera=new PerspectiveCamera(68,r,.05,1e4),this.camera.position.set(10,10,10),this.camera.lookAt(0,0,0),this.scene.add(this.camera)}initControls(){if(!this.renderer)return;const e=this.camera;if(!e)return;const t=new OrbitControls(e,this.renderer.domElement);t.enableDamping=!0,t.dampingFactor=.5,t.enabled=!0,t.keyPanSpeed=10,t.keys={LEFT:"KeyD", // model goes left, camera goes right UP:"KeyE", // model goes up, camera goes down RIGHT:"KeyA", // model goes right, camera goes left BOTTOM:"KeyQ"},t.update(),this.controls=t,t.addEventListener("change",(()=>{!this.isBrowserMode()&&this.renderer&&this.renderer.render(this.scene,e)}))}initLights(){if(!this.scene)return;const e=16777215,t=new DirectionalLight(e,.3);t.position.set(-2,2,4);const r=new AmbientLight(3158064),i=new HemisphereLight(e,14540253,3);i.position.set(0,300,0),this.scene.add(t),this.scene.add(r),this.scene.add(i)} /** * Initialize mouse/pointer events */initPointerEvents(){if(!this.renderer||!this.camera||!this.controls)return;let e=!1,t=!1,r=-1,i=-1;this.renderer.domElement.addEventListener("pointerdown",(t=>{r=t.x,i=t.y,e=!1})),this.renderer.domElement.addEventListener("pointermove",(t=>{if(r>=0&&i>=0){const n=5;(Math.abs(t.x-r)>n||Math.abs(t.y-i)>n)&&(e=!0)}})),this.renderer.domElement.addEventListener("pointerup",(()=>{t&&setTimeout((()=>{t=!1}),200),r=-1,i=-1})),this.renderer.domElement.addEventListener("dblclick",(r=>{t=!0,e||(this.handleMouseClick(r),this.flyToSelectedObject())}))}animate(){var e;this.isBrowserMode()&&requestAnimationFrame(this.animate.bind(this)),this.controls&&this.controls.update(),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.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,r){return __async(this,null,(function*(){const i=new LoadingHelper,n=yield i.loadLocalModel(e,t.src,r);return n?(this.applyOptionsAndAddToScene(e,n,t),Promise.resolve()):Promise.reject()}))}loadModel(e,t){return __async(this,null,(function*(){this.increaseJobCount();const r=new LoadingHelper,i=yield r.loadModel(e.src,e.fileFormat,t);return i?(this.applyOptionsAndAddToScene(e.src,i,e),Promise.resolve()):Promise.reject()}))}parseGltf(e,t,r,i){this.increaseJobCount(),(new LoadingHelper).parseGltf(e,t.src,(e=>{this.applyOptionsAndAddToScene(t.src,e,t),r&&r(e)}),(e=>{i&&i(e)}))} /** * Add newly added object to scene. * Also, usually(but not always) we should regenerate sky and go to home view * @param object */addLoadedModelToScene(e,t){if(!this.scene)return;e.updateMatrix(),this.scene.add(e);const r=new BoxHelper(e);r.name="BIM_VIEWER_BOX_HELPER",r.visible=!1,r.material&&(r.material=void 0,r.layers.set(layerForUnselectableObjects));let i=t.modelId||t.src;if(this.loadedModels[i]){let e=1;for(;this.loadedModels[`${i}_${e}`];)e++;i=`${i}_${e}`,log.warn(`[BimViewer] Model '${i}' is loaded more than once!`)}this.loadedModels[i]={id:e.id,bbox:r},this.computeBoundingBox();const n=Object.values(this.loadedModels).map((e=>e.id));(!n||n.length<=1)&&(this.tryAdjustCameraNearAndFar(),this.goToHomeView()),this.scene.add(r),t.edges&&ObjectUtils.addOutlines(e),this.decreaseJobCount(),log.info(`[SimplifiedBimViewer] Added '${t.src}' to scene`)} /** * We won't set a opacity or highlight directly, because that way will lose model's original opacity or color value * @param isAdd is add or remove the opacity we added * @param opacity */addOrRemoveObjectOpacity(e=!0,t=.3,r,i){if(this.savedMaterialsForOpacity||(this.savedMaterialsForOpacity=[]),!this.scene)return;const n=this.scene,s=[];Object.keys(this.loadedModels).forEach((a=>{const o=this.loadedModels[a];if(e){this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0&&ObjectUtils.revertObjectOpacityById(n,o.id,this.savedMaterialsForOpacity);const e=ObjectUtils.setObjectOpacityById(n,o.id,t,r,i);s.push(...e)}else this.savedMaterialsForOpacity&&ObjectUtils.revertObjectOpacityById(n,o.id,this.savedMaterialsForOpacity)})),this.savedMaterialsForOpacity=e?s:[]}hasTransparentObject(){return!!(this.savedMaterialsForOpacity&&this.savedMaterialsForOpacity.length>0)} /** * Gets intersections by given mouse location. * If no MouseEvent is passed in, use (0, 0) as the raycaster's origin. */getIntersections(e){if(!this.raycaster||!this.camera||!this.scene)return[];let t=new Vector2;e&&(t=CoordinateConversionUtils.getScreenPointByEvent(e,this.containerOrCanvas));const r=CoordinateConversionUtils.screenPoint2NdcPoint(t,this.camera,this.containerOrCanvas);this.raycaster.setFromCamera(r,this.camera);const i=[];return Object.values(this.loadedModels).forEach((e=>{const t=this.scene&&this.scene.getObjectById(e.id);t&&t.visible&&i.push(t)})),this.raycaster.intersectObjects(i,!0)||[]} /** * Handles mouse click event */handleMouseClick(e){const t=this.getIntersections(e).find((e=>{const t=e.object;return t.visible&&(!1!==t.userData.selectable||t instanceof Mesh)}));let r=t&&t.object||void 0;r&&this.selectedObject&&this.selectedObject.id===r.id&&(r=void 0),r?this.selectObject(r):this.clearSelection()}selectObject(e){if(this.selectedObject){const e=this.selectedObject.userData;if(e.originalMaterial){if(this.selectedObject.material){const e=this.selectedObject.material;Array.isArray(e)?e.forEach((e=>e.dispose())):e instanceof Material&&e.dispose()}this.selectedObject.material=e.originalMaterial,delete e.originalMaterial}this.selectedObject=void 0}if(!this.scene||!e)return;const t=MaterialUtils.clonedHighlightMaterials(e);t&&(this.selectedObject=e,this.selectedObject.userData.originalMaterial=this.selectedObject.material,this.selectedObject.material=t)} /** * Clears the current selection */clearSelection(){this.selectObject()} /** * Make camera fly to objects */flyToObjects(e){if(!e||0===e.length||!this.camera)return;const t=new Vector3,r=new Vector3,i=new Box3;e.forEach((e=>{const t=SceneUtils.getBoundingBox(e);i.union(t)}));const n=new Vector3;this.camera.getWorldDirection(n),Viewer3DUtils.getCameraPositionByBboxAndDirection(i,t,r,this.camera.projectionMatrix,n),this.flyTo(t,r)} /** * Make camera fly to an object */flyToObject(e){this.flyToObjects([e])} /** * Flies to current selected object if any */flyToSelectedObject(){this.selectedObject&&this.flyToObject(this.selectedObject)} /** * Make camera fly to target position with given lookAt position * @param position camera's target position * @param lookAt camera's new lookAt position */flyTo(e,t,r){var i;const n=this.camera,s=this.controls;if(!n||!s)return;const a=e=Array.isArray(e)?new Vector3(e[0],e[1],e[2]):e,o=t=Array.isArray(t)?new Vector3(t[0],t[1],t[2]):t;log.info("[SimplifiedBimViewer] flyTo: ",CommonUtils.vectorToString(a)),n.lookAt(o.x,o.y,o.z),n.position.set(a.x,a.y,a.z),s.target.set(o.x,o.y,o.z),s.update(),this.isBrowserMode()||null==(i=this.renderer)||i.render(this.scene,n),r&&r()}goToHomeView(){var e;const t=new Vector3,r=new Vector3,i=new Vector3,n=new Vector3;this.bbox.getSize(n),this.bbox.getCenter(i);const s=(n.x+n.y+n.z)/3*1.5,a=new Vector3(i.x+s,i.y+s/1.5,i.z+s),o=i.clone().sub(a);Viewer3DUtils.getCameraPositionByBboxAndDirection(this.bbox,t,r,null==(e=this.camera)?void 0:e.projectionMatrix,o),t.equals(r)||this.flyTo(t,r)} /** * Sets environment for the scene. * @param data Uint16Array of the hdr content */setEnvironmentFromDataArray(e){TextureUtils.createEnvTextureFromDataArray(this.pmremGenerator,e).then((e=>{this.scene.environment=e,this.isBrowserMode()||this.animate()}))} /** * Tries to adjust camera near/far clip plane according to objects size in scene. * Do this to avoid the case when objects are too small or big thus clipped! */tryAdjustCameraNearAndFar(){const e=this.camera;if(!this.scene||!e)return;const t=this.bbox,r=e.near,i=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,c=5*o;if(r>l||iCommonUtils.numberToString(e);log.info(`[SimplifiedBimViewer] BBox's longest side is: ${t(o)}`),r>l&&(log.warn(`[SimplifiedBimViewer] camera.near(${t(r)}) shouldn't bigger than ${t(l)}, will change it!`),e.near=l),i0?void 0:this.transparentObjectIds,r=this.transparentObjectIds.length>0?this.transparentObjectIds:void 0,i=new MeshBasicMaterial({color:16777215,transparent:!0,opacity:.1});Object.keys(this.loadedModels).forEach((e=>{const n=this.loadedModels[e];ObjectUtils.applyMaterialToObjectById(this.scene,n.id,i,r,t)})),this.outlineRoot.clear();let n=[];if(e.forEach((e=>{const t=e.modelId;let r=t?this.scene.getObjectById(this.loadedModels[t].id):this.scene;r||(log.warn(`[BimViewer] The ModelId of ${t} has no corresponding model.`),r=this.scene),r.traverse((t=>{if((0,import_lodash10.includes)(e.id,(0,import_lodash10.get)(t.userData,"UniqueId"))){const e=this.getMeshes(t);n=n.concat(e)}}))})),n.length>0){n.forEach((e=>{var t;const r=ObjectUtils.createOutline(e.geometry,e.matrix,this.outlineMaterial);(null==(t=e.parent)?void 0:t.matrixWorld)&&r.applyMatrix4(e.parent.matrixWorld),this.outlineRoot.add(r)}));const e=n.map((e=>e.id));Object.keys(this.loadedModels).forEach((t=>{const r=this.loadedModels[t];ObjectUtils.revertAppliedMaterialToObjectById(this.scene,r.id,e)})),this.transparentObjectIds=e,this.flyToObjects(n)}else log.warn(`[BimViewer] No object found with uniqueIds: ${e.map((e=>e.id))}`);this.isBrowserMode()||this.animate()} /** * Increases job count, and show spinner accordingly */increaseJobCount(){++this.jobCount} /** * Decreases job count, and hide spinner accordingly */decreaseJobCount(){--this.jobCount} /** * Compute bounding box of loaded models */computeBoundingBox(){const e=new Box3;return Object.values(this.loadedModels).forEach((t=>{if(t.bbox){t.bbox.geometry.computeBoundingBox();const r=t.bbox.geometry.boundingBox;r&&!r.isEmpty()&&e.union(r)}})),this.bbox=e,e}getContext(){var e;return null==(e=this.renderer)?void 0:e.getContext()}getCameraDirection(){var e;const t=new Vector3;return null==(e=this.camera)||e.getWorldDirection(t),{x:t.x,y:t.y,z:t.z}}},CancelablePromise=class{constructor(e){this.isCanceled=!1;const t=new Promise(((e,t)=>{this.cancelReject=t}));this.promise=Promise.race([t,e])}cancel(){this.cancelReject&&this.cancelReject({type:"cancel"})}},import_lodash11=__toESM(require_lodash(),1),BaseVRMesh=class extends Group{constructor(e,t,r=10){super(),this.images=e,this.thumbnailImages=t,this.size=r,this.textureLoader=new TextureLoader,this.mesh=new Mesh} /** * Fades in by changing its opacity */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));const r=1/(e/10);this.visible=!0,this.clearFading(),this.renderOrder+=1,this.fadingInInterval=setInterval((()=>{let e=1;const i=this.getMaterials();this.materialEquals(t,i)||(t=i),t.length>0&&(e=Math.min(t[0].opacity+r,1),t.forEach((t=>t.opacity=e))),e>=1&&this.clearFading()}),10)}materialEquals(e,t){return import_lodash11.default.isEqualWith(e,t,((e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return e.id===t.id}))} /** * Fades out by changing its opacity. * In the meantime, will dynamically change its scale. We do this because there is * bug in threejs that when two or more pictures are transparent, it may render improperly! */fadeOut(e=1e3){const t=this.getMaterials(),r=1/(e/10),i=1/(e/10);this.clearFading(),this.scale.set(2,2,2),this.fadingOutInterval=setInterval((()=>{const e=this.scale.x+i;this.scale.set(e,e,e);let n=0;t.length>0&&(n=Math.max(t[0].opacity-r,0),t.forEach((e=>e.opacity=n))),(n<=0||e>=3)&&this.clearFading()}),10)} /** * Clears existing fadeIn/fadeOut intervals if any */clearFading(){const 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);const t=[];return Array.isArray(e.material)?t.push(...e.material):e.material&&t.push(e.material),t} // eslint-disable-next-line @typescript-eslint/no-empty-function create(){}createThumbnailMesh(e){return __async(this,null,(function*(){if(!this.thumbnailImages||6!=this.thumbnailImages.length)return;this.thumbnailMesh=new Mesh(new BoxGeometry(e,e,e)),this.thumbnailMesh.geometry.scale(1,1,-1);const t=(yield this.loadTexturesAsync(this.thumbnailImages)).map((e=>new MeshBasicMaterial({map:e,side:FrontSide,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 __async(this,null,(function*(){const 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 Mesh?this.destroyMesh(this.mesh):this.mesh.traverse((e=>{e instanceof Mesh&&this.destroyMesh(e)})),this.mesh=void 0)}},VRCube=class extends BaseVRMesh{constructor(e,t,r=20){if(super(e,t,r),6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`)}create(){return __async(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return __async(this,null,(function*(){const e=this.mesh;e.geometry=new BoxGeometry(this.size,this.size,this.size),e.geometry.scale(1,1,-1);const t=(yield this.loadTexturesAsync(this.images)).map((e=>new MeshBasicMaterial({map:e,side:FrontSide,transparent:!0})));e.material=t,this.add(e),this.thumbnailMesh&&(this.destroyMesh(this.thumbnailMesh),this.thumbnailMesh=void 0,this.thumbnailImages=void 0)}))}},VRCube24Faces=class extends BaseVRMesh{ /** * @param images must be in order of right, left, up/top, down/bottom, front, back * And the 4 images for each side, must be in order of 1_1, 1_2, 2_1, 2_2. */ constructor(e,t,r=20){if(super(e,t,r),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 __async(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return __async(this,null,(function*(){var e;this.mesh=new Group,this.mesh.scale.set(1,1,-1);const t=(yield this.loadTexturesAsync(this.images)).map((e=>new MeshBasicMaterial({map:e,side:BackSide,transparent:!0})));if(24!==t.length)throw new Error(`[VRCube24Faces] Wrong number of materials! Expected 24, got ${t.length}`);const r=this.createPlaneOfAFace(t.slice(0,4));r.rotateOnAxis(new Vector3(0,1,0),-Math.PI/2),r.position.set(this.size/2,0,0);const i=this.createPlaneOfAFace(t.slice(4,8));i.rotateOnAxis(new Vector3(0,1,0),Math.PI/2),i.position.set(-this.size/2,0,0);const n=this.createPlaneOfAFace(t.slice(8,12));n.rotateOnAxis(new Vector3(1,0,0),-Math.PI/2),n.rotateOnAxis(new Vector3(0,0,1),Math.PI),n.rotateOnAxis(new Vector3(1,0,0),Math.PI),n.position.set(0,this.size/2,0);const s=this.createPlaneOfAFace(t.slice(12,16));s.rotateOnAxis(new Vector3(1,0,0),Math.PI/2),s.rotateOnAxis(new Vector3(0,0,1),Math.PI),s.rotateOnAxis(new Vector3(1,0,0),Math.PI),s.position.set(0,-this.size/2,0);const a=this.createPlaneOfAFace(t.slice(16,20));a.rotateOnAxis(new Vector3(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;const r=new Group,i=new PlaneGeometry(this.subPlaneWidth0,this.subPlaneWidth0),n=new PlaneGeometry(this.subPlaneWidth1,this.subPlaneWidth0),s=new PlaneGeometry(this.subPlaneWidth0,this.subPlaneWidth1),a=new PlaneGeometry(this.subPlaneWidth1,this.subPlaneWidth1),o=new Mesh(i,e[0]),l=new Mesh(n,e[1]),c=new Mesh(s,e[2]),u=new Mesh(a,e[3]);return o.position.set(this.subPlaneWidth1/2,this.subPlaneWidth1/2,0),l.position.set(-this.subPlaneWidth0/2,this.subPlaneWidth1/2,0),c.position.set(this.subPlaneWidth1/2,-this.subPlaneWidth0/2,0),u.position.set(-this.subPlaneWidth0/2,-this.subPlaneWidth0/2,0),o.geometry.scale(-1,1,1),l.geometry.scale(-1,1,1),c.geometry.scale(-1,1,1),u.geometry.scale(-1,1,1),r.add(o,l,c,u),null==(t=this.mesh)||t.add(r),r}},VRSphere=class extends BaseVRMesh{constructor(e,t,r=10){if(super(e,t,r),1!==e.length)throw new Error(`[VRSphere] Wrong number of images! Expected 1, got ${e.length}`)}create(){return __async(this,null,(function*(){yield this.createThumbnailMesh(this.size+.1),this.thumbnailMesh?this.createMesh():yield this.createMesh()}))}createMesh(){return __async(this,null,(function*(){var e;const t=this.mesh;t.geometry=new SphereGeometry(this.size,100,100),t.geometry.scale(-1,1,1);const r=(yield this.loadTexturesAsync(this.images)).map((e=>new MeshBasicMaterial({map:e,side:FrontSide,transparent:!0})));t.material=r[0],this.add(t),this.thumbnailMesh&&(this.destroyMesh(this.thumbnailMesh),this.remove(this.thumbnailMesh),null==(e=this.thumbnailMesh)||e.clear(),this.thumbnailMesh=void 0)}))}},VRViewer=class extends BaseViewer{constructor(e,t){super(e), /** * @internal */ this.minFov=50, /** * @internal */ this.maxFov=95,this.raycaster=new Raycaster,this.autoRotate=!0, // store events so that they can be removed before destroy // eslint-disable-next-line this.events=[],this.lastFrameExecuteTime=Date.now(), // used to limit max fps this.maxFps=60, // used to limit max fps. < 0 means no limitation this.isMousePressing=!1, // to indicate pointer is down but not up yet this.settings=defaultSettings,this.jobCount=0, // job count in order to identify if it should show spinner this.viewpoints=[],this.previousViewpointId="",this.previousPanoramaId="",this.activeViewpointId="",this.activePanoramaId="",this.viewpointAssetsMap=new Map,this.loadingPanos=[],this.onResize=()=>{var e;const t=null==(e=this.renderer)?void 0:e.domElement;t&&t.parentElement&&this.resize(t.parentElement.clientWidth,t.parentElement.clientHeight)},this.onMouseWheel=e=>{const 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=defaultSettings,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)} /** * Initialize everything it needs */init(){const 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(){const e=new Scene;e.background=new Color(16777215),e.matrixAutoUpdate=!0,this.scene=e}initRenderer(){var e,t;this.renderer=new WebGLRenderer({antialias:!1,preserveDrawingBuffer:!1}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.css2dRenderer=new CSS2DRenderer,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 PerspectiveCamera(75, // fov should be bigger for VR mode this.width/this.height,this.settings.camera.near,this.settings.camera.far),this.scene.add(this.camera))}initControls(){if(!this.renderer||!this.camera)return;const e=this.camera,t=this.viewerCfg,r=new VRControls2(e,this.renderer.domElement,!0);r.enabled=!0,r.autoRotate=this.autoRotate,r.autoRotateSpeed=t.autoRotateSpeed||-2,r.enablePan=!1,r.enableZoom=!1,r.enableRotate=!0,r.rotateSpeed=.3,r.minPolarAngle=.05*Math.PI,r.maxPolarAngle=.95*Math.PI,r.listenToKeyEvents(document.body),r.update(),this.controls=r,this.controlsHelper=new ControlsHelper(e,r),this.controls.controlsHelper=this.controlsHelper,this.autoRotate&&this.controlsHelper.delayAutoRotate(),this.controlsHelper.automaticallyAdjustCameraPosition=!1,this.controls.addEventListener("end",(()=>{this.handleDragEnd&&this.handleDragEnd()}));const i=new Vector3(0,0,0),n=new Vector3(10,0,0);this.setCameraPositionAndDirection(i,n)}onKeyDown(e){return t=>{var r,i;const n=e.camera,s=e.controls;n&&s&&("ArrowLeft"!==t.code&&"ArrowRight"!==t.code&&"ArrowUp"!==t.code&&"ArrowDown"!==t.code||null==(r=this.controlsHelper)||r.startToRotate(t),null==(i=this.controlsHelper)||i.delayAutoRotate())}}initLights(){if(!this.scene)return;const e=new DirectionalLight(16777215,.3);e.position.set(-2,2,4),this.scene.add(e)}initEvents(){const e=this.renderer,t=this.camera;if(!e||!t)return;let r=!1,i=-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;i=t.x,n=t.y,r=!1,this.isMousePressing=!0,this.autoRotate&&(null==(s=this.controlsHelper)||s.delayAutoRotate()),t.button===MOUSE.LEFT&&t.target instanceof HTMLCanvasElement&&(e.domElement.style.cursor="move")})),this.addEvent(window,"pointermove",(e=>{if(i>=0&&n>=0){const t=5;(Math.abs(e.x-i)>t||Math.abs(e.y-n)>t)&&(r=!0)}})),this.addEvent(window,"pointerup",(i=>{var n,s;if(this.isMousePressing=!1,this.autoRotate&&(null==(n=this.controlsHelper)||n.delayAutoRotate()),e.domElement.style.cursor="auto",!r&&i.button===MOUSE.LEFT)if(i.target&&i.target instanceof HTMLDivElement){const e=CSS2DObjectUtils.tryFindObjectId(i.target);if(e){const t=null==(s=this.scene)?void 0:s.getObjectById(e);if(t){const e=t.userData.hotpoint;e&&(log.info("[VRViewer] Clicked on hotpoint: ",e.hotpointId||e),this.onHotpointClicked&&this.onHotpointClicked(e))}}}else{const e=this.getIntersection(i);if(e){const r=e=>CommonUtils.vectorToString(e),i=e.point,n=i.clone().sub(t.position).normalize();log.info(`[VRViewer] Clicked at: ${r(i)},\n Camera position: ${r(t.position)},\n Target direction: ${r(n)}`)}}}))}initSpinner(){var e;const t=document.createElement("div");t.classList.add("spinner");const r=document.createElement("div");r.classList.add(ICON_FONT_CLASS,"icon-loading"),t.append(r),null==(e=this.widgetContainer)||e.appendChild(t),this.spinner=t,this.setSpinnerVisibility(this.jobCount>0)}initOthers(){this.controls&&this.renderer&&this.camera&&(this.renderer.domElement.style.outlineWidth="0")}initAxes(){var e;const t=document.createElement("div");t.classList.add("axesRenderer");const r=new CoordinateAxesViewport(t,this.camera);return null==(e=this.widgetContainer)||e.append(t),r}initToolbar(){const e=this.viewerCfg;return new Toolbar2(this,__spreadValues(__spreadValues({},DEFAULT_VRVIEWER_TOOLBAR_CONFIG),e.toolbarMenuConfig),[["SceneClear"/* SceneClear */]])}initBottomBar(){return new BottomBar(this)}animate(){var e,t,r,i;if(requestAnimationFrame(this.animate.bind(this)),this.maxFps>0){const e=Date.now()-this.lastFrameExecuteTime;if(e<1e3/this.maxFps)return;if(this.lastFrameExecuteTime=Date.now(),this.autoRotate){const t=this.controlsHelper;t&&t.autoRotateRemainingTime>0&&!this.isMousePressing&&(t.autoRotateRemainingTime-=e,t.autoRotateRemainingTime<=0&&this.controls&&t.startAutoRotate())}}null==(e=this.controls)||e.update(),this.scene&&this.camera&&(null==(t=this.renderer)||t.render(this.scene,this.camera),null==(r=this.css2dRenderer)||r.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;const r=e.panoramas;for(let e=r.length-1;e>=0;--e){const i=r[e];i.box.destroy(),null==(t=this.scene)||t.remove(i.box)}})),this.loadingPanos=[],this.viewpointAssetsMap.clear(),this.activePanoramaId="",this.activePanoramaId="",this.previousViewpointId="",this.previousPanoramaId=""}destroy(){var e,t,r,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.spinner)||t.remove(),null==(r=this.axes)||r.dispose(),null==(i=this.toolbar)||i.destroy(),super.destroy()}updateFov(e){var t;const r=this.camera;if(!r)return;const i=this.minFov,n=this.maxFov,s=e=>{let t=r.fov+e;t=Math.min(t,n),t=Math.max(t,i),r.fov!==t&&(r.fov=t,r.updateProjectionMatrix())},a=e/20;for(let e=0;e<20;++e)setTimeout((()=>s(a)),5*e);this.autoRotate&&(null==(t=this.controlsHelper)||t.delayAutoRotate())}setMinAndMaxFov(e,t){const r=this.controls;r&&(this.minFov=e,this.maxFov=t,r.minFov=e,r.maxFov=t)} // resize render area // if no width or height passed in, use window.innerWidth/window.innerHeight instead resize(e,t){var r,i,n;const s=this.camera;s&&(this.width=e||window.innerWidth,this.height=t||window.innerHeight,s.aspect=this.width/this.height,s.updateProjectionMatrix(),null==(r=this.renderer)||r.setSize(this.width,this.height),null==(i=this.css2dRenderer)||i.setSize(this.width,this.height),null==(n=this.css3dRenderer)||n.setSize(this.width,this.height))} /** * Enables/Disables orbit controls to automatically rotate. */enableAutoRotate(e){this.controls&&(this.autoRotate=e,this.controls.autoRotate=e)} /** * Sets orbit controls' rotate speed. * It requires (3600 / speed / fps) seconds for a around * When speed is 1, 60fps, it requires 60s; * When speed is 2, 60fps, it requires 30s; */setAutoRotateSpeed(e=1){this.controls&&(this.controls.autoRotateSpeed=e)} /** * Sets camera fov. Usually 45 - 90. */setCameraFov(e=75){const t=this.camera;t&&(t.fov=e,t.updateProjectionMatrix())} /** * Sets spinner visibility */setSpinnerVisibility(e){this.spinner&&(e?this.spinner.classList.remove("hidden"):this.spinner.classList.add("hidden"))} /** * Calls addEventListener of a node. * This makes sure to removeEventListener properly * @param node window, dom element, etc. * @param type 'change', 'keydown', etc. * @param func event callback */ // eslint-disable-next-line addEvent(e,t,r){e.addEventListener(t,r),this.events.push({node:e,type:t,func:r})} /** * Sets camera position and direction. */setCameraPositionAndDirection(e,t,r){const i=this.camera,n=this.controls;if(!i||!n)return;let s,a;s=t?Array.isArray(t)?new Vector3(t[0],t[1],t[2]):new Vector3(t.x,t.y,t.z):n.target.clone().sub(i.position),s.normalize(),a=Array.isArray(e)?new Vector3(e[0],e[1],e[2]):new Vector3(e.x,e.y,e.z);const o=a.clone().addScaledVector(s,.01);this.fianlCameraPosition=a,this.finalCameraTarget=o;const l=(e,t)=>{i.lookAt(t),i.position.set(e.x,e.y,e.z),n.target.set(t.x,t.y,t.z),n.update()};if(!1===r)return this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),void l(a,o);const c=i.position.clone(),u=n.target.clone(),h=500,p=Date.now();this.cameraUpdateInterval&&clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=setInterval((()=>{let e=Date.now()-p;e>h&&(e=h);const t=(e,t,r)=>{const i=e.x+(t.x-e.x)*r,n=e.y+(t.y-e.y)*r,s=e.z+(t.z-e.z)*r;return new Vector3(i,n,s)},r=t(c,a,e/h),i=t(u,o,e/h);l(r,i),e>=h&&(clearInterval(this.cameraUpdateInterval),this.cameraUpdateInterval=void 0)}),10)} /** * Gets camera position and direction. */getCameraPositionAndDirection(){const e=this.camera;if(!e)return;const t=e.position,r=new Vector3;return e.getWorldDirection(r),{position:{x:t.x,y:t.y,z:t.z},direction:{x:r.x,y:r.y,z:r.z}}} /** * Gets camera's fov value. */getCameraFov(){const e=this.camera;if(e)return e.fov} /** * Sets a group of viewpoints */setViewpoints(e){this.handleCameraUpdateInterval(),this.viewpointAssetsMap.size>0&&(this.viewpointAssetsMap.forEach((e=>{const t=e.panoramas,r=e.css2dObjects;t.forEach((e=>{var t;e.box.destroy(),null==(t=this.scene)||t.remove(e.box)})),r.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} // /** // * Adds a viewpoint // */ // addViewpoint(viewpoint: VRViewpoint) { // this.viewpoints.push(viewpoint); // } // /** // * Checks if a viewpoint with specific id is added // */ // hasViewpoint(viewpointId: string) { // return !!this.viewpoints.find((vp) => vp.id === viewpointId); // } /** * Adds a panorama to a viewpoint */ addPanorama(e,t){const r=this.viewpoints.find((t=>t.id===e));if(!r)throw new Error(`[VRViewer] Failed to find viewpoint by id '${e}'`);r.panoramas||(r.panoramas=[]),r.panoramas.push(t)} /** * Checks if a panorama exists in a viewpoint */findPanorama(e,t){const r=this.viewpoints.find((t=>t.id===e));if(r&&r.panoramas)return r.panoramas.find((e=>e.id===t))} /** * Sets hotpoints visibility for one or all viewpoints * @param visible true or false * @param viewpointId target viewpointId. Will apply to all if no viewpointId is specified * @param hotpointIds target hotpointIds. Will apply to all if no hotpointIds is specified */setHotpointsVisibility(e,t="",r=[]){if(!this.viewpoints)return;const i=t=>{var i;const n=this.viewpointAssetsMap.get(t.id),s=(null==n?void 0:n.css2dObjects)||[];null==(i=t.hotpoints)||i.forEach((i=>{if(r&&r.length>0){if(-1===r.findIndex((e=>e===i.hotpointId)))return;if(i.visible=e,this.activeViewpointId===t.id){const t=s.find((e=>e.userData.hotpoint.hotpointId===i.hotpointId));t&&(t.visible=e)}}else i.visible=e,this.activeViewpointId===t.id&&s.forEach((t=>t.visible=e))}))};if(t){const e=this.viewpoints.find((e=>e.id===t));e&&i(e)}else this.viewpoints.forEach((e=>i(e)))} /** * Adds hotpoint to active viewpoint */addHotpoints(e){if(!this.activeViewpointId||!e)return;const t=this.viewpoints.find((e=>e.id===this.activeViewpointId)),r=this.viewpointAssetsMap.get(this.activeViewpointId);t&&r&&(t.hotpoints||(t.hotpoints=[]),e.forEach((e=>{var i,n;if(-1!==(null==(i=t.hotpoints)?void 0:i.findIndex((t=>t.hotpointId===e.hotpointId))))return void log.warn(`[VRViewer] Duplicated hotpointId: ${e.hotpointId}`);const s=t.position||[0,0,0],a=e.anchorPosition,o=CSS2DObjectUtils.createHotpoint(e.html),l=new Vector3(a[0],a[1],a[2]),c=new Vector3(s[0],s[1],s[2]);this.relocateAnchorIfTooCloseToCamera(o,l,c),o.visible=!1!==e.visible,o.userData.hotpoint=e,r.css2dObjects.push(o),null==(n=this.scene)||n.add(o),t.hotpoints.push(e)})))} /** * Removes hotpoint of active viewpoint */removeHotpoints(e){if(!this.activeViewpointId||!e)return;const t=this.viewpoints.find((e=>e.id===this.activeViewpointId)),r=this.viewpointAssetsMap.get(this.activeViewpointId);t&&r&&e.forEach((e=>{var i,n;if(t.hotpoints)for(let r=t.hotpoints.length-1;r>=0;--r)e===t.hotpoints[r].hotpointId&&t.hotpoints.splice(r,1);for(let t=r.css2dObjects.length-1;t>=0;--t){const s=r.css2dObjects[t];e===(null==(i=s.userData.hotpoint)?void 0:i.hotpointId)&&(r.css2dObjects.splice(t,1),null==(n=this.scene)||n.remove(s))}}))} /** * @deprecated use activatePanoramaById() instead */activeViewpointById(e,t,r,i){this.activatePanoramaById(e,"",!0,t,r,i)} /** * Activates a panorama by viewpointId and panoramaId */activatePanoramaById(e,t,r=!0,i,n,s){if(e===this.activeViewpointId&&t===this.activePanoramaId)return;const a=this.viewpoints.find((t=>t.id===e));a&&this.activatePanorama(a,t,r,i,n,s)}removeCachedPanoramas(){this.viewpointAssetsMap.forEach(((e,t)=>{var r;const i=e.panoramas;for(let e=i.length-1;e>=0;--e){const n=i[e];if(t===this.activeViewpointId&&n.id===this.activePanoramaId)return;if(t===this.previousViewpointId&&n.id===this.previousPanoramaId)return;n.box.destroy(),null==(r=this.scene)||r.remove(n.box),i.splice(e,1)}}))} /** * Unlimits controls and show all assets. This is useful for debugging. */unlimitControlsAndShowAssets(e=!1){this.controls&&(this.controls.enablePan=!0,this.controls.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,r){const i=this.camera;if(!i)return log.error("[VRViewer] Camera is not initialized"),void e.position.set(t.x,t.y,t.z);let n;const s=Math.abs(t.distanceTo(r));if(s{const i=e.panoramas.find((e=>e.id===t)),n=null==i?void 0:i.box;n&&(r?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}))},h=()=>{var t;const n=new Vector3(0,0,0),s=new Vector3(1,0,0),a=null==(t=this.getCameraPositionAndDirection())?void 0:t.direction;a&&s.set(a.x,a.y,a.z);const o=e.position;if(o&&3===o.length&&n.set(o[0],o[1],o[2]),r){const t=e.initialDirection;t&&3===t.length&&s.set(t[0],t[1],t[2])}this.setCameraPositionAndDirection(n,s,i)};!t&&(null==(a=e.panoramas)?void 0:a.length)>0&&(t=e.panoramas[0].id||""),this.handleCameraUpdateInterval();const p=this.viewpointAssetsMap.get(this.activeViewpointId),d=this.viewpointAssetsMap.get(e.id);if(this.activeViewpointId&&p&&(this.activeViewpointId!==e.id&&u(p,!1),c(p,this.activePanoramaId,!1)),d){if(d.panoramas.find((e=>e.id===t)))return c(d,t,!0),this.activeViewpointId!==e.id&&u(d,!0),this.activeViewpointId!==e.id&&h(),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((r=>r.viewpointId===e.id&&r.panoramaId===t)))return void log.warn(`[VRViewer] Panorama with viewpointId=${e.id} and panoramaId=${t} is being created`);const r=new CancelablePromise(this.createBoxByImageOrImages(e,t));this.loadingPanos.push({viewpointId:e.id,panoramaId:t,creationPromise:r});const i=yield r.promise;this.loadingPanos=this.loadingPanos.filter((r=>r.viewpointId!==e.id||r.panoramaId!==t));const s=e.position;s&&3===s.length&&i.position.set(s[0],s[1],s[2]),this.activeViewpointId===e.id&&this.activePanoramaId===t?(this.fadeIn(i),null==(o=this.scene)||o.add(i),h()):(i.visible=!1,null==(l=this.scene)||l.add(i));const a={id:t,box:i},c=this.viewpointAssetsMap.get(e.id);if(c)c.panoramas.push(a),u(c,!0);else{const r=[];e.hotpoints&&e.hotpoints.forEach((n=>{const s=n.anchorPosition,a=CSS2DObjectUtils.createHotpoint(n.html);a.visible=!1!==n.visible,a.userData.hotpoint=n;const o=new Vector3(s[0],s[1],s[2]);this.relocateAnchorIfTooCloseToCamera(a,o,i.position),this.activeViewpointId===e.id&&this.activePanoramaId===t||(a.visible=!1),r.push(a)}));const n={panoramas:[a],css2dObjects:r};this.viewpointAssetsMap.set(e.id,n),r.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)}}))} /** * Creates box by 1, 6 or 24 images. * For 6/24 images, caller must make sure the order is correct. The reason is that, * the url can be really complex that we cannot order them here! * 6 images must be in order of: right, left, top, bottom, front, back * 24 images must be in order of: 4 for right(1_1, 1_2, 2_1, 2_2), 4 for left, top, bottom, front, back... */createBoxByImageOrImages(e,t){var r;let i=e.imageOrImages,n=e.thumbnailImages;if((null==(r=e.panoramas)?void 0:r.length)>0){let r=this.findPanorama(e.id,t);r||(r=e.panoramas[0],log.warn(`[VRViewer] Failed to find panorama by id '${t}', will use the first one`)),i=r.images,n=r.thumbnails}if(!i)throw new Error("[VRViewer] Invalid images!");if(Array.isArray(i)||(i=[i]),1===i.length)return this.createBoxByImage(i,n);if(6===i.length)return this.createBoxBy6Images(i,n);if(24===i.length)return this.createBoxBy24Images(i,n);throw new Error(`[VRViewer] Wrong number of images! Expected 1/6/24, got ${i.length}`)} /** * Creates a box with proper size and texture from an image. */createBoxByImage(e,t){return __async(this,null,(function*(){const r=new VRSphere(e,t);return yield r.create(),r}))} /** * Creates a box with proper size and texture from 6 images. */createBoxBy6Images(e,t){return __async(this,null,(function*(){if(6!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 6, got ${e.length}`);const r=new VRCube(e,t);return yield r.create(),r}))}createBoxBy24Images(e,t){return __async(this,null,(function*(){if(24!==e.length)throw new Error(`[VRCube] Wrong number of images! Expected 24, got ${e.length}`);const r=new VRCube24Faces(e,t);return yield r.create(),r}))} /** * Gets intersection by given mouse location. * If no MouseEvent is passed in, use (0, 0) as the raycaster's origin. */getIntersection(e){if(!this.camera||!this.scene)return;const t=this.viewpointAssetsMap.get(this.activeViewpointId);if(!t)return;const r=t.panoramas.find((e=>e.id===this.activePanoramaId));if(!r)return;const i=r.box,n=this.viewerContainer;let s=new Vector2;e&&(s=CoordinateConversionUtils.getScreenPointByEvent(e,n));const a=CoordinateConversionUtils.screenPoint2NdcPoint(s,this.camera,n);this.raycaster.setFromCamera(a,this.camera);const o=[i],l=this.raycaster.intersectObjects(o,!0)||[];if(l.length>0){return l.find((e=>{const t=e.object;return t.visible&&t instanceof Mesh}))}}fadeIn(e,t=500){e.fadeIn(t)} // TODO: there is a bug that when durationInMs is large, we can see z-fighting and white faces! don't know how to fix it yet! fadeOut(e,t=1e3){e.fadeOut(t)}handleCameraUpdateInterval(){if(this.cameraUpdateInterval){clearInterval(this.cameraUpdateInterval);const e=this.fianlCameraPosition,t=this.finalCameraTarget;e&&t&&this.controls&&this.camera&&(this.camera.lookAt(t),this.camera.position.set(e.x,e.y,e.z),this.controls.target.set(t.x,t.y,t.z),this.controls.update()),this.cameraUpdateInterval=void 0}this.fianlCameraPosition=void 0,this.finalCameraTarget=void 0} /** * Gets mouse hit result */getHitResult(e){const t={location:null};if(!this.camera)return t;const r=this.getIntersection(e);return t.location=r?{x:r.point.x,y:r.point.y,z:r.point.z}:null,t} /** * Makes camera look to specific position * @param position target position to look to */lookToPosition(e){var t;if(!this.camera)return;this.handleCameraUpdateInterval();const r=new Vector3(e[0],e[1],e[2]).clone().sub(this.camera.position);null==(t=this.controlsHelper)||t.lookTo(r)}},DEFAULT_MARKUP_TOOLBAR_CONFIG={Arrow:{menuName:"Toolbar.markupArrow",icon:{default:"icon-arrow",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("ArrowMarkup"/* Arrow */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},Rect:{defaultActive:!0,menuName:"Toolbar.markupRect",icon:{default:"icon-rectangle",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("RectMarkup"/* Rectangle */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Arrow"/* MarkupArrow */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},CloudRect:{menuName:"Toolbar.markupCloudRect",icon:{default:"icon-cloud",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("CloudRectMarkup"/* CloudLineRectangle */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"Arrow"/* MarkupArrow */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},PolyLine:{menuName:"Toolbar.markupPolyLine",icon:{default:"icon-polyline",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("PolylineMarkup"/* PolyLine */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"Arrow"/* MarkupArrow */,"CloudRect"/* MarkupCloudRect */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},CloudLine:{menuName:"Toolbar.markupCloudLine",icon:{default:"icon-cloud-segment",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("CloudLineMarkup"/* CloudLine */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"Arrow"/* MarkupArrow */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},Ellipse:{menuName:"Toolbar.markupEllipse",icon:{default:"icon-oval",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("EllipseMarkup"/* Ellipse */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Arrow"/* MarkupArrow */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},Circle:{menuName:"Toolbar.markupCircle",icon:{default:"icon-round",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("CircleMarkup"/* Circle */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Arrow"/* MarkupArrow */,"Dot"/* MarkupDot */,"Text"/* MarkupText */,"X"/* MarkupX */]},Dot:{menuName:"Toolbar.markupDot",icon:{default:"icon-round",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("DotMarkup"/* Dot */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Arrow"/* MarkupArrow */,"Circle"/* MarkupCircle */,"Text"/* MarkupText */,"X"/* MarkupX */]},X:{menuName:"Toolbar.markupX",icon:{default:"icon-cross",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("XMarkup"/* X */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Arrow"/* MarkupArrow */,"Text"/* MarkupText */]},Text:{menuName:"Toolbar.markupText",icon:{default:"icon-text",iconFont:"iconfont"},type:4/* Switch */,onActive:e=>{e.activateMarkup("TextMarkup"/* Text */)},onDeactive(e){e.deactivateMarkup()},mutexIds:["Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */,"CloudLine"/* MarkupCloudLine */,"Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */,"Dot"/* MarkupDot */,"Arrow"/* MarkupArrow */,"X"/* MarkupX */]},StrokeStyle:{menuName:"Toolbar.markupStroke",icon:{default:"icon-color-red",iconFont:"iconfont"},type:1/* ClickEvent */,onClick:(e,t,r)=>{const i=r.target.parentElement,n=null==i?void 0:i.firstElementChild,s=document.createElement("input");s.setAttribute("type","color"),s.style.position="absolute",s.style.left=`${r.x}px`,s.style.top=`${r.y}px`,s.value=e.getMarkupLineColor(),s.click(),s.oninput=t=>{const r=t.target.value;e.setMarkupLineColor(r),n.style.color=r}}},LineWidth:{menuName:"Toolbar.markupLineWidth",icon:{default:"icon-line",iconFont:"iconfont"}, // icon: { default: "" }, customElement(e,r,i){const n=document.createElement("div");return n.id=r,n.classList.add("toolbar-menu"),i.children&&n.classList.add("toolbar-parent-menu"),n.title=t(i.menuName),n.innerHTML+=`${n.title}`,n},type:3/* SubMenu */,children:{LineWidth2:{defaultActive:!0,icon:{default:"icon-line-2",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(2)},type:4/* Switch */,menuName:"Toolbar.markupLineWidth2",mutexIds:["LineWidth5"/* MarkupLineWidth5 */,"LineWidth10"/* MarkupLineWidth10 */]},LineWidth5:{icon:{default:"icon-line-3",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(3)},type:4/* Switch */,menuName:"Toolbar.markupLineWidth5",mutexIds:["LineWidth2"/* MarkupLineWidth2 */,"LineWidth10"/* MarkupLineWidth10 */]},LineWidth10:{icon:{default:"icon-line-4",iconFont:"iconfont"},onClick:e=>{e.setMarkupLineWidth(4)},type:4/* Switch */,menuName:"Toolbar.markupLineWidth10",mutexIds:["LineWidth2"/* MarkupLineWidth2 */,"LineWidth5"/* MarkupLineWidth5 */]}}},FontSize:{menuName:"Toolbar.markupFontSize",icon:{default:"icon-font"},customElement(e,r,i){const n=document.createElement("div");return n.id=r,n.classList.add("toolbar-menu"),i.children&&n.classList.add("toolbar-parent-menu"),n.title=t(i.menuName),n.innerHTML+=`${n.title}`,n},type:3/* SubMenu */,children:{FontSize14:{icon:{default:"icon-font14",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(14)},type:4/* Switch */,menuName:"",mutexIds:["FontSize18"/* MarkupFontSize18 */,"FontSize24"/* MarkupFontSize24 */]},FontSize18:{defaultActive:!0,icon:{default:"icon-font18",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(18)},type:4/* Switch */,menuName:"",mutexIds:["FontSize14"/* MarkupFontSize14 */,"FontSize24"/* MarkupFontSize24 */]},FontSize24:{icon:{default:"icon-font24",iconFont:"iconfont"},onClick:e=>{e.setMarkupFontSize(24)},type:4/* Switch */,menuName:"",mutexIds:["FontSize14"/* MarkupFontSize14 */,"FontSize18"/* MarkupFontSize18 */]}}},MarkupClear:{icon:{default:"icon-eraser",iconFont:"iconfont"},onClick:e=>{log.info("[Toolbar]","Clear Markup",e),e.clearMarkups()},type:1/* ClickEvent */,menuName:"Toolbar.clearMarkup"},MarkupQuit:{icon:{default:""},customElement(e,r,i){const n=document.createElement("div");return n.id=r,n.classList.add("toolbar-menu"),i.children&&n.classList.add("toolbar-parent-menu"),n.title=t(i.menuName),n.innerHTML+=`${n.title}`,n},onClick:(e,t)=>{var r;e.deactivateMarkup(),t.destroy(),null==(r=e.toolbar)||r.show()},type:1/* ClickEvent */,menuName:"Toolbar.quitMarkup"}},MARKUP_GROUP_CONFIG=[["Arrow"/* MarkupArrow */,"Rect"/* MarkupRect */,"CloudRect"/* MarkupCloudRect */,"PolyLine"/* MarkupPolyLine */, // ToolbarMenuId.MarkupCloudLine, "Ellipse"/* MarkupEllipse */,"Circle"/* MarkupCircle */, // ToolbarMenuId.MarkupDot, "Text"/* MarkupText */, // ToolbarMenuId.MarkupX, // ToolbarMenuId.MarkupStrokeStyle, // ToolbarMenuId.MarkupLineWidth, // ToolbarMenuId.MarkupFontSize, "MarkupClear"/* MarkupClear */,"MarkupQuit"/* MarkupQuit */]],MarkupToolbar=class extends Toolbar2{constructor(e,t,r=[...MARKUP_GROUP_CONFIG]){super(e,t,r)}},DEFAULT_BIMVIEWER_TOOLBAR_CONFIG={HomeView:{icon:{default:"icon-home",active:"icon-home-filled"},menuName:"Toolbar.homeView",type:1/* ClickEvent */,onClick:e=>{e.goToHomeView()}},OrthoMode:{icon:{default:"icon-orthomode",active:"icon-orthomode-filled"},menuName:"Toolbar.orthoView",type:4/* Switch */,onActive:e=>{log.info("[Toolbar]","Enter OrthoMode"),e.setToOrthographicCamera(!0)},onDeactive:e=>{log.info("[Toolbar]","Exit OrthoMode"),e.setToOrthographicCamera(!1)}},Measure:{icon:{default:"icon-measure",active:"icon-measure-filled"},menuName:"Toolbar.measurement",type:3/* SubMenu */,children:{MeasureDistance:{icon:{default:"icon-distancemeasure",active:"icon-distancemeasure-filled"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.activateMeasurement("Distance"/* Distance */)},onDeactive:e=>{e.deactivateMeasurement()},type:4/* Switch */,mutexIds:["MeasureArea"/* MeasureArea */,"MeasureAngle"/* MeasureAngle */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureArea:{icon:{default:"icon-areameasure",active:"icon-areameasure-filled"},onActive:e=>{e.activateMeasurement("Area"/* Area */)},onDeactive:e=>{e.deactivateMeasurement()},type:4/* Switch */,menuName:"Toolbar.areaMeasurement",mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureAngle"/* MeasureAngle */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureAngle:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-anglemeasure"},type:4/* Switch */,onActive:e=>{e.activateMeasurement("Angle"/* Angle */)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureArea"/* MeasureArea */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureCoordinate:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure"}, // TODO: replace with a correct icon type:4/* Switch */,onActive:e=>{e.activateMeasurement("Coordinate"/* Coordinate */)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureArea"/* MeasureArea */,"MeasureAngle"/* MeasureAngle */]},MeasureClear:{icon:{default:"icon-clear",active:"icon-clear-filled"},onClick:e=>{log.debug("[Toolbar]","Clearing Measure",e),e.clearMeasurements()},type:1/* ClickEvent */,menuName:"Toolbar.clearMeasurement"}}},Section:{icon:{default:"icon-section",active:"icon-section-filled"},menuName:"Toolbar.section",type:3/* SubMenu */,children:{AxisSectionPlane:{icon:{default:"icon-sectionplane",active:"icon-sectionplane-filled"},menuName:"Toolbar.axisSection",type:4/* Switch */,onActive:e=>{e.activateSection("AxisPlaneSection"/* AxisPlaneSection */)},onDeactive:e=>{e.deactivateSection()},mutexIds:["SectionBox"/* SectionBox */,"SectionPlane"/* SectionPlane */]},SectionPlane:{icon:{default:"icon-choosesectionplane",active:"icon-choosesectionplane-filled"},menuName:"Toolbar.pickSectionPlane",type:4/* Switch */,onActive:e=>{e.activateSection("PickPlaneSection"/* PickPlaneSection */)},onDeactive:e=>{e.deactivateSection()},mutexIds:["AxisSectionPlane"/* AxisSectionPlane */,"SectionBox"/* SectionBox */]},SectionBox:{icon:{default:"icon-sectionbox",active:"icon-sectionbox-filled"},menuName:"Toolbar.sectionBox",type:4/* Switch */,onActive:e=>{e.activateSection()},onDeactive:e=>{e.deactivateSection()},mutexIds:["AxisSectionPlane"/* AxisSectionPlane */,"SectionPlane"/* SectionPlane */]}}},BimTree:{icon:{default:"icon-bimtree",active:"icon-bimtree-filled"},menuName:"Toolbar.bimTree",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Bim Tree")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Bim Tree")}},Viewpoint:{icon:{default:"icon-viewpoint",active:"icon-viewpoint-filled"},menuName:"Toolbar.viewpoint",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Viewpoint")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Viewpoint")},visible:!1},Annotation:{icon:{default:"icon-annotation",active:"icon-annotation-filled"},menuName:"Toolbar.annotation",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Annotation")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Annotation")},visible:!1},Property:{icon:{default:"icon-property",active:"icon-property-filled"},menuName:"Toolbar.property",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Property")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Property")},visible:!1},Settings:{icon:{default:"icon-settings",active:"icon-settings-filled"},menuName:"Toolbar.settings",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Settings")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Settings")},visible:!1}, // [ToolbarMenuId.Layers]: { // icon: { default: "icon-settings", active: "icon-settings-filled" }, // menuName: "Toolbar.layers", // type: MenuTypeEnums.POPUP, // popupName: Types.MUTATION_SHOW_LAYER_MANAGER, // }, FullScreen:{icon:{default:"icon-fullscreen",active:"icon-fullscreen-filled"},menuName:"Toolbar.fullscreen",type:4/* Switch */,onClick:(e,t)=>{const r=()=>{const e=null==t?void 0:t.menuList.get("FullScreen"/* Fullscreen */);e&&e.setActive(CommonUtils.isFullScreen())};CommonUtils.isFullScreen()?(CommonUtils.exitFullscreen(),window.removeEventListener("resize",r)):CommonUtils.fullScreen(e.viewerContainer),window.addEventListener("resize",r)}}},GROUP_CONFIG=[["HomeView"/* HomeView */,"OrthoMode"/* OrthoMode */,"FullScreen"/* Fullscreen */,"ZoomToRectangle"/* ZoomToRectangle */],["Measure"/* Measure */,"Markup"/* Markup */,"Section"/* Section */],["BimTree"/* BimTree */,"Viewpoint"/* Viewpoint */,"Annotation"/* Annotation */,"Property"/* Property */,"Compared"/* Compared */,"QuitCompare"/* QuitCompare */,"Layers"/* Layers */],["Settings"/* Settings */]],DEFAULT_VRVIEWER_TOOLBAR_CONFIG={SceneClear:{icon:{default:"icon-clear",active:"icon-clear-filled"},menuName:"clear",type:1/* ClickEvent */,onClick:()=>{}}},DEFAULT_DXFVIEWER_TOOLBAR_CONFIG={HomeView:{icon:{default:"icon-zhushitu",active:"icon-zhushitu",iconFont:"iconfont"},menuName:"Toolbar.homeView",type:1/* ClickEvent */,onClick:e=>{e.goToHomeView()}},ZoomToRectangle:{icon:{default:"icon-kuangxuanfangda",active:"icon-kuangxuanfangda",iconFont:"iconfont"},menuName:"Toolbar.zoomToRectangle",type:1/* ClickEvent */,onClick:e=>{e.activateZoomToRect()}},Measure:{icon:{default:"icon-celiang1",active:"icon-celiang1",iconFont:"iconfont"},menuName:"Toolbar.measurement",type:3/* SubMenu */,children:{MeasureDistance:{icon:{default:"icon-distancemeasure",active:"icon-distancemeasure-filled"},menuName:"Toolbar.distanceMeasurement",onActive:e=>{e.activateMeasurement("Distance"/* Distance */)},onDeactive:e=>{e.deactivateMeasurement()},type:4/* Switch */,mutexIds:["MeasureArea"/* MeasureArea */,"MeasureAngle"/* MeasureAngle */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureArea:{icon:{default:"icon-areameasure",active:"icon-areameasure-filled"},onActive:e=>{e.activateMeasurement("Area"/* Area */)},onDeactive:e=>{e.deactivateMeasurement()},type:4/* Switch */,menuName:"Toolbar.areaMeasurement",mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureAngle"/* MeasureAngle */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureAngle:{menuName:"Toolbar.angleMeasurement",icon:{default:"icon-anglemeasure"},type:4/* Switch */,onActive:e=>{e.activateMeasurement("Angle"/* Angle */)},onDeactive:e=>{e.deactivateMeasurement()},mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureArea"/* MeasureArea */,"MeasureCoordinate"/* MeasureCoordinate */]},MeasureCoordinate:{menuName:"Toolbar.coordinateMeasurement",icon:{default:"icon-distancemeasure"}, // TODO: replace with a correct icon type:4/* Switch */,onActive:e=>{e.activateMeasurement("Coordinate"/* Coordinate */)},onDeactive:e=>{e.deactivateMeasurement()},visible:!1, // hide it for now mutexIds:["MeasureDistance"/* MeasureDistance */,"MeasureArea"/* MeasureArea */,"MeasureAngle"/* MeasureAngle */]},MeasureClear:{icon:{default:"icon-clear",active:"icon-clear-filled"},onClick:e=>{log.debug("[Toolbar]","Clearing Measure",e),e.clearMeasurements()},type:1/* ClickEvent */,menuName:"Toolbar.clearMeasurement"}}},Markup:{icon:{default:"icon-tianjiapizhu",iconFont:"iconfont"},menuName:"Toolbar.markup",type:1/* ClickEvent */,onClick:(e,t)=>{e.activateMarkup("RectMarkup"/* Rectangle */),t.hide(),e.deactivateMeasurement(),new MarkupToolbar(e,__spreadValues({},DEFAULT_MARKUP_TOOLBAR_CONFIG))}},Settings:{icon:{default:"icon-settings",active:"icon-settings-filled"},menuName:"Toolbar.settings",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Settings")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Settings")},visible:!0},Compared:{icon:{default:"icon-compared",iconFont:"iconfont"},menuName:"Toolbar.compared",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Compare")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Compare")},visible:!1},QuitCompare:{icon:{default:"icon-compared",iconFont:"iconfont"},menuName:"Toolbar.quitCompare",type:4/* Switch */,onActive:()=>{log.info("[Toolbar]","Activate Compare")},onDeactive:()=>{log.info("[Toolbar]","Deactivate Compare")},visible:!1},Layers:{ // TODO: replace the icon icon:{default:"icon-tucengkongzhi",active:"icon-tucengkongzhi",iconFont:"iconfont"},menuName:"Toolbar.layers",type:4/* Switch */,onClick:()=>{}},FullScreen:{icon:{default:"icon-quanping",active:"icon-quanping",iconFont:"iconfont"},menuName:"Toolbar.fullscreen",type:4/* Switch */,onClick:(e,t)=>{const r=()=>{const e=null==t?void 0:t.menuList.get("FullScreen"/* Fullscreen */);e&&e.setActive(CommonUtils.isFullScreen())};CommonUtils.isFullScreen()?(CommonUtils.exitFullscreen(),window.removeEventListener("resize",r)):CommonUtils.fullScreen(e.viewerContainer),window.addEventListener("resize",r)}}},DEFAULT_BIM_VIEWER_CONFIG={enableNavCube:!0,enableAxisGizmo:!0,enableToolbar:!0,enableBottomBar:!0,enableContextMenu:!0,enableSpinner:!0,containerId:"myCanvas", // caller need to make sure it exist or rewrite it units:"meters"},SIMPLE_BIM_VIEWER_CONFIG={enableNavCube:!1,enableAxisGizmo:!1,enableToolbar:!1,enableBottomBar:!1,enableContextMenu:!1,containerId:"myCanvas"}; // src/core/markup/MarkupManager.ts export{AXIS_SECTION_PLANE_CONTROL_ID,AXIS_SECTION_PLANE_ID,BaseViewer,BimViewer,BimViewerDatGui,CanvasRender,CommonUtils,ControlsHelper,CoordinateConversionUtils,DEFAULT_BIMVIEWER_TOOLBAR_CONFIG,DEFAULT_BIM_VIEWER_CONFIG,DEFAULT_DXFVIEWER_TOOLBAR_CONFIG,DEFAULT_MARKUP_TOOLBAR_CONFIG,DEFAULT_VRVIEWER_TOOLBAR_CONFIG,DXFLoader,DeviceUtils,Drawable,DrawableList,DxfChangeType,DxfCompare,DxfViewer,ENTER_KEY,ESC_KEY,Event,Exploder,ExportUtils,FpsUtils,GROUND_PLANE_RENDER_ORDER,GROUP_CONFIG,GeometryUtils,GroundUtils,ICON_FONT_CLASS,IUploader,InstantiateHelper,KEYDOWN_EVENT,KEYUP_EVENT,Keys,LocalDxfUploader,LocalImageUploader,LocalModelUploader,MOUSEDOWN_EVENT,MOUSEMOVE_EVENT,MOUSEUP_EVENT,MarkupToolbar,MarkupType,MaterialUtils,MathUtils2 as MathUtils,MeasurementType,MenuTypeEnums,MergeUtils,ObjectUtils,RafHelper,SECTION_BOX_ID,SECTION_PLANE_CONTROL_ID,SECTION_PLANE_ID,SECTION_PLANE_NAME,SIMPLE_BIM_VIEWER_CONFIG,STATE,SVGObject,SVGRenderer,SceneUtils,SectionMode,SectionType,SimplifiedBimViewer,SimplifyUtils,SkyboxUtils,Toolbar2 as Toolbar,ToolbarMenu,ToolbarMenuId2 as ToolbarMenuId,VRControls2 as VRControls,VRViewer,Viewer3DUtils,ViewerEvent,ViewerMode,Views,getLengthValueByUnit,getUnitStr,layerForNonSnapableObjects,layerForUnselectableObjects,matrixAutoUpdate,parseDxfMTextContent,sceneAutoUpdate,setIcon,showPrecisionValue,unitConversionByMeter,unitLabel};