w-threejs-vue 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +15 -0
- package/dist/w-threejs-vue.umd.js +26 -0
- package/dist/w-threejs-vue.umd.js.map +1 -0
- package/docs/examples/app.html +66 -0
- package/docs/examples/app.umd.js +31 -0
- package/docs/examples/app.umd.js.map +1 -0
- package/docs/examples/ex-AppBasicAutoRotateDeg.html +190 -0
- package/docs/examples/ex-AppBasicBackgroundColor.html +189 -0
- package/docs/examples/ex-AppBasicSize.html +170 -0
- package/docs/examples/ex-AppBasicUploadStl.html +237 -0
- package/docs/examples/ex-AppBasicUseAutoRotate.html +189 -0
- package/docs/examples/ex-AppCmCameraFar.html +191 -0
- package/docs/examples/ex-AppCmCameraFov.html +191 -0
- package/docs/examples/ex-AppCmCameraNear.html +191 -0
- package/docs/examples/ex-AppCmCameraOrthographicRatio.html +191 -0
- package/docs/examples/ex-AppCmCameraType.html +190 -0
- package/docs/examples/ex-AppCmGetCameraViewAngle.html +218 -0
- package/docs/examples/ex-AppCmSetCameraAzimuthAngle.html +190 -0
- package/docs/examples/ex-AppCmSetCameraPolarAngle.html +190 -0
- package/docs/examples/ex-AppCmSetCameraViewAngle.html +194 -0
- package/docs/examples/ex-AppHpHelperAxesLengthRatio.html +189 -0
- package/docs/examples/ex-AppHpHelperGridDensity.html +189 -0
- package/docs/examples/ex-AppHpHelperGridLengthRatio.html +189 -0
- package/docs/examples/ex-AppHpHelperGridPositionRatioZ.html +189 -0
- package/docs/examples/ex-AppHpUseHelperAxes.html +189 -0
- package/docs/examples/ex-AppHpUseHelperGrid.html +189 -0
- package/docs/examples/ex-AppLgLegnedBackgroundColor.html +189 -0
- package/docs/examples/ex-AppLgLegnedHeight.html +189 -0
- package/docs/examples/ex-AppLgLegnedHeightMax.html +189 -0
- package/docs/examples/ex-AppLtLightAmbientColor.html +189 -0
- package/docs/examples/ex-AppLtLightDirectionColor.html +191 -0
- package/docs/examples/ex-AppLtLightDirectionIntensity.html +191 -0
- package/docs/examples/ex-AppLtLightDirectionPos.html +191 -0
- package/docs/examples/ex-AppLtLightPointColor.html +192 -0
- package/docs/examples/ex-AppLtLightPointDecay.html +192 -0
- package/docs/examples/ex-AppLtLightPointDistance.html +192 -0
- package/docs/examples/ex-AppLtLightPointIntensity.html +192 -0
- package/docs/examples/ex-AppLtLightPointPoss.html +192 -0
- package/docs/examples/ex-AppLtUseLightAmbient.html +191 -0
- package/docs/examples/ex-AppLtUseLightDirection.html +191 -0
- package/docs/examples/ex-AppLtUseLightPoint.html +191 -0
- package/docs/examples/ex-AppMhGetMeshsInfor.html +198 -0
- package/docs/examples/ex-AppMhSetMeshColor.html +190 -0
- package/docs/examples/ex-AppMhSetMeshLabelText.html +190 -0
- package/docs/examples/ex-AppMhSetMeshLabelTextColor.html +190 -0
- package/docs/examples/ex-AppMhSetMeshLabelTextFontFamily.html +190 -0
- package/docs/examples/ex-AppMhSetMeshLabelTextFontSize.html +190 -0
- package/docs/examples/ex-AppMhSetMeshLabelVisible.html +198 -0
- package/docs/examples/ex-AppMhSetMeshVisible.html +198 -0
- package/docs/examples/ex-AppMuMenuIcons.html +217 -0
- package/docs/examples/ex-AppMuMenuTooltips.html +218 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/index.html +84 -0
- package/docs/module-WThreejsVue.html +216 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/package.json +74 -0
- package/public/index.html +42 -0
- package/src/App.vue +574 -0
- package/src/AppBasicAutoRotateDeg.vue +102 -0
- package/src/AppBasicBackgroundColor.vue +101 -0
- package/src/AppBasicSize.vue +90 -0
- package/src/AppBasicUploadStl.vue +159 -0
- package/src/AppBasicUseAutoRotate.vue +101 -0
- package/src/AppCmCameraFar.vue +103 -0
- package/src/AppCmCameraFov.vue +103 -0
- package/src/AppCmCameraNear.vue +103 -0
- package/src/AppCmCameraOrthographicRatio.vue +103 -0
- package/src/AppCmCameraType.vue +102 -0
- package/src/AppCmGetCameraViewAngle.vue +135 -0
- package/src/AppCmSetCameraAzimuthAngle.vue +104 -0
- package/src/AppCmSetCameraPolarAngle.vue +104 -0
- package/src/AppCmSetCameraViewAngle.vue +105 -0
- package/src/AppHpHelperAxesLengthRatio.vue +101 -0
- package/src/AppHpHelperGridDensity.vue +101 -0
- package/src/AppHpHelperGridLengthRatio.vue +101 -0
- package/src/AppHpHelperGridPositionRatioZ.vue +101 -0
- package/src/AppHpUseHelperAxes.vue +101 -0
- package/src/AppHpUseHelperGrid.vue +101 -0
- package/src/AppLgLegnedBackgroundColor.vue +101 -0
- package/src/AppLgLegnedHeight.vue +101 -0
- package/src/AppLgLegnedHeightMax.vue +101 -0
- package/src/AppLtLightAmbientColor.vue +101 -0
- package/src/AppLtLightDirectionColor.vue +103 -0
- package/src/AppLtLightDirectionIntensity.vue +103 -0
- package/src/AppLtLightDirectionPos.vue +103 -0
- package/src/AppLtLightPointColor.vue +104 -0
- package/src/AppLtLightPointDecay.vue +104 -0
- package/src/AppLtLightPointDistance.vue +104 -0
- package/src/AppLtLightPointIntensity.vue +104 -0
- package/src/AppLtLightPointPoss.vue +104 -0
- package/src/AppLtUseLightAmbient.vue +103 -0
- package/src/AppLtUseLightDirection.vue +103 -0
- package/src/AppLtUseLightPoint.vue +103 -0
- package/src/AppMhGetMeshsInfor.vue +112 -0
- package/src/AppMhSetMeshColor.vue +104 -0
- package/src/AppMhSetMeshLabelText.vue +104 -0
- package/src/AppMhSetMeshLabelTextColor.vue +104 -0
- package/src/AppMhSetMeshLabelTextFontFamily.vue +104 -0
- package/src/AppMhSetMeshLabelTextFontSize.vue +104 -0
- package/src/AppMhSetMeshLabelVisible.vue +106 -0
- package/src/AppMhSetMeshVisible.vue +106 -0
- package/src/AppMuMenuIcons.vue +130 -0
- package/src/AppMuMenuTooltips.vue +131 -0
- package/src/components/WThreejsVue.vue +955 -0
- package/src/js/addStl.mjs +83 -0
- package/src/js/getCsrdFromMeshs.mjs +85 -0
- package/src/js/plot3d.mjs +1407 -0
- package/src/main.js +8 -0
- package/test/all.test.mjs +10 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +4 -0
- package/toolg/gDistApp.mjs +38 -0
- package/toolg/gDistRollupComps.mjs +22 -0
- package/toolg/gDocExams.mjs +47 -0
- package/toolg/gExtractHtml.mjs +159 -0
- package/toolg/modifyReadme.mjs +4 -0
- package/vue.config.js +21 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* w-threejs-vue v1.0.0
|
|
3
|
+
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-threejs-vue"]=t()}(this,(function(){"use strict";var e=Array.isArray,t="object"==typeof global&&global&&global.Object===Object&&global,n="object"==typeof self&&self&&self.Object===Object&&self,r=t||n||Function("return this")(),i=r.Symbol,o=Object.prototype,s=o.hasOwnProperty,a=o.toString,l=i?i.toStringTag:void 0;var c=Object.prototype.toString;var u="[object Null]",h="[object Undefined]",d=i?i.toStringTag:void 0;function p(e){return null==e?void 0===e?h:u:d&&d in Object(e)?function(e){var t=s.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[l]=n:delete e[l]),i}(e):function(e){return c.call(e)}(e)}function f(e){return null!=e&&"object"==typeof e}var m="[object Symbol]";function g(e){return"symbol"==typeof e||f(e)&&p(e)==m}var v=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y=/^\w*$/;function _(t,n){if(e(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!g(t))||(y.test(t)||!v.test(t)||null!=n&&t in Object(n))}function x(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var b="[object AsyncFunction]",S="[object Function]",w="[object GeneratorFunction]",C="[object Proxy]";function M(e){if(!x(e))return!1;var t=p(e);return t==S||t==w||t==b||t==C}var T,A=r["__core-js_shared__"],E=(T=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";var R=Function.prototype.toString;function L(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var P=/^\[object .+?Constructor\]$/,I=Function.prototype,O=Object.prototype,k=I.toString,B=O.hasOwnProperty,D=RegExp("^"+k.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function N(e){return!(!x(e)||(t=e,E&&E in t))&&(M(e)?D:P).test(L(e));var t}function U(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return N(n)?n:void 0}var F=U(Object,"create");var z=Object.prototype.hasOwnProperty;var H=Object.prototype.hasOwnProperty;function W(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e,t){return e===t||e!=e&&t!=t}function G(e,t){for(var n=e.length;n--;)if(V(e[n][0],t))return n;return-1}W.prototype.clear=function(){this.__data__=F?F(null):{},this.size=0},W.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},W.prototype.get=function(e){var t=this.__data__;if(F){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return z.call(t,e)?t[e]:void 0},W.prototype.has=function(e){var t=this.__data__;return F?void 0!==t[e]:H.call(t,e)},W.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=F&&void 0===t?"__lodash_hash_undefined__":t,this};var j=Array.prototype.splice;function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=G(t,e);return!(n<0)&&(n==t.length-1?t.pop():j.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=G(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return G(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=G(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var $=U(r,"Map");function Y(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}q.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new($||X),string:new W}},q.prototype.delete=function(e){var t=Y(this,e).delete(e);return this.size-=t?1:0,t},q.prototype.get=function(e){return Y(this,e).get(e)},q.prototype.has=function(e){return Y(this,e).has(e)},q.prototype.set=function(e,t){var n=Y(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var Z="Expected a function";function J(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Z);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(J.Cache||q),n}J.Cache=q;var K,Q,ee,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/\\(\\)?/g,re=(K=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,n,r,i){t.push(r?i.replace(ne,"$1"):n||e)})),t},Q=J(K,(function(e){return 500===ee.size&&ee.clear(),e})),ee=Q.cache,Q),ie=re;function oe(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var se=1/0,ae=i?i.prototype:void 0,le=ae?ae.toString:void 0;function ce(t){if("string"==typeof t)return t;if(e(t))return oe(t,ce)+"";if(g(t))return le?le.call(t):"";var n=t+"";return"0"==n&&1/t==-se?"-0":n}function ue(e){return null==e?"":ce(e)}function he(t,n){return e(t)?t:_(t,n)?[t]:ie(ue(t))}var de=1/0;function pe(e){if("string"==typeof e||g(e))return e;var t=e+"";return"0"==t&&1/e==-de?"-0":t}function fe(e,t){for(var n=0,r=(t=he(t,e)).length;null!=e&&n<r;)e=e[pe(t[n++])];return n&&n==r?e:void 0}function me(e,t,n){var r=null==e?void 0:fe(e,t);return void 0===r?n:r}var ge=function(){try{var e=U(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ve=ge;function ye(e,t,n){"__proto__"==t&&ve?ve(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var _e=Object.prototype.hasOwnProperty;function xe(e,t,n){var r=e[t];_e.call(e,t)&&V(r,n)&&(void 0!==n||t in e)||ye(e,t,n)}var be=9007199254740991,Se=/^(?:0|[1-9]\d*)$/;function we(e,t){var n=typeof e;return!!(t=null==t?be:t)&&("number"==n||"symbol"!=n&&Se.test(e))&&e>-1&&e%1==0&&e<t}function Ce(e,t,n){return null==e?e:function(e,t,n,r){if(!x(e))return e;for(var i=-1,o=(t=he(t,e)).length,s=o-1,a=e;null!=a&&++i<o;){var l=pe(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=s){var u=a[l];void 0===(c=r?r(u,l,a):void 0)&&(c=x(u)?u:we(t[i+1])?[]:{})}xe(a,l,c),a=a[l]}return e}(e,t,n)}var Me=Object.prototype;function Te(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function Ae(e,t){return function(n){return e(t(n))}}var Ee=Ae(Object.keys,Object),Re=Object.prototype.hasOwnProperty;function Le(e){if(!Te(e))return Ee(e);var t=[];for(var n in Object(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}var Pe=U(r,"DataView"),Ie=U(r,"Promise"),Oe=U(r,"Set"),ke=U(r,"WeakMap"),Be="[object Map]",De="[object Promise]",Ne="[object Set]",Ue="[object WeakMap]",Fe="[object DataView]",ze=L(Pe),He=L($),We=L(Ie),Ve=L(Oe),Ge=L(ke),je=p;(Pe&&je(new Pe(new ArrayBuffer(1)))!=Fe||$&&je(new $)!=Be||Ie&&je(Ie.resolve())!=De||Oe&&je(new Oe)!=Ne||ke&&je(new ke)!=Ue)&&(je=function(e){var t=p(e),n="[object Object]"==t?e.constructor:void 0,r=n?L(n):"";if(r)switch(r){case ze:return Fe;case He:return Be;case We:return De;case Ve:return Ne;case Ge:return Ue}return t});var Xe=je,$e=9007199254740991;function Ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=$e}function qe(e){return null!=e&&Ye(e.length)&&!M(e)}var Ze="[object String]";function Je(e){return function(t){return null==t?void 0:t[e]}}var Ke=Je("length"),Qe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function et(e){return Qe.test(e)}var tt="\\ud800-\\udfff",nt="["+tt+"]",rt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",it="\\ud83c[\\udffb-\\udfff]",ot="[^"+tt+"]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",at="[\\ud800-\\udbff][\\udc00-\\udfff]",lt="(?:"+rt+"|"+it+")"+"?",ct="[\\ufe0e\\ufe0f]?",ut=ct+lt+("(?:\\u200d(?:"+[ot,st,at].join("|")+")"+ct+lt+")*"),ht="(?:"+[ot+rt+"?",rt,st,at,nt].join("|")+")",dt=RegExp(it+"(?="+it+")|"+ht+ut,"g");function pt(e){return et(e)?function(e){for(var t=dt.lastIndex=0;dt.test(e);)++t;return t}(e):Ke(e)}var ft="[object Map]",mt="[object Set]";function gt(t){if(null==t)return 0;if(qe(t))return"string"==typeof(n=t)||!e(n)&&f(n)&&p(n)==Ze?pt(t):t.length;var n,r=Xe(t);return r==ft||r==mt?t.size:Le(t).length}function vt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}var yt,_t=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[yt?s:++r];if(!1===t(i[a],a,i))break}return e},xt=_t;function bt(e){return f(e)&&"[object Arguments]"==p(e)}var St=Object.prototype,wt=St.hasOwnProperty,Ct=St.propertyIsEnumerable,Mt=bt(function(){return arguments}())?bt:function(e){return f(e)&&wt.call(e,"callee")&&!Ct.call(e,"callee")},Tt=Mt;var At="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=At&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Et&&Et.exports===At?r.Buffer:void 0,Lt=(Rt?Rt.isBuffer:void 0)||function(){return!1},Pt={};function It(e){return function(t){return e(t)}}Pt["[object Float32Array]"]=Pt["[object Float64Array]"]=Pt["[object Int8Array]"]=Pt["[object Int16Array]"]=Pt["[object Int32Array]"]=Pt["[object Uint8Array]"]=Pt["[object Uint8ClampedArray]"]=Pt["[object Uint16Array]"]=Pt["[object Uint32Array]"]=!0,Pt["[object Arguments]"]=Pt["[object Array]"]=Pt["[object ArrayBuffer]"]=Pt["[object Boolean]"]=Pt["[object DataView]"]=Pt["[object Date]"]=Pt["[object Error]"]=Pt["[object Function]"]=Pt["[object Map]"]=Pt["[object Number]"]=Pt["[object Object]"]=Pt["[object RegExp]"]=Pt["[object Set]"]=Pt["[object String]"]=Pt["[object WeakMap]"]=!1;var Ot="object"==typeof exports&&exports&&!exports.nodeType&&exports,kt=Ot&&"object"==typeof module&&module&&!module.nodeType&&module,Bt=kt&&kt.exports===Ot&&t.process,Dt=function(){try{var e=kt&&kt.require&&kt.require("util").types;return e||Bt&&Bt.binding&&Bt.binding("util")}catch(e){}}(),Nt=Dt&&Dt.isTypedArray,Ut=Nt?It(Nt):function(e){return f(e)&&Ye(e.length)&&!!Pt[p(e)]},Ft=Object.prototype.hasOwnProperty;function zt(t,n){var r=e(t),i=!r&&Tt(t),o=!r&&!i&&Lt(t),s=!r&&!i&&!o&&Ut(t),a=r||i||o||s,l=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(t.length,String):[],c=l.length;for(var u in t)!n&&!Ft.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||we(u,c))||l.push(u);return l}function Ht(e){return qe(e)?zt(e):Le(e)}var Wt=function(e,t){return function(n,r){if(null==n)return n;if(!qe(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}((function(e,t){return e&&xt(e,t,Ht)})),Vt=Wt;function Gt(e){return e}function jt(t,n){var r;return(e(t)?vt:Vt)(t,"function"==typeof(r=n)?r:Gt)}function Xt(e){var t=this.__data__=new X(e);this.size=t.size}Xt.prototype.clear=function(){this.__data__=new X,this.size=0},Xt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Xt.prototype.get=function(e){return this.__data__.get(e)},Xt.prototype.has=function(e){return this.__data__.has(e)},Xt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!$||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new q(r)}return n.set(e,t),this.size=n.size,this};function $t(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new q;++t<n;)this.add(e[t])}function Yt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function qt(e,t){return e.has(t)}$t.prototype.add=$t.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},$t.prototype.has=function(e){return this.__data__.has(e)};var Zt=1,Jt=2;function Kt(e,t,n,r,i,o){var s=n&Zt,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,p=n&Jt?new $t:void 0;for(o.set(e,t),o.set(t,e);++h<a;){var f=e[h],m=t[h];if(r)var g=s?r(m,f,h,t,e,o):r(f,m,h,e,t,o);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!Yt(t,(function(e,t){if(!qt(p,t)&&(f===e||i(f,e,n,r,o)))return p.push(t)}))){d=!1;break}}else if(f!==m&&!i(f,m,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d}var Qt=r.Uint8Array;function en(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function tn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var nn=1,rn=2,on="[object Boolean]",sn="[object Date]",an="[object Error]",ln="[object Map]",cn="[object Number]",un="[object RegExp]",hn="[object Set]",dn="[object String]",pn="[object Symbol]",fn="[object ArrayBuffer]",mn="[object DataView]",gn=i?i.prototype:void 0,vn=gn?gn.valueOf:void 0;function yn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function _n(t,n,r){var i=n(t);return e(t)?i:yn(i,r(t))}function xn(){return[]}var bn=Object.prototype.propertyIsEnumerable,Sn=Object.getOwnPropertySymbols,wn=Sn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}(Sn(e),(function(t){return bn.call(e,t)})))}:xn,Cn=wn;function Mn(e){return _n(e,Ht,Cn)}var Tn=1,An=Object.prototype.hasOwnProperty;var En=1,Rn="[object Arguments]",Ln="[object Array]",Pn="[object Object]",In=Object.prototype.hasOwnProperty;function On(t,n,r,i,o,s){var a=e(t),l=e(n),c=a?Ln:Xe(t),u=l?Ln:Xe(n),h=(c=c==Rn?Pn:c)==Pn,d=(u=u==Rn?Pn:u)==Pn,p=c==u;if(p&&Lt(t)){if(!Lt(n))return!1;a=!0,h=!1}if(p&&!h)return s||(s=new Xt),a||Ut(t)?Kt(t,n,r,i,o,s):function(e,t,n,r,i,o,s){switch(n){case mn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case fn:return!(e.byteLength!=t.byteLength||!o(new Qt(e),new Qt(t)));case on:case sn:case cn:return V(+e,+t);case an:return e.name==t.name&&e.message==t.message;case un:case dn:return e==t+"";case ln:var a=en;case hn:var l=r&nn;if(a||(a=tn),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=rn,s.set(e,t);var u=Kt(a(e),a(t),r,i,o,s);return s.delete(e),u;case pn:if(vn)return vn.call(e)==vn.call(t)}return!1}(t,n,c,r,i,o,s);if(!(r&En)){var f=h&&In.call(t,"__wrapped__"),m=d&&In.call(n,"__wrapped__");if(f||m){var g=f?t.value():t,v=m?n.value():n;return s||(s=new Xt),o(g,v,r,i,s)}}return!!p&&(s||(s=new Xt),function(e,t,n,r,i,o){var s=n&Tn,a=Mn(e),l=a.length;if(l!=Mn(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:An.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var p=!0;o.set(e,t),o.set(t,e);for(var f=s;++c<l;){var m=e[u=a[c]],g=t[u];if(r)var v=s?r(g,m,u,t,e,o):r(m,g,u,e,t,o);if(!(void 0===v?m===g||i(m,g,n,r,o):v)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var y=e.constructor,_=t.constructor;y==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(t,n,r,i,o,s))}function kn(e,t,n,r,i){return e===t||(null==e||null==t||!f(e)&&!f(t)?e!=e&&t!=t:On(e,t,n,r,kn,i))}var Bn=1,Dn=2;function Nn(e){return e==e&&!x(e)}function Un(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Fn(e){var t=function(e){for(var t=Ht(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Nn(i)]}return t}(e);return 1==t.length&&t[0][2]?Un(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var i=n.length,o=i,s=!r;if(null==e)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var l=(a=n[i])[0],c=e[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var h=new Xt;if(r)var d=r(c,u,l,e,t,h);if(!(void 0===d?kn(u,c,Bn|Dn,r,h):d))return!1}}return!0}(n,e,t)}}function zn(e,t){return null!=e&&t in Object(e)}function Hn(t,n){return null!=t&&function(t,n,r){for(var i=-1,o=(n=he(n,t)).length,s=!1;++i<o;){var a=pe(n[i]);if(!(s=null!=t&&r(t,a)))break;t=t[a]}return s||++i!=o?s:!!(o=null==t?0:t.length)&&Ye(o)&&we(a,o)&&(e(t)||Tt(t))}(t,n,zn)}var Wn=1,Vn=2;function Gn(e){return _(e)?Je(pe(e)):function(e){return function(t){return fe(t,e)}}(e)}function jn(t){return"function"==typeof t?t:null==t?Gt:"object"==typeof t?e(t)?(n=t[0],r=t[1],_(n)&&Nn(r)?Un(pe(n),r):function(e){var t=me(e,n);return void 0===t&&t===r?Hn(e,n):kn(r,t,Wn|Vn)}):Fn(t):Gn(t);var n,r}function Xn(e,t){var n=-1,r=qe(e)?Array(e.length):[];return Vt(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function $n(t,n){return(e(t)?oe:Xn)(t,jn(n))}function Yn(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var qn=/\s/;var Zn=/^\s+/;function Jn(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&qn.test(e.charAt(t)););return t}(e)+1).replace(Zn,""):e}var Kn=NaN,Qn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if("number"==typeof e)return e;if(g(e))return Kn;if(x(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=x(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jn(e);var n=er.test(e);return n||tr.test(e)?nr(e.slice(2),n?2:8):Qn.test(e)?Kn:+e}var ir=1/0,or=17976931348623157e292;function sr(e){return e?(e=rr(e))===ir||e===-ir?(e<0?-1:1)*or:e==e?e:0:0===e?e:0}function ar(e){var t=sr(e),n=t%1;return t==t?n?t-n:t:0}var lr=Math.max;var cr,ur=(cr=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ar(n);return i<0&&(i=lr(r+i,0)),Yn(e,jn(t),i)},function(e,t,n){var r=Object(e);if(!qe(e)){var i=jn(t);e=Ht(e),t=function(e){return i(r[e],e,r)}}var o=cr(e,t,n);return o>-1?r[i?e[o]:o]:void 0});function hr(e){return ue(e).toUpperCase()}function dr(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(null!=s&&(void 0===a?s==s&&!g(s):n(s,a)))var a=s,l=o}return l}function pr(e,t){return e<t}function fr(e){return e&&e.length?dr(e,Gt,pr):void 0}function mr(e,t){return e>t}function gr(e){return e&&e.length?dr(e,Gt,mr):void 0}var vr=Math.max;var yr=ve?function(e,t){return ve(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Gt,_r=yr,xr=Date.now;var br=function(e){var t=0,n=0;return function(){var r=xr(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(_r),Sr=br;function wr(e,t){return Sr(function(e,t,n){return t=vr(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=vr(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,Gt),e+"")}function Cr(e){return e!=e}function Mr(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Yn(e,Cr,n)}function Tr(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Ar(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Er=Array.prototype.splice;var Rr=wr((function(e,t){return e&&e.length&&t&&t.length?function(e,t,n,r){var i=r?Tr:Mr,o=-1,s=t.length,a=e;for(e===t&&(t=Ar(t)),n&&(a=oe(e,It(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(a,u,l,r))>-1;)a!==e&&Er.call(a,l,1),Er.call(e,l,1);return e}(e,t):e})),Lr=i?i.isConcatSpreadable:void 0;function Pr(t){return e(t)||Tt(t)||!!(Lr&&t&&t[Lr])}function Ir(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=Pr),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Ir(a,t-1,n,r,i):yn(i,a):r||(i[i.length]=a)}return i}function Or(e,t){return kn(e,t)}var kr="[object Number]";function Br(e){return"number"==typeof e||f(e)&&p(e)==kr}function Dr(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=r?r(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),i?ye(n,a,l):xe(n,a,l)}return n}var Nr=Object.prototype.hasOwnProperty;function Ur(e){if(!x(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var r in e)("constructor"!=r||!t&&Nr.call(e,r))&&n.push(r);return n}function Fr(e){return qe(e)?zt(e,!0):Ur(e)}var zr="object"==typeof exports&&exports&&!exports.nodeType&&exports,Hr=zr&&"object"==typeof module&&module&&!module.nodeType&&module,Wr=Hr&&Hr.exports===zr?r.Buffer:void 0,Vr=Wr?Wr.allocUnsafe:void 0;var Gr=Ae(Object.getPrototypeOf,Object),jr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)yn(t,Cn(e)),e=Gr(e);return t}:xn,Xr=jr;function $r(e){return _n(e,Fr,Xr)}var Yr=Object.prototype.hasOwnProperty;function qr(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t}var Zr=/\w*$/;var Jr=i?i.prototype:void 0,Kr=Jr?Jr.valueOf:void 0;var Qr="[object Boolean]",ei="[object Date]",ti="[object Map]",ni="[object Number]",ri="[object RegExp]",ii="[object Set]",oi="[object String]",si="[object Symbol]",ai="[object ArrayBuffer]",li="[object DataView]",ci="[object Float32Array]",ui="[object Float64Array]",hi="[object Int8Array]",di="[object Int16Array]",pi="[object Int32Array]",fi="[object Uint8Array]",mi="[object Uint8ClampedArray]",gi="[object Uint16Array]",vi="[object Uint32Array]";function yi(e,t,n){var r,i=e.constructor;switch(t){case ai:return qr(e);case Qr:case ei:return new i(+e);case li:return function(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case ci:case ui:case hi:case di:case pi:case fi:case mi:case gi:case vi:return function(e,t){var n=t?qr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case ti:return new i;case ni:case oi:return new i(e);case ri:return function(e){var t=new e.constructor(e.source,Zr.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ii:return new i;case si:return r=e,Kr?Object(Kr.call(r)):{}}}var _i=Object.create,xi=function(){function e(){}return function(t){if(!x(t))return{};if(_i)return _i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),bi=xi;var Si=Dt&&Dt.isMap,wi=Si?It(Si):function(e){return f(e)&&"[object Map]"==Xe(e)};var Ci=Dt&&Dt.isSet,Mi=Ci?It(Ci):function(e){return f(e)&&"[object Set]"==Xe(e)},Ti=1,Ai=2,Ei=4,Ri="[object Arguments]",Li="[object Function]",Pi="[object GeneratorFunction]",Ii="[object Object]",Oi={};function ki(t,n,r,i,o,s){var a,l=n&Ti,c=n&Ai,u=n&Ei;if(r&&(a=o?r(t,i,o,s):r(t)),void 0!==a)return a;if(!x(t))return t;var h=e(t);if(h){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Yr.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!l)return Ar(t,a)}else{var d=Xe(t),p=d==Li||d==Pi;if(Lt(t))return function(e,t){if(t)return e.slice();var n=e.length,r=Vr?Vr(n):new e.constructor(n);return e.copy(r),r}(t,l);if(d==Ii||d==Ri||p&&!o){if(a=c||p?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:bi(Gr(e))}(t),!l)return c?function(e,t){return Dr(e,Xr(e),t)}(t,function(e,t){return e&&Dr(t,Fr(t),e)}(a,t)):function(e,t){return Dr(e,Cn(e),t)}(t,function(e,t){return e&&Dr(t,Ht(t),e)}(a,t))}else{if(!Oi[d])return o?t:{};a=yi(t,d,l)}}s||(s=new Xt);var f=s.get(t);if(f)return f;s.set(t,a),Mi(t)?t.forEach((function(e){a.add(ki(e,n,r,e,t,s))})):wi(t)&&t.forEach((function(e,i){a.set(i,ki(e,n,r,i,t,s))}));var m=h?void 0:(u?c?$r:Mn:c?Fr:Ht)(t);return vt(m||t,(function(e,i){m&&(e=t[i=e]),xe(a,i,ki(e,n,r,i,t,s))})),a}Oi[Ri]=Oi["[object Array]"]=Oi["[object ArrayBuffer]"]=Oi["[object DataView]"]=Oi["[object Boolean]"]=Oi["[object Date]"]=Oi["[object Float32Array]"]=Oi["[object Float64Array]"]=Oi["[object Int8Array]"]=Oi["[object Int16Array]"]=Oi["[object Int32Array]"]=Oi["[object Map]"]=Oi["[object Number]"]=Oi[Ii]=Oi["[object RegExp]"]=Oi["[object Set]"]=Oi["[object String]"]=Oi["[object Symbol]"]=Oi["[object Uint8Array]"]=Oi["[object Uint8ClampedArray]"]=Oi["[object Uint16Array]"]=Oi["[object Uint32Array]"]=!0,Oi["[object Error]"]=Oi[Li]=Oi["[object WeakMap]"]=!1;var Bi=1,Di=4;function Ni(e){return ki(e,Bi|Di)}function Ui(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fi={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,o),!0;case 6:return u.fn.call(u.context,t,r,i,o,s),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var l=0,c=[],u=a.length;l<u;l++)(a[l].fn!==t||i&&!a[l].once||r&&a[l].context!==r)&&c.push(a[l]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Fi);var zi=Ui(Fi.exports);function Hi(){return new zi}function Wi(){let e,t,n=new Promise((function(){e=arguments[0],t=arguments[1]}));return n.resolve=e,n.reject=t,n}function Vi(e){let t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}function Gi(e){return"[object String]"===Object.prototype.toString.call(e)}function ji(e){return!(!Gi(e)||""===e)}function Xi(e){return e!=e}function $i(e){let t=!1;if(ji(e))t=!isNaN(Number(e));else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(Xi(e))return!1;t=!0}return t}function Yi(e){if(!$i(e))return 0;return sr(e)}function qi(e){return!!$i(e)&&(e=Yi(e),"number"==typeof(t=e)&&t==ar(t));var t}var Zi=r.isFinite,Ji=Math.min;var Ki=function(e){var t=Math[e];return function(e,n){if(e=rr(e),(n=null==n?0:Ji(ar(n),292))&&Zi(e)){var r=(ue(e)+"e").split("e");return+((r=(ue(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}("round"),Qi=Ki;function eo(e){if(!$i(e))return 0;e=Yi(e);let t=Qi(e);return"0"===String(t)?0:t}function to(e){if(!qi(e))return!1;return eo(e)>0}async function no(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=Wi();if(!Vi(e))return r.reject("waitfunction需輸入函數f"),r;let i=async()=>{let t=e();return function(e){let t,n=Object.prototype.toString.call(e);if(t="[object Promise]"===n,t)return!0;if("[object Function]"!==n)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}(t)&&(t=await t),t};if(n=await i(),!0===n)return r.resolve(),r;let o=me(t,"attemptNum",null);to(o)||(o=200);let s=me(t,"timeInterval",null);to(s)||(s=1e3);let a=0,l=setInterval((async()=>{a+=1,n=await i(),!0===n&&(clearInterval(l),r.resolve()),a>o&&(clearInterval(l),r.reject(`exceeded attemptNum[${o}]`))}),s);return r}function ro(e){return"[object Object]"===Object.prototype.toString.call(e)}function io(e,t){return!!ro(e)&&(!(!ji(t)&&!$i(t))&&t in e)}var oo="[object Boolean]";function so(e){return!0===e||!1===e||f(e)&&p(e)==oo}function ao(e){return so(e)}function lo(e){return"[object Array]"===Object.prototype.toString.call(e)}function co(e){return!!function(e){return"[object Undefined]"===Object.prototype.toString.call(e)}(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!function(e){if(ro(e)){for(let t in e)return!1;return!0}return!1}(e)||(!!function(e){return!(!Gi(e)||""!==e)}(e)||(!!function(e){return!!lo(e)&&0===e.length}(e)||!!Xi(e)))))}function uo(e){return!!lo(e)&&(0!==e.length&&(1!==e.length||!co(e[0])))}function ho(e){if(ro(e)){for(let t in e)return!0;return!1}return!1}var po="[object Object]",fo=Function.prototype,mo=Object.prototype,go=fo.toString,vo=mo.hasOwnProperty,yo=go.call(Object);function _o(e){return f(e)&&1===e.nodeType&&!function(e){if(!f(e)||p(e)!=po)return!1;var t=Gr(e);if(null===t)return!0;var n=vo.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&go.call(n)==yo}(e)}function xo(e){return _o(e)}function bo(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function So(e,t){let n=Wi();if(!lo(e)&&!ro(e))return n.reject("rs is not an array or object"),n;let r=!1;if(ro(e)){r=!0;let t=[];jt(e,((e,n)=>{t.push({k:n,v:e})})),e=t}Vi(t)||(t=function(e){return e});let i=-1,o=[];return e.reduce((function(e,n){return e.then((function(e){o.push(e),i+=1;let s=i,a=n;return r&&(s=n.k,a=n.v),Vi(t)?t(a,s):a}))}),Promise.resolve()).then((function(e){var t,r,i,s;o.push(e),s=null==(t=o)?0:t.length,o=s?bo(t,(r=i||void 0===r?1:ar(r))<0?0:r,s):[],n.resolve(o)})).catch((function(e){n.reject(e)})),n}function wo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;$i(e)||(e=10);let t=Wi();return setTimeout((function(){t.resolve()}),e),t}function Co(e){if(!qi(e))return!1;return eo(e)>=0}function Mo(e,t){return ji(e)&&Co(t)?0===(t=eo(t))?"":e.substring(0,t):""}function To(e,t){if(!ji(e))return"";if(!Co(t))return"";if(0===(t=eo(t)))return"";let n=e.length-t;return n<0&&(n=0),e.substr(n,t)}function Ao(e,t){return ji(e)&&Co(t)?0===(t=eo(t))?e:To(e,e.length-t):""}function Eo(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:bo(e,t,n)}var Ro="\\ud800-\\udfff",Lo="["+Ro+"]",Po="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Io="\\ud83c[\\udffb-\\udfff]",Oo="[^"+Ro+"]",ko="(?:\\ud83c[\\udde6-\\uddff]){2}",Bo="[\\ud800-\\udbff][\\udc00-\\udfff]",Do="(?:"+Po+"|"+Io+")"+"?",No="[\\ufe0e\\ufe0f]?",Uo=No+Do+("(?:\\u200d(?:"+[Oo,ko,Bo].join("|")+")"+No+Do+")*"),Fo="(?:"+[Oo+Po+"?",Po,ko,Bo,Lo].join("|")+")",zo=RegExp(Io+"(?="+Io+")|"+Fo+Uo,"g");function Ho(e){return et(e)?function(e){return e.match(zo)||[]}(e):function(e){return e.split("")}(e)}function Wo(e,t,n){if((e=ue(e))&&(n||void 0===t))return Jn(e);if(!e||!(t=ce(t)))return e;var r=Ho(e),i=Ho(t),o=function(e,t){for(var n=-1,r=e.length;++n<r&&Mr(t,e[n],0)>-1;);return n}(r,i),s=function(e,t){for(var n=e.length;n--&&Mr(t,e[n],0)>-1;);return n}(r,i)+1;return Eo(r,o,s).join("")}function Vo(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=g(e),s=void 0!==t,a=null===t,l=t==t,c=g(t);if(!a&&!c&&!o&&e>t||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&e<t||c&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!l)return-1}return 0}function Go(t,n,r){n=n.length?oe(n,(function(t){return e(t)?function(e){return fe(e,1===t.length?t[0]:t)}:t})):[Gt];var i=-1;return n=oe(n,It(jn)),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Xn(t,(function(e,t,r){return{criteria:oe(n,(function(t){return t(e)})),index:++i,value:e}})),(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Vo(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,r)}))}function jo(e,t,n){if(!x(n))return!1;var r=typeof t;return!!("number"==r?qe(n)&&we(t,n.length):"string"==r&&t in n)&&V(n[t],e)}var Xo=wr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&jo(e,t[0],t[1])?t=[]:n>2&&jo(t[0],t[1],t[2])&&(t=[t[0]]),Go(e,Ir(t,1),[])}));function $o(e){return ue(e).toLowerCase()}function Yo(e,t,n){if(!ji(e))return"";if(!ji(t))return"";if(!Gi(n))return"";return String(e).replaceAll(t,n)}function qo(e,t){if(!ji(e))return[];if(!ji(t))return[];let n=function(e,t){return ji(e)&&ji(t)?e.split(t):[]}(e,t);n=$n(n,Wo);let r=[];return jt(n,(function(e){ji(e)&&r.push(e)})),r}function Zo(e){if(!ji(e)&&!$i(e)&&!g(e))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}function Jo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return ji(e)&&Co(t)?(n=to(n)?eo(n):1,e.substring(t,t+n)):""}let Ko={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function Qo(e){return ts(e,1)}function es(e){return ts(e,360)}function ts(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.indexOf("%")>=0){if(!$i(e=Yo(e,"%","")))throw new Error("invalid color: value is not a number");e=Yi(e)/100}else{if(!$i(e))throw new Error("invalid color: value is not a number");e=Yi(e)/t}if(e>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function ns(e){if(!$i(e))throw new Error("invalid color: value is not a number");if((e=Yi(e))>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function rs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba";if(!lo(e))throw new Error("invalid colors array");let n=me(e,0,0),r=me(e,1,0),i=me(e,2,0),o=me(e,3,1);if(t=t.split(""),4!==gt(t))throw new Error("tar.length !== 4");return{[me(t,0)]:n,[me(t,1)]:r,[me(t,2)]:i,[me(t,3)]:o}}function is(e){let t=gt(e=Ao(e,1));if(2===t)e=`${e}${e}${e}ff`;else if(3===t){let t=Jo(e,0,1),n=Jo(e,1,1),r=Jo(e,2,1);e=`${t}${t}${n}${n}${r}${r}ff`}else if(6===t)e=`${e}ff`;else if(8!==t)throw new Error("invalid hex color");function n(e){if(2!==gt(e))throw new Error("hex.length of color is not equal to 2");if(!$i(e=parseInt(e,16)))throw new Error("invalid hex of color");return(e=Yi(e))/255}return{r:n(Jo(e,0,2)),g:n(Jo(e,2,2)),b:n(Jo(e,4,2)),a:n(Jo(e,6,2))}}function os(e){return e=rs(e=$n(e,((e,t)=>t<=2?ts(e,255):3===t?ns(e):null)),"rgba")}function ss(e){return e=fs(e=rs(e=$n(e,((e,t)=>0===t?es(e):1===t||2===t?Qo(e):3===t?ns(e):null)),"hsla"))}function as(e){return e=ms(e=rs(e=$n(e,((e,t)=>0===t?es(e):1===t||2===t?Qo(e):3===t?ns(e):null)),"hsva"))}function ls(e){if("transparent"===e)return{r:0,g:0,b:0,a:0};if(function(e){return io(Ko,e)}(e))return is(e=`#${Ko[e]}`);if(function(e){return"#"===Mo(e,1)&&(!!/[0-9A-Fa-f]{2}/g.test(e)||(!!/[0-9A-Fa-f]{3}/g.test(e)||(!!/[0-9A-Fa-f]{6}/g.test(e)||!!/[0-9A-Fa-f]{8}/g.test(e))))}(e))return is(e);if(function(e){return"rgb"===Mo(e,3)||"rgba"===Mo(e,4)}(e))return function(e){return e=Yo(e,"rgba",""),e=Yo(e,"rgb",""),os(qo(e=Yo(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsl"===Mo(e,3)||"hsla"===Mo(e,4)}(e))return function(e){return e=Yo(e,"hsla",""),e=Yo(e,"hsl",""),ss(qo(e=Yo(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsv"===Mo(e,3)||"hsva"===Mo(e,4)}(e))return function(e){return e=Yo(e,"hsva",""),e=Yo(e,"hsv",""),as(qo(e=Yo(e=e.replace(/[()]/g,""),","," ")," "))}(e);throw new Error("format of color string is not hex-color, name-color, rgba, hsla, hsva")}function cs(e,t){return!!io(e,t=$o(t))||!!io(e,t=hr(t))}function us(e,t,n){let r;return r=me(e,t,null),null!==r?r:(r=me(e,t=hr(t),null),null!==r?r:n)}function hs(e){if(function(e){let t=cs(e,"r"),n=cs(e,"g"),r=cs(e,"b");return t&&n&&r}(e))return function(e){let t=[us(e,"r",null),us(e,"g",null),us(e,"b",null),us(e,"a",1)];return t=$n(t,Zo),os(t)}(e);if(function(e){let t=cs(e,"h"),n=cs(e,"s"),r=cs(e,"l");return t&&n&&r}(e))return function(e){let t=[us(e,"h",null),us(e,"s",null),us(e,"l",null),us(e,"a",1)];return t=$n(t,Zo),ss(t)}(e);if(function(e){let t=cs(e,"h"),n=cs(e,"s"),r=cs(e,"v");return t&&n&&r}(e))return function(e){let t=[us(e,"h",null),us(e,"s",null),us(e,"v",null),us(e,"a",1)];return t=$n(t,Zo),as(t)}(e);throw new Error("color object is not one of rgba, hsla, hsva")}function ds(e){let t,n,r=e.r,i=e.g,o=e.b,s=Math.max(r,i,o),a=Math.min(r,i,o),l=(s+a)/2;if(s===a)t=n=0;else{let e=s-a;switch(n=l>.5?e/(2-s-a):e/(s+a),s){case r:t=(i-o)/e+(i<o?6:0);break;case i:t=(o-r)/e+2;break;case o:t=(r-i)/e+4}t/=6}return{h:t,s:n,l:l,a:e.a}}function ps(e){let t,n,r=e.r,i=e.g,o=e.b,s=Math.max(r,i,o),a=Math.min(r,i,o),l=s,c=s-a;if(n=0===s?0:c/s,s===a)t=0;else{switch(s){case r:t=(i-o)/c+(i<o?6:0);break;case i:t=(o-r)/c+2;break;case o:t=(r-i)/c+4}t/=6}return{h:t,s:n,v:l,a:e.a}}function fs(e){let t,n,r,i=e.h,o=e.s,s=e.l;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===o)t=n=r=s;else{let e=s<.5?s*(1+o):s+o-s*o,l=2*s-e;t=a(l,e,i+1/3),n=a(l,e,i),r=a(l,e,i-1/3)}return{r:t,g:n,b:r,a:e.a}}function ms(e){let t,n,r,i=e.h,o=e.s,s=e.v,a=Math.floor(6*i),l=6*i-a,c=s*(1-o),u=s*(1-l*o),h=s*(1-(1-l)*o);switch(a%6){case 0:t=s,n=h,r=c;break;case 1:t=u,n=s,r=c;break;case 2:t=c,n=s,r=h;break;case 3:t=c,n=u,r=s;break;case 4:t=h,n=c,r=s;break;case 5:t=s,n=c,r=u}return{r:t,g:n,b:r,a:e.a}}function gs(e){let t=Math.round(255*e).toString(16);if(1===gt(t))return`0${t}`;if(2===gt(t))return t;throw new Error("invalid value")}function vs(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.r,r=e.g,i=e.b,o=e.a,s=`${gs(n)}${gs(r)}${gs(i)}`;return t&&(s=`${s}${gs(o)}`),s}function ys(e){return Math.min(1,Math.max(0,e))}function _s(e,t){if(!ji(t))throw new Error("fmtOutput is not a string");if(!Qs[t])throw console.log(`fmtOutput must be [${Ht(Qs)}]`),new Error("invalid fmtOutput");return e=Qs[t](e)}function xs(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=ds(e);return r.h+=t,r.h=r.h%1,_s(fs(r),n)}function bs(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"toRgbString";if(t<0||t>1)throw new Error("w1 < 0 or > 1");if(r<0||r>1)throw new Error("w1 < 0 or > 1");return _s({r:e.r*t+n.r*r,g:e.g*t+n.g*r,b:e.b*t+n.b*r,a:e.a*t+n.a*r},i)}function Ss(e){return`${Qi(100*e,1)}%`}function ws(e){return Qi(e,0)}function Cs(e){return Qi(e,3)}function Ms(e){return{r:ws(255*e.r),g:ws(255*e.g),b:ws(255*e.b)}}function Ts(e){return`rgb(${ws(255*e.r)}, ${ws(255*e.g)}, ${ws(255*e.b)})`}function As(e){return{r:ws(255*e.r),g:ws(255*e.g),b:ws(255*e.b),a:Cs(e.a)}}function Es(e){return`rgba(${ws(255*e.r)}, ${ws(255*e.g)}, ${ws(255*e.b)}, ${Cs(e.a)})`}function Rs(e){let t=ds(e);return{h:ws(360*t.h),s:Cs(t.s),l:Cs(t.l)}}function Ls(e){let t=ds(e);return`hsl(${ws(360*t.h)}, ${Cs(t.s)}, ${Cs(t.l)})`}function Ps(e){let t=ds(e);return{h:ws(360*t.h),s:Cs(t.s),l:Cs(t.l),a:Cs(t.a)}}function Is(e){let t=ds(e);return`hsla(${ws(360*t.h)}, ${Cs(t.s)}, ${Cs(t.l)}, ${Cs(t.a)})`}function Os(e){let t=ps(e);return{h:ws(360*t.h),s:Cs(t.s),v:Cs(t.v)}}function ks(e){let t=ps(e);return`hsv(${ws(360*t.h)}, ${Cs(t.s)}, ${Cs(t.v)})`}function Bs(e){let t=ps(e);return{h:ws(360*t.h),s:Cs(t.s),v:Cs(t.v),a:Cs(t.a)}}function Ds(e){let t=ps(e);return`hsva(${ws(360*t.h)}, ${Cs(t.s)}, ${Cs(t.v)}, ${Cs(t.a)})`}function Ns(e){return{r:Ss(e.r),g:Ss(e.g),b:Ss(e.b)}}function Us(e){return`rgb(${Ss(e.r)}, ${Ss(e.g)}, ${Ss(e.b)})`}function Fs(e){return{r:Ss(e.r),g:Ss(e.g),b:Ss(e.b),a:Cs(e.a)}}function zs(e){return`rgba(${Ss(e.r)}, ${Ss(e.g)}, ${Ss(e.b)}, ${Cs(e.a)})`}function Hs(e){let t=ds(e);return{h:ws(360*t.h),s:Ss(t.s),l:Ss(t.l)}}function Ws(e){let t=ds(e);return`hsl(${ws(360*t.h)}, ${Ss(t.s)}, ${Ss(t.l)})`}function Vs(e){let t=ds(e);return{h:ws(360*t.h),s:Ss(t.s),l:Ss(t.l),a:Cs(t.a)}}function Gs(e){let t=ds(e);return`hsla(${ws(360*t.h)}, ${Ss(t.s)}, ${Ss(t.l)}, ${Cs(t.a)})`}function js(e){let t=ps(e);return{h:ws(360*t.h),s:Ss(t.s),v:Ss(t.v)}}function Xs(e){let t=ps(e);return`hsv(${ws(360*t.h)}, ${Ss(t.s)}, ${Ss(t.v)})`}function $s(e){let t=ps(e);return{h:ws(360*t.h),s:Ss(t.s),v:Ss(t.v),a:Cs(t.a)}}function Ys(e){let t=ps(e);return`hsva(${ws(360*t.h)}, ${Ss(t.s)}, ${Ss(t.v)}, ${Cs(t.a)})`}function qs(e){let t=function(e){return vs(e,!1)}(e);return`#${t}`}function Zs(e){return`#${vs(e)}`}function Js(e){let t=null,n=null,r=null;if(ji(e))t=$o(Wo(e));else{if(!ho(e))throw console.log("color=",e),new Error("color is not a string or an object");n=e}if(null!==t)try{r=ls(t)}catch(e){throw console.log(e),new Error(`can not parse color: ${t}`)}else if(null!==n)try{r=hs(n)}catch(e){throw console.log(e),new Error(`can not parse color: ${JSON.stringify(n)}`)}return r}function Ks(e){if(!ho(e))return console.log("gradient is not an effective object"),e=>`rgb(${255*(e=Math.min(Math.max(e,0),1))},${255*e},${255*e})`;let t=[];return jt(e,((e,n)=>{t.push([Yi(n),As(Js(e)),e])})),t=Xo(t,0),function(e){let n=null;for(let r=1;r<t.length;r++){let i=t[r-1][0],o=t[r-1][1],s=t[r][0],a=t[r][1];if(i<=e&&s>=e){let t=(s-e)/(s-i),r=(e-i)/(s-i);n=bs(Js(o),t,Js(a),r,"toRgbaString");break}}return n}}let Qs={toRgb:Ms,toRgbString:Ts,toRgba:As,toRgbaString:Es,toHsl:Rs,toHslString:Ls,toHsla:Ps,toHslaString:Is,toHsv:Os,toHsvString:ks,toHsva:Bs,toHsvaString:Ds,toRgbP:Ns,toRgbPString:Us,toRgbaP:Fs,toRgbaPString:zs,toHslP:Hs,toHslPString:Ws,toHslaP:Vs,toHslaPString:Gs,toHsvP:js,toHsvPString:Xs,toHsvaP:$s,toHsvaPString:Ys,toHexString:qs,toHex8String:Zs};var ea=function(){let e={toRgb:e=>Ms(Js(e)),toRgbString:e=>Ts(Js(e)),toRgba:e=>As(Js(e)),toRgbaString:e=>Es(Js(e)),toHsl:e=>Rs(Js(e)),toHslString:e=>Ls(Js(e)),toHsla:e=>Ps(Js(e)),toHslaString:e=>Is(Js(e)),toHsv:e=>Os(Js(e)),toHsvString:e=>ks(Js(e)),toHsva:e=>Bs(Js(e)),toHsvaString:e=>Ds(Js(e)),toRgbP:e=>Ns(Js(e)),toRgbPString:e=>Us(Js(e)),toRgbaP:e=>Fs(Js(e)),toRgbaPString:e=>zs(Js(e)),toHslP:e=>Hs(Js(e)),toHslPString:e=>Ws(Js(e)),toHslaP:e=>Vs(Js(e)),toHslaPString:e=>Gs(Js(e)),toHsvP:e=>js(Js(e)),toHsvPString:e=>Xs(Js(e)),toHsvaP:e=>$s(Js(e)),toHsvaPString:e=>Ys(Js(e)),toHexString:e=>qs(Js(e)),toHex8String:e=>Zs(Js(e)),modSaturate:(e,t,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=ds(e);return r.s+=t,r.s=ys(r.s),_s(fs(r),n)}(Js(e),t,n),modGrey:(e,t)=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"toRgbString",n=ds(e);return n.s=0,_s(fs(n),t)}(Js(e),t),modLighten:(e,t,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=ds(e);return r.l+=t,r.l=ys(r.l),_s(fs(r),n)}(Js(e),t,n),modBrighten:(e,t,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(t<0||t>1)throw new Error("amount < 0 or > 1");return e.r+=t,e.r=ys(e.r),e.g+=t,e.g=ys(e.g),e.b+=t,e.b=ys(e.b),_s(e,n)}(Js(e),t,n),modHue:(e,t,n)=>xs(Js(e),t,n),modComplement:(e,t)=>function(e){return xs(e,.5,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"toRgbString")}(Js(e),t),spreadHue:(e,t,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(!qi(t))throw new Error("num is not an integer");if((t=eo(t))<=1)return[e];let r=ds(e),i=1/t,o=[];for(let e=0;e<t;e++)o.push(_s(fs(r),n)),r.h+=i,r.h=r.h%1;return o}(Js(e),t,n),spreadMonochromatic:(e,t,n)=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toRgbString";if(!qi(t))throw new Error("num is not an integer");if((t=eo(t))<=1)return[e];let r=ps(e);r.s=1,r.l=1;let i=1/t,o=[];for(let e=0;e<t;e++)o.push(_s(ms(r),n)),r.h-=i,r.l-=i;return o}(Js(e),t,n),mix:(e,t,n,r,i)=>bs(Js(e),t,Js(n),r,i),getBrightness:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");return(299*e.r+587*e.g+114*e.b)/1e3}(Js(e)),getLuminance:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");let t,n,r,i=e.r,o=e.g,s=e.b;return t=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),r=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r}(Js(e)),interp:Ks};return e}();function ta(e){return ta="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},ta(e)}function na(e){var t=function(e,t){if("object"!=ta(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ta(t)?t:String(t)}function ra(e,t,n){return(t=na(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ia(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=me(t,"timeInterval",null);to(n)||(n=20);let r=me(t,"tolerancePixel",null);to(r)||(r=1);let i,o=Hi(),s={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0},a=Ni(s),l={width:"",height:""};if(!Vi(e))return console.log("invalid f",e),null;i=setInterval((()=>{let t=e();if(t){let e={offsetWidth:t.offsetWidth,offsetHeight:t.offsetHeight,clientWidth:t.clientWidth,clientHeight:t.clientHeight,windowWidth:window.innerWidth,windowHeight:window.innerHeight},n=a.offsetWidth-e.offsetWidth,i=a.offsetHeight-e.offsetHeight,c=Math.abs(n)>r,u=Math.abs(i)>r,h="";n>0?h="smaller":n<0&&(h="larger");let d="";if(i>0?d="smaller":i<0&&(d="larger"),l={width:h,height:d},c||u){let n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ia(Object(n),!0).forEach((function(t){ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ia(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},a);setTimeout((()=>{e.offsetWidth>0&&e.offsetHeight>0&&(o.emit("resize",{sold:n,snew:e,smode:l,ele:t}),o.emit("resizeWithWindow",{sold:n,snew:e,smode:l,ele:t,from:"dom"}))}),1)}s=a,a=e}}),n);let c=e=>{o.emit("resizeWithWindow",{sold:s,snew:a,smode:l,from:"window"})};return window.addEventListener("resize",c),o.clear=()=>{clearInterval(i),window.removeEventListener("resize",c)},o}let sa="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),aa=sa.length;function la(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,t=[];e=to(e)?eo(e):32;for(let n=0;n<e;n++)t[n]=sa[0|Math.random()*aa];return t.join("")}function ca(){let e={};return{bind:function(t,n,r){let i=`r${la()}`;t.setAttribute("ev-resize",i);let o=oa((()=>t));o.on("resizeWithWindow",(e=>{!function(e,t,n){let r=e.data&&e.data.on||e.componentOptions&&e.componentOptions.listeners;r&&r[t]&&r[t].fns(n)}(r,"domresize",e)})),e[i]=o},unbind:function(t){let n=t.getAttribute("ev-resize");t.setAttribute("ev-resize",null),e[n]&&(e[n].clear(),e[n]=null,delete e[n])}}}var ua,ha=(ua="toUpperCase",function(e){var t=et(e=ue(e))?Ho(e):void 0,n=t?t[0]:e.charAt(0),r=t?Eo(t,1).join(""):e.slice(1);return n[ua]()+r});var da,pa=(da={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(e){return null==da?void 0:da[e]}),fa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ma=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ga=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var va=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var ya="\\ud800-\\udfff",_a="\\u2700-\\u27bf",xa="a-z\\xdf-\\xf6\\xf8-\\xff",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",Sa="\\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",wa="["+Sa+"]",Ca="\\d+",Ma="["+_a+"]",Ta="["+xa+"]",Aa="[^"+ya+Sa+Ca+_a+xa+ba+"]",Ea="(?:\\ud83c[\\udde6-\\uddff]){2}",Ra="[\\ud800-\\udbff][\\udc00-\\udfff]",La="["+ba+"]",Pa="(?:"+Ta+"|"+Aa+")",Ia="(?:"+La+"|"+Aa+")",Oa="(?:['’](?:d|ll|m|re|s|t|ve))?",ka="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ba="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Da="[\\ufe0e\\ufe0f]?",Na=Da+Ba+("(?:\\u200d(?:"+["[^"+ya+"]",Ea,Ra].join("|")+")"+Da+Ba+")*"),Ua="(?:"+[Ma,Ea,Ra].join("|")+")"+Na,Fa=RegExp([La+"?"+Ta+"+"+Oa+"(?="+[wa,La,"$"].join("|")+")",Ia+"+"+ka+"(?="+[wa,La+Pa,"$"].join("|")+")",La+"?"+Pa+"+"+Oa,La+"+"+ka,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ca,Ua].join("|"),"g");function za(e,t,n){return e=ue(e),void 0===(t=n?void 0:t)?function(e){return va.test(e)}(e)?function(e){return e.match(Fa)||[]}(e):function(e){return e.match(ga)||[]}(e):e.match(t)||[]}var Ha=RegExp("['’]","g");var Wa,Va=(Wa=function(e,t,n){return t=t.toLowerCase(),e+(n?ha(ue(t).toLowerCase()):t)},function(e){return function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}(za(function(e){return(e=ue(e))&&e.replace(fa,pa).replace(ma,"")}(e).replace(Ha,"")),Wa,"")}),Ga=Va;var ja=Dt&&Dt.isRegExp,Xa=ja?It(ja):function(e){return f(e)&&"[object RegExp]"==p(e)},$a=4294967295;function Ya(e,t,n){return n&&"number"!=typeof n&&jo(e,t,n)&&(t=n=void 0),(n=void 0===n?$a:n>>>0)?(e=ue(e))&&("string"==typeof t||null!=t&&!Xa(t))&&!(t=ce(t))&&et(e)?Eo(Ho(e),0,n):e.split(t,n):[]}let qa={default:{red:{base:"#f44336",lighten5:"#ffebee",lighten4:"#ffcdd2",lighten3:"#ef9a9a",lighten2:"#e57373",lighten1:"#ef5350",darken1:"#e53935",darken2:"#d32f2f",darken3:"#c62828",darken4:"#b71c1c",accent1:"#ff8a80",accent2:"#ff5252",accent3:"#ff1744",accent4:"#d50000"},pink:{base:"#e91e63",lighten5:"#fce4ec",lighten4:"#f8bbd0",lighten3:"#f48fb1",lighten2:"#f06292",lighten1:"#ec407a",darken1:"#d81b60",darken2:"#c2185b",darken3:"#ad1457",darken4:"#880e4f",accent1:"#ff80ab",accent2:"#ff4081",accent3:"#f50057",accent4:"#c51162"},purple:{base:"#9c27b0",lighten5:"#f3e5f5",lighten4:"#e1bee7",lighten3:"#ce93d8",lighten2:"#ba68c8",lighten1:"#ab47bc",darken1:"#8e24aa",darken2:"#7b1fa2",darken3:"#6a1b9a",darken4:"#4a148c",accent1:"#ea80fc",accent2:"#e040fb",accent3:"#d500f9",accent4:"#aa00ff"},deepPurple:{base:"#673ab7",lighten5:"#ede7f6",lighten4:"#d1c4e9",lighten3:"#b39ddb",lighten2:"#9575cd",lighten1:"#7e57c2",darken1:"#5e35b1",darken2:"#512da8",darken3:"#4527a0",darken4:"#311b92",accent1:"#b388ff",accent2:"#7c4dff",accent3:"#651fff",accent4:"#6200ea"},indigo:{base:"#3f51b5",lighten5:"#e8eaf6",lighten4:"#c5cae9",lighten3:"#9fa8da",lighten2:"#7986cb",lighten1:"#5c6bc0",darken1:"#3949ab",darken2:"#303f9f",darken3:"#283593",darken4:"#1a237e",accent1:"#8c9eff",accent2:"#536dfe",accent3:"#3d5afe",accent4:"#304ffe"},blue:{base:"#2196f3",lighten5:"#e3f2fd",lighten4:"#bbdefb",lighten3:"#90caf9",lighten2:"#64b5f6",lighten1:"#42a5f5",darken1:"#1e88e5",darken2:"#1976d2",darken3:"#1565c0",darken4:"#0d47a1",accent1:"#82b1ff",accent2:"#448aff",accent3:"#2979ff",accent4:"#2962ff"},lightBlue:{base:"#03a9f4",lighten5:"#e1f5fe",lighten4:"#b3e5fc",lighten3:"#81d4fa",lighten2:"#4fc3f7",lighten1:"#29b6f6",darken1:"#039be5",darken2:"#0288d1",darken3:"#0277bd",darken4:"#01579b",accent1:"#80d8ff",accent2:"#40c4ff",accent3:"#00b0ff",accent4:"#0091ea"},cyan:{base:"#00bcd4",lighten5:"#e0f7fa",lighten4:"#b2ebf2",lighten3:"#80deea",lighten2:"#4dd0e1",lighten1:"#26c6da",darken1:"#00acc1",darken2:"#0097a7",darken3:"#00838f",darken4:"#006064",accent1:"#84ffff",accent2:"#18ffff",accent3:"#00e5ff",accent4:"#00b8d4"},teal:{base:"#009688",lighten5:"#e0f2f1",lighten4:"#b2dfdb",lighten3:"#80cbc4",lighten2:"#4db6ac",lighten1:"#26a69a",darken1:"#00897b",darken2:"#00796b",darken3:"#00695c",darken4:"#004d40",accent1:"#a7ffeb",accent2:"#64ffda",accent3:"#1de9b6",accent4:"#00bfa5"},green:{base:"#4caf50",lighten5:"#e8f5e9",lighten4:"#c8e6c9",lighten3:"#a5d6a7",lighten2:"#81c784",lighten1:"#66bb6a",darken1:"#43a047",darken2:"#388e3c",darken3:"#2e7d32",darken4:"#1b5e20",accent1:"#b9f6ca",accent2:"#69f0ae",accent3:"#00e676",accent4:"#00c853"},lightGreen:{base:"#8bc34a",lighten5:"#f1f8e9",lighten4:"#dcedc8",lighten3:"#c5e1a5",lighten2:"#aed581",lighten1:"#9ccc65",darken1:"#7cb342",darken2:"#689f38",darken3:"#558b2f",darken4:"#33691e",accent1:"#ccff90",accent2:"#b2ff59",accent3:"#76ff03",accent4:"#64dd17"},lime:{base:"#cddc39",lighten5:"#f9fbe7",lighten4:"#f0f4c3",lighten3:"#e6ee9c",lighten2:"#dce775",lighten1:"#d4e157",darken1:"#c0ca33",darken2:"#afb42b",darken3:"#9e9d24",darken4:"#827717",accent1:"#f4ff81",accent2:"#eeff41",accent3:"#c6ff00",accent4:"#aeea00"},yellow:{base:"#ffeb3b",lighten5:"#fffde7",lighten4:"#fff9c4",lighten3:"#fff59d",lighten2:"#fff176",lighten1:"#ffee58",darken1:"#fdd835",darken2:"#fbc02d",darken3:"#f9a825",darken4:"#f57f17",accent1:"#ffff8d",accent2:"#ffff00",accent3:"#ffea00",accent4:"#ffd600"},amber:{base:"#ffc107",lighten5:"#fff8e1",lighten4:"#ffecb3",lighten3:"#ffe082",lighten2:"#ffd54f",lighten1:"#ffca28",darken1:"#ffb300",darken2:"#ffa000",darken3:"#ff8f00",darken4:"#ff6f00",accent1:"#ffe57f",accent2:"#ffd740",accent3:"#ffc400",accent4:"#ffab00"},orange:{base:"#ff9800",lighten5:"#fff3e0",lighten4:"#ffe0b2",lighten3:"#ffcc80",lighten2:"#ffb74d",lighten1:"#ffa726",darken1:"#fb8c00",darken2:"#f57c00",darken3:"#ef6c00",darken4:"#e65100",accent1:"#ffd180",accent2:"#ffab40",accent3:"#ff9100",accent4:"#ff6d00"},deepOrange:{base:"#ff5722",lighten5:"#fbe9e7",lighten4:"#ffccbc",lighten3:"#ffab91",lighten2:"#ff8a65",lighten1:"#ff7043",darken1:"#f4511e",darken2:"#e64a19",darken3:"#d84315",darken4:"#bf360c",accent1:"#ff9e80",accent2:"#ff6e40",accent3:"#ff3d00",accent4:"#dd2c00"},brown:{base:"#795548",lighten5:"#efebe9",lighten4:"#d7ccc8",lighten3:"#bcaaa4",lighten2:"#a1887f",lighten1:"#8d6e63",darken1:"#6d4c41",darken2:"#5d4037",darken3:"#4e342e",darken4:"#3e2723"},blueGrey:{base:"#607d8b",lighten5:"#eceff1",lighten4:"#cfd8dc",lighten3:"#b0bec5",lighten2:"#90a4ae",lighten1:"#78909c",darken1:"#546e7a",darken2:"#455a64",darken3:"#37474f",darken4:"#263238"},grey:{base:"#9e9e9e",lighten5:"#fafafa",lighten4:"#f5f5f5",lighten3:"#eeeeee",lighten2:"#e0e0e0",lighten1:"#bdbdbd",darken1:"#757575",darken2:"#616161",darken3:"#424242",darken4:"#212121"},shades:{black:"#000000",white:"#ffffff",transparent:"transparent"}}};function Za(e){if("white"===e)return"#fff";if("black"===e)return"#000";if("transparent"===e)return"rgba(0,0,0,0)";let t=function(e){let t=Ya(e," ");return 1===gt(t)&&(t[1]=null),t}(e),n=function(e,t,n){let r=me(qa,`default.${e}.${t}`,null);return null===r&&(r=n),r}(function(e){let t=e.trim();return t=Ga(t),t}(t[0]),function(e){ji(e)||(e="base");let t=e.trim();return t=t.replace("-","").trim(),t}(t[1]),e);return n}var Ja={components:{},props:{name:{type:String,default:"cir-wave"},color:{type:String,default:"grey"},size:{type:Number,default:48}},data:function(){return{}},computed:{effColor:function(){return Za(this.color)}},methods:{}};function Ka(e,t,n,r,i,o,s,a,l,c){"boolean"!=typeof s&&(l=a,a=s,s=!1);const u="function"==typeof n?n.options:n;let h;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(h=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=h):t&&(h=s?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),h)if(u.functional){const e=u.render;u.render=function(t,n){return h.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,h):[h]}return n}const Qa="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function el(e){return(e,t)=>function(e,t){const n=Qa?t.media||"default":e,r=nl[n]||(nl[n]={ids:new Set,styles:[]});if(!r.ids.has(e)){r.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",t.media&&r.element.setAttribute("media",t.media),void 0===tl&&(tl=document.head||document.getElementsByTagName("head")[0]),tl.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(n),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const e=r.ids.size-1,t=document.createTextNode(n),i=r.element.childNodes;i[e]&&r.element.removeChild(i[e]),i.length?r.element.insertBefore(t,i[e]):r.element.appendChild(t)}}}(e,t)}let tl;const nl={};const rl=Ja;var il=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; vertical-align:middle; outline:none; user-select:none; height:"+e.size+"px; width:"+e.size+"px;"},["cir-wave"===e.name?[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:e.size,height:e.size}},[n("circle",{attrs:{cx:"50",cy:"50",r:"14.6699",fill:"none",stroke:"#420457","stroke-width":"10"}},[n("animate",{attrs:{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"-0.5s"}}),e._v(" "),n("animate",{attrs:{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"-0.5s"}})]),e._v(" "),n("circle",{attrs:{cx:"50",cy:"50",r:"33.9915",fill:"none",stroke:"#5a3faa","stroke-width":"10"}},[n("animate",{attrs:{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline"}}),e._v(" "),n("animate",{attrs:{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline"}})])])]:"cir-rotate"===e.name?[n("div",{style:"position:relative; display:inline-flex; align-items:center; justify-content:center; display:inline-block; height:"+e.size+"px; width:"+e.size+"px;"},[n("svg",{staticClass:"pgc-rotate",staticStyle:{transform:"rotate(0deg)"},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"21.904761904761905 21.904761904761905 43.80952380952381 43.80952380952381"}},[n("circle",{staticClass:"pgc-dash",attrs:{fill:"transparent",cx:"43.80952380952381",cy:"43.80952380952381",r:"20","stroke-width":"4","stroke-dasharray":"100","stroke-dashoffset":"50px",stroke:e.effColor}})])])]:e._e()],2)};il._withStripped=!0;const ol=Ka({render:il,staticRenderFns:[]},(function(e){e&&e("data-v-6639a678_0",{source:"\n.pgc-rotate[data-v-6639a678] {\r\n width: 100%;\r\n height: 100%;\r\n margin: auto;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n z-index: 1;\r\n transition: all .6s ease-in-out;\r\n animation: progress-circular-rotate-data-v-6639a678 1.4s linear infinite;\r\n transform-origin: center center;\n}\n.pgc-dash[data-v-6639a678] {\r\n animation: progress-circular-dash-data-v-6639a678 1.4s ease-in-out infinite;\r\n stroke-linecap: round;\r\n stroke-dasharray: 80,200;\r\n stroke-dashoffset: 0px;\n}\n@-webkit-keyframes progress-circular-dash-data-v-6639a678 {\n0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\n}\n50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\n}\nto {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\n}\n}\n@keyframes progress-circular-dash-data-v-6639a678 {\n0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\n}\n50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\n}\nto {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\n}\n}\n@-webkit-keyframes progress-circular-rotate-data-v-6639a678 {\nto {\r\n transform: rotate(1turn)\n}\n}\n@keyframes progress-circular-rotate-data-v-6639a678 {\nto {\r\n transform: rotate(1turn)\n}\n}\r\n\r\n",map:{version:3,sources:["D:\\- 006 - 開源\\開源-JS-105-3-w-threejs-vue\\w-threejs-vue\\node_modules\\w-component-vue\\src\\components\\WIconLoading.vue"],names:[],mappings:";AA8FA;IACA,WAAA;IACA,YAAA;IACA,YAAA;IACA,kBAAA;IACA,MAAA;IACA,SAAA;IACA,OAAA;IACA,QAAA;IACA,UAAA;IACA,+BAAA;IACA,wEAAA;IACA,+BAAA;AACA;AAEA;IACA,2EAAA;IACA,qBAAA;IACA,wBAAA;IACA,sBAAA;AACA;AAEA;AACA;QACA,uBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AACA;AAEA;AACA;QACA,uBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AAEA;QACA,yBAAA;QACA;AACA;AACA;AAEA;AACA;QACA;AACA;AACA;AAEA;AACA;QACA;AACA;AACA",file:"WIconLoading.vue",sourcesContent:['<template>\r\n <div :style="`display:inline-block; vertical-align:middle; outline:none; user-select:none; height:${size}px; width:${size}px;`">\r\n\r\n <template v-if="name===\'cir-wave\'">\r\n\r\n <svg\r\n xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"\r\n :width="size"\r\n :height="size"\r\n >\r\n <circle cx="50" cy="50" r="14.6699" fill="none" stroke="#420457" stroke-width="10">\r\n <animate attributeName="r" repeatCount="indefinite" dur="1s" values="0;40" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline" begin="-0.5s"></animate>\r\n <animate attributeName="opacity" repeatCount="indefinite" dur="1s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline" begin="-0.5s"></animate>\r\n </circle>\r\n <circle cx="50" cy="50" r="33.9915" fill="none" stroke="#5a3faa" stroke-width="10">\r\n <animate attributeName="r" repeatCount="indefinite" dur="1s" values="0;40" keyTimes="0;1" keySplines="0 0.2 0.8 1" calcMode="spline"></animate>\r\n <animate attributeName="opacity" repeatCount="indefinite" dur="1s" values="1;0" keyTimes="0;1" keySplines="0.2 0 0.8 1" calcMode="spline"></animate>\r\n </circle>\r\n </svg>\r\n\r\n </template>\r\n\r\n <template v-else-if="name===\'cir-rotate\'">\r\n\r\n <div :style="`position:relative; display:inline-flex; align-items:center; justify-content:center; display:inline-block; height:${size}px; width:${size}px;`">\r\n <svg\r\n class="pgc-rotate"\r\n style="transform: rotate(0deg);"\r\n xmlns="http://www.w3.org/2000/svg"\r\n viewBox="21.904761904761905 21.904761904761905 43.80952380952381 43.80952380952381"\r\n >\r\n <circle\r\n class="pgc-dash"\r\n fill="transparent"\r\n cx="43.80952380952381"\r\n cy="43.80952380952381"\r\n r="20"\r\n stroke-width="4"\r\n stroke-dasharray="100"\r\n stroke-dashoffset="50px"\r\n :stroke="effColor"\r\n ></circle>\r\n </svg>\r\n </div>\r\n\r\n </template>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport convertColor from \'../js/convertColor.mjs\'\r\n\r\n\r\n/**\r\n * @vue-prop {String} [name=\'cir-wave\'] 輸入動畫名稱字串,預設\'cir-wave\'\r\n * @vue-prop {Number} [size=48] 輸入圖標欲顯示的尺寸浮點數,預設48\r\n */\r\nexport default {\r\n components: {\r\n },\r\n props: {\r\n name: {\r\n type: String,\r\n default: \'cir-wave\',\r\n },\r\n color: {\r\n type: String,\r\n default: \'grey\',\r\n },\r\n size: {\r\n type: Number,\r\n default: 48,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n }\r\n },\r\n computed: {\r\n\r\n effColor: function() {\r\n let vo = this\r\n return convertColor(vo.color)\r\n },\r\n\r\n },\r\n methods: {\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n\r\n.pgc-rotate {\r\n width: 100%;\r\n height: 100%;\r\n margin: auto;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n z-index: 1;\r\n transition: all .6s ease-in-out;\r\n animation: progress-circular-rotate 1.4s linear infinite;\r\n transform-origin: center center;\r\n}\r\n\r\n.pgc-dash {\r\n animation: progress-circular-dash 1.4s ease-in-out infinite;\r\n stroke-linecap: round;\r\n stroke-dasharray: 80,200;\r\n stroke-dashoffset: 0px;\r\n}\r\n\r\n@-webkit-keyframes progress-circular-dash {\r\n 0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\r\n }\r\n\r\n 50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\r\n }\r\n\r\n to {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\r\n }\r\n}\r\n\r\n@keyframes progress-circular-dash {\r\n 0% {\r\n stroke-dasharray: 1,200;\r\n stroke-dashoffset: 0px\r\n }\r\n\r\n 50% {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -15px\r\n }\r\n\r\n to {\r\n stroke-dasharray: 100,200;\r\n stroke-dashoffset: -124px\r\n }\r\n}\r\n\r\n@-webkit-keyframes progress-circular-rotate {\r\n to {\r\n transform: rotate(1turn)\r\n }\r\n}\r\n\r\n@keyframes progress-circular-rotate {\r\n to {\r\n transform: rotate(1turn)\r\n }\r\n}\r\n\r\n</style>\r\n']},media:void 0})}),rl,"data-v-6639a678",false,undefined,!1,el,void 0,void 0);function sl(e,t){function n(e){return lo(e)?e:[e]}if(co(e))return!1;if(0===(e=n(e)).length)return!1;if(co(e))return!1;if(0===(t=n(t)).length)return!1;for(let n=0;n<e.length;n++)for(let r=0;r<t.length;r++)if(Or(e[n],t[r]))return!0;return!1}var al=Array.prototype.join;function ll(e,t){return null==e?"":al.call(e,t)}function cl(e){function t(e){e.parentNode.removeChild(e)}if(xo(e)){return void t(e)}if(!ji(e))return;let n=function(e){return document.querySelectorAll(e)}(e);jt(n,(function(e){t(e)}))}function ul(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=me(n,"timeDuration",null);to(r)||(r=1e3);let i=me(n,"color",null);if(ji(i)||(i="rgba(255, 255, 255, 0.5)"),!xo(e))return;e.style.position="relative",e.style.overflow="hidden";let o=e.getBoundingClientRect(),s=t.clientX-o.left,a=t.clientY-o.top,l=2*Math.max(e.clientWidth,e.clientHeight),c=document.createElement("div");c.style.width=`${l}px`,c.style.height=`${l}px`,c.style.transition=`all ${r/1e3}s linear`,c.style.position="absolute",c.style.zIndex=1,c.style.left=`${s}px`,c.style.top=`${a}px`,c.style.borderRadius="50%",c.style.transformOrigin="center",c.style.transform="translate(-50%,-50%) scale(0)",c.style.background=i,c.style.userSelect="none",c.style.pointerEvents="none",e.appendChild(c),setTimeout((()=>{c.style.transform="translate(-50%,-50%) scale(2)",c.style.opacity=0}),1),setTimeout((()=>{cl(c)}),r)}function hl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=me(t,"parse");ao(n)||(n=!0);let r=me(t,"ext");ho(r)||(r={});let i=me(t,"semicolon");ao(i)||(i=!0);let o=me(t,"returnObj");ao(o)||(o=!1);let s=0,a=0,l=0,c=0;if(n){let t=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=me(n,"def",""),i=me(n,"type","");"num"!==i&&"text"!==i&&(i="num"),"num"===i?t=Br:"text"===i&&(t=Gi);let o=r,s=r,a=r,l=r;return t(me(e,"h"))&&(o=me(e,"h"),s=o),t(me(e,"v"))&&(a=me(e,"v"),l=a),t(me(e,"left"))&&(o=me(e,"left")),t(me(e,"right"))&&(s=me(e,"right")),t(me(e,"top"))&&(a=me(e,"top")),t(me(e,"bottom"))&&(l=me(e,"bottom")),{left:o,right:s,top:a,bottom:l}}(e);s=t.left,a=t.right,l=t.top,c=t.bottom}s+=me(r,"left",0),a+=me(r,"right",0),l+=me(r,"top",0),c+=me(r,"bottom",0);let u=null;return o?u={left:s,right:a,top:l,bottom:c}:(u=`${l}px ${a}px ${c}px ${s}px`,i&&(u=`${u};`)),u}const dl={components:{},props:{icon:{type:[String,Array],default:""},color:{type:String,default:"grey darken-1"},colorHover:{type:String,default:"grey darken-3"},sizeOriginal:{type:Number,default:24},size:{type:Number,default:24},timeTransition:{type:Number,default:.15}},data:function(){return{mouseEnter:!1,r:.83,paths:[]}},computed:{hasIcon:function(){return ji(this.icon)},isMdi:function(){return!!this.hasIcon&&this.icon.indexOf("mdi-")>=0},isFa:function(){return!!this.hasIcon&&this.icon.indexOf(" fa-")>=0},isSvg:function(){let e=this;if(e.isMdi||e.isFa)return!1;let t=ji(e.icon),n=uo(e.icon);return t||n},usePaths:function(){let e=this;if(!e.isSvg)return[];let t=e.icon;return ji(e.icon)&&(t=[e.icon]),t},useIconColor:function(){let e=this;return e.mouseEnter?Za(e.colorHover):Za(e.color)},useStyleSize:function(){let e=this;return{width:`${e.size}px`,height:`${e.size}px`,"line-height":`${e.size}px`,"max-height":`${e.size}px`,"min-height":`${e.size}px`}}},methods:{}};var pl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.icon?n("div",{style:[e.useStyleSize,{display:"flex","align-items":"center","user-select":"none",border:"0px solid #ddd"}],on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(t){e.$emit("click",t)}.apply(null,arguments)},click:function(t){e.$emit("click",t)}}},[e.isSvg?n("svg",{style:"transition:all "+e.timeTransition+"s linear; fill:"+e.useIconColor+";",attrs:{width:e.size,height:e.size,viewBox:"0 0 "+e.sizeOriginal+" "+e.sizeOriginal},on:{mouseenter:function(t){e.mouseEnter=!0},mouseleave:function(t){e.mouseEnter=!1}}},e._l(e.usePaths,(function(t,r){return n("path",{key:r,attrs:{d:e.icon}})})),0):e._e(),e._v(" "),e.isMdi?n("div",{style:"transition:all "+e.timeTransition+"s linear; width:"+e.size+"px; height:"+e.size+"px; color:"+e.useIconColor+"; display:flex; align-items:center; justify-content:center;",on:{mouseenter:function(t){e.mouseEnter=!0},mouseleave:function(t){e.mouseEnter=!1}}},[n("span",{class:"mdi "+e.icon,style:"font-size:"+e.size+"px;"})]):e._e(),e._v(" "),e.isFa?n("div",{style:"transition:all "+e.timeTransition+"s linear; width:"+e.size+"px; height:"+e.size+"px; color:"+e.useIconColor+"; display:flex; align-items:center; justify-content:center;",on:{mouseenter:function(t){e.mouseEnter=!0},mouseleave:function(t){e.mouseEnter=!1}}},[n("div",{style:"width:"+e.size+"px; height:"+e.size+"px; _transform-origin:center; transform:translateX(0px) translateY(0px) scale("+e.r+");"},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[n("i",{class:"fas "+e.icon,style:"font-size:"+e.size+"px;"})])])]):e._e()]):e._e()};pl._withStripped=!0;const fl=Ka({render:pl,staticRenderFns:[]},(function(e){e&&e("data-v-0b5c1a37_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WIcon.vue"},media:void 0})}),dl,"data-v-0b5c1a37",false,undefined,!1,el,void 0,void 0);function ml(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function gl(e,t,n){if(!Br(e))return void console.log("clientX is not a number",e);if(!Br(t))return void console.log("clientY is not a number",t);if(!xo(n))return void console.log("ele is not a HTMLElement",n);let r;try{r=n.getBoundingClientRect()}catch(e){return void console.log("invalid ele for getBoundingClientRect",e)}let i=!1;try{i=e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom}catch(e){console.log("catch when calculating page information of element",e)}return i}function vl(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function yl(e){return e instanceof vl(e).Element||e instanceof Element}function _l(e){return e instanceof vl(e).HTMLElement||e instanceof HTMLElement}function xl(e){return"undefined"!=typeof ShadowRoot&&(e instanceof vl(e).ShadowRoot||e instanceof ShadowRoot)}var bl=Math.max,Sl=Math.min,wl=Math.round;function Cl(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Ml(){return!/^((?!chrome|android).)*safari/i.test(Cl())}function Tl(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&_l(e)&&(i=e.offsetWidth>0&&wl(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&wl(r.height)/e.offsetHeight||1);var s=(yl(e)?vl(e):window).visualViewport,a=!Ml()&&n,l=(r.left+(a&&s?s.offsetLeft:0))/i,c=(r.top+(a&&s?s.offsetTop:0))/o,u=r.width/i,h=r.height/o;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function Al(e){var t=vl(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function El(e){return e?(e.nodeName||"").toLowerCase():null}function Rl(e){return((yl(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ll(e){return Tl(Rl(e)).left+Al(e).scrollLeft}function Pl(e){return vl(e).getComputedStyle(e)}function Il(e){var t=Pl(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ol(e,t,n){void 0===n&&(n=!1);var r,i,o=_l(t),s=_l(t)&&function(e){var t=e.getBoundingClientRect(),n=wl(t.width)/e.offsetWidth||1,r=wl(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Rl(t),l=Tl(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==El(t)||Il(a))&&(c=(r=t)!==vl(r)&&_l(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Al(r)),_l(t)?((u=Tl(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=Ll(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function kl(e){var t=Tl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Bl(e){return"html"===El(e)?e:e.assignedSlot||e.parentNode||(xl(e)?e.host:null)||Rl(e)}function Dl(e){return["html","body","#document"].indexOf(El(e))>=0?e.ownerDocument.body:_l(e)&&Il(e)?e:Dl(Bl(e))}function Nl(e,t){var n;void 0===t&&(t=[]);var r=Dl(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=vl(r),s=i?[o].concat(o.visualViewport||[],Il(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Nl(Bl(s)))}function Ul(e){return["table","td","th"].indexOf(El(e))>=0}function Fl(e){return _l(e)&&"fixed"!==Pl(e).position?e.offsetParent:null}function zl(e){for(var t=vl(e),n=Fl(e);n&&Ul(n)&&"static"===Pl(n).position;)n=Fl(n);return n&&("html"===El(n)||"body"===El(n)&&"static"===Pl(n).position)?t:n||function(e){var t=/firefox/i.test(Cl());if(/Trident/i.test(Cl())&&_l(e)&&"fixed"===Pl(e).position)return null;var n=Bl(e);for(xl(n)&&(n=n.host);_l(n)&&["html","body"].indexOf(El(n))<0;){var r=Pl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Hl="top",Wl="bottom",Vl="right",Gl="left",jl="auto",Xl=[Hl,Wl,Vl,Gl],$l="start",Yl="end",ql="clippingParents",Zl="viewport",Jl="popper",Kl="reference",Ql=Xl.reduce((function(e,t){return e.concat([t+"-"+$l,t+"-"+Yl])}),[]),ec=[].concat(Xl,[jl]).reduce((function(e,t){return e.concat([t,t+"-"+$l,t+"-"+Yl])}),[]),tc=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function nc(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function rc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&xl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ic(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oc(e,t,n){return t===Zl?ic(function(e,t){var n=vl(e),r=Rl(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Ml();(c||!c&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Ll(e),y:l}}(e,n)):yl(t)?function(e,t){var n=Tl(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ic(function(e){var t,n=Rl(e),r=Al(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=bl(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=bl(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Ll(e),l=-r.scrollTop;return"rtl"===Pl(i||n).direction&&(a+=bl(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Rl(e)))}function sc(e,t,n,r){var i="clippingParents"===t?function(e){var t=Nl(Bl(e)),n=["absolute","fixed"].indexOf(Pl(e).position)>=0&&_l(e)?zl(e):e;return yl(n)?t.filter((function(e){return yl(e)&&rc(e,n)&&"body"!==El(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce((function(t,n){var i=oc(e,n,r);return t.top=bl(i.top,t.top),t.right=Sl(i.right,t.right),t.bottom=Sl(i.bottom,t.bottom),t.left=bl(i.left,t.left),t}),oc(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ac(e){return e.split("-")[0]}function lc(e){return e.split("-")[1]}function cc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function uc(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?ac(i):null,s=i?lc(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Hl:t={x:a,y:n.y-r.height};break;case Wl:t={x:a,y:n.y+n.height};break;case Vl:t={x:n.x+n.width,y:l};break;case Gl:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?cc(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case $l:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Yl:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function hc(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function dc(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function pc(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.strategy,s=void 0===o?e.strategy:o,a=n.boundary,l=void 0===a?ql:a,c=n.rootBoundary,u=void 0===c?Zl:c,h=n.elementContext,d=void 0===h?Jl:h,p=n.altBoundary,f=void 0!==p&&p,m=n.padding,g=void 0===m?0:m,v=hc("number"!=typeof g?g:dc(g,Xl)),y=d===Jl?Kl:Jl,_=e.rects.popper,x=e.elements[f?y:d],b=sc(yl(x)?x:x.contextElement||Rl(e.elements.popper),l,u,s),S=Tl(e.elements.reference),w=uc({reference:S,element:_,strategy:"absolute",placement:i}),C=ic(Object.assign({},_,w)),M=d===Jl?C:S,T={top:b.top-M.top+v.top,bottom:M.bottom-b.bottom+v.bottom,left:b.left-M.left+v.left,right:M.right-b.right+v.right},A=e.modifiersData.offset;if(d===Jl&&A){var E=A[i];Object.keys(T).forEach((function(e){var t=[Vl,Wl].indexOf(e)>=0?1:-1,n=[Hl,Wl].indexOf(e)>=0?"y":"x";T[e]+=E[n]*t}))}return T}var fc={placement:"bottom",modifiers:[],strategy:"absolute"};function mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function gc(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?fc:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},fc,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;h(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:yl(e)?Nl(e):e.contextElement?Nl(e.contextElement):[],popper:Nl(t)};var s,c,d=function(e){var t=nc(e);return tc.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(r,a.options.modifiers),c=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return a.orderedModifiers=d.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:u,options:r}),s=function(){};l.push(o||s)}})),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(mc(t,n)){a.rects={reference:Ol(t,zl(n),"fixed"===a.options.strategy),popper:kl(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,h=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:h,instance:u})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){h(),c=!0}};if(!mc(e,t))return u;function h(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var vc={passive:!0};var yc={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _c(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,h=e.isFixed,d=s.x,p=void 0===d?0:d,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),_=Gl,x=Hl,b=window;if(c){var S=zl(n),w="clientHeight",C="clientWidth";if(S===vl(n)&&"static"!==Pl(S=Rl(n)).position&&"absolute"===a&&(w="scrollHeight",C="scrollWidth"),i===Hl||(i===Gl||i===Vl)&&o===Yl)x=Wl,m-=(h&&S===b&&b.visualViewport?b.visualViewport.height:S[w])-r.height,m*=l?1:-1;if(i===Gl||(i===Hl||i===Wl)&&o===Yl)_=Vl,p-=(h&&S===b&&b.visualViewport?b.visualViewport.width:S[C])-r.width,p*=l?1:-1}var M,T=Object.assign({position:a},c&&yc),A=!0===u?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:wl(n*i)/i||0,y:wl(r*i)/i||0}}({x:p,y:m},vl(n)):{x:p,y:m};return p=A.x,m=A.y,l?Object.assign({},T,((M={})[x]=y?"0":"",M[_]=v?"0":"",M.transform=(b.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",M)):Object.assign({},T,((t={})[x]=y?m+"px":"",t[_]=v?p+"px":"",t.transform="",t))}var xc={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,c={placement:ac(t.placement),variation:lc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,_c(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,_c(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var bc={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];_l(i)&&El(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});_l(r)&&El(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},Sc=gc({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=vl(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,vc)})),a&&l.addEventListener("resize",n.update,vc),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,vc)})),a&&l.removeEventListener("resize",n.update,vc)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=uc({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},xc,bc]}),wc={left:"right",right:"left",bottom:"top",top:"bottom"};function Cc(e){return e.replace(/left|right|bottom|top/g,(function(e){return wc[e]}))}var Mc={start:"end",end:"start"};function Tc(e){return e.replace(/start|end/g,(function(e){return Mc[e]}))}function Ac(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ec:l,u=lc(r),h=u?a?Ql:Ql.filter((function(e){return lc(e)===u})):Xl,d=h.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=h);var p=d.reduce((function(t,n){return t[n]=pc(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[ac(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}var Ec={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,h=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,v=ac(g),y=l||(v===g||!f?[Cc(g)]:function(e){if(ac(e)===jl)return[];var t=Cc(e);return[Tc(e),t,Tc(t)]}(g)),_=[g].concat(y).reduce((function(e,n){return e.concat(ac(n)===jl?Ac(t,{placement:n,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,b=t.rects.popper,S=new Map,w=!0,C=_[0],M=0;M<_.length;M++){var T=_[M],A=ac(T),E=lc(T)===$l,R=[Hl,Wl].indexOf(A)>=0,L=R?"width":"height",P=pc(t,{placement:T,boundary:u,rootBoundary:h,altBoundary:d,padding:c}),I=R?E?Vl:Gl:E?Wl:Hl;x[L]>b[L]&&(I=Cc(I));var O=Cc(I),k=[];if(o&&k.push(P[A]<=0),a&&k.push(P[I]<=0,P[O]<=0),k.every((function(e){return e}))){C=T,w=!1;break}S.set(T,k)}if(w)for(var B=function(e){var t=_.find((function(t){var n=S.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},D=f?3:1;D>0;D--){if("break"===B(D))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};var Rc={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=ec.reduce((function(e,n){return e[n]=function(e,t,n){var r=ac(e),i=[Gl,Hl].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Gl,Vl].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};function Lc(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Pc(e){return[Hl,Vl,Wl,Gl].some((function(t){return e[t]>=0}))}var Ic={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=pc(t,{elementContext:"reference"}),a=pc(t,{altBoundary:!0}),l=Lc(s,r),c=Lc(a,i,o),u=Pc(l),h=Pc(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}};function Oc(e,t,n){return bl(e,Sl(t,n))}var kc={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,h=n.padding,d=n.tether,p=void 0===d||d,f=n.tetherOffset,m=void 0===f?0:f,g=pc(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),v=ac(t.placement),y=lc(t.placement),_=!y,x=cc(v),b="x"===x?"y":"x",S=t.modifiersData.popperOffsets,w=t.rects.reference,C=t.rects.popper,M="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,T="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(o){var R,L="y"===x?Hl:Gl,P="y"===x?Wl:Vl,I="y"===x?"height":"width",O=S[x],k=O+g[L],B=O-g[P],D=p?-C[I]/2:0,N=y===$l?w[I]:C[I],U=y===$l?-C[I]:-w[I],F=t.elements.arrow,z=p&&F?kl(F):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=H[L],V=H[P],G=Oc(0,w[I],z[I]),j=_?w[I]/2-D-G-W-T.mainAxis:N-G-W-T.mainAxis,X=_?-w[I]/2+D+G+V+T.mainAxis:U+G+V+T.mainAxis,$=t.elements.arrow&&zl(t.elements.arrow),Y=$?"y"===x?$.clientTop||0:$.clientLeft||0:0,q=null!=(R=null==A?void 0:A[x])?R:0,Z=O+X-q,J=Oc(p?Sl(k,O+j-q-Y):k,O,p?bl(B,Z):B);S[x]=J,E[x]=J-O}if(a){var K,Q="x"===x?Hl:Gl,ee="x"===x?Wl:Vl,te=S[b],ne="y"===b?"height":"width",re=te+g[Q],ie=te-g[ee],oe=-1!==[Hl,Gl].indexOf(v),se=null!=(K=null==A?void 0:A[b])?K:0,ae=oe?re:te-w[ne]-C[ne]-se+T.altAxis,le=oe?te+w[ne]+C[ne]-se-T.altAxis:ie,ce=p&&oe?function(e,t,n){var r=Oc(e,t,n);return r>n?n:r}(ae,te,le):Oc(p?ae:re,te,p?le:ie);S[b]=ce,E[b]=ce-te}t.modifiersData[r]=E}},requiresIfExists:["offset"]};let Bc={tooltip:[],popup:[]};const Dc={directives:{domresize:ca()},props:{mode:{type:String,default:"tooltip"},value:{type:Boolean,default:!1},displayType:{type:String,default:"block"},cmpZIndex:{type:Number,default:3e3},isolated:{type:Boolean,default:!1},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!1},autoFitMaxWidth:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},placementDist:{type:Number,default:5},borderRadius:{type:Number,default:4},textFontSize:{type:String,default:"0.85rem"},textColor:{type:String,default:"white"},backgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},paddingStyle:{type:Object,default:()=>({v:2,h:10})},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)"},transitionTime:{type:Number,default:200},editable:{type:Boolean,default:!0}},data:function(){return{mmkey:la(),valueTrans:!1,triggerWidth:null,cursorTriggerInner:!1,clickContentInner:!1,windowMousedown:null,windowMouseup:null,windowScroll:null,popperInstance:null,popperShow:!1,contentStyle:"",mouseClientX:0,mouseClientY:0}},mounted:function(){let e=this;e.windowMousemove=t=>{e.mouseClientX=t.clientX,e.mouseClientY=t.clientY},window.addEventListener("mousemove",e.windowMousemove,!1),e.windowMousedown=t=>{let n=me(e,"$refs.divTrigger",null);e.cursorTriggerInner=!!n&&gl(t.clientX,t.clientY,n);let r=me(e,"$refs.divContent",null);e.valueTrans&&r?e.clickContentInner=gl(t.clientX,t.clientY,r):e.clickContentInner=!1},window.addEventListener("mousedown",e.windowMousedown,!1),e.windowMouseup=t=>{e.checkTriggerEff(e.mmkey)&&(!e.valueTrans||e.cursorTriggerInner||e.clickContentInner?(e.cursorTriggerInner=!1,e.clickContentInner=!1):e.evHide("click","windowMouseup"))},window.addEventListener("mouseup",e.windowMouseup,!1),e.windowScroll=t=>{if("hover"!==e.kind)return;let n=me(e,"$refs.divTrigger",null);n&&(e.cursorTriggerInner=!!n&&gl(e.mouseClientX,e.mouseClientY,n),e.cursorTriggerInner?e.valueTrans||e.evShow("hover","windowScroll"):e.valueTrans&&e.evHide("hover","windowScroll"))},window.addEventListener("scroll",e.windowScroll,!1)},beforeDestroy:function(){let e=this;window.removeEventListener("mousemove",e.windowMousemove,!1),window.removeEventListener("mousedown",e.windowMousedown,!1),window.removeEventListener("mouseup",e.windowMouseup,!1),window.removeEventListener("scroll",e.windowMouseup,!1),e.triggerEvent(!1),clearInterval(e.trt)},computed:{changeValue:function(){let e=this,t=e.value;return e.isolated||e.updateValue(t,"changeValue"),""},useDisplayType:function(){return"line"===this.displayType?"display:block;":"display:inline-block;"},useMinWidth:function(){let e=this;return Br(e.minWidth)?`min-width:${e.minWidth}px;`:e.autoFitMinWidth?`min-width:${e.triggerWidth}px;`:""},useMaxWidth:function(){let e=this;return Br(e.maxWidth)?`max-width:${e.maxWidth}px;`:e.autoFitMaxWidth?`max-width:${e.triggerWidth}px;`:""},useBorderRadius:function(){let e=this;return Br(e.borderRadius)?`border-radius:${e.borderRadius}px;`:""},useTextFontSize:function(){let e=this.textFontSize;return e=Yo(e,";",""),`font-size:${e};`},useTextColor:function(){return Za(this.textColor)},useBackgroundColor:function(){return Za(this.backgroundColor)},usePadding:function(){return`padding:${hl(this.paddingStyle)};`},useShadow:function(){if(!this.shadow)return"";let e=Yo(this.shadowStyle,";","");return""!==e?`box-shadow:${e};`:""},kind:function(){return"popup"===this.mode?"click":"hover"}},methods:{addTrigger:function(e){return function(e,t){Bc[e].push(t)}(this.mode,e)},checkTriggerEff:function(e){return function(e,t){return ml(Bc[e])===t}(this.mode,e)},removeTrigger:function(e){return function(e,t){Rr(Bc[e],t)}(this.mode,e)},showPopper:function(e){let t=this,n=me(t,"$refs.divTrigger",null);if(null===n)return;t.$nextTick((()=>{t.triggerWidth=n.offsetWidth}));let r=me(t,"$refs.divContent",null);if(null===r)return;t.addTrigger(t.mmkey);let i={strategy:"fixed",placement:t.placement,modifiers:[kc,xc,{name:"computeStyles",options:{gpuAcceleration:!1}},Ec,{name:"flip",options:{fallbackPlacements:["bottom-start","bottom-end","top-start","top-end","top","right-start","right-end","right","left-start","left-end","left"]}},Rc,{name:"offset",options:{offset:[0,t.placementDist]}},Ic]};t.popperInstance=Sc(n,r,i)},hidePopper:function(e){let t=this;t.popperInstance&&(t.popperInstance.destroy(),t.popperInstance=null),setTimeout((()=>{t.removeTrigger(t.mmkey)}),20)},updatePopper:function(e){let t=this;t.popperInstance&&t.popperInstance.update(),t.$emit("resize",e)},displayPopper:function(){let e=this;e.$nextTick((()=>{let t=e.editable&&e.valueTrans;if(t&&!e.popperShow){let t=-15;e.contentStyle=`opacity:0; pointer-events:none; transform:translateY(${t}px);`,e.showPopper("displayPopper"),e.popperShow=!0,e.$emit("show"),setTimeout((()=>{e.contentStyle=`transition:all ${e.transitionTime}ms ease-out; opacity:1; pointer-events:none;`}),1),setTimeout((()=>{e.contentStyle=""}),e.transitionTime)}else!t&&e.popperShow&&(e.hidePopper("displayPopper"),e.popperShow=!1,e.$emit("hide"))}))},updateValue:function(e,t){let n=this;n.editable&&(n.valueTrans=e,n.displayPopper())},triggerEvent:function(e){let t=this;t.editable&&(t.isolated&&t.updateValue(e,"triggerEvent"),t.$nextTick((()=>{t.$emit("input",e)})))},evShow:function(e,t){let n=this;n.editable&&(n.valueTrans||n.kind===e&&n.triggerEvent(!0))},evHide:function(e,t){let n=this;n.editable&&n.valueTrans&&n.kind===e&&n.triggerEvent(!1)}}};var Nc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:""+e.useDisplayType,attrs:{changeValue:e.changeValue}},[n("div",{ref:"divTrigger",staticStyle:{outline:"none"},attrs:{tabindex:"0"},on:{click:function(t){return e.evShow("click","click")},mouseenter:function(t){return e.evShow("hover","mouseenter")},mouseleave:function(t){return e.evHide("hover","mouseleave")}}},[e._t("trigger")],2),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.valueTrans,expression:"valueTrans"},{name:"domresize",rawName:"v-domresize"}],ref:"divContent",staticClass:"WPopup-Content",style:"z-index:"+e.cmpZIndex+";",on:{domresize:e.updatePopper}},[e.valueTrans?n("div",{style:e.contentStyle+" "+e.usePadding+" "+e.useTextFontSize+" color:"+e.useTextColor+"; background:"+e.useBackgroundColor+"; "+e.useMinWidth+" "+e.useMaxWidth+" "+e.useBorderRadius+" "+e.useShadow},[e._t("content",null,{funHide:function(){e.updateValue(!1,"slot")}})],2):e._e()])])};Nc._withStripped=!0;const Uc=Ka({render:Nc,staticRenderFns:[]},(function(e){e&&e("data-v-059d708c_0",{source:"\n.WPopup-Content[data-popper-reference-hidden][data-v-059d708c] {\r\n visibility: hidden;\r\n pointer-events: none;\n}\r\n",map:{version:3,sources:["D:\\- 006 - 開源\\開源-JS-105-3-w-threejs-vue\\w-threejs-vue\\node_modules\\w-component-vue\\src\\components\\WTooltip.vue"],names:[],mappings:";AAizBA;IACA,kBAAA;IACA,oBAAA;AACA",file:"WTooltip.vue",sourcesContent:["<template>\r\n <div\r\n :style=\"`${useDisplayType}`\"\r\n :changeValue=\"changeValue\"\r\n >\r\n\r\n <div\r\n ref=\"divTrigger\"\r\n style=\"outline:none;\"\r\n tabindex=\"0\"\r\n @click=\"evShow('click','click')\"\r\n @mouseenter=\"evShow('hover','mouseenter')\"\r\n @mouseleave=\"evHide('hover','mouseleave')\"\r\n >\r\n\r\n <slot name=\"trigger\"></slot>\r\n\r\n </div>\r\n\r\n \x3c!-- 不能給予position因會被popupjs洗掉, 但可給z-index, 且popupjs會改用transform:translate定位 --\x3e\r\n \x3c!-- 若使用minWidth, 會使popupjs重算給予minWidth用以自動撐開彈窗寬度失效, 若於其內slot外添加div給予minWidth, 亦會使popupjs給予minWidth機制失效, 待研究 --\x3e\r\n <div\r\n ref=\"divContent\"\r\n class=\"WPopup-Content\"\r\n :style=\"`z-index:${cmpZIndex};`\"\r\n v-show=\"valueTrans\"\r\n v-domresize\r\n @domresize=\"updatePopper\"\r\n >\r\n <div\r\n :style=\"`${contentStyle} ${usePadding} ${useTextFontSize} color:${useTextColor}; background:${useBackgroundColor}; ${useMinWidth} ${useMaxWidth} ${useBorderRadius} ${useShadow}`\"\r\n v-if=\"valueTrans\"\r\n >\r\n <slot\r\n name=\"content\"\r\n :funHide=\"()=>{updateValue(false,'slot')}\"\r\n ></slot>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport get from 'lodash-es/get'\r\nimport last from 'lodash-es/last'\r\nimport pull from 'lodash-es/pull'\r\nimport isNumber from 'lodash-es/isNumber'\r\nimport genID from 'wsemi/src/genID.mjs'\r\nimport replace from 'wsemi/src/replace.mjs'\r\nimport domIsClientXYIn from 'wsemi/src/domIsClientXYIn.mjs'\r\nimport convertColor from '../js/convertColor.mjs'\r\nimport parseSpace from '../js/parseSpace.mjs'\r\nimport domResize from '../js/domResize.mjs'\r\nimport { createPopper } from '@popperjs/core/lib/popper-lite.js' //不用安裝@popperjs/core, 因wsemi安裝tippy.js內有依賴@popperjs/core\r\nimport flip from '@popperjs/core/lib/modifiers/flip.js'\r\nimport offset from '@popperjs/core/lib/modifiers/offset.js'\r\nimport hide from '@popperjs/core/lib/modifiers/hide.js'\r\nimport preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow.js'\r\nimport computeStyles from '@popperjs/core/lib/modifiers/computeStyles'\r\n\r\n\r\n//tootip與popup不共用已出現項目清單, 避免互相影響\r\nlet kpRespList = {\r\n tooltip: [],\r\n popup: [],\r\n}\r\nfunction addTriggerMode(mode, mmkey) {\r\n kpRespList[mode].push(mmkey)\r\n}\r\nfunction checkTriggerEffMode(mode, mmkey) {\r\n return last(kpRespList[mode]) === mmkey\r\n}\r\nfunction removeTriggerMode(mode, mmkey) {\r\n pull(kpRespList[mode], mmkey)\r\n}\r\n\r\n\r\n/**\r\n * @vue-prop {String} [mode='tooltip'] 輸入組件模式字串,可選'tooltip'與'popup',預設'tooltip'\r\n * @vue-prop {Boolean} [value=false] 輸入是否顯示布林值,預設false\r\n * @vue-prop {String} [displayType='block'] 輸入display設定字串,可選'block'與'line',預設'block'\r\n * @vue-prop {Number} [cmpZIndex=3000] 輸入提示窗或彈窗使用z-index數字,預設3000\r\n * @vue-prop {Boolean} [isolated=false] 輸入提示窗或彈窗當mode為'popup'時是否為獨立顯引狀態布林值,也就是可不接收外部傳入value值,預設false\r\n * @vue-prop {Number} [minWidth=null] 輸入提示窗或彈窗最小寬度數字,單位為px,預設null\r\n * @vue-prop {Number} [maxWidth=null] 輸入提示窗或彈窗最大寬度數字,單位為px,預設null\r\n * @vue-prop {Boolean} [autoFitMinWidth=false] 輸入是否使用驅動區寬度作為提示窗或彈窗之最小寬度布林值,預設false\r\n * @vue-prop {Boolean} [autoFitMaxWidth=false] 輸入是否使用驅動區寬度作為提示窗或彈窗之最大寬度布林值,預設false\r\n * @vue-prop {String} [placement='bottom'] 輸入提示窗或彈窗出現位置字串,可選'top-start'、'top'、'top-end'、'bottom-start'、'bottom'、'bottom-end'、'left-start'、'left'、'left-end'、'right-start'、'right'、'right-end'、,預設'bottom'\r\n * @vue-prop {Number} [placementDist=5] 輸入提示窗或彈窗距離觸發元素距離數字,單位為px,預設5\r\n * @vue-prop {Number} [borderRadius=4] 輸入提示窗或彈窗框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [textFontSize='0.85rem'] 輸入提示窗或彈窗文字字型大小字串,預設'0.85rem'\r\n * @vue-prop {String} [textColor='white'] 輸入提示窗或彈窗文字顏色字串,預設'white'\r\n * @vue-prop {String} [backgroundColor='rgba(60,60,60,0.75)'] 輸入提示窗或彈窗背景顏色字串,預設'rgba(60,60,60,0.75)'\r\n * @vue-prop {Object} [paddingStyle={v:2,h:10}] 輸入提示窗或彈窗內寬距離設定物件,可用鍵值為v、h、left、right、top、bottom,v代表同時設定top與bottom,h代表設定left與right,若有重複設定時後面鍵值會覆蓋前面,各鍵值為寬度數字,單位為px,預設{v:2,h:10}\r\n * @vue-prop {Boolean} [shadow=true] 輸入提示窗或彈窗是否顯示陰影布林值,預設true\r\n * @vue-prop {String} [shadowStyle=''] 輸入提示窗或彈窗陰影顏色字串,預設值詳見props\r\n * @vue-prop {Number} [transitionTime=200] 輸入提示窗或彈窗淡入出現時間數字,單位為ms,預設200\r\n * @vue-prop {Boolean} [editable=true] 輸入是否為編輯模式布林值,預設true\r\n */\r\nexport default {\r\n directives: {\r\n domresize: domResize(),\r\n },\r\n props: {\r\n mode: {\r\n type: String,\r\n default: 'tooltip', //tooltip, popup\r\n },\r\n value: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n displayType: {\r\n type: String,\r\n default: 'block', //line, block\r\n },\r\n cmpZIndex: {\r\n type: Number,\r\n default: 3000,\r\n },\r\n isolated: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n minWidth: {\r\n type: Number,\r\n default: null,\r\n },\r\n maxWidth: {\r\n type: Number,\r\n default: null,\r\n },\r\n autoFitMinWidth: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n autoFitMaxWidth: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n placement: {\r\n type: String,\r\n default: 'bottom',\r\n },\r\n placementDist: {\r\n type: Number,\r\n default: 5,\r\n },\r\n borderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n textFontSize: {\r\n type: String,\r\n default: '0.85rem',\r\n },\r\n textColor: {\r\n type: String,\r\n default: 'white',\r\n },\r\n backgroundColor: {\r\n type: String,\r\n default: 'rgba(60,60,60,0.75)',\r\n },\r\n paddingStyle: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n v: 2,\r\n h: 10,\r\n }\r\n },\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n shadowStyle: {\r\n type: String,\r\n default: '0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)',\r\n },\r\n transitionTime: {\r\n type: Number,\r\n default: 200,\r\n },\r\n editable: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n\r\n mmkey: genID(), //beforeMount內無法變更data, mounted內會晚於computed, 故優先放於data生成\r\n // mmkey: (() => {\r\n // let id = genID()\r\n // console.log('data gen mmkey', id)\r\n // return id\r\n // })(),\r\n\r\n valueTrans: false,\r\n\r\n triggerWidth: null,\r\n cursorTriggerInner: false,\r\n clickContentInner: false,\r\n windowMousedown: null,\r\n windowMouseup: null,\r\n windowScroll: null,\r\n\r\n popperInstance: null,\r\n popperShow: false,\r\n\r\n contentStyle: '',\r\n\r\n mouseClientX: 0,\r\n mouseClientY: 0,\r\n\r\n }\r\n },\r\n mounted: function() {\r\n //console.log('mounted')\r\n\r\n let vo = this\r\n\r\n //windowMousemove\r\n vo.windowMousemove = (e) => {\r\n // console.log(vo.mmkey, 'windowMousemove', e)\r\n\r\n //save\r\n vo.mouseClientX = e.clientX\r\n vo.mouseClientY = e.clientY\r\n\r\n }\r\n window.addEventListener('mousemove', vo.windowMousemove, false)\r\n\r\n //windowMousedown\r\n vo.windowMousedown = (e) => {\r\n // console.log(vo.mmkey, 'windowMousedown', e)\r\n\r\n //divTrigger\r\n let divTrigger = get(vo, '$refs.divTrigger', null)\r\n\r\n //cursorTriggerInner, 滑鼠游標是否點擊於觸發區內\r\n if (divTrigger) {\r\n vo.cursorTriggerInner = domIsClientXYIn(e.clientX, e.clientY, divTrigger)\r\n }\r\n else {\r\n vo.cursorTriggerInner = false\r\n }\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent', null)\r\n\r\n //clickContentInner, 是否當前為顯示且擊於內容區內\r\n if (vo.valueTrans && divContent) {\r\n vo.clickContentInner = domIsClientXYIn(e.clientX, e.clientY, divContent)\r\n }\r\n else {\r\n vo.clickContentInner = false\r\n }\r\n\r\n }\r\n window.addEventListener('mousedown', vo.windowMousedown, false)\r\n\r\n //windowMouseup\r\n vo.windowMouseup = (e) => {\r\n // console.log(vo.mmkey, 'windowMouseup', e, vo.checkTriggerEff(vo.mmkey))\r\n\r\n //check\r\n if (!vo.checkTriggerEff(vo.mmkey)) {\r\n return\r\n }\r\n\r\n //當前為顯示時, 非點擊於觸發區與內容區, 才觸發隱藏事件\r\n if (vo.valueTrans && !vo.cursorTriggerInner && !vo.clickContentInner) {\r\n //console.log(vo.mmkey, 'click隱藏')\r\n\r\n //evHide\r\n vo.evHide('click', 'windowMouseup')\r\n\r\n }\r\n else {\r\n //console.log(vo.mmkey, 'click不隱藏')\r\n vo.cursorTriggerInner = false\r\n vo.clickContentInner = false\r\n }\r\n\r\n }\r\n window.addEventListener('mouseup', vo.windowMouseup, false)\r\n\r\n //windowScroll\r\n vo.windowScroll = (e) => {\r\n // console.log(vo.mmkey, 'windowScroll', e, vo.checkTriggerEff(vo.mmkey))\r\n\r\n // //check, 不能偵測checkTriggerEff, 因須支援由隱藏但通過捲動而滑鼠進入組件而顯示機制\r\n // if (!vo.checkTriggerEff(vo.mmkey)) {\r\n // return\r\n // }\r\n\r\n //check, 只針對hover做處理\r\n if (vo.kind !== 'hover') {\r\n return\r\n }\r\n\r\n //divTrigger\r\n let divTrigger = get(vo, '$refs.divTrigger', null)\r\n\r\n //check\r\n if (!divTrigger) {\r\n return\r\n }\r\n\r\n //cursorTriggerInner, 滑鼠游標是否點擊於觸發區內\r\n if (divTrigger) {\r\n vo.cursorTriggerInner = domIsClientXYIn(vo.mouseClientX, vo.mouseClientY, divTrigger)\r\n // console.log('domIsClientXYIn vo.cursorTriggerInner', vo.cursorTriggerInner)\r\n }\r\n else {\r\n vo.cursorTriggerInner = false\r\n // console.log('force vo.cursorTriggerInner', vo.cursorTriggerInner)\r\n }\r\n\r\n if (vo.cursorTriggerInner) {\r\n //滑鼠位於於觸發區\r\n\r\n if (vo.valueTrans) {\r\n //當前為顯示\r\n\r\n //不處理\r\n\r\n }\r\n else {\r\n //當前為隱藏\r\n // console.log(vo.mmkey, 'scroll顯示')\r\n\r\n //evShow\r\n vo.evShow('hover', 'windowScroll')\r\n\r\n }\r\n\r\n }\r\n else {\r\n //滑鼠非位於於觸發區\r\n\r\n if (vo.valueTrans) {\r\n //當前為顯示\r\n // console.log(vo.mmkey, 'scroll隱藏')\r\n\r\n //evHide\r\n vo.evHide('hover', 'windowScroll')\r\n\r\n }\r\n else {\r\n //當前為隱藏\r\n\r\n //不處理\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n window.addEventListener('scroll', vo.windowScroll, false)\r\n\r\n },\r\n beforeDestroy: function() {\r\n //console.log('beforeDestroy')\r\n\r\n let vo = this\r\n\r\n //window remove mousemove, mousedown, mouseup, scroll\r\n window.removeEventListener('mousemove', vo.windowMousemove, false)\r\n window.removeEventListener('mousedown', vo.windowMousedown, false)\r\n window.removeEventListener('mouseup', vo.windowMouseup, false)\r\n window.removeEventListener('scroll', vo.windowMouseup, false)\r\n\r\n // //hidePopper, 不論click或hover一律隱藏\r\n // vo.hidePopper('beforeDestroy')\r\n\r\n //triggerEvent for hide\r\n vo.triggerEvent(false)\r\n\r\n //bbb\r\n clearInterval(vo.trt)\r\n\r\n },\r\n computed: {\r\n\r\n changeValue: function () {\r\n //console.log('computed changeValue')\r\n\r\n let vo = this\r\n\r\n //trigger\r\n let value = vo.value\r\n let isolated = vo.isolated\r\n\r\n //updateValue\r\n if (!isolated) {\r\n vo.updateValue(value, 'changeValue')\r\n }\r\n\r\n return ''\r\n },\r\n\r\n useDisplayType: function() {\r\n let vo = this\r\n if (vo.displayType === 'line') {\r\n return 'display:block;'\r\n }\r\n return 'display:inline-block;'\r\n },\r\n\r\n useMinWidth: function() {\r\n //console.log('computed useMinWidth')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.minWidth)) {\r\n return `min-width:${vo.minWidth}px;`\r\n }\r\n else if (vo.autoFitMinWidth) {\r\n return `min-width:${vo.triggerWidth}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useMaxWidth: function() {\r\n //console.log('computed useMaxWidth')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.maxWidth)) {\r\n return `max-width:${vo.maxWidth}px;`\r\n }\r\n else if (vo.autoFitMaxWidth) {\r\n return `max-width:${vo.triggerWidth}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useBorderRadius: function() {\r\n //console.log('computed useBorderRadius')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.borderRadius)) {\r\n return `border-radius:${vo.borderRadius}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useTextFontSize: function() {\r\n let vo = this\r\n let s = vo.textFontSize\r\n s = replace(s, ';', '')\r\n return `font-size:${s};`\r\n },\r\n\r\n useTextColor: function() {\r\n //console.log('computed useTextColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.textColor)\r\n },\r\n\r\n useBackgroundColor: function() {\r\n //console.log('computed useBackgroundColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.backgroundColor)\r\n },\r\n\r\n usePadding: function() {\r\n //console.log('computed usePadding')\r\n\r\n let vo = this\r\n\r\n //parseSpace\r\n let cs = parseSpace(vo.paddingStyle)\r\n\r\n //padding\r\n let padding = `padding:${cs};`\r\n\r\n return padding\r\n },\r\n\r\n useShadow: function() {\r\n //console.log('computed useShadow')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.shadow) {\r\n return ''\r\n }\r\n\r\n //shadowStyle\r\n let s = replace(vo.shadowStyle, ';', '')\r\n if (s !== '') {\r\n return `box-shadow:${s};`\r\n }\r\n\r\n return ''\r\n },\r\n\r\n kind: function() {\r\n let vo = this\r\n if (vo.mode === 'popup') {\r\n return 'click'\r\n }\r\n return 'hover'\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n addTrigger: function(mmkey) {\r\n let vo = this\r\n return addTriggerMode(vo.mode, mmkey)\r\n },\r\n\r\n checkTriggerEff: function(mmkey) {\r\n let vo = this\r\n return checkTriggerEffMode(vo.mode, mmkey)\r\n },\r\n\r\n removeTrigger: function(mmkey) {\r\n let vo = this\r\n return removeTriggerMode(vo.mode, mmkey)\r\n },\r\n\r\n showPopper: function(from) {\r\n // console.log('methods showPopper', this.mmkey, from)\r\n\r\n let vo = this\r\n\r\n //divTrigger\r\n let divTrigger = get(vo, '$refs.divTrigger', null)\r\n if (divTrigger === null) {\r\n return //console.log('無法找到點擊區元素')\r\n }\r\n\r\n //$nextTick, 因顯示後popperjs會用divContent撐開導致divTrigger寬度等同於divContent, 需延遲取得offsetWidth才是正確寬度\r\n vo.$nextTick(() => {\r\n\r\n //update triggerWidth\r\n vo.triggerWidth = divTrigger.offsetWidth\r\n\r\n })\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent', null)\r\n\r\n //check\r\n if (divContent === null) {\r\n return //console.log('無法找到顯示元素')\r\n }\r\n\r\n //addTrigger, 採同步方式添加, popup顯示前就會mmkey就會進清單\r\n vo.addTrigger(vo.mmkey)\r\n\r\n //@popperjs/core 2.x\r\n let opt = {\r\n strategy: 'fixed', //盡量使用'fixed'而不用'absolute', 否則位於多層dialog或多層drawer內popup顯示會異常\r\n placement: vo.placement,\r\n modifiers: [\r\n preventOverflow,\r\n computeStyles,\r\n {\r\n name: 'computeStyles',\r\n options: {\r\n gpuAcceleration: false, //預設true, 可關閉GPU加速\r\n },\r\n },\r\n flip,\r\n {\r\n name: 'flip',\r\n options: {\r\n fallbackPlacements: ['bottom-start', 'bottom-end', 'top-start', 'top-end', 'top', 'right-start', 'right-end', 'right', 'left-start', 'left-end', 'left'],\r\n },\r\n },\r\n offset,\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: [0, vo.placementDist],\r\n //因popperjs會自動調位置, 故得通過callback函數處理指定位置時的偏移量\r\n // offset: ({ placement, reference, popper }) => {\r\n // console.log('offset', placement, reference, popper, vo.placementDist)\r\n // if (placement === 'bottom-start' || placement === 'bottom' || placement === 'bottom-end') {\r\n // return [0, vo.placementDist]\r\n // }\r\n // else if (placement === 'top-start' || placement === 'top' || placement === 'top-end') {\r\n // return [0, vo.placementDist]\r\n // }\r\n // else if (placement === 'left-start' || placement === 'left' || placement === 'left-end') {\r\n // return [0, vo.placementDist]\r\n // }\r\n // else if (placement === 'right-start' || placement === 'right' || placement === 'right-end') {\r\n // return [0, vo.placementDist]\r\n // }\r\n // else {\r\n // return []\r\n // }\r\n // // return [0, vo.placementDist] //[Skidding, Distance]\r\n // },\r\n },\r\n },\r\n hide,\r\n ],\r\n }\r\n vo.popperInstance = createPopper(divTrigger, divContent, opt)\r\n // console.log('popperInstance', vo.popperInstance)\r\n\r\n },\r\n\r\n hidePopper: function(from) {\r\n // console.log('methods hidePopper', from, this.mmkey)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (vo.popperInstance) {\r\n\r\n //destroy\r\n vo.popperInstance.destroy()\r\n vo.popperInstance = null\r\n\r\n }\r\n\r\n //非同步移除用nextTick會太快, 得使用setTimeout\r\n //不管有沒有popperInstance都進行移除, 於開發階段避免熱更新問題\r\n setTimeout(() => {\r\n\r\n //removeTrigger, 需採非同步移除, 避免window事件結束後, 此時會繼續觸發前面popup內的window事件, 若採同步移除就無法讓前面popup判斷是否需屏蔽\r\n vo.removeTrigger(vo.mmkey)\r\n\r\n }, 20)\r\n\r\n },\r\n\r\n updatePopper: function(msg) {\r\n //console.log('methods updatePopper', msg)\r\n\r\n let vo = this\r\n\r\n //update\r\n if (vo.popperInstance) {\r\n vo.popperInstance.update()\r\n }\r\n\r\n //emit\r\n vo.$emit('resize', msg)\r\n\r\n },\r\n\r\n displayPopper: function() {\r\n //console.log('methods displayPopper')\r\n\r\n let vo = this\r\n\r\n //showPopper or hidePopper\r\n vo.$nextTick(() => {\r\n\r\n //b\r\n let b = vo.editable && vo.valueTrans //顯示時valueTrans=true與可編輯時才顯示, 否則一律隱藏\r\n\r\n if (b && !vo.popperShow) {\r\n // console.log('call showPopper', vo.mmkey)\r\n\r\n //shift, 暫時無法取得popper自動變更的placement, shift無法即時連動, 待研究\r\n let shift = -15\r\n // if (vo.placement.indexOf('top') >= 0) {\r\n // shift = 15\r\n // }\r\n // console.log('vo.placement', vo.placement, vo.placement.indexOf('top'))\r\n // console.log('shift', shift)\r\n\r\n //contentStyle, 初始化使用pointer-events:none避免彈出區遮蔽驅動區導致觸發隱藏\r\n vo.contentStyle = `opacity:0; pointer-events:none; transform:translateY(${shift}px);`\r\n\r\n vo.showPopper('displayPopper')\r\n vo.popperShow = true\r\n vo.$emit('show')\r\n // console.log('emit show')\r\n\r\n //contentStyle, 顯示才給予transition用以驅動動畫, 動畫期間使用pointer-events:none避免彈出區遮蔽驅動區導致觸發隱藏\r\n setTimeout(() => {\r\n vo.contentStyle = `transition:all ${vo.transitionTime}ms ease-out; opacity:1; pointer-events:none;`\r\n }, 1)\r\n\r\n //contentStyle, 動畫結束清除pointer-events:none, 使內部能接收事件\r\n setTimeout(() => {\r\n vo.contentStyle = ``\r\n }, vo.transitionTime)\r\n\r\n }\r\n else if (!b && vo.popperShow) {\r\n // console.log('call hidePopper', vo.mmkey)\r\n\r\n vo.hidePopper('displayPopper')\r\n vo.popperShow = false\r\n vo.$emit('hide')\r\n // console.log('emit hide')\r\n\r\n }\r\n\r\n })\r\n\r\n },\r\n\r\n updateValue: function (value, from) {\r\n // console.log('methods updateValue', value, from)\r\n\r\n let vo = this\r\n\r\n //check, 不可編輯時跳出\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //save\r\n vo.valueTrans = value\r\n // console.log('updateValue', vo.valueTrans, from, vo.mmkey)\r\n\r\n //displayPopper\r\n vo.displayPopper()\r\n\r\n },\r\n\r\n triggerEvent: function(value) {\r\n // console.log('methods triggerEvent', value)\r\n\r\n let vo = this\r\n\r\n //check, 不可編輯時跳出\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //check\r\n if (vo.isolated) {\r\n\r\n //updateValue\r\n vo.updateValue(value, 'triggerEvent')\r\n\r\n }\r\n\r\n //$nextTick, 不論是否isolated都須emit\r\n vo.$nextTick(() => {\r\n\r\n //emit\r\n vo.$emit('input', value)\r\n\r\n })\r\n\r\n },\r\n\r\n evShow: function(kind, from) {\r\n // console.log('methods evShow', kind, from)\r\n\r\n let vo = this\r\n\r\n //check, 不可編輯時跳出\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //check, 已經顯示就不再顯示\r\n if (vo.valueTrans) {\r\n return\r\n }\r\n\r\n //check, 只允許限制模式\r\n if (vo.kind !== kind) {\r\n return\r\n }\r\n\r\n //triggerEvent for show\r\n vo.triggerEvent(true)\r\n\r\n },\r\n\r\n evHide: function(kind, from) {\r\n // console.log('methods evHide', kind, from)\r\n\r\n let vo = this\r\n\r\n //check, 不可編輯時跳出\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //check, 已經隱藏就不再隱藏\r\n if (!vo.valueTrans) {\r\n return\r\n }\r\n\r\n //check, 只允許限制模式\r\n if (vo.kind !== kind) {\r\n return\r\n }\r\n\r\n //triggerEvent for hide\r\n vo.triggerEvent(false)\r\n\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.WPopup-Content[data-popper-reference-hidden] {\r\n visibility: hidden;\r\n pointer-events: none;\r\n}\r\n</style>\r\n\r\n"]},media:void 0})}),Dc,"data-v-059d708c",false,undefined,!1,el,void 0,void 0);var Fc={components:{WIcon:fl,WIconLoading:ol,WTooltip:Uc},props:{tooltip:{type:String,default:""},icon:{type:String,default:""},iconSize:{type:Number,default:22},iconColor:{type:String,default:"grey darken-1"},iconColorHover:{type:String,default:"grey darken-2"},iconColorFocus:{type:String,default:"grey darken-3"},iconColorActive:{type:String,default:"grey darken-3"},borderRadius:{type:[Number,String],default:"50%"},borderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"rgb(241,241,241)"},backgroundColorHover:{type:String,default:"rgb(236,236,236)"},backgroundColorFocus:{type:String,default:"rgb(230,230,230)"},backgroundColorActive:{type:String,default:"rgb(230,230,230)"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},rippleColor:{type:String,default:"rgba(255, 255, 255, 0.5)"},paddingStyle:{type:Object,default:()=>({v:4,h:4})},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"},active:{type:Boolean,default:!1},cursorPointer:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"grey darken-2"},promiseUnlock:{type:Boolean,default:!1},role:{type:String,default:"button"},editable:{type:Boolean,default:!0},disabledColor:{type:String,default:"rgba(255,255,255,0.5)"}},data:function(){return{activeTrans:!1,hoverTrans:!1,focusTrans:!1,loadingTrans:!1}},mounted:function(){},computed:{changeActive:function(){return this.activeTrans=this.active,""},changeLoading:function(){return this.loadingTrans=this.loading,""},effIconColor:function(){return Za(this.iconColor)},effIconColorHover:function(){return Za(this.iconColorHover)},effIconColorFocus:function(){return Za(this.iconColorFocus)},effIconColorActive:function(){return Za(this.iconColorActive)},useIconColor:function(){let e,t=this;return t.loadingTrans?t.effIconColor:(e=t.activeTrans?t.effIconColorActive:t.focusTrans?t.effIconColorFocus:t.hoverTrans?t.effIconColorHover:t.effIconColor,t.editable||(e=t.activeTrans?t.effIconColorActive:t.effIconColor),e)},useBorderRadius:function(){let e=this,t="0px";if($i(e.borderRadius)){t=`${Yi(e.borderRadius)}px;`}else ji(e.borderRadius)&&(t=e.borderRadius);let n="0px",r="0px",i="0px",o="0px";return!0===me(e,"borderRadiusStyle.left")&&(n=t,i=t),!0===me(e,"borderRadiusStyle.right")&&(r=t,o=t),!0===me(e,"borderRadiusStyle.top")&&(n=t,r=t),!0===me(e,"borderRadiusStyle.bottom")&&(i=t,o=t),!0!==me(e,"borderRadiusStyle.topLeft")&&!0!==me(e,"borderRadiusStyle.top-left")||(n=t),!0!==me(e,"borderRadiusStyle.topRight")&&!0!==me(e,"borderRadiusStyle.top-right")||(r=t),!0!==me(e,"borderRadiusStyle.bottomLeft")&&!0!==me(e,"borderRadiusStyle.bottom-left")||(i=t),!0!==me(e,"borderRadiusStyle.bottomRight")&&!0!==me(e,"borderRadiusStyle.bottom-right")||(o=t),`border-top-left-radius:${n}; border-top-right-radius:${r}; border-bottom-left-radius:${i}; border-bottom-right-radius:${o};`},effBorderColor:function(){return Za(this.borderColor)},effBorderColorHover:function(){return Za(this.borderColorHover)},effBorderColorFocus:function(){return Za(this.borderColorFocus)},effBorderColorActive:function(){return Za(this.borderColorActive)},useBorderColor:function(){let e,t=this;return t.loadingTrans?t.effBorderColor:(e=t.activeTrans?t.effBorderColorActive:t.focusTrans?t.effBorderColorFocus:t.hoverTrans?t.effBorderColorHover:t.effBorderColor,t.editable||(e=t.activeTrans?t.effBorderColorActive:t.effBorderColor),e)},effBackgroundColor:function(){return Za(this.backgroundColor)},effBackgroundColorHover:function(){return Za(this.backgroundColorHover)},effBackgroundColorFocus:function(){return Za(this.backgroundColorFocus)},effBackgroundColorActive:function(){return Za(this.backgroundColorActive)},useBackgroundColor:function(){let e,t=this;return t.loadingTrans?t.effBackgroundColor:(e=t.activeTrans?t.effBackgroundColorActive:t.focusTrans?t.effBackgroundColorFocus:t.hoverTrans?t.effBackgroundColorHover:t.effBackgroundColor,t.editable||(e=t.activeTrans?t.effBackgroundColorActive:t.effBackgroundColor),e)},effRippleColor:function(){return Za(this.rippleColor)},effLoadingColor:function(){return Za(this.loadingColor)},effDisabledColor:function(){return Za(this.disabledColor)},usePadding:function(){let e=this;return`padding:${hl(e.paddingStyle,{ext:{left:e.shiftLeft,right:e.shiftRight}})};`},useShadow:function(){let e=this;return e.shadow&&ji(e.shadowStyle)?"box-shadow:"+function(e,t,n){let r=Ya(e=Yo(e,"}","{"),"{");return r=$n(r,(e=>{if(e.indexOf(t)>=0){let t=qo(e,"=")[1];return t=$i(t)?Yi(t):.2,function(e,t){let n=Za(e),r=ea.toRgba(n);return r.a=t,ea.toRgbaString(r)}(n,t)}return e})),ll(r,"")}(e.shadowStyle,"backgroundColorAlpha",e.backgroundColor):""},hasTooltop:function(){return ji(this.tooltip)}},methods:{ripple:function(e){let t=this;t.editable&&(t.loadingTrans||t.$nextTick((()=>{ul(e.currentTarget,e,{color:t.effRippleColor,timeDuration:500})})))},clickBtn:function(e){let t=this;if(t.editable&&!t.loadingTrans)if(t.promiseUnlock){t.loadingTrans=!0,t.$nextTick((()=>{t.$emit("update:loading",t.loadingTrans)}));let e=Wi();t.$nextTick((()=>{t.$emit("click",{pm:e})})),e.catch().finally((()=>{t.loadingTrans=!1,t.$nextTick((()=>{t.$emit("update:loading",t.loadingTrans)}))}))}else t.$nextTick((()=>{t.$emit("click")}))}}};const zc=Fc;var Hc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{display:"inline-block","vertical-align":"middle",outline:"none","user-select":"none"},attrs:{role:e.editable?e.role:"",changeActive:e.changeActive,changeLoading:e.changeLoading}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:e.tooltipBorderRadius,paddingStyle:e.tooltipPaddingStyle,textFontSize:e.tooltipTextFontSize,textColor:e.tooltipTextColor,backgroundColor:e.tooltipBackgroundColor,editable:e.hasTooltop},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("div",{style:"position:relative; transition:all 0.3s; "+e.usePadding+" "+e.useBorderRadius+" border:"+e.borderWidth+"px solid "+e.useBorderColor+"; background:"+e.useBackgroundColor+"; "+(e.editable&&e.cursorPointer?"cursor:pointer;":"")+" "+e.useShadow+"; outline:none; user-select:none; overflow:hidden;",attrs:{tabindex:"0"},on:{mouseenter:function(t){e.hoverTrans=!0,e.$emit("mouseenter",t)},mouseleave:function(t){e.hoverTrans=!1,e.$emit("mouseleave",t)},focus:function(t){e.focusTrans=!0},blur:function(t){e.focusTrans=!1},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clickBtn(t)},click:function(t){e.ripple(t),e.clickBtn(t)}}},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center"}},[e.loadingTrans?e._e():n("WIcon",{attrs:{icon:e.icon,color:e.useIconColor,colorHover:e.useIconColor,size:e.iconSize}}),e._v(" "),e.loadingTrans?n("WIconLoading",{attrs:{name:"cir-rotate",color:e.effLoadingColor,size:e.iconSize}}):e._e()],1),e._v(" "),e.editable?e._e():n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{style:e.useBorderRadius+" overflow:hidden; width:100%; height:100%;"},[n("div",{style:"background:"+e.effDisabledColor+"; height:100%;"})])])])]},proxy:!0},{key:"content",fn:function(){return[e._v("\n "+e._s(e.tooltip)+"\n ")]},proxy:!0}])})],1)};Hc._withStripped=!0;var Wc={components:{WButtonCircle:Ka({render:Hc,staticRenderFns:[]},(function(e){e&&e("data-v-1589afba_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WButtonCircle.vue"},media:void 0})}),zc,"data-v-1589afba",false,undefined,!1,el,void 0,void 0)},props:{multiCheck:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},value:{type:[Array,Object],default:null},keyIcon:{type:String,default:"icon"},keyTooltip:{type:String,default:"tooltip"},dir:{type:String,default:"horizontal"},iconColor:{type:String,default:"#222"},iconColorHover:{type:String,default:"#444"},iconColorFocus:{type:String,default:"#666"},iconColorActive:{type:String,default:"#333"},iconSize:{type:Number,default:22},borderWidth:{type:Number,default:0},borderRadius:{type:Number,default:4},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"#f2f2f2"},backgroundColorHover:{type:String,default:"#eaeaea"},backgroundColorFocus:{type:String,default:"#e2e2e2"},backgroundColorActive:{type:String,default:"#cecece"},seplineWidth:{type:Number,default:1},seplineColor:{type:String,default:"#ddd"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},rippleColor:{type:String,default:"rgba(255, 255, 255, 0.5)"},paddingStyle:{type:Object,default:()=>({v:4,h:4})},shadow:{type:Boolean,default:!1},shadowStyle:{type:String,default:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"},editable:{type:Boolean,default:!0}},data:function(){return{get:me,itemsTrans:[]}},mounted:function(){},computed:{changeItems:function(){let e=this;let t=Ni(e.items),n=$n(t,(t=>{let n=function(t){let n;return n=e.multiCheck?sl(e.value,t):Or(t,e.value),n}(t);return{active:n,hover:!1}})),r=$n(t,((e,t)=>{let r={data:e},i=n[t];return r.ia=i,r.active=i.active,r.hover=!1,r}));return e.itemsTrans=r,""},useFlexDirection:function(){return"horizontal"===this.dir?"row":"column"},useSeplineStype:function(){let e=this,t="";return t="horizontal"===e.dir?`height:100%; border-left:${e.seplineWidth}px solid ${e.useSeplineColor};`:`width:100%; border-top:${e.seplineWidth}px solid ${e.useSeplineColor};`,t},useSeplineColor:function(){return Za(this.seplineColor)},useShadow:function(){let e=this;return e.shadow&&ji(e.shadowStyle)?"box-shadow:"+function(e,t,n){let r=Ya(e=Yo(e,"}","{"),"{");return r=$n(r,(e=>{if(e.indexOf(t)>=0){let t=qo(e,"=")[1];return t=$i(t)?Yi(t):.2,function(e,t){let n=Za(e),r=ea.toRgba(n);return r.a=t,ea.toRgbaString(r)}(n,t)}return e})),ll(r,"")}(e.shadowStyle,"backgroundColorAlpha",e.backgroundColor):""}},methods:{getBorderRadiusStyle:function(e){let t=gt(this.itemsTrans)-1,n={};return"horizontal"===this.dir?(0===e&&(n={...n,topLeft:!0,bottomLeft:!0}),e===t&&(n={...n,topRight:!0,bottomRight:!0})):(0===e&&(n={...n,topLeft:!0,topRight:!0}),e===t&&(n={...n,bottomLeft:!0,bottomRight:!0})),n},toggleState:function(e){let t=this;if(!1!==t.editable)if(t.multiCheck){let n=Ni(t.value);if(e.active){let t=[];jt(n,(n=>{Or(n,e.data)||t.push(n)})),n=t}else n.push(e.data);t.$nextTick((()=>{t.$emit("input",n),t.$emit("click",e.data,""+(e.active?"hide":"show"))}))}else t.$nextTick((()=>{t.$emit("input",e.data),t.$emit("click",e.data)}))}}};const Vc=Wc;var Gc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeItems:e.changeItems}},[n("div",{style:"display:inline-block; border-radius:"+e.borderRadius+"px; "+e.useShadow},[n("div",{style:"display:flex; flex-direction:"+e.useFlexDirection+";"},[e._l(e.itemsTrans,(function(t,r){return[n("div",{key:"kitem-"+r,style:"display:flex; flex-direction:"+e.useFlexDirection+"; align-items:stretch;"},[r>0?n("div",{style:""+e.useSeplineStype}):e._e(),e._v(" "),n("WButtonCircle",{key:r,attrs:{tooltip:e.get(t,"data."+e.keyTooltip),icon:e.get(t,"data."+e.keyIcon),iconColor:e.iconColor,iconColorHover:e.iconColorHover,iconColorFocus:e.iconColorFocus,iconColorActive:e.iconColorActive,iconSize:e.iconSize,borderWidth:e.borderWidth,borderRadius:e.borderRadius,borderRadiusStyle:e.getBorderRadiusStyle(r),borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorFocus:e.borderColorFocus,borderColorActive:e.borderColorActive,backgroundColor:e.backgroundColor,backgroundColorHover:e.backgroundColorHover,backgroundColorFocus:e.backgroundColorFocus,backgroundColorActive:e.backgroundColorActive,tooltipBorderRadius:e.tooltipBorderRadius,tooltipPaddingStyle:e.tooltipPaddingStyle,tooltipTextFontSize:e.tooltipTextFontSize,tooltipTextColor:e.tooltipTextColor,tooltipBackgroundColor:e.tooltipBackgroundColor,rippleColor:e.rippleColor,paddingStyle:e.paddingStyle,shadow:!1,_shadowStyle:"shadowStyle",editable:e.editable,disabledColor:"rgba(255,255,255,0.4)",active:t.active},on:{click:function(n){return e.toggleState(t)}}})],1)]}))],2)])])};Gc._withStripped=!0;const jc=Ka({render:Gc,staticRenderFns:[]},(function(e){e&&e("data-v-354ea539_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WGroupIconCheck.vue"},media:void 0})}),Vc,"data-v-354ea539",false,undefined,!1,el,void 0,void 0);const Xc={components:{WTooltip:Uc},props:{value:{type:Boolean,default:!1},displayType:{type:String,default:"block"},cmpZIndex:{type:Number,default:3e3},isolated:{type:Boolean,default:!1},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},autoFitMinWidth:{type:Boolean,default:!1},autoFitMaxWidth:{type:Boolean,default:!1},placement:{type:String,default:"bottom-start"},placementDist:{type:Number,default:5},borderRadius:{type:Number,default:4},textFontSize:{type:String,default:"inherit"},textColor:{type:String,default:"black"},backgroundColor:{type:String,default:"white"},paddingStyle:{type:Object,default:()=>({v:0,h:0})},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12)"},transitionTime:{type:Number,default:200},editable:{type:Boolean,default:!0}},data:function(){return{}},mounted:function(){},computed:{},methods:{}};var $c=function(){var e=this,t=e.$createElement;return(e._self._c||t)("WTooltip",e._g(e._b({scopedSlots:e._u([{key:"trigger",fn:function(){return[e._t("trigger")]},proxy:!0},{key:"content",fn:function(t){return[e._t("content",null,{funHide:t.funHide})]}}],null,!0)},"WTooltip",Object.assign({},e.$props,{mode:"popup"}),!1),e.$listeners))};$c._withStripped=!0;const Yc=Ka({render:$c,staticRenderFns:[]},(function(e){e&&e("data-v-4642e044_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPopup.vue"},media:void 0})}),Xc,"data-v-4642e044",false,undefined,!1,el,void 0,void 0);var qc={components:{},props:{value:{type:String,default:"#FFFFFF"},size:{type:Number,default:200}},data:function(){let e=function(e){let t=e,n=t/2*Math.sqrt(3),r=t/4*3,i=$n((()=>{let e=[];for(let n=0;n<6;n++){let r=Math.PI/3*(n+.5),i=.5+.5*Math.cos(r),o=.5+.5*Math.sin(r);i*=t,o*=t,e.push({x:i,y:o})}return e})(),(e=>`${e.x},${e.y}`));i=ll(i," ");let o=[];jt([{dx:6,cs:["#003366","#336699","#3366CC","#003399","#000099","#0000CC","#000066"]},{dx:5,cs:["#006666","#006699","#0099CC","#0066CC","#0033CC","#0000FF","#3333FF","#333399"]},{dx:4,cs:["#669999","#009999","#33CCCC","#00CCFF","#0099FF","#0066FF","#3366FF","#3333CC","#666699"]},{dx:3,cs:["#339966","#00CC99","#00FFCC","#00FFFF","#33CCFF","#3399FF","#6699FF","#6666FF","#6600FF","#6600CC"]},{dx:2,cs:["#339933","#00CC66","#00FF99","#66FFCC","#66FFFF","#66CCFF","#99CCFF","#9999FF","#9966FF","#9933FF","#9900FF"]},{dx:1,cs:["#006600","#00CC00","#00FF00","#66FF99","#99FFCC","#CCFFFF","#CCCCFF","#CC99FF","#CC66FF","#CC33FF","#CC00FF","#9900CC"]},{dx:0,cs:["#003300","#009933","#33CC33","#66FF66","#99FF99","#CCFFCC","#FFFFFF","#FFCCFF","#FF99FF","#FF66FF","#FF00FF","#CC00CC","#660066"]},{dx:1,cs:["#336600","#009900","#66FF33","#99FF66","#CCFF99","#FFFFCC","#FFCCCC","#FF99CC","#FF66CC","#FF33CC","#CC0099","#993399"]},{dx:2,cs:["#333300","#669900","#99FF33","#CCFF66","#FFFF99","#FFCC99","#FF9999","#FF6699","#FF3399","#CC3399","#990099"]},{dx:3,cs:["#666633","#99CC00","#CCFF33","#FFFF66","#FFCC66","#FF9966","#FF6666","#FF0066","#CC6699","#993366"]},{dx:4,cs:["#999966","#CCCC00","#FFFF00","#FFCC00","#FF9933","#FF6600","#FF5050","#CC0066","#660033"]},{dx:5,cs:["#996633","#CC9900","#FF9900","#CC6600","#FF3300","#FF0000","#CC0000","#990033"]},{dx:6,cs:["#663300","#996600","#CC3300","#993300","#990000","#800000","#993333"]}],((e,t)=>{jt(e.cs,((i,s)=>{let a={x:(n+0)*s+e.dx*(n/2),y:(r+0)*t,color:i};ji(i)&&o.push(a)}))}));let s=fr($n(o,"x")),a=gr($n(o,"x")),l=fr($n(o,"y")),c=gr($n(o,"y"));return a+=n+2,c+=t+1,{cpgs:i,colors:o,xmin:s,xmax:a,ymin:l,ymax:c}}(18);return{valueTrans:null,cpgs:e.cpgs,colors:e.colors,xmin:e.xmin,xmax:e.xmax,ymin:e.ymin,ymax:e.ymax,pick:null}},computed:{changeValue:function(){return this.valueTrans=Za(this.value),""},changePick:function(){let e=this,t=null;return jt(e.colors,(n=>{e.jdColor2(n.color,e.valueTrans)&&(t=n)})),e.pick=t,""},width:function(){return this.size},height:function(){return this.width/10*9}},methods:{jdColor2:function(e,t){return ea.toRgbString(e)===ea.toRgbString(t)},ckColor:function(e){this.valueTrans=e.color,this.$emit("input",e.color)}}};const Zc=qc;var Jc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.width+"px; height:"+e.height+"px;",attrs:{changeValue:e.changeValue,changePick:e.changePick}},[n("div",{staticStyle:{display:"flex"}},[n("svg",{attrs:{viewBox:"0 0 "+e.xmax+" "+e.ymax,width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg"}},[e._l(e.colors,(function(t,r){return n("polygon",{key:"kc-"+r,style:"fill:"+t.color+"; stroke:"+t.color+"; stroke-width:1px; cursor:pointer; user-select:none;",attrs:{transform:"translate("+t.x+", "+t.y+")",points:e.cpgs},on:{click:function(n){return e.ckColor(t)}}})})),e._v(" "),e.pick?[n("polygon",{style:"fill:transparent; stroke:#000; stroke-width:4px; cursor:pointer; user-select:none;",attrs:{transform:"translate("+e.pick.x+", "+e.pick.y+")",points:e.cpgs},on:{click:function(t){return e.ckColor(e.pick)}}}),e._v(" "),n("polygon",{style:"fill:transparent; stroke:#fff; stroke-width:2px; cursor:pointer; user-select:none;",attrs:{transform:"translate("+e.pick.x+", "+e.pick.y+")",points:e.cpgs},on:{click:function(t){return e.ckColor(e.pick)}}})]:e._e()],2)])])};Jc._withStripped=!0;const Kc=Ka({render:Jc,staticRenderFns:[]},(function(e){e&&e("data-v-d9aed7a8_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickHexagon.vue"},media:void 0})}),Zc,"data-v-d9aed7a8",false,undefined,!1,el,void 0,void 0);var Qc={components:{},props:{value:{type:String,default:"#FFFFFF"},colorLeft:{type:String,default:"#FFFFFF"},colorRight:{type:String,default:"#000000"},colorNum:{type:Number,default:10},width:{type:Number,default:200},height:{type:Number,default:20}},data:function(){return{aimg:"data:image/svg+xml;base64,ICAgICAgICAgICAgICAgIDxzdmcgdmlld0JveD0iMCAwIDEwIDEwIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNkZGQiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjAiIHk9IjUiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNmZmYiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjUiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNmZmYiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNkZGQiIC8+DQogICAgICAgICAgICAgICAgPC9zdmc+",valueTrans:null,colorLeftTrans:null,colorRightTrans:null,s:20,pick:null}},computed:{changeValue:function(){let e=this;return e.valueTrans=Za(e.value),e.colorLeftTrans=Za(e.colorLeft),e.colorRightTrans=Za(e.colorRight),""},colors:function(){let e=this,t={0:e.colorLeftTrans,1:e.colorRightTrans},n=ea.interp(t),r=[];for(let t=0;t<e.colorNum;t++){let i=t/Math.max(e.colorNum-1,1),o=n(i);r.push({r:i,x:t*e.s,y:0,color:o})}return r},changePick:function(){let e=this,t=null;return jt(e.colors,(n=>{e.jdColor2(n.color,e.valueTrans)&&(t=n)})),e.pick=t,""}},methods:{jdColor2:function(e,t){return ea.toRgbString(e)===ea.toRgbString(t)},ckColor:function(e){this.valueTrans=e.color,this.$emit("input",e.color)}}};const eu=Qc;var tu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.width+"px; height:"+e.height+"px;",attrs:{changeValue:e.changeValue,changePick:e.changePick}},[n("div",{style:"position:relative; width:"+e.width+"px; height:"+e.height+"px;"},[n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n background-image: url("+e.aimg+");\n background-repeat:repeat;\n "}),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n "},[n("div",{staticStyle:{display:"flex"}},[n("svg",{attrs:{viewBox:"0 0 "+e.colors.length*e.s+" "+e.s,width:e.width,height:e.height,preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg"}},[e._l(e.colors,(function(t,r){return n("rect",{key:"kc-"+r,style:"fill:"+t.color+"; stroke-width:0px; cursor:pointer; user-select:none;",attrs:{x:t.x,y:t.y,width:e.s,height:e.s},on:{click:function(n){return e.ckColor(t)}}})})),e._v(" "),e.pick?[n("rect",{style:"fill:transparent; stroke:#000; stroke-width:1px; cursor:pointer; user-select:none;",attrs:{x:e.pick.x,y:e.pick.y,width:e.s,height:e.s}}),e._v(" "),n("rect",{style:"fill:transparent; stroke:#fff; stroke-width:2px; cursor:pointer; user-select:none;",attrs:{x:e.pick.x+2,y:e.pick.y+2,width:e.s-4,height:e.s-4}})]:e._e()],2)])])])])};tu._withStripped=!0;const nu={components:{WColorPickHexagon:Kc,WColorPickStripe:Ka({render:tu,staticRenderFns:[]},(function(e){e&&e("data-v-a033fb78_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickStripe.vue"},media:void 0})}),eu,"data-v-a033fb78",false,undefined,!1,el,void 0,void 0)},props:{value:{type:String,default:"#FFFFFF"},size:{type:Number,default:200},space:{type:Number,default:5}},data:function(){return{valueTrans:null}},computed:{changeValue:function(){return this.valueTrans=Za(this.value),""},hexagonSize:function(){return this.size},hexagonWidth:function(){return this.size},hexagonHeight:function(){return this.hexagonWidth/10*9},stripeWidth:function(){return this.size},stripeHeight:function(){return this.stripeWidth/10},width:function(){return this.size},height:function(){let e=this;return e.hexagonHeight+e.space+e.stripeHeight}},methods:{ckColor:function(e){e=(e=ea.toHexString(e)).toUpperCase(),this.valueTrans=e,this.$emit("input",e)}}};var ru=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.width+"px; height:"+e.height+"px;",attrs:{changeValue:e.changeValue}},[n("div",{staticStyle:{display:"flex"}},[n("WColorPickHexagon",{attrs:{size:e.hexagonSize,value:e.valueTrans},on:{input:e.ckColor}})],1),e._v(" "),n("div",{style:"height:"+e.space+"px;"}),e._v(" "),n("div",{staticStyle:{display:"flex"}},[n("WColorPickStripe",{attrs:{width:e.stripeWidth,height:e.stripeHeight,colorNum:10,value:e.valueTrans},on:{input:e.ckColor}})],1)])};ru._withStripped=!0;const iu=Ka({render:ru,staticRenderFns:[]},(function(e){e&&e("data-v-18cec008_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickHexagonGray.vue"},media:void 0})}),nu,"data-v-18cec008",false,undefined,!1,el,void 0,void 0);const ou={components:{},props:{value:{type:Number,default:1},color:{type:String,default:"#000000"},width:{type:Number,default:200},height:{type:Number,default:20},cursorSize:{type:Number,default:7}},data:function(){return{aimg:"data:image/svg+xml;base64,ICAgICAgICAgICAgICAgIDxzdmcgdmlld0JveD0iMCAwIDEwIDEwIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNkZGQiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjAiIHk9IjUiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNmZmYiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjUiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNmZmYiIC8+DQogICAgICAgICAgICAgICAgICAgIDxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNkZGQiIC8+DQogICAgICAgICAgICAgICAgPC9zdmc+",valueTrans:1,colorTrans:"#000",curMousedown:!1,curLocLeft:0}},mounted:function(){let e=this;e.windowMousemove=t=>{e.curMousedown&&e.updateCurLocByEvent(t)},window.addEventListener("mousemove",e.windowMousemove,!1),e.windowMouseup=t=>{e.curMousedown=!1},window.addEventListener("mouseup",e.windowMouseup,!1)},beforeDestroy:function(){window.removeEventListener("mousemove",this.windowMousemove,!1),window.removeEventListener("mouseup",this.windowMouseup,!1)},computed:{changeValue:function(){let e=this;return e.valueTrans=e.value,e.updateCurLocByValue(),""},changeColor:function(){return this.colorTrans=Za(this.color),""}},methods:{updateCurLocByEvent:function(e){let t=this,n=t.$el.getBoundingClientRect(),r=e.clientX-n.left;r=Math.min(Math.max(r,0),t.width-1),t.curLocLeft=r,t.updateAlpha()},updateCurLocByValue:function(){let e=this,t=e.valueTrans*(e.width-1);e.curLocLeft=t},updateAlpha:function(){let e=this,t=e.width-1,n=0;t-0-1>0&&(n=(e.curLocLeft-0)/(t-0));let r=n;e.$emit("input",r)},mousedownCur:function(e){this.curMousedown=!0,this.updateCurLocByEvent(e)}}};var su=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block;",attrs:{changeValue:e.changeValue,changeColor:e.changeColor}},[n("div",{style:"position:relative; width:"+e.width+"px; height:"+e.height+"px;"},[n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n background-image: url("+e.aimg+");\n background-repeat:repeat;\n "},[e._e()]),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n background:linear-gradient(to left, "+e.colorTrans+", transparent);\n "}),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2)-1)+"px; top:-1px;\n width:"+(e.cursorSize+2)+"px; height:"+(e.height+2)+"px;\n background:transparent;\n border:1px solid #666;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2))+"px; top:0px;\n width:"+e.cursorSize+"px; height:"+e.height+"px;\n background:transparent;\n border:1px solid #fff;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}})])])};su._withStripped=!0;const au=Ka({render:su,staticRenderFns:[]},(function(e){e&&e("data-v-1c777884_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickAlpha.vue"},media:void 0})}),ou,"data-v-1c777884",false,undefined,!1,el,void 0,void 0);var lu={components:{WColorPickHexagonGray:iu,WColorPickAlpha:au},props:{value:{type:String,default:"#FFFFFF"},size:{type:Number,default:200},spaceGray:{type:Number,default:5},spaceAlpha:{type:Number,default:8}},data:function(){return{colorPure:"#fff",colorAlpha:1,pick:null}},computed:{changeValue:function(){let e=this,t=Za(e.value),n=ea.toRgba(t),r={r:n.r,g:n.g,b:n.b},i=ea.toRgbString(r),o=n.a;return e.colorPure=i,e.colorAlpha=o,""},hexagonGrayWidth:function(){return this.size},hexagonGrayHeight:function(){return this.hexagonGrayWidth+this.spaceGray},alphaWidth:function(){return this.size},alphaHeight:function(){return this.alphaWidth/10},width:function(){return this.size},height:function(){let e=this;return e.hexagonGrayHeight+e.spaceAlpha+e.alphaHeight}},methods:{updateColor:function(e,t,n){let r=ea.toRgba(e);r.a=t;let i=ea.toRgbaString(r);this.$emit("input",i)}}};const cu=lu;var uu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.width+"px; height:"+e.height+"px;",attrs:{changeValue:e.changeValue}},[n("div",{staticStyle:{display:"flex"}},[n("WColorPickHexagonGray",{attrs:{size:e.size,space:e.spaceGray,value:e.colorPure},on:{input:function(t){e.colorPure=t,e.updateColor(e.colorPure,e.colorAlpha,"hexagonGray")}}})],1),e._v(" "),n("div",{style:"height:"+e.spaceAlpha+"px;"}),e._v(" "),n("div",{staticStyle:{display:"flex"}},[n("WColorPickAlpha",{attrs:{width:e.alphaWidth,height:e.alphaHeight,cursorSize:7,value:e.colorAlpha,color:e.colorPure},on:{input:function(t){e.colorAlpha=t,e.updateColor(e.colorPure,e.colorAlpha,"alpha")}}})],1)])};uu._withStripped=!0;const hu=Ka({render:uu,staticRenderFns:[]},(function(e){e&&e("data-v-2fd05b6d_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorSelectPanelBlock.vue"},media:void 0})}),cu,"data-v-2fd05b6d",false,undefined,!1,el,void 0,void 0);const du={components:{},props:{value:{type:String,default:"#FFFFFF"},color:{type:String,default:"#FFFFFF"},colorLeftTop:{type:String,default:"#FFFFFF"},colorBottom:{type:String,default:"#000000"},width:{type:Number,default:200},height:{type:Number,default:200},cursorSize:{type:Number,default:14}},data:function(){return{valueTrans:"#fff",colorTrans:"#fff",colorLeftTopTrans:"#fff",colorBottomTrans:"#fff",curMousedown:!1,curLocLeft:0,curLocTop:0}},mounted:function(){let e=this;e.windowMousemove=t=>{e.curMousedown&&e.updateCurLocByEvent(t)},window.addEventListener("mousemove",e.windowMousemove,!1),e.windowMouseup=t=>{e.curMousedown=!1},window.addEventListener("mouseup",e.windowMouseup,!1)},beforeDestroy:function(){window.removeEventListener("mousemove",this.windowMousemove,!1),window.removeEventListener("mouseup",this.windowMouseup,!1)},computed:{changeParams:function(){let e=this;e.valueTrans=Za(e.value);let t=Za(e.color);return t={h:ea.toHsv(t).h,s:1,v:1},t=ea.toHexString(t),e.colorTrans=t,e.colorLeftTopTrans=Za(e.colorLeftTop),e.colorBottomTrans=Za(e.colorBottom),e.updateCurLocByValue(),""},changeColor:function(){return this.updateColor(this.color),""}},methods:{updateCurLocByEvent:function(e){let t=this,n=t.$el.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;r=Math.min(Math.max(r,0),t.width-1),i=Math.min(Math.max(i,0),t.height-1),t.curLocLeft=r,t.curLocTop=i,t.updateColor()},updateCurLocByValue:function(){let e=this,t=ea.toHsv(e.valueTrans),n=t.s*(e.width-1),r=(1-t.v)*(e.height-1),i=ea.toHsv(e.colorTrans);t.h===i.h&&(e.curLocLeft=n,e.curLocTop=r)},updateColor:function(){let e=this,t=e.width-1,n=0;t-0>0&&(n=(e.curLocLeft-0)/(t-0));let r,i,o,s=e.height-1,a=0;s-0>0&&(a=(e.curLocTop-0)/(s-0)),r=e.colorTrans,i=e.colorLeftTopTrans,o=ea.mix(r,n,i,1-n,"toRgbString"),r=o,i=e.colorBottomTrans,o=ea.mix(r,1-a,i,a,"toHexString"),o=o.toUpperCase(),e.$emit("input",o)},mousedownCur:function(e){this.curMousedown=!0,this.updateCurLocByEvent(e)}}};var pu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block;",attrs:{changeParams:e.changeParams,changeColor:e.changeColor}},[n("div",{style:"position:relative; width:"+e.width+"px; height:"+e.height+"px;"},[n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n background:linear-gradient(to right, "+e.colorLeftTop+", "+e.colorTrans+");\n "}),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n background:linear-gradient(to top, "+e.colorBottom+", transparent);\n "}),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2)-1)+"px; top:"+(e.curLocTop-Math.floor(e.cursorSize/2)-1)+"px;\n width:"+(e.cursorSize+2)+"px; height:"+(e.cursorSize+2)+"px;\n background:transparent;\n border-radius:50%;\n border:1px solid #666;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2))+"px; top:"+(e.curLocTop-Math.floor(e.cursorSize/2))+"px;\n width:"+e.cursorSize+"px; height:"+e.cursorSize+"px;\n background:transparent;\n border-radius:50%;\n border:1px solid #fff;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}})])])};pu._withStripped=!0;const fu=Ka({render:pu,staticRenderFns:[]},(function(e){e&&e("data-v-6e10d83c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickHsv.vue"},media:void 0})}),du,"data-v-6e10d83c",false,undefined,!1,el,void 0,void 0);const mu={components:{},props:{value:{type:String,default:"#FF0000"},width:{type:Number,default:200},height:{type:Number,default:20},cursorSize:{type:Number,default:7}},data:function(){return{valueTrans:"#fff",curMousedown:!1,curLocLeft:0}},mounted:function(){let e=this;e.plotBackground(),e.windowMousemove=t=>{e.curMousedown&&e.updateCurLocByEvent(t)},window.addEventListener("mousemove",e.windowMousemove,!1),e.windowMouseup=t=>{e.curMousedown=!1},window.addEventListener("mouseup",e.windowMouseup,!1)},beforeDestroy:function(){window.removeEventListener("mousemove",this.windowMousemove,!1),window.removeEventListener("mouseup",this.windowMouseup,!1)},computed:{changeValue:function(){let e=this;return e.valueTrans=Za(e.value),e.updateCurLocByValue(),""}},methods:{plotBackground:function(){let e=this;(async function(){await no((()=>xo(e.$refs.cvs)));let t=e.$refs.cvs;t.width=e.width,t.height=e.height;let n=t.getContext("2d"),r=e.width-1;for(let t=0;t<=r;t++){let i={h:t/r*360,s:1,v:1};i=ea.toHexString(i),n.fillStyle=i,n.fillRect(t,0,1,e.height)}})().catch((e=>{console.log(e)}))},updateCurLocByEvent:function(e){let t=this,n=t.$el.getBoundingClientRect(),r=e.clientX-n.left;r=Math.min(Math.max(r,0),t.width-1),t.curLocLeft=r,t.updateColor()},updateCurLocByValue:function(){let e=this,t=ea.toHsv(e.valueTrans).h/360*(e.width-1);e.curLocLeft=t},updateColor:function(){let e=this,t=e.width-1,n=0;t-0-1>0&&(n=(e.curLocLeft-0)/(t-0));let r={h:360*n,s:1,v:1};r=ea.toHexString(r),r=r.toUpperCase(),e.$emit("input",r)},mousedownCur:function(e){this.curMousedown=!0,this.updateCurLocByEvent(e)}}};var gu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block;",attrs:{changeValue:e.changeValue}},[n("div",{style:"position:relative; width:"+e.width+"px; height:"+e.height+"px;"},[n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n overflow:hidden;\n "},[n("div",{staticStyle:{display:"flex"}},[n("canvas",{ref:"cvs",style:"width:"+e.width+"px; height:"+e.height+"px;"})])]),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2)-1)+"px; top:-1px;\n width:"+(e.cursorSize+2)+"px; height:"+(e.height+2)+"px;\n background:transparent;\n border:1px solid #666;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:"+(e.curLocLeft-Math.floor(e.cursorSize/2))+"px; top:0px;\n width:"+e.cursorSize+"px; height:"+e.height+"px;\n background:transparent;\n border:1px solid #fff;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}}),e._v(" "),n("div",{style:"\n position:absolute; left:0px; top:0px;\n width:"+e.width+"px; height:"+e.height+"px;\n cursor:pointer;\n user-select:none;\n _pointer-events:none;\n ",on:{mousedown:e.mousedownCur}})])])};gu._withStripped=!0;const vu={components:{WColorPickHsv:fu,WColorPickHue:Ka({render:gu,staticRenderFns:[]},(function(e){e&&e("data-v-6ca56ab4_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorPickHue.vue"},media:void 0})}),mu,"data-v-6ca56ab4",false,undefined,!1,el,void 0,void 0),WColorPickAlpha:au},props:{value:{type:String,default:"#FFFFFF"},size:{type:Number,default:200},space:{type:Number,default:10}},data:function(){return{lock:!1,valueTrans:null,colorHue:"#f00",colorPure:"#fff",colorAlpha:1}},computed:{changeParams:function(){let e=this;if(e.value===e.valueTrans)return;if(e.lock)return;e.lock=!0,e.valueTrans=Za(e.value);let t=ea.toHsva(e.value),n="#f00";{let e={h:t.h,s:1,v:1};n=ea.toHexString(e)}let r="#fff";{let e={h:t.h,s:t.s,v:t.v};r=ea.toHexString(e)}let i=1;return i=t.a,e.colorHue=n,e.colorPure=r,e.colorAlpha=i,""},hsvWidth:function(){return this.size},hsvHeight:function(){return this.hsvWidth},hueWidth:function(){return this.size},hueHeight:function(){return this.hueWidth/10},alphaWidth:function(){return this.size},alphaHeight:function(){return this.alphaWidth/10},width:function(){return this.size},height:function(){let e=this;return e.hsvHeight+e.space+e.hueHeight+e.space+e.alphaHeight}},methods:{updateColor:function(e,t){let n=this;if(n.lock&&"hsv"===t)return void(n.lock=!1);let r=ea.toHsva(n.colorHue),i=ea.toHsva(n.colorPure),o={h:r.h,s:i.s,v:i.v,a:n.colorAlpha};o=ea.toRgbaString(o),n.valueTrans=o,n.$emit("input",o)}}};var yu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.width+"px; height:"+e.height+"px;",attrs:{changeParams:e.changeParams}},[n("div",{staticStyle:{display:"flex"}},[n("WColorPickHsv",{attrs:{width:e.hsvWidth,height:e.hsvHeight,cursorSize:14,color:e.colorHue},on:{input:function(t){e.updateColor(t,"hsv")}},model:{value:e.colorPure,callback:function(t){e.colorPure=t},expression:"colorPure"}})],1),e._v(" "),n("div",{style:"height:"+e.space+"px;"}),e._v(" "),n("div",{staticStyle:{display:"flex"}},[n("WColorPickHue",{attrs:{width:e.hueWidth,height:e.hueHeight,cursorSize:7},on:{input:function(t){e.updateColor(t,"hue")}},model:{value:e.colorHue,callback:function(t){e.colorHue=t},expression:"colorHue"}})],1),e._v(" "),n("div",{style:"height:"+e.space+"px;"}),e._v(" "),n("div",{staticStyle:{display:"flex"}},[n("WColorPickAlpha",{attrs:{width:e.alphaWidth,height:e.alphaHeight,colorNum:10,color:e.colorPure},on:{input:function(t){e.updateColor(t,"alpha")}},model:{value:e.colorAlpha,callback:function(t){e.colorAlpha=t},expression:"colorAlpha"}})],1)])};yu._withStripped=!0;const _u={components:{WColorSelectPanelBlock:hu,WColorSelectPanelHsva:Ka({render:yu,staticRenderFns:[]},(function(e){e&&e("data-v-4010dad8_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorSelectPanelHsva.vue"},media:void 0})}),vu,"data-v-4010dad8",false,undefined,!1,el,void 0,void 0)},props:{value:{type:String,default:"#FFFFFF"},type:{type:String,default:"LUMP"},size:{type:Number,default:200},space:{type:Number,default:10},backgroundColor:{type:String,default:"transparent"}},data:function(){return{valueTrans:"#fff",typeTrans:"LUMP"}},computed:{changeValue:function(){return this.valueTrans=Za(this.value),""},changeType:function(){return this.typeTrans=this.type,""},useBackgroundColor:function(){return Za(this.backgroundColor)}},methods:{updateColor:function(e,t){this.valueTrans=e,this.$emit("input",e)}}};var xu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; background:"+e.useBackgroundColor+";",attrs:{changeValue:e.changeValue,changeType:e.changeType}},[n("div",{style:"padding:"+e.space+"px;"},["LUMP"===e.typeTrans?n("div",{staticStyle:{display:"flex"}},[n("WColorSelectPanelBlock",{attrs:{size:e.size,spaceGray:5,spaceAlpha:8,value:e.valueTrans},on:{input:function(t){e.updateColor(t,"block")}}})],1):e._e(),e._v(" "),"HSVA"===e.typeTrans?n("div",{staticStyle:{display:"flex"}},[n("WColorSelectPanelHsva",{attrs:{_size:"size*0.8875",size:e.size,space:10,value:e.valueTrans},on:{input:function(t){e.updateColor(t,"hsva")}}})],1):e._e()])])};xu._withStripped=!0;const bu=Ka({render:xu,staticRenderFns:[]},(function(e){e&&e("data-v-733d7b14_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorSelectPanel.vue"},media:void 0})}),_u,"data-v-733d7b14",false,undefined,!1,el,void 0,void 0);function Su(e){if(!$i(e))return!1;return Yi(e)>=0}function wu(e){if(!e)return"invalid event";if(!e.cancelable)return"event is not cancelable";try{null!==navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)?e.cancelBubble=!0:e.stopPropagation(),e.preventDefault()}catch(e){}}var Cu={directives:{domripple:function(){let e={};return{bind:function(t,n,r){let i=`r${la()}`;t.setAttribute("ev-ripple",i),function(t,n){let r=t.getAttribute("ev-ripple"),i=me(n,"value");if(i=ho(i),!i)return;let o=me(n,"value.color");if(!ji(o))return;o=Za(o);let s=me(n,"value.timeDuration");$i(s)||(s=1e3);function a(e){ul(e.currentTarget,e,{color:o,timeDuration:s})}s=Yi(s),t.addEventListener("click",a,!1),e[r]=a}(t,n)},unbind:function(t){!function(t){let n=t.getAttribute("ev-ripple");if(e[n]){let r=e[n];t.removeEventListener("click",r,!1),delete e[n]}}(t),t.setAttribute("ev-ripple",null)}}}()},components:{WIcon:fl,WIconLoading:ol,WTooltip:Uc},props:{text:{type:String,default:""},tooltip:{type:String,default:""},icon:{type:String,default:""},iconColor:{type:String,default:"black"},iconColorHover:{type:String,default:"grey darken-3"},iconColorActive:{type:String,default:"white"},iconSize:{type:Number,default:22},prog:{type:Number,default:null},progColor:{type:String,default:"rgba(150,150,150,0.4)"},progBackgroundColor:{type:String,default:"rgba(150,150,150,0.075)"},textColor:{type:String,default:"black"},textColorHover:{type:String,default:"grey darken-3"},textColorActive:{type:String,default:"white"},textFontSize:{type:String,default:"0.85rem"},borderUsed:{type:Object,default:()=>({top:!0,bottom:!0,left:!0,right:!0})},borderWidth:{type:Object,default:()=>({top:1,bottom:1,left:1,right:1})},borderRadius:{type:Number,default:30},borderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"rgb(241,241,241)"},backgroundColorHover:{type:String,default:"rgb(236,236,236)"},backgroundColorActive:{type:String,default:"orange"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},shadow:{type:Boolean,default:!0},shadowStyle:{type:String,default:"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"},shadowActive:{type:Boolean,default:!0},shadowActiveStyle:{type:String,default:"0 12px 20px -10px {backgroundColorActiveAlpha=0.28}, 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 8px -5px {backgroundColorActiveAlpha=0.2}"},rippleColor:{type:String,default:"rgba(255,255,255,0.4)"},paddingStyle:{type:Object,default:()=>({v:3,h:15})},shiftLeft:{type:Number,default:0},shiftRight:{type:Number,default:0},active:{type:Boolean,default:!1},close:{type:Boolean,default:!1},cursorPointer:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"grey darken-2"},promiseUnlock:{type:Boolean,default:!1},role:{type:String,default:"button"},editable:{type:Boolean,default:!0},disabledColor:{type:String,default:"rgba(255,255,255,0.5)"}},data:function(){return{mdiCloseCircle:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",activeTrans:!1,hoverTrans:!1,loadingTrans:!1,progTrans:null}},mounted:function(){},computed:{changeActive:function(){return this.activeTrans=this.active,""},changeProg:function(){return this.progTrans=this.prog,""},changeLoading:function(){return this.loadingTrans=this.loading,""},usePadding:function(){let e=this;return`padding:${hl(e.paddingStyle,{ext:{left:e.shiftLeft,right:e.shiftRight}})};`},effIconColor:function(){return Za(this.iconColor)},effIconColorHover:function(){return Za(this.iconColorHover)},effIconColorActive:function(){return Za(this.iconColorActive)},hasIcon:function(){return""!==this.icon},hasText:function(){return""!==this.text},useIconColor:function(){let e,t=this;return t.loadingTrans||t.isProging?t.effIconColor:(e=t.activeTrans?t.effIconColorActive:t.hoverTrans?t.effIconColorHover:t.effIconColor,t.editable||(e=t.activeTrans?t.effIconColorActive:t.effIconColor),e)},effDisabledColor:function(){return Za(this.disabledColor)},effProgColor:function(){return Za(this.progColor)},effProgBackgroundColor:function(){return Za(this.progBackgroundColor)},effTextColor:function(){return Za(this.textColor)},effTextColorHover:function(){return Za(this.textColorHover)},effTextColorActive:function(){return Za(this.textColorActive)},useTextColor:function(){let e,t=this;return t.loadingTrans||t.isProging?t.effTextColor:(e=t.activeTrans?t.effTextColorActive:t.hoverTrans?t.effTextColorHover:t.effTextColor,t.editable||(e=t.activeTrans?t.effTextColorActive:t.effTextColor),e)},useTextFontSize:function(){let e=this.textFontSize;return e=Yo(e,";",""),`font-size:${e};`},effBorderColor:function(){return Za(this.borderColor)},effBorderColorHover:function(){return Za(this.borderColorHover)},effBorderColorActive:function(){return Za(this.borderColorActive)},useBorderColor:function(){let e,t=this;return(t.loadingTrans||t.isProging)&&(e=t.effBorderColor),e=t.activeTrans?t.effBorderColorActive:t.hoverTrans?t.effBorderColorHover:t.effBorderColor,t.editable||(e=t.activeTrans?t.effBorderColorActive:t.effBorderColor),ll($n(t.useBorderUsed,((t,n)=>`border-${n}-color:${t?e:"transparent"};`))," ")},useBorderUsed:function(){let e=this,t=!0,n=!0,r=!0,i=!0;return ao(me(e,"borderUsed.left"))&&(t=me(e,"borderUsed.left")),ao(me(e,"borderUsed.right"))&&(n=me(e,"borderUsed.right")),ao(me(e,"borderUsed.top"))&&(r=me(e,"borderUsed.top")),ao(me(e,"borderUsed.bottom"))&&(i=me(e,"borderUsed.bottom")),{left:t,right:n,top:r,bottom:i}},useBorderWidth:function(){return`border-width:${hl(this.borderWidth)};`},useBorderRadius:function(){let e=this,t=0,n=0,r=0,i=0;return!0===me(e,"borderRadiusStyle.left")&&(t=e.borderRadius,r=e.borderRadius),!0===me(e,"borderRadiusStyle.right")&&(n=e.borderRadius,i=e.borderRadius),!0===me(e,"borderRadiusStyle.top")&&(t=e.borderRadius,n=e.borderRadius),!0===me(e,"borderRadiusStyle.bottom")&&(r=e.borderRadius,i=e.borderRadius),!0!==me(e,"borderRadiusStyle.topLeft")&&!0!==me(e,"borderRadiusStyle.top-left")||(t=e.borderRadius),!0!==me(e,"borderRadiusStyle.topRight")&&!0!==me(e,"borderRadiusStyle.top-right")||(n=e.borderRadius),!0!==me(e,"borderRadiusStyle.bottomLeft")&&!0!==me(e,"borderRadiusStyle.bottom-left")||(r=e.borderRadius),!0!==me(e,"borderRadiusStyle.bottomRight")&&!0!==me(e,"borderRadiusStyle.bottom-right")||(i=e.borderRadius),`border-top-left-radius:${t}px; border-top-right-radius:${n}px; border-bottom-left-radius:${r}px; border-bottom-right-radius:${i}px;`},effBackgroundColor:function(){return Za(this.backgroundColor)},effBackgroundColorHover:function(){return Za(this.backgroundColorHover)},effBackgroundColorActive:function(){return Za(this.backgroundColorActive)},useBackgroundColor:function(){let e,t=this;return t.loadingTrans||t.isProging?t.effBackgroundColor:(e=t.activeTrans?t.effBackgroundColorActive:t.hoverTrans?t.effBackgroundColorHover:t.effBackgroundColor,t.editable||(e=t.activeTrans?t.effBackgroundColorActive:t.effBackgroundColor),e)},useShadow:function(){let e=this;function t(e,t,n){let r=Ya(e=Yo(e,"}","{"),"{");return r=$n(r,(e=>{if(e.indexOf(t)>=0){let t=qo(e,"=")[1];return t=$i(t)?Yi(t):.2,function(e,t){let n=Za(e),r=ea.toRgba(n);return r.a=t,ea.toRgbaString(r)}(n,t)}return e})),ll(r,"")}return e.activeTrans&&e.shadowActive?ji(e.shadowActiveStyle)?"box-shadow:"+t(e.shadowActiveStyle,"backgroundColorActiveAlpha",e.backgroundColorActive):"":e.shadow&&ji(e.shadowStyle)?"box-shadow:"+t(e.shadowStyle,"backgroundColorAlpha",e.backgroundColor):""},isProging:function(){return $i(this.useProg)},useProg:function(){let e=this.progTrans;return $i(e)?(e=Yi(e),e<0||e>100?null:e):null},effLoadingColor:function(){return Za(this.loadingColor)},useRipple:function(){let e=this;if(e.editable&&!e.loadingTrans&&!e.isProging)return{color:e.rippleColor,timeDuration:700}},hasTooltop:function(){return ji(this.tooltip)}},methods:{clickBtn:function(e){let t=this;if(!t.editable)return;if(t.isProging)return;if(t.loadingTrans)return;let n={setProg:e=>{null===e||$i(e)?($i(e)&&(e=Yi(e)),t.progTrans=e,t.$nextTick((()=>{t.$emit("update:prog",t.progTrans)})),e>=100&&t.$nextTick((()=>{t.progTrans=null,t.$emit("update:prog",t.progTrans)}))):console.log("prog is not number")},setLoading:e=>{ao(e)?(t.loadingTrans=e,t.$nextTick((()=>{t.$emit("update:loading",t.loadingTrans)}))):console.log("loading is not boolean")}};if(t.promiseUnlock){t.loadingTrans=!0,t.$nextTick((()=>{t.$emit("update:loading",t.loadingTrans)}));let e=Wi();n.pm=e,e.catch().finally((()=>{t.loadingTrans=!1,t.$nextTick((()=>{t.$emit("update:loading",t.loadingTrans)}))}))}t.$nextTick((()=>{t.$emit("click",n)}))},clickClose:function(e){let t=this;wu(e),t.editable&&t.$nextTick((()=>{t.$emit("click-close")}))}}};const Mu=Cu;var Tu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{display:"inline-block","vertical-align":"middle",outline:"none","user-select":"none"},attrs:{role:e.editable?e.role:"",changeActive:e.changeActive,changeProg:e.changeProg,changeLoading:e.changeLoading}},[n("div",{staticStyle:{position:"relative"}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:e.tooltipBorderRadius,paddingStyle:e.tooltipPaddingStyle,textFontSize:e.tooltipTextFontSize,textColor:e.tooltipTextColor,backgroundColor:e.tooltipBackgroundColor,editable:e.hasTooltop},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("div",{directives:[{name:"domripple",rawName:"v-domripple",value:e.useRipple,expression:"useRipple"}],style:"transition:all 0.3s; "+e.useBorderRadius+" background:"+e.useBackgroundColor+"; "+(e.editable&&e.cursorPointer?"cursor:pointer;":"")+" "+e.useShadow+"; outline:none; user-select:none; overflow:hidden;",attrs:{tabindex:"0"},on:{mouseenter:function(t){e.hoverTrans=!0,e.$emit("mouseenter",t)},mouseleave:function(t){e.hoverTrans=!1,e.$emit("mouseleave",t)},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clickBtn(t)},click:function(t){return e.clickBtn(t)}}},[n("div",{style:"transition:all 0.3s; "+e.usePadding+" "+e.useBorderRadius+" "+e.useBorderWidth+" "+e.useBorderColor+" border-style:solid; outline:none; user-select:none;",attrs:{tabindex:"1"}},[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("div",[e._t("default",(function(){return[n("div",{staticStyle:{display:"flex","align-items":"center","white-space":"nowrap"}},[e.hasIcon?n("WIcon",{style:"margin-left:-6px; margin-right:"+(e.hasText?5:-6)+"px;",attrs:{icon:e.icon,color:e.useIconColor,colorHover:e.useIconColor,size:e.iconSize}}):e._e(),e._v(" "),e.hasText?n("div",{style:"transition:all 0.3s; text-transform:none; color:"+e.useTextColor+"; "+e.useTextFontSize+" "+(e.hasIcon?"min-height:"+e.iconSize+"px":"")+"; display:flex; align-items:center;"},[e._v("\n "+e._s(e.text)+"\n ")]):e._e()],1)]}))],2),e._v(" "),e.close?n("div",{style:"margin:0px -9px 0px 5px; display:inline-block; outline:none; user-select:none;",attrs:{tabindex:"2"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clickClose(t)},click:function(t){return e.clickClose(t)}}},[n("WIcon",{attrs:{icon:e.mdiCloseCircle,color:e.useIconColor,colorHover:e.useIconColor,size:e.iconSize}})],1):e._e()])])])]},proxy:!0},{key:"content",fn:function(){return[e._v("\n "+e._s(e.tooltip)+"\n ")]},proxy:!0}],null,!0)}),e._v(" "),e.isProging?n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{style:e.useBorderRadius+" overflow:hidden; width:100%; height:100%;"},[n("div",{style:"background:"+e.effProgBackgroundColor+"; height:100%;"},[n("div",{style:"background:"+e.effProgColor+"; width:"+e.useProg+"%; height:100%;"})])])]):e._e(),e._v(" "),!e.editable||e.loadingTrans?n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{style:e.useBorderRadius+" overflow:hidden; width:100%; height:100%;"},[n("div",{style:"background:"+e.effDisabledColor+"; height:100%;"})])]):e._e(),e._v(" "),!e.isProging&&e.loadingTrans?n("div",{staticStyle:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"center",height:"100%"}},[n("WIconLoading",{attrs:{name:"cir-rotate",color:e.effLoadingColor,size:e.iconSize}})],1)]):e._e()],1)])};Tu._withStripped=!0;const Au=Ka({render:Tu,staticRenderFns:[]},(function(e){e&&e("data-v-03107f1d_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WButtonChip.vue"},media:void 0})}),Mu,"data-v-03107f1d",false,undefined,!1,el,void 0,void 0);const Eu={components:{WButtonChip:Au},props:{multiCheck:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},value:{type:[Array,String,Object],default:null},keyText:{type:String,default:"text"},keyIcon:{type:String,default:"icon"},keyTooltip:{type:String,default:"tooltip"},iconColor:{type:String,default:"black"},iconColorHover:{type:String,default:"grey darken-3"},iconColorActive:{type:String,default:"white"},iconSize:{type:Number,default:22},textColor:{type:String,default:"black"},textColorHover:{type:String,default:"grey darken-3"},textColorActive:{type:String,default:"white"},textFontSize:{type:String,default:"0.85rem"},borderWidth:{type:Object,default:()=>({top:1,bottom:1,left:1,right:1})},borderRadius:{type:Number,default:30},borderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"transparent"},backgroundColorHover:{type:String,default:"rgba(200,200,200,0.25)"},backgroundColorActive:{type:String,default:"orange"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},marginStyle:{type:Object,default:()=>({top:10,bottom:10,left:0,right:10})},shadow:{type:Boolean,default:!1},shadowStyle:{type:String,default:"0 12px 20px -10px {backgroundColorAlpha=0.28}, 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 8px -5px {backgroundColorAlpha=0.2}"},shadowActive:{type:Boolean,default:!0},shadowActiveStyle:{type:String,default:"0 12px 20px -10px {backgroundColorActiveAlpha=0.28}, 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 8px -5px {backgroundColorActiveAlpha=0.2}"},paddingStyle:{type:Object,default:()=>({v:3,h:15})},shiftLeft:{type:Number,default:0},shiftRight:{type:Number,default:0},group:{type:Boolean,default:!1},groupBorderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},groupShift:{type:Number,default:5},close:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"black"},editable:{type:Boolean,default:!0}},data:function(){return{get:me,itemsTrans:[],borderUsed:{top:!0,bottom:!0,left:!0,right:!0}}},mounted:function(){},computed:{changeItems:function(){let e=this;let t=Ni(e.items),n=$n(t,(t=>{let n=function(t){let n;return n=e.multiCheck?sl(e.value,t):Or(t,e.value),n}(t);return{active:n,hover:!1,borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorActive:e.borderColorActive}})),r=$n(t,((r,i)=>{let o={data:r},s=n[i];o.ia=s,o.active=s.active,o.hover=!1;let a=null;i>0&&(a=n[i-1]);let l=null;i<t.length-1&&(l=n[i+1]);let c={};e.group&&(0===i&&(!0===me(e,"groupBorderRadiusStyle.left")&&(c.left=!0),!0!==me(e,"groupBorderRadiusStyle.topLeft")&&!0!==me(e,"groupBorderRadiusStyle.top-left")||(c.topLeft=!0),!0!==me(e,"groupBorderRadiusStyle.bottomLeft")&&!0!==me(e,"groupBorderRadiusStyle.bottom-left")||(c.bottomLeft=!0),!0===me(e,"groupBorderRadiusStyle.top")&&(c.topLeft=!0),!0===me(e,"groupBorderRadiusStyle.bottom")&&(c.bottomLeft=!0)),i===t.length-1&&(!0===me(e,"groupBorderRadiusStyle.right")&&(c.right=!0),!0!==me(e,"groupBorderRadiusStyle.topRight")&&!0!==me(e,"groupBorderRadiusStyle.top-right")||(c.topRight=!0),!0!==me(e,"groupBorderRadiusStyle.bottomRight")&&!0!==me(e,"groupBorderRadiusStyle.bottom-right")||(c.bottomRight=!0),!0===me(e,"groupBorderRadiusStyle.top")&&(c.topRight=!0),!0===me(e,"groupBorderRadiusStyle.bottom")&&(c.bottomRight=!0))),o.spcBorderRadiusStyle=c;let u={};e.group&&(u={top:e.borderWidth.top,bottom:e.borderWidth.bottom,left:1,right:1},0===i&&(u.left=e.borderWidth.left),i===t.length-1&&(u.right=e.borderWidth.right)),o.spcBorderWidth=u;let h={};e.group&&(h=e.getSpcBorderUsed(i,!1,a,s,l)),o.spcBorderUsed=h,o.spcBorderUsedBackup=Ni(h);let d=0,p=0;return e.group&&(0===i?d=e.groupShift:i===t.length-1&&(p=e.groupShift)),o.spcShiftLeft=d,o.spcShiftRight=p,o}));return e.itemsTrans=r,""},useMarginStyle:function(){return`margin:${hl(this.marginStyle,{parse:!this.group})};`}},methods:{getSpcBorderUsed:function(e,t,n,r,i){let o={top:!0,bottom:!0,left:!0,right:!0};if(n){let e=null;e=n.hover?n.borderColorHover:n.borderColor,e=n.active?n.borderColorActive:e;let t=null;t=r.hover?r.borderColorHover:r.borderColor,t=r.active?r.borderColorActive:t;let i=!1;e===t&&(i=!0);let s=!1;n.active&&!r.active&&(s=!0);let a=!1;r.hover&&(a=!0);let l=!1;a||(l=s),l=l||i,o.left=!l}if(i){let e=!1;i.active&&!r.active&&(e=!0);let t=!1;r.hover&&(t=!0);let n=!1;t||(n=e),o.right=!n}return o},mouseenter:function(e,t){let n=this;jt(n.itemsTrans,((e,r)=>{n.itemsTrans[r].ia.hover=r===t})),jt(n.itemsTrans,((e,r)=>{let i=me(n,`itemsTrans[${r}].ia`,null),o=me(n,`itemsTrans[${r-1}].ia`,null),s=me(n,`itemsTrans[${r+1}].ia`,null),a=n.getSpcBorderUsed(r,r===t,o,i,s);n.itemsTrans[r].spcBorderUsed=a}))},mouseleave:function(e,t){let n=this;jt(n.itemsTrans,((e,t)=>{n.itemsTrans[t].spcBorderUsed=Ni(n.itemsTrans[t].spcBorderUsedBackup)}))},toggleState:function(e){let t=this;if(!1!==t.editable)if(t.multiCheck){let n=Ni(t.value);if(e.active){let t=[];jt(n,(n=>{Or(n,e.data)||t.push(n)})),n=t}else n.push(e.data);t.$nextTick((()=>{t.$emit("input",n),t.$emit("click",e.data,""+(e.active?"hide":"show"))}))}else t.$nextTick((()=>{t.$emit("input",e.data),t.$emit("click",e.data)}))}}};var Ru=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeItems:e.changeItems}},[e._l(e.itemsTrans,(function(t,r){return[n("WButtonChip",{key:r,style:""+e.useMarginStyle,attrs:{text:e.get(t,"data."+e.keyText)||e.get(t,"data"),tooltip:e.get(t,"data."+e.keyTooltip),icon:e.get(t,"data."+e.keyIcon),iconColor:e.iconColor,iconColorHover:e.iconColorHover,iconColorActive:e.iconColorActive,iconSize:e.iconSize,textColor:e.textColor,textColorHover:e.textColorHover,textColorActive:e.textColorActive,textFontSize:e.textFontSize,borderUsed:e.group?t.spcBorderUsed:e.borderUsed,borderWidth:e.group?t.spcBorderWidth:e.borderWidth,borderRadius:e.borderRadius,borderRadiusStyle:e.group?t.spcBorderRadiusStyle:e.borderRadiusStyle,borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorActive:e.borderColorActive,backgroundColor:e.backgroundColor,backgroundColorHover:e.backgroundColorHover,backgroundColorActive:e.backgroundColorActive,tooltipBorderRadius:e.tooltipBorderRadius,tooltipPaddingStyle:e.tooltipPaddingStyle,tooltipTextFontSize:e.tooltipTextFontSize,tooltipTextColor:e.tooltipTextColor,tooltipBackgroundColor:e.tooltipBackgroundColor,shadow:e.shadow,shadowStyle:e.shadowStyle,shadowActive:e.shadowActive,shadowActiveStyle:e.shadowActiveStyle,paddingStyle:e.paddingStyle,shiftLeft:e.shiftLeft+t.spcShiftLeft,shiftRight:e.shiftRight+t.spcShiftRight,_close:"close",loading:e.loading,loadingColor:e.loadingColor,editable:e.editable,disabledColor:"rgba(255,255,255,0.4)",active:t.active},on:{click:function(n){return e.toggleState(t)},mouseenter:function(n){return e.mouseenter(t,r)},mouseleave:function(n){return e.mouseleave(t,r)}}},[e._t("default",null,{item:t,kitem:r})],2)]}))],2)};Ru._withStripped=!0;const Lu={components:{WGroupChipCheck:Ka({render:Ru,staticRenderFns:[]},(function(e){e&&e("data-v-433eeb06_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WGroupChipCheck.vue"},media:void 0})}),Eu,"data-v-433eeb06",false,undefined,!1,el,void 0,void 0)},props:{items:{type:Array,default:()=>[]},value:{type:[String,Object],default:null},keyText:{type:String,default:"text"},keyIcon:{type:String,default:"icon"},keyTooltip:{type:String,default:"tooltip"},iconColor:{type:String,default:"black"},iconColorHover:{type:String,default:"grey darken-3"},iconColorActive:{type:String,default:"white"},iconSize:{type:Number,default:22},textColor:{type:String,default:"black"},textColorHover:{type:String,default:"grey darken-3"},textColorActive:{type:String,default:"white"},textFontSize:{type:String,default:"0.85rem"},borderWidth:{type:Object,default:()=>({top:1,bottom:1,left:1,right:1})},borderRadius:{type:Number,default:30},borderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorActive:{type:String,default:"transparent"},backgroundColor:{type:String,default:"transparent"},backgroundColorHover:{type:String,default:"rgba(200,200,200,0.25)"},backgroundColorActive:{type:String,default:"orange"},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},marginStyle:{type:Object,default:()=>({top:10,bottom:10,left:0,right:10})},shadow:{type:Boolean,default:!1},shadowStyle:{type:String,default:"0 12px 20px -10px {backgroundColorAlpha=0.28}, 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 8px -5px {backgroundColorAlpha=0.2}"},shadowActive:{type:Boolean,default:!0},shadowActiveStyle:{type:String,default:"0 12px 20px -10px {backgroundColorActiveAlpha=0.28}, 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 8px -5px {backgroundColorActiveAlpha=0.2}"},paddingStyle:{type:Object,default:()=>({v:3,h:15})},shiftLeft:{type:Number,default:0},shiftRight:{type:Number,default:0},group:{type:Boolean,default:!1},groupBorderRadiusStyle:{type:Object,default:()=>({left:!0,right:!0})},groupShift:{type:Number,default:5},close:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"black"},editable:{type:Boolean,default:!0}},data:function(){return{}},mounted:function(){},computed:{},methods:{}};var Pu=function(){var e=this,t=e.$createElement;return(e._self._c||t)("WGroupChipCheck",e._g(e._b({scopedSlots:e._u([{key:"default",fn:function(t){return[e._t("default",null,{item:t.item,kitem:t.kitem})]}}],null,!0)},"WGroupChipCheck",Object.assign({},e.$props,{multiCheck:!1}),!1),e.$listeners))};Pu._withStripped=!0;const Iu=Ka({render:Pu,staticRenderFns:[]},(function(e){e&&e("data-v-30b87bf9_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WGroupChipRadio.vue"},media:void 0})}),Lu,"data-v-30b87bf9",false,undefined,!1,el,void 0,void 0);const Ou={components:{},props:{label:{type:String,default:""},labelWidth:{type:Number,default:null},labelHeight:{type:Number,default:null},labelColor:{type:String,default:"#666"},labelFontSize:{type:String,default:"0.8rem"},labelHorizontalAlign:{type:String,default:"left"},labelVerticalAlign:{type:String,default:"center"},labelShiftTop:{type:Number,default:0},space:{type:Number,default:0},seplines:{type:Boolean,default:!1},floatForItemSub:{type:Boolean,default:!0}},data:function(){return{}},computed:{useLabelWidth:function(){let e=this;if($i(e.labelWidth)){return{width:`${Yi(e.labelWidth)}px`}}return{}},useLabelHeight:function(){let e=this;if($i(e.labelHeight)){return{height:`${Yi(e.labelHeight)}px`}}return{}},useLabelVerticalAlign:function(){let e=this,t="middle";return"top"!==e.labelVerticalAlign&&"bottom"!==e.labelVerticalAlign||(t=e.labelVerticalAlign),t},useLabelColor:function(){return Za(this.labelColor)}},methods:{}};var ku=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{},[e.seplines?[e._t("label",(function(){return[n("div",{style:[e.useLabelWidth,e.useLabelHeight,{color:e.useLabelColor,fontSize:e.labelFontSize,textAlign:e.labelHorizontalAlign,paddingTop:e.labelShiftTop+"px",paddingBottom:e.space+"px"}]},[e._v("\n "+e._s(e.label)+"\n ")])]})),e._v(" "),n("div",{},[e._t("item"),e._v(" "),n("div",{staticStyle:{position:"relative"}},[n("div",{style:e.floatForItemSub?"position:absolute; top:0; left:0;":""},[e._t("item-sub")],2)])],2)]:[n("table",{staticStyle:{width:"100%","border-collapse":"collapse"}},[n("tr",[n("td",{style:[{verticalAlign:e.useLabelVerticalAlign,whiteSpace:"nowrap",color:e.useLabelColor,fontSize:e.labelFontSize,textAlign:e.labelHorizontalAlign}]},[e._t("label",(function(){return[n("div",{style:[e.useLabelWidth,e.useLabelHeight,{paddingTop:e.labelShiftTop+"px"}]},[e._v("\n "+e._s(e.label)+":\n ")])]}))],2),e._v(" "),n("td",{style:[{paddingRight:e.space+8+"px"}]}),e._v(" "),n("td",{style:[{width:"100%"}]},[e._t("item"),e._v(" "),e.floatForItemSub?n("div",{staticStyle:{position:"relative"}},[n("div",{staticStyle:{position:"absolute",top:"0",left:"0"}},[e._t("item-sub")],2)]):e._e()],2)]),e._v(" "),e.floatForItemSub?e._e():n("tr",[n("td"),e._v(" "),n("td"),e._v(" "),n("td",[e._t("item-sub")],2)])])]],2)};ku._withStripped=!0;const Bu=Ka({render:ku,staticRenderFns:[]},(function(e){e&&e("data-v-f3a740cc_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WPanelLabelItem.vue"},media:void 0})}),Ou,"data-v-f3a740cc",false,undefined,!1,el,void 0,void 0);const Du={components:{WIcon:fl,WTooltip:Uc},props:{paddingStyle:{type:Object,default:()=>({v:0,h:15})},backgroundColor:{type:String,default:"transparent"},backgroundColorHover:{type:String,default:"transparent"},backgroundColorFocus:{type:String,default:"transparent"},borderWidth:{type:Number,default:1},borderRadius:{type:Number,default:30},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},shadow:{type:Boolean,default:!0},leftIcon:{type:String,default:""},leftIconSize:{type:Number,default:24},leftIconColor:{type:String,default:"deep-orange lighten-2"},leftIconColorHover:{type:String,default:"deep-orange lighten-1"},leftIconColorFocus:{type:String,default:"deep-orange lighten-1"},leftIconTooltip:{type:String,default:""},rightIcon:{type:String,default:""},rightIconSize:{type:Number,default:24},rightIconColor:{type:String,default:"deep-orange lighten-2"},rightIconColorHover:{type:String,default:"deep-orange lighten-2"},rightIconColorFocus:{type:String,default:"deep-orange lighten-1"},rightIconTooltip:{type:String,default:""},iconShiftOuter:{type:Number,default:-10},iconShiftInner:{type:Number,default:5},tooltipBorderRadius:{type:Number,default:4},tooltipPaddingStyle:{type:Object,default:()=>({v:5,h:8})},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"rgba(60,60,60,0.75)"},verticalAlign:{type:String,default:"center"},editable:{type:Boolean,default:!0},hovered:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},data:function(){return{hoveredTrans:!1,focusedTrans:!1}},computed:{changeParam:function(){let e=this;return e.hoveredTrans=e.hovered,e.focusedTrans=e.focused,""},useBackgroundColor:function(){let e=this,t={};return e.focusedTrans?(t["background-color"]=Za(e.backgroundColorFocus),t):e.hoveredTrans?(t["background-color"]=Za(e.backgroundColorHover),t):(t["background-color"]=Za(e.backgroundColor),t)},useBorder:function(){let e=this,t={};return e.focusedTrans?(t.border=`${e.borderWidth}px solid ${Za(e.borderColorFocus)}`,t):e.hoveredTrans?(t.border=`${e.borderWidth}px solid ${Za(e.borderColorHover)}`,t):(t.border=`${e.borderWidth}px solid ${Za(e.borderColor)}`,t)},useShadow:function(){let e={};return this.shadow&&(e["box-shadow"]="0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12)"),e},useLeftIconColor:function(){let e=this;return e.hoveredTrans?Za(e.leftIconColorHover):e.focusedTrans?Za(e.leftIconColorFocus):Za(e.leftIconColor)},useRightIconColor:function(){let e=this;return e.hoveredTrans?Za(e.rightIconColorHover):e.focusedTrans?Za(e.rightIconColorFocus):Za(e.rightIconColor)},useTitleColor:function(){let e={};return e.color=Za(this.titleColor),e},usePadding:function(){return{padding:hl(this.paddingStyle,{semicolon:!1})}},hasLeftIconTooltop:function(){return ji(this.leftIconTooltip)},hasRightIconTooltop:function(){return ji(this.rightIconTooltip)},useVerticalAlign:function(){let e=this,t={};return"center"===e.verticalAlign?t["align-items"]="center":"top"===e.verticalAlign?t["align-items"]="flex-start":"bottom"===e.verticalAlign&&(t["align-items"]="flex-end"),t}},methods:{clickIcon:function(e){let t=this;!1!==t.editable&&t.$nextTick((()=>{t.$emit("click-"+e)}))},mouseenter:function(){let e=this;e.hoveredTrans=!0,e.$nextTick((()=>{e.$emit("update:hovered",!0)}))},mouseleave:function(){let e=this;e.hoveredTrans=!1,e.$nextTick((()=>{e.$emit("update:hovered",!1)}))}}};var Nu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeParam:e.changeParam}},[n("div",{style:[{transition:"all 0.3s",display:"flex","justify-content":"flex-start","border-radius":e.borderRadius+"px",opacity:e.editable?1:.6},e.usePadding,e.useBackgroundColor,e.useBorder,e.useShadow,e.useVerticalAlign],on:{mouseenter:e.mouseenter,mouseleave:e.mouseleave}},[e.leftIcon?n("div",{style:"margin-left:"+e.iconShiftOuter+"px; margin-right:"+e.iconShiftInner+"px; user-select:none; cursor:pointer; outline:none;",attrs:{tabindex:"0"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clickIcon("left")},click:function(t){return e.clickIcon("left")}}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:e.tooltipBorderRadius,paddingStyle:e.tooltipPaddingStyle,textFontSize:e.tooltipTextFontSize,textColor:e.tooltipTextColor,backgroundColor:e.tooltipBackgroundColor,editable:e.hasLeftIconTooltop},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("div",{attrs:{ShellEllipse:"leftIcon"}},[n("WIcon",{attrs:{icon:e.leftIcon,size:e.leftIconSize,color:e.useLeftIconColor,colorHover:e.useLeftIconColor}})],1)]},proxy:!0},{key:"content",fn:function(){return[e._v("\n "+e._s(e.leftIconTooltip)+"\n ")]},proxy:!0}],null,!1,3849071383)})],1):e._e(),e._v(" "),n("div",{style:[{width:"100%"}]},[e._t("default")],2),e._v(" "),e.rightIcon?n("div",{style:"margin-right:"+e.iconShiftOuter+"px; margin-left:"+e.iconShiftInner+"px; user-select:none; cursor:pointer; outline:none;",attrs:{tabindex:"0"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clickIcon("right")},click:function(t){return e.clickIcon("right")}}},[n("WTooltip",{attrs:{displayType:"line",isolated:!0,borderRadius:e.tooltipBorderRadius,paddingStyle:e.tooltipPaddingStyle,textFontSize:e.tooltipTextFontSize,textColor:e.tooltipTextColor,backgroundColor:e.tooltipBackgroundColor,editable:e.hasRightIconTooltop},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("div",{attrs:{ShellEllipse:"rightIcon"}},[n("WIcon",{attrs:{icon:e.rightIcon,size:e.rightIconSize,color:e.useRightIconColor,colorHover:e.useRightIconColor}})],1)]},proxy:!0},{key:"content",fn:function(){return[e._v("\n "+e._s(e.rightIconTooltip)+"\n ")]},proxy:!0}],null,!1,1563142679)})],1):e._e()])])};Nu._withStripped=!0;const Uu=Ka({render:Nu,staticRenderFns:[]},(function(e){e&&e("data-v-4c752dd2_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WShellEllipse.vue"},media:void 0})}),Du,"data-v-4c752dd2",false,undefined,!1,el,void 0,void 0);const Fu={components:{},props:{borderColor:{type:String,default:"grey lighten-1"},borderColorHover:{type:String,default:"grey"},borderColorFocus:{type:String,default:"blue darken-2"},borderWidth:{type:Number,default:1},borderWidthHover:{type:Number,default:1},borderWidthFocus:{type:Number,default:2},focused:{type:Boolean,default:!1}},data:function(){return{focusedTrans:!1,hoverTrans:!1}},computed:{changeParam:function(){return this.focusedTrans=this.focused,""},useBorderWidth:function(){let e=this;return e.hoverTrans?e.borderWidthHover:e.borderWidth},useBorderColor:function(){let e=this;return e.hoverTrans?Za(e.borderColorHover):Za(e.borderColor)},useBorderColorFocus:function(){return Za(this.borderColorFocus)}},methods:{}};var zu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeParam:e.changeParam}},[n("div",{staticStyle:{position:"relative"},on:{mouseenter:function(t){e.hoverTrans=!0},mouseleave:function(t){e.hoverTrans=!1}}},[e._t("default"),e._v(" "),n("div",{style:"position:absolute; left:0px; right:0px; bottom:0px; z-index:1; border-bottom:"+e.useBorderWidth+"px solid "+e.useBorderColor+";"}),e._v(" "),n("transition",{attrs:{name:"fade"}},[e.focused?n("div",{style:"position:absolute; left:0px; right:0px; bottom:0px; z-index:2; border-bottom:"+e.borderWidthFocus+"px solid "+e.useBorderColorFocus+";"}):e._e()])],2)])};zu._withStripped=!0;const Hu=Ka({render:zu,staticRenderFns:[]},(function(e){e&&e("data-v-cea78b16_0",{source:"\n.fade-enter-active[data-v-cea78b16], .fade-leave-active[data-v-cea78b16] {\r\n transition: all 0.3s;\n}\n.fade-enter[data-v-cea78b16], .fade-leave-to[data-v-cea78b16] {\r\n transform: scaleX(0);\n}\n.fade-enter-to[data-v-cea78b16], .fade-leave[data-v-cea78b16] {\r\n transform: scaleX(100%);\n}\r\n",map:{version:3,sources:["D:\\- 006 - 開源\\開源-JS-105-3-w-threejs-vue\\w-threejs-vue\\node_modules\\w-component-vue\\src\\components\\WShellBottomLine.vue"],names:[],mappings:";AAiIA;IACA,oBAAA;AACA;AACA;IACA,oBAAA;AACA;AACA;IACA,uBAAA;AACA",file:"WShellBottomLine.vue",sourcesContent:["<template>\r\n <div :changeParam=\"changeParam\">\r\n\r\n <div\r\n style=\"position:relative;\"\r\n @mouseenter=\"hoverTrans=true\"\r\n @mouseleave=\"hoverTrans=false\"\r\n >\r\n\r\n <slot></slot>\r\n\r\n <div\r\n :style=\"`position:absolute; left:0px; right:0px; bottom:0px; z-index:1; border-bottom:${useBorderWidth}px solid ${useBorderColor};`\"\r\n ></div>\r\n\r\n <transition name=\"fade\">\r\n <div\r\n :style=\"`position:absolute; left:0px; right:0px; bottom:0px; z-index:2; border-bottom:${borderWidthFocus}px solid ${useBorderColorFocus};`\"\r\n v-if=\"focused\"\r\n ></div>\r\n </transition>\r\n\r\n </div>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport convertColor from '../js/convertColor.mjs'\r\n\r\n\r\n/**\r\n * @vue-prop {Number} [borderWidth=1] 輸入線寬度數字,單位為px,預設1\r\n * @vue-prop {String} [borderColor='grey lighten-1'] 輸入線顏色字串,預設'grey lighten-1'\r\n * @vue-prop {String} [borderColorHover='grey'] 輸入滑鼠移入時線顏色字串,預設'grey'\r\n * @vue-prop {String} [borderColorFocus='blue darken-2'] 輸入取得焦點時線顏色字串,預設'blue darken-2'\r\n * @vue-prop {Number} [borderWidthHover=1] 輸入滑鼠移入時線寬度數字,單位為px,預設1\r\n * @vue-prop {Number} [borderWidthFocus=2] 輸入取得焦點時線寬度數字,單位為px,預設2\r\n * @vue-prop {Boolean} [focused=false] 輸入是否為取得焦點狀態,預設false\r\n */\r\nexport default {\r\n components: {\r\n },\r\n props: {\r\n borderColor: {\r\n type: String,\r\n default: 'grey lighten-1',\r\n },\r\n borderColorHover: {\r\n type: String,\r\n default: 'grey',\r\n },\r\n borderColorFocus: {\r\n type: String,\r\n default: 'blue darken-2',\r\n },\r\n borderWidth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n borderWidthHover: {\r\n type: Number,\r\n default: 1,\r\n },\r\n borderWidthFocus: {\r\n type: Number,\r\n default: 2,\r\n },\r\n focused: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n focusedTrans: false,\r\n hoverTrans: false,\r\n }\r\n },\r\n computed: {\r\n\r\n changeParam: function () {\r\n //console.log('computed changeParam')\r\n\r\n let vo = this\r\n\r\n //focusedTrans\r\n vo.focusedTrans = vo.focused\r\n\r\n return ''\r\n },\r\n\r\n useBorderWidth: function() {\r\n //console.log('computed useBorderWidth')\r\n\r\n let vo = this\r\n\r\n if (vo.hoverTrans) {\r\n return vo.borderWidthHover\r\n }\r\n return vo.borderWidth\r\n },\r\n\r\n useBorderColor: function() {\r\n //console.log('computed useBorderColor')\r\n\r\n let vo = this\r\n\r\n if (vo.hoverTrans) {\r\n return convertColor(vo.borderColorHover)\r\n }\r\n return convertColor(vo.borderColor)\r\n },\r\n\r\n useBorderColorFocus: function() {\r\n //console.log('computed useBorderColorFocus')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.borderColorFocus)\r\n },\r\n\r\n },\r\n methods: {\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.fade-enter-active, .fade-leave-active {\r\n transition: all 0.3s;\r\n}\r\n.fade-enter, .fade-leave-to {\r\n transform: scaleX(0);\r\n}\r\n.fade-enter-to, .fade-leave {\r\n transform: scaleX(100%);\r\n}\r\n</style>\r\n"]},media:void 0})}),Fu,"data-v-cea78b16",false,undefined,!1,el,void 0,void 0);function Wu(e,t){let n=!1,r="";if("isstr"===t)Gi(e)||(n=!0,r="需要為字串",e="");else if("isnum"===t)$i(e)||(n=!0,r="需要為數字",e=0);else if("isp0num"===t)Su(e)||(n=!0,r="需要為含0的正浮點數",e=0);else if("isn0num"===t)$i(i=e)&&Yi(i)<=0||(n=!0,r="需要為含0的負浮點數",e=0);else if("isint"===t)qi(e)||(n=!0,r="需要為整數",e=0);else if("ispint"===t)to(e)||(n=!0,r="需要為不含0正整數",e=0);else if("isp0int"===t)Co(e)||(n=!0,r="需要為含0正整數",e=0);else if("isnint"===t)(function(e){return!!qi(e)&&eo(e)<0})(e)||(n=!0,r="需要為不含0負整數",e=0);else if("isn0int"===t)(function(e){return!!qi(e)&&eo(e)<=0})(e)||(n=!0,r="需要為含0負整數",e=0);else if(Vi(t)){e=t(e)}else"any"===t?$i(e)||Gi(e)||(n=!0,r="需要為字串或數字",e=""):(n=!0,r="需要指定驗證類型",e=null);var i;return{value:e,err:n,errmsg:r}}const Vu={props:{type:{type:[String,Function],default:"any"},value:{type:[String,Number],default:""},textFontSize:{type:String,default:"1rem"},textColor:{type:String,default:"black"},textAlign:{type:String,default:"left"},placeholder:{type:String,default:""},height:{type:[Number,String],default:""},editable:{type:Boolean,default:!0},focused:{type:Boolean,default:!1}},data:function(){return{valueTrans:"",errmsg:""}},mounted:function(){},computed:{changeValue:function(){return this.valueTrans=this.value,""},useHeight:function(){let e=this,t="";return $i(e.height)?t=`height:${e.height}px;`:ji(e.height)&&(t=`height:${e.height}; line-height:${e.height};`),t},useTextFontSize:function(){let e=this.textFontSize;return e=Yo(e,";",""),`font-size:${e};`},useTextColor:function(){return Za(this.textColor)}},methods:{setValue:function(e){this.valueTrans=e},setFocus:function(){this.$refs.inp.focus()},updateFocused:function(e){let t=this;t.focused!==e&&t.$nextTick((()=>{t.$emit("update:focused",e)}))},updateValue:function(e){let t=this,n=Wu(t.valueTrans,t.type);t.valueTrans=n.value,t.errmsg=n.errmsg},trigger:function(e,t){let n=this;n.$nextTick((()=>{n.$emit(e,n.valueTrans,n.errmsg,t)}))}}};var Gu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeValue:e.changeValue}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.valueTrans,expression:"valueTrans"}],ref:"inp",style:"transition:all 0.3s; display:block; outline:none; width:100%; box-sizing:border-box; border-style:none; background:transparent; color:"+e.useTextColor+"; "+e.useHeight+" text-align:"+e.textAlign+"; "+e.useTextFontSize+" opacity:"+(""!==e.valueTrans||e.focused?1:.6)+";",attrs:{type:"text",readonly:!e.editable,placeholder:e.placeholder},domProps:{value:e.valueTrans},on:{input:[function(t){t.target.composing||(e.valueTrans=t.target.value)},function(t){e.updateValue(t),e.trigger("input",t),e.updateFocused(!0)}],change:function(t){e.trigger("change",t)},focus:function(t){return e.updateFocused(!0)},blur:function(t){e.trigger("blur",t),e.updateFocused(!1)},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(t){e.trigger("enter",t)}.apply(null,arguments)},select:function(t){e.trigger("select",t)}}})])};Gu._withStripped=!0;const ju={components:{WShellEllipse:Uu,WShellBottomLine:Hu,WTextCore:Ka({render:Gu,staticRenderFns:[]},(function(e){e&&e("data-v-5b18e29a_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WTextCore.vue"},media:void 0})}),Vu,"data-v-5b18e29a",false,undefined,!1,el,void 0,void 0)},props:{paddingStyle:{type:Object,default:()=>({v:0,h:0})},borderRadius:{type:Number,default:30},shadow:{type:Boolean,default:!1},type:{type:[String,Function],default:"any"},value:{type:[String,Number]},textFontSize:{type:String,default:"1rem"},textColor:{type:String,default:"black"},textAlign:{type:String,default:"left"},leftIcon:{type:String,default:""},leftIconSize:{type:Number,default:24},leftIconColor:{type:String,default:"blue"},leftIconColorHover:{type:String,default:"blue darken-1"},leftIconColorFocus:{type:String,default:"blue darken-1"},leftIconTooltip:{type:String,default:""},rightIcon:{type:String,default:""},rightIconSize:{type:Number,default:24},rightIconColor:{type:String,default:"blue"},rightIconColorHover:{type:String,default:"blue darken-1"},rightIconColorFocus:{type:String,default:"blue darken-1"},rightIconTooltip:{type:String,default:""},iconShiftOuter:{type:Number,default:0},iconShiftInner:{type:Number,default:5},backgroundColor:{type:String,default:"transparent"},backgroundColorHover:{type:String,default:"transparent"},backgroundColorFocus:{type:String,default:"transparent"},borderColor:{type:String,default:"transparent"},borderColorHover:{type:String,default:"transparent"},borderColorFocus:{type:String,default:"transparent"},bottomLineBorderColor:{type:String,default:"grey lighten-1"},bottomLineBorderColorHover:{type:String,default:"grey"},bottomLineBorderColorFocus:{type:String,default:"blue darken-1"},bottomLineBorderWidth:{type:Number,default:1},bottomLineBorderWidthHover:{type:Number,default:1},bottomLineBorderWidthFocus:{type:Number,default:2},placeholder:{type:String,default:""},height:{type:Number,default:28},editable:{type:Boolean,default:!0},focused:{type:Boolean,default:!1}},data:function(){return{focusedTrans:!1}},mounted:function(){},computed:{changeFocused:function(){return this.focusedTrans=this.focused,""}},methods:{modifyFocused:function(e){let t=this;t.focusedTrans=e,t.$nextTick((()=>{t.$emit("update:focused",e)}))}}};var Xu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{changeFocused:e.changeFocused}},[n("WShellBottomLine",{attrs:{borderColor:e.bottomLineBorderColor,borderColorHover:e.bottomLineBorderColorHover,borderColorFocus:e.bottomLineBorderColorFocus,borderWidth:e.bottomLineBorderWidth,borderWidthHover:e.bottomLineBorderWidthHover,borderWidthFocus:e.bottomLineBorderWidthFocus,focused:e.focusedTrans}},[n("WShellEllipse",{attrs:{paddingStyle:e.paddingStyle,borderRadius:e.borderRadius,shadow:e.shadow,leftIcon:e.leftIcon,leftIconSize:e.leftIconSize,leftIconColor:e.leftIconColor,leftIconColorHover:e.leftIconColorHover,leftIconColorFocus:e.leftIconColorFocus,leftIconTooltip:e.leftIconTooltip,rightIcon:e.rightIcon,rightIconSize:e.rightIconSize,rightIconColor:e.rightIconColor,rightIconColorHover:e.rightIconColorHover,rightIconColorFocus:e.rightIconColorFocus,rightIconTooltip:e.rightIconTooltip,iconShiftOuter:e.iconShiftOuter,iconShiftInner:e.iconShiftInner,backgroundColor:e.backgroundColor,backgroundColorHover:e.backgroundColorHover,backgroundColorFocus:e.backgroundColorFocus,borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorFocus:e.borderColorFocus,editable:e.editable,focused:e.focusedTrans},on:{"click-left":function(t){return e.$emit("click-left")},"click-right":function(t){return e.$emit("click-right")}}},[n("WTextCore",{attrs:{type:e.type,textFontSize:e.textFontSize,textColor:e.textColor,textAlign:e.textAlign,placeholder:e.placeholder,height:e.height,editable:e.editable,value:e.value,focused:e.focusedTrans},on:{"update:focused":e.modifyFocused,select:function(t,n,r){e.$emit("select",t,n,r)},blur:function(t,n,r){e.$emit("blur",t,n,r)},enter:function(t,n,r){e.$emit("enter",t,n,r)},input:function(t,n,r){e.$emit("input",t,n,r)},change:function(t,n,r){e.$emit("change",t,n,r)}}})],1)],1)],1)};Xu._withStripped=!0;const $u=Ka({render:Xu,staticRenderFns:[]},(function(e){e&&e("data-v-399c9556_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WText.vue"},media:void 0})}),ju,"data-v-399c9556",false,undefined,!1,el,void 0,void 0);
|
|
7
|
+
/*!
|
|
8
|
+
* decimal.js v10.4.3
|
|
9
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
10
|
+
* https://github.com/MikeMcl/decimal.js
|
|
11
|
+
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
12
|
+
* MIT Licence
|
|
13
|
+
*/
|
|
14
|
+
var Yu,qu,Zu=9e15,Ju=1e9,Ku="0123456789abcdef",Qu="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",eh="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",th={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Zu,maxE:Zu,crypto:!1},nh=!0,rh="[DecimalError] ",ih=rh+"Invalid argument: ",oh=rh+"Precision limit exceeded",sh=rh+"crypto unavailable",ah="[object Decimal]",lh=Math.floor,ch=Math.pow,uh=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,hh=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,dh=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ph=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fh=1e7,mh=7,gh=Qu.length-1,vh=eh.length-1,yh={toStringTag:ah};function _h(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",(n=mh-r.length)&&(o+=Lh(n)),o+=r;s=e[t],(n=mh-(r=s+"").length)&&(o+=Lh(n))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function xh(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ih+e)}function bh(e,t,n,r){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=mh,i=0):(i=Math.ceil((t+1)/mh),t%=mh),o=ch(10,mh-t),a=e[i]%o|0,null==r?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(e[i+1]/o/100|0)==ch(10,t-2)-1||(a==o/2||0==a)&&0==(e[i+1]/o/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==ch(10,t-3)-1,s}function Sh(e,t,n){for(var r,i,o=[0],s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=Ku.indexOf(e.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}yh.absoluteValue=yh.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Ch(e)},yh.ceil=function(){return Ch(new this.constructor(this),this.e+1,2)},yh.clampedTo=yh.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(ih+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},yh.comparedTo=yh.cmp=function(e){var t,n,r,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,c=e.s;if(!s||!a)return l&&c?l!==c?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-c:0;if(l!==c)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(t=0,n=(r=s.length)<(i=a.length)?r:i;t<n;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},yh.cosine=yh.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+mh,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?i=(1/zh(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");e.precision+=n,t=Fh(e,1,t.times(i),new e(1));for(var o=n;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}(r,Hh(r,n)),r.precision=e,r.rounding=t,Ch(2==qu||3==qu?n.neg():n,e,t,!0)):new r(1):new r(NaN)},yh.cubeRoot=yh.cbrt=function(){var e,t,n,r,i,o,s,a,l,c,u=this,h=u.constructor;if(!u.isFinite()||u.isZero())return new h(u);for(nh=!1,(o=u.s*ch(u.s*u,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=_h(u.d),(o=((e=u.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=ch(n,1/3),e=lh((e+1)/3)-(e%3==(e<0?-1:2)),(r=new h(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),s=(e=h.precision)+3;;)if(c=(l=(a=r).times(a).times(a)).plus(u),r=wh(c.plus(u).times(a),c.plus(l),s+2,1),_h(a.d).slice(0,s)===(n=_h(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Ch(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!i&&(Ch(a,e+1,0),a.times(a).times(a).eq(u))){r=a;break}s+=4,i=1}return nh=!0,Ch(r,e,h.rounding,t)},yh.decimalPlaces=yh.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-lh(this.e/mh))*mh,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},yh.dividedBy=yh.div=function(e){return wh(this,new this.constructor(e))},yh.dividedToIntegerBy=yh.divToInt=function(e){var t=this.constructor;return Ch(wh(this,new t(e),0,1,1),t.precision,t.rounding)},yh.equals=yh.eq=function(e){return 0===this.cmp(e)},yh.floor=function(){return Ch(new this.constructor(this),this.e+1,3)},yh.greaterThan=yh.gt=function(e){return this.cmp(e)>0},yh.greaterThanOrEqualTo=yh.gte=function(e){var t=this.cmp(e);return 1==t||0===t},yh.hyperbolicCosine=yh.cosh=function(){var e,t,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?t=(1/zh(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=Fh(s,1,o.times(t),new s(1),!0);for(var l,c=e,u=new s(8);c--;)l=o.times(o),o=a.minus(l.times(u.minus(l.times(u))));return Ch(o,s.precision=n,s.rounding=r,!0)},yh.hyperbolicSine=yh.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=Fh(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=Fh(o,2,i=i.times(1/zh(5,e)),i,!0);for(var s,a=new o(5),l=new o(16),c=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(c))))}return o.precision=t,o.rounding=n,Ch(i,t,n,!0)},yh.hyperbolicTangent=yh.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,wh(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},yh.inverseCosine=yh.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?t.isNeg()?Eh(n,i,o):new n(0):new n(NaN):t.isZero()?Eh(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=Eh(n,i+4,o).times(.5),n.precision=i,n.rounding=o,e.minus(t))},yh.inverseHyperbolicCosine=yh.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,nh=!1,n=n.times(n).minus(1).sqrt().plus(n),nh=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},yh.inverseHyperbolicSine=yh.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,nh=!1,n=n.times(n).plus(1).sqrt().plus(n),nh=!0,r.precision=e,r.rounding=t,n.ln())},yh.inverseHyperbolicTangent=yh.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?Ch(new o(i),e,t,!0):(o.precision=n=r-i.e,i=wh(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},yh.inverseSine=yh.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=Eh(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},yh.inverseTangent=yh.atan=function(){var e,t,n,r,i,o,s,a,l,c=this,u=c.constructor,h=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&h+4<=vh)return(s=Eh(u,h+4,d).times(.25)).s=c.s,s}else{if(!c.s)return new u(NaN);if(h+4<=vh)return(s=Eh(u,h+4,d).times(.5)).s=c.s,s}for(u.precision=a=h+10,u.rounding=1,e=n=Math.min(28,a/mh+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(nh=!1,t=Math.ceil(a/mh),r=1,l=c.times(c),s=new u(c),i=c;-1!==e;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),void 0!==(s=o.plus(i.div(r+=2))).d[t])for(e=t;s.d[e]===o.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),nh=!0,Ch(s,u.precision=h,u.rounding=d,!0)},yh.isFinite=function(){return!!this.d},yh.isInteger=yh.isInt=function(){return!!this.d&&lh(this.e/mh)>this.d.length-2},yh.isNaN=function(){return!this.s},yh.isNegative=yh.isNeg=function(){return this.s<0},yh.isPositive=yh.isPos=function(){return this.s>0},yh.isZero=function(){return!!this.d&&0===this.d[0]},yh.lessThan=yh.lt=function(e){return this.cmp(e)<0},yh.lessThanOrEqualTo=yh.lte=function(e){return this.cmp(e)<1},yh.logarithm=yh.log=function(e){var t,n,r,i,o,s,a,l,c=this,u=c.constructor,h=u.precision,d=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(nh=!1,s=Bh(c,a=h+5),r=t?Ah(u,a+10):Bh(e,a),bh((l=wh(s,r,a,1)).d,i=h,d))do{if(s=Bh(c,a+=10),r=t?Ah(u,a+10):Bh(e,a),l=wh(s,r,a,1),!o){+_h(l.d).slice(i+1,i+15)+1==1e14&&(l=Ch(l,h+1,0));break}}while(bh(l.d,i+=10,d));return nh=!0,Ch(l,h,d)},yh.minus=yh.sub=function(e){var t,n,r,i,o,s,a,l,c,u,h,d,p=this,f=p.constructor;if(e=new f(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new f(e.d||p.s!==e.s?p:NaN):e=new f(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,d=e.d,a=f.precision,l=f.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!c[0])return new f(3===l?-0:0);e=new f(p)}return nh?Ch(e,a,l):e}if(n=lh(e.e/mh),u=lh(p.e/mh),c=c.slice(),o=u-n){for((h=o<0)?(t=c,o=-o,s=d.length):(t=d,n=u,s=c.length),o>(r=Math.max(Math.ceil(a/mh),s)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((h=(r=c.length)<(s=d.length))&&(s=r),r=0;r<s;r++)if(c[r]!=d[r]){h=c[r]<d[r];break}o=0}for(h&&(t=c,c=d,d=t,e.s=-e.s),s=c.length,r=d.length-s;r>0;--r)c[s++]=0;for(r=d.length;r>o;){if(c[--r]<d[r]){for(i=r;i&&0===c[--i];)c[i]=fh-1;--c[i],c[r]+=fh}c[r]-=d[r]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=Th(c,n),nh?Ch(e,a,l):e):new f(3===l?-0:0)},yh.modulo=yh.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?Ch(new r(n),r.precision,r.rounding):(nh=!1,9==r.modulo?(t=wh(n,e.abs(),0,3,1)).s*=e.s:t=wh(n,e,0,r.modulo,1),t=t.times(e),nh=!0,n.minus(t))},yh.naturalExponential=yh.exp=function(){return kh(this)},yh.naturalLogarithm=yh.ln=function(){return Bh(this)},yh.negated=yh.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Ch(e)},yh.plus=yh.add=function(e){var t,n,r,i,o,s,a,l,c,u,h=this,d=h.constructor;if(e=new d(e),!h.d||!e.d)return h.s&&e.s?h.d||(e=new d(e.d||h.s===e.s?h:NaN)):e=new d(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.minus(e);if(c=h.d,u=e.d,a=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(e=new d(h)),nh?Ch(e,a,l):e;if(o=lh(h.e/mh),r=lh(e.e/mh),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,s=u.length):(n=u,r=o,s=c.length),i>(s=(o=Math.ceil(a/mh))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=c.length)-(i=u.length)<0&&(i=s,n=u,u=c,c=n),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/fh|0,c[i]%=fh;for(t&&(c.unshift(t),++r),s=c.length;0==c[--s];)c.pop();return e.d=c,e.e=Th(c,r),nh?Ch(e,a,l):e},yh.precision=yh.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ih+e);return n.d?(t=Rh(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},yh.round=function(){var e=this,t=e.constructor;return Ch(new t(e),e.e+1,t.rounding)},yh.sine=yh.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+mh,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Fh(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/zh(5,n)),t=Fh(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}(r,Hh(r,n)),r.precision=e,r.rounding=t,Ch(qu>2?n.neg():n,e,t,!0)):new r(NaN)},yh.squareRoot=yh.sqrt=function(){var e,t,n,r,i,o,s=this,a=s.d,l=s.e,c=s.s,u=s.constructor;if(1!==c||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(nh=!1,0==(c=Math.sqrt(+s))||c==1/0?(((t=_h(a)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=lh((l+1)/2)-(l<0||l%2),r=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):r=new u(c.toString()),n=(l=u.precision)+3;;)if(r=(o=r).plus(wh(s,o,n+2,1)).times(.5),_h(o.d).slice(0,n)===(t=_h(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Ch(r,l+1,1),e=!r.times(r).eq(s));break}if(!i&&(Ch(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return nh=!0,Ch(r,l,u.rounding,e)},yh.tangent=yh.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=wh(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Ch(2==qu||4==qu?n.neg():n,e,t,!0)):new r(NaN)},yh.times=yh.mul=function(e){var t,n,r,i,o,s,a,l,c,u=this,h=u.constructor,d=u.d,p=(e=new h(e)).d;if(e.s*=u.s,!(d&&d[0]&&p&&p[0]))return new h(!e.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:d&&p?0*e.s:e.s/0);for(n=lh(u.e/mh)+lh(e.e/mh),(l=d.length)<(c=p.length)&&(o=d,d=p,p=o,s=l,l=c,c=s),o=[],r=s=l+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=l+r;i>r;)a=o[i]+p[r]*d[i-r-1]+t,o[i--]=a%fh|0,t=a/fh|0;o[i]=(o[i]+t)%fh|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=Th(o,n),nh?Ch(e,h.precision,h.rounding):e},yh.toBinary=function(e,t){return Wh(this,2,e,t)},yh.toDecimalPlaces=yh.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(xh(e,0,Ju),void 0===t?t=r.rounding:xh(t,0,8),Ch(n,e+n.e+1,t))},yh.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Mh(r,!0):(xh(e,0,Ju),void 0===t?t=i.rounding:xh(t,0,8),n=Mh(r=Ch(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},yh.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=Mh(i):(xh(e,0,Ju),void 0===t?t=o.rounding:xh(t,0,8),n=Mh(r=Ch(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},yh.toFraction=function(e){var t,n,r,i,o,s,a,l,c,u,h,d,p=this,f=p.d,m=p.constructor;if(!f)return new m(p);if(c=n=new m(1),r=l=new m(0),s=(o=(t=new m(r)).e=Rh(f)-p.e-1)%mh,t.d[0]=ch(10,s<0?mh+s:s),null==e)e=o>0?t:c;else{if(!(a=new m(e)).isInt()||a.lt(c))throw Error(ih+a);e=a.gt(t)?o>0?t:c:a}for(nh=!1,a=new m(_h(f)),u=m.precision,m.precision=o=f.length*mh*2;h=wh(a,t,0,1,1),1!=(i=n.plus(h.times(r))).cmp(e);)n=r,r=i,i=c,c=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=wh(e.minus(n),r,0,1,1),l=l.plus(i.times(c)),n=n.plus(i.times(r)),l.s=c.s=p.s,d=wh(c,r,o,1).minus(p).abs().cmp(wh(l,n,o,1).minus(p).abs())<1?[c,r]:[l,n],m.precision=u,nh=!0,d},yh.toHexadecimal=yh.toHex=function(e,t){return Wh(this,16,e,t)},yh.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:xh(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(nh=!1,n=wh(n,e,0,t,1).times(e),nh=!0,Ch(n)):(e.s=n.s,n=e),n},yh.toNumber=function(){return+this},yh.toOctal=function(e,t){return Wh(this,8,e,t)},yh.toPower=yh.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,c=+(e=new l(e));if(!(a.d&&e.d&&a.d[0]&&e.d[0]))return new l(ch(+a,c));if((a=new l(a)).eq(1))return a;if(r=l.precision,o=l.rounding,e.eq(1))return Ch(a,r,o);if((t=lh(e.e/mh))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Ph(l,a,n,r),e.s<0?new l(1).div(i):Ch(i,r,o);if((s=a.s)<0){if(t<e.d.length-1)return new l(NaN);if(0==(1&e.d[t])&&(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(t=0!=(n=ch(+a,c))&&isFinite(n)?new l(n+"").e:lh(c*(Math.log("0."+_h(a.d))/Math.LN10+a.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(nh=!1,l.rounding=a.s=1,n=Math.min(12,(t+"").length),(i=kh(e.times(Bh(a,r+n)),r)).d&&bh((i=Ch(i,r+5,1)).d,r,o)&&(t=r+10,+_h((i=Ch(kh(e.times(Bh(a,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Ch(i,r+1,0))),i.s=s,nh=!0,l.rounding=o,Ch(i,r,o))},yh.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Mh(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(xh(e,1,Ju),void 0===t?t=i.rounding:xh(t,0,8),n=Mh(r=Ch(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},yh.toSignificantDigits=yh.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(xh(e,1,Ju),void 0===t?t=n.rounding:xh(t,0,8)),Ch(new n(this),e,t)},yh.toString=function(){var e=this,t=e.constructor,n=Mh(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},yh.truncated=yh.trunc=function(){return Ch(new this.constructor(this),this.e+1,1)},yh.valueOf=yh.toJSON=function(){var e=this,t=e.constructor,n=Mh(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var wh=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s,a,l){var c,u,h,d,p,f,m,g,v,y,_,x,b,S,w,C,M,T,A,E,R=r.constructor,L=r.s==i.s?1:-1,P=r.d,I=i.d;if(!(P&&P[0]&&I&&I[0]))return new R(r.s&&i.s&&(P?!I||P[0]!=I[0]:I)?P&&0==P[0]||!I?0*L:L/0:NaN);for(l?(p=1,u=r.e-i.e):(l=fh,p=mh,u=lh(r.e/p)-lh(i.e/p)),A=I.length,M=P.length,y=(v=new R(L)).d=[],h=0;I[h]==(P[h]||0);h++);if(I[h]>(P[h]||0)&&u--,null==o?(S=o=R.precision,s=R.rounding):S=a?o+(r.e-i.e)+1:o,S<0)y.push(1),f=!0;else{if(S=S/p+2|0,h=0,1==A){for(d=0,I=I[0],S++;(h<M||d)&&S--;h++)w=d*l+(P[h]||0),y[h]=w/I|0,d=w%I|0;f=d||h<M}else{for((d=l/(I[0]+1)|0)>1&&(I=e(I,d,l),P=e(P,d,l),A=I.length,M=P.length),C=A,x=(_=P.slice(0,A)).length;x<A;)_[x++]=0;(E=I.slice()).unshift(0),T=I[0],I[1]>=l/2&&++T;do{d=0,(c=t(I,_,A,x))<0?(b=_[0],A!=x&&(b=b*l+(_[1]||0)),(d=b/T|0)>1?(d>=l&&(d=l-1),1==(c=t(m=e(I,d,l),_,g=m.length,x=_.length))&&(d--,n(m,A<g?E:I,g,l))):(0==d&&(c=d=1),m=I.slice()),(g=m.length)<x&&m.unshift(0),n(_,m,x,l),-1==c&&(c=t(I,_,A,x=_.length))<1&&(d++,n(_,A<x?E:I,x,l)),x=_.length):0===c&&(d++,_=[0]),y[h++]=d,c&&_[0]?_[x++]=P[C]||0:(_=[P[C]],x=1)}while((C++<M||void 0!==_[0])&&S--);f=void 0!==_[0]}y[0]||y.shift()}if(1==p)v.e=u,Yu=f;else{for(h=1,d=y[0];d>=10;d/=10)h++;v.e=h+u*p-1,Ch(v,a?o+v.e+1:o,s,f)}return v}}();function Ch(e,t,n,r){var i,o,s,a,l,c,u,h,d,p=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=t-i)<0)o+=mh,s=t,l=(u=h[d=0])/ch(10,i-s-1)%10|0;else if((d=Math.ceil((o+1)/mh))>=(a=h.length)){if(!r)break e;for(;a++<=d;)h.push(0);u=l=0,i=1,s=(o%=mh)-mh+1}else{for(u=a=h[d],i=1;a>=10;a/=10)i++;l=(s=(o%=mh)-mh+i)<0?0:u/ch(10,i-s-1)%10|0}if(r=r||t<0||void 0!==h[d+1]||(s<0?u:u%ch(10,i-s-1)),c=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?s>0?u/ch(10,i-s):0:h[d-1])%10&1||n==(e.s<0?8:7)),t<1||!h[0])return h.length=0,c?(t-=e.e+1,h[0]=ch(10,(mh-t%mh)%mh),e.e=-t||0):h[0]=e.e=0,e;if(0==o?(h.length=d,a=1,d--):(h.length=d+1,a=ch(10,mh-o),h[d]=s>0?(u/ch(10,i-s)%ch(10,s)|0)*a:0),c)for(;;){if(0==d){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==fh&&(h[0]=1));break}if(h[d]+=a,h[d]!=fh)break;h[d--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return nh&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function Mh(e,t,n){if(!e.isFinite())return Dh(e);var r,i=e.e,o=_h(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Lh(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Lh(-i-1)+o,n&&(r=n-s)>0&&(o+=Lh(r))):i>=s?(o+=Lh(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Lh(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Lh(r))),o}function Th(e,t){var n=e[0];for(t*=mh;n>=10;n/=10)t++;return t}function Ah(e,t,n){if(t>gh)throw nh=!0,n&&(e.precision=n),Error(oh);return Ch(new e(Qu),t,1,!0)}function Eh(e,t,n){if(t>vh)throw Error(oh);return Ch(new e(eh),t,n,!0)}function Rh(e){var t=e.length-1,n=t*mh+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Lh(e){for(var t="";e--;)t+="0";return t}function Ph(e,t,n,r){var i,o=new e(1),s=Math.ceil(r/mh+4);for(nh=!1;;){if(n%2&&Vh((o=o.times(t)).d,s)&&(i=!0),0===(n=lh(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}Vh((t=t.times(t)).d,s)}return nh=!0,o}function Ih(e){return 1&e.d[e.d.length-1]}function Oh(e,t,n){for(var r,i=new e(t[0]),o=0;++o<t.length;){if(!(r=new e(t[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function kh(e,t){var n,r,i,o,s,a,l,c=0,u=0,h=0,d=e.constructor,p=d.rounding,f=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(nh=!1,l=f):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),h+=5;for(l+=r=Math.log(ch(2,h))/Math.LN10*2+5|0,n=o=s=new d(1),d.precision=l;;){if(o=Ch(o.times(e),l,1),n=n.times(++u),_h((a=s.plus(wh(o,n,l,1))).d).slice(0,l)===_h(s.d).slice(0,l)){for(i=h;i--;)s=Ch(s.times(s),l,1);if(null!=t)return d.precision=f,s;if(!(c<3&&bh(s.d,l-r,p,c)))return Ch(s,d.precision=f,p,nh=!0);d.precision=l+=10,n=o=a=new d(1),u=0,c++}s=a}}function Bh(e,t){var n,r,i,o,s,a,l,c,u,h,d,p=1,f=e,m=f.d,g=f.constructor,v=g.rounding,y=g.precision;if(f.s<0||!m||!m[0]||!f.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=f.s?NaN:m?0:f);if(null==t?(nh=!1,u=y):u=t,g.precision=u+=10,r=(n=_h(m)).charAt(0),!(Math.abs(o=f.e)<15e14))return c=Ah(g,u+2,y).times(o+""),f=Bh(new g(r+"."+n.slice(1)),u-10).plus(c),g.precision=y,null==t?Ch(f,y,v,nh=!0):f;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=_h((f=f.times(e)).d)).charAt(0),p++;for(o=f.e,r>1?(f=new g("0."+n),o++):f=new g(r+"."+n.slice(1)),h=f,l=s=f=wh(f.minus(1),f.plus(1),u,1),d=Ch(f.times(f),u,1),i=3;;){if(s=Ch(s.times(d),u,1),_h((c=l.plus(wh(s,new g(i),u,1))).d).slice(0,u)===_h(l.d).slice(0,u)){if(l=l.times(2),0!==o&&(l=l.plus(Ah(g,u+2,y).times(o+""))),l=wh(l,new g(p),u,1),null!=t)return g.precision=y,l;if(!bh(l.d,u-10,v,a))return Ch(l,g.precision=y,v,nh=!0);g.precision=u+=10,c=s=f=wh(h.minus(1),h.plus(1),u,1),d=Ch(f.times(f),u,1),i=a=1}l=c,i+=2}}function Dh(e){return String(e.s*e.s/0)}function Nh(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%mh,n<0&&(r+=mh),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=mh;r<i;)e.d.push(+t.slice(r,r+=mh));t=t.slice(r),r=mh-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),nh&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Uh(e,t){var n,r,i,o,s,a,l,c,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ph.test(t))return Nh(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(hh.test(t))n=16,t=t.toLowerCase();else if(uh.test(t))n=2;else{if(!dh.test(t))throw Error(ih+t);n=8}for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,r=e.constructor,s&&(o=(a=(t=t.replace(".","")).length)-o,i=Ph(r,new r(n),o,2*o)),o=u=(c=Sh(t,n,fh)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=Th(c,u),e.d=c,nh=!1,s&&(e=wh(e,i,4*a)),l&&(e=e.times(Math.abs(l)<54?ch(2,l):Ld.pow(2,l))),nh=!0,e)}function Fh(e,t,n,r,i){var o,s,a,l,c=e.precision,u=Math.ceil(c/mh);for(nh=!1,l=n.times(n),a=new e(r);;){if(s=wh(a.times(l),new e(t++*t++),c,1),a=i?r.plus(s):r.minus(s),r=wh(s.times(l),new e(t++*t++),c,1),void 0!==(s=a.plus(r)).d[u]){for(o=u;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return nh=!0,s.d.length=u+1,s}function zh(e,t){for(var n=e;--t;)n*=e;return n}function Hh(e,t){var n,r=t.s<0,i=Eh(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return qu=r?4:1,t;if((n=t.divToInt(i)).isZero())qu=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return qu=Ih(n)?r?2:3:r?4:1,t;qu=Ih(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Wh(e,t,n,r){var i,o,s,a,l,c,u,h,d,p=e.constructor,f=void 0!==n;if(f?(xh(n,1,Ju),void 0===r?r=p.rounding:xh(r,0,8)):(n=p.precision,r=p.rounding),e.isFinite()){for(f?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(s=(u=Mh(e)).indexOf("."))>=0&&(u=u.replace(".",""),(d=new p(1)).e=u.length-s,d.d=Sh(Mh(d),10,i),d.e=d.d.length),o=l=(h=Sh(u,10,i)).length;0==h[--l];)h.pop();if(h[0]){if(s<0?o--:((e=new p(e)).d=h,e.e=o,h=(e=wh(e,d,n,r,0,i)).d,o=e.e,c=Yu),s=h[n],a=i/2,c=c||void 0!==h[n+1],c=r<4?(void 0!==s||c)&&(0===r||r===(e.s<0?3:2)):s>a||s===a&&(4===r||c||6===r&&1&h[n-1]||r===(e.s<0?8:7)),h.length=n,c)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,u="";s<l;s++)u+=Ku.charAt(h[s]);if(f){if(l>1)if(16==t||8==t){for(s=16==t?4:3,--l;l%s;l++)u+="0";for(l=(h=Sh(u,i,t)).length;!h[l-1];--l);for(s=1,u="1.";s<l;s++)u+=Ku.charAt(h[s])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>l)for(o-=l;o--;)u+="0";else o<l&&(u=u.slice(0,o)+"."+u.slice(o))}else u=f?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=Dh(e);return e.s<0?"-"+u:u}function Vh(e,t){if(e.length>t)return e.length=t,!0}function Gh(e){return new this(e).abs()}function jh(e){return new this(e).acos()}function Xh(e){return new this(e).acosh()}function $h(e,t){return new this(e).plus(t)}function Yh(e){return new this(e).asin()}function qh(e){return new this(e).asinh()}function Zh(e){return new this(e).atan()}function Jh(e){return new this(e).atanh()}function Kh(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?Eh(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=Eh(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(wh(e,t,o,1)),t=Eh(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(wh(e,t,o,1)):(n=Eh(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Qh(e){return new this(e).cbrt()}function ed(e){return Ch(e=new this(e),e.e+1,2)}function td(e,t,n){return new this(e).clamp(t,n)}function nd(e){if(!e||"object"!=typeof e)throw Error(rh+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,Ju,"rounding",0,8,"toExpNeg",-Zu,0,"toExpPos",0,Zu,"maxE",0,Zu,"minE",-Zu,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=th[n]),void 0!==(r=e[n])){if(!(lh(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(ih+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=th[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(ih+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(sh);this[n]=!0}else this[n]=!1}return this}function rd(e){return new this(e).cos()}function id(e){return new this(e).cosh()}function od(e,t){return new this(e).div(t)}function sd(e){return new this(e).exp()}function ad(e){return Ch(e=new this(e),e.e+1,3)}function ld(){var e,t,n=new this(0);for(nh=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return nh=!0,new this(1/0);n=t}return nh=!0,n.sqrt()}function cd(e){return e instanceof Ld||e&&e.toStringTag===ah||!1}function ud(e){return new this(e).ln()}function hd(e,t){return new this(e).log(t)}function dd(e){return new this(e).log(2)}function pd(e){return new this(e).log(10)}function fd(){return Oh(this,arguments,"lt")}function md(){return Oh(this,arguments,"gt")}function gd(e,t){return new this(e).mod(t)}function vd(e,t){return new this(e).mul(t)}function yd(e,t){return new this(e).pow(t)}function _d(e){var t,n,r,i,o=0,s=new this(1),a=[];if(void 0===e?e=this.precision:xh(e,1,Ju),r=Math.ceil(e/mh),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(sh);for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o<r;)a[o++]=1e7*Math.random()|0;for(r=a[--o],e%=mh,r&&e&&(i=ch(10,mh-e),a[o]=(r/i|0)*i);0===a[o];o--)a.pop();if(o<0)n=0,a=[0];else{for(n=-1;0===a[0];n-=mh)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<mh&&(n-=mh-r)}return s.e=n,s.d=a,s}function xd(e){return Ch(e=new this(e),e.e+1,this.rounding)}function bd(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Sd(e){return new this(e).sin()}function wd(e){return new this(e).sinh()}function Cd(e){return new this(e).sqrt()}function Md(e,t){return new this(e).sub(t)}function Td(){var e=0,t=arguments,n=new this(t[e]);for(nh=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return nh=!0,Ch(n,this.precision,this.rounding)}function Ad(e){return new this(e).tan()}function Ed(e){return new this(e).tanh()}function Rd(e){return Ch(e=new this(e),e.e+1,1)}yh[Symbol.for("nodejs.util.inspect.custom")]=yh.toString,yh[Symbol.toStringTag]="Decimal";var Ld=yh.constructor=function e(t){var n,r,i;function o(e){var t,n,r,i=this;if(!(i instanceof o))return new o(e);if(i.constructor=o,cd(e))return i.s=e.s,void(nh?!e.d||e.e>o.maxE?(i.e=NaN,i.d=null):e.e<o.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(nh?t>o.maxE?(i.e=NaN,i.d=null):t<o.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):Nh(i,e.toString())}if("string"!==r)throw Error(ih+e);return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),ph.test(e)?Nh(i,e):Uh(i,e)}if(o.prototype=yh,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=nd,o.clone=e,o.isDecimal=cd,o.abs=Gh,o.acos=jh,o.acosh=Xh,o.add=$h,o.asin=Yh,o.asinh=qh,o.atan=Zh,o.atanh=Jh,o.atan2=Kh,o.cbrt=Qh,o.ceil=ed,o.clamp=td,o.cos=rd,o.cosh=id,o.div=od,o.exp=sd,o.floor=ad,o.hypot=ld,o.ln=ud,o.log=hd,o.log10=pd,o.log2=dd,o.max=fd,o.min=md,o.mod=gd,o.mul=vd,o.pow=yd,o.random=_d,o.round=xd,o.sign=bd,o.sin=Sd,o.sinh=wd,o.sqrt=Cd,o.sub=Md,o.sum=Td,o.tan=Ad,o.tanh=Ed,o.trunc=Rd,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(th);Qu=new Ld(Qu),eh=new Ld(eh);var Pd={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=ac(n.placement),l=cc(a),c=[Gl,Vl].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return hc("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:dc(e,Xl))}(i.padding,n),h=kl(o),d="y"===l?Hl:Gl,p="y"===l?Wl:Vl,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=zl(o),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,_=u[d],x=v-h[c]-u[p],b=v/2-h[c]/2+y,S=Oc(_,b,x),w=l;n.modifiersData[r]=((t={})[w]=S,t.centerOffset=S-b,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&rc(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},Id={directives:{domresize:ca()},components:{},props:{value:{type:Number,default:0},valueMin:{type:Number,default:0},valueMax:{type:Number,default:100},valueStep:{type:Number,default:1},valueDecimal:{type:Number,default:0},progBorderRadius:{type:Number,default:5},progHeight:{type:Number,default:4},progColor:{type:String,default:"#74a4d9"},progColorDisabled:{type:String,default:"#c5c5c5"},progBackgroundColor:{type:String,default:"#eee"},progBackgroundColorDisabled:{type:String,default:"#f2f2f2"},sliderSize:{type:Number,default:20},sliderBackgroundColor:{type:String,default:"blue darken-3"},sliderBackgroundColorHover:{type:String,default:"blue darken-2"},sliderBackgroundColorDisabled:{type:String,default:"#aaa"},cmpZIndex:{type:Number,default:3e3},tooltipPlacementDist:{type:Number,default:5},tooltipBorderRadius:{type:Number,default:4},tooltipTextFontSize:{type:String,default:"0.85rem"},tooltipTextColor:{type:String,default:"white"},tooltipBackgroundColor:{type:String,default:"#666"},editable:{type:Boolean,default:!0}},data:function(){return{panelWidth:0,panelHeight:0,das:null,hoverTrans:!1,dragTrans:!1,popperInstance:null,popperShow:!1,r:null,rt:null}},mounted:function(){let e=this,t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=null,o=null,s=null,a=null,l=null,c=null,u=null,h=null,d=null,p=null,f=null,m=null,g=null,v=null,y=!1,_=me(n,"getHeighRatio",null);M(_)||(_=()=>1);let x=me(n,"getWidthRatio",null);M(x)||(x=()=>1);let b=me(n,"stopScrollPropagationForPanel",null);so(b)||(b=!1);let S=me(n,"stopTouchDragPropagationForPanel",null);so(S)||(S=!1);let w=me(n,"useTouchDragForPanel",null);so(w)||(w=!0);let C=e,T=t,A=Hi();return r=e=>{let t=e.deltaY/Math.abs(e.deltaY),n=e.deltaX/Math.abs(e.deltaX);A.emit("scrollPanel",{ratioY:t,ratioX:n}),b&&wu(e)},C.addEventListener("wheel",r),i=e=>{if(w){let t=me(e,"touches.0.clientY",0),n=me(e,"touches.0.clientX",0),r=-t*_(),i=-n*x();y=!0,A.emit("pressBar",{clientY:r,clientX:i}),S&&wu(e)}},C.addEventListener("touchstart",i),o=e=>{if(w&&y){let t=me(e,"touches.0.clientY",0),n=me(e,"touches.0.clientX",0),r=-t*_(),i=-n*x();A.emit("dragBar",{clientY:r,clientX:i}),S&&wu(e)}},C.addEventListener("touchmove",o,{passive:!1}),s=e=>{w&&y&&(y=!1,A.emit("freeBar"),S&&wu(e))},C.addEventListener("touchend",s),a=e=>{y=!0,A.emit("pressBar",{clientY:e.clientY,clientX:e.clientX})},T.addEventListener("mousedown",a),l=e=>{y&&(y=!1,A.emit("freeBar"))},T.addEventListener("mouseup",l),c=e=>{y=!0,A.emit("pressBar",{clientY:e.touches[0].clientY,clientX:e.touches[0].clientX})},T.addEventListener("touchstart",c),u=e=>{y&&(A.emit("dragBar",{clientY:e.touches[0].clientY,clientX:e.touches[0].clientX}),wu(e))},T.addEventListener("touchmove",u,{passive:!1}),h=e=>{y&&(y=!1,A.emit("freeBar"))},T.addEventListener("touchend",h),d=e=>{y&&A.emit("dragBar",{clientY:e.clientY,clientX:e.clientX})},window.addEventListener("mousemove",d),p=e=>{y&&(y=!1,A.emit("freeBar"),b&&wu(e))},window.addEventListener("mouseup",p),f=e=>{},window.addEventListener("scroll",f,{passive:!1}),m=e=>{},window.addEventListener("wheel",m,{passive:!1}),g=e=>{},document.addEventListener("scroll",g,{passive:!1}),v=e=>{},document.addEventListener("wheel",v,{passive:!1}),A.clear=function(){C.removeEventListener("wheel",r),C.removeEventListener("touchstart",i),C.removeEventListener("touchmove",o),C.removeEventListener("touchend",s),T.removeEventListener("mousedown",a),T.removeEventListener("mouseup",l),T.removeEventListener("touchstart",c),T.removeEventListener("touchmove",u),T.removeEventListener("touchend",h),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",p),window.removeEventListener("scroll",f),window.removeEventListener("wheel",m),document.removeEventListener("scroll",g),document.removeEventListener("wheel",v)},A}(e.$refs.divPanel,e.$refs.divBar,{useTouchDragForPanel:!1});t.on("dragBar",e.dragBar),t.on("pressBar",e.pressBar),t.on("freeBar",e.freeBar),e.das=t},beforeDestroy:function(){let e=this;e.das&&e.das.clear()},computed:{changeParam:function(){let e=this,t=0;try{t=(e.value-e.valueMin)/(e.valueMax-e.valueMin)}catch(e){}t=e.limitRatio(t);let n=e.tickRatio(t);return e.r=t,e.rt=n,""},heightCir:function(){return this.sliderSize},widthCir:function(){return this.heightCir},effecting:function(){let e=this;if(!e.editable)return;let t=e.hoverTrans||e.dragTrans;return t?e.showPopper():(e.hidePopper(),e.r=e.rt),t},progWidth:function(){return this.panelWidth-this.sliderSize},useProgBorderRadius:function(){return`border-radius:${this.progBorderRadius}px;`},effProgColor:function(){return Za(this.progColor)},effProgColorDisabled:function(){return Za(this.progColorDisabled)},useProgColor:function(){let e=this;return e.editable?e.effProgColor:e.effProgColorDisabled},effProgBackgroundColor:function(){return Za(this.progBackgroundColor)},effProgBackgroundColorDisabled:function(){return Za(this.progBackgroundColorDisabled)},useProgBackgroundColor:function(){let e=this;return e.editable?e.effProgBackgroundColor:e.effProgBackgroundColorDisabled},effSliderBackgroundColor:function(){return Za(this.sliderBackgroundColor)},effSliderBackgroundColorHover:function(){return Za(this.sliderBackgroundColorHover)},effSliderBackgroundColorDisabled:function(){return Za(this.sliderBackgroundColorDisabled)},useSliderBackgroundColor:function(){let e=this;return e.editable?e.effecting?e.effSliderBackgroundColorHover:e.effSliderBackgroundColor:e.effSliderBackgroundColorDisabled},useTooltipBorderRadius:function(){let e=this;return Br(e.tooltipBorderRadius)?`border-radius:${e.tooltipBorderRadius}px;`:""},useTooltipTextFontSize:function(){let e=this.tooltipTextFontSize;return e=Yo(e,";",""),`font-size:${e};`},useTooltipTextColor:function(){return Za(this.tooltipTextColor)},useTooltipBackgroundColor:function(){return Za(this.tooltipBackgroundColor)},valueDig:function(){let e=this,t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return $i(e)&&Co(t)?(e=Yi(e),Qi(e,t).toFixed(t)):""}(e.rt*(e.valueMax-e.valueMin)+e.valueMin,e.valueDecimal);return t}},methods:{resizePanel:function(e){this.panelWidth=e.snew.offsetWidth,this.panelHeight=e.snew.offsetHeight},limitRatio:function(e){return e=Math.min(e,1),e=Math.max(e,0)},tickRatio:function(e){let t=this,n=0;try{let r=t.valueMax-t.valueMin,i=t.valueStep/r,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Co(t)||(t=0),t=eo(t);let r=me(n,"rounding","");if("ROUND_HALF_UP"!==r&&"ROUND_HALF_EVEN"!==r&&(r="ROUND_HALF_UP"),!$i(e))return"";e=Yi(e);let i=Ld.clone();return i.set({rounding:Ld[r]}),new i(e).toDecimalPlaces(t).toNumber()}(e/i);n=o*i}catch(e){}return n},dragBar:function(e){let t=this;if(!t.editable)return;let n=t.$el.getBoundingClientRect(),r=e.clientX-t.sliderSize/2,i=t.progWidth,o=0;i>0&&(o=(r-n.left)/i),o=t.limitRatio(o);let s=t.tickRatio(o);t.r=o,t.rt=s;let a=Yi(t.valueDig);t.updatePopper(),t.$emit("input",a)},pressBar:function(){this.dragTrans=!0},freeBar:function(){this.dragTrans=!1},showPopper:function(e){let t=this;if(!t.editable)return;let n=me(t,"$refs.divTrigger",null);if(null===n)return;let r=me(t,"$refs.divContent",null);if(null===r)return;let i={strategy:"fixed",placement:"top",modifiers:[Pd,{name:"arrow",options:{padding:5}},Ec,{name:"flip",options:{fallbackPlacements:["top","top-start","top-end","bottom","bottom-start","bottom-end"]}},Rc,{name:"offset",options:{offset:({placement:e,reference:n,popper:r})=>[0,t.tooltipPlacementDist]}},Ic]};t.popperInstance=Sc(n,r,i)},updatePopper:function(e){let t=this;t.editable&&t.popperInstance&&t.popperInstance.update()},hidePopper:function(e){let t=this;t.popperInstance&&(t.popperInstance.destroy(),t.popperInstance=null)}}};const Od=Id;var kd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],style:"user-select:none;",attrs:{changeParam:e.changeParam},on:{domresize:e.resizePanel}},[n("div",{style:"position:relative; width:100%; height:"+e.sliderSize+"px;"},[n("div",{style:"position:absolute; top:"+(e.sliderSize/2-e.progHeight/2)+"px; left:"+e.sliderSize/2+"px; width:"+e.progWidth+"px;"},[n("div",{ref:"divPanel",style:"position:relative; width:"+e.progWidth+"px;",attrs:{_click:"clickProg"}},[n("div",{style:e.useProgBorderRadius+" overflow:hidden; width:"+e.progWidth+"px; height:"+e.progHeight+"px;"},[n("div",{style:"background:"+e.useProgBackgroundColor+"; height:"+e.progHeight+"px;"},[n("div",{style:"background:"+e.useProgColor+"; width:"+e.rt*e.progWidth+"px; height:"+e.progHeight+"px;"})])]),e._v(" "),n("div",{style:"position:absolute; left:"+(e.rt*e.progWidth-e.widthCir/2)+"px; top:"+(e.progHeight/2-e.heightCir/2)+"px; z-index:1; "+(e.editable?"cursor:pointer;":"")},[n("div",{ref:"divTrigger",staticClass:"ts bs",style:"width:"+e.widthCir+"px; height:"+e.heightCir+"px; border-radius:50%; background:"+e.useSliderBackgroundColor+"; outline:none;"})]),e._v(" "),n("div",{ref:"divBar",style:"position:absolute; left:"+(e.r*e.progWidth-e.widthCir/2)+"px; top:"+(e.progHeight/2-e.heightCir/2)+"px; z-index:2; "+(e.editable?"cursor:pointer;":"")},[n("div",{style:"width:"+e.widthCir+"px; height:"+e.heightCir+"px; border-radius:50%; opacity:0; outline:none;",on:{mouseenter:function(t){e.hoverTrans=!0},mouseleave:function(t){e.hoverTrans=!1}}})])])])]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.effecting,expression:"effecting"},{name:"domresize",rawName:"v-domresize"}],ref:"divContent",staticClass:"WPopup-Content",style:"z-index:"+e.cmpZIndex+";",on:{domresize:e.updatePopper}},[n("div",{style:"padding:2px 5px; font-size:0.8rem; "+e.useTooltipTextFontSize+" color:"+e.useTooltipTextColor+"; background:"+e.useTooltipBackgroundColor+"; "+e.useTooltipBorderRadius},[e._v("\n "+e._s(e.valueDig)+"\n "),n("div",{staticClass:"arrow",attrs:{"data-popper-arrow":""}})])])])};kd._withStripped=!0;const Bd={components:{WGroupChipRadio:Iu,WPanelLabelItem:Bu,WText:$u,WSlider:Ka({render:kd,staticRenderFns:[]},(function(e){e&&e("data-v-eb456a54_0",{source:"\n.ts[data-v-eb456a54] {\r\n transition:all 0.3s;\n}\n.bs[data-v-eb456a54] {\r\n box-shadow: 0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);\n}\n.WPopup-Content[data-popper-reference-hidden][data-v-eb456a54] {\r\n visibility: hidden;\r\n pointer-events: none;\n}\n.arrow[data-v-eb456a54],\r\n.arrow[data-v-eb456a54]::before {\r\n position: absolute;\r\n width: 5px;\r\n height: 5px;\r\n background: inherit;\n}\n.arrow[data-v-eb456a54] {\r\n visibility: hidden;\n}\n.arrow[data-v-eb456a54]::before {\r\n visibility: visible;\r\n content: '';\r\n transform: rotate(45deg);\n}\r\n/* .arrow::after {\r\n content: \"\";\r\n position: absolute;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -5px;\r\n border-width: 5px;\r\n border-style: solid;\r\n border-color: black transparent transparent transparent;\r\n} */\r\n",map:{version:3,sources:["D:\\- 006 - 開源\\開源-JS-105-3-w-threejs-vue\\w-threejs-vue\\node_modules\\w-component-vue\\src\\components\\WSlider.vue"],names:[],mappings:";AA6qBA;IACA,mBAAA;AACA;AACA;IACA,kHAAA;AACA;AACA;IACA,kBAAA;IACA,oBAAA;AACA;AACA;;IAEA,kBAAA;IACA,UAAA;IACA,WAAA;IACA,mBAAA;AACA;AACA;IACA,kBAAA;AACA;AACA;IACA,mBAAA;IACA,WAAA;IACA,wBAAA;AACA;AACA;;;;;;;;;GASA",file:"WSlider.vue",sourcesContent:["<template>\r\n <div\r\n :style=\"`user-select:none;`\"\r\n :changeParam=\"changeParam\"\r\n v-domresize\r\n @domresize=\"resizePanel\"\r\n >\r\n\r\n <div\r\n :style=\"`position:relative; width:100%; height:${sliderSize}px;`\"\r\n >\r\n\r\n <div :style=\"`position:absolute; top:${sliderSize/2-progHeight/2}px; left:${sliderSize/2}px; width:${progWidth}px;`\">\r\n\r\n <div\r\n ref=\"divPanel\"\r\n :style=\"`position:relative; width:${progWidth}px;`\"\r\n _click=\"clickProg\"\r\n >\r\n\r\n <div :style=\"`${useProgBorderRadius} overflow:hidden; width:${progWidth}px; height:${progHeight}px;`\">\r\n <div :style=\"`background:${useProgBackgroundColor}; height:${progHeight}px;`\">\r\n <div :style=\"`background:${useProgColor}; width:${(rt)*progWidth}px; height:${progHeight}px;`\"></div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n :style=\"`position:absolute; left:${(rt)*progWidth-widthCir/2}px; top:${progHeight/2-heightCir/2}px; z-index:1; ${editable?'cursor:pointer;':''}`\"\r\n >\r\n\r\n <div\r\n ref=\"divTrigger\"\r\n class=\"ts bs\"\r\n :style=\"`width:${widthCir}px; height:${heightCir}px; border-radius:50%; background:${useSliderBackgroundColor}; outline:none;`\"\r\n ></div>\r\n\r\n </div>\r\n\r\n <div\r\n ref=\"divBar\"\r\n :style=\"`position:absolute; left:${(r)*progWidth-widthCir/2}px; top:${progHeight/2-heightCir/2}px; z-index:2; ${editable?'cursor:pointer;':''}`\"\r\n >\r\n\r\n <div\r\n :style=\"`width:${widthCir}px; height:${heightCir}px; border-radius:50%; opacity:0; outline:none;`\"\r\n @mouseenter=\"hoverTrans=true\"\r\n @mouseleave=\"hoverTrans=false\"\r\n ></div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n \x3c!-- 不能給予position因會被popupjs洗掉, 但可給z-index, 且popupjs會改用transform:translate定位 --\x3e\r\n \x3c!-- 若使用minWidth, 會使popupjs重算給予minWidth用以自動撐開彈窗寬度失效, 若於其內slot外添加div給予minWidth, 亦會使popupjs給予minWidth機制失效, 待研究 --\x3e\r\n <div\r\n ref=\"divContent\"\r\n class=\"WPopup-Content\"\r\n :style=\"`z-index:${cmpZIndex};`\"\r\n v-show=\"effecting\"\r\n v-domresize\r\n @domresize=\"updatePopper\"\r\n >\r\n \x3c!-- 不使用v-if來重產dom, 因開啟arrow會有顯示後來不及定位問題 --\x3e\r\n <div\r\n :style=\"`padding:2px 5px; font-size:0.8rem; ${useTooltipTextFontSize} color:${useTooltipTextColor}; background:${useTooltipBackgroundColor}; ${useTooltipBorderRadius}`\"\r\n >\r\n {{valueDig}}\r\n <div class=\"arrow\" data-popper-arrow></div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport get from 'lodash-es/get'\r\nimport isNumber from 'lodash-es/isNumber'\r\nimport dig from 'wsemi/src/dig.mjs'\r\nimport round from 'wsemi/src/round.mjs'\r\nimport cdbl from 'wsemi/src/cdbl.mjs'\r\nimport replace from 'wsemi/src/replace.mjs'\r\nimport domDragBarAndScroll from 'wsemi/src/domDragBarAndScroll.mjs'\r\nimport domResize from '../js/domResize.mjs'\r\nimport convertColor from '../js/convertColor.mjs'\r\nimport { createPopper } from '@popperjs/core/lib/popper-lite.js' //不用安裝@popperjs/core, 因wsemi安裝tippy.js內有依賴@popperjs/core\r\nimport flip from '@popperjs/core/lib/modifiers/flip.js'\r\nimport offset from '@popperjs/core/lib/modifiers/offset.js'\r\nimport arrow from '@popperjs/core/lib/modifiers/arrow.js'\r\nimport hide from '@popperjs/core/lib/modifiers/hide.js'\r\n//import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow.js'\r\n//import computeStyles from '@popperjs/core/lib/modifiers/computeStyles'\r\n\r\n\r\n/**\r\n * @vue-prop {Number} [value=0] 輸入值數字,介於valueMin與valueMax之間,預設0\r\n * @vue-prop {Number} [valueMin=0] 輸入最小值數字,預設0\r\n * @vue-prop {Number} [valueMax=100] 輸入最大值數字,預設100\r\n * @vue-prop {Number} [valueStep=1] 輸入間隔數字,預設1\r\n * @vue-prop {Number} [valueDecimal=0] 輸入值取小數位數字,用於可拖選值具有小數時,預設0\r\n * @vue-prop {Number} [progBorderRadius=5] 輸入值域條框圓角度數字,單位為px,預設5\r\n * @vue-prop {Number} [progHeight=4] 輸入值域條高度數字,單位為px,預設4\r\n * @vue-prop {String} [progColor='#74a4d9'] 輸入值域條顏色字串,預設'#74a4d9'\r\n * @vue-prop {String} [progColorDisabled='#c5c5c5'] 輸入不可編輯時值域條顏色字串,預設'#c5c5c5'\r\n * @vue-prop {String} [progBackgroundColor='#eee'] 輸入值域條背景顏色字串,預設'#eee'\r\n * @vue-prop {String} [progBackgroundColorDisabled='#f2f2f2'] 輸入不可編輯時值域條背景顏色字串,預設'#f2f2f2'\r\n * @vue-prop {Number} [sliderSize=20] 輸入拖曳球尺寸數字,單位為px,預設20\r\n * @vue-prop {String} [sliderBackgroundColor='blue darken-3'] 輸入拖曳球背景顏色字串,預設'blue darken-3'\r\n * @vue-prop {String} [sliderBackgroundColorHover='blue darken-2'] 輸入滑鼠移入時拖曳球背景顏色字串,預設'blue darken-2'\r\n * @vue-prop {String} [sliderBackgroundColorDisabled='#aaa'] 輸入不可編輯時拖曳球背景顏色字串,預設'#aaa'\r\n * @vue-prop {Number} [cmpZIndex=3000] 輸入提示窗使用z-index數字,預設3000\r\n * @vue-prop {Number} [tooltipPlacementDist=5] 輸入提示窗距離觸發元素距離數字,單位為px,預設5\r\n * @vue-prop {Number} [tooltipBorderRadius=5] 輸入提示窗框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [tooltipTextFontSize='0.85rem'] 輸入提示窗框文字字型大小字串,預設'0.85rem'\r\n * @vue-prop {String} [tooltipTextColor='white'] 輸入提示窗框文字顏色字串,預設'white'\r\n * @vue-prop {String} [tooltipBackgroundColor='#666'] 輸入值域條背景顏色字串,預設'#666'\r\n * @vue-prop {Boolean} [editable=true] 輸入是否為編輯模式,預設true\r\n */\r\nexport default {\r\n directives: {\r\n domresize: domResize(),\r\n },\r\n components: {\r\n },\r\n props: {\r\n value: {\r\n type: Number,\r\n default: 0,\r\n },\r\n valueMin: {\r\n type: Number,\r\n default: 0,\r\n },\r\n valueMax: {\r\n type: Number,\r\n default: 100,\r\n },\r\n valueStep: {\r\n type: Number,\r\n default: 1,\r\n },\r\n valueDecimal: {\r\n type: Number,\r\n default: 0,\r\n },\r\n progBorderRadius: {\r\n type: Number,\r\n default: 5,\r\n },\r\n progHeight: {\r\n type: Number,\r\n default: 4,\r\n },\r\n progColor: {\r\n type: String,\r\n default: '#74a4d9',\r\n },\r\n progColorDisabled: {\r\n type: String,\r\n default: '#c5c5c5',\r\n },\r\n progBackgroundColor: {\r\n type: String,\r\n default: '#eee',\r\n },\r\n progBackgroundColorDisabled: {\r\n type: String,\r\n default: '#f2f2f2',\r\n },\r\n sliderSize: {\r\n type: Number,\r\n default: 20,\r\n },\r\n sliderBackgroundColor: {\r\n type: String,\r\n default: 'blue darken-3',\r\n },\r\n sliderBackgroundColorHover: {\r\n type: String,\r\n default: 'blue darken-2',\r\n },\r\n sliderBackgroundColorDisabled: {\r\n type: String,\r\n default: '#aaa',\r\n },\r\n cmpZIndex: {\r\n type: Number,\r\n default: 3000,\r\n },\r\n tooltipPlacementDist: {\r\n type: Number,\r\n default: 5,\r\n },\r\n tooltipBorderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n tooltipTextFontSize: {\r\n type: String,\r\n default: '0.85rem',\r\n },\r\n tooltipTextColor: {\r\n type: String,\r\n default: 'white',\r\n },\r\n tooltipBackgroundColor: {\r\n type: String,\r\n default: '#666', //rgba(60,60,60,0.75) //因arrow是通過div與旋轉成菱形來繪製, 因此可支援外部指定背景色, 但若有透明就會出現arrow的菱形問題\r\n },\r\n editable: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n\r\n panelWidth: 0,\r\n panelHeight: 0,\r\n\r\n das: null,\r\n\r\n hoverTrans: false,\r\n dragTrans: false,\r\n\r\n popperInstance: null,\r\n popperShow: false,\r\n\r\n r: null,\r\n rt: null,\r\n\r\n }\r\n },\r\n mounted: function() {\r\n //console.log('mounted')\r\n\r\n let vo = this\r\n\r\n //das\r\n let das = domDragBarAndScroll(vo.$refs.divPanel, vo.$refs.divBar, { useTouchDragForPanel: false })\r\n das.on('dragBar', vo.dragBar)\r\n das.on('pressBar', vo.pressBar)\r\n das.on('freeBar', vo.freeBar)\r\n\r\n //save\r\n vo.das = das\r\n\r\n },\r\n beforeDestroy: function() {\r\n //console.log('beforeDestroy')\r\n\r\n let vo = this\r\n\r\n //clear\r\n if (vo.das) {\r\n vo.das.clear()\r\n }\r\n\r\n },\r\n computed: {\r\n\r\n changeParam: function() {\r\n // console.log('computed changeParam')\r\n\r\n let vo = this\r\n\r\n //ratio\r\n let r = 0\r\n try {\r\n r = (vo.value - vo.valueMin) / (vo.valueMax - vo.valueMin)\r\n }\r\n catch (err) {}\r\n\r\n //limitRatio\r\n r = vo.limitRatio(r)\r\n\r\n //rt\r\n let rt = vo.tickRatio(r)\r\n\r\n //save\r\n vo.r = r\r\n vo.rt = rt\r\n\r\n return ''\r\n },\r\n\r\n heightCir: function() {\r\n let vo = this\r\n return vo.sliderSize\r\n },\r\n\r\n widthCir: function() {\r\n let vo = this\r\n return vo.heightCir\r\n },\r\n\r\n effecting: function() {\r\n //console.log('computed effecting')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //b\r\n let b = vo.hoverTrans || vo.dragTrans\r\n\r\n if (b) {\r\n\r\n //showPopper\r\n vo.showPopper()\r\n\r\n }\r\n else {\r\n\r\n //hidePopper\r\n vo.hidePopper()\r\n\r\n //同步\r\n vo.r = vo.rt\r\n\r\n }\r\n\r\n return b\r\n },\r\n\r\n progWidth: function() {\r\n let vo = this\r\n return vo.panelWidth - vo.sliderSize\r\n },\r\n\r\n useProgBorderRadius: function() {\r\n let vo = this\r\n return `border-radius:${vo.progBorderRadius}px;`\r\n },\r\n\r\n effProgColor: function() {\r\n let vo = this\r\n return convertColor(vo.progColor)\r\n },\r\n\r\n effProgColorDisabled: function() {\r\n let vo = this\r\n return convertColor(vo.progColorDisabled)\r\n },\r\n\r\n useProgColor: function() {\r\n let vo = this\r\n if (!vo.editable) {\r\n return vo.effProgColorDisabled\r\n }\r\n return vo.effProgColor\r\n },\r\n\r\n effProgBackgroundColor: function() {\r\n let vo = this\r\n return convertColor(vo.progBackgroundColor)\r\n },\r\n\r\n effProgBackgroundColorDisabled: function() {\r\n let vo = this\r\n return convertColor(vo.progBackgroundColorDisabled)\r\n },\r\n\r\n useProgBackgroundColor: function() {\r\n let vo = this\r\n if (!vo.editable) {\r\n return vo.effProgBackgroundColorDisabled\r\n }\r\n return vo.effProgBackgroundColor\r\n },\r\n\r\n effSliderBackgroundColor: function() {\r\n let vo = this\r\n return convertColor(vo.sliderBackgroundColor)\r\n },\r\n\r\n effSliderBackgroundColorHover: function() {\r\n let vo = this\r\n return convertColor(vo.sliderBackgroundColorHover)\r\n },\r\n\r\n effSliderBackgroundColorDisabled: function() {\r\n let vo = this\r\n return convertColor(vo.sliderBackgroundColorDisabled)\r\n },\r\n\r\n useSliderBackgroundColor: function() {\r\n let vo = this\r\n if (!vo.editable) {\r\n return vo.effSliderBackgroundColorDisabled\r\n }\r\n if (vo.effecting) {\r\n return vo.effSliderBackgroundColorHover\r\n }\r\n return vo.effSliderBackgroundColor\r\n },\r\n\r\n useTooltipBorderRadius: function() {\r\n //console.log('computed useTooltipBorderRadius')\r\n\r\n let vo = this\r\n\r\n if (isNumber(vo.tooltipBorderRadius)) {\r\n return `border-radius:${vo.tooltipBorderRadius}px;`\r\n }\r\n return ''\r\n },\r\n\r\n useTooltipTextFontSize: function() {\r\n let vo = this\r\n let s = vo.tooltipTextFontSize\r\n s = replace(s, ';', '')\r\n return `font-size:${s};`\r\n },\r\n\r\n useTooltipTextColor: function() {\r\n //console.log('computed useTooltipTextColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.tooltipTextColor)\r\n },\r\n\r\n useTooltipBackgroundColor: function() {\r\n //console.log('computed useTooltipBackgroundColor')\r\n\r\n let vo = this\r\n\r\n return convertColor(vo.tooltipBackgroundColor)\r\n },\r\n\r\n valueDig: function() {\r\n // console.log('computed valueDig')\r\n\r\n let vo = this\r\n\r\n //t\r\n let t = (vo.rt) * (vo.valueMax - vo.valueMin) + vo.valueMin\r\n\r\n //dig\r\n let c = dig(t, vo.valueDecimal)\r\n\r\n return c\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n resizePanel: function(msg) {\r\n //console.log('methods resizePanel', msg)\r\n\r\n let vo = this\r\n\r\n //update\r\n vo.panelWidth = msg.snew.offsetWidth\r\n vo.panelHeight = msg.snew.offsetHeight\r\n\r\n // //emit\r\n // vo.$emit('resize', msg)\r\n\r\n },\r\n\r\n limitRatio: function(r) {\r\n // console.log('methods limitRatio', r)\r\n\r\n // let vo = this\r\n\r\n r = Math.min(r, 1)\r\n r = Math.max(r, 0)\r\n\r\n return r\r\n },\r\n\r\n tickRatio: function(r) {\r\n // console.log('methods tickRatio', r)\r\n\r\n let vo = this\r\n\r\n //rt\r\n let rt = 0\r\n try {\r\n\r\n //rtk\r\n let rng = vo.valueMax - vo.valueMin\r\n let rtk = vo.valueStep / rng\r\n\r\n //round\r\n let i = round(r / rtk)\r\n\r\n //rt\r\n rt = i * rtk\r\n // console.log('r', r, 'rt', rt)\r\n\r\n }\r\n catch (err) { }\r\n\r\n\r\n return rt\r\n },\r\n\r\n dragBar: function(msg) {\r\n // console.log('methods dragBar', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //r\r\n let bd = vo.$el.getBoundingClientRect()\r\n let x = msg.clientX - vo.sliderSize / 2\r\n let w = vo.progWidth //vo.$el.offsetWidth\r\n let r = 0\r\n if (w > 0) {\r\n r = (x - bd.left) / w //clientX需扣除元件的left位置\r\n }\r\n\r\n //limitRatio\r\n r = vo.limitRatio(r)\r\n // console.log(vo.r, 'r', r)\r\n\r\n //rt\r\n let rt = vo.tickRatio(r)\r\n\r\n //save\r\n vo.r = r\r\n vo.rt = rt\r\n\r\n //v\r\n let v = cdbl(vo.valueDig)\r\n\r\n //updatePopper\r\n vo.updatePopper()\r\n\r\n //emit\r\n vo.$emit('input', v)\r\n\r\n },\r\n\r\n pressBar: function() {\r\n let vo = this\r\n vo.dragTrans = true\r\n },\r\n\r\n freeBar: function() {\r\n let vo = this\r\n vo.dragTrans = false\r\n },\r\n\r\n showPopper: function(from) {\r\n // console.log('methods showPopper', from)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //divTrigger\r\n let divTrigger = get(vo, '$refs.divTrigger', null)\r\n if (divTrigger === null) {\r\n return //console.log('無法找到點擊區元素')\r\n }\r\n\r\n //divContent\r\n let divContent = get(vo, '$refs.divContent', null)\r\n\r\n //check\r\n if (divContent === null) {\r\n return //console.log('無法找到顯示元素')\r\n }\r\n\r\n //@popperjs/core 2.x\r\n let opt = {\r\n strategy: 'fixed', //盡量使用'fixed'而不用'absolute', 否則位於多層dialog或多層drawer內popup顯示會異常\r\n placement: 'top', //預設top, 因arrow不好給故僅提供top\r\n modifiers: [\r\n // preventOverflow,\r\n // computeStyles,\r\n // {\r\n // name: 'computeStyles',\r\n // options: {\r\n // gpuAcceleration: false, //預設true, 可關閉GPU加速\r\n // },\r\n // },\r\n arrow,\r\n {\r\n name: 'arrow',\r\n options: {\r\n padding: 5,\r\n },\r\n },\r\n flip,\r\n {\r\n name: 'flip',\r\n options: {\r\n fallbackPlacements: ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'],\r\n },\r\n },\r\n offset,\r\n {\r\n name: 'offset',\r\n options: {\r\n // offset: [0, vo.tooltipPlacementDist], //[Skidding, Distance]\r\n // offset: [0, 5], //因popperjs會自動調位置, 故得通過callback函數處理指定位置時的偏移量\r\n offset: ({ placement, reference, popper }) => {\r\n // console.log('offset', placement, reference, popper, vo.tooltipPlacementDist)\r\n // if (placement === 'bottom-start' || placement === 'bottom' || placement === 'bottom-end') {\r\n // return [0, vo.tooltipPlacementDist]\r\n // }\r\n // else if (placement === 'top-start' || placement === 'top' || placement === 'top-end') {\r\n // return [0, vo.tooltipPlacementDist]\r\n // }\r\n // else if (placement === 'left-start' || placement === 'left' || placement === 'left-end') {\r\n // return [0, vo.tooltipPlacementDist]\r\n // }\r\n // else if (placement === 'right-start' || placement === 'right' || placement === 'right-end') {\r\n // return [0, vo.tooltipPlacementDist]\r\n // }\r\n // else {\r\n // return []\r\n // }\r\n return [0, vo.tooltipPlacementDist] //[Skidding, Distance]\r\n },\r\n },\r\n },\r\n hide,\r\n ],\r\n }\r\n vo.popperInstance = createPopper(divTrigger, divContent, opt)\r\n // console.log('popperInstance', vo.popperInstance)\r\n\r\n },\r\n\r\n updatePopper: function(msg) {\r\n //console.log('methods updatePopper', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //update\r\n if (vo.popperInstance) {\r\n vo.popperInstance.update()\r\n }\r\n\r\n // //emit\r\n // vo.$emit('resize', msg)\r\n\r\n },\r\n\r\n hidePopper: function(from) {\r\n // console.log('methods hidePopper', from, this.mmkey)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (vo.popperInstance) {\r\n\r\n //destroy\r\n vo.popperInstance.destroy()\r\n vo.popperInstance = null\r\n\r\n }\r\n\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.ts {\r\n transition:all 0.3s;\r\n}\r\n.bs {\r\n box-shadow: 0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);\r\n}\r\n.WPopup-Content[data-popper-reference-hidden] {\r\n visibility: hidden;\r\n pointer-events: none;\r\n}\r\n.arrow,\r\n.arrow::before {\r\n position: absolute;\r\n width: 5px;\r\n height: 5px;\r\n background: inherit;\r\n}\r\n.arrow {\r\n visibility: hidden;\r\n}\r\n.arrow::before {\r\n visibility: visible;\r\n content: '';\r\n transform: rotate(45deg);\r\n}\r\n/* .arrow::after {\r\n content: \"\";\r\n position: absolute;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -5px;\r\n border-width: 5px;\r\n border-style: solid;\r\n border-color: black transparent transparent transparent;\r\n} */\r\n</style>\r\n"]},media:void 0})}),Od,"data-v-eb456a54",false,undefined,!1,el,void 0,void 0)},props:{value:{type:String,default:"#FFFFFF"},size:{type:Number,default:200},borderColor:{type:String,default:"#ddd"},borderColorHover:{type:String,default:"#ccc"},borderColorActive:{type:String,default:"#777"},backgroundColor:{type:String,default:"transparent"},menuBorderRadius:{type:Number,default:4},menuBackgroundColor:{type:String,default:"#fff"},menuBackgroundColorHover:{type:String,default:"#f9f9f9"},menuBackgroundColorActive:{type:String,default:"#f2f2f2"},menuTextColor:{type:String,default:"#444"},menuTextColorHover:{type:String,default:"#222"},menuTextColorActive:{type:String,default:"#000"},menuTextFontSize:{type:String,default:"0.8rem"},inputBorderRadius:{type:Number,default:4},inputBorderColor:{type:String,default:"#ccc"},inputBorderColorHover:{type:String,default:"#b5b5b5"},inputBorderColorActive:{type:String,default:"#aaa"},inputBackgroundColor:{type:String,default:"#fff"},inputBackgroundColorHover:{type:String,default:"#fafafa"},inputBackgroundColorActive:{type:String,default:"#f2f2f2"},inputTextColor:{type:String,default:"#000"},inputTextFontSize:{type:String,default:"0.8rem"},inputTextWidth:{type:Number,default:38},inputTextHeight:{type:Number,default:18},inputLabelWidth:{type:Number,default:12},inputLabelColor:{type:String,default:"#666"},inputLabelFontSize:{type:String,default:"0.8rem"},barProgHeight:{type:Number,default:4},barProgColor:{type:String,default:"#74a4d9"},barProgBackgroundColor:{type:String,default:"#eee"},barSliderSize:{type:Number,default:10},barSliderBackgroundColor:{type:String,default:"#1565C0"},barSliderBackgroundColorHover:{type:String,default:"#1976D2"}},data:function(){return{methods:[{text:"RGBA"},{text:"HSVA"}],methodSelect:{text:"RGBA"},lock:!1,valueTrans:null,r:255,g:255,b:255,h:360,s:1,v:1,a:1,rt:255,gt:255,bt:255,ht:360,st:1,vt:1,at:1}},computed:{changeValue:function(){let e=this;e.valueTrans=Za(e.value);let t=ea.toRgba(e.valueTrans),n=ea.toHsva(e.valueTrans);return e.r=t.r,e.rt=t.r,e.g=t.g,e.gt=t.g,e.b=t.b,e.bt=t.b,e.a=t.a,e.at=t.a,e.h=n.h,e.ht=n.h,e.s=n.s,e.st=n.s,e.v=n.v,e.vt=n.v,""},sliderWidth:function(){let e=this,t=e.size-e.inputTextWidth-e.inputLabelWidth-13;return t=Math.max(t,0),t},useBorderColor:function(){return Za(this.borderColor)},useBackgroundColor:function(){return Za(this.backgroundColor)}},methods:{cki255:function(e){if(!Co(e))return 0;let t=e;return(e=eo(e))<0?e=0:e>255&&(e=255),e===eo(t)?t:e},cki360:function(e){if(!Co(e))return 0;let t=e;return(e=eo(e))<0?e=0:e>360&&(e=360),e===eo(t)?t:e},ckd1:function(e){if(!Su(e))return 0;let t=e;return(e=Yi(e))<0?e=0:e>1&&(e=1),e===Yi(t)?t:e},updateColorCore:function(){let e=this,t=!1,n=!1;{let n=eo(e.rt);e.r!==n&&(e.r=n,t=!0)}{let n=eo(e.gt);e.g!==n&&(e.g=n,t=!0)}{let n=eo(e.bt);e.b!==n&&(e.b=n,t=!0)}{let n=Yi(e.at);e.a!==n&&(e.a=n,t=!0)}{let t=eo(e.ht);e.h!==t&&(e.h=t,n=!0)}{let t=Yi(e.st);e.s!==t&&(e.s=t,n=!0)}{let t=Yi(e.vt);e.v!==t&&(e.v=t,n=!0)}let r=null;t?r={r:e.r,g:e.g,b:e.b,a:e.a}:n&&(r={h:e.h,s:e.s,v:e.v,a:e.a}),ho(r)&&(r=ea.toRgbaString(r),e.valueTrans=r,e.$emit("input",r))},updateColor:function(e,t,n){let r=this;setTimeout((()=>{r.updateColorCore()}),1)}}};var Dd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block;",attrs:{changeValue:e.changeValue}},[n("div",{style:"padding-left:10px; margin-bottom:-1px;"},[n("WGroupChipRadio",{attrs:{items:e.methods,paddingStyle:{v:1,h:6},group:!0,groupBorderRadiusStyle:{top:!0},groupShift:0,borderRadius:e.menuBorderRadius,borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorActive:e.borderColorActive,backgroundColor:e.menuBackgroundColor,backgroundColorHover:e.menuBackgroundColorHover,backgroundColorActive:e.menuBackgroundColorActive,textColor:e.menuTextColor,textColorHover:e.menuTextColorHover,textColorActive:e.menuTextColorActive,textFontSize:e.menuTextFontSize,marginStyle:{},shadowActive:!1},model:{value:e.methodSelect,callback:function(t){e.methodSelect=t},expression:"methodSelect"}})],1),e._v(" "),n("div",{style:"padding:10px; border:1px solid "+e.useBorderColor+"; background:"+e.useBackgroundColor+";"},[n("div",{directives:[{name:"show",rawName:"v-show",value:"RGBA"===e.methodSelect.text,expression:"methodSelect.text==='RGBA'"}]},[n("WPanelLabelItem",{attrs:{label:"R",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.cki255,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"r")}},model:{value:e.rt,callback:function(t){e.rt=t},expression:"rt"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:255,valueStep:1,valueDecimal:0,value:e.r},on:{input:function(t){e.rt=t,e.updateColor(t,"","rs")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"G",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.cki255,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"g")}},model:{value:e.gt,callback:function(t){e.gt=t},expression:"gt"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:255,valueStep:1,valueDecimal:0,value:e.g},on:{input:function(t){e.gt=t,e.updateColor(t,"","gs")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"B",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.cki255,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"b")}},model:{value:e.bt,callback:function(t){e.bt=t},expression:"bt"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:255,valueStep:1,valueDecimal:0,value:e.b},on:{input:function(t){e.bt=t,e.updateColor(t,"","bs")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"A",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.ckd1,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"a")}},model:{value:e.at,callback:function(t){e.at=t},expression:"at"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:1,valueStep:.01,valueDecimal:2,value:e.a},on:{input:function(t){e.at=t,e.updateColor(t,"","as")}}})],1)]},proxy:!0}])})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:"HSVA"===e.methodSelect.text,expression:"methodSelect.text==='HSVA'"}]},[n("WPanelLabelItem",{attrs:{label:"H",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.cki360,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"h")}},model:{value:e.ht,callback:function(t){e.ht=t},expression:"ht"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:360,valueStep:1,valueDecimal:0,value:e.h},on:{input:function(t){e.ht=t,e.updateColor(t,"","hs")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"S",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.ckd1,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"s")}},model:{value:e.st,callback:function(t){e.st=t},expression:"st"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:1,valueStep:.01,valueDecimal:2,value:e.s},on:{input:function(t){e.st=t,e.updateColor(t,"","ss")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"V",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.ckd1,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"v")}},model:{value:e.vt,callback:function(t){e.vt=t},expression:"vt"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:1,valueStep:.01,valueDecimal:2,value:e.v},on:{input:function(t){e.vt=t,e.updateColor(t,"","bs")}}})],1)]},proxy:!0}])}),e._v(" "),n("div",{staticStyle:{height:"10px"}}),e._v(" "),n("WPanelLabelItem",{attrs:{label:"A",labelFontSize:e.inputLabelFontSize,labelWidth:e.inputLabelWidth,labelColor:e.inputLabelColor},scopedSlots:e._u([{key:"item",fn:function(){return[n("div",{staticStyle:{display:"flex","align-items":"center"}},[n("WText",{style:"width:"+e.inputTextWidth+"px;",attrs:{type:e.ckd1,shadow:!1,bottomLineBorderColor:"transparent",bottomLineBorderColorHover:"transparent",bottomLineBorderColorFocus:"transparent",paddingStyle:{v:0,h:5},iconShiftOuter:-10,borderRadius:e.inputBorderRadius,borderColor:e.inputBorderColor,borderColorHover:e.inputBorderColorHover,borderColorFocus:e.inputBorderColorActive,backgroundColor:e.inputBackgroundColor,backgroundColorHover:e.inputBackgroundColorHover,backgroundColorFocus:e.inputBackgroundColorActive,textColor:e.inputTextColor,textFontSize:e.inputTextFontSize,height:e.inputTextHeight},on:{input:function(t,n){e.updateColor(t,n,"a")}},model:{value:e.at,callback:function(t){e.at=t},expression:"at"}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WSlider",{style:"width:"+e.sliderWidth+"px;",attrs:{progHeight:e.barProgHeight,progColor:e.barProgColor,progBackgroundColor:e.barProgBackgroundColor,sliderSize:e.barSliderSize,sliderBackgroundColor:e.barSliderBackgroundColor,sliderBackgroundColorHover:e.barSliderBackgroundColorHover,valueMin:0,valueMax:1,valueStep:.01,valueDecimal:2,value:e.a},on:{input:function(t){e.at=t,e.updateColor(t,"","as")}}})],1)]},proxy:!0}])})],1)])])};Dd._withStripped=!0;const Nd=Ka({render:Dd,staticRenderFns:[]},(function(e){e&&e("data-v-e1922134_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WColorSelectInput.vue"},media:void 0})}),Bd,"data-v-e1922134",false,undefined,!1,el,void 0,void 0);const Ud={directives:{domresize:ca()},components:{WPopup:Yc,WColorSelectPanel:bu,WColorSelectInput:Nd,WButtonChip:Au,WIcon:fl},props:{value:{type:String,default:"#FFFFFF"},type:{type:String,default:"HSVA"},size:{type:Number,default:200},space:{type:Number,default:10},colorBlockSize:{type:Number,default:20},colorBlockBorderWidth:{type:Number,default:1},colorBlockBorderColor:{type:String,default:"#ddd"},showColorText:{type:Boolean,default:!0},colorTextColor:{type:String,default:"#000"},colorTextFontSize:{type:String,default:"0.8rem"},panelBackgroundColor:{type:String,default:"#fff"},toolBackgroundColor:{type:String,default:"#f5f5f5"},menuIconLump:{type:String,default:"M12,5.32L18,8.69V15.31L12,18.68L6,15.31V8.69L12,5.32M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L5,8.09V15.91L12,19.85L19,15.91V8.09L12,4.15Z"},menuIconHsva:{type:String,default:"M19 3V21H15V3H19M14 3V21H10V3H14M9 3V21H5V3H9Z"},menuIconEyeDropper:{type:String,default:"M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"},menuIconColor:{type:String,default:"#aaa"},menuIconColorHover:{type:String,default:"#999"},menuIconColorActive:{type:String,default:"#666"},menuIconSize:{type:Number,default:20},borderColor:{type:String,default:"#ddd"},borderColorHover:{type:String,default:"#ccc"},borderColorActive:{type:String,default:"#777"},menuBorderRadius:{type:Number,default:4},menuTextColor:{type:String,default:"#444"},menuTextColorHover:{type:String,default:"#222"},menuTextColorActive:{type:String,default:"#000"},menuTextFontSize:{type:String,default:"0.8rem"},menuBackgroundColor:{type:String,default:"#fff"},menuBackgroundColorHover:{type:String,default:"#f9f9f9"},menuBackgroundColorActive:{type:String,default:"#f2f2f2"},inputBorderRadius:{type:Number,default:4},inputBorderColor:{type:String,default:"#ccc"},inputBorderColorHover:{type:String,default:"#b5b5b5"},inputBorderColorActive:{type:String,default:"#aaa"},inputBackgroundColor:{type:String,default:"#fff"},inputBackgroundColorHover:{type:String,default:"#fafafa"},inputBackgroundColorActive:{type:String,default:"#f2f2f2"},inputTextColor:{type:String,default:"#000"},inputTextFontSize:{type:String,default:"0.8rem"},inputTextWidth:{type:Number,default:38},inputTextHeight:{type:Number,default:18},inputLabelWidth:{type:Number,default:12},inputLabelColor:{type:String,default:"#666"},inputLabelFontSize:{type:String,default:"0.8rem"},barProgHeight:{type:Number,default:4},barProgColor:{type:String,default:"#74a4d9"},barProgBackgroundColor:{type:String,default:"#eee"},barSliderSize:{type:Number,default:10},barSliderBackgroundColor:{type:String,default:"#1565C0"},barSliderBackgroundColorHover:{type:String,default:"#1976D2"},popupPlacementDist:{type:Number,default:5},btnText:{type:String,default:"OK"},btnRippleColor:{type:String,default:"rgba(255,255,255,0.4)"},btnPaddingStyle:{type:Object,default:()=>({v:1,h:5})},btnTextColor:{type:String,default:"#000"},btnTextColorHover:{type:String,default:"#222"},btnTextColorActive:{type:String,default:"#222"},btnTextFontSize:{type:String,default:"0.8rem"},btnBorderRadius:{type:Number,default:4},btnBackgroundColor:{type:String,default:"rgb(241,241,241)"},btnBackgroundColorHover:{type:String,default:"rgb(236,236,236)"},btnBackgroundColorActive:{type:String,default:"rgb(236,236,236)"},btnShadow:{type:Boolean,default:!0},editable:{type:Boolean,default:!0}},data:function(){return{mdiLoading:"M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",show:!1,typeTrans:"HSVA",loadingEyeDropper:!1,layoutType:"horizontal",layoutOverflowY:!1,layoutMinY:300,layoutMaxY:300,selectPanelHeight:0,selectInputHeight:0,valueOri:null,valueNew:null}},computed:{changeValue:function(){let e=this;return e.valueOri=Za(e.value),e.valueNew=e.valueOri,""},changeType:function(){return this.typeTrans=this.type,""},hasEyeDropper:function(){return Vi(window.EyeDropper)},useColorBlockBorderColor:function(){return Za(this.colorBlockBorderColor)},useColorTextColor:function(){return Za(this.colorTextColor)},usePanelBackgroundColor:function(){return Za(this.panelBackgroundColor)},useToolBackgroundColor:function(){return Za(this.toolBackgroundColor)},useBorderColor:function(){return Za(this.borderColor)},usePanelOverflow:function(){let e=this,t=`overflow-y:auto; min-height:${e.layoutMinY}px;`;return e.layoutOverflowY&&(t+=`max-height:${e.layoutMaxY}px;`),t}},methods:{resize:function(e){let t=this;if(!t.show)return;let n=me(e,"snew.windowWidth",0)>=2*(t.size+20)+3*t.space;t.layoutType=n?"horizontal":"vertical"},resizeContent:function(e){let t=this;if(!t.show)return;let n=me(e,"snew.windowHeight",0);try{let e=function(e){if(!xo(e))return null;try{return e.getBoundingClientRect()}catch(e){}return null}(t.$refs.ct),r=500;t.layoutOverflowY=e.top+r>n,t.layoutMaxY=Math.max(n-e.top-30,t.layoutMinY)}catch(e){}},resizeSelectPanel:function(e){if(!this.show)return;let t=me(e,"snew.clientHeight",0);this.selectPanelHeight=t},resizeSelectInput:function(e){if(!this.show)return;let t=me(e,"snew.clientHeight",0);this.selectInputHeight=t},openEyeDropper:function(){let e=this;e.hasEyeDropper&&(e.loadingEyeDropper=!0,(new window.EyeDropper).open().then((t=>{let n=me(t,"sRGBHex","#fff");e.valueNew=n})).catch((e=>{console.log(e)})).finally((()=>{e.loadingEyeDropper=!1})))},clickColor:function(){let e=this;e.editable&&(e.$emit("input",e.valueNew),e.show=!1)}}};var Fd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("WPopup",{directives:[{name:"domresize",rawName:"v-domresize"}],attrs:{minWidth:null,maxWidth:null,autoFitMinWidth:!1,autoFitMaxWidth:!1,placementDist:e.popupPlacementDist,editable:e.editable,changeValue:e.changeValue,changeType:e.changeType},on:{domresize:e.resize},scopedSlots:e._u([{key:"trigger",fn:function(){return[n("div",{},[n("div",{staticStyle:{display:"flex","align-items":"center",cursor:"pointer",outline:"none"},on:{click:e.clickColor}},[n("div",{style:"border:"+e.colorBlockBorderWidth+"px solid "+e.useColorBlockBorderColor+"; width:"+e.colorBlockSize+"px; height:"+e.colorBlockSize+"px; background:"+e.valueOri+";"}),e._v(" "),e.showColorText?[n("div",{style:"padding-left:5px;"}),e._v(" "),n("div",{style:"font-size:"+e.colorTextFontSize+"; color:"+e.useColorTextColor+";"},[e._v("\n "+e._s(e.valueOri)+"\n ")])]:e._e()],2)])]},proxy:!0},{key:"content",fn:function(){return[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"ct",style:"background:"+e.usePanelBackgroundColor+"; "+e.usePanelOverflow,on:{domresize:e.resizeContent}},[n("div",{style:"display:flex; padding:"+e.space+"px; border-bottom:1px solid "+e.useBorderColor+"; background:"+e.useToolBackgroundColor+";"},[n("div",{},[n("WIcon",{staticStyle:{cursor:"pointer"},attrs:{icon:e.menuIconHsva,color:"HSVA"===e.typeTrans?e.menuIconColorActive:e.menuIconColor,colorHover:"HSVA"===e.typeTrans?e.menuIconColorActive:e.menuIconColorHover,size:e.menuIconSize},on:{click:function(t){e.typeTrans="HSVA",e.$emit("update:type","HSVA")}}})],1),e._v(" "),n("div",{},[n("WIcon",{staticStyle:{cursor:"pointer"},attrs:{icon:e.menuIconLump,color:"LUMP"===e.typeTrans?e.menuIconColorActive:e.menuIconColor,colorHover:"LUMP"===e.typeTrans?e.menuIconColorActive:e.menuIconColorHover,size:e.menuIconSize},on:{click:function(t){e.typeTrans="LUMP",e.$emit("update:type","LUMP")}}})],1),e._v(" "),e.hasEyeDropper?n("div",{},[n("WIcon",{class:{"icon-spinner":e.loadingEyeDropper},staticStyle:{cursor:"pointer"},attrs:{icon:e.loadingEyeDropper?e.mdiLoading:e.menuIconEyeDropper,color:e.loadingEyeDropper?e.menuIconColor:e.menuIconColorActive,colorHover:e.loadingEyeDropper?e.menuIconColor:e.menuIconColorActive,size:e.menuIconSize},on:{click:e.openEyeDropper}})],1):e._e(),e._v(" "),n("div",{style:"width:100%;"}),e._v(" "),n("div",{ref:"mtb",style:"display:flex; align-items:center;"},[n("div",{style:"display:flex; align-items:center; border:"+e.colorBlockBorderWidth+"px solid "+e.useColorBlockBorderColor+";"},[n("div",{style:"width:"+e.colorBlockSize+"px; min-width:"+e.colorBlockSize+"px; height:"+e.colorBlockSize+"px; background:"+e.valueOri+";"}),e._v(" "),n("div",{style:"width:"+e.colorBlockSize+"px; min-width:"+e.colorBlockSize+"px; height:"+e.colorBlockSize+"px; background:"+e.valueNew+";"})]),e._v(" "),n("div",{style:"padding-left:"+e.space+"px;"}),e._v(" "),n("WButtonChip",{attrs:{text:e.btnText,rippleColor:e.btnRippleColor,paddingStyle:e.btnPaddingStyle,textColor:e.btnTextColor,textColorHover:e.btnTextColorHover,textColorActive:e.btnTextColorActive,textFontSize:e.btnTextFontSize,borderRadius:e.btnBorderRadius,_borderColor:"btnBorderColor",_borderColorHover:"btnBorderColorHover",_borderColorActive:"btnBorderColorActive",backgroundColor:e.btnBackgroundColor,backgroundColorHover:e.btnBackgroundColorHover,backgroundColorActive:e.btnBackgroundColorActive,shadow:e.btnShadow},on:{click:e.clickColor}})],1)]),e._v(" "),n("div",{style:"padding:"+e.space+"px;"},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],staticStyle:{display:"flex"},on:{domresize:e.resizeSelectPanel}},[n("WColorSelectPanel",{attrs:{type:e.typeTrans,size:e.size,space:0,backgroundColor:"transparent",menuIconLump:e.menuIconLump,menuIconHsva:e.menuIconHsva,menuIconColor:e.menuIconColor,menuIconColorHover:e.menuIconColorHover,menuIconColorActive:e.menuIconColorActive,menuIconSize:e.menuIconSize},model:{value:e.valueNew,callback:function(t){e.valueNew=t},expression:"valueNew"}})],1),e._v(" "),n("div",{style:"height:"+e.space+"px;"}),e._v(" "),n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],staticStyle:{display:"flex"},on:{domresize:e.resizeSelectInput}},[n("WColorSelectInput",{attrs:{size:Math.max(e.size-22,0),backgroundColor:"transparent",borderColor:e.borderColor,borderColorHover:e.borderColorHover,borderColorActive:e.borderColorActive,menuBorderRadius:e.menuBorderRadius,menuBackgroundColor:e.menuBackgroundColor,menuBackgroundColorHover:e.menuBackgroundColorHover,menuBackgroundColorActive:e.menuBackgroundColorActive,menuTextColor:e.menuTextColor,menuTextColorHover:e.menuTextColorHover,menuTextColorActive:e.menuTextColorActive,menuTextFontSize:e.menuTextFontSize,inputBorderRadius:e.inputBorderRadius,inputBorderColor:e.inputBorderColor,inputBorderColorHover:e.inputBorderColorHover,inputBorderColorActive:e.inputBorderColorActive,inputBackgroundColor:e.inputBackgroundColor,inputBackgroundColorHover:e.inputBackgroundColorHover,inputBackgroundColorActive:e.inputBackgroundColorActive,inputTextColor:e.inputTextColor,inputTextFontSize:e.inputTextFontSize,inputTextWidth:e.inputTextWidth,inputTextHeight:e.inputTextHeight,inputLabelWidth:e.inputLabelWidth,inputLabelColor:e.inputLabelColor,inputLabelFontSize:e.inputLabelFontSize,barProgHeight:e.barProgHeight,barProgColor:e.barProgColor,barProgBackgroundColor:e.barProgBackgroundColor,barSliderSize:e.barSliderSize,barSliderBackgroundColor:e.barSliderBackgroundColor,barSliderBackgroundColorHover:e.barSliderBackgroundColorHover},model:{value:e.valueNew,callback:function(t){e.valueNew=t},expression:"valueNew"}})],1)])])]},proxy:!0}]),model:{value:e.show,callback:function(t){e.show=t},expression:"show"}})};Fd._withStripped=!0;const zd=Ka({render:Fd,staticRenderFns:[]},(function(e){e&&e("data-v-776154e8_0",{source:"\n.icon-spinner[data-v-776154e8] {\r\n animation: spin-animation-data-v-776154e8 1.5s infinite;\r\n display: inline-block;\n}\n@keyframes spin-animation-data-v-776154e8 {\n0% {\r\n transform: rotate(0deg);\n}\n100% {\r\n transform: rotate(359deg);\n}\n}\r\n",map:{version:3,sources:["D:\\- 006 - 開源\\開源-JS-105-3-w-threejs-vue\\w-threejs-vue\\node_modules\\w-component-vue\\src\\components\\WColorSelect.vue"],names:[],mappings:";AA+wBA;IACA,uDAAA;IACA,qBAAA;AACA;AACA;AACA;QACA,uBAAA;AACA;AACA;QACA,yBAAA;AACA;AACA",file:"WColorSelect.vue",sourcesContent:["<template>\r\n <WPopup\r\n :minWidth=\"null\"\r\n :maxWidth=\"null\"\r\n :autoFitMinWidth=\"false\"\r\n :autoFitMaxWidth=\"false\"\r\n :placementDist=\"popupPlacementDist\"\r\n :editable=\"editable\"\r\n v-model=\"show\"\r\n :changeValue=\"changeValue\"\r\n :changeType=\"changeType\"\r\n v-domresize\r\n @domresize=\"resize\"\r\n >\r\n\r\n <template v-slot:trigger>\r\n\r\n <div style=\"\">\r\n \x3c!-- 盡量不要讓display:flex暴露至外層 --\x3e\r\n <div\r\n style=\"display:flex; align-items:center; cursor:pointer; outline:none;\"\r\n @click=\"clickColor\"\r\n >\r\n\r\n <div :style=\"`border:${colorBlockBorderWidth}px solid ${useColorBlockBorderColor}; width:${colorBlockSize}px; height:${colorBlockSize}px; background:${valueOri};`\"></div>\r\n\r\n <template v-if=\"showColorText\">\r\n\r\n <div :style=\"`padding-left:5px;`\"></div>\r\n\r\n <div :style=\"`font-size:${colorTextFontSize}; color:${useColorTextColor};`\">\r\n {{valueOri}}\r\n </div>\r\n\r\n </template>\r\n\r\n </div>\r\n </div>\r\n\r\n </template>\r\n\r\n <template v-slot:content>\r\n\r\n <div\r\n ref=\"ct\"\r\n :style=\"`background:${usePanelBackgroundColor}; ${usePanelOverflow}`\"\r\n v-domresize\r\n @domresize=\"resizeContent\"\r\n >\r\n\r\n \x3c!-- 上方選單區 --\x3e\r\n <div :style=\"`display:flex; padding:${space}px; border-bottom:1px solid ${useBorderColor}; background:${useToolBackgroundColor};`\">\r\n\r\n <div style=\"\">\r\n <WIcon\r\n style=\"cursor:pointer;\"\r\n :icon=\"menuIconHsva\"\r\n :color=\"typeTrans==='HSVA'?menuIconColorActive:menuIconColor\"\r\n :colorHover=\"typeTrans==='HSVA'?menuIconColorActive:menuIconColorHover\"\r\n :size=\"menuIconSize\"\r\n @click=\"typeTrans='HSVA';$emit('update:type','HSVA')\"\r\n ></WIcon>\r\n </div>\r\n\r\n <div style=\"\">\r\n <WIcon\r\n style=\"cursor:pointer;\"\r\n :icon=\"menuIconLump\"\r\n :color=\"typeTrans==='LUMP'?menuIconColorActive:menuIconColor\"\r\n :colorHover=\"typeTrans==='LUMP'?menuIconColorActive:menuIconColorHover\"\r\n :size=\"menuIconSize\"\r\n @click=\"typeTrans='LUMP';$emit('update:type','LUMP')\"\r\n ></WIcon>\r\n </div>\r\n\r\n <div style=\"\" v-if=\"hasEyeDropper\">\r\n <WIcon\r\n :class=\"{'icon-spinner':loadingEyeDropper}\"\r\n style=\"cursor:pointer;\"\r\n :icon=\"loadingEyeDropper?mdiLoading:menuIconEyeDropper\"\r\n :color=\"loadingEyeDropper?menuIconColor:menuIconColorActive\"\r\n :colorHover=\"loadingEyeDropper?menuIconColor:menuIconColorActive\"\r\n :size=\"menuIconSize\"\r\n @click=\"openEyeDropper\"\r\n ></WIcon>\r\n </div>\r\n\r\n <div :style=\"`width:100%;`\"></div>\r\n\r\n <div\r\n ref=\"mtb\"\r\n :style=\"`display:flex; align-items:center;`\"\r\n >\r\n\r\n <div :style=\"`display:flex; align-items:center; border:${colorBlockBorderWidth}px solid ${useColorBlockBorderColor};`\">\r\n\r\n <div :style=\"`width:${colorBlockSize}px; min-width:${colorBlockSize}px; height:${colorBlockSize}px; background:${valueOri};`\"></div>\r\n\r\n <div :style=\"`width:${colorBlockSize}px; min-width:${colorBlockSize}px; height:${colorBlockSize}px; background:${valueNew};`\"></div>\r\n\r\n </div>\r\n\r\n <div :style=\"`padding-left:${space}px;`\"></div>\r\n\r\n <WButtonChip\r\n :text=\"btnText\"\r\n :rippleColor=\"btnRippleColor\"\r\n :paddingStyle=\"btnPaddingStyle\"\r\n :textColor=\"btnTextColor\"\r\n :textColorHover=\"btnTextColorHover\"\r\n :textColorActive=\"btnTextColorActive\"\r\n :textFontSize=\"btnTextFontSize\"\r\n :borderRadius=\"btnBorderRadius\"\r\n _borderColor=\"btnBorderColor\"\r\n _borderColorHover=\"btnBorderColorHover\"\r\n _borderColorActive=\"btnBorderColorActive\"\r\n :backgroundColor=\"btnBackgroundColor\"\r\n :backgroundColorHover=\"btnBackgroundColorHover\"\r\n :backgroundColorActive=\"btnBackgroundColorActive\"\r\n :shadow=\"btnShadow\"\r\n @click=\"clickColor\"\r\n ></WButtonChip>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <div :style=\"`padding:${space}px;`\">\r\n\r\n \x3c!-- 顏色選擇區 --\x3e\r\n <div\r\n style=\"display:flex;\"\r\n v-domresize\r\n @domresize=\"resizeSelectPanel\"\r\n >\r\n <WColorSelectPanel\r\n :type=\"typeTrans\"\r\n :size=\"size\"\r\n :space=\"0\"\r\n :backgroundColor=\"'transparent'\"\r\n :menuIconLump=\"menuIconLump\"\r\n :menuIconHsva=\"menuIconHsva\"\r\n :menuIconColor=\"menuIconColor\"\r\n :menuIconColorHover=\"menuIconColorHover\"\r\n :menuIconColorActive=\"menuIconColorActive\"\r\n :menuIconSize=\"menuIconSize\"\r\n v-model=\"valueNew\"\r\n ></WColorSelectPanel>\r\n </div>\r\n\r\n <div :style=\"`height:${space}px;`\"></div>\r\n\r\n \x3c!-- 顏色數值區 --\x3e\r\n <div\r\n style=\"display:flex;\"\r\n v-domresize\r\n @domresize=\"resizeSelectInput\"\r\n >\r\n <WColorSelectInput\r\n :size=\"Math.max(size-22,0)\"\r\n :backgroundColor=\"'transparent'\"\r\n :borderColor=\"borderColor\"\r\n :borderColorHover=\"borderColorHover\"\r\n :borderColorActive=\"borderColorActive\"\r\n :menuBorderRadius=\"menuBorderRadius\"\r\n :menuBackgroundColor=\"menuBackgroundColor\"\r\n :menuBackgroundColorHover=\"menuBackgroundColorHover\"\r\n :menuBackgroundColorActive=\"menuBackgroundColorActive\"\r\n :menuTextColor=\"menuTextColor\"\r\n :menuTextColorHover=\"menuTextColorHover\"\r\n :menuTextColorActive=\"menuTextColorActive\"\r\n :menuTextFontSize=\"menuTextFontSize\"\r\n :inputBorderRadius=\"inputBorderRadius\"\r\n :inputBorderColor=\"inputBorderColor\"\r\n :inputBorderColorHover=\"inputBorderColorHover\"\r\n :inputBorderColorActive=\"inputBorderColorActive\"\r\n :inputBackgroundColor=\"inputBackgroundColor\"\r\n :inputBackgroundColorHover=\"inputBackgroundColorHover\"\r\n :inputBackgroundColorActive=\"inputBackgroundColorActive\"\r\n :inputTextColor=\"inputTextColor\"\r\n :inputTextFontSize=\"inputTextFontSize\"\r\n :inputTextWidth=\"inputTextWidth\"\r\n :inputTextHeight=\"inputTextHeight\"\r\n :inputLabelWidth=\"inputLabelWidth\"\r\n :inputLabelColor=\"inputLabelColor\"\r\n :inputLabelFontSize=\"inputLabelFontSize\"\r\n :barProgHeight=\"barProgHeight\"\r\n :barProgColor=\"barProgColor\"\r\n :barProgBackgroundColor=\"barProgBackgroundColor\"\r\n :barSliderSize=\"barSliderSize\"\r\n :barSliderBackgroundColor=\"barSliderBackgroundColor\"\r\n :barSliderBackgroundColorHover=\"barSliderBackgroundColorHover\"\r\n v-model=\"valueNew\"\r\n ></WColorSelectInput>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </template>\r\n\r\n </WPopup>\r\n</template>\r\n\r\n<script>\r\nimport { mdiHexagonSlice6, mdiViewParallel, mdiEyedropper, mdiLoading } from '@mdi/js'\r\nimport get from 'lodash-es/get'\r\nimport isfun from 'wsemi/src/isfun.mjs'\r\nimport domGetBoudRect from 'wsemi/src/domGetBoudRect.mjs'\r\nimport convertColor from '../js/convertColor.mjs'\r\nimport domResize from '../js/domResize.mjs'\r\nimport WPopup from './WPopup.vue'\r\nimport WColorSelectPanel from './WColorSelectPanel.vue'\r\nimport WColorSelectInput from './WColorSelectInput.vue'\r\nimport WButtonChip from './WButtonChip.vue'\r\nimport WIcon from './WIcon.vue'\r\n\r\n\r\n/**\r\n * @vue-prop {String} [value='#FFFFFF'] 輸入顏色字串,預設'#FFFFFF'\r\n * @vue-prop {String} [type='HSVA'] 輸入選擇顏色方式字串,可選'LUMP'、'HSVA',預設'HSVA'\r\n * @vue-prop {Number} [size=200] 輸入尺寸數字,代表組件基礎寬度與將自動計算高度,單位px,預設200\r\n * @vue-prop {Number} [space=10] 輸入子組件間距數字,單位px,預設10\r\n * @vue-prop {Number} [colorBlockSize=20] 輸入色塊長與寬度數字,單位px,預設20\r\n * @vue-prop {Number} [colorBlockBorderWidth=1] 輸入色塊框線寬度數字,單位px,預設1\r\n * @vue-prop {String} [colorBlockBorderColor='#ddd'] 輸入色塊框線顏色字串,預設'#ddd'\r\n * @vue-prop {Boolean} [showColorText=true] 輸入是否顯示當前RGBA顏色文字布林值,預設true\r\n * @vue-prop {String} [colorTextColor='#000'] 輸入當前RGBA顏色文字顏色字串,預設'#000'\r\n * @vue-prop {String} [colorTextFontSize='0.8rem'] 輸入當前RGBA顏色文字字型大小字串,預設'0.8rem'\r\n * @vue-prop {String} [panelBackgroundColor='#fff'] 輸入彈窗背景顏色字串,預設'#fff'\r\n * @vue-prop {String} [toolBackgroundColor='#f5f5f5'] 輸入彈窗背景顏色字串,預設'#f5f5f5'\r\n * @vue-prop {String} [menuIconLump=mdiHexagonSlice6] 輸入選單LUMP模式圖標字串,預設mdiHexagonSlice6\r\n * @vue-prop {String} [menuIconHsva=mdiViewParallel] mdiViewParallel\r\n * @vue-prop {String} [menuIconEyeDropper=mdiEyedropper] 輸入取色滴管圖標字串,可為mdi,md,fa代號或mdi/js路徑,預設使用mdi的圖標(mdiEyedropper)\r\n * @vue-prop {String} [menuIconColor='#aaa'] 輸入選單圖標顏色字串,預設'#aaa'\r\n * @vue-prop {String} [menuIconColorHover='#999'] 輸入滑鼠移入時選單圖標顏色字串,預設'#999'\r\n * @vue-prop {String} [menuIconColorActive='#666'] 輸入主動模式時選單圖標顏色字串,預設'#666'\r\n * @vue-prop {Number} [menuIconSize=20] 輸入選單圖標尺寸數字,單位為px,預設20\r\n * @vue-prop {String} [borderColor='#ddd'] 輸入邊框顏色字串,預設'#ddd'\r\n * @vue-prop {String} [borderColorHover='#ccc'] 輸入滑鼠移入時邊框顏色字串,預設'#ccc'\r\n * @vue-prop {String} [borderColorActive='#777'] 輸入主動模式時邊框顏色字串,預設'#777'\r\n * @vue-prop {Number} [menuBorderRadius=4] 輸入框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [menuTextColor='#444'] 輸入選單文字顏色字串,預設'#444'\r\n * @vue-prop {String} [menuTextColorHover='#222'] 輸入滑鼠移入時選單文字顏色字串,預設'#222'\r\n * @vue-prop {String} [menuTextColorActive='#000'] 輸入主動模式時選單文字顏色字串,預設'#000'\r\n * @vue-prop {String} [menuTextFontSize='0.8rem'] 輸入選單文字字型大小字串,預設'0.8rem'\r\n * @vue-prop {String} [menuBackgroundColor='#fff'] 輸入選單背景顏色字串,預設'#fff'\r\n * @vue-prop {String} [menuBackgroundColorHover='#f9f9f9'] 輸入滑鼠移入時選單背景顏色字串,預設'#f9f9f9'\r\n * @vue-prop {String} [menuBackgroundColorActive='#f2f2f2'] 輸入主動模式時選單背景顏色字串,預設'#f2f2f2'\r\n * @vue-prop {Number} [inputBorderRadius=4] 輸入顏色數字輸入區邊框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [inputBorderColor='#ccc'] 輸入顏色數字輸入區邊框顏色字串,預設'#ccc'\r\n * @vue-prop {String} [inputBorderColorHover='#b5b5b5'] 輸入滑鼠移入時顏色數字輸入區邊框顏色字串,預設'#b5b5b5'\r\n * @vue-prop {String} [inputBorderColorActive='#aaa'] 輸入主動模式時顏色數字輸入區邊框顏色字串,預設'#aaa'\r\n * @vue-prop {String} [inputBackgroundColor='#fff'] 輸入顏色數字輸入區背景顏色字串,預設'#fff'\r\n * @vue-prop {String} [inputBackgroundColorHover='#fafafa'] 輸入滑鼠移入時顏色數字輸入區背景顏色字串,預設'#fafafa'\r\n * @vue-prop {String} [inputBackgroundColorActive='#f2f2f2'] 輸入主動模式時顏色數字輸入區背景顏色字串,預設'#f2f2f2'\r\n * @vue-prop {String} [inputTextColor='#000'] 輸入顏色數字輸入區文字顏色字串,預設'#000'\r\n * @vue-prop {String} [inputTextFontSize='0.8rem'] 輸入顏色數字輸入區文字字型大小字串,預設'0.8rem'\r\n * @vue-prop {Number} [inputTextWidth=38] 輸入顏色數字輸入區寬度數字,單位為px,預設38\r\n * @vue-prop {Number} [inputTextHeight=18] 輸入顏色數字輸入區高度數字,單位為px,預設18\r\n * @vue-prop {Number} [inputLabelWidth=12] 輸入顏色數字輸入區標題寬度數字,單位為px,預設12\r\n * @vue-prop {String} [inputLabelColor='#666'] 輸入文字顏色字串,預設'#666'\r\n * @vue-prop {String} [inputLabelFontSize='0.8rem'] 輸入文字字型大小字串,預設'0.8rem'\r\n * @vue-prop {Number} [barProgHeight=4] 輸入值域條高度數字,單位為px,預設4\r\n * @vue-prop {String} [barProgColor='#74a4d9'] 輸入值域條顏色字串,預設'#74a4d9'\r\n * @vue-prop {String} [barProgBackgroundColor='#eee'] 輸入值域條背景顏色字串,預設'#eee'\r\n * @vue-prop {Number} [barSliderSize=10] 輸入拖曳球尺寸數字,單位為px,預設10\r\n * @vue-prop {String} [barSliderBackgroundColor='#1565C0'] 輸入拖曳球背景顏色字串,預設'#1565C0'\r\n * @vue-prop {String} [barSliderBackgroundColorHover='#1976D2'] 輸入滑鼠移入時拖曳球背景顏色字串,預設'#1976D2'\r\n * @vue-prop {Number} [popupPlacementDist=5] 輸入彈窗距離觸發元素距離數字,單位為px,預設5\r\n * @vue-prop {String} [btnText='OK'] 輸入確認按鈕之文字字串,預設'OK'\r\n * @vue-prop {String} [btnRippleColor='rgba(255,255,255,0.4)'] 輸入確認按鈕之ripple效果顏色字串,預設'rgba(255,255,255,0.4)'\r\n * @vue-prop {Object} [btnPaddingStyle={v:1,h:5}] 輸入確認按鈕之內寬距離設定物件,可用鍵值為v、h、left、right、top、bottom,v代表同時設定top與bottom,h代表設定left與right,若有重複設定時後面鍵值會覆蓋前面,各鍵值為寬度數字,單位為px,預設{v:1,h:5}\r\n * @vue-prop {String} [btnTextColor='#000'] 輸入確認按鈕之文字顏色字串,預設'#000'\r\n * @vue-prop {String} [btnTextColorHover='#222'] 輸入滑鼠移入時確認按鈕之文字顏色字串,預設'#222'\r\n * @vue-prop {String} [btnTextColorActive='#222'] 輸入主動模式時確認按鈕之文字顏色字串,預設'#222'\r\n * @vue-prop {String} [btnTextFontSize='0.8rem'] 輸入確認按鈕之文字字型大小字串,預設'0.8rem'\r\n * @vue-prop {Number} [btnBorderRadius=4] 輸入確認按鈕之框圓角度數字,單位為px,預設4\r\n * @vue-prop {String} [btnBackgroundColor='rgb(241,241,241)'] 輸入確認按鈕之背景顏色字串,預設'rgb(241,241,241)'\r\n * @vue-prop {String} [btnBackgroundColorHover='rgb(236,236,236)'] 輸入滑鼠移入時確認按鈕之背景顏色字串,預設'rgb(236,236,236)'\r\n * @vue-prop {String} [btnBackgroundColorActive='rgb(236,236,236)'] 輸入主動模式時確認按鈕之背景顏色字串,預設'rgb(236,236,236)'\r\n * @vue-prop {Boolean} [btnShadow=true] 輸入確認按鈕之是否顯示陰影布林值,預設true\r\n * @vue-prop {Boolean} [editable=true] 輸入是否為編輯模式布林值,預設true\r\n */\r\nexport default {\r\n directives: {\r\n domresize: domResize(),\r\n },\r\n components: {\r\n WPopup,\r\n WColorSelectPanel,\r\n WColorSelectInput,\r\n WButtonChip,\r\n WIcon,\r\n },\r\n props: {\r\n value: {\r\n type: String,\r\n default: '#FFFFFF',\r\n },\r\n type: {\r\n type: String,\r\n default: 'HSVA',\r\n },\r\n size: {\r\n type: Number,\r\n default: 200,\r\n },\r\n space: {\r\n type: Number,\r\n default: 10,\r\n },\r\n colorBlockSize: {\r\n type: Number,\r\n default: 20,\r\n },\r\n colorBlockBorderWidth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n colorBlockBorderColor: {\r\n type: String,\r\n default: '#ddd',\r\n },\r\n showColorText: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n colorTextColor: {\r\n type: String,\r\n default: '#000',\r\n },\r\n colorTextFontSize: {\r\n type: String,\r\n default: '0.8rem',\r\n },\r\n panelBackgroundColor: {\r\n type: String,\r\n default: '#fff',\r\n },\r\n toolBackgroundColor: {\r\n type: String,\r\n default: '#f5f5f5',\r\n },\r\n menuIconLump: {\r\n type: String,\r\n default: mdiHexagonSlice6,\r\n },\r\n menuIconHsva: {\r\n type: String,\r\n default: mdiViewParallel,\r\n },\r\n menuIconEyeDropper: {\r\n type: String,\r\n default: mdiEyedropper,\r\n },\r\n menuIconColor: {\r\n type: String,\r\n default: '#aaa',\r\n },\r\n menuIconColorHover: {\r\n type: String,\r\n default: '#999',\r\n },\r\n menuIconColorActive: {\r\n type: String,\r\n default: '#666',\r\n },\r\n menuIconSize: {\r\n type: Number,\r\n default: 20,\r\n },\r\n borderColor: {\r\n type: String,\r\n default: '#ddd',\r\n },\r\n borderColorHover: {\r\n type: String,\r\n default: '#ccc',\r\n },\r\n borderColorActive: {\r\n type: String,\r\n default: '#777',\r\n },\r\n menuBorderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n menuTextColor: {\r\n type: String,\r\n default: '#444',\r\n },\r\n menuTextColorHover: {\r\n type: String,\r\n default: '#222',\r\n },\r\n menuTextColorActive: {\r\n type: String,\r\n default: '#000',\r\n },\r\n menuTextFontSize: {\r\n type: String,\r\n default: '0.8rem',\r\n },\r\n menuBackgroundColor: {\r\n type: String,\r\n default: '#fff',\r\n },\r\n menuBackgroundColorHover: {\r\n type: String,\r\n default: '#f9f9f9',\r\n },\r\n menuBackgroundColorActive: {\r\n type: String,\r\n default: '#f2f2f2',\r\n },\r\n inputBorderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n inputBorderColor: {\r\n type: String,\r\n default: '#ccc',\r\n },\r\n inputBorderColorHover: {\r\n type: String,\r\n default: '#b5b5b5',\r\n },\r\n inputBorderColorActive: {\r\n type: String,\r\n default: '#aaa',\r\n },\r\n inputBackgroundColor: {\r\n type: String,\r\n default: '#fff',\r\n },\r\n inputBackgroundColorHover: {\r\n type: String,\r\n default: '#fafafa',\r\n },\r\n inputBackgroundColorActive: {\r\n type: String,\r\n default: '#f2f2f2',\r\n },\r\n inputTextColor: {\r\n type: String,\r\n default: '#000',\r\n },\r\n inputTextFontSize: {\r\n type: String,\r\n default: '0.8rem',\r\n },\r\n inputTextWidth: {\r\n type: Number,\r\n default: 38,\r\n },\r\n inputTextHeight: {\r\n type: Number,\r\n default: 18,\r\n },\r\n inputLabelWidth: {\r\n type: Number,\r\n default: 12,\r\n },\r\n inputLabelColor: {\r\n type: String,\r\n default: '#666',\r\n },\r\n inputLabelFontSize: {\r\n type: String,\r\n default: '0.8rem',\r\n },\r\n barProgHeight: {\r\n type: Number,\r\n default: 4,\r\n },\r\n barProgColor: {\r\n type: String,\r\n default: '#74a4d9',\r\n },\r\n barProgBackgroundColor: {\r\n type: String,\r\n default: '#eee',\r\n },\r\n barSliderSize: {\r\n type: Number,\r\n default: 10,\r\n },\r\n barSliderBackgroundColor: {\r\n type: String,\r\n default: '#1565C0',\r\n },\r\n barSliderBackgroundColorHover: {\r\n type: String,\r\n default: '#1976D2',\r\n },\r\n popupPlacementDist: {\r\n type: Number,\r\n default: 5,\r\n },\r\n btnText: {\r\n type: String,\r\n default: 'OK',\r\n },\r\n btnRippleColor: {\r\n type: String,\r\n default: 'rgba(255,255,255,0.4)',\r\n },\r\n btnPaddingStyle: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n v: 1,\r\n h: 5,\r\n }\r\n },\r\n },\r\n btnTextColor: {\r\n type: String,\r\n default: '#000',\r\n },\r\n btnTextColorHover: {\r\n type: String,\r\n default: '#222',\r\n },\r\n btnTextColorActive: {\r\n type: String,\r\n default: '#222',\r\n },\r\n btnTextFontSize: {\r\n type: String,\r\n default: '0.8rem',\r\n },\r\n btnBorderRadius: {\r\n type: Number,\r\n default: 4,\r\n },\r\n btnBackgroundColor: {\r\n type: String,\r\n default: 'rgb(241,241,241)',\r\n },\r\n btnBackgroundColorHover: {\r\n type: String,\r\n default: 'rgb(236,236,236)',\r\n },\r\n btnBackgroundColorActive: {\r\n type: String,\r\n default: 'rgb(236,236,236)',\r\n },\r\n btnShadow: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n editable: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n },\r\n data: function() {\r\n return {\r\n mdiLoading,\r\n\r\n show: false,\r\n\r\n typeTrans: 'HSVA',\r\n\r\n loadingEyeDropper: false,\r\n\r\n layoutType: 'horizontal',\r\n layoutOverflowY: false,\r\n layoutMinY: 300,\r\n layoutMaxY: 300,\r\n\r\n selectPanelHeight: 0,\r\n selectInputHeight: 0,\r\n\r\n valueOri: null,\r\n valueNew: null,\r\n\r\n }\r\n },\r\n computed: {\r\n\r\n changeValue: function() {\r\n let vo = this\r\n vo.valueOri = convertColor(vo.value)\r\n vo.valueNew = vo.valueOri\r\n return ''\r\n },\r\n\r\n changeType: function() {\r\n let vo = this\r\n vo.typeTrans = vo.type\r\n return ''\r\n },\r\n\r\n hasEyeDropper: function() {\r\n // let vo = this\r\n let b = isfun(window.EyeDropper)\r\n // console.log('window.EyeDropper', window.EyeDropper)\r\n return b\r\n },\r\n\r\n useColorBlockBorderColor: function() {\r\n let vo = this\r\n return convertColor(vo.colorBlockBorderColor)\r\n },\r\n\r\n useColorTextColor: function() {\r\n let vo = this\r\n return convertColor(vo.colorTextColor)\r\n },\r\n\r\n usePanelBackgroundColor: function() {\r\n let vo = this\r\n return convertColor(vo.panelBackgroundColor)\r\n },\r\n\r\n useToolBackgroundColor: function() {\r\n let vo = this\r\n return convertColor(vo.toolBackgroundColor)\r\n },\r\n\r\n useBorderColor: function() {\r\n let vo = this\r\n return convertColor(vo.borderColor)\r\n },\r\n\r\n usePanelOverflow: function() {\r\n let vo = this\r\n let of = `overflow-y:auto; min-height:${vo.layoutMinY}px;`\r\n if (vo.layoutOverflowY) {\r\n of += `max-height:${vo.layoutMaxY}px;`\r\n }\r\n return of\r\n },\r\n\r\n },\r\n methods: {\r\n\r\n resize: function(msg) {\r\n // console.log('methods resize', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.show) {\r\n return\r\n }\r\n\r\n let w = get(msg, 'snew.windowWidth', 0)\r\n // let h = get(msg, 'snew.windowHeight', 0)\r\n // console.log('w', w, 'h', h, b)\r\n\r\n //layoutType\r\n let b = w >= 2 * (vo.size + 20) + 3 * vo.space //20為組件設定, 不提供外部更改故可直接給\r\n vo.layoutType = b ? 'horizontal' : 'vertical'\r\n // console.log('layoutType', vo.layoutType)\r\n\r\n },\r\n\r\n resizeContent: function(msg) {\r\n // console.log('methods resizeContent', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.show) {\r\n return\r\n }\r\n\r\n // let w = get(msg, 'snew.windowWidth', 0)\r\n let h = get(msg, 'snew.windowHeight', 0)\r\n\r\n try {\r\n\r\n // console.log('vo.$refs.ct', vo.$refs.ct)\r\n let rt = domGetBoudRect(vo.$refs.ct)\r\n // console.log('rt', rt)\r\n\r\n //hc, 概估組件size=200時高度\r\n let hc = 500\r\n\r\n //layoutOverflowY\r\n vo.layoutOverflowY = rt.top + hc > h\r\n // console.log('layoutOverflowY', vo.layoutOverflowY)\r\n\r\n //layoutMaxY\r\n vo.layoutMaxY = Math.max(h - rt.top - 30, vo.layoutMinY) //30是概估與底部的留白距離\r\n // console.log('layoutMaxY', vo.layoutMaxY)\r\n\r\n }\r\n catch (err) {}\r\n\r\n },\r\n\r\n resizeSelectPanel: function(msg) {\r\n // console.log('methods resizeSelectPanel', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.show) {\r\n return\r\n }\r\n\r\n let h = get(msg, 'snew.clientHeight', 0)\r\n\r\n //save\r\n vo.selectPanelHeight = h\r\n\r\n },\r\n\r\n resizeSelectInput: function(msg) {\r\n // console.log('methods resizeSelectInput', msg)\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.show) {\r\n return\r\n }\r\n\r\n let h = get(msg, 'snew.clientHeight', 0)\r\n\r\n //save\r\n vo.selectInputHeight = h\r\n\r\n },\r\n\r\n openEyeDropper: function() {\r\n // console.log('methods openEyeDropper')\r\n\r\n let vo = this\r\n\r\n //check\r\n if (!vo.hasEyeDropper) {\r\n return\r\n }\r\n\r\n vo.loadingEyeDropper = true\r\n\r\n let eyeDropper = new window.EyeDropper()\r\n eyeDropper\r\n .open()\r\n .then((res) => {\r\n // console.log('res', res)\r\n let hex = get(res, 'sRGBHex', '#fff')\r\n vo.valueNew = hex\r\n })\r\n .catch((err) => {\r\n console.log(err)\r\n })\r\n .finally(() => {\r\n vo.loadingEyeDropper = false\r\n })\r\n\r\n },\r\n\r\n clickColor: function() {\r\n // console.log('methods clickColor')\r\n\r\n let vo = this\r\n\r\n //check, 不可編輯時跳出\r\n if (!vo.editable) {\r\n return\r\n }\r\n\r\n //emit\r\n vo.$emit('input', vo.valueNew)\r\n\r\n //hide\r\n vo.show = false\r\n\r\n },\r\n\r\n },\r\n}\r\n<\/script>\r\n\r\n<style scoped>\r\n.icon-spinner {\r\n animation: spin-animation 1.5s infinite;\r\n display: inline-block;\r\n}\r\n@keyframes spin-animation {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n 100% {\r\n transform: rotate(359deg);\r\n }\r\n}\r\n</style>\r\n"]},media:void 0})}),Ud,"data-v-776154e8",false,undefined,!1,el,void 0,void 0);function Hd(e,t){return ji(e)&&Co(t)?0===(t=eo(t))?e:Mo(e,e.length-t):""}function Wd(e){if(!ji(e))return"";let t=function(e){if(!ji(e))return{path:"",isRoot:!1};for(;e.indexOf("\\\\")>=0;)e=e.replace("\\\\","\\");for(;e.indexOf("//")>=0;)e=e.replace("//","/");if(":"===To(e,1))return{path:`${e}\\`,isRoot:!0};if("\\"===To(e,1)){let t=Hd(e,1);return":"===To(t,1)?{path:e,isRoot:!0}:{path:t,isRoot:!1}}if("/"===To(e,1)){let t=Hd(e,1);return 0===gt(t)?{path:e,isRoot:!0}:{path:t,isRoot:!1}}return{path:e,isRoot:!1}}(e);if(t.isRoot)return t.path;let n=t.path;try{n=n.split("\\").pop().split("/").pop()}catch(e){}return n}function Vd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vd(Object(n),!0).forEach((function(t){ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2010-2023 Three.js Authors
|
|
18
|
+
* SPDX-License-Identifier: MIT
|
|
19
|
+
*/const jd="159",Xd=1,$d=2,Yd=3,qd=0,Zd=1,Jd=100,Kd=204,Qd=205,ep=0,tp=1,np=2,rp=0,ip=1,op=2,sp=3,ap=4,lp=5,cp="attached",up="detached",hp=300,dp=301,pp=302,fp=303,mp=304,gp=306,vp=1e3,yp=1001,_p=1002,xp=1003,bp=1004,Sp=1005,wp=1006,Cp=1007,Mp=1008,Tp=1009,Ap=1012,Ep=1013,Rp=1014,Lp=1015,Pp=1016,Ip=1017,Op=1018,kp=1020,Bp=1023,Dp=1026,Np=1027,Up=1029,Fp=1031,zp=1033,Hp=33776,Wp=33777,Vp=33778,Gp=33779,jp=35840,Xp=35841,$p=35842,Yp=35843,qp=36196,Zp=37492,Jp=37496,Kp=37808,Qp=37809,ef=37810,tf=37811,nf=37812,rf=37813,of=37814,sf=37815,af=37816,lf=37817,cf=37818,uf=37819,hf=37820,df=37821,pf=36492,ff=36494,mf=36495,gf=36284,vf=36285,yf=36286,_f=2300,xf=2301,bf=2302,Sf=2400,wf=2401,Cf=2402,Mf=2500,Tf=2501,Af=3e3,Ef=3001,Rf="",Lf="srgb",Pf="srgb-linear",If="display-p3",Of="display-p3-linear",kf="linear",Bf="srgb",Df="rec709",Nf="p3",Uf=7680,Ff=35044,zf="300 es",Hf=1035,Wf=2e3,Vf=2001;let Gf=class{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.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 n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}};const jf=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Xf=1234567;const $f=Math.PI/180,Yf=180/Math.PI;function qf(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(jf[255&e]+jf[e>>8&255]+jf[e>>16&255]+jf[e>>24&255]+"-"+jf[255&t]+jf[t>>8&255]+"-"+jf[t>>16&15|64]+jf[t>>24&255]+"-"+jf[63&n|128]+jf[n>>8&255]+"-"+jf[n>>16&255]+jf[n>>24&255]+jf[255&r]+jf[r>>8&255]+jf[r>>16&255]+jf[r>>24&255]).toLowerCase()}function Zf(e,t,n){return Math.max(t,Math.min(n,e))}function Jf(e,t){return(e%t+t)%t}function Kf(e,t,n){return(1-n)*e+n*t}function Qf(e){return 0==(e&e-1)&&0!==e}function em(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function tm(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function nm(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const rm={DEG2RAD:$f,RAD2DEG:Yf,generateUUID:qf,clamp:Zf,euclideanModulo:Jf,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Kf,damp:function(e,t,n,r){return Kf(e,t,1-Math.exp(-n*r))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(Jf(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(Xf=e);let t=Xf+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*$f},radToDeg:function(e){return e*Yf},isPowerOfTwo:Qf,ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:em,setQuaternionFromProperEuler:function(e,t,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((t+r)/2),u=s((t+r)/2),h=o((t-r)/2),d=s((t-r)/2),p=o((r-t)/2),f=s((r-t)/2);switch(i){case"XYX":e.set(a*u,l*h,l*d,a*c);break;case"YZY":e.set(l*d,a*u,l*h,a*c);break;case"ZXZ":e.set(l*h,l*d,a*u,a*c);break;case"XZX":e.set(a*u,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:nm,denormalize:tm};class im{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;im.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(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}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Zf(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class om{constructor(e,t,n,r,i,o,s,a,l){om.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,o,s,a,l)}set(e,t,n,r,i,o,s,a,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=s,c[3]=t,c[4]=i,c[5]=a,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],s=n[3],a=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],_=r[7],x=r[2],b=r[5],S=r[8];return i[0]=o*f+s*v+a*x,i[3]=o*m+s*y+a*b,i[6]=o*g+s*_+a*S,i[1]=l*f+c*v+u*x,i[4]=l*m+c*y+u*b,i[7]=l*g+c*_+u*S,i[2]=h*f+d*v+p*x,i[5]=h*m+d*y+p*b,i[8]=h*g+d*_+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*o*c-t*s*l-n*i*c+n*s*a+r*i*l-r*o*a}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=c*o-s*l,h=s*a-c*i,d=l*i-o*a,p=t*u+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=u*f,e[1]=(r*l-c*n)*f,e[2]=(s*n-r*o)*f,e[3]=h*f,e[4]=(c*t-r*a)*f,e[5]=(r*i-s*t)*f,e[6]=d*f,e[7]=(n*a-l*t)*f,e[8]=(o*t-n*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,o,s){const a=Math.cos(i),l=Math.sin(i);return this.set(n*a,n*l,-n*(a*o+l*s)+o+e,-r*l,r*a,-r*(-l*o+a*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(sm.makeScale(e,t)),this}rotate(e){return this.premultiply(sm.makeRotation(-e)),this}translate(e,t){return this.premultiply(sm.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const sm=new om;function am(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}const lm={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function cm(e,t){return new lm[e](t)}function um(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function hm(){const e=um("canvas");return e.style.display="block",e}const dm={};function pm(e){e in dm||(dm[e]=!0,console.warn(e))}const fm=(new om).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),mm=(new om).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),gm={[Pf]:{transfer:kf,primaries:Df,toReference:e=>e,fromReference:e=>e},[Lf]:{transfer:Bf,primaries:Df,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[Of]:{transfer:kf,primaries:Nf,toReference:e=>e.applyMatrix3(mm),fromReference:e=>e.applyMatrix3(fm)},[If]:{transfer:Bf,primaries:Nf,toReference:e=>e.convertSRGBToLinear().applyMatrix3(mm),fromReference:e=>e.applyMatrix3(fm).convertLinearToSRGB()}},vm=new Set([Pf,Of]),ym={enabled:!0,_workingColorSpace:Pf,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!vm.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const r=gm[t].toReference;return(0,gm[n].fromReference)(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return gm[e].primaries},getTransfer:function(e){return e===Rf?kf:gm[e].transfer}};function _m(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function xm(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let bm;class Sm{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===bm&&(bm=um("canvas")),bm.width=e.width,bm.height=e.height;const n=bm.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=bm}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=um("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*_m(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*_m(t[e]/255)):t[e]=_m(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let wm=0;class Cm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isSource=!0,Object.defineProperty(this,"id",{value:wm++}),this.uuid=qf(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(Mm(r[t].image)):e.push(Mm(r[t]))}else e=Mm(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function Mm(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Sm.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Tm=0;class Am extends Gf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Am.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Am.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yp,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:yp,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:wp,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Mp,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Bp,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Tp,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Am.DEFAULT_ANISOTROPY,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Rf;super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Tm++}),this.uuid=qf(),this.name="",this.source=new Cm(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new im(0,0),this.repeat=new im(1,1),this.center=new im(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new om,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(pm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===Ef?Lf:Rf),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){void 0===e&&(e=null),this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==hp)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case vp:e.x=e.x-Math.floor(e.x);break;case yp:e.x=e.x<0?0:1;break;case _p: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 vp:e.y=e.y-Math.floor(e.y);break;case yp:e.y=e.y<0?0:1;break;case _p: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)}get encoding(){return pm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Lf?Ef:Af}set encoding(e){pm("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Ef?Lf:Rf}}Am.DEFAULT_IMAGE=null,Am.DEFAULT_MAPPING=hp,Am.DEFAULT_ANISOTROPY=1;class Em{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Em.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const o=.01,s=.1,a=e.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+h)/4,_=(u+f)/4,x=(p+m)/4;return e>a&&e>v?e<o?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=y/n,i=_/n):a>v?a<o?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(a),n=y/r,i=x/r):v<o?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(v),n=_/i,r=x/i),this.set(n,r,i,t),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}}class Rm extends Gf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Em(0,0,e,t),this.scissorTest=!1,this.viewport=new Em(0,0,e,t);const r={width:e,height:t,depth:1};void 0!==n.encoding&&(pm("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Ef?Lf:Rf),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wp,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new Am(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Cm(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Lm extends Rm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.isWebGLRenderTarget=!0}}class Pm extends Am{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=xp,this.minFilter=xp,this.wrapR=yp,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Im extends Am{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=xp,this.minFilter=xp,this.wrapR=yp,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Om{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,o,s){let a=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(0===s)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===s)return e[t+0]=h,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(u!==f||a!==h||l!==d||c!==p){let e=1-s;const t=a*h+l*d+c*p+u*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,t*n);e=Math.sin(e*o)/i,s=Math.sin(s*o)/i}const i=s*n;if(a=a*e+h*i,l=l*e+d*i,c=c*e+p*i,u=u*e+f*i,e===1-s){const e=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=e,l*=e,c*=e,u*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,o){const s=n[r],a=n[r+1],l=n[r+2],c=n[r+3],u=i[o],h=i[o+1],d=i[o+2],p=i[o+3];return e[t]=s*p+c*u+a*d-l*h,e[t+1]=a*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-a*u,e[t+3]=c*p-s*u-a*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,r=e._y,i=e._z,o=e._order,s=Math.cos,a=Math.sin,l=s(n/2),c=s(r/2),u=s(i/2),h=a(n/2),d=a(r/2),p=a(i/2);switch(o){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],s=t[5],a=t[9],l=t[2],c=t[6],u=t[10],h=n+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(o-r)*e}else if(n>s&&n>u){const e=2*Math.sqrt(1+n-s-u);this._w=(c-a)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(i+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-n-u);this._w=(i-l)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+u-n-s);this._w=(o-r)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Zf(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,o=e._w,s=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+o*s+r*l-i*a,this._y=r*c+o*a+i*s-n*l,this._z=i*c+o*l+n*a-r*s,this._w=o*c-n*s-r*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,o=this._w;let s=o*e._w+n*e._x+r*e._y+i*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const a=1-s*s;if(a<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class km{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;km.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Dm.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Dm.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,s=e.z,a=e.w,l=2*(o*r-s*n),c=2*(s*t-i*r),u=2*(i*n-o*t);return this.x=t+a*l+o*u-s*c,this.y=n+a*c+s*l-i*u,this.z=r+a*u+i*c-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,o=t.x,s=t.y,a=t.z;return this.x=r*a-i*s,this.y=i*o-n*a,this.z=n*s-r*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Bm.copy(this).projectOnVector(e),this.sub(Bm)}reflect(e){return this.sub(Bm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Zf(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Bm=new km,Dm=new Om;class Nm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km(-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){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Fm.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fm.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Fm.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,Fm):Fm.fromBufferAttribute(r,t),Fm.applyMatrix4(e.matrixWorld),this.expandByPoint(Fm);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),zm.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),zm.copy(n.boundingBox)),zm.applyMatrix4(e.matrixWorld),this.union(zm)}const r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Fm),Fm.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($m),Ym.subVectors(this.max,$m),Hm.subVectors(e.a,$m),Wm.subVectors(e.b,$m),Vm.subVectors(e.c,$m),Gm.subVectors(Wm,Hm),jm.subVectors(Vm,Wm),Xm.subVectors(Hm,Vm);let t=[0,-Gm.z,Gm.y,0,-jm.z,jm.y,0,-Xm.z,Xm.y,Gm.z,0,-Gm.x,jm.z,0,-jm.x,Xm.z,0,-Xm.x,-Gm.y,Gm.x,0,-jm.y,jm.x,0,-Xm.y,Xm.x,0];return!!Jm(t,Hm,Wm,Vm,Ym)&&(t=[1,0,0,0,1,0,0,0,1],!!Jm(t,Hm,Wm,Vm,Ym)&&(qm.crossVectors(Gm,jm),t=[qm.x,qm.y,qm.z],Jm(t,Hm,Wm,Vm,Ym)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fm).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Fm).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()||(Um[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Um[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Um[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Um[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Um[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Um[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Um[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Um[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Um)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Um=[new km,new km,new km,new km,new km,new km,new km,new km],Fm=new km,zm=new Nm,Hm=new km,Wm=new km,Vm=new km,Gm=new km,jm=new km,Xm=new km,$m=new km,Ym=new km,qm=new km,Zm=new km;function Jm(e,t,n,r,i){for(let o=0,s=e.length-3;o<=s;o+=3){Zm.fromArray(e,o);const s=i.x*Math.abs(Zm.x)+i.y*Math.abs(Zm.y)+i.z*Math.abs(Zm.z),a=t.dot(Zm),l=n.dot(Zm),c=r.dot(Zm);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Km=new Nm,Qm=new km,eg=new km;class tg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Km.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Qm.subVectors(e,this.center);const t=Qm.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Qm,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(eg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Qm.copy(e.center).add(eg)),this.expandByPoint(Qm.copy(e.center).sub(eg))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ng=new km,rg=new km,ig=new km,og=new km,sg=new km,ag=new km,lg=new km;class cg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km(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.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ng)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ng.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ng.copy(this.origin).addScaledVector(this.direction,t),ng.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){rg.copy(e).add(t).multiplyScalar(.5),ig.copy(t).sub(e).normalize(),og.copy(this.origin).sub(rg);const i=.5*e.distanceTo(t),o=-this.direction.dot(ig),s=og.dot(this.direction),a=-og.dot(ig),l=og.lengthSq(),c=Math.abs(1-o*o);let u,h,d,p;if(c>0)if(u=o*a-s,h=o*s-a,p=i*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h=-i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h<=-p?(u=Math.max(0,-(-o*i+s)),h=u>0?-i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l):h<=p?(u=0,h=Math.min(Math.max(-i,-a),i),d=h*(h+2*a)+l):(u=Math.max(0,-(o*i+s)),h=u>0?i:Math.min(Math.max(-i,-a),i),d=-u*u+h*(h+2*a)+l);else h=o>0?-i:i,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(rg).addScaledVector(ig,h),d}intersectSphere(e,t){ng.subVectors(e.center,this.origin);const n=ng.dot(this.direction),r=ng.dot(ng)-n*n,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),s=n-o,a=n+o;return a<0?null:s<0?this.at(a,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),n>o||i>r?null:((i>n||isNaN(n))&&(n=i),(o<r||isNaN(r))&&(r=o),u>=0?(s=(e.min.z-h.z)*u,a=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,a=(e.min.z-h.z)*u),n>a||s>r?null:((s>n||n!=n)&&(n=s),(a<r||r!=r)&&(r=a),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,ng)}intersectTriangle(e,t,n,r,i){sg.subVectors(t,e),ag.subVectors(n,e),lg.crossVectors(sg,ag);let o,s=this.direction.dot(lg);if(s>0){if(r)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}og.subVectors(this.origin,e);const a=o*this.direction.dot(ag.crossVectors(og,ag));if(a<0)return null;const l=o*this.direction.dot(sg.cross(og));if(l<0)return null;if(a+l>s)return null;const c=-o*og.dot(lg);return c<0?null:this.at(c/s,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class ug{constructor(e,t,n,r,i,o,s,a,l,c,u,h,d,p,f,m){ug.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,o,s,a,l,c,u,h,d,p,f,m)}set(e,t,n,r,i,o,s,a,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ug).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/hg.setFromMatrixColumn(e,0).length(),i=1/hg.setFromMatrixColumn(e,1).length(),o=1/hg.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*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){const t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=o*c,n=o*u,r=s*c,i=s*u;t[0]=a*c,t[4]=-a*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-s*a,t[2]=i-e*l,t[6]=r+n*l,t[10]=o*a}else if("YXZ"===e.order){const e=a*c,n=a*u,r=l*c,i=l*u;t[0]=e+i*s,t[4]=r*s-n,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-s,t[2]=n*s-r,t[6]=i+e*s,t[10]=o*a}else if("ZXY"===e.order){const e=a*c,n=a*u,r=l*c,i=l*u;t[0]=e-i*s,t[4]=-o*u,t[8]=r+n*s,t[1]=n+r*s,t[5]=o*c,t[9]=i-e*s,t[2]=-o*l,t[6]=s,t[10]=o*a}else if("ZYX"===e.order){const e=o*c,n=o*u,r=s*c,i=s*u;t[0]=a*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=a*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=s*a,t[10]=o*a}else if("YZX"===e.order){const e=o*a,n=o*l,r=s*a,i=s*l;t[0]=a*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=o*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=o*a,n=o*l,r=s*a,i=s*l;t[0]=a*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=o*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=s*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(pg,e,fg)}lookAt(e,t,n){const r=this.elements;return vg.subVectors(e,t),0===vg.lengthSq()&&(vg.z=1),vg.normalize(),mg.crossVectors(n,vg),0===mg.lengthSq()&&(1===Math.abs(n.z)?vg.x+=1e-4:vg.z+=1e-4,vg.normalize(),mg.crossVectors(n,vg)),mg.normalize(),gg.crossVectors(vg,mg),r[0]=mg.x,r[4]=gg.x,r[8]=vg.x,r[1]=mg.y,r[5]=gg.y,r[9]=vg.y,r[2]=mg.z,r[6]=gg.z,r[10]=vg.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],s=n[4],a=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],b=r[0],S=r[4],w=r[8],C=r[12],M=r[1],T=r[5],A=r[9],E=r[13],R=r[2],L=r[6],P=r[10],I=r[14],O=r[3],k=r[7],B=r[11],D=r[15];return i[0]=o*b+s*M+a*R+l*O,i[4]=o*S+s*T+a*L+l*k,i[8]=o*w+s*A+a*P+l*B,i[12]=o*C+s*E+a*I+l*D,i[1]=c*b+u*M+h*R+d*O,i[5]=c*S+u*T+h*L+d*k,i[9]=c*w+u*A+h*P+d*B,i[13]=c*C+u*E+h*I+d*D,i[2]=p*b+f*M+m*R+g*O,i[6]=p*S+f*T+m*L+g*k,i[10]=p*w+f*A+m*P+g*B,i[14]=p*C+f*E+m*I+g*D,i[3]=v*b+y*M+_*R+x*O,i[7]=v*S+y*T+_*L+x*k,i[11]=v*w+y*A+_*P+x*B,i[15]=v*C+y*E+_*I+x*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],s=e[5],a=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*a*u-r*l*u-i*s*h+n*l*h+r*s*d-n*a*d)+e[7]*(+t*a*d-t*l*h+i*o*h-r*o*d+r*l*c-i*a*c)+e[11]*(+t*l*u-t*s*d-i*o*u+n*o*d+i*s*c-n*l*c)+e[15]*(-r*s*c-t*a*u+t*s*h+r*o*u-n*o*h+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=u*m*l-f*h*l+f*a*d-s*m*d-u*a*g+s*h*g,y=p*h*l-c*m*l-p*a*d+o*m*d+c*a*g-o*h*g,_=c*f*l-p*u*l+p*s*d-o*f*d-c*s*g+o*u*g,x=p*u*a-c*f*a-p*s*h+o*f*h+c*s*m-o*u*m,b=t*v+n*y+r*_+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/b;return e[0]=v*S,e[1]=(f*h*i-u*m*i-f*r*d+n*m*d+u*r*g-n*h*g)*S,e[2]=(s*m*i-f*a*i+f*r*l-n*m*l-s*r*g+n*a*g)*S,e[3]=(u*a*i-s*h*i-u*r*l+n*h*l+s*r*d-n*a*d)*S,e[4]=y*S,e[5]=(c*m*i-p*h*i+p*r*d-t*m*d-c*r*g+t*h*g)*S,e[6]=(p*a*i-o*m*i-p*r*l+t*m*l+o*r*g-t*a*g)*S,e[7]=(o*h*i-c*a*i+c*r*l-t*h*l-o*r*d+t*a*d)*S,e[8]=_*S,e[9]=(p*u*i-c*f*i-p*n*d+t*f*d+c*n*g-t*u*g)*S,e[10]=(o*f*i-p*s*i+p*n*l-t*f*l-o*n*g+t*s*g)*S,e[11]=(c*s*i-o*u*i-c*n*l+t*u*l+o*n*d-t*s*d)*S,e[12]=x*S,e[13]=(c*f*r-p*u*r+p*n*h-t*f*h-c*n*m+t*u*m)*S,e[14]=(p*s*r-o*f*r-p*n*a+t*f*a+o*n*m-t*s*m)*S,e[15]=(o*u*r-c*s*r+c*n*a-t*u*a-o*n*h+t*s*h)*S,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,s=e.y,a=e.z,l=i*o,c=i*s;return this.set(l*o+n,l*s-r*a,l*a+r*s,0,l*s+r*a,c*s+n,c*a-r*o,0,l*a-r*s,c*a+r*o,i*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,o){return this.set(1,n,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,o=t._y,s=t._z,a=t._w,l=i+i,c=o+o,u=s+s,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,g=s*u,v=a*l,y=a*c,_=a*u,x=n.x,b=n.y,S=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+_)*x,r[2]=(p-y)*x,r[3]=0,r[4]=(d-_)*b,r[5]=(1-(h+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(p+y)*S,r[9]=(m-v)*S,r[10]=(1-(h+f))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=hg.set(r[0],r[1],r[2]).length();const o=hg.set(r[4],r[5],r[6]).length(),s=hg.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],dg.copy(this);const a=1/i,l=1/o,c=1/s;return dg.elements[0]*=a,dg.elements[1]*=a,dg.elements[2]*=a,dg.elements[4]*=l,dg.elements[5]*=l,dg.elements[6]*=l,dg.elements[8]*=c,dg.elements[9]*=c,dg.elements[10]*=c,t.setFromRotationMatrix(dg),n.x=i,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Wf;const a=this.elements,l=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),h=(n+r)/(n-r);let d,p;if(s===Wf)d=-(o+i)/(o-i),p=-2*o*i/(o-i);else{if(s!==Vf)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-o/(o-i),p=-o*i/(o-i)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Wf;const a=this.elements,l=1/(t-e),c=1/(n-r),u=1/(o-i),h=(t+e)*l,d=(n+r)*c;let p,f;if(s===Wf)p=(o+i)*u,f=-2*u;else{if(s!==Vf)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=i*u,f=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const hg=new km,dg=new ug,pg=new km(0,0,0),fg=new km(1,1,1),mg=new km,gg=new km,vg=new km,yg=new ug,_g=new Om;class xg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xg.DEFAULT_ORDER;this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e.elements,i=r[0],o=r[4],s=r[8],a=r[1],l=r[5],c=r[9],u=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(Zf(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Zf(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(Zf(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-Zf(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Zf(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Zf(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return yg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yg,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return _g.setFromEuler(this),this.setFromQuaternion(_g,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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}}xg.DEFAULT_ORDER="XYZ";class bg{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let Sg=0;const wg=new km,Cg=new Om,Mg=new ug,Tg=new km,Ag=new km,Eg=new km,Rg=new Om,Lg=new km(1,0,0),Pg=new km(0,1,0),Ig=new km(0,0,1),Og={type:"added"},kg={type:"removed"};class Bg extends Gf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Sg++}),this.uuid=qf(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Bg.DEFAULT_UP.clone();const e=new km,t=new xg,n=new Om,r=new km(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ug},normalMatrix:{value:new om}}),this.matrix=new ug,this.matrixWorld=new ug,this.matrixAutoUpdate=Bg.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Bg.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bg,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Cg.setFromAxisAngle(e,t),this.quaternion.multiply(Cg),this}rotateOnWorldAxis(e,t){return Cg.setFromAxisAngle(e,t),this.quaternion.premultiply(Cg),this}rotateX(e){return this.rotateOnAxis(Lg,e)}rotateY(e){return this.rotateOnAxis(Pg,e)}rotateZ(e){return this.rotateOnAxis(Ig,e)}translateOnAxis(e,t){return wg.copy(e).applyQuaternion(this.quaternion),this.position.add(wg.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Lg,e)}translateY(e){return this.translateOnAxis(Pg,e)}translateZ(e){return this.translateOnAxis(Ig,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Mg.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Tg.copy(e):Tg.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Ag.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Mg.lookAt(Ag,Tg,this.up):Mg.lookAt(Tg,Ag,this.up),this.quaternion.setFromRotationMatrix(Mg),r&&(Mg.extractRotation(r.matrixWorld),Cg.setFromRotationMatrix(Mg),this.quaternion.premultiply(Cg.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Og)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(kg)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Mg.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Mg.multiply(e.parent.matrixWorld)),e.applyMatrix4(Mg),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&n.push(this);const r=this.children;for(let i=0,o=r.length;i<o;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ag,e,Eg),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ag,Rg,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){const r=t[n];!0!==r.matrixWorldAutoUpdate&&!0!==e||r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){const n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=o(e.geometries),r=o(e.materials),i=o(e.textures),s=o(e.images),a=o(e.shapes),l=o(e.skeletons),c=o(e.animations),u=o(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=r,n;function o(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Bg.DEFAULT_UP=new km(0,1,0),Bg.DEFAULT_MATRIX_AUTO_UPDATE=!0,Bg.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Dg=new km,Ng=new km,Ug=new km,Fg=new km,zg=new km,Hg=new km,Wg=new km,Vg=new km,Gg=new km,jg=new km;let Xg=!1;class $g{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new km;this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Dg.subVectors(e,t),r.cross(Dg);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Dg.subVectors(r,t),Ng.subVectors(n,t),Ug.subVectors(e,t);const o=Dg.dot(Dg),s=Dg.dot(Ng),a=Dg.dot(Ug),l=Ng.dot(Ng),c=Ng.dot(Ug),u=o*l-s*s;if(0===u)return i.set(-2,-1,-1);const h=1/u,d=(l*a-s*c)*h,p=(o*c-s*a)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Fg),Fg.x>=0&&Fg.y>=0&&Fg.x+Fg.y<=1}static getUV(e,t,n,r,i,o,s,a){return!1===Xg&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xg=!0),this.getInterpolation(e,t,n,r,i,o,s,a)}static getInterpolation(e,t,n,r,i,o,s,a){return this.getBarycoord(e,t,n,r,Fg),a.setScalar(0),a.addScaledVector(i,Fg.x),a.addScaledVector(o,Fg.y),a.addScaledVector(s,Fg.z),a}static isFrontFacing(e,t,n,r){return Dg.subVectors(n,t),Ng.subVectors(e,t),Dg.cross(Ng).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Dg.subVectors(this.c,this.b),Ng.subVectors(this.a,this.b),.5*Dg.cross(Ng).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return $g.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return $g.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return!1===Xg&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xg=!0),$g.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}getInterpolation(e,t,n,r,i){return $g.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return $g.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return $g.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let o,s;zg.subVectors(r,n),Hg.subVectors(i,n),Vg.subVectors(e,n);const a=zg.dot(Vg),l=Hg.dot(Vg);if(a<=0&&l<=0)return t.copy(n);Gg.subVectors(e,r);const c=zg.dot(Gg),u=Hg.dot(Gg);if(c>=0&&u<=c)return t.copy(r);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),t.copy(n).addScaledVector(zg,o);jg.subVectors(e,i);const d=zg.dot(jg),p=Hg.dot(jg);if(p>=0&&d<=p)return t.copy(i);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(n).addScaledVector(Hg,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return Wg.subVectors(i,r),s=(u-c)/(u-c+(d-p)),t.copy(r).addScaledVector(Wg,s);const g=1/(m+f+h);return o=f*g,s=h*g,t.copy(n).addScaledVector(zg,o).addScaledVector(Hg,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Yg={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},qg={h:0,s:0,l:0},Zg={h:0,s:0,l:0};function Jg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class Kg{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lf;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ym.toWorkingColorSpace(this,t),this}setRGB(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ym.workingColorSpace;return this.r=e,this.g=t,this.b=n,ym.toWorkingColorSpace(this,r),this}setHSL(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ym.workingColorSpace;if(e=Jf(e,1),t=Zf(t,0,1),n=Zf(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Jg(i,r,e+1/3),this.g=Jg(i,r,e),this.b=Jg(i,r,e-1/3)}return ym.toWorkingColorSpace(this,r),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lf;function r(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const o=t[1],s=t[2];switch(o){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=t[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(6===i)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lf;const n=Yg[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=_m(e.r),this.g=_m(e.g),this.b=_m(e.b),this}copyLinearToSRGB(e){return this.r=xm(e.r),this.g=xm(e.g),this.b=xm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lf;return ym.fromWorkingColorSpace(Qg.copy(this),e),65536*Math.round(Zf(255*Qg.r,0,255))+256*Math.round(Zf(255*Qg.g,0,255))+Math.round(Zf(255*Qg.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lf;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ym.workingColorSpace;ym.fromWorkingColorSpace(Qg.copy(this),t);const n=Qg.r,r=Qg.g,i=Qg.b,o=Math.max(n,r,i),s=Math.min(n,r,i);let a,l;const c=(s+o)/2;if(s===o)a=0,l=0;else{const e=o-s;switch(l=c<=.5?e/(o+s):e/(2-o-s),o){case n:a=(r-i)/e+(r<i?6:0);break;case r:a=(i-n)/e+2;break;case i:a=(n-r)/e+4}a/=6}return e.h=a,e.s=l,e.l=c,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ym.workingColorSpace;return ym.fromWorkingColorSpace(Qg.copy(this),t),e.r=Qg.r,e.g=Qg.g,e.b=Qg.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lf;ym.fromWorkingColorSpace(Qg.copy(this),e);const t=Qg.r,n=Qg.g,r=Qg.b;return e!==Lf?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(qg),this.setHSL(qg.h+e,qg.s+t,qg.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(qg),e.getHSL(Zg);const n=Kf(qg.h,Zg.h,t),r=Kf(qg.s,Zg.s,t),i=Kf(qg.l,Zg.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Qg=new Kg;Kg.NAMES=Yg;let ev=0;class tv extends Gf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ev++}),this.uuid=qf(),this.name="",this.type="Material",this.blending=1,this.side=qd,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Kd,this.blendDst=Qd,this.blendEquation=Jd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Kg(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Uf,this.stencilZFail=Uf,this.stencilZPass=Uf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==qd&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==Kd&&(n.blendSrc=this.blendSrc),this.blendDst!==Qd&&(n.blendDst=this.blendDst),this.blendEquation!==Jd&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Uf&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Uf&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Uf&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class nv extends tv{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Kg(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=ep,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}}const rv=iv();function iv(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,o[e]=t|n}for(let e=1024;e<2048;++e)o[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(a[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:s,offsetTable:a}}function ov(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=Zf(e,-65504,65504),rv.floatView[0]=e;const t=rv.uint32View[0],n=t>>23&511;return rv.baseTable[n]+((8388607&t)>>rv.shiftTable[n])}function sv(e){const t=e>>10;return rv.uint32View[0]=rv.mantissaTable[rv.offsetTable[t]+(1023&e)]+rv.exponentTable[t],rv.floatView[0]}const av={toHalfFloat:ov,fromHalfFloat:sv},lv=new km,cv=new im;class uv{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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=n,this.usage=Ff,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Lp,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)cv.fromBufferAttribute(this,t),cv.applyMatrix3(e),this.setXY(t,cv.x,cv.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)lv.fromBufferAttribute(this,t),lv.applyMatrix3(e),this.setXYZ(t,lv.x,lv.y,lv.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)lv.fromBufferAttribute(this,t),lv.applyMatrix4(e),this.setXYZ(t,lv.x,lv.y,lv.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)lv.fromBufferAttribute(this,t),lv.applyNormalMatrix(e),this.setXYZ(t,lv.x,lv.y,lv.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)lv.fromBufferAttribute(this,t),lv.transformDirection(e),this.setXYZ(t,lv.x,lv.y,lv.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=tm(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=nm(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=tm(t,this.array)),t}setX(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=tm(t,this.array)),t}setY(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=tm(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=tm(t,this.array)),t}setW(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array),i=nm(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Ff&&(e.usage=this.usage),e}}class hv extends uv{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class dv extends uv{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class pv extends uv{constructor(e,t,n){super(new Float32Array(e),t,n)}}let fv=0;const mv=new ug,gv=new Bg,vv=new km,yv=new Nm,_v=new Nm,xv=new km;class bv extends Gf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:fv++}),this.uuid=qf(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(am(e)?dv:hv)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new om).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return mv.makeRotationFromQuaternion(e),this.applyMatrix4(mv),this}rotateX(e){return mv.makeRotationX(e),this.applyMatrix4(mv),this}rotateY(e){return mv.makeRotationY(e),this.applyMatrix4(mv),this}rotateZ(e){return mv.makeRotationZ(e),this.applyMatrix4(mv),this}translate(e,t,n){return mv.makeTranslation(e,t,n),this.applyMatrix4(mv),this}scale(e,t,n){return mv.makeScale(e,t,n),this.applyMatrix4(mv),this}lookAt(e){return gv.lookAt(e),gv.updateMatrix(),this.applyMatrix4(gv.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vv).negate(),this.translate(vv.x,vv.y,vv.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new pv(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Nm);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new km(-1/0,-1/0,-1/0),new km(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];yv.setFromBufferAttribute(n),this.morphTargetsRelative?(xv.addVectors(this.boundingBox.min,yv.min),this.boundingBox.expandByPoint(xv),xv.addVectors(this.boundingBox.max,yv.max),this.boundingBox.expandByPoint(xv)):(this.boundingBox.expandByPoint(yv.min),this.boundingBox.expandByPoint(yv.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new tg);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new km,1/0);if(e){const n=this.boundingSphere.center;if(yv.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];_v.setFromBufferAttribute(n),this.morphTargetsRelative?(xv.addVectors(yv.min,_v.min),yv.expandByPoint(xv),xv.addVectors(yv.max,_v.max),yv.expandByPoint(xv)):(yv.expandByPoint(_v.min),yv.expandByPoint(_v.max))}yv.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)xv.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(xv));if(t)for(let i=0,o=t.length;i<o;i++){const o=t[i],s=this.morphTargetsRelative;for(let t=0,i=o.count;t<i;t++)xv.fromBufferAttribute(o,t),s&&(vv.fromBufferAttribute(e,t),xv.add(vv)),r=Math.max(r,n.distanceToSquared(xv))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,o=t.uv.array,s=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new uv(new Float32Array(4*s),4));const a=this.getAttribute("tangent").array,l=[],c=[];for(let e=0;e<s;e++)l[e]=new km,c[e]=new km;const u=new km,h=new km,d=new km,p=new im,f=new im,m=new im,g=new km,v=new km;function y(e,t,n){u.fromArray(r,3*e),h.fromArray(r,3*t),d.fromArray(r,3*n),p.fromArray(o,2*e),f.fromArray(o,2*t),m.fromArray(o,2*n),h.sub(u),d.sub(u),f.sub(p),m.sub(p);const i=1/(f.x*m.y-m.x*f.y);isFinite(i)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(i),v.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(i),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(v),c[t].add(v),c[n].add(v))}let _=this.groups;0===_.length&&(_=[{start:0,count:n.length}]);for(let e=0,t=_.length;e<t;++e){const t=_[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)y(n[e+0],n[e+1],n[e+2])}const x=new km,b=new km,S=new km,w=new km;function C(e){S.fromArray(i,3*e),w.copy(S);const t=l[e];x.copy(t),x.sub(S.multiplyScalar(S.dot(t))).normalize(),b.crossVectors(w,t);const n=b.dot(c[e])<0?-1:1;a[4*e]=x.x,a[4*e+1]=x.y,a[4*e+2]=x.z,a[4*e+3]=n}for(let e=0,t=_.length;e<t;++e){const t=_[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)C(n[e+0]),C(n[e+1]),C(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new uv(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new km,i=new km,o=new km,s=new km,a=new km,l=new km,c=new km,u=new km;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),o.fromBufferAttribute(t,f),c.subVectors(o,i),u.subVectors(r,i),c.cross(u),s.fromBufferAttribute(n,d),a.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),a.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),o.fromBufferAttribute(t,e+2),c.subVectors(o,i),u.subVectors(r,i),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)xv.fromBufferAttribute(e,t),xv.normalize(),e.setXYZ(t,xv.x,xv.y,xv.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,o=new n.constructor(t.length*r);let s=0,a=0;for(let i=0,l=t.length;i<l;i++){s=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)o[a++]=n[s++]}return new uv(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new bv,n=this.index.array,r=this.attributes;for(const i in r){const o=e(r[i],n);t.setAttribute(i,o)}const i=this.morphAttributes;for(const r in i){const o=[],s=i[r];for(let t=0,r=s.length;t<r;t++){const r=e(s[t],n);o.push(r)}t.morphAttributes[r]=o}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,n=o.length;e<n;e++){const n=o[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],o=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];o.push(r.toJSON(e.data))}o.length>0&&(r[t]=o,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let e=0,t=o.length;e<t;e++){const t=o[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Sv=new ug,wv=new cg,Cv=new tg,Mv=new km,Tv=new km,Av=new km,Ev=new km,Rv=new km,Lv=new km,Pv=new im,Iv=new im,Ov=new im,kv=new km,Bv=new km,Dv=new km,Nv=new km,Uv=new km;class Fv extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bv,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nv;super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const s=this.morphTargetInfluences;if(i&&s){Lv.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=s[n],a=i[n];0!==r&&(Rv.fromBufferAttribute(a,e),o?Lv.addScaledVector(Rv,r):Lv.addScaledVector(Rv.sub(t),r))}t.add(Lv)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),Cv.copy(n.boundingSphere),Cv.applyMatrix4(i),wv.copy(e.ray).recast(e.near),!1===Cv.containsPoint(wv.origin)){if(null===wv.intersectSphere(Cv,Mv))return;if(wv.origin.distanceToSquared(Mv)>(e.far-e.near)**2)return}Sv.copy(i).invert(),wv.copy(e.ray).applyMatrix4(Sv),null!==n.boundingBox&&!1===wv.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,wv)}}_computeIntersections(e,t,n){let r;const i=this.geometry,o=this.material,s=i.index,a=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==s)if(Array.isArray(o))for(let i=0,a=h.length;i<a;i++){const a=h[i],p=o[a.materialIndex];for(let i=Math.max(a.start,d.start),o=Math.min(s.count,Math.min(a.start+a.count,d.start+d.count));i<o;i+=3){r=zv(this,p,e,n,l,c,u,s.getX(i),s.getX(i+1),s.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=a.materialIndex,t.push(r))}}else{for(let i=Math.max(0,d.start),a=Math.min(s.count,d.start+d.count);i<a;i+=3){r=zv(this,o,e,n,l,c,u,s.getX(i),s.getX(i+1),s.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}else if(void 0!==a)if(Array.isArray(o))for(let i=0,s=h.length;i<s;i++){const s=h[i],p=o[s.materialIndex];for(let i=Math.max(s.start,d.start),o=Math.min(a.count,Math.min(s.start+s.count,d.start+d.count));i<o;i+=3){r=zv(this,p,e,n,l,c,u,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{for(let i=Math.max(0,d.start),s=Math.min(a.count,d.start+d.count);i<s;i+=3){r=zv(this,o,e,n,l,c,u,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}}}function zv(e,t,n,r,i,o,s,a,l,c){e.getVertexPosition(a,Tv),e.getVertexPosition(l,Av),e.getVertexPosition(c,Ev);const u=function(e,t,n,r,i,o,s,a){let l;if(l=t.side===Zd?r.intersectTriangle(s,o,i,!0,a):r.intersectTriangle(i,o,s,t.side===qd,a),null===l)return null;Uv.copy(a),Uv.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(Uv);return c<n.near||c>n.far?null:{distance:c,point:Uv.clone(),object:e}}(e,t,n,r,Tv,Av,Ev,Nv);if(u){i&&(Pv.fromBufferAttribute(i,a),Iv.fromBufferAttribute(i,l),Ov.fromBufferAttribute(i,c),u.uv=$g.getInterpolation(Nv,Tv,Av,Ev,Pv,Iv,Ov,new im)),o&&(Pv.fromBufferAttribute(o,a),Iv.fromBufferAttribute(o,l),Ov.fromBufferAttribute(o,c),u.uv1=$g.getInterpolation(Nv,Tv,Av,Ev,Pv,Iv,Ov,new im),u.uv2=u.uv1),s&&(kv.fromBufferAttribute(s,a),Bv.fromBufferAttribute(s,l),Dv.fromBufferAttribute(s,c),u.normal=$g.getInterpolation(Nv,Tv,Av,Ev,kv,Bv,Dv,new km),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const e={a:a,b:l,c:c,normal:new km,materialIndex:0};$g.getNormal(Tv,Av,Ev,e.normal),u.face=e}return u}class Hv extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const s=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const a=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,n,r,i,o,p,f,m,g,v){const y=o/m,_=p/g,x=o/2,b=p/2,S=f/2,w=m+1,C=g+1;let M=0,T=0;const A=new km;for(let o=0;o<C;o++){const s=o*_-b;for(let a=0;a<w;a++){const h=a*y-x;A[e]=h*r,A[t]=s*i,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=f>0?1:-1,c.push(A.x,A.y,A.z),u.push(a/m),u.push(1-o/g),M+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=h+t+w*e,r=h+t+w*(e+1),i=h+(t+1)+w*(e+1),o=h+(t+1)+w*e;a.push(n,r,o),a.push(r,i,o),T+=6}s.addGroup(d,T,v),d+=T,h+=M}p("z","y","x",-1,-1,n,t,e,o,i,0),p("z","y","x",1,-1,n,t,-e,o,i,1),p("x","z","y",1,1,e,n,t,r,o,2),p("x","z","y",1,-1,e,n,-t,r,o,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(a),this.setAttribute("position",new pv(l,3)),this.setAttribute("normal",new pv(c,3)),this.setAttribute("uv",new pv(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hv(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Wv(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Vv(e){const t={};for(let n=0;n<e.length;n++){const r=Wv(e[n]);for(const e in r)t[e]=r[e]}return t}function Gv(e){return null===e.getRenderTarget()?e.outputColorSpace:ym.workingColorSpace}const jv={clone:Wv,merge:Vv};class Xv extends tv{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Wv(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class $v extends Bg{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ug,this.projectionMatrix=new ug,this.projectionMatrixInverse=new ug,this.coordinateSystem=Wf}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Yv extends $v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Yf*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*$f*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Yf*Math.atan(Math.tan(.5*$f*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*$f*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/e,t-=o.offsetY*n/s,r*=o.width/e,n*=o.height/s}const s=this.filmOffset;0!==s&&(i+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),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}}const qv=-90;class Zv extends Bg{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Yv(qv,1,e,t);r.layers=this.layers,this.add(r);const i=new Yv(qv,1,e,t);i.layers=this.layers,this.add(i);const o=new Yv(qv,1,e,t);o.layers=this.layers,this.add(o);const s=new Yv(qv,1,e,t);s.layers=this.layers,this.add(s);const a=new Yv(qv,1,e,t);a.layers=this.layers,this.add(a);const l=new Yv(qv,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,i,o,s,a]=t;for(const e of t)this.remove(e);if(e===Wf)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(e!==Vf)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,o,s,a,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,o),e.setRenderTarget(n,2,r),e.render(t,s),e.setRenderTarget(n,3,r),e.render(t,a),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,r),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class Jv extends Am{constructor(e,t,n,r,i,o,s,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:dp,n,r,i,o,s,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Kv extends Lm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];void 0!==t.encoding&&(pm("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Ef?Lf:Rf),this.texture=new Jv(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:wp}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Hv(5,5,5),i=new Xv({name:"CubemapFromEquirect",uniforms:Wv(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Zd,blending:0});i.uniforms.tEquirect.value=t;const o=new Fv(r,i),s=t.minFilter;t.minFilter===Mp&&(t.minFilter=wp);return new Zv(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}const Qv=new km,ey=new km,ty=new om;class ny{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km(1,0,0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Qv.subVectors(n,t).cross(ey.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Qv),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||ty.getNormalMatrix(e),r=this.coplanarPoint(Qv).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const ry=new tg,iy=new km;class oy{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ny,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ny,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ny,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ny,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new ny,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new ny;this.planes=[e,t,n,r,i,o]}set(e,t,n,r,i,o){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(r),s[4].copy(i),s[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wf;const n=this.planes,r=e.elements,i=r[0],o=r[1],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],_=r[15];if(n[0].setComponents(a-i,h-l,m-d,_-g).normalize(),n[1].setComponents(a+i,h+l,m+d,_+g).normalize(),n[2].setComponents(a+o,h+c,m+p,_+v).normalize(),n[3].setComponents(a-o,h-c,m-p,_-v).normalize(),n[4].setComponents(a-s,h-u,m-f,_-y).normalize(),t===Wf)n[5].setComponents(a+s,h+u,m+f,_+y).normalize();else{if(t!==Vf)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(s,u,f,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),ry.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),ry.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ry)}intersectsSprite(e){return ry.center.set(0,0,0),ry.radius=.7071067811865476,ry.applyMatrix4(e.matrixWorld),this.intersectsSphere(ry)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(iy.x=r.normal.x>0?e.max.x:e.min.x,iy.y=r.normal.y>0?e.max.y:e.min.y,iy.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(iy)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function sy(){let e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ay(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const o=r.get(t);if(void 0===o)r.set(t,function(t,r){const i=t.array,o=t.usage,s=i.byteLength,a=e.createBuffer();let l;if(e.bindBuffer(r,a),e.bufferData(r,i,o),t.onUploadCallback(),i instanceof Float32Array)l=e.FLOAT;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");l=e.HALF_FLOAT}else l=e.UNSIGNED_SHORT;else if(i instanceof Int16Array)l=e.SHORT;else if(i instanceof Uint32Array)l=e.UNSIGNED_INT;else if(i instanceof Int32Array)l=e.INT;else if(i instanceof Int8Array)l=e.BYTE;else if(i instanceof Uint8Array)l=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);l=e.UNSIGNED_BYTE}return{buffer:a,type:l,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:s}}(t,i));else if(o.version<t.version){if(o.size!==t.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,r,i){const o=r.array,s=r._updateRange,a=r.updateRanges;if(e.bindBuffer(i,t),-1===s.count&&0===a.length&&e.bufferSubData(i,0,o),0!==a.length){for(let t=0,r=a.length;t<r;t++){const r=a[t];n?e.bufferSubData(i,r.start*o.BYTES_PER_ELEMENT,o,r.start,r.count):e.bufferSubData(i,r.start*o.BYTES_PER_ELEMENT,o.subarray(r.start,r.start+r.count))}r.clearUpdateRanges()}-1!==s.count&&(n?e.bufferSubData(i,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):e.bufferSubData(i,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1),r.onUploadCallback()}(o.buffer,t,i),o.version=t.version}}}}class ly extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,o=t/2,s=Math.floor(n),a=Math.floor(r),l=s+1,c=a+1,u=e/s,h=t/a,d=[],p=[],f=[],m=[];for(let e=0;e<c;e++){const t=e*h-o;for(let n=0;n<l;n++){const r=n*u-i;p.push(r,-t,0),f.push(0,0,1),m.push(n/s),m.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<s;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),o=t+1+l*e;d.push(n,r,o),d.push(r,i,o)}this.setIndex(d),this.setAttribute("position",new pv(p,3)),this.setAttribute("normal",new pv(f,3)),this.setAttribute("uv",new pv(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ly(e.width,e.height,e.widthSegments,e.heightSegments)}}const cy={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float 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} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn 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 T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + 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 = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( 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}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef 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#ifdef 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 ( LEGACY_LIGHTS )\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#else\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#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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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 USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).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_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\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, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\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\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = 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, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\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_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},uy={common:{diffuse:{value:new Kg(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new om},alphaMap:{value:null},alphaMapTransform:{value:new om},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new om}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new om}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new om}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new om},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new om},normalScale:{value:new im(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new om},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new om}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new om}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new om}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Kg(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 Kg(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new om},alphaTest:{value:0},uvTransform:{value:new om}},sprite:{diffuse:{value:new Kg(16777215)},opacity:{value:1},center:{value:new im(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new om},alphaMap:{value:null},alphaMapTransform:{value:new om},alphaTest:{value:0}}},hy={basic:{uniforms:Vv([uy.common,uy.specularmap,uy.envmap,uy.aomap,uy.lightmap,uy.fog]),vertexShader:cy.meshbasic_vert,fragmentShader:cy.meshbasic_frag},lambert:{uniforms:Vv([uy.common,uy.specularmap,uy.envmap,uy.aomap,uy.lightmap,uy.emissivemap,uy.bumpmap,uy.normalmap,uy.displacementmap,uy.fog,uy.lights,{emissive:{value:new Kg(0)}}]),vertexShader:cy.meshlambert_vert,fragmentShader:cy.meshlambert_frag},phong:{uniforms:Vv([uy.common,uy.specularmap,uy.envmap,uy.aomap,uy.lightmap,uy.emissivemap,uy.bumpmap,uy.normalmap,uy.displacementmap,uy.fog,uy.lights,{emissive:{value:new Kg(0)},specular:{value:new Kg(1118481)},shininess:{value:30}}]),vertexShader:cy.meshphong_vert,fragmentShader:cy.meshphong_frag},standard:{uniforms:Vv([uy.common,uy.envmap,uy.aomap,uy.lightmap,uy.emissivemap,uy.bumpmap,uy.normalmap,uy.displacementmap,uy.roughnessmap,uy.metalnessmap,uy.fog,uy.lights,{emissive:{value:new Kg(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cy.meshphysical_vert,fragmentShader:cy.meshphysical_frag},toon:{uniforms:Vv([uy.common,uy.aomap,uy.lightmap,uy.emissivemap,uy.bumpmap,uy.normalmap,uy.displacementmap,uy.gradientmap,uy.fog,uy.lights,{emissive:{value:new Kg(0)}}]),vertexShader:cy.meshtoon_vert,fragmentShader:cy.meshtoon_frag},matcap:{uniforms:Vv([uy.common,uy.bumpmap,uy.normalmap,uy.displacementmap,uy.fog,{matcap:{value:null}}]),vertexShader:cy.meshmatcap_vert,fragmentShader:cy.meshmatcap_frag},points:{uniforms:Vv([uy.points,uy.fog]),vertexShader:cy.points_vert,fragmentShader:cy.points_frag},dashed:{uniforms:Vv([uy.common,uy.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cy.linedashed_vert,fragmentShader:cy.linedashed_frag},depth:{uniforms:Vv([uy.common,uy.displacementmap]),vertexShader:cy.depth_vert,fragmentShader:cy.depth_frag},normal:{uniforms:Vv([uy.common,uy.bumpmap,uy.normalmap,uy.displacementmap,{opacity:{value:1}}]),vertexShader:cy.meshnormal_vert,fragmentShader:cy.meshnormal_frag},sprite:{uniforms:Vv([uy.sprite,uy.fog]),vertexShader:cy.sprite_vert,fragmentShader:cy.sprite_frag},background:{uniforms:{uvTransform:{value:new om},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:cy.background_vert,fragmentShader:cy.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:cy.backgroundCube_vert,fragmentShader:cy.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cy.cube_vert,fragmentShader:cy.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cy.equirect_vert,fragmentShader:cy.equirect_frag},distanceRGBA:{uniforms:Vv([uy.common,uy.displacementmap,{referencePosition:{value:new km},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cy.distanceRGBA_vert,fragmentShader:cy.distanceRGBA_frag},shadow:{uniforms:Vv([uy.lights,uy.fog,{color:{value:new Kg(0)},opacity:{value:1}}]),vertexShader:cy.shadow_vert,fragmentShader:cy.shadow_frag}};hy.physical={uniforms:Vv([hy.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new om},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new om},clearcoatNormalScale:{value:new im(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new om},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new om},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new om},sheen:{value:0},sheenColor:{value:new Kg(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new om},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new om},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new om},transmissionSamplerSize:{value:new im},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new om},attenuationDistance:{value:0},attenuationColor:{value:new Kg(0)},specularColor:{value:new Kg(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new om},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new om},anisotropyVector:{value:new im},anisotropyMap:{value:null},anisotropyMapTransform:{value:new om}}]),vertexShader:cy.meshphysical_vert,fragmentShader:cy.meshphysical_frag};const dy={r:0,b:0,g:0};function py(e,t,n,r,i,o,s){const a=new Kg(0);let l,c,u=!0===o?0:1,h=null,d=0,p=null;function f(t,n){t.getRGB(dy,Gv(e)),r.buffers.color.setClear(dy.r,dy.g,dy.b,n,s)}return{getClearColor:function(){return a},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;a.set(e),u=t,f(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,f(a,u)},render:function(o,m){let g=!1,v=!0===m.isScene?m.background:null;if(v&&v.isTexture){v=(m.backgroundBlurriness>0?n:t).get(v)}null===v?f(a,u):v&&v.isColor&&(f(v,1),g=!0);const y=e.xr.getEnvironmentBlendMode();"additive"===y?r.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===y&&r.buffers.color.setClear(0,0,0,0,s),(e.autoClear||g)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.mapping===gp)?(void 0===c&&(c=new Fv(new Hv(1,1,1),new Xv({name:"BackgroundCubeMaterial",uniforms:Wv(hy.backgroundCube.uniforms),vertexShader:hy.backgroundCube.vertexShader,fragmentShader:hy.backgroundCube.fragmentShader,side:Zd,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.toneMapped=ym.getTransfer(v.colorSpace)!==Bf,h===v&&d===v.version&&p===e.toneMapping||(c.material.needsUpdate=!0,h=v,d=v.version,p=e.toneMapping),c.layers.enableAll(),o.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new Fv(new ly(2,2),new Xv({name:"BackgroundMaterial",uniforms:Wv(hy.background.uniforms),vertexShader:hy.background.vertexShader,fragmentShader:hy.background.fragmentShader,side:qd,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=v,l.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,l.material.toneMapped=ym.getTransfer(v.colorSpace)!==Bf,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),h===v&&d===v.version&&p===e.toneMapping||(l.material.needsUpdate=!0,h=v,d=v.version,p=e.toneMapping),l.layers.enableAll(),o.unshift(l,l.geometry,l.material,0,0,null))}}}function fy(e,t,n,r){const i=e.getParameter(e.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),s=r.isWebGL2||null!==o,a={},l=p(null);let c=l,u=!1;function h(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function m(e){g(e,0)}function g(n,i){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;if(o[n]=1,0===s[n]&&(e.enableVertexAttribArray(n),s[n]=1),a[n]!==i){(r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),a[n]=i}}function v(){const t=c.newAttributes,n=c.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,r,i,o,s,a){!0===a?e.vertexAttribIPointer(t,n,r,o,s):e.vertexAttribPointer(t,n,r,i,o,s)}function _(){x(),u=!0,c!==l&&(c=l,h(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,d,_,x){let b=!1;if(s){const t=function(t,n,i){const s=!0===i.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let u=c[s];void 0===u&&(u=p(r.isWebGL2?e.createVertexArray():o.createVertexArrayOES()),c[s]=u);return u}(_,d,l);c!==t&&(c=t,h(c.object)),b=function(e,t,n,r){const i=c.attributes,o=t.attributes;let s=0;const a=n.getAttributes();for(const t in a){if(a[t].location>=0){const n=i[t];let r=o[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;s++}}return c.attributesNum!==s||c.index!==r}(i,_,d,x),b&&function(e,t,n,r){const i={},o=t.attributes;let s=0;const a=n.getAttributes();for(const t in a){if(a[t].location>=0){let n=o[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}}c.attributes=i,c.attributesNum=s,c.index=r}(i,_,d,x)}else{const e=!0===l.wireframe;c.geometry===_.id&&c.program===d.id&&c.wireframe===e||(c.geometry=_.id,c.program=d.id,c.wireframe=e,b=!0)}null!==x&&n.update(x,e.ELEMENT_ARRAY_BUFFER),(b||u)&&(u=!1,function(i,o,s,a){if(!1===r.isWebGL2&&(i.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=s.getAttributes(),u=o.defaultAttributeValues;for(const t in c){const o=c[t];if(o.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&i.instanceMatrix&&(s=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(s=i.instanceColor)),void 0!==s){const t=s.normalized,l=s.itemSize,c=n.get(s);if(void 0===c)continue;const u=c.buffer,h=c.type,d=c.bytesPerElement,p=!0===r.isWebGL2&&(h===e.INT||h===e.UNSIGNED_INT||s.gpuType===Ep);if(s.isInterleavedBufferAttribute){const n=s.data,r=n.stride,c=s.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<o.locationSize;e++)g(o.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<o.locationSize;e++)m(o.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<o.locationSize;e++)y(o.location+e,l/o.locationSize,h,t,r*d,(c+l/o.locationSize*e)*d,p)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<o.locationSize;e++)g(o.location+e,s.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<o.locationSize;e++)m(o.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<o.locationSize;e++)y(o.location+e,l/o.locationSize,h,t,l*d,l/o.locationSize*e*d,p)}}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(o.location,n);break;case 3:e.vertexAttrib3fv(o.location,n);break;case 4:e.vertexAttrib4fv(o.location,n);break;default:e.vertexAttrib1fv(o.location,n)}}}}v()}(i,l,d,_),null!==x&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.get(x).buffer))},reset:_,resetDefaultState:x,dispose:function(){_();for(const e in a){const t=a[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const n=a[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function my(e,t,n,r){const i=r.isWebGL2;let o;this.setMode=function(e){o=e},this.render=function(t,r){e.drawArrays(o,t,r),n.update(r,o,1)},this.renderInstances=function(r,s,a){if(0===a)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,r,s,a),n.update(s,o,a)},this.renderMultiDraw=function(e,r,i){if(0===i)return;const s=t.get("WEBGL_multi_draw");if(null===s)for(let t=0;t<i;t++)this.render(e[t],r[t]);else{s.multiDrawArraysWEBGL(o,e,0,r,0,i);let t=0;for(let e=0;e<i;e++)t+=r[e];n.update(t,o,1)}}}function gy(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let s=void 0!==n.precision?n.precision:"highp";const a=i(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,_=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:s,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:y&&_,maxSamples:o?e.getParameter(e.MAX_SAMPLES):0}}function vy(e){const t=this;let n=null,r=0,i=!1,o=!1;const s=new ny,a=new om,l={value:null,needsUpdate:!1};function c(e,n,r,i){const o=null!==e?e.length:0;let c=null;if(0!==o){if(c=l.value,!0!==i||null===c){const t=r+4*o,i=n.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=r;t!==o;++t,n+=4)s.copy(e[t]).applyMatrix4(i,a),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=o,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(s,a,u){const h=s.clippingPlanes,d=s.clipIntersection,p=s.clipShadows,f=e.get(s);if(!i||null===h||0===h.length||o&&!p)o?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=o?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=c(h,a,t,u);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function yy(e){let t=new WeakMap;function n(e,t){return t===fp?e.mapping=dp:t===mp&&(e.mapping=pp),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping;if(o===fp||o===mp){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const o=i.image;if(o&&o.height>0){const s=new Kv(o.height/2);return s.fromEquirectangularTexture(e,i),t.set(i,s),i.addEventListener("dispose",r),n(s.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class _y extends $v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=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=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,o=n+e,s=r+t,a=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,o=i+e*this.view.width,s-=t*this.view.offsetY,a=s-t*this.view.height}this.projectionMatrix.makeOrthographic(i,o,s,a,this.near,this.far,this.coordinateSystem),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}}const xy=[.125,.215,.35,.446,.526,.582],by=20,Sy=new _y,wy=new Kg;let Cy=null,My=0,Ty=0;const Ay=(1+Math.sqrt(5))/2,Ey=1/Ay,Ry=[new km(1,1,1),new km(-1,1,1),new km(1,1,-1),new km(-1,1,-1),new km(0,Ay,Ey),new km(0,Ay,-Ey),new km(Ey,0,Ay),new km(-Ey,0,Ay),new km(Ay,Ey,0),new km(-Ay,Ey,0)];class Ly{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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Cy=this._renderer.getRenderTarget(),My=this._renderer.getActiveCubeFace(),Ty=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ky(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Oy(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Cy,My,Ty),e.scissorTest=!1,Iy(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===dp||e.mapping===pp?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Cy=this._renderer.getRenderTarget(),My=this._renderer.getActiveCubeFace(),Ty=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:wp,minFilter:wp,generateMipmaps:!1,type:Pp,format:Bp,colorSpace:Pf,depthBuffer:!1},r=Py(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Py(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const o=e-4+1+xy.length;for(let s=0;s<o;s++){const o=Math.pow(2,i);n.push(o);let a=1/o;s>e-4?a=xy[s-e+4-1]:0===s&&(a=0),r.push(a);const l=1/(o-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),y=new Float32Array(m*p*d),_=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];v.set(r,f*p*e),y.set(h,m*p*e);const i=[e,e,e,e,e,e];_.set(i,g*p*e)}const x=new bv;x.setAttribute("position",new uv(v,f)),x.setAttribute("uv",new uv(y,m)),x.setAttribute("faceIndex",new uv(_,g)),t.push(x),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(by),i=new km(0,1,0),o=new Xv({name:"SphericalGaussianBlur",defines:{n:by,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:By(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return o}(r,e,t)}return r}_compileMaterial(e){const t=new Fv(this._lodPlanes[0],e);this._renderer.compile(t,Sy)}_sceneToCubeUV(e,t,n,r){const i=new Yv(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(wy),a.toneMapping=rp,a.autoClear=!1;const u=new nv({name:"PMREM.Background",side:Zd,depthWrite:!1,depthTest:!1}),h=new Fv(new Hv,u);let d=!1;const p=e.background;p?p.isColor&&(u.color.copy(p),e.background=null,d=!0):(u.color.copy(wy),d=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,o[t],0),i.lookAt(s[t],0,0)):1===n?(i.up.set(0,0,o[t]),i.lookAt(0,s[t],0)):(i.up.set(0,o[t],0),i.lookAt(0,0,s[t]));const l=this._cubeSize;Iy(r,n*l,t>2?l:0,l,l),a.setRenderTarget(r),d&&a.render(h,i),a.render(e,i)}h.geometry.dispose(),h.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===dp||e.mapping===pp;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ky()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Oy());const i=r?this._cubemapMaterial:this._equirectMaterial,o=new Fv(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const s=this._cubeSize;Iy(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(o,Sy)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=Ry[(t-1)%Ry.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,r,i){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",i),this._halfBlur(o,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Fv(this._lodPlanes[r],l),u=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):by;f>by&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<by;++e){const t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===o,s&&(u.poleAxis.value=s);const{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-n;const y=this._sizeLods[r];Iy(t,3*y*(r>v-4?r-v+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(t),a.render(c,Sy)}}function Py(e,t,n){const r=new Lm(e,t,n);return r.texture.mapping=gp,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Iy(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Oy(){return new Xv({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:By(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ky(){return new Xv({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:By(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function By(){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 Dy(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping,s=o===fp||o===mp,a=o===dp||o===pp;if(s||a){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new Ly(e)),r=s?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const o=i.image;if(s&&o&&o.height>0||a&&o&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(o)){null===n&&(n=new Ly(e));const o=s?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,o),i.addEventListener("dispose",r),o.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Ny(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Uy(e,t,n,r){const i={},o=new WeakMap;function s(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);for(const e in a.morphAttributes){const n=a.morphAttributes[e];for(let e=0,r=n.length;e<r;e++)t.remove(n[e])}a.removeEventListener("dispose",s),delete i[a.id];const l=o.get(a);l&&(t.remove(l),o.delete(a)),r.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(e){const n=[],r=e.index,i=e.attributes.position;let s=0;if(null!==r){const e=r.array;s=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],o=e[t+2];n.push(r,i,i,o,o,r)}}else{if(void 0===i)return;{const e=i.array;s=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}}const a=new(am(n)?dv:hv)(n,1);a.version=s;const l=o.get(e);l&&t.remove(l),o.set(e,a)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",s),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const n in r)t.update(r[n],e.ARRAY_BUFFER);const i=n.morphAttributes;for(const n in i){const r=i[n];for(let n=0,i=r.length;n<i;n++)t.update(r[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=o.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&a(e)}else a(e);return o.get(e)}}}function Fy(e,t,n,r){const i=r.isWebGL2;let o,s,a;this.setMode=function(e){o=e},this.setIndex=function(e){s=e.type,a=e.bytesPerElement},this.render=function(t,r){e.drawElements(o,r,s,t*a),n.update(r,o,1)},this.renderInstances=function(r,l,c){if(0===c)return;let u,h;if(i)u=e,h="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,l,s,r*a,c),n.update(l,o,c)},this.renderMultiDraw=function(e,r,i){if(0===i)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<i;t++)this.render(e[t]/a,r[t]);else{l.multiDrawElementsWEBGL(o,r,0,s,e,0,i);let t=0;for(let e=0;e<i;e++)t+=r[e];n.update(t,o,1)}}}function zy(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function Hy(e,t){return e[0]-t[0]}function Wy(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Vy(e,t,n){const r={},i=new Float32Array(8),o=new WeakMap,s=new Em,a=[];for(let e=0;e<8;e++)a[e]=[e,0];return{update:function(l,c,u){const h=l.morphTargetInfluences;if(!0===t.isWebGL2){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=void 0!==d?d.length:0;let f=o.get(c);if(void 0===f||f.count!==p){void 0!==f&&f.texture.dispose();const v=void 0!==c.morphAttributes.position,y=void 0!==c.morphAttributes.normal,_=void 0!==c.morphAttributes.color,x=c.morphAttributes.position||[],b=c.morphAttributes.normal||[],S=c.morphAttributes.color||[];let w=0;!0===v&&(w=1),!0===y&&(w=2),!0===_&&(w=3);let C=c.attributes.position.count*w,M=1;C>t.maxTextureSize&&(M=Math.ceil(C/t.maxTextureSize),C=t.maxTextureSize);const T=new Float32Array(C*M*4*p),A=new Pm(T,C,M,p);A.type=Lp,A.needsUpdate=!0;const E=4*w;for(let L=0;L<p;L++){const P=x[L],I=b[L],O=S[L],k=C*M*4*L;for(let B=0;B<P.count;B++){const D=B*E;!0===v&&(s.fromBufferAttribute(P,B),T[k+D+0]=s.x,T[k+D+1]=s.y,T[k+D+2]=s.z,T[k+D+3]=0),!0===y&&(s.fromBufferAttribute(I,B),T[k+D+4]=s.x,T[k+D+5]=s.y,T[k+D+6]=s.z,T[k+D+7]=0),!0===_&&(s.fromBufferAttribute(O,B),T[k+D+8]=s.x,T[k+D+9]=s.y,T[k+D+10]=s.z,T[k+D+11]=4===O.itemSize?s.w:1)}}function R(){A.dispose(),o.delete(c),c.removeEventListener("dispose",R)}f={count:p,texture:A,size:new im(C,M)},o.set(c,f),c.addEventListener("dispose",R)}let m=0;for(let N=0;N<h.length;N++)m+=h[N];const g=c.morphTargetsRelative?1:1-m;u.getUniforms().setValue(e,"morphTargetBaseInfluence",g),u.getUniforms().setValue(e,"morphTargetInfluences",h),u.getUniforms().setValue(e,"morphTargetsTexture",f.texture,n),u.getUniforms().setValue(e,"morphTargetsTextureSize",f.size)}else{const U=void 0===h?0:h.length;let F=r[c.id];if(void 0===F||F.length!==U){F=[];for(let G=0;G<U;G++)F[G]=[G,0];r[c.id]=F}for(let j=0;j<U;j++){const X=F[j];X[0]=j,X[1]=h[j]}F.sort(Wy);for(let $=0;$<8;$++)$<U&&F[$][1]?(a[$][0]=F[$][0],a[$][1]=F[$][1]):(a[$][0]=Number.MAX_SAFE_INTEGER,a[$][1]=0);a.sort(Hy);const z=c.morphAttributes.position,H=c.morphAttributes.normal;let W=0;for(let Y=0;Y<8;Y++){const q=a[Y],Z=q[0],J=q[1];Z!==Number.MAX_SAFE_INTEGER&&J?(z&&c.getAttribute("morphTarget"+Y)!==z[Z]&&c.setAttribute("morphTarget"+Y,z[Z]),H&&c.getAttribute("morphNormal"+Y)!==H[Z]&&c.setAttribute("morphNormal"+Y,H[Z]),i[Y]=J,W+=J):(z&&!0===c.hasAttribute("morphTarget"+Y)&&c.deleteAttribute("morphTarget"+Y),H&&!0===c.hasAttribute("morphNormal"+Y)&&c.deleteAttribute("morphNormal"+Y),i[Y]=0)}const V=c.morphTargetsRelative?1:1-W;u.getUniforms().setValue(e,"morphTargetBaseInfluence",V),u.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function Gy(e,t,n,r){let i=new WeakMap;function o(e){const t=e.target;t.removeEventListener("dispose",o),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(s){const a=r.render.frame,l=s.geometry,c=t.get(s,l);if(i.get(c)!==a&&(t.update(c),i.set(c,a)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",o)&&s.addEventListener("dispose",o),i.get(s)!==a&&(n.update(s.instanceMatrix,e.ARRAY_BUFFER),null!==s.instanceColor&&n.update(s.instanceColor,e.ARRAY_BUFFER),i.set(s,a))),s.isSkinnedMesh){const e=s.skeleton;i.get(e)!==a&&(e.update(),i.set(e,a))}return c},dispose:function(){i=new WeakMap}}}class jy extends Am{constructor(e,t,n,r,i,o,s,a,l,c){if((c=void 0!==c?c:Dp)!==Dp&&c!==Np)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Dp&&(n=Rp),void 0===n&&c===Np&&(n=kp),super(null,r,i,o,s,a,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==s?s:xp,this.minFilter=void 0!==a?a:xp,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const Xy=new Am,$y=new jy(1,1);$y.compareFunction=515;const Yy=new Pm,qy=new Im,Zy=new Jv,Jy=[],Ky=[],Qy=new Float32Array(16),e_=new Float32Array(9),t_=new Float32Array(4);function n_(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let o=Jy[i];if(void 0===o&&(o=new Float32Array(i),Jy[i]=o),0!==t){r.toArray(o,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(o,i)}return o}function r_(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function i_(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function o_(e,t){let n=Ky[t];void 0===n&&(n=new Int32Array(t),Ky[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function s_(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function a_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(r_(n,t))return;e.uniform2fv(this.addr,t),i_(n,t)}}function l_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(r_(n,t))return;e.uniform3fv(this.addr,t),i_(n,t)}}function c_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(r_(n,t))return;e.uniform4fv(this.addr,t),i_(n,t)}}function u_(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(r_(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),i_(n,t)}else{if(r_(n,r))return;t_.set(r),e.uniformMatrix2fv(this.addr,!1,t_),i_(n,r)}}function h_(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(r_(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),i_(n,t)}else{if(r_(n,r))return;e_.set(r),e.uniformMatrix3fv(this.addr,!1,e_),i_(n,r)}}function d_(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(r_(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),i_(n,t)}else{if(r_(n,r))return;Qy.set(r),e.uniformMatrix4fv(this.addr,!1,Qy),i_(n,r)}}function p_(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function f_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(r_(n,t))return;e.uniform2iv(this.addr,t),i_(n,t)}}function m_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(r_(n,t))return;e.uniform3iv(this.addr,t),i_(n,t)}}function g_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(r_(n,t))return;e.uniform4iv(this.addr,t),i_(n,t)}}function v_(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function y_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(r_(n,t))return;e.uniform2uiv(this.addr,t),i_(n,t)}}function __(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(r_(n,t))return;e.uniform3uiv(this.addr,t),i_(n,t)}}function x_(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(r_(n,t))return;e.uniform4uiv(this.addr,t),i_(n,t)}}function b_(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);const o=this.type===e.SAMPLER_2D_SHADOW?$y:Xy;n.setTexture2D(t||o,i)}function S_(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||qy,i)}function w_(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Zy,i)}function C_(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Yy,i)}function M_(e,t){e.uniform1fv(this.addr,t)}function T_(e,t){const n=n_(t,this.size,2);e.uniform2fv(this.addr,n)}function A_(e,t){const n=n_(t,this.size,3);e.uniform3fv(this.addr,n)}function E_(e,t){const n=n_(t,this.size,4);e.uniform4fv(this.addr,n)}function R_(e,t){const n=n_(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function L_(e,t){const n=n_(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function P_(e,t){const n=n_(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function I_(e,t){e.uniform1iv(this.addr,t)}function O_(e,t){e.uniform2iv(this.addr,t)}function k_(e,t){e.uniform3iv(this.addr,t)}function B_(e,t){e.uniform4iv(this.addr,t)}function D_(e,t){e.uniform1uiv(this.addr,t)}function N_(e,t){e.uniform2uiv(this.addr,t)}function U_(e,t){e.uniform3uiv(this.addr,t)}function F_(e,t){e.uniform4uiv(this.addr,t)}function z_(e,t,n){const r=this.cache,i=t.length,o=o_(n,i);r_(r,o)||(e.uniform1iv(this.addr,o),i_(r,o));for(let e=0;e!==i;++e)n.setTexture2D(t[e]||Xy,o[e])}function H_(e,t,n){const r=this.cache,i=t.length,o=o_(n,i);r_(r,o)||(e.uniform1iv(this.addr,o),i_(r,o));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||qy,o[e])}function W_(e,t,n){const r=this.cache,i=t.length,o=o_(n,i);r_(r,o)||(e.uniform1iv(this.addr,o),i_(r,o));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||Zy,o[e])}function V_(e,t,n){const r=this.cache,i=t.length,o=o_(n,i);r_(r,o)||(e.uniform1iv(this.addr,o),i_(r,o));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||Yy,o[e])}class G_{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return s_;case 35664:return a_;case 35665:return l_;case 35666:return c_;case 35674:return u_;case 35675:return h_;case 35676:return d_;case 5124:case 35670:return p_;case 35667:case 35671:return f_;case 35668:case 35672:return m_;case 35669:case 35673:return g_;case 5125:return v_;case 36294:return y_;case 36295:return __;case 36296:return x_;case 35678:case 36198:case 36298:case 36306:case 35682:return b_;case 35679:case 36299:case 36307:return S_;case 35680:case 36300:case 36308:case 36293:return w_;case 36289:case 36303:case 36311:case 36292:return C_}}(t.type)}}class j_{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return M_;case 35664:return T_;case 35665:return A_;case 35666:return E_;case 35674:return R_;case 35675:return L_;case 35676:return P_;case 5124:case 35670:return I_;case 35667:case 35671:return O_;case 35668:case 35672:return k_;case 35669:case 35673:return B_;case 5125:return D_;case 36294:return N_;case 36295:return U_;case 36296:return F_;case 35678:case 36198:case 36298:case 36306:case 35682:return z_;case 35679:case 36299:case 36307:return H_;case 35680:case 36300:case 36308:case 36293:return W_;case 36289:case 36303:case 36311:case 36292:return V_}}(t.type)}}class X_{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,o=r.length;i!==o;++i){const o=r[i];o.setValue(e,t[o.id],n)}}}const $_=/(\w+)(\])?(\[|\.)?/g;function Y_(e,t){e.seq.push(t),e.map[t.id]=t}function q_(e,t,n){const r=e.name,i=r.length;for($_.lastIndex=0;;){const o=$_.exec(r),s=$_.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===i){Y_(n,void 0===c?new G_(a,e,t):new j_(a,e,t));break}{let e=n.map[a];void 0===e&&(e=new X_(a),Y_(n,e)),n=e}}}class Z_{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);q_(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,o=t.length;i!==o;++i){const o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function J_(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}const K_=37297;let Q_=0;function ex(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const r=parseInt(o[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),o=Math.min(t+6,n.length);for(let e=i;e<o;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function tx(e,t){const n=function(e){const t=ym.getPrimaries(ym.workingColorSpace),n=ym.getPrimaries(e);let r;switch(t===n?r="":t===Nf&&n===Df?r="LinearDisplayP3ToLinearSRGB":t===Df&&n===Nf&&(r="LinearSRGBToLinearDisplayP3"),e){case Pf:case Of:return[r,"LinearTransferOETF"];case Lf:case If:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function nx(e,t){let n;switch(t){case ip:n="Linear";break;case op:n="Reinhard";break;case sp:n="OptimizedCineon";break;case ap:n="ACESFilmic";break;case lp:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function rx(e){return""!==e}function ix(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ox(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const sx=/^[ \t]*#include +<([\w\d./]+)>/gm;function ax(e){return e.replace(sx,cx)}const lx=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function cx(e,t){let n=cy[t];if(void 0===n){const e=lx.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=cy[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return ax(n)}const ux=/#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 hx(e){return e.replace(ux,dx)}function dx(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function px(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function fx(e,t,n,r){const i=e.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Xd?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===$d?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Yd&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case dp:case pp:t="ENVMAP_TYPE_CUBE";break;case gp:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===pp&&(t="ENVMAP_MODE_REFRACTION");return t}(n),h=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case ep:t="ENVMAP_BLENDING_MULTIPLY";break;case tp:t="ENVMAP_BLENDING_MIX";break;case np:t="ENVMAP_BLENDING_ADD"}return t}(n),d=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.normalMapTangentSpace||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(rx).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(o),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f].filter(rx).join("\n"),g.length>0&&(g+="\n"),v=[p,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f].filter(rx).join("\n"),v.length>0&&(v+="\n")):(g=[px(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f,n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#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(rx).join("\n"),v=[p,px(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==rp?"#define TONE_MAPPING":"",n.toneMapping!==rp?cy.tonemapping_pars_fragment:"",n.toneMapping!==rp?nx("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",cy.colorspace_pars_fragment,tx("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(rx).join("\n")),s=ax(s),s=ix(s,n),s=ox(s,n),a=ax(a),a=ix(a,n),a=ox(a,n),s=hx(s),a=hx(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===zf?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===zf?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const _=y+g+s,x=y+v+a,b=J_(i,i.VERTEX_SHADER,_),S=J_(i,i.FRAGMENT_SHADER,x);function w(t){if(e.debug.checkShaderErrors){const n=i.getProgramInfoLog(m).trim(),r=i.getShaderInfoLog(b).trim(),o=i.getShaderInfoLog(S).trim();let s=!0,a=!0;if(!1===i.getProgramParameter(m,i.LINK_STATUS))if(s=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,m,b,S);else{const e=ex(i,b,"vertex"),t=ex(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,i.VALIDATE_STATUS)+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+t)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==o||(a=!1);a&&(t.diagnostics={runnable:s,programLog:n,vertexShader:{log:r,prefix:g},fragmentShader:{log:o,prefix:v}})}i.deleteShader(b),i.deleteShader(S),C=new Z_(i,m),M=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),o=r.name;let s=1;r.type===e.FLOAT_MAT2&&(s=2),r.type===e.FLOAT_MAT3&&(s=3),r.type===e.FLOAT_MAT4&&(s=4),n[o]={type:r.type,location:e.getAttribLocation(t,o),locationSize:s}}return n}(i,m)}let C,M;i.attachShader(m,b),i.attachShader(m,S),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),this.getUniforms=function(){return void 0===C&&w(this),C},this.getAttributes=function(){return void 0===M&&w(this),M};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=i.getProgramParameter(m,K_)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Q_++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=S,this}let mx=0;class gx{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return!1===o.has(r)&&(o.add(r),r.usedTimes++),!1===o.has(i)&&(o.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new vx(e),t.set(e,n)),n}}class vx{constructor(e){this.id=mx++,this.code=e,this.usedTimes=0}}function yx(e,t,n,r,i,o,s){const a=new bg,l=new gx,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(e){return 0===e?"uv":`uv${e}`}return{getParameters:function(o,a,c,g,v){const y=g.fog,_=v.geometry,x=o.isMeshStandardMaterial?g.environment:null,b=(o.isMeshStandardMaterial?n:t).get(o.envMap||x),S=b&&b.mapping===gp?b.image.height:null,w=f[o.type];null!==o.precision&&(p=i.getMaxPrecision(o.precision),p!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",p,"instead."));const C=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,M=void 0!==C?C.length:0;let T,A,E,R,L=0;if(void 0!==_.morphAttributes.position&&(L=1),void 0!==_.morphAttributes.normal&&(L=2),void 0!==_.morphAttributes.color&&(L=3),w){const e=hy[w];T=e.vertexShader,A=e.fragmentShader}else T=o.vertexShader,A=o.fragmentShader,l.update(o),E=l.getVertexShaderID(o),R=l.getFragmentShaderID(o);const P=e.getRenderTarget(),I=!0===v.isInstancedMesh,O=!0===v.isBatchedMesh,k=!!o.map,B=!!o.matcap,D=!!b,N=!!o.aoMap,U=!!o.lightMap,F=!!o.bumpMap,z=!!o.normalMap,H=!!o.displacementMap,W=!!o.emissiveMap,V=!!o.metalnessMap,G=!!o.roughnessMap,j=o.anisotropy>0,X=o.clearcoat>0,$=o.iridescence>0,Y=o.sheen>0,q=o.transmission>0,Z=j&&!!o.anisotropyMap,J=X&&!!o.clearcoatMap,K=X&&!!o.clearcoatNormalMap,Q=X&&!!o.clearcoatRoughnessMap,ee=$&&!!o.iridescenceMap,te=$&&!!o.iridescenceThicknessMap,ne=Y&&!!o.sheenColorMap,re=Y&&!!o.sheenRoughnessMap,ie=!!o.specularMap,oe=!!o.specularColorMap,se=!!o.specularIntensityMap,ae=q&&!!o.transmissionMap,le=q&&!!o.thicknessMap,ce=!!o.gradientMap,ue=!!o.alphaMap,he=o.alphaTest>0,de=!!o.alphaHash,pe=!!o.extensions,fe=!!_.attributes.uv1,me=!!_.attributes.uv2,ge=!!_.attributes.uv3;let ve=rp;return o.toneMapped&&(null!==P&&!0!==P.isXRRenderTarget||(ve=e.toneMapping)),{isWebGL2:u,shaderID:w,shaderType:o.type,shaderName:o.name,vertexShader:T,fragmentShader:A,defines:o.defines,customVertexShaderID:E,customFragmentShaderID:R,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:p,batching:O,instancing:I,instancingColor:I&&null!==v.instanceColor,supportsVertexTextures:d,outputColorSpace:null===P?e.outputColorSpace:!0===P.isXRRenderTarget?P.texture.colorSpace:Pf,map:k,matcap:B,envMap:D,envMapMode:D&&b.mapping,envMapCubeUVHeight:S,aoMap:N,lightMap:U,bumpMap:F,normalMap:z,displacementMap:d&&H,emissiveMap:W,normalMapObjectSpace:z&&1===o.normalMapType,normalMapTangentSpace:z&&0===o.normalMapType,metalnessMap:V,roughnessMap:G,anisotropy:j,anisotropyMap:Z,clearcoat:X,clearcoatMap:J,clearcoatNormalMap:K,clearcoatRoughnessMap:Q,iridescence:$,iridescenceMap:ee,iridescenceThicknessMap:te,sheen:Y,sheenColorMap:ne,sheenRoughnessMap:re,specularMap:ie,specularColorMap:oe,specularIntensityMap:se,transmission:q,transmissionMap:ae,thicknessMap:le,gradientMap:ce,opaque:!1===o.transparent&&1===o.blending,alphaMap:ue,alphaTest:he,alphaHash:de,combine:o.combine,mapUv:k&&m(o.map.channel),aoMapUv:N&&m(o.aoMap.channel),lightMapUv:U&&m(o.lightMap.channel),bumpMapUv:F&&m(o.bumpMap.channel),normalMapUv:z&&m(o.normalMap.channel),displacementMapUv:H&&m(o.displacementMap.channel),emissiveMapUv:W&&m(o.emissiveMap.channel),metalnessMapUv:V&&m(o.metalnessMap.channel),roughnessMapUv:G&&m(o.roughnessMap.channel),anisotropyMapUv:Z&&m(o.anisotropyMap.channel),clearcoatMapUv:J&&m(o.clearcoatMap.channel),clearcoatNormalMapUv:K&&m(o.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Q&&m(o.clearcoatRoughnessMap.channel),iridescenceMapUv:ee&&m(o.iridescenceMap.channel),iridescenceThicknessMapUv:te&&m(o.iridescenceThicknessMap.channel),sheenColorMapUv:ne&&m(o.sheenColorMap.channel),sheenRoughnessMapUv:re&&m(o.sheenRoughnessMap.channel),specularMapUv:ie&&m(o.specularMap.channel),specularColorMapUv:oe&&m(o.specularColorMap.channel),specularIntensityMapUv:se&&m(o.specularIntensityMap.channel),transmissionMapUv:ae&&m(o.transmissionMap.channel),thicknessMapUv:le&&m(o.thicknessMap.channel),alphaMapUv:ue&&m(o.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(z||j),vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUv1s:fe,vertexUv2s:me,vertexUv3s:ge,pointsUvs:!0===v.isPoints&&!!_.attributes.uv&&(k||ue),fog:!!y,useFog:!0===o.fog,fogExp2:y&&y.isFogExp2,flatShading:!0===o.flatShading,sizeAttenuation:!0===o.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:M,morphTextureStride:L,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,numLightProbes:a.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:o.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ve,useLegacyLights:e._useLegacyLights,decodeVideoTexture:k&&!0===o.map.isVideoTexture&&ym.getTransfer(o.map.colorSpace)===Bf,premultipliedAlpha:o.premultipliedAlpha,doubleSided:2===o.side,flipSided:o.side===Zd,useDepthPacking:o.depthPacking>=0,depthPacking:o.depthPacking||0,index0AttributeName:o.index0AttributeName,extensionDerivatives:pe&&!0===o.extensions.derivatives,extensionFragDepth:pe&&!0===o.extensions.fragDepth,extensionDrawBuffers:pe&&!0===o.extensions.drawBuffers,extensionShaderTextureLOD:pe&&!0===o.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),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.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){a.disableAll(),t.isWebGL2&&a.enable(0);t.supportsVertexTextures&&a.enable(1);t.instancing&&a.enable(2);t.instancingColor&&a.enable(3);t.matcap&&a.enable(4);t.envMap&&a.enable(5);t.normalMapObjectSpace&&a.enable(6);t.normalMapTangentSpace&&a.enable(7);t.clearcoat&&a.enable(8);t.iridescence&&a.enable(9);t.alphaTest&&a.enable(10);t.vertexColors&&a.enable(11);t.vertexAlphas&&a.enable(12);t.vertexUv1s&&a.enable(13);t.vertexUv2s&&a.enable(14);t.vertexUv3s&&a.enable(15);t.vertexTangents&&a.enable(16);t.anisotropy&&a.enable(17);t.alphaHash&&a.enable(18);t.batching&&a.enable(19);e.push(a.mask),a.disableAll(),t.fog&&a.enable(0);t.useFog&&a.enable(1);t.flatShading&&a.enable(2);t.logarithmicDepthBuffer&&a.enable(3);t.skinning&&a.enable(4);t.morphTargets&&a.enable(5);t.morphNormals&&a.enable(6);t.morphColors&&a.enable(7);t.premultipliedAlpha&&a.enable(8);t.shadowMapEnabled&&a.enable(9);t.useLegacyLights&&a.enable(10);t.doubleSided&&a.enable(11);t.flipSided&&a.enable(12);t.useDepthPacking&&a.enable(13);t.dithering&&a.enable(14);t.transmission&&a.enable(15);t.sheen&&a.enable(16);t.opaque&&a.enable(17);t.pointsUvs&&a.enable(18);t.decodeVideoTexture&&a.enable(19);e.push(a.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=f[e.type];let n;if(t){const e=hy[t];n=jv.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new fx(e,n,t,o),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function _x(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function xx(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function bx(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Sx(){const e=[];let t=0;const n=[],r=[],i=[];function o(n,r,i,o,s,a){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:a},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=a),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,s,a,l,c){const u=o(e,t,s,a,l,c);s.transmission>0?r.push(u):!0===s.transparent?i.push(u):n.push(u)},unshift:function(e,t,s,a,l,c){const u=o(e,t,s,a,l,c);s.transmission>0?r.unshift(u):!0===s.transparent?i.unshift(u):n.unshift(u)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||xx),r.length>1&&r.sort(t||bx),i.length>1&&i.sort(t||bx)}}}function wx(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new Sx,e.set(t,[i])):n>=r.length?(i=new Sx,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function Cx(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new km,color:new Kg};break;case"SpotLight":n={position:new km,direction:new km,color:new Kg,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new km,color:new Kg,distance:0,decay:0};break;case"HemisphereLight":n={direction:new km,skyColor:new Kg,groundColor:new Kg};break;case"RectAreaLight":n={color:new Kg,position:new km,halfWidth:new km,halfHeight:new km}}return e[t.id]=n,n}}}let Mx=0;function Tx(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Ax(e,t){const n=new Cx,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new im};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new im,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let e=0;e<9;e++)i.probe.push(new km);const o=new km,s=new ug,a=new ug;return{setup:function(o,s){let a=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0,_=0,x=0;o.sort(Tx);const b=!0===s?Math.PI:1;for(let e=0,t=o.length;e<t;e++){const t=o[e],s=t.color,S=t.intensity,w=t.distance,C=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=s.r*S*b,l+=s.g*S*b,c+=s.b*S*b;else if(t.isLightProbe){for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],S);x++}else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[u]=n,i.directionalShadowMap[u]=C,i.directionalShadowMatrix[u]=t.shadow.matrix,m++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=n.get(t);e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(S*b),e.distance=w,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,i.spot[d]=e;const o=t.shadow;if(t.map&&(i.spotLightMap[y]=t.map,y++,o.updateMatrices(t),t.castShadow&&_++),i.spotLightMatrix[d]=o.matrix,t.castShadow){const e=r.get(t);e.shadowBias=o.bias,e.shadowNormalBias=o.normalBias,e.shadowRadius=o.radius,e.shadowMapSize=o.mapSize,i.spotShadow[d]=e,i.spotShadowMap[d]=C,v++}d++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(s).multiplyScalar(S),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[h]=n,i.pointShadowMap[h]=C,i.pointShadowMatrix[h]=t.shadow.matrix,g++}i.point[h]=e,h++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(S*b),e.groundColor.copy(t.groundColor).multiplyScalar(S*b),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=uy.LTC_FLOAT_1,i.rectAreaLTC2=uy.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=uy.LTC_HALF_1,i.rectAreaLTC2=uy.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=l,i.ambient[2]=c;const S=i.hash;S.directionalLength===u&&S.pointLength===h&&S.spotLength===d&&S.rectAreaLength===p&&S.hemiLength===f&&S.numDirectionalShadows===m&&S.numPointShadows===g&&S.numSpotShadows===v&&S.numSpotMaps===y&&S.numLightProbes===x||(i.directional.length=u,i.spot.length=d,i.rectArea.length=p,i.point.length=h,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotLightMatrix.length=v+y-_,i.spotLightMap.length=y,i.numSpotLightShadowsWithMaps=_,i.numLightProbes=x,S.directionalLength=u,S.pointLength=h,S.spotLength=d,S.rectAreaLength=p,S.hemiLength=f,S.numDirectionalShadows=m,S.numPointShadows=g,S.numSpotShadows=v,S.numSpotMaps=y,S.numLightProbes=x,i.version=Mx++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),n++}else if(d.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),a.identity(),s.copy(d.matrixWorld),s.premultiply(h),a.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),r++}else if(d.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),u++}}},state:i}}function Ex(e,t){const n=new Ax(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Rx(e,t){let n=new WeakMap;return{get:function(r){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const o=n.get(r);let s;return void 0===o?(s=new Ex(e,t),n.set(r,[s])):i>=o.length?(s=new Ex(e,t),o.push(s)):s=o[i],s},dispose:function(){n=new WeakMap}}}class Lx extends tv{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=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}}class Px extends tv{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",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.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Ix(e,t,n){let r=new oy;const i=new im,o=new im,s=new Em,a=new Lx({depthPacking:3201}),l=new Px,c={},u=n.maxTextureSize,h={[qd]:Zd,[Zd]:qd,2:2},d=new Xv({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new im},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new bv;f.setAttribute("position",new uv(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Fv(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Xd;let v=this.type;function y(n,r){const o=t.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Lm(i.x,i.y)),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,o,d,m,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,o,p,m,null)}function _(t,n,r,i){let o=null;const s=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)o=s;else if(o=!0===r.isPointLight?l:a,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=o.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=o.clone(),r[t]=i),o=i}if(o.visible=n.visible,o.wireframe=n.wireframe,o.side=i===Yd?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],o.alphaMap=n.alphaMap,o.alphaTest=n.alphaTest,o.map=n.map,o.clipShadows=n.clipShadows,o.clippingPlanes=n.clippingPlanes,o.clipIntersection=n.clipIntersection,o.displacementMap=n.displacementMap,o.displacementScale=n.displacementScale,o.displacementBias=n.displacementBias,o.wireframeLinewidth=n.wireframeLinewidth,o.linewidth=n.linewidth,!0===r.isPointLight&&!0===o.isMeshDistanceMaterial){e.properties.get(o).light=r}return o}function x(n,i,o,s,a){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===Yd)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],h=l[u.materialIndex];if(h&&h.visible){const t=_(n,h,s,a);n.onBeforeShadow(e,n,i,o,r,t,u),e.renderBufferDirect(o,null,r,t,n,u),n.onAfterShadow(e,n,i,o,r,t,u)}}}else if(l.visible){const t=_(n,l,s,a);n.onBeforeShadow(e,n,i,o,r,t,null),e.renderBufferDirect(o,null,r,t,n,null),n.onAfterShadow(e,n,i,o,r,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)x(l[e],i,o,s,a)}this.render=function(t,n,a){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const p=v!==Yd&&this.type===Yd,f=v===Yd&&this.type!==Yd;for(let l=0,c=t.length;l<c;l++){const c=t[l],h=c.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const m=h.getFrameExtents();if(i.multiply(m),o.copy(h.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/m.x),i.x=o.x*m.x,h.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/m.y),i.y=o.y*m.y,h.mapSize.y=o.y)),null===h.map||!0===p||!0===f){const e=this.type!==Yd?{minFilter:xp,magFilter:xp}:{};null!==h.map&&h.map.dispose(),h.map=new Lm(i.x,i.y,e),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const g=h.getViewportCount();for(let e=0;e<g;e++){const t=h.getViewport(e);s.set(o.x*t.x,o.y*t.y,o.x*t.z,o.y*t.w),d.viewport(s),h.updateMatrices(c,e),r=h.getFrustum(),x(n,a,h.camera,c,this.type)}!0!==h.isPointLightShadow&&this.type===Yd&&y(h,a),h.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(l,c,h)}}function Ox(e,t,n){const r=n.isWebGL2;const i=new function(){let t=!1;const n=new Em;let r=null;const i=new Em(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,s,a){!0===a&&(t*=s,r*=s,o*=s),n.set(t,r,o,s),!1===i.equals(n)&&(e.clearColor(t,r,o,s),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?W(e.DEPTH_TEST):V(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},s=new function(){let t=!1,n=null,r=null,i=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(n){t||(n?W(e.STENCIL_TEST):V(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,s){r===t&&i===n&&o===s||(e.stencilFunc(t,n,s),r=t,i=n,o=s)},setOp:function(t,n,r){s===t&&a===n&&l===r||(e.stencilOp(t,n,r),s=t,a=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,s=null,a=null,l=null,c=null}}},a=new WeakMap,l=new WeakMap;let c={},u={},h=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,y=null,_=null,x=null,b=null,S=new Kg(0,0,0),w=0,C=!1,M=null,T=null,A=null,E=null,R=null;const L=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let P=!1,I=0;const O=e.getParameter(e.VERSION);-1!==O.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(O)[1]),P=I>=1):-1!==O.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),P=I>=2);let k=null,B={};const D=e.getParameter(e.SCISSOR_BOX),N=e.getParameter(e.VIEWPORT),U=(new Em).fromArray(D),F=(new Em).fromArray(N);function z(t,n,i,o){const s=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a<i;a++)!r||t!==e.TEXTURE_3D&&t!==e.TEXTURE_2D_ARRAY?e.texImage2D(n+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage3D(n,0,e.RGBA,1,1,o,0,e.RGBA,e.UNSIGNED_BYTE,s);return a}const H={};function W(t){!0!==c[t]&&(e.enable(t),c[t]=!0)}function V(t){!1!==c[t]&&(e.disable(t),c[t]=!1)}H[e.TEXTURE_2D]=z(e.TEXTURE_2D,e.TEXTURE_2D,1),H[e.TEXTURE_CUBE_MAP]=z(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(H[e.TEXTURE_2D_ARRAY]=z(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),H[e.TEXTURE_3D]=z(e.TEXTURE_3D,e.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),o.setClear(1),s.setClear(0),W(e.DEPTH_TEST),o.setFunc(3),$(!1),Y(1),W(e.CULL_FACE),X(0);const G={[Jd]:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};if(r)G[103]=e.MIN,G[104]=e.MAX;else{const e=t.get("EXT_blend_minmax");null!==e&&(G[103]=e.MIN_EXT,G[104]=e.MAX_EXT)}const j={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,[Kd]:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,[Qd]:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function X(t,n,r,i,o,s,a,l,c,u){if(0!==t){if(!1===f&&(W(e.BLEND),f=!0),5===t)o=o||n,s=s||r,a=a||i,n===g&&o===_||(e.blendEquationSeparate(G[n],G[o]),g=n,_=o),r===v&&i===y&&s===x&&a===b||(e.blendFuncSeparate(j[r],j[i],j[s],j[a]),v=r,y=i,x=s,b=a),!1!==l.equals(S)&&c===w||(e.blendColor(l.r,l.g,l.b,c),S.copy(l),w=c),m=t,C=!1;else if(t!==m||u!==C){if(g===Jd&&_===Jd||(e.blendEquation(e.FUNC_ADD),g=Jd,_=Jd),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}v=null,y=null,x=null,b=null,S.set(0,0,0),w=0,m=t,C=u}}else!0===f&&(V(e.BLEND),f=!1)}function $(t){M!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),M=t)}function Y(t){0!==t?(W(e.CULL_FACE),t!==T&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):V(e.CULL_FACE),T=t}function q(t,n,r){t?(W(e.POLYGON_OFFSET_FILL),E===n&&R===r||(e.polygonOffset(n,r),E=n,R=r)):V(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:o,stencil:s},enable:W,disable:V,bindFramebuffer:function(t,n){return u[t]!==n&&(e.bindFramebuffer(t,n),u[t]=n,r&&(t===e.DRAW_FRAMEBUFFER&&(u[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(u[e.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let o=d,s=!1;if(r)if(o=h.get(i),void 0===o&&(o=[],h.set(i,o)),r.isWebGLMultipleRenderTargets){const t=r.texture;if(o.length!==t.length||o[0]!==e.COLOR_ATTACHMENT0){for(let n=0,r=t.length;n<r;n++)o[n]=e.COLOR_ATTACHMENT0+n;o.length=t.length,s=!0}}else o[0]!==e.COLOR_ATTACHMENT0&&(o[0]=e.COLOR_ATTACHMENT0,s=!0);else o[0]!==e.BACK&&(o[0]=e.BACK,s=!0);s&&(n.isWebGL2?e.drawBuffers(o):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(o))},useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:X,setMaterial:function(t,n){2===t.side?V(e.CULL_FACE):W(e.CULL_FACE);let r=t.side===Zd;n&&(r=!r),$(r),1===t.blending&&!1===t.transparent?X(0):X(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),i.setMask(t.colorWrite);const a=t.stencilWrite;s.setTest(a),a&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),q(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?W(e.SAMPLE_ALPHA_TO_COVERAGE):V(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:$,setCullFace:Y,setLineWidth:function(t){t!==A&&(P&&e.lineWidth(t),A=t)},setPolygonOffset:q,setScissorTest:function(t){t?W(e.SCISSOR_TEST):V(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+L-1),k!==t&&(e.activeTexture(t),k=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===k?e.TEXTURE0+L-1:k);let i=B[r];void 0===i&&(i={type:void 0,texture:void 0},B[r]=i),i.type===t&&i.texture===n||(k!==r&&(e.activeTexture(r),k=r),e.bindTexture(t,n||H[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=B[k];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,n){let r=l.get(n);void 0===r&&(r=new WeakMap,l.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=l.get(n).get(t);a.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),a.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===U.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),U.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),!0===r&&(e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},k=null,B={},u={},h=new WeakMap,d=[],p=null,f=!1,m=null,g=null,v=null,y=null,_=null,x=null,b=null,S=new Kg(0,0,0),w=0,C=!1,M=null,T=null,A=null,E=null,R=null,U.set(0,0,e.canvas.width,e.canvas.height),F.set(0,0,e.canvas.width,e.canvas.height),i.reset(),o.reset(),s.reset()}}}function kx(e,t,n,r,i,o,s){const a=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function y(e,t){return v?new OffscreenCanvas(e,t):um("canvas")}function _(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?em:Math.floor,o=r(i*e.width),s=r(i*e.height);void 0===m&&(m=y(o,s));const a=n?y(o,s):m;a.width=o,a.height=s;return a.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return Qf(e.width)&&Qf(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==xp&&e.minFilter!==wp}function S(t){e.generateMipmap(t)}function w(n,r,i,o){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!1===a)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RGBA){const t=s?kf:ym.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===Bf?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return l!==e.R16F&&l!==e.R32F&&l!==e.RG16F&&l!==e.RG32F&&l!==e.RGBA16F&&l!==e.RGBA32F||t.get("EXT_color_buffer_float"),l}function C(e,t,n){return!0===b(e,n)||e.isFramebufferTexture&&e.minFilter!==xp&&e.minFilter!==wp?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 M(t){return t===xp||t===bp||t===Sp?e.NEAREST:e.LINEAR}function T(e){const t=e.target;t.removeEventListener("dispose",T),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=g.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&E(e),0===Object.keys(i).length&&g.delete(n)}r.remove(e)}(t),t.isVideoTexture&&f.delete(t)}function A(t){const n=t.target;n.removeEventListener("dispose",A),function(t){const n=t.texture,i=r.get(t),o=r.get(n);void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),s.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(i.__webglFramebuffer[t]))for(let n=0;n<i.__webglFramebuffer[t].length;n++)e.deleteFramebuffer(i.__webglFramebuffer[t][n]);else e.deleteFramebuffer(i.__webglFramebuffer[t]);i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t])}else{if(Array.isArray(i.__webglFramebuffer))for(let t=0;t<i.__webglFramebuffer.length;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer);if(i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),s.memory.textures--),r.remove(n[t])}r.remove(n),r.remove(t)}(n)}function E(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete g.get(i)[n.__cacheKey],s.memory.textures--}let R=0;function L(t,i){const o=r.get(t);if(t.isVideoTexture&&function(e){const t=s.render.frame;f.get(e)!==t&&(f.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&o.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void D(o,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,o.__webglTexture,e.TEXTURE0+i)}const P={[vp]:e.REPEAT,[yp]:e.CLAMP_TO_EDGE,[_p]:e.MIRRORED_REPEAT},I={[xp]:e.NEAREST,[bp]:e.NEAREST_MIPMAP_NEAREST,[Sp]:e.NEAREST_MIPMAP_LINEAR,[wp]:e.LINEAR,[Cp]:e.LINEAR_MIPMAP_NEAREST,[Mp]:e.LINEAR_MIPMAP_LINEAR},O={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function k(n,o,s){if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,P[o.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,P[o.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,P[o.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,I[o.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,I[o.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),o.wrapS===yp&&o.wrapT===yp||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,M(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,M(o.minFilter)),o.minFilter!==xp&&o.minFilter!==wp&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),o.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,O[o.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){const s=t.get("EXT_texture_filter_anisotropic");if(o.magFilter===xp)return;if(o.minFilter!==Sp&&o.minFilter!==Mp)return;if(o.type===Lp&&!1===t.has("OES_texture_float_linear"))return;if(!1===a&&o.type===Pp&&!1===t.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function B(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",T));const i=n.source;let o=g.get(i);void 0===o&&(o={},g.set(i,o));const a=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.colorSpace),t.join()}(n);if(a!==t.__cacheKey){void 0===o[a]&&(o[a]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),o[a].usedTimes++;const i=o[t.__cacheKey];void 0!==i&&(o[t.__cacheKey].usedTimes--,0===i.usedTimes&&E(n)),t.__cacheKey=a,t.__webglTexture=o[a].texture}return r}function D(t,i,s){let l=e.TEXTURE_2D;(i.isDataArrayTexture||i.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),i.isData3DTexture&&(l=e.TEXTURE_3D);const c=B(t,i),h=i.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const d=r.get(h);if(h.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+s);const t=ym.getPrimaries(ym.workingColorSpace),r=i.colorSpace===Rf?null:ym.getPrimaries(i.colorSpace),p=i.colorSpace===Rf||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(e){return!a&&(e.wrapS!==yp||e.wrapT!==yp||e.minFilter!==xp&&e.minFilter!==wp)}(i)&&!1===x(i.image);let m=_(i.image,f,!1,u);m=W(i,m);const g=x(m)||a,v=o.convert(i.format,i.colorSpace);let y,M=o.convert(i.type),T=w(i.internalFormat,v,M,i.colorSpace,i.isVideoTexture);k(l,i,g);const A=i.mipmaps,E=a&&!0!==i.isVideoTexture&&T!==qp,R=void 0===d.__version||!0===c,L=C(i,m,g);if(i.isDepthTexture)T=e.DEPTH_COMPONENT,a?T=i.type===Lp?e.DEPTH_COMPONENT32F:i.type===Rp?e.DEPTH_COMPONENT24:i.type===kp?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:i.type===Lp&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Dp&&T===e.DEPTH_COMPONENT&&i.type!==Ap&&i.type!==Rp&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Rp,M=o.convert(i.type)),i.format===Np&&T===e.DEPTH_COMPONENT&&(T=e.DEPTH_STENCIL,i.type!==kp&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=kp,M=o.convert(i.type))),R&&(E?n.texStorage2D(e.TEXTURE_2D,1,T,m.width,m.height):n.texImage2D(e.TEXTURE_2D,0,T,m.width,m.height,0,v,M,null));else if(i.isDataTexture)if(A.length>0&&g){E&&R&&n.texStorage2D(e.TEXTURE_2D,L,T,A[0].width,A[0].height);for(let t=0,r=A.length;t<r;t++)y=A[t],E?n.texSubImage2D(e.TEXTURE_2D,t,0,0,y.width,y.height,v,M,y.data):n.texImage2D(e.TEXTURE_2D,t,T,y.width,y.height,0,v,M,y.data);i.generateMipmaps=!1}else E?(R&&n.texStorage2D(e.TEXTURE_2D,L,T,m.width,m.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,m.width,m.height,v,M,m.data)):n.texImage2D(e.TEXTURE_2D,0,T,m.width,m.height,0,v,M,m.data);else if(i.isCompressedTexture)if(i.isCompressedArrayTexture){E&&R&&n.texStorage3D(e.TEXTURE_2D_ARRAY,L,T,A[0].width,A[0].height,m.depth);for(let t=0,r=A.length;t<r;t++)y=A[t],i.format!==Bp?null!==v?E?n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,y.width,y.height,m.depth,v,y.data,0,0):n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,T,y.width,y.height,m.depth,0,y.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,y.width,y.height,m.depth,v,M,y.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,T,y.width,y.height,m.depth,0,v,M,y.data)}else{E&&R&&n.texStorage2D(e.TEXTURE_2D,L,T,A[0].width,A[0].height);for(let t=0,r=A.length;t<r;t++)y=A[t],i.format!==Bp?null!==v?E?n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,y.width,y.height,v,y.data):n.compressedTexImage2D(e.TEXTURE_2D,t,T,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?n.texSubImage2D(e.TEXTURE_2D,t,0,0,y.width,y.height,v,M,y.data):n.texImage2D(e.TEXTURE_2D,t,T,y.width,y.height,0,v,M,y.data)}else if(i.isDataArrayTexture)E?(R&&n.texStorage3D(e.TEXTURE_2D_ARRAY,L,T,m.width,m.height,m.depth),n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,m.width,m.height,m.depth,v,M,m.data)):n.texImage3D(e.TEXTURE_2D_ARRAY,0,T,m.width,m.height,m.depth,0,v,M,m.data);else if(i.isData3DTexture)E?(R&&n.texStorage3D(e.TEXTURE_3D,L,T,m.width,m.height,m.depth),n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,m.width,m.height,m.depth,v,M,m.data)):n.texImage3D(e.TEXTURE_3D,0,T,m.width,m.height,m.depth,0,v,M,m.data);else if(i.isFramebufferTexture){if(R)if(E)n.texStorage2D(e.TEXTURE_2D,L,T,m.width,m.height);else{let t=m.width,r=m.height;for(let i=0;i<L;i++)n.texImage2D(e.TEXTURE_2D,i,T,t,r,0,v,M,null),t>>=1,r>>=1}}else if(A.length>0&&g){E&&R&&n.texStorage2D(e.TEXTURE_2D,L,T,A[0].width,A[0].height);for(let t=0,r=A.length;t<r;t++)y=A[t],E?n.texSubImage2D(e.TEXTURE_2D,t,0,0,v,M,y):n.texImage2D(e.TEXTURE_2D,t,T,v,M,y);i.generateMipmaps=!1}else E?(R&&n.texStorage2D(e.TEXTURE_2D,L,T,m.width,m.height),n.texSubImage2D(e.TEXTURE_2D,0,0,0,v,M,m)):n.texImage2D(e.TEXTURE_2D,0,T,v,M,m);b(i,g)&&S(l),d.__version=h.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function N(t,i,s,a,l,c){const u=o.convert(s.format,s.colorSpace),h=o.convert(s.type),p=w(s.internalFormat,u,h,s.colorSpace);if(!r.get(i).__hasExternalTextures){const t=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,c,p,t,r,i.depth,0,u,h,null):n.texImage2D(l,c,p,t,r,0,u,h,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),H(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,a,l,r.get(s).__webglTexture,0,z(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,a,l,r.get(s).__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function U(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let i=!0===a?e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT16;if(r||H(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===Lp?i=e.DEPTH_COMPONENT32F:t.type===Rp&&(i=e.DEPTH_COMPONENT24));const r=z(n);H(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,r,i,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,r,i,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,i,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=z(n);r&&!1===H(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):H(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i<t.length;i++){const s=t[i],a=o.convert(s.format,s.colorSpace),l=o.convert(s.type),c=w(s.internalFormat,a,l,s.colorSpace),u=z(n);r&&!1===H(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,n.width,n.height):H(n)?d.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function F(t){const i=r.get(t),o=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),L(i.depthTexture,0);const o=r.get(i.depthTexture).__webglTexture,s=z(i);if(i.depthTexture.format===Dp)H(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0);else{if(i.depthTexture.format!==Np)throw new Error("Unknown depthTexture format");H(i)?d.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0,s):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0)}}(i.__webglFramebuffer,t)}else if(o){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),U(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),U(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}function z(e){return Math.min(h,e.samples)}function H(e){const n=r.get(e);return a&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function W(e,n){const r=e.colorSpace,i=e.format,o=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===Hf||r!==Pf&&r!==Rf&&(ym.getTransfer(r)===Bf?!1===a?!0===t.has("EXT_sRGB")&&i===Bp?(e.format=Hf,e.minFilter=wp,e.generateMipmaps=!1):n=Sm.sRGBToLinear(n):i===Bp&&o===Tp||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}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=L,this.setTexture2DArray=function(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?D(o,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,o.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?D(o,t,i):n.bindTexture(e.TEXTURE_3D,o.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?function(t,i,s){if(6!==i.image.length)return;const l=B(t,i),u=i.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const h=r.get(u);if(u.version!==h.__version||!0===l){n.activeTexture(e.TEXTURE0+s);const t=ym.getPrimaries(ym.workingColorSpace),r=i.colorSpace===Rf?null:ym.getPrimaries(i.colorSpace),d=i.colorSpace===Rf||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=i.isCompressedTexture||i.image[0].isCompressedTexture,f=i.image[0]&&i.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)m[e]=p||f?f?i.image[e].image:i.image[e]:_(i.image[e],!1,!0,c),m[e]=W(i,m[e]);const g=m[0],v=x(g)||a,y=o.convert(i.format,i.colorSpace),M=o.convert(i.type),T=w(i.internalFormat,y,M,i.colorSpace),A=a&&!0!==i.isVideoTexture,E=void 0===h.__version||!0===l;let R,L=C(i,g,v);if(k(e.TEXTURE_CUBE_MAP,i,v),p){A&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,L,T,g.width,g.height);for(let t=0;t<6;t++){R=m[t].mipmaps;for(let r=0;r<R.length;r++){const o=R[r];i.format!==Bp?null!==y?A?n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,o.width,o.height,y,o.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,T,o.width,o.height,0,o.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):A?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,o.width,o.height,y,M,o.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,T,o.width,o.height,0,y,M,o.data)}}}else{R=i.mipmaps,A&&E&&(R.length>0&&L++,n.texStorage2D(e.TEXTURE_CUBE_MAP,L,T,m[0].width,m[0].height));for(let t=0;t<6;t++)if(f){A?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,y,M,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,T,m[t].width,m[t].height,0,y,M,m[t].data);for(let r=0;r<R.length;r++){const i=R[r].image[t].image;A?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,y,M,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,T,i.width,i.height,0,y,M,i.data)}}else{A?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,y,M,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,T,y,M,m[t]);for(let r=0;r<R.length;r++){const i=R[r];A?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,y,M,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,T,y,M,i.image[t])}}}b(i,v)&&S(e.TEXTURE_CUBE_MAP),h.__version=u.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(s,t,i):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+i)},this.rebindTextures=function(t,n,i){const o=r.get(t);void 0!==n&&N(o.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&F(t)},this.setupRenderTarget=function(t){const l=t.texture,c=r.get(t),u=r.get(l);t.addEventListener("dispose",A),!0!==t.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=e.createTexture()),u.__version=l.version,s.memory.textures++);const h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=x(t)||a;if(h){c.__webglFramebuffer=[];for(let t=0;t<6;t++)if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer[t]=[];for(let n=0;n<l.mipmaps.length;n++)c.__webglFramebuffer[t][n]=e.createFramebuffer()}else c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(a&&l.mipmaps&&l.mipmaps.length>0){c.__webglFramebuffer=[];for(let t=0;t<l.mipmaps.length;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else c.__webglFramebuffer=e.createFramebuffer();if(d)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&t.samples>0&&!1===H(t)){const r=d?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let n=0;n<r.length;n++){const i=r[n];c.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);const s=o.convert(i.format,i.colorSpace),a=o.convert(i.type),l=w(i.internalFormat,s,a,i.colorSpace,!0===t.isXRRenderTarget),u=z(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,c.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),U(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(h){n.bindTexture(e.TEXTURE_CUBE_MAP,u.__webglTexture),k(e.TEXTURE_CUBE_MAP,l,p);for(let n=0;n<6;n++)if(a&&l.mipmaps&&l.mipmaps.length>0)for(let r=0;r<l.mipmaps.length;r++)N(c.__webglFramebuffer[n][r],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else N(c.__webglFramebuffer[n],t,l,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);b(l,p)&&S(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){const i=t.texture;for(let o=0,s=i.length;o<s;o++){const s=i[o],a=r.get(s);n.bindTexture(e.TEXTURE_2D,a.__webglTexture),k(e.TEXTURE_2D,s,p),N(c.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+o,e.TEXTURE_2D,0),b(s,p)&&S(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(a?r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,u.__webglTexture),k(r,l,p),a&&l.mipmaps&&l.mipmaps.length>0)for(let n=0;n<l.mipmaps.length;n++)N(c.__webglFramebuffer[n],t,l,e.COLOR_ATTACHMENT0,r,n);else N(c.__webglFramebuffer,t,l,e.COLOR_ATTACHMENT0,r,0);b(l,p)&&S(r),n.unbindTexture()}t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(t){const i=x(t)||a,o=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let s=0,a=o.length;s<a;s++){const a=o[s];if(b(a,i)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=r.get(a).__webglTexture;n.bindTexture(i,o),S(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(a&&t.samples>0&&!1===H(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],o=t.width,s=t.height;let a=e.COLOR_BUFFER_BIT;const l=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),h=!0===t.isWebGLMultipleRenderTargets;if(h)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){l.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&l.push(c);const d=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===d&&(t.depthBuffer&&(a|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(a|=e.STENCIL_BUFFER_BIT)),h&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===d&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[c]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[c])),h){const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,o,s,0,0,o,s,a,e.NEAREST),p&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,l)}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const o=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,o,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=F,this.setupFrameBufferTexture=N,this.useMultisampledRTT=H}function Bx(e,t,n){const r=n.isWebGL2;return{convert:function(n){let i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rf;const s=ym.getTransfer(o);if(n===Tp)return e.UNSIGNED_BYTE;if(n===Ip)return e.UNSIGNED_SHORT_4_4_4_4;if(n===Op)return e.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===Ap)return e.UNSIGNED_SHORT;if(n===Ep)return e.INT;if(n===Rp)return e.UNSIGNED_INT;if(n===Lp)return e.FLOAT;if(n===Pp)return r?e.HALF_FLOAT:(i=t.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(1021===n)return e.ALPHA;if(n===Bp)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===Dp)return e.DEPTH_COMPONENT;if(n===Np)return e.DEPTH_STENCIL;if(n===Hf)return i=t.get("EXT_sRGB"),null!==i?i.SRGB_ALPHA_EXT:null;if(1028===n)return e.RED;if(n===Up)return e.RED_INTEGER;if(1030===n)return e.RG;if(n===Fp)return e.RG_INTEGER;if(n===zp)return e.RGBA_INTEGER;if(n===Hp||n===Wp||n===Vp||n===Gp)if(s===Bf){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(n===Hp)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Wp)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Vp)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Gp)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(n===Hp)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Wp)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Vp)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Gp)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===jp||n===Xp||n===$p||n===Yp){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(n===jp)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Xp)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===$p)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Yp)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===qp)return i=t.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===Zp||n===Jp){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(n===Zp)return s===Bf?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===Jp)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(n===Kp||n===Qp||n===ef||n===tf||n===nf||n===rf||n===of||n===sf||n===af||n===lf||n===cf||n===uf||n===hf||n===df){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(n===Kp)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Qp)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ef)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===tf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===nf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===rf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===of)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===sf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===af)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===lf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===cf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===uf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===hf)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===df)return s===Bf?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===pf||n===ff||n===mf){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(n===pf)return s===Bf?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ff)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===mf)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||n===gf||n===vf||n===yf){if(i=t.get("EXT_texture_compression_rgtc"),null===i)return null;if(n===pf)return i.COMPRESSED_RED_RGTC1_EXT;if(n===gf)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===vf)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===yf)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===kp?r?e.UNSIGNED_INT_24_8:(i=t.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}class Dx extends Yv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isArrayCamera=!0,this.cameras=e}}class Nx extends Bg{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Ux={type:"move"};class Fx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Nx,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Nx,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new km,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new km),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Nx,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new km,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new km),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){o=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],s=r.position.distanceTo(i.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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));null!==s&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ux)))}return null!==s&&(s.visible=null!==r),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==o),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new Nx;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class zx extends Gf{constructor(e,t){super();const n=this;let r=null,i=1,o=null,s="local-floor",a=1,l=null,c=null,u=null,h=null,d=null,p=null;const f=t.getContextAttributes();let m=null,g=null;const v=[],y=[],_=new im;let x=null;const b=new Yv;b.layers.enable(1),b.viewport=new Em;const S=new Yv;S.layers.enable(2),S.viewport=new Em;const w=[b,S],C=new Dx;C.layers.enable(1),C.layers.enable(2);let M=null,T=null;function A(e){const t=y.indexOf(e.inputSource);if(-1===t)return;const n=v[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||o),n.dispatchEvent({type:e.type,data:e.inputSource}))}function E(){r.removeEventListener("select",A),r.removeEventListener("selectstart",A),r.removeEventListener("selectend",A),r.removeEventListener("squeeze",A),r.removeEventListener("squeezestart",A),r.removeEventListener("squeezeend",A),r.removeEventListener("end",E),r.removeEventListener("inputsourceschange",R);for(let e=0;e<v.length;e++){const t=y[e];null!==t&&(y[e]=null,v[e].disconnect(t))}M=null,T=null,e.setRenderTarget(m),d=null,h=null,u=null,r=null,g=null,k.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(_.width,_.height,!1),n.dispatchEvent({type:"sessionend"})}function R(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=y.indexOf(n);r>=0&&(y[r]=null,v[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=y.indexOf(n);if(-1===r){for(let e=0;e<v.length;e++){if(e>=y.length){y.push(n),r=e;break}if(null===y[e]){y[e]=n,r=e;break}}if(-1===r)break}const i=v[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=v[e];return void 0===t&&(t=new Fx,v[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=v[e];return void 0===t&&(t=new Fx,v[e]=t),t.getGripSpace()},this.getHand=function(e){let t=v[e];return void 0===t&&(t=new Fx,v[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(c){if(r=c,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",A),r.addEventListener("selectstart",A),r.addEventListener("selectend",A),r.addEventListener("squeeze",A),r.addEventListener("squeezestart",A),r.addEventListener("squeezeend",A),r.addEventListener("end",E),r.addEventListener("inputsourceschange",R),!0!==f.xrCompatible&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(_),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),g=new Lm(d.framebufferWidth,d.framebufferHeight,{format:Bp,type:Tp,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,o=null,s=null;f.depth&&(s=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=f.stencil?Np:Dp,o=f.stencil?kp:Rp);const a={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:i};u=new XRWebGLBinding(r,t),h=u.createProjectionLayer(a),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),g=new Lm(h.textureWidth,h.textureHeight,{format:Bp,type:Tp,depthTexture:new jy(h.textureWidth,h.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0});e.properties.get(g).__ignoreDepthValues=h.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(a),l=null,o=await r.requestReferenceSpace(s),k.setContext(r),k.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const L=new km,P=new km;function I(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;C.near=S.near=b.near=e.near,C.far=S.far=b.far=e.far,M===C.near&&T===C.far||(r.updateRenderState({depthNear:C.near,depthFar:C.far}),M=C.near,T=C.far);const t=e.parent,n=C.cameras;I(C,t);for(let e=0;e<n.length;e++)I(n[e],t);2===n.length?function(e,t,n){L.setFromMatrixPosition(t.matrixWorld),P.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(P),i=t.projectionMatrix.elements,o=n.projectionMatrix.elements,s=i[14]/(i[10]-1),a=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(o[8]+1)/o[0],d=s*u,p=s*h,f=r/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=s+f,v=a+f,y=d-m,_=p+(r-m),x=l*a/v*g,b=c*a/v*g;e.projectionMatrix.makePerspective(y,_,x,b,g,v),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(C,b,S):C.projectionMatrix.copy(b.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld));e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*Yf*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,C,t)},this.getCamera=function(){return C},this.getFoveation=function(){if(null!==h||null!==d)return a},this.setFoveation=function(e){a=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let O=null;const k=new sy;k.setAnimationLoop((function(t,r){if(c=r.getViewerPose(l||o),p=r,null!==c){const t=c.views;null!==d&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let n=!1;t.length!==C.cameras.length&&(C.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let o=null;if(null!==d)o=d.getViewport(i);else{const t=u.getViewSubImage(h,i);o=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,h.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(g))}let s=w[r];void 0===s&&(s=new Yv,s.layers.enable(r),s.viewport=new Em,w[r]=s),s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(i.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(o.x,o.y,o.width,o.height),0===r&&(C.matrix.copy(s.matrix),C.matrix.decompose(C.position,C.quaternion,C.scale)),!0===n&&C.cameras.push(s)}}for(let e=0;e<v.length;e++){const t=y[e],n=v[e];null!==t&&void 0!==n&&n.update(t,r,l||o)}O&&O(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),p=null})),this.setAnimationLoop=function(e){O=e},this.dispose=function(){}}}function Hx(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===Zd&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===Zd&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const o=t.get(i).envMap;if(o&&(r.envMap.value=o,r.flipEnvMap.value=o.isCubeTexture&&!1===o.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._useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*t,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Gv(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,o,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.metalness.value=r.metalness,r.metalnessMap&&(e.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,e.metalnessMapTransform));e.roughness.value=r.roughness,r.roughnessMap&&(e.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,e.roughnessMapTransform));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,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===Zd&&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,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));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,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(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,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(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,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,o,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,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Wx(e,t,n,r){let i={},o={},s=[];const a=n.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,n){const r=e.value;if(void 0===n[t]){if("number"==typeof r)n[t]=r;else{const e=Array.isArray(r)?r:[r],i=[];for(let t=0;t<e.length;t++)i.push(e[t].clone());n[t]=i}return!0}if("number"==typeof r){if(n[t]!==r)return n[t]=r,!0}else{const e=Array.isArray(n[t])?n[t]:[n[t]],i=Array.isArray(r)?r:[r];for(let t=0;t<e.length;t++){const n=e[t];if(!1===n.equals(i[t]))return n.copy(i[t]),!0}}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const n=t.target;n.removeEventListener("dispose",u);const r=s.indexOf(n.__bindingPointIndex);s.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete o[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,h){let d=i[n.id];void 0===d&&(!function(e){const t=e.uniforms;let n=0;const r=16;let i=0;for(let e=0,o=t.length;e<o;e++){const o=t[e],s={boundary:0,storage:0},a=Array.isArray(o.value)?o.value:[o.value];for(let e=0,t=a.length;e<t;e++){const t=c(a[e]);s.boundary+=t.boundary,s.storage+=t.storage}if(o.__data=new Float32Array(s.storage/Float32Array.BYTES_PER_ELEMENT),o.__offset=n,e>0){i=n%r;0!==i&&r-i-s.boundary<0&&(n+=r-i,o.__offset=n)}n+=s.storage}i=n%r,i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),d=function(t){const n=function(){for(let e=0;e<a;e++)if(-1===s.indexOf(e))return s.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,o=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,o),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=d,n.addEventListener("dispose",u));const p=h.program;r.updateUBOMapping(n,p);const f=t.render.frame;o[n.id]!==f&&(!function(t){const n=i[t.id],r=t.uniforms,o=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){const n=r[t];if(!0===l(n,t,o)){const t=n.__offset,r=Array.isArray(n.value)?n.value:[n.value];let i=0;for(let o=0;o<r.length;o++){const s=r[o],a=c(s);"number"==typeof s?(n.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,t+i,n.__data)):s.isMatrix3?(n.__data[0]=s.elements[0],n.__data[1]=s.elements[1],n.__data[2]=s.elements[2],n.__data[3]=s.elements[0],n.__data[4]=s.elements[3],n.__data[5]=s.elements[4],n.__data[6]=s.elements[5],n.__data[7]=s.elements[0],n.__data[8]=s.elements[6],n.__data[9]=s.elements[7],n.__data[10]=s.elements[8],n.__data[11]=s.elements[0]):(s.toArray(n.__data,i),i+=a.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,n.__data)}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),o[n.id]=f)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);s=[],i={},o={}}}}class Vx{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{canvas:t=hm(),context:n=null,depth:r=!0,stencil:i=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:a=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=e;let h;this.isWebGLRenderer=!0,h=null!==n?n.getContextAttributes().alpha:o;const d=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Lf,this._useLegacyLights=!1,this.toneMapping=rp,this.toneMappingExposure=1;const y=this;let _=!1,x=0,b=0,S=null,w=-1,C=null;const M=new Em,T=new Em;let A=null;const E=new Kg(0);let R=0,L=t.width,P=t.height,I=1,O=null,k=null;const B=new Em(0,0,L,P),D=new Em(0,0,L,P);let N=!1;const U=new oy;let F=!1,z=!1,H=null;const W=new ug,V=new im,G=new km,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function X(){return null===S?I:1}let $,Y,q,Z,J,K,Q,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,he,de,pe,fe,me,ge,ve=n;function ye(e,n){for(let r=0;r<e.length;r++){const i=e[r],o=t.getContext(i,n);if(null!==o)return o}return null}try{const e={alpha:!0,depth:r,stencil:i,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${jd}`),t.addEventListener("webglcontextlost",be,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",we,!1),null===ve){const t=["webgl2","webgl","experimental-webgl"];if(!0===y.isWebGL1Renderer&&t.shift(),ve=ye(t,e),null===ve)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&ve instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===ve.getShaderPrecisionFormat&&(ve.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function _e(){$=new Ny(ve),Y=new gy(ve,$,e),$.init(Y),fe=new Bx(ve,$,Y),q=new Ox(ve,$,Y),Z=new zy(ve),J=new _x,K=new kx(ve,$,q,J,Y,fe,Z),Q=new yy(y),ee=new Dy(y),te=new ay(ve,Y),me=new fy(ve,$,te,Y),ne=new Uy(ve,te,Z,me),re=new Gy(ve,ne,te,Z),he=new Vy(ve,Y,K),le=new vy(J),ie=new yx(y,Q,ee,$,Y,me,le),oe=new Hx(y,J),se=new wx,ae=new Rx($,Y),ue=new py(y,Q,ee,q,re,h,a),ce=new Ix(y,re,Y),ge=new Wx(ve,Z,Y,q),de=new my(ve,$,Z,Y),pe=new Fy(ve,$,Z,Y),Z.programs=ie.programs,y.capabilities=Y,y.extensions=$,y.properties=J,y.renderLists=se,y.shadowMap=ce,y.state=q,y.info=Z}_e();const xe=new zx(y,ve);function be(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;const e=Z.autoReset,t=ce.enabled,n=ce.autoUpdate,r=ce.needsUpdate,i=ce.type;_e(),Z.autoReset=e,ce.enabled=t,ce.autoUpdate=n,ce.needsUpdate=r,ce.type=i}function we(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Ce(e){const t=e.target;t.removeEventListener("dispose",Ce),function(e){(function(e){const t=J.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),J.remove(e)}(t)}function Me(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=Zd,e.needsUpdate=!0,ke(e,t,n),e.side=qd,e.needsUpdate=!0,ke(e,t,n),e.side=2):ke(e,t,n)}this.xr=xe,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=$.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=$.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(L,P,!1))},this.getSize=function(e){return e.set(L,P)},this.setSize=function(e,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(L=e,P=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(L*I,P*I).floor()},this.setDrawingBufferSize=function(e,n,r){L=e,P=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(M)},this.getViewport=function(e){return e.copy(B)},this.setViewport=function(e,t,n,r){e.isVector4?B.set(e.x,e.y,e.z,e.w):B.set(e,t,n,r),q.viewport(M.copy(B).multiplyScalar(I).floor())},this.getScissor=function(e){return e.copy(D)},this.setScissor=function(e,t,n,r){e.isVector4?D.set(e.x,e.y,e.z,e.w):D.set(e,t,n,r),q.scissor(T.copy(D).multiplyScalar(I).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(e){q.setScissorTest(N=e)},this.setOpaqueSort=function(e){O=e},this.setTransparentSort=function(e){k=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=0;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){let e=!1;if(null!==S){const t=S.texture.format;e=t===zp||t===Fp||t===Up}if(e){const e=S.texture.type,t=e===Tp||e===Rp||e===Ap||e===kp||e===Ip||e===Op,n=ue.getClearColor(),r=ue.getClearAlpha(),i=n.r,o=n.g,s=n.b;t?(d[0]=i,d[1]=o,d[2]=s,d[3]=r,ve.clearBufferuiv(ve.COLOR,0,d)):(p[0]=i,p[1]=o,p[2]=s,p[3]=r,ve.clearBufferiv(ve.COLOR,0,p))}else n|=ve.COLOR_BUFFER_BIT}e&&(n|=ve.DEPTH_BUFFER_BIT),t&&(n|=ve.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",be,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",we,!1),se.dispose(),ae.dispose(),J.dispose(),Q.dispose(),ee.dispose(),re.dispose(),me.dispose(),ge.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Ae),xe.removeEventListener("sessionend",Ee),H&&(H.dispose(),H=null),Re.stop()},this.renderBufferDirect=function(e,t,n,r,i,o){null===t&&(t=j);const s=i.isMesh&&i.matrixWorld.determinant()<0,a=function(e,t,n,r,i){!0!==t.isScene&&(t=j);K.resetTextureUnits();const o=t.fog,s=r.isMeshStandardMaterial?t.environment:null,a=null===S?y.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Pf,l=(r.isMeshStandardMaterial?ee:Q).get(r.envMap||s),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color;let f=rp;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=y.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,_=J.get(r),x=m.state.lights;if(!0===F&&(!0===z||e!==C)){const t=e===C&&r.id===w;le.setState(r,e,t)}let b=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==x.state.version||_.outputColorSpace!==a||i.isBatchedMesh&&!1===_.batching?b=!0:i.isBatchedMesh||!0!==_.batching?i.isInstancedMesh&&!1===_.instancing?b=!0:i.isInstancedMesh||!0!==_.instancing?i.isSkinnedMesh&&!1===_.skinning?b=!0:i.isSkinnedMesh||!0!==_.skinning?i.isInstancedMesh&&!0===_.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===_.instancingColor&&null!==i.instanceColor||_.envMap!==l||!0===r.fog&&_.fog!==o?b=!0:void 0===_.numClippingPlanes||_.numClippingPlanes===le.numPlanes&&_.numIntersection===le.numIntersection?(_.vertexAlphas!==c||_.vertexTangents!==u||_.morphTargets!==h||_.morphNormals!==d||_.morphColors!==p||_.toneMapping!==f||!0===Y.isWebGL2&&_.morphTargetsCount!==v)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,_.__version=r.version);let M=_.currentProgram;!0===b&&(M=ke(r,t,i));let T=!1,A=!1,E=!1;const R=M.getUniforms(),L=_.uniforms;q.useProgram(M.program)&&(T=!0,A=!0,E=!0);r.id!==w&&(w=r.id,A=!0);if(T||C!==e){R.setValue(ve,"projectionMatrix",e.projectionMatrix),R.setValue(ve,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(ve,G.setFromMatrixPosition(e.matrixWorld)),Y.logarithmicDepthBuffer&&R.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&R.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),C!==e&&(C=e,A=!0,E=!0)}if(i.isSkinnedMesh){R.setOptional(ve,i,"bindMatrix"),R.setOptional(ve,i,"bindMatrixInverse");const e=i.skeleton;e&&(Y.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(ve,"boneTexture",e.boneTexture,K)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}i.isBatchedMesh&&(R.setOptional(ve,i,"batchingTexture"),R.setValue(ve,"batchingTexture",i._matricesTexture,K));const O=n.morphAttributes;(void 0!==O.position||void 0!==O.normal||void 0!==O.color&&!0===Y.isWebGL2)&&he.update(i,n,M);(A||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,R.setValue(ve,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(L.envMap.value=l,L.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);A&&(R.setValue(ve,"toneMappingExposure",y.toneMappingExposure),_.needsLights&&(B=E,(k=L).ambientLightColor.needsUpdate=B,k.lightProbe.needsUpdate=B,k.directionalLights.needsUpdate=B,k.directionalLightShadows.needsUpdate=B,k.pointLights.needsUpdate=B,k.pointLightShadows.needsUpdate=B,k.spotLights.needsUpdate=B,k.spotLightShadows.needsUpdate=B,k.rectAreaLights.needsUpdate=B,k.hemisphereLights.needsUpdate=B),o&&!0===r.fog&&oe.refreshFogUniforms(L,o),oe.refreshMaterialUniforms(L,r,I,P,H),Z_.upload(ve,Be(_),L,K));var k,B;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Z_.upload(ve,Be(_),L,K),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&R.setValue(ve,"center",i.center);if(R.setValue(ve,"modelViewMatrix",i.modelViewMatrix),R.setValue(ve,"normalMatrix",i.normalMatrix),R.setValue(ve,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++)if(Y.isWebGL2){const n=e[t];ge.update(n,M),ge.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}(e,t,n,r,i);q.setMaterial(r,s);let l=n.index,c=1;if(!0===r.wireframe){if(l=ne.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,h=n.attributes.position;let d=u.start*c,p=(u.start+u.count)*c;null!==o&&(d=Math.max(d,o.start*c),p=Math.min(p,(o.start+o.count)*c)),null!==l?(d=Math.max(d,0),p=Math.min(p,l.count)):null!=h&&(d=Math.max(d,0),p=Math.min(p,h.count));const f=p-d;if(f<0||f===1/0)return;let g;me.setup(i,r,a,n,l);let v=de;if(null!==l&&(g=te.get(l),v=pe,v.setIndex(g)),i.isMesh)!0===r.wireframe?(q.setLineWidth(r.wireframeLinewidth*X()),v.setMode(ve.LINES)):v.setMode(ve.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),q.setLineWidth(e*X()),i.isLineSegments?v.setMode(ve.LINES):i.isLineLoop?v.setMode(ve.LINE_LOOP):v.setMode(ve.LINE_STRIP)}else i.isPoints?v.setMode(ve.POINTS):i.isSprite&&v.setMode(ve.TRIANGLES);if(i.isBatchedMesh)v.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)v.renderInstances(d,f,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(d,f,t)}else v.render(d,f)},this.compile=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=e),m=ae.get(n),m.init(),v.push(m),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),m.setupLights(y._useLegacyLights);const r=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const o=t[i];Me(o,n,e),r.add(o)}else Me(t,n,e),r.add(t)})),v.pop(),m=null,r},this.compileAsync=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=this.compile(e,t,n);return new Promise((t=>{function n(){r.forEach((function(e){J.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==$.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Te=null;function Ae(){Re.stop()}function Ee(){Re.start()}const Re=new sy;function Le(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(W);const t=re.update(e),i=e.material;i.visible&&f.push(e,t,i,n,G.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||U.intersectsObject(e))){const t=re.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),G.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),G.copy(t.boundingSphere.center)),G.applyMatrix4(e.matrixWorld).applyMatrix4(W)),Array.isArray(i)){const r=t.groups;for(let o=0,s=r.length;o<s;o++){const s=r[o],a=i[s.materialIndex];a&&a.visible&&f.push(e,t,a,n,G.z,s)}}else i.visible&&f.push(e,t,i,n,G.z,null)}const i=e.children;for(let e=0,o=i.length;e<o;e++)Le(i[e],t,n,r)}function Pe(e,t,n,r){const i=e.opaque,o=e.transmissive,s=e.transparent;m.setupLightsView(n),!0===F&&le.setGlobalState(y.clippingPlanes,n),o.length>0&&function(e,t,n,r){const i=!0===n.isScene?n.overrideMaterial:null;if(null!==i)return;const o=Y.isWebGL2;null===H&&(H=new Lm(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?Pp:Tp,minFilter:Mp,samples:o?4:0}));y.getDrawingBufferSize(V),o?H.setSize(V.x,V.y):H.setSize(em(V.x),em(V.y));const s=y.getRenderTarget();y.setRenderTarget(H),y.getClearColor(E),R=y.getClearAlpha(),R<1&&y.setClearColor(16777215,.5);y.clear();const a=y.toneMapping;y.toneMapping=rp,Ie(e,n,r),K.updateMultisampleRenderTarget(H),K.updateRenderTargetMipmap(H);let l=!1;for(let e=0,i=t.length;e<i;e++){const i=t[e],o=i.object,s=i.geometry,a=i.material,c=i.group;if(2===a.side&&o.layers.test(r.layers)){const e=a.side;a.side=Zd,a.needsUpdate=!0,Oe(o,n,r,s,a,c),a.side=e,a.needsUpdate=!0,l=!0}}!0===l&&(K.updateMultisampleRenderTarget(H),K.updateRenderTargetMipmap(H));y.setRenderTarget(s),y.setClearColor(E,R),y.toneMapping=a}(i,o,t,n),r&&q.viewport(M.copy(r)),i.length>0&&Ie(i,t,n),o.length>0&&Ie(o,t,n),s.length>0&&Ie(s,t,n),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function Ie(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,o=e.length;i<o;i++){const o=e[i],s=o.object,a=o.geometry,l=null===r?o.material:r,c=o.group;s.layers.test(n.layers)&&Oe(s,t,n,a,l,c)}}function Oe(e,t,n,r,i,o){e.onBeforeRender(y,t,n,r,i,o),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(y,t,n,r,e,o),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=Zd,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,o),i.side=qd,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,o),i.side=2):y.renderBufferDirect(n,t,r,i,e,o),e.onAfterRender(y,t,n,r,i,o)}function ke(e,t,n){!0!==t.isScene&&(t=j);const r=J.get(e),i=m.state.lights,o=m.state.shadowsArray,s=i.state.version,a=ie.getParameters(e,i.state,o,t,n),l=ie.getProgramCacheKey(a);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ee:Q).get(e.envMap||r.environment),void 0===c&&(e.addEventListener("dispose",Ce),c=new Map,r.programs=c);let u=c.get(l);if(void 0!==u){if(r.currentProgram===u&&r.lightsStateVersion===s)return De(e,a),u}else a.uniforms=ie.getUniforms(e),e.onBuild(n,a,y),e.onBeforeCompile(a,y),u=ie.acquireProgram(a,l),c.set(l,u),r.uniforms=a.uniforms;const h=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=le.uniform),De(e,a),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=s,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=u,r.uniformsList=null,u}function Be(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=Z_.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function De(e,t){const n=J.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Re.setAnimationLoop((function(e){Te&&Te(e)})),"undefined"!=typeof self&&Re.setContext(self),this.setAnimationLoop=function(e){Te=e,xe.setAnimationLoop(e),null===e?Re.stop():Re.start()},xe.addEventListener("sessionstart",Ae),xe.addEventListener("sessionend",Ee),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===_)return;!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===xe.enabled&&!0===xe.isPresenting&&(!0===xe.cameraAutoUpdate&&xe.updateCamera(t),t=xe.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,S),m=ae.get(e,v.length),m.init(),v.push(m),W.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),U.setFromProjectionMatrix(W),z=this.localClippingEnabled,F=le.init(this.clippingPlanes,z),f=se.get(e,g.length),f.init(),g.push(f),Le(e,t,0,y.sortObjects),f.finish(),!0===y.sortObjects&&f.sort(O,k),this.info.render.frame++,!0===F&&le.beginShadows();const n=m.state.shadowsArray;if(ce.render(n,e,t),!0===F&&le.endShadows(),!0===this.info.autoReset&&this.info.reset(),ue.render(f,e),m.setupLights(y._useLegacyLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Pe(f,e,r,r.viewport)}}else Pe(f,e,t);null!==S&&(K.updateMultisampleRenderTarget(S),K.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(y,e,t),me.resetDefaultState(),w=-1,C=null,v.pop(),m=v.length>0?v[v.length-1]:null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){J.get(e.texture).__webglTexture=t,J.get(e.depthTexture).__webglTexture=n;const r=J.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=J.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;S=e,x=t,b=n;let r=!0,i=null,o=!1,s=!1;if(e){const a=J.get(e);void 0!==a.__useDefaultFramebuffer?(q.bindFramebuffer(ve.FRAMEBUFFER,null),r=!1):void 0===a.__webglFramebuffer?K.setupRenderTarget(e):a.__hasExternalTextures&&K.rebindTextures(e,J.get(e.texture).__webglTexture,J.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(s=!0);const c=J.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][n]:c[t],o=!0):i=Y.isWebGL2&&e.samples>0&&!1===K.useMultisampledRTT(e)?J.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,M.copy(e.viewport),T.copy(e.scissor),A=e.scissorTest}else M.copy(B).multiplyScalar(I).floor(),T.copy(D).multiplyScalar(I).floor(),A=N;if(q.bindFramebuffer(ve.FRAMEBUFFER,i)&&Y.drawBuffers&&r&&q.drawBuffers(e,i),q.viewport(M),q.scissor(T),q.setScissorTest(A),o){const r=J.get(e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(s){const r=J.get(e.texture),i=t||0;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}w=-1},this.readRenderTargetPixels=function(e,t,n,r,i,o,s){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=J.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){q.bindFramebuffer(ve.FRAMEBUFFER,a);try{const s=e.texture,a=s.format,l=s.type;if(a!==Bp&&fe.convert(a)!==ve.getParameter(ve.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Pp&&($.has("EXT_color_buffer_half_float")||Y.isWebGL2&&$.has("EXT_color_buffer_float"));if(!(l===Tp||fe.convert(l)===ve.getParameter(ve.IMPLEMENTATION_COLOR_READ_TYPE)||l===Lp&&(Y.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ve.readPixels(t,n,r,i,fe.convert(a),fe.convert(l),o)}finally{const e=null!==S?J.get(S).__webglFramebuffer:null;q.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r);K.setTexture2D(t,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,n,0,0,e.x,e.y,i,o),q.unbindTexture()},this.copyTextureToTexture=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=t.image.width,o=t.image.height,s=fe.convert(n.format),a=fe.convert(n.type);K.setTexture2D(n,0),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,n.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,r,e.x,e.y,i,o,s,a,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):ve.texSubImage2D(ve.TEXTURE_2D,r,e.x,e.y,s,a,t.image),0===r&&n.generateMipmaps&&ve.generateMipmap(ve.TEXTURE_2D),q.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(y.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=fe.convert(r.format),c=fe.convert(r.type);let u;if(r.isData3DTexture)K.setTexture3D(r,0),u=ve.TEXTURE_3D;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(r,0),u=ve.TEXTURE_2D_ARRAY}ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,r.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,r.unpackAlignment);const h=ve.getParameter(ve.UNPACK_ROW_LENGTH),d=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),p=ve.getParameter(ve.UNPACK_SKIP_PIXELS),f=ve.getParameter(ve.UNPACK_SKIP_ROWS),m=ve.getParameter(ve.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;ve.pixelStorei(ve.UNPACK_ROW_LENGTH,g.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,g.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,e.min.x),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,e.min.y),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?ve.texSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ve.compressedTexSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,g.data)):ve.texSubImage3D(u,i,t.x,t.y,t.z,o,s,a,l,c,g),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,h),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,d),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,p),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,f),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,m),0===i&&r.generateMipmaps&&ve.generateMipmap(u),q.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?K.setTextureCube(e,0):e.isData3DTexture?K.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?K.setTexture2DArray(e,0):K.setTexture2D(e,0),q.unbindTexture()},this.resetState=function(){x=0,b=0,S=null,q.reset(),me.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Wf}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===If?"display-p3":"srgb",t.unpackColorSpace=ym.workingColorSpace===Of?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Lf?Ef:Af}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ef?Lf:Pf}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class Gx extends Vx{}Gx.prototype.isWebGL1Renderer=!0;class jx{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;this.isFogExp2=!0,this.name="",this.color=new Kg(e),this.density=t}clone(){return new jx(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Xx{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.isFog=!0,this.name="",this.color=new Kg(e),this.near=t,this.far=n}clone(){return new Xx(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class $x extends Bg{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Yx{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Ff,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=qf()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=qf()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=qf()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const qx=new km;class Zx{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)qx.fromBufferAttribute(this,t),qx.applyMatrix4(e),this.setXYZ(t,qx.x,qx.y,qx.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qx.fromBufferAttribute(this,t),qx.applyNormalMatrix(e),this.setXYZ(t,qx.x,qx.y,qx.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qx.fromBufferAttribute(this,t),qx.transformDirection(e),this.setXYZ(t,qx.x,qx.y,qx.z);return this}setX(e,t){return this.normalized&&(t=nm(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=nm(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=nm(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=nm(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=tm(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=tm(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=tm(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=tm(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array),i=nm(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new uv(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Zx(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Jx extends tv{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Kg(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Kx;const Qx=new km,eb=new km,tb=new km,nb=new im,rb=new im,ib=new ug,ob=new km,sb=new km,ab=new km,lb=new im,cb=new im,ub=new im;class hb extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jx;if(super(),this.isSprite=!0,this.type="Sprite",void 0===Kx){Kx=new bv;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Yx(e,5);Kx.setIndex([0,1,2,0,2,3]),Kx.setAttribute("position",new Zx(t,3,0,!1)),Kx.setAttribute("uv",new Zx(t,2,3,!1))}this.geometry=Kx,this.material=e,this.center=new im(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),eb.setFromMatrixScale(this.matrixWorld),ib.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),tb.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&eb.multiplyScalar(-tb.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const o=this.center;db(ob.set(-.5,-.5,0),tb,o,eb,r,i),db(sb.set(.5,-.5,0),tb,o,eb,r,i),db(ab.set(.5,.5,0),tb,o,eb,r,i),lb.set(0,0),cb.set(1,0),ub.set(1,1);let s=e.ray.intersectTriangle(ob,sb,ab,!1,Qx);if(null===s&&(db(sb.set(-.5,.5,0),tb,o,eb,r,i),cb.set(0,1),s=e.ray.intersectTriangle(ob,ab,sb,!1,Qx),null===s))return;const a=e.ray.origin.distanceTo(Qx);a<e.near||a>e.far||t.push({distance:a,point:Qx.clone(),uv:$g.getInterpolation(Qx,ob,sb,ab,lb,cb,ub,new im),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 db(e,t,n,r,i,o){nb.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(rb.x=o*nb.x-i*nb.y,rb.y=i*nb.x+o*nb.y):rb.copy(nb),e.copy(t),e.x+=rb.x,e.y+=rb.y,e.applyMatrix4(ib)}const pb=new km,fb=new km;class mb extends Bg{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,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance,n.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=Math.abs(t);const r=this.levels;let i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){pb.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(pb);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){pb.setFromMatrixPosition(e.matrixWorld),fb.setFromMatrixPosition(this.matrixWorld);const n=pb.distanceTo(fb)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),!(n>=e))break;t[r-1].object.visible=!1,t[r].object.visible=!0}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,r=n.length;e<r;e++){const r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return t}}const gb=new km,vb=new Em,yb=new Em,_b=new km,xb=new ug,bb=new km,Sb=new tg,wb=new ug,Cb=new cg;class Mb extends Fv{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=cp,this.bindMatrix=new ug,this.bindMatrixInverse=new ug,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new Nm),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,bb),this.boundingBox.expandByPoint(bb)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new tg),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,bb),this.boundingSphere.expandByPoint(bb)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),Sb.copy(this.boundingSphere),Sb.applyMatrix4(r),!1!==e.ray.intersectsSphere(Sb)&&(wb.copy(r).invert(),Cb.copy(e.ray).applyMatrix4(wb),null!==this.boundingBox&&!1===Cb.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,Cb)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Em,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===cp?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===up?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;vb.fromBufferAttribute(r.attributes.skinIndex,e),yb.fromBufferAttribute(r.attributes.skinWeight,e),gb.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const r=yb.getComponent(e);if(0!==r){const i=vb.getComponent(e);xb.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(_b.copy(gb).applyMatrix4(xb),r)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class Tb extends Bg{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ab extends Am{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(null,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:xp,arguments.length>9&&void 0!==arguments[9]?arguments[9]:xp,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>10?arguments[10]:void 0,arguments.length>11?arguments[11]:void 0),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Eb=new ug,Rb=new ug;class Lb{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=qf(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new ug)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new ug;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){const i=e[r]?e[r].matrixWorld:Rb;Eb.multiplyMatrices(i,t[r]),Eb.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new Lb(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Ab(t,e,e,Bp,Lp);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new Tb),this.bones.push(i),this.boneInverses.push((new ug).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const o=n[r];e.boneInverses.push(o.toArray())}return e}}class Pb extends uv{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ib=new ug,Ob=new ug,kb=[],Bb=new Nm,Db=new ug,Nb=new Fv,Ub=new tg;class Fb extends Fv{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Pb(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,Db)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new Nm),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ib),Bb.copy(e.boundingBox).applyMatrix4(Ib),this.boundingBox.union(Bb)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new tg),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ib),Ub.copy(e.boundingSphere).applyMatrix4(Ib),this.boundingSphere.union(Ub)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Nb.geometry=this.geometry,Nb.material=this.material,void 0!==Nb.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),Ub.copy(this.boundingSphere),Ub.applyMatrix4(n),!1!==e.ray.intersectsSphere(Ub)))for(let i=0;i<r;i++){this.getMatrixAt(i,Ib),Ob.multiplyMatrices(n,Ib),Nb.matrixWorld=Ob,Nb.raycast(e,kb);for(let e=0,n=kb.length;e<n;e++){const n=kb[e];n.instanceId=i,n.object=this,t.push(n)}kb.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Pb(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function zb(e,t){return e.z-t.z}function Hb(e,t){return t.z-e.z}class Wb{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t){const n=this.pool,r=this.list;this.index>=n.length&&n.push({start:-1,count:-1,z:-1});const i=n[this.index];r.push(i),this.index++,i.start=e.start,i.count=e.count,i.z=t}reset(){this.list.length=0,this.index=0}}const Vb="batchId",Gb=new ug,jb=new ug,Xb=new ug,$b=new ug,Yb=new oy,qb=new Nm,Zb=new tg,Jb=new km,Kb=new Wb,Qb=new Fv,eS=[];function tS(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){const i=e.count;for(let o=0;o<i;o++)for(let i=0;i<r;i++)t.setComponent(o+n,i,e.getComponent(o,i))}else t.array.set(e.array,n*r);t.needsUpdate=!0}class nS extends Fv{get maxGeometryCount(){return this._maxGeometryCount}constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2*t,r=arguments.length>3?arguments[3]:void 0;super(new bv,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let e=Math.sqrt(4*this._maxGeometryCount);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new Ab(t,e,e,Bp,Lp);this._matricesTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxGeometryCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(const r in e.attributes){const i=e.getAttribute(r),{array:o,itemSize:s,normalized:a}=i,l=new o.constructor(n*s),c=new i.constructor(l,s,a);c.setUsage(i.usage),t.setAttribute(r,c)}if(null!==e.getIndex()){const e=n>65536?new Uint32Array(i):new Uint16Array(i);t.setIndex(new uv(e,1))}const o=r>65536?new Uint32Array(n):new Uint16Array(n);t.setAttribute(Vb,new uv(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(Vb))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Vb}"`);const t=this.geometry;if(Boolean(e.getIndex())!==Boolean(t.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(n===Vb)continue;if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Nm);const e=this._geometryCount,t=this.boundingBox,n=this._active;t.makeEmpty();for(let r=0;r<e;r++)!1!==n[r]&&(this.getMatrixAt(r,Gb),this.getBoundingBoxAt(r,qb).applyMatrix4(Gb),t.union(qb))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new tg);const e=this._geometryCount,t=this.boundingSphere,n=this._active;t.makeEmpty();for(let r=0;r<e;r++)!1!==n[r]&&(this.getMatrixAt(r,Gb),this.getBoundingSphereAt(r,Zb).applyMatrix4(Gb),t.union(Zb))}addGeometry(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let i=null;const o=this._reservedRanges,s=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(i=o[o.length-1]),r.vertexCount=-1===t?e.getAttribute("position").count:t,r.vertexStart=null===i?0:i.vertexStart+i.vertexCount;const l=e.getIndex(),c=null!==l;if(c&&(r.indexCount=-1===n?l.count:n,r.indexStart=null===i?0:i.indexStart+i.indexCount),-1!==r.indexStart&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const u=this._visibility,h=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;u.push(!0),h.push(!0);const f=this._geometryCount;this._geometryCount++,Xb.toArray(p,16*f),d.needsUpdate=!0,o.push(r),s.push({start:c?r.indexStart:r.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Nm,sphereInitialized:!1,sphere:new tg});const m=this.geometry.getAttribute(Vb);for(let e=0;e<r.vertexCount;e++)m.setX(r.vertexStart+e,f);return m.needsUpdate=!0,this.setGeometryAt(f,e),f}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,r=null!==n.getIndex(),i=n.getIndex(),o=t.getIndex(),s=this._reservedRanges[e];if(r&&o.count>s.indexCount||t.attributes.position.count>s.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=s.vertexStart,l=s.vertexCount;for(const e in n.attributes){if(e===Vb)continue;const r=t.getAttribute(e),i=n.getAttribute(e);tS(r,i,a);const o=r.itemSize;for(let e=r.count,t=l;e<t;e++){const t=a+e;for(let e=0;e<o;e++)i.setComponent(t,e,0)}i.needsUpdate=!0}if(r){const e=s.indexStart;for(let t=0;t<o.count;t++)i.setX(e+t,a+o.getX(t));for(let t=o.count,n=s.indexCount;t<n;t++)i.setX(e+t,a);i.needsUpdate=!0}const c=this._bounds[e];null!==t.boundingBox?(c.box.copy(t.boundingBox),c.boxInitialized=!0):c.boxInitialized=!1,null!==t.boundingSphere?(c.sphere.copy(t.boundingSphere),c.sphereInitialized=!0):c.sphereInitialized=!1;const u=this._drawRanges[e],h=t.getAttribute("position");return u.count=r?o.count:h.count,this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._active;return e>=t.length||!1===t[e]||(t[e]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(e,t){if(!1===this._active[e])return this;const n=this._bounds[e],r=n.box,i=this.geometry;if(!1===n.boxInitialized){r.makeEmpty();const t=i.index,o=i.attributes.position,s=this._drawRanges[e];for(let e=s.start,n=s.start+s.count;e<n;e++){let n=e;t&&(n=t.getX(n)),r.expandByPoint(Jb.fromBufferAttribute(o,n))}n.boxInitialized=!0}return t.copy(r),t}getBoundingSphereAt(e,t){if(!1===this._active[e])return this;const n=this._bounds[e],r=n.sphere,i=this.geometry;if(!1===n.sphereInitialized){r.makeEmpty(),this.getBoundingBoxAt(e,qb),qb.getCenter(r.center);const t=i.index,o=i.attributes.position,s=this._drawRanges[e];let a=0;for(let e=s.start,n=s.start+s.count;e<n;e++){let n=e;t&&(n=t.getX(n)),Jb.fromBufferAttribute(o,n),a=Math.max(a,r.center.distanceToSquared(Jb))}r.radius=Math.sqrt(a),n.sphereInitialized=!0}return t.copy(r),t}setMatrixAt(e,t){const n=this._active,r=this._matricesTexture,i=this._matricesTexture.image.data;return e>=this._geometryCount||!1===n[e]||(t.toArray(i,16*e),r.needsUpdate=!0),this}getMatrixAt(e,t){const n=this._active,r=this._matricesTexture.image.data;return e>=this._geometryCount||!1===n[e]?null:t.fromArray(r,16*e)}setVisibleAt(e,t){const n=this._visibility,r=this._active;return e>=this._geometryCount||!1===r[e]||n[e]===t||(n[e]=t,this._visibilityChanged=!0),this}getVisibleAt(e){const t=this._visibility,n=this._active;return!(e>=this._geometryCount||!1===n[e])&&t[e]}raycast(e,t){const n=this._visibility,r=this._active,i=this._drawRanges,o=this._geometryCount,s=this.matrixWorld,a=this.geometry;Qb.material=this.material,Qb.geometry.index=a.index,Qb.geometry.attributes=a.attributes,null===Qb.geometry.boundingBox&&(Qb.geometry.boundingBox=new Nm),null===Qb.geometry.boundingSphere&&(Qb.geometry.boundingSphere=new tg);for(let a=0;a<o;a++){if(!n[a]||!r[a])continue;const o=i[a];Qb.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(a,Qb.matrixWorld).premultiply(s),this.getBoundingBoxAt(a,Qb.geometry.boundingBox),this.getBoundingSphereAt(a,Qb.geometry.boundingSphere),Qb.raycast(e,eS);for(let e=0,n=eS.length;e<n;e++){const n=eS[e];n.object=this,n.batchId=a,t.push(n)}eS.length=0}Qb.material=null,Qb.geometry.index=null,Qb.geometry.attributes={},Qb.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map((e=>Gd({},e))),this._reservedRanges=e._reservedRanges.map((e=>Gd({},e))),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map((e=>({boxInitialized:e.boxInitialized,box:e.box.clone(),sphereInitialized:e.sphereInitialized,sphere:e.sphere.clone()}))),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),s=null===o?1:o.array.BYTES_PER_ELEMENT,a=this._visibility,l=this._multiDrawStarts,c=this._multiDrawCounts,u=this._drawRanges,h=this.perObjectFrustumCulled;h&&($b.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Yb.setFromProjectionMatrix($b,e.isWebGPURenderer?Vf:Wf));let d=0;if(this.sortObjects){jb.copy(this.matrixWorld).invert(),Jb.setFromMatrixPosition(n.matrixWorld).applyMatrix4(jb);for(let e=0,t=a.length;e<t;e++)if(a[e]){this.getMatrixAt(e,Gb),this.getBoundingSphereAt(e,Zb).applyMatrix4(Gb);let t=!1;if(h&&(t=!Yb.intersectsSphere(Zb)),!t){const t=Jb.distanceTo(Zb.center);Kb.push(u[e],t)}}const e=Kb.list,t=this.customSort;null===t?e.sort(i.transparent?Hb:zb):t.call(this,e,n);for(let t=0,n=e.length;t<n;t++){const n=e[t];l[d]=n.start*s,c[d]=n.count,d++}Kb.reset()}else for(let e=0,t=a.length;e<t;e++)if(a[e]){let t=!1;if(h&&(this.getMatrixAt(e,Gb),this.getBoundingSphereAt(e,Zb).applyMatrix4(Gb),t=!Yb.intersectsSphere(Zb)),!t){const t=u[e];l[d]=t.start*s,c[d]=t.count,d++}}this._multiDrawCount=d,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,i,o){this.onBeforeRender(e,null,r,i,o)}}class rS extends tv{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Kg(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const iS=new km,oS=new km,sS=new ug,aS=new cg,lS=new tg;class cS extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bv,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rS;super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)iS.fromBufferAttribute(t,e-1),oS.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=iS.distanceTo(oS);e.setAttribute("lineDistance",new pv(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),lS.copy(n.boundingSphere),lS.applyMatrix4(r),lS.radius+=i,!1===e.ray.intersectsSphere(lS))return;sS.copy(r).invert(),aS.copy(e.ray).applyMatrix4(sS);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new km,c=new km,u=new km,h=new km,d=this.isLineSegments?2:1,p=n.index,f=n.attributes.position;if(null!==p){for(let n=Math.max(0,o.start),r=Math.min(p.count,o.start+o.count)-1;n<r;n+=d){const r=p.getX(n),i=p.getX(n+1);l.fromBufferAttribute(f,r),c.fromBufferAttribute(f,i);if(aS.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const o=e.ray.origin.distanceTo(h);o<e.near||o>e.far||t.push({distance:o,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,o.start),r=Math.min(f.count,o.start+o.count)-1;n<r;n+=d){l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,n+1);if(aS.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(h);r<e.near||r>e.far||t.push({distance:r,point:u.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const uS=new km,hS=new km;class dS extends cS{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)uS.fromBufferAttribute(t,e),hS.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+uS.distanceTo(hS);e.setAttribute("lineDistance",new pv(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class pS extends cS{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class fS extends tv{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Kg(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const mS=new ug,gS=new cg,vS=new tg,yS=new km;class _S extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bv,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fS;super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),vS.copy(n.boundingSphere),vS.applyMatrix4(r),vS.radius+=i,!1===e.ray.intersectsSphere(vS))return;mS.copy(r).invert(),gS.copy(e.ray).applyMatrix4(mS);const s=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,o.start),i=Math.min(l.count,o.start+o.count);n<i;n++){const i=l.getX(n);yS.fromBufferAttribute(c,i),xS(yS,i,a,r,e,t,this)}}else{for(let n=Math.max(0,o.start),i=Math.min(c.count,o.start+o.count);n<i;n++)yS.fromBufferAttribute(c,n),xS(yS,n,a,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function xS(e,t,n,r,i,o,s){const a=gS.distanceSqToPoint(e);if(a<n){const n=new km;gS.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:s})}}class bS extends Am{constructor(e,t,n,r,i,o,s,a,l,c,u,h){super(null,o,s,a,l,c,r,i,u,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class SS{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let o;o=t||e*n[i-1];let s,a=0,l=i-1;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),s=n[r]-o,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,n[r]===o)return r/(i-1);const c=n[r];return(r+(o-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const o=this.getPoint(r),s=this.getPoint(i),a=t||(o.isVector2?new im:new km);return a.copy(s).sub(o).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new km,r=[],i=[],o=[],s=new km,a=new ug;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new km)}i[0]=new km,o[0]=new km;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),h=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],s),o[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),o[t]=o[t-1].clone(),s.crossVectors(r[t-1],r[t]),s.length()>Number.EPSILON){s.normalize();const e=Math.acos(Zf(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(a.makeRotationAxis(s,e))}o[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Zf(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(s.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(a.makeRotationAxis(r[n],t*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class wS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(e,t){const n=t||new im,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);const s=this.aStartAngle+e*i;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=a-this.aX,r=l-this.aY;a=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class CS extends wS{constructor(e,t,n,r,i,o){super(e,t,n,n,r,i,o),this.isArcCurve=!0,this.type="ArcCurve"}}function MS(){let e=0,t=0,n=0,r=0;function i(i,o,s,a){e=i,t=s,n=-3*i+3*o-2*s-a,r=2*i-2*o+s+a}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,s,a){let l=(t-e)/o-(n-e)/(o+s)+(n-t)/s,c=(n-t)/s-(r-t)/(s+a)+(r-n)/a;l*=s,c*=s,i(t,n,l,c)},calc:function(i){const o=i*i;return e+t*i+n*o+r*(o*i)}}}const TS=new km,AS=new MS,ES=new MS,RS=new MS;class LS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=this.points,r=n.length,i=(r-(this.closed?0:1))*e;let o,s,a=Math.floor(i),l=i-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:0===l&&a===r-1&&(a=r-2,l=1),this.closed||a>0?o=n[(a-1)%r]:(TS.subVectors(n[0],n[1]).add(n[0]),o=TS);const c=n[a%r],u=n[(a+1)%r];if(this.closed||a+2<r?s=n[(a+2)%r]:(TS.subVectors(n[r-1],n[r-2]).add(n[r-1]),s=TS),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(o.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(s),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),AS.initNonuniformCatmullRom(o.x,c.x,u.x,s.x,t,n,r),ES.initNonuniformCatmullRom(o.y,c.y,u.y,s.y,t,n,r),RS.initNonuniformCatmullRom(o.z,c.z,u.z,s.z,t,n,r)}else"catmullrom"===this.curveType&&(AS.initCatmullRom(o.x,c.x,u.x,s.x,this.tension),ES.initCatmullRom(o.y,c.y,u.y,s.y,this.tension),RS.initCatmullRom(o.z,c.z,u.z,s.z,this.tension));return t.set(AS.calc(l),ES.calc(l),RS.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new km).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function PS(e,t,n,r,i){const o=.5*(r-t),s=.5*(i-n),a=e*e;return(2*n-2*r+o+s)*(e*a)+(-3*n+3*r-2*o-s)*a+o*e+n}function IS(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function OS(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class kS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new im,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new im,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new im;super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im,n=this.v0,r=this.v1,i=this.v2,o=this.v3;return t.set(OS(e,n.x,r.x,i.x,o.x),OS(e,n.y,r.y,i.y,o.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class BS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new km,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new km;super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=this.v0,r=this.v1,i=this.v2,o=this.v3;return t.set(OS(e,n.x,r.x,i.x,o.x),OS(e,n.y,r.y,i.y,o.y),OS(e,n.z,r.z,i.z,o.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class DS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new im,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im;super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class NS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km;super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km).subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class US extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new im,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new im;super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im,n=this.v0,r=this.v1,i=this.v2;return t.set(IS(e,n.x,r.x,i.x),IS(e,n.y,r.y,i.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class FS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new km;super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km,n=this.v0,r=this.v1,i=this.v2;return t.set(IS(e,n.x,r.x,i.x),IS(e,n.y,r.y,i.y),IS(e,n.z,r.z,i.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class zS extends SS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im,n=this.points,r=(n.length-1)*e,i=Math.floor(r),o=r-i,s=n[0===i?i:i-1],a=n[i],l=n[i>n.length-2?n.length-1:i+1],c=n[i>n.length-3?n.length-1:i+2];return t.set(PS(o,s.x,a.x,l.x,c.x),PS(o,s.y,a.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new im).fromArray(n))}return this}}var HS=Object.freeze({__proto__:null,ArcCurve:CS,CatmullRomCurve3:LS,CubicBezierCurve:kS,CubicBezierCurve3:BS,EllipseCurve:wS,LineCurve:DS,LineCurve3:NS,QuadraticBezierCurve:US,QuadraticBezierCurve3:FS,SplineCurve:zS});class WS extends SS{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new HS[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,o=this.curves[i],s=o.getLength(),a=0===s?0:1-e/s;return o.getPointAt(a,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const o=i[r],s=o.isEllipseCurve?2*e:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,a=o.getPoints(s);for(let e=0;e<a.length;e++){const r=a[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new HS[n.type]).fromJSON(n))}return this}}class VS extends WS{constructor(e){super(),this.type="Path",this.currentPoint=new im,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new DS(this.currentPoint.clone(),new im(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new US(this.currentPoint.clone(),new im(e,t),new im(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,o){const s=new kS(this.currentPoint.clone(),new im(e,t),new im(n,r),new im(i,o));return this.curves.push(s),this.currentPoint.set(i,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new zS(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+s,t+a,n,r,i,o),this}absarc(e,t,n,r,i,o){return this.absellipse(e,t,n,n,r,i,o),this}ellipse(e,t,n,r,i,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,o,s,a),this}absellipse(e,t,n,r,i,o,s,a){const l=new wS(e,t,n,r,i,o,s,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class GS extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new im(0,-.5),new im(.5,0),new im(0,.5)],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Zf(r,0,2*Math.PI);const i=[],o=[],s=[],a=[],l=[],c=1/t,u=new km,h=new im,d=new km,p=new km,f=new km;let m=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case e.length-1:a.push(f.x,f.y,f.z);break;default:m=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let i=0;i<=t;i++){const d=n+i*c*r,p=Math.sin(d),f=Math.cos(d);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*p,u.y=e[n].y,u.z=e[n].x*f,o.push(u.x,u.y,u.z),h.x=i/t,h.y=n/(e.length-1),s.push(h.x,h.y);const r=a[3*n+0]*p,c=a[3*n+1],d=a[3*n+0]*f;l.push(r,c,d)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const r=t+n*e.length,o=r,s=r+e.length,a=r+e.length+1,l=r+1;i.push(o,s,l),i.push(a,l,s)}this.setIndex(i),this.setAttribute("position",new pv(o,3)),this.setAttribute("uv",new pv(s,2)),this.setAttribute("normal",new pv(l,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new GS(e.points,e.segments,e.phiStart,e.phiLength)}}class jS extends GS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;const i=new VS;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new jS(e.radius,e.length,e.capSegments,e.radialSegments)}}class XS extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],o=[],s=[],a=[],l=new km,c=new im;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let i=0,u=3;i<=t;i++,u+=3){const h=n+i/t*r;l.x=e*Math.cos(h),l.y=e*Math.sin(h),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/e+1)/2,c.y=(o[u+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new pv(o,3)),this.setAttribute("normal",new pv(s,3)),this.setAttribute("uv",new pv(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new XS(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class $S extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:s,thetaLength:a};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],u=[],h=[],d=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const i=p,o=new im,f=new km;let v=0;const y=!0===n?e:t,_=!0===n?1:-1;for(let e=1;e<=r;e++)u.push(0,m*_,0),h.push(0,_,0),d.push(.5,.5),p++;const x=p;for(let e=0;e<=r;e++){const t=e/r*a+s,n=Math.cos(t),i=Math.sin(t);f.x=y*i,f.y=m*_,f.z=y*n,u.push(f.x,f.y,f.z),h.push(0,_,0),o.x=.5*n+.5,o.y=.5*i*_+.5,d.push(o.x,o.y),p++}for(let e=0;e<r;e++){const t=i+e,r=x+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const o=new km,v=new km;let y=0;const _=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,y=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*a+s,l=Math.sin(i),f=Math.cos(i);v.x=y*l,v.y=-g*n+m,v.z=y*f,u.push(v.x,v.y,v.z),o.set(l,_,f).normalize(),h.push(o.x,o.y,o.z),d.push(t,1-g),c.push(p++)}f.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],o=f[t][e+1];c.push(n,r,o),c.push(r,i,o),y+=6}l.addGroup(g,y,0),g+=y}(),!1===o&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new pv(u,3)),this.setAttribute("normal",new pv(h,3)),this.setAttribute("uv",new pv(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $S(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class YS extends $S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,n,r,i,o,s),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:s}}static fromJSON(e){return new YS(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class qS extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],o=[];function s(e,t,n,r){const i=r+1,o=[];for(let r=0;r<=i;r++){o[r]=[];const s=e.clone().lerp(n,r/i),a=t.clone().lerp(n,r/i),l=i-r;for(let e=0;e<=l;e++)o[r][e]=0===e&&r===i?s:s.clone().lerp(a,e/l)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){const n=Math.floor(t/2);t%2==0?(a(o[e][n+1]),a(o[e+1][n]),a(o[e][n])):(a(o[e][n+1]),a(o[e+1][n+1]),a(o[e+1][n]))}}function a(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new km,r=new km,i=new km;for(let o=0;o<t.length;o+=3)l(t[o+0],n),l(t[o+1],r),l(t[o+2],i),s(n,r,i,e)}(r),function(e){const t=new km;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new km;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=u(e)/2/Math.PI+.5,s=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);o.push(r,1-s)}var t;(function(){const e=new km,t=new km,n=new km,r=new km,s=new im,a=new im,l=new im;for(let h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),s.set(o[d+0],o[d+1]),a.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=u(r);c(s,d+0,e,p),c(a,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<o.length;e+=6){const t=o[e+0],n=o[e+2],r=o[e+4],i=Math.max(t,n,r),s=Math.min(t,n,r);i>.9&&s<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.setAttribute("position",new pv(i,3)),this.setAttribute("normal",new pv(i.slice(),3)),this.setAttribute("uv",new pv(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qS(e.vertices,e.indices,e.radius,e.details)}}class ZS extends qS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ZS(e.radius,e.detail)}}const JS=new km,KS=new km,QS=new km,ew=new $g;class tw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,r=Math.pow(10,n),i=Math.cos($f*t),o=e.getIndex(),s=e.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let e=0;e<a;e+=3){o?(l[0]=o.getX(e),l[1]=o.getX(e+1),l[2]=o.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:a}=ew;if(t.fromBufferAttribute(s,l[0]),n.fromBufferAttribute(s,l[1]),a.fromBufferAttribute(s,l[2]),ew.getNormal(QS),u[0]=`${Math.round(t.x*r)},${Math.round(t.y*r)},${Math.round(t.z*r)}`,u[1]=`${Math.round(n.x*r)},${Math.round(n.y*r)},${Math.round(n.z*r)}`,u[2]=`${Math.round(a.x*r)},${Math.round(a.y*r)},${Math.round(a.z*r)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],r=u[t],o=ew[c[e]],s=ew[c[t]],a=`${n}_${r}`,p=`${r}_${n}`;p in h&&h[p]?(QS.dot(h[p].normal)<=i&&(d.push(o.x,o.y,o.z),d.push(s.x,s.y,s.z)),h[p]=null):a in h||(h[a]={index0:l[e],index1:l[t],normal:QS.clone()})}}for(const e in h)if(h[e]){const{index0:t,index1:n}=h[e];JS.fromBufferAttribute(s,t),KS.fromBufferAttribute(s,n),d.push(JS.x,JS.y,JS.z),d.push(KS.x,KS.y,KS.z)}this.setAttribute("position",new pv(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class nw extends VS{constructor(e){super(e),this.uuid=qf(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new VS).fromJSON(n))}return this}}const rw=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const r=t&&t.length,i=r?t[0]*n:e.length;let o=iw(e,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,d,p;if(r&&(o=function(e,t,n,r){const i=[];let o,s,a,l,c;for(o=0,s=t.length;o<s;o++)a=t[o]*r,l=o<s-1?t[o+1]*r:e.length,c=iw(e,a,l,r,!1),c===c.next&&(c.steiner=!0),i.push(mw(c));for(i.sort(hw),o=0;o<i.length;o++)n=dw(i[o],n);return n}(e,t,o,n)),e.length>80*n){a=c=e[0],l=u=e[1];for(let t=n;t<i;t+=n)h=e[t],d=e[t+1],h<a&&(a=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=0!==p?32767/p:0}return sw(o,s,n,a,l,p,0),s};function iw(e,t,n,r,i){let o,s;if(i===function(e,t,n,r){let i=0;for(let o=t,s=n-r;o<n;o+=r)i+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return i}(e,t,n,r)>0)for(o=t;o<n;o+=r)s=Mw(o,e[o],e[o+1],s);else for(o=n-r;o>=t;o-=r)s=Mw(o,e[o],e[o+1],s);return s&&_w(s,s.next)&&(Tw(s),s=s.next),s}function ow(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!_w(r,r.next)&&0!==yw(r.prev,r,r.next))r=r.next;else{if(Tw(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function sw(e,t,n,r,i,o,s){if(!e)return;!s&&o&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=fw(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,o,s,a,l,c=1;do{for(n=e,e=null,o=null,s=0;n;){for(s++,r=n,a=0,t=0;t<c&&(a++,r=r.nextZ,r);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(e,r,i,o);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,o?lw(e,r,i,o):aw(e))t.push(a.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),Tw(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?sw(e=cw(ow(e),t,n),t,n,r,i,o,2):2===s&&uw(e,t,n,r,i,o):sw(ow(e),t,n,r,i,o,1);break}}function aw(e){const t=e.prev,n=e,r=e.next;if(yw(t,n,r)>=0)return!1;const i=t.x,o=n.x,s=r.x,a=t.y,l=n.y,c=r.y,u=i<o?i<s?i:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=i>o?i>s?i:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c;let f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&gw(i,a,o,l,s,c,f.x,f.y)&&yw(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function lw(e,t,n,r){const i=e.prev,o=e,s=e.next;if(yw(i,o,s)>=0)return!1;const a=i.x,l=o.x,c=s.x,u=i.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,v=fw(p,f,t,n,r),y=fw(m,g,t,n,r);let _=e.prevZ,x=e.nextZ;for(;_&&_.z>=v&&x&&x.z<=y;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==s&&gw(a,u,l,h,c,d,_.x,_.y)&&yw(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==s&&gw(a,u,l,h,c,d,x.x,x.y)&&yw(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=v;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==s&&gw(a,u,l,h,c,d,_.x,_.y)&&yw(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==s&&gw(a,u,l,h,c,d,x.x,x.y)&&yw(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function cw(e,t,n){let r=e;do{const i=r.prev,o=r.next.next;!_w(i,o)&&xw(i,r,r.next,o)&&ww(i,o)&&ww(o,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),Tw(r),Tw(r.next),r=e=o),r=r.next}while(r!==e);return ow(r)}function uw(e,t,n,r,i,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&vw(s,e)){let a=Cw(s,e);return s=ow(s,s.next),a=ow(a,a.next),sw(s,t,n,r,i,o,0),void sw(a,t,n,r,i,o,0)}e=e.next}s=s.next}while(s!==e)}function hw(e,t){return e.x-t.x}function dw(e,t){const n=function(e,t){let n,r=t,i=-1/0;const o=e.x,s=e.y;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){const e=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=o&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===o))return n}r=r.next}while(r!==t);if(!n)return null;const a=n,l=n.x,c=n.y;let u,h=1/0;r=n;do{o>=r.x&&r.x>=l&&o!==r.x&&gw(s<c?o:i,s,l,c,s<c?i:o,s,r.x,r.y)&&(u=Math.abs(s-r.y)/(o-r.x),ww(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&pw(n,r)))&&(n=r,h=u)),r=r.next}while(r!==a);return n}(e,t);if(!n)return t;const r=Cw(n,e);return ow(r,r.next),ow(n,n.next)}function pw(e,t){return yw(e.prev,e,t.prev)<0&&yw(t.next,e,e.next)<0}function fw(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function mw(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function gw(e,t,n,r,i,o,s,a){return(i-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(r-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function vw(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xw(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ww(e,t)&&ww(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(yw(e.prev,e,t.prev)||yw(e,t.prev,t))||_w(e,t)&&yw(e.prev,e,e.next)>0&&yw(t.prev,t,t.next)>0)}function yw(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _w(e,t){return e.x===t.x&&e.y===t.y}function xw(e,t,n,r){const i=Sw(yw(e,t,n)),o=Sw(yw(e,t,r)),s=Sw(yw(n,r,e)),a=Sw(yw(n,r,t));return i!==o&&s!==a||(!(0!==i||!bw(e,n,t))||(!(0!==o||!bw(e,r,t))||(!(0!==s||!bw(n,e,r))||!(0!==a||!bw(n,t,r)))))}function bw(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Sw(e){return e>0?1:e<0?-1:0}function ww(e,t){return yw(e.prev,e,e.next)<0?yw(e,t,e.next)>=0&&yw(e,e.prev,t)>=0:yw(e,t,e.prev)<0||yw(e,e.next,t)<0}function Cw(e,t){const n=new Aw(e.i,e.x,e.y),r=new Aw(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Mw(e,t,n,r){const i=new Aw(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Tw(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 Aw(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Ew{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Ew.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Rw(e),Lw(n,e);let o=e.length;t.forEach(Rw);for(let e=0;e<t.length;e++)r.push(o),o+=t[e].length,Lw(n,t[e]);const s=rw(n,r);for(let e=0;e<s.length;e+=3)i.push(s.slice(e,e+3));return i}}function Rw(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Lw(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class Pw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nw([new im(.5,.5),new im(-.5,.5),new im(-.5,-.5),new im(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){o(e[t])}function o(e){const o=[],s=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let c=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:u-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const f=t.extrudePath,m=void 0!==t.UVGenerator?t.UVGenerator:Iw;let g,v,y,_,x,b=!1;f&&(g=f.getSpacedPoints(a),b=!0,c=!1,v=f.computeFrenetFrames(a,!1),y=new km,_=new km,x=new km),c||(p=0,u=0,h=0,d=0);const S=e.extractPoints(s);let w=S.shape;const C=S.holes;if(!Ew.isClockWise(w)){w=w.reverse();for(let e=0,t=C.length;e<t;e++){const t=C[e];Ew.isClockWise(t)&&(C[e]=t.reverse())}}const M=Ew.triangulateShape(w,C),T=w;for(let e=0,t=C.length;e<t;e++){const t=C[e];w=w.concat(t)}function A(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}const E=w.length,R=M.length;function L(e,t,n){let r,i,o;const s=e.x-t.x,a=e.y-t.y,l=n.x-e.x,c=n.y-e.y,u=s*s+a*a,h=s*c-a*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),p=t.x-a/h,f=t.y+s/h,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(s*c-a*l);r=p+s*m-e.x,i=f+a*m-e.y;const g=r*r+i*i;if(g<=2)return new im(r,i);o=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(r=-a,i=s,o=Math.sqrt(u)):(r=s,i=a,o=Math.sqrt(u/2))}return new im(r/o,i/o)}const P=[];for(let e=0,t=T.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),P[e]=L(T[e],T[n],T[r]);const I=[];let O,k=P.concat();for(let e=0,t=C.length;e<t;e++){const t=C[e];O=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[e]=L(t[e],t[r],t[i]);I.push(O),k=k.concat(O)}for(let e=0;e<p;e++){const t=e/p,n=u*Math.cos(t*Math.PI/2),r=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=T.length;e<t;e++){const t=A(T[e],P[e],r);N(t.x,t.y,-n)}for(let e=0,t=C.length;e<t;e++){const t=C[e];O=I[e];for(let e=0,i=t.length;e<i;e++){const i=A(t[e],O[e],r);N(i.x,i.y,-n)}}}const B=h+d;for(let e=0;e<E;e++){const t=c?A(w[e],k[e],B):w[e];b?(_.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),x.copy(g[0]).add(_).add(y),N(x.x,x.y,x.z)):N(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<E;t++){const n=c?A(w[t],k[t],B):w[t];b?(_.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),x.copy(g[e]).add(_).add(y),N(x.x,x.y,x.z)):N(n.x,n.y,l/a*e)}for(let e=p-1;e>=0;e--){const t=e/p,n=u*Math.cos(t*Math.PI/2),r=h*Math.sin(t*Math.PI/2)+d;for(let e=0,t=T.length;e<t;e++){const t=A(T[e],P[e],r);N(t.x,t.y,l+n)}for(let e=0,t=C.length;e<t;e++){const t=C[e];O=I[e];for(let e=0,i=t.length;e<i;e++){const i=A(t[e],O[e],r);b?N(i.x,i.y+g[a-1].y,g[a-1].x+n):N(i.x,i.y,l+n)}}}function D(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=a+2*p;e<n;e++){const n=E*e,o=E*(e+1);F(t+r+n,t+i+n,t+i+o,t+r+o)}}}function N(e,t,n){o.push(e),o.push(t),o.push(n)}function U(e,t,i){z(e),z(t),z(i);const o=r.length/3,s=m.generateTopUV(n,r,o-3,o-2,o-1);H(s[0]),H(s[1]),H(s[2])}function F(e,t,i,o){z(e),z(t),z(o),z(t),z(i),z(o);const s=r.length/3,a=m.generateSideWallUV(n,r,s-6,s-3,s-2,s-1);H(a[0]),H(a[1]),H(a[3]),H(a[1]),H(a[2]),H(a[3])}function z(e){r.push(o[3*e+0]),r.push(o[3*e+1]),r.push(o[3*e+2])}function H(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=E*e;for(let e=0;e<R;e++){const n=M[e];U(n[2]+t,n[1]+t,n[0]+t)}e=a+2*p,t=E*e;for(let e=0;e<R;e++){const n=M[e];U(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<R;e++){const t=M[e];U(t[2],t[1],t[0])}for(let e=0;e<R;e++){const t=M[e];U(t[0]+E*a,t[1]+E*a,t[2]+E*a)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;D(T,t),t+=T.length;for(let e=0,n=C.length;e<n;e++){const n=C[e];D(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new pv(r,3)),this.setAttribute("uv",new pv(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new HS[r.type]).fromJSON(r)),new Pw(n,e.options)}}const Iw={generateTopUV:function(e,t,n,r,i){const o=t[3*n],s=t[3*n+1],a=t[3*r],l=t[3*r+1],c=t[3*i],u=t[3*i+1];return[new im(o,s),new im(a,l),new im(c,u)]},generateSideWallUV:function(e,t,n,r,i,o){const s=t[3*n],a=t[3*n+1],l=t[3*n+2],c=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*o],g=t[3*o+1],v=t[3*o+2];return Math.abs(a-u)<Math.abs(s-c)?[new im(s,1-l),new im(c,1-h),new im(d,1-f),new im(m,1-v)]:[new im(a,1-l),new im(u,1-h),new im(p,1-f),new im(g,1-v)]}};class Ow extends qS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Ow(e.radius,e.detail)}}class kw extends qS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new kw(e.radius,e.detail)}}class Bw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},n=Math.max(3,n),r=Math.max(1,r);const s=[],a=[],l=[],c=[];let u=e;const h=(t-e)/r,d=new km,p=new im;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){const r=i+e/n*o;d.x=u*Math.cos(r),d.y=u*Math.sin(r),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,c.push(p.x,p.y)}u+=h}for(let e=0;e<r;e++){const t=e*(n+1);for(let e=0;e<n;e++){const r=e+t,i=r,o=r+n+1,a=r+n+2,l=r+1;s.push(i,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute("position",new pv(a,3)),this.setAttribute("normal",new pv(l,3)),this.setAttribute("uv",new pv(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bw(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Dw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nw([new im(0,.5),new im(-.5,-.5),new im(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],o=[];let s=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(s,a,t),s+=a,a=0;function l(e){const s=r.length/3,l=e.extractPoints(t);let c=l.shape;const u=l.holes;!1===Ew.isClockWise(c)&&(c=c.reverse());for(let e=0,t=u.length;e<t;e++){const t=u[e];!0===Ew.isClockWise(t)&&(u[e]=t.reverse())}const h=Ew.triangulateShape(c,u);for(let e=0,t=u.length;e<t;e++){const t=u[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];r.push(t.x,t.y,0),i.push(0,0,1),o.push(t.x,t.y)}for(let e=0,t=h.length;e<t;e++){const t=h[e],r=t[0]+s,i=t[1]+s,o=t[2]+s;n.push(r,i,o),a+=3}}this.setIndex(n),this.setAttribute("position",new pv(r,3)),this.setAttribute("normal",new pv(i,3)),this.setAttribute("uv",new pv(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new Dw(n,e.curveSegments)}}class Nw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:s},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const a=Math.min(o+s,Math.PI);let l=0;const c=[],u=new km,h=new km,d=[],p=[],f=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let y=0;0===d&&0===o?y=.5/t:d===n&&a===Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const a=n/t;u.x=-e*Math.cos(r+a*i)*Math.sin(o+v*s),u.y=e*Math.cos(o+v*s),u.z=e*Math.sin(r+a*i)*Math.sin(o+v*s),p.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(a+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=c[e][r+1],i=c[e][r],s=c[e+1][r],l=c[e+1][r+1];(0!==e||o>0)&&d.push(t,i,l),(e!==n-1||a<Math.PI)&&d.push(i,s,l)}this.setIndex(d),this.setAttribute("position",new pv(p,3)),this.setAttribute("normal",new pv(f,3)),this.setAttribute("uv",new pv(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nw(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Uw extends qS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Uw(e.radius,e.detail)}}class Fw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const o=[],s=[],a=[],l=[],c=new km,u=new km,h=new km;for(let o=0;o<=n;o++)for(let d=0;d<=r;d++){const p=d/r*i,f=o/n*Math.PI*2;u.x=(e+t*Math.cos(f))*Math.cos(p),u.y=(e+t*Math.cos(f))*Math.sin(p),u.z=t*Math.sin(f),s.push(u.x,u.y,u.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),h.subVectors(u,c).normalize(),a.push(h.x,h.y,h.z),l.push(d/r),l.push(o/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,s=(r+1)*(e-1)+t,a=(r+1)*e+t;o.push(n,i,a),o.push(i,s,a)}this.setIndex(o),this.setAttribute("position",new pv(s,3)),this.setAttribute("normal",new pv(a,3)),this.setAttribute("uv",new pv(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fw(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class zw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],l=[],c=[],u=new km,h=new km,d=new km,p=new km,f=new km,m=new km,g=new km;for(let s=0;s<=n;++s){const y=s/n*i*Math.PI*2;v(y,i,o,e,d),v(y+.01,i,o,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,o=-t*Math.cos(i),p=t*Math.sin(i);u.x=d.x+(o*g.x+p*f.x),u.y=d.y+(o*g.y+p*f.y),u.z=d.z+(o*g.z+p*f.z),a.push(u.x,u.y,u.z),h.subVectors(u,d).normalize(),l.push(h.x,h.y,h.z),c.push(s/n),c.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),o=(r+1)*e+t,a=(r+1)*(e-1)+t;s.push(n,i,a),s.push(i,o,a)}function v(e,t,n,r,i){const o=Math.cos(e),s=Math.sin(e),a=n/t*e,l=Math.cos(a);i.x=r*(2+l)*.5*o,i.y=r*(2+l)*s*.5,i.z=r*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new pv(a,3)),this.setAttribute("normal",new pv(l,3)),this.setAttribute("uv",new pv(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zw(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Hw extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new FS(new km(-1,-1,0),new km(-1,1,0),new km(1,1,0)),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new km,a=new km,l=new im;let c=new km;const u=[],h=[],d=[],p=[];function f(i){c=e.getPointAt(i/t,c);const l=o.normals[i],d=o.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),o=-Math.cos(t);a.x=o*l.x+i*d.x,a.y=o*l.y+i*d.y,a.z=o*l.z+i*d.z,a.normalize(),h.push(a.x,a.y,a.z),s.x=c.x+n*a.x,s.y=c.y+n*a.y,s.z=c.z+n*a.z,u.push(s.x,s.y,s.z)}}!function(){for(let e=0;e<t;e++)f(e);f(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),o=(r+1)*e+t,s=(r+1)*(e-1)+t;p.push(n,i,s),p.push(i,o,s)}}()}(),this.setIndex(p),this.setAttribute("position",new pv(u,3)),this.setAttribute("normal",new pv(h,3)),this.setAttribute("uv",new pv(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Hw((new HS[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Ww extends bv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new km,i=new km;if(null!==e.index){const o=e.attributes.position,s=e.index;let a=e.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=a.length;e<l;++e){const l=a[e],c=l.start;for(let e=c,a=c+l.count;e<a;e+=3)for(let a=0;a<3;a++){const l=s.getX(e+a),c=s.getX(e+(a+1)%3);r.fromBufferAttribute(o,l),i.fromBufferAttribute(o,c),!0===Vw(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const o=e.attributes.position;for(let e=0,s=o.count/3;e<s;e++)for(let s=0;s<3;s++){const a=3*e+s,l=3*e+(s+1)%3;r.fromBufferAttribute(o,a),i.fromBufferAttribute(o,l),!0===Vw(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new pv(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Vw(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var Gw=Object.freeze({__proto__:null,BoxGeometry:Hv,CapsuleGeometry:jS,CircleGeometry:XS,ConeGeometry:YS,CylinderGeometry:$S,DodecahedronGeometry:ZS,EdgesGeometry:tw,ExtrudeGeometry:Pw,IcosahedronGeometry:Ow,LatheGeometry:GS,OctahedronGeometry:kw,PlaneGeometry:ly,PolyhedronGeometry:qS,RingGeometry:Bw,ShapeGeometry:Dw,SphereGeometry:Nw,TetrahedronGeometry:Uw,TorusGeometry:Fw,TorusKnotGeometry:zw,TubeGeometry:Hw,WireframeGeometry:Ww});class jw extends tv{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Kg(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class Xw extends Xv{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class $w extends tv{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Kg(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Yw extends $w{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new im(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Zf(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Kg(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Kg(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Kg(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=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 sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=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.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class qw extends tv{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Kg(16777215),this.specular=new Kg(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ep,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}}class Zw extends tv{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Kg(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(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}}class Jw extends tv{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class Kw extends tv{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Kg(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kg(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ep,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}}class Qw extends tv{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Kg(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new im(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}}class eC extends rS{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 tC(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function nC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rC(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n}function iC(e,t,n){const r=e.length,i=new e.constructor(r);for(let o=0,s=0;s!==r;++o){const r=n[o]*t;for(let n=0;n!==t;++n)i[s++]=e[r+n]}return i}function oC(e,t,n,r){let i=1,o=e[0];for(;void 0!==o&&void 0===o[r];)o=e[i++];if(void 0===o)return;let s=o[r];if(void 0!==s)if(Array.isArray(s))do{s=o[r],void 0!==s&&(t.push(o.time),n.push.apply(n,s)),o=e[i++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[r],void 0!==s&&(t.push(o.time),s.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{s=o[r],void 0!==s&&(t.push(o.time),n.push(s)),o=e[i++]}while(void 0!==o)}const sC={convertArray:tC,isTypedArray:nC,getKeyframeOrder:rC,sortedArray:iC,flattenJSON:oC,subclip:function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;const o=e.clone();o.name=t;const s=[];for(let e=0;e<o.tracks.length;++e){const t=o.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const o=t.times[e]*i;if(!(o<n||o>=r)){l.push(t.times[e]);for(let n=0;n<a;++n)c.push(t.values[e*a+n])}}0!==l.length&&(t.times=tC(l,t.times.constructor),t.values=tC(c,t.values.constructor),s.push(t))}o.tracks=s;let a=1/0;for(let e=0;e<o.tracks.length;++e)a>o.tracks[e].times[0]&&(a=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);const i=n.tracks.length,o=t/r;for(let t=0;t<i;++t){const r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const s=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===s)continue;let a=0;const l=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=r.times.length-1;let d;if(o<=r.times[0]){const e=a,t=l-a;d=r.values.slice(e,t)}else if(o>=r.times[h]){const e=h*l+a,t=e+l-a;d=r.values.slice(e,t)}else{const e=r.createInterpolant(),t=a,n=l-a;e.evaluate(o),d=e.resultBuffer.slice(t,n)}if("quaternion"===i){(new Om).fromArray(d).normalize().conjugate().toArray(d)}const p=s.times.length;for(let e=0;e<p;++e){const t=e*u+c;if("quaternion"===i)Om.multiplyQuaternionsFlat(s.values,t,d,0,s.values,t);else{const e=u-2*c;for(let n=0;n<e;++n)s.values[t+n]-=d[n]}}}return e.blendMode=Tf,e}};class aC{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let o;n:{r:if(!(e<r)){for(let o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(i=r,r=t[++n],e<r)break t}o=t.length;break n}if(e>=i)break e;{const s=t[1];e<s&&(n=2,i=s);for(let o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===o)break;if(r=i,i=t[--n-1],e>=i)break t}o=n,n=0}}for(;n<o;){const r=n+o>>>1;e<t[r]?o=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class lC extends aC{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Sf,endingEnd:Sf}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,o=e+1,s=r[i],a=r[o];if(void 0===s)switch(this.getSettings_().endingStart){case wf:i=e,s=2*t-n;break;case Cf:i=r.length-2,s=t+r[i]-r[i+1];break;default:i=e,s=n}if(void 0===a)switch(this.getSettings_().endingEnd){case wf:o=e,a=2*n-t;break;case Cf:o=1,a=n+r[1]-r[0];break;default:o=e-1,a=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(a-n),this._offsetPrev=i*c,this._offsetNext=o*c}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,_=d*m-d*f;for(let e=0;e!==s;++e)i[e]=g*o[c+e]+v*o[l+e]+y*o[a+e]+_*o[u+e];return i}}class cC extends aC{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=e*s,l=a-s,c=(n-t)/(r-t),u=1-c;for(let e=0;e!==s;++e)i[e]=o[l+e]*u+o[a+e]*c;return i}}class uC extends aC{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class hC{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=tC(t,this.TimeBufferType),this.values=tC(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:tC(e.times,Array),values:tC(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new uC(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new cC(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new lC(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case _f:t=this.InterpolantFactoryMethodDiscrete;break;case xf:t=this.InterpolantFactoryMethodLinear;break;case bf:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _f;case this.InterpolantFactoryMethodLinear:return xf;case this.InterpolantFactoryMethodSmooth:return bf}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,o=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const e=this.getValueSize();this.times=n.slice(i,o),this.values=this.values.slice(i*e,o*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,o),e=!1;break}o=r}if(void 0!==r&&nC(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===bf,i=e.length-1;let o=1;for(let s=1;s<i;++s){let i=!1;const a=e[s];if(a!==e[s+1]&&(1!==s||a!==e[0]))if(r)i=!0;else{const e=s*n,r=e-n,o=e+n;for(let s=0;s!==n;++s){const n=t[e+s];if(n!==t[r+s]||n!==t[o+s]){i=!0;break}}}if(i){if(s!==o){e[o]=e[s];const r=s*n,i=o*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++o}}if(i>0){e[o]=e[i];for(let e=i*n,r=o*n,s=0;s!==n;++s)t[r+s]=t[e+s];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}hC.prototype.TimeBufferType=Float32Array,hC.prototype.ValueBufferType=Float32Array,hC.prototype.DefaultInterpolation=xf;class dC extends hC{}dC.prototype.ValueTypeName="bool",dC.prototype.ValueBufferType=Array,dC.prototype.DefaultInterpolation=_f,dC.prototype.InterpolantFactoryMethodLinear=void 0,dC.prototype.InterpolantFactoryMethodSmooth=void 0;class pC extends hC{}pC.prototype.ValueTypeName="color";class fC extends hC{}fC.prototype.ValueTypeName="number";class mC extends aC{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-t)/(r-t);let l=e*s;for(let e=l+s;l!==e;l+=4)Om.slerpFlat(i,0,o,l-s,o,l,a);return i}}class gC extends hC{InterpolantFactoryMethodLinear(e){return new mC(this.times,this.values,this.getValueSize(),e)}}gC.prototype.ValueTypeName="quaternion",gC.prototype.DefaultInterpolation=xf,gC.prototype.InterpolantFactoryMethodSmooth=void 0;class vC extends hC{}vC.prototype.ValueTypeName="string",vC.prototype.ValueBufferType=Array,vC.prototype.DefaultInterpolation=_f,vC.prototype.InterpolantFactoryMethodLinear=void 0,vC.prototype.InterpolantFactoryMethodSmooth=void 0;class yC extends hC{}yC.prototype.ValueTypeName="vector";class _C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mf;this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=qf(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(xC(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(hC.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,o=[];for(let e=0;e<i;e++){let s=[],a=[];s.push((e+i-1)%i,e,(e+1)%i),a.push(0,1,0);const l=rC(s);s=iC(s,1,l),a=iC(a,1,l),r||0!==s[0]||(s.push(i),a.push(a[0])),o.push(new fC(".morphTargetInfluences["+t[e].name+"]",s,a).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],o=n.name.match(i);if(o&&o.length>1){const e=o[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const o=[];for(const e in r)o.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const o=[],s=[];oC(n,o,s,r),0!==o.length&&i.push(new e(t,o,s))}},r=[],i=e.name||"default",o=e.fps||30,s=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(const n in e){const e=[],o=[];for(let r=0;r!==i[t].morphTargets.length;++r){const r=i[t];e.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new fC(".morphTargetInfluence["+n+"]",e,o))}a=e.length*o}else{const o=".bones["+t[e].name+"]";n(yC,o+".position",i,"pos",r),n(gC,o+".quaternion",i,"rot",r),n(yC,o+".scale",i,"scl",r)}}if(0===r.length)return null;return new this(i,a,r,s)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function xC(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return fC;case"vector":case"vector2":case"vector3":case"vector4":return yC;case"color":return pC;case"quaternion":return gC;case"bool":case"boolean":return dC;case"string":return vC}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];oC(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const bC={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class SC{constructor(e,t,n){const r=this;let i,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===o&&void 0!==r.onStart&&r.onStart(e,s,a),o=!0},this.itemEnd=function(e){s++,void 0!==r.onProgress&&r.onProgress(e,s,a),s===a&&(o=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const wC=new SC;class CC{constructor(e){this.manager=void 0!==e?e:wC,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}CC.DEFAULT_MATERIAL_NAME="__DEFAULT";const MC={};class TC extends Error{constructor(e,t){super(e),this.response=t}}class AC extends CC{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=bC.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==MC[e])return void MC[e].push({onLoad:t,onProgress:n,onError:r});MC[e]=[],MC[e].push({onLoad:t,onProgress:n,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,a=this.responseType;fetch(o).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=MC[e],r=t.body.getReader(),i=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),o=i?parseInt(i):0,s=0!==o;let a=0;const l=new ReadableStream({start(e){!function t(){r.read().then((r=>{let{done:i,value:l}=r;if(i)e.close();else{a+=l.byteLength;const r=new ProgressEvent("progress",{lengthComputable:s,loaded:a,total:o});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(l),t()}}))}()}});return new Response(l)}throw new TC(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)})).then((e=>{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,s)));case"json":return e.json();default:if(void 0===s)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(s),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{bC.add(e,t);const n=MC[e];delete MC[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=MC[e];if(void 0===n)throw this.manager.itemError(e),t;delete MC[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class EC extends CC{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=bC.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const s=um("img");function a(){c(),bC.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),i.manager.itemStart(e),s.src=e,s}}class RC extends Bg{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.isLight=!0,this.type="Light",this.color=new Kg(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}class LC extends RC{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Bg.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Kg(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const PC=new ug,IC=new km,OC=new km;class kC{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new im(512,512),this.map=null,this.mapPass=null,this.matrix=new ug,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new oy,this._frameExtents=new im(1,1),this._viewportCount=1,this._viewports=[new Em(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;IC.setFromMatrixPosition(e.matrixWorld),t.position.copy(IC),OC.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(OC),t.updateMatrixWorld(),PC.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(PC),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(PC)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class BC extends kC{constructor(){super(new Yv(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*Yf*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class DC extends RC{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2;super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Bg.DEFAULT_UP),this.updateMatrix(),this.target=new Bg,this.distance=n,this.angle=r,this.penumbra=i,this.decay=o,this.map=null,this.shadow=new BC}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const NC=new ug,UC=new km,FC=new km;class zC extends kC{constructor(){super(new Yv(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new im(4,2),this._viewportCount=6,this._viewports=[new Em(2,1,1,1),new Em(0,1,1,1),new Em(3,1,1,1),new Em(1,1,1,1),new Em(3,0,1,1),new Em(1,0,1,1)],this._cubeDirections=[new km(1,0,0),new km(-1,0,0),new km(0,0,1),new km(0,0,-1),new km(0,1,0),new km(0,-1,0)],this._cubeUps=[new km(0,1,0),new km(0,1,0),new km(0,1,0),new km(0,1,0),new km(0,0,1),new km(0,0,-1)]}updateMatrices(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),UC.setFromMatrixPosition(e.matrixWorld),n.position.copy(UC),FC.copy(n.position),FC.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(FC),n.updateMatrixWorld(),r.makeTranslation(-UC.x,-UC.y,-UC.z),NC.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(NC)}}class HC extends RC{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new zC}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class WC extends kC{constructor(){super(new _y(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class VC extends RC{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Bg.DEFAULT_UP),this.updateMatrix(),this.target=new Bg,this.shadow=new WC}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class GC extends RC{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class jC extends RC{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class XC{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new km)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class $C extends RC{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new XC;super(void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class YC extends CC{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,o=new AC(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=YC.createMaterialFromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new Kg).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(r.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(r.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(r.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(r.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(r.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(r.depthFunc=e.depthFunc),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(r.blendSrc=e.blendSrc),void 0!==e.blendDst&&(r.blendDst=e.blendDst),void 0!==e.blendEquation&&(r.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(r.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(r.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(r.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(r.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),void 0!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(r.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new Kg).setHex(i.value);break;case"v2":r.uniforms[t].value=(new im).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new km).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new Em).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new om).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new ug).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(r.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(r.lights=e.lights),void 0!==e.clipping&&(r.clipping=e.clipping),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new im).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new im).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(r.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.anisotropyMap&&(r.anisotropyMap=n(e.anisotropyMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:jw,SpriteMaterial:Jx,RawShaderMaterial:Xw,ShaderMaterial:Xv,PointsMaterial:fS,MeshPhysicalMaterial:Yw,MeshStandardMaterial:$w,MeshPhongMaterial:qw,MeshToonMaterial:Zw,MeshNormalMaterial:Jw,MeshLambertMaterial:Kw,MeshDepthMaterial:Lx,MeshDistanceMaterial:Px,MeshBasicMaterial:nv,MeshMatcapMaterial:Qw,LineDashedMaterial:eC,LineBasicMaterial:rS,Material:tv}[e]}}class qC{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class ZC extends bv{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class JC extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],o=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers,i=r[t],o=new Uint32Array(i).buffer;return n[t]=o,o}(e,i.buffer),s=cm(i.type,o),a=new Yx(s,i.stride);return a.uuid=i.uuid,t[r]=a,a}const i=e.isInstancedBufferGeometry?new ZC:new bv,o=e.data.index;if(void 0!==o){const e=cm(o.type,o.array);i.setIndex(new uv(e,1))}const s=e.data.attributes;for(const t in s){const n=s[t];let o;if(n.isInterleavedBufferAttribute){const t=r(e.data,n.data);o=new Zx(t,n.itemSize,n.offset,n.normalized)}else{const e=cm(n.type,n.array);o=new(n.isInstancedBufferAttribute?Pb:uv)(e,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),void 0!==n.usage&&o.setUsage(n.usage),i.setAttribute(t,o)}const a=e.data.morphAttributes;if(a)for(const t in a){const n=a[t],o=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];let s;if(i.isInterleavedBufferAttribute){const t=r(e.data,i.data);s=new Zx(t,i.itemSize,i.offset,i.normalized)}else{const e=cm(i.type,i.array);s=new uv(e,i.itemSize,i.normalized)}void 0!==i.name&&(s.name=i.name),o.push(s)}i.morphAttributes[t]=o}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];i.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new km;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new tg(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}const KC={UVMapping:hp,CubeReflectionMapping:dp,CubeRefractionMapping:pp,EquirectangularReflectionMapping:fp,EquirectangularRefractionMapping:mp,CubeUVReflectionMapping:gp},QC={RepeatWrapping:vp,ClampToEdgeWrapping:yp,MirroredRepeatWrapping:_p},eM={NearestFilter:xp,NearestMipmapNearestFilter:bp,NearestMipmapLinearFilter:Sp,LinearFilter:wp,LinearMipmapNearestFilter:Cp,LinearMipmapLinearFilter:Mp};let tM;class nM{static getContext(){return void 0===tM&&(tM=new(window.AudioContext||window.webkitAudioContext)),tM}static setContext(e){tM=e}}const rM=new ug,iM=new ug,oM=new ug;class sM{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=aM(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=aM();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function aM(){return("undefined"==typeof performance?Date:performance).now()}const lM=new km,cM=new Om,uM=new km,hM=new km;class dM extends Bg{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const pM=new km,fM=new Om,mM=new km,gM=new km;class vM{constructor(e,t,n){let r,i,o;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let o=this.cumulativeWeight;if(0===o){for(let e=0;e!==r;++e)n[i+e]=n[e];o=t}else{o+=t;const e=t/o;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){s.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}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 n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Om.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const o=this._workIndex*i;Om.multiplyQuaternionsFlat(e,o,e,t,e,n),Om.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,n,r,i){const o=1-r;for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]*o+e[n+s]*r}}_lerpAdditive(e,t,n,r,i){for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]+e[n+o]*r}}}const yM="\\[\\]\\.:\\/",_M=new RegExp("["+yM+"]","g"),xM="[^"+yM+"]",bM="[^"+yM.replace("\\.","")+"]",SM=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",xM)+/(WCOD+)?/.source.replace("WCOD",bM)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xM)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xM)+"$"),wM=["material","materials","bones","map"];class CM{constructor(e,t,n){this.path=t,this.parsedPath=n||CM.parseTrackName(t),this.node=CM.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new CM.Composite(e,t,n):new CM(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(_M,"")}static parseTrackName(e){const t=SM.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==wM.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const o=n(i.children);if(o)return o}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=CM.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const o=e[r];if(void 0===o){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}CM.Composite=class{constructor(e,t,n){const r=n||CM.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},CM.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},CM.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},CM.prototype.GetterByBindingType=[CM.prototype._getValue_direct,CM.prototype._getValue_array,CM.prototype._getValue_arrayElement,CM.prototype._getValue_toArray],CM.prototype.SetterByBindingTypeAndVersioning=[[CM.prototype._setValue_direct,CM.prototype._setValue_direct_setNeedsUpdate,CM.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[CM.prototype._setValue_array,CM.prototype._setValue_array_setNeedsUpdate,CM.prototype._setValue_array_setMatrixWorldNeedsUpdate],[CM.prototype._setValue_arrayElement,CM.prototype._setValue_arrayElement_setNeedsUpdate,CM.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[CM.prototype._setValue_fromArray,CM.prototype._setValue_fromArray_setNeedsUpdate,CM.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class MM{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,o=i.length,s=new Array(o),a={endingStart:Sf,endingEnd:Sf};for(let e=0;e!==o;++e){const t=i[e].createInterpolant(null);s[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,o=n/r;e.warp(1,i,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=r._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=i,a[1]=i+n,l[0]=e/o,l[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);const o=this._updateTime(t),s=this._updateWeight(e);if(s>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===Tf)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(o),t[n].accumulateAdditive(s);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(o),t[n].accumulate(r,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=wf,r.endingEnd=wf):(r.endingStart=e?this.zeroSlopeAtStart?wf:Sf:Cf,r.endingEnd=t?this.zeroSlopeAtEnd?wf:Sf:Cf)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=i,a[0]=t,s[1]=i+e,a[1]=n,this}}const TM=new Float32Array(1);class AM{constructor(e){this.value=e}clone(){return new AM(void 0===this.value.clone?this.value:this.value.clone())}}let EM=0;function RM(e,t){return e.distance-t.distance}function LM(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)LM(r[e],t,n,!0)}}const PM=new im;const IM=new km,OM=new km;const kM=new km;const BM=new km,DM=new ug,NM=new ug;function UM(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,UM(e.children[n]));return t}const FM=new km,zM=new Kg,HM=new Kg;class WM extends dS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;n=new Kg(n),r=new Kg(r);const i=t/2,o=e/t,s=e/2,a=[],l=[];for(let e=0,c=0,u=-s;e<=t;e++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new bv;c.setAttribute("position",new pv(a,3)),c.setAttribute("color",new pv(l,3));super(c,new rS({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const VM=new km,GM=new km,jM=new km;const XM=new km,$M=new $v;function YM(e,t,n,r,i,o,s){XM.set(i,o,s).unproject(r);const a=t[e];if(void 0!==a){const e=n.getAttribute("position");for(let t=0,n=a.length;t<n;t++)e.setXYZ(a[t],XM.x,XM.y,XM.z)}}const qM=new Nm;const ZM=new km;let JM,KM;class QM extends dS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new bv;n.setAttribute("position",new pv(t,3)),n.setAttribute("color",new pv([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new rS({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new Kg,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:jd}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=jd);var eT=Object.freeze({__proto__:null,ACESFilmicToneMapping:ap,AddEquation:Jd,AddOperation:np,AdditiveAnimationBlendMode:Tf,AdditiveBlending:2,AlphaFormat:1021,AlwaysCompare:519,AlwaysDepth:1,AlwaysStencilFunc:519,AmbientLight:GC,AnimationAction:MM,AnimationClip:_C,AnimationLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=_C.parse(e[n]);t.push(r)}return t}},AnimationMixer:class extends Gf{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,s=e._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let u=c[l];if(void 0!==u)++u.referenceCount,o[e]=u;else{if(u=o[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;u=new vM(CM.create(n,l,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[e]=u}s[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_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}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let o=i[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o;else{const t=o.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,o=this._actionsByClip,s=o[i],a=s.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null;delete s.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete o[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let o=r[t];void 0===o&&(o={},r[t]=o),o[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,s=o[r],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete s[i],0===Object.keys(s).length&&delete o[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new cC(new Float32Array(2),new Float32Array(2),1,TM),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let o="string"==typeof e?_C.findByName(r,e):e;const s=null!==o?o.uuid:e,a=this._actionsByClip[s];let l=null;if(void 0===n&&(n=null!==o?o.blendMode:Mf),void 0!==a){const e=a.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new MM(this,o,t,n);return this._bindAction(c,l),this._addInactiveAction(c,s,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?_C.findByName(n,e):e,o=i?i.uuid:e,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1;for(let s=0;s!==n;++s){t[s]._update(r,e,i,o)}const s=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)s[e].apply(o);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,o=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=i,t[i]=o,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const r=n[e].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const e in r){const t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}},AnimationObjectGroup:class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=qf(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,o=i.length;let s,a=e.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let d=t[h];if(void 0===d){d=a++,t[h]=d,e.push(u);for(let e=0,t=o;e!==t;++e)i[e].push(new CM(u,n[e],r[e]))}else if(d<l){s=e[d];const a=--l,c=e[a];t[c.uuid]=d,e[d]=c,t[h]=a,e[a]=u;for(let e=0,t=o;e!==t;++e){const t=i[e],o=t[a];let s=t[d];t[d]=o,void 0===s&&(s=new CM(u,n[e],r[e])),t[a]=s}}else e[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=t[a];if(void 0!==l&&l>=i){const o=i++,c=e[o];t[c.uuid]=l,e[l]=c,t[a]=o,e[o]=s;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[l];t[l]=r,t[o]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,o=e.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=t[a];if(void 0!==l)if(delete t[a],l<i){const s=--i,a=e[s],c=--o,u=e[c];t[a.uuid]=l,e[l]=a,t[u.uuid]=s,e[s]=u,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[s],i=t[c];t[l]=r,t[s]=i,t.pop()}}else{const i=--o,s=e[i];i>0&&(t[s.uuid]=l),e[l]=s,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,o.push(e),s.push(t),i.push(u);for(let n=c,r=a.length;n!==r;++n){const r=a[n];u[n]=new CM(r,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];t[e[s]]=n,o[n]=a,o.pop(),i[n]=i[s],i.pop(),r[n]=r[s],r.pop()}}},AnimationUtils:sC,ArcCurve:CS,ArrayCamera:Dx,ArrowHelper:class extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km(0,0,1),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16776960,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2*n,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.2*i;super(),this.type="ArrowHelper",void 0===JM&&(JM=new bv,JM.setAttribute("position",new pv([0,0,0,0,1,0],3)),KM=new $S(0,.5,1,5,1),KM.translate(0,-.5,0)),this.position.copy(t),this.line=new cS(JM,new rS({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Fv(KM,new nv({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ZM.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ZM,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},AttachedBindMode:cp,Audio:dM,AudioAnalyser:class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}},AudioContext:nM,AudioListener:class extends Bg{constructor(){super(),this.type="AudioListener",this.context=nM.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sM}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(lM,cM,uM),hM.set(0,0,-1).applyQuaternion(cM),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(lM.x,e),t.positionY.linearRampToValueAtTime(lM.y,e),t.positionZ.linearRampToValueAtTime(lM.z,e),t.forwardX.linearRampToValueAtTime(hM.x,e),t.forwardY.linearRampToValueAtTime(hM.y,e),t.forwardZ.linearRampToValueAtTime(hM.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(lM.x,lM.y,lM.z),t.setOrientation(hM.x,hM.y,hM.z,n.x,n.y,n.z)}},AudioLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(this.manager);function s(t){r?r(t):console.error(t),i.manager.itemError(e)}o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(e){try{const n=e.slice(0);nM.getContext().decodeAudioData(n,(function(e){t(e)})).catch(s)}catch(e){s(e)}}),n,r)}},AxesHelper:QM,BackSide:Zd,BasicDepthPacking:3200,BasicShadowMap:0,BatchedMesh:nS,Bone:Tb,BooleanKeyframeTrack:dC,Box2:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new im(1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new im(-1/0,-1/0);this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=PM.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,PM).distanceTo(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}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)}},Box3:Nm,Box3Helper:class extends dS{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new bv;r.setIndex(new uv(n,1)),r.setAttribute("position",new pv([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new rS({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},BoxGeometry:Hv,BoxHelper:class extends dS{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new bv;i.setIndex(new uv(n,1)),i.setAttribute("position",new uv(r,3)),super(i,new rS({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&qM.setFromObject(this.object),qM.isEmpty())return;const t=qM.min,n=qM.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},BufferAttribute:uv,BufferGeometry:bv,BufferGeometryLoader:JC,ByteType:1010,Cache:bC,Camera:$v,CameraHelper:class extends dS{constructor(e){const t=new bv,n=new rS({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],o={};function s(e,t){a(e),a(t)}function a(e){r.push(0,0,0),i.push(0,0,0),void 0===o[e]&&(o[e]=[]),o[e].push(r.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),t.setAttribute("position",new pv(r,3)),t.setAttribute("color",new pv(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const l=new Kg(16755200),c=new Kg(16711680),u=new Kg(43775),h=new Kg(16777215),d=new Kg(3355443);this.setColors(l,c,u,h,d)}setColors(e,t,n,r,i){const o=this.geometry.getAttribute("color");o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,t.r,t.g,t.b),o.setXYZ(25,t.r,t.g,t.b),o.setXYZ(26,t.r,t.g,t.b),o.setXYZ(27,t.r,t.g,t.b),o.setXYZ(28,t.r,t.g,t.b),o.setXYZ(29,t.r,t.g,t.b),o.setXYZ(30,t.r,t.g,t.b),o.setXYZ(31,t.r,t.g,t.b),o.setXYZ(32,n.r,n.g,n.b),o.setXYZ(33,n.r,n.g,n.b),o.setXYZ(34,n.r,n.g,n.b),o.setXYZ(35,n.r,n.g,n.b),o.setXYZ(36,n.r,n.g,n.b),o.setXYZ(37,n.r,n.g,n.b),o.setXYZ(38,r.r,r.g,r.b),o.setXYZ(39,r.r,r.g,r.b),o.setXYZ(40,i.r,i.g,i.b),o.setXYZ(41,i.r,i.g,i.b),o.setXYZ(42,i.r,i.g,i.b),o.setXYZ(43,i.r,i.g,i.b),o.setXYZ(44,i.r,i.g,i.b),o.setXYZ(45,i.r,i.g,i.b),o.setXYZ(46,i.r,i.g,i.b),o.setXYZ(47,i.r,i.g,i.b),o.setXYZ(48,i.r,i.g,i.b),o.setXYZ(49,i.r,i.g,i.b),o.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;$M.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),YM("c",t,e,$M,0,0,-1),YM("t",t,e,$M,0,0,1),YM("n1",t,e,$M,-1,-1,-1),YM("n2",t,e,$M,1,-1,-1),YM("n3",t,e,$M,-1,1,-1),YM("n4",t,e,$M,1,1,-1),YM("f1",t,e,$M,-1,-1,1),YM("f2",t,e,$M,1,-1,1),YM("f3",t,e,$M,-1,1,1),YM("f4",t,e,$M,1,1,1),YM("u1",t,e,$M,.7,1.1,-1),YM("u2",t,e,$M,-.7,1.1,-1),YM("u3",t,e,$M,0,2,-1),YM("cf1",t,e,$M,-1,0,1),YM("cf2",t,e,$M,1,0,1),YM("cf3",t,e,$M,0,-1,1),YM("cf4",t,e,$M,0,1,1),YM("cn1",t,e,$M,-1,0,-1),YM("cn2",t,e,$M,1,0,-1),YM("cn3",t,e,$M,0,-1,-1),YM("cn4",t,e,$M,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},CanvasTexture:class extends Am{constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r,i,o,s,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},CapsuleGeometry:jS,CatmullRomCurve3:LS,CineonToneMapping:sp,CircleGeometry:XS,ClampToEdgeWrapping:yp,Clock:sM,Color:Kg,ColorKeyframeTrack:pC,ColorManagement:ym,CompressedArrayTexture:class extends bS{constructor(e,t,n,r,i,o){super(e,t,n,i,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=yp}},CompressedCubeTexture:class extends bS{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,dp),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},CompressedTexture:bS,CompressedTextureLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=[],s=new bS,a=new AC(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(i.withCredentials);let l=0;function c(c){a.load(e[c],(function(e){const n=i.parse(e,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(s.minFilter=wp),s.image=o,s.format=n.format,s.needsUpdate=!0,t&&t(s))}),n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)c(t);else a.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){o[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)o[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),o[t].format=n.format,o[t].width=n.width,o[t].height=n.height}s.image=o}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=wp),s.format=n.format,s.needsUpdate=!0,t&&t(s)}),n,r);return s}},ConeGeometry:YS,ConstantAlphaFactor:213,ConstantColorFactor:211,CubeCamera:Zv,CubeReflectionMapping:dp,CubeRefractionMapping:pp,CubeTexture:Jv,CubeTextureLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=new Jv;i.colorSpace=Lf;const o=new EC(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(n){o.load(e[n],(function(e){i.images[n]=e,s++,6===s&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t<e.length;++t)a(t);return i}},CubeUVReflectionMapping:gp,CubicBezierCurve:kS,CubicBezierCurve3:BS,CubicInterpolant:lC,CullFaceBack:1,CullFaceFront:2,CullFaceFrontBack:3,CullFaceNone:0,Curve:SS,CurvePath:WS,CustomBlending:5,CustomToneMapping:lp,CylinderGeometry:$S,Cylindrical:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}},Data3DTexture:Im,DataArrayTexture:Pm,DataTexture:Ab,DataTextureLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Ab,s=new AC(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(i.withCredentials),s.load(e,(function(e){let n;try{n=i.parse(e)}catch(e){if(void 0===r)return void console.error(e);r(e)}void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:yp,o.wrapT=void 0!==n.wrapT?n.wrapT:yp,o.magFilter=void 0!==n.magFilter?n.magFilter:wp,o.minFilter=void 0!==n.minFilter?n.minFilter:wp,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace?o.colorSpace=n.colorSpace:void 0!==n.encoding&&(o.encoding=n.encoding),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=Mp),1===n.mipmapCount&&(o.minFilter=wp),void 0!==n.generateMipmaps&&(o.generateMipmaps=n.generateMipmaps),o.needsUpdate=!0,t&&t(o,n)}),n,r),o}},DataUtils:av,DecrementStencilOp:7683,DecrementWrapStencilOp:34056,DefaultLoadingManager:wC,DepthFormat:Dp,DepthStencilFormat:Np,DepthTexture:jy,DetachedBindMode:up,DirectionalLight:VC,DirectionalLightHelper:class extends Bg{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===t&&(t=1);let r=new bv;r.setAttribute("position",new pv([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new rS({fog:!1,toneMapped:!1});this.lightPlane=new cS(r,i),this.add(this.lightPlane),r=new bv,r.setAttribute("position",new pv([0,0,0,0,0,1],3)),this.targetLine=new cS(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),VM.setFromMatrixPosition(this.light.matrixWorld),GM.setFromMatrixPosition(this.light.target.matrixWorld),jM.subVectors(GM,VM),this.lightPlane.lookAt(GM),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(GM),this.targetLine.scale.z=jM.length()}},DiscreteInterpolant:uC,DisplayP3ColorSpace:If,DodecahedronGeometry:ZS,DoubleSide:2,DstAlphaFactor:206,DstColorFactor:208,DynamicCopyUsage:35050,DynamicDrawUsage:35048,DynamicReadUsage:35049,EdgesGeometry:tw,EllipseCurve:wS,EqualCompare:514,EqualDepth:4,EqualStencilFunc:514,EquirectangularReflectionMapping:fp,EquirectangularRefractionMapping:mp,Euler:xg,EventDispatcher:Gf,ExtrudeGeometry:Pw,FileLoader:AC,Float16BufferAttribute:class extends uv{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=sv(this.array[e*this.itemSize]);return this.normalized&&(t=tm(t,this.array)),t}setX(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize]=ov(t),this}getY(e){let t=sv(this.array[e*this.itemSize+1]);return this.normalized&&(t=tm(t,this.array)),t}setY(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+1]=ov(t),this}getZ(e){let t=sv(this.array[e*this.itemSize+2]);return this.normalized&&(t=tm(t,this.array)),t}setZ(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+2]=ov(t),this}getW(e){let t=sv(this.array[e*this.itemSize+3]);return this.normalized&&(t=tm(t,this.array)),t}setW(e,t){return this.normalized&&(t=nm(t,this.array)),this.array[e*this.itemSize+3]=ov(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array)),this.array[e+0]=ov(t),this.array[e+1]=ov(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array)),this.array[e+0]=ov(t),this.array[e+1]=ov(n),this.array[e+2]=ov(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=nm(t,this.array),n=nm(n,this.array),r=nm(r,this.array),i=nm(i,this.array)),this.array[e+0]=ov(t),this.array[e+1]=ov(n),this.array[e+2]=ov(r),this.array[e+3]=ov(i),this}},Float32BufferAttribute:pv,Float64BufferAttribute:class extends uv{constructor(e,t,n){super(new Float64Array(e),t,n)}},FloatType:Lp,Fog:Xx,FogExp2:jx,FramebufferTexture:class extends Am{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=xp,this.minFilter=xp,this.generateMipmaps=!1,this.needsUpdate=!0}},FrontSide:qd,Frustum:oy,GLBufferAttribute:class{constructor(e,t,n,r,i){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},GLSL1:"100",GLSL3:zf,GreaterCompare:516,GreaterDepth:6,GreaterEqualCompare:518,GreaterEqualDepth:5,GreaterEqualStencilFunc:518,GreaterStencilFunc:516,GridHelper:WM,Group:Nx,HalfFloatType:Pp,HemisphereLight:LC,HemisphereLightHelper:class extends Bg{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new kw(t);r.rotateY(.5*Math.PI),this.material=new nv({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.setAttribute("color",new uv(o,3)),this.add(new Fv(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");zM.copy(this.light.color),HM.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?zM:HM;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(FM.setFromMatrixPosition(this.light.matrixWorld).negate())}},IcosahedronGeometry:Ow,ImageBitmapLoader:class extends CC{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=bC.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){bC.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}},ImageLoader:EC,ImageUtils:Sm,IncrementStencilOp:7682,IncrementWrapStencilOp:34055,InstancedBufferAttribute:Pb,InstancedBufferGeometry:ZC,InstancedInterleavedBuffer:class extends Yx{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},InstancedMesh:Fb,Int16BufferAttribute:class extends uv{constructor(e,t,n){super(new Int16Array(e),t,n)}},Int32BufferAttribute:class extends uv{constructor(e,t,n){super(new Int32Array(e),t,n)}},Int8BufferAttribute:class extends uv{constructor(e,t,n){super(new Int8Array(e),t,n)}},IntType:Ep,InterleavedBuffer:Yx,InterleavedBufferAttribute:Zx,Interpolant:aC,InterpolateDiscrete:_f,InterpolateLinear:xf,InterpolateSmooth:bf,InvertStencilOp:5386,KeepStencilOp:Uf,KeyframeTrack:hC,LOD:mb,LatheGeometry:GS,Layers:bg,LessCompare:513,LessDepth:2,LessEqualCompare:515,LessEqualDepth:3,LessEqualStencilFunc:515,LessStencilFunc:513,Light:RC,LightProbe:$C,Line:cS,Line3:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new km,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new km;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){IM.subVectors(e,this.start),OM.subVectors(this.end,this.start);const n=OM.dot(OM);let r=OM.dot(IM)/n;return t&&(r=Zf(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},LineBasicMaterial:rS,LineCurve:DS,LineCurve3:NS,LineDashedMaterial:eC,LineLoop:pS,LineSegments:dS,LinearDisplayP3ColorSpace:Of,LinearEncoding:Af,LinearFilter:wp,LinearInterpolant:cC,LinearMipMapLinearFilter:1008,LinearMipMapNearestFilter:1007,LinearMipmapLinearFilter:Mp,LinearMipmapNearestFilter:Cp,LinearSRGBColorSpace:Pf,LinearToneMapping:ip,LinearTransfer:kf,Loader:CC,LoaderUtils:qC,LoadingManager:SC,LoopOnce:2200,LoopPingPong:2202,LoopRepeat:2201,LuminanceAlphaFormat:1025,LuminanceFormat:1024,MOUSE:{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Material:tv,MaterialLoader:YC,MathUtils:rm,Matrix3:om,Matrix4:ug,MaxEquation:104,Mesh:Fv,MeshBasicMaterial:nv,MeshDepthMaterial:Lx,MeshDistanceMaterial:Px,MeshLambertMaterial:Kw,MeshMatcapMaterial:Qw,MeshNormalMaterial:Jw,MeshPhongMaterial:qw,MeshPhysicalMaterial:Yw,MeshStandardMaterial:$w,MeshToonMaterial:Zw,MinEquation:103,MirroredRepeatWrapping:_p,MixOperation:tp,MultiplyBlending:4,MultiplyOperation:ep,NearestFilter:xp,NearestMipMapLinearFilter:1005,NearestMipMapNearestFilter:1004,NearestMipmapLinearFilter:Sp,NearestMipmapNearestFilter:bp,NeverCompare:512,NeverDepth:0,NeverStencilFunc:512,NoBlending:0,NoColorSpace:Rf,NoToneMapping:rp,NormalAnimationBlendMode:Mf,NormalBlending:1,NotEqualCompare:517,NotEqualDepth:7,NotEqualStencilFunc:517,NumberKeyframeTrack:fC,Object3D:Bg,ObjectLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=""===this.path?qC.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const s=new AC(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){let o=null;try{o=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())return void 0!==r&&r(new Error("THREE.ObjectLoader: Can't load "+e)),void console.error("THREE.ObjectLoader: Can't load "+e);i.parse(o,t)}),n,r)}async loadAsync(e,t){const n=""===this.path?qC.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new AC(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),o=JSON.parse(i),s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(o)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),s=this.parseTextures(e.textures,o),a=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,i,a,s,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in o)if(o[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,i),s=this.parseMaterials(e.materials,o),a=this.parseObject(e.object,r,s,o,t),l=this.parseSkeletons(e.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new nw).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let t=0,i=e.length;t<i;t++){const i=(new Lb).fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new JC;for(let i=0,o=e.length;i<o;i++){let o;const s=e[i];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;default:s.type in Gw?o=Gw[s.type].fromJSON(s,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${s.type}"`)}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new YC;i.setTextures(t);for(let t=0,o=e.length;t<o;t++){const o=e[t];void 0===n[o.uuid]&&(n[o.uuid]=i.parse(o)),r[o.uuid]=n[o.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=_C.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function o(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:cm(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new SC(t);i=new EC(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=o(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new Ab(n.data,n.width,n.height)))}r[n.uuid]=new Cm(e)}else{const e=o(n.url);r[n.uuid]=new Cm(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"==typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:cm(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new EC(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],o=r.url;if(Array.isArray(o)){const e=[];for(let t=0,n=o.length;t<n;t++){const n=o[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new Ab(r.data,r.width,r.height)))}n[r.uuid]=new Cm(e)}else{const e=await i(r.url);n[r.uuid]=new Cm(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,o=e.length;i<o;i++){const o=e[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const s=t[o.image],a=s.data;let l;Array.isArray(a)?(l=new Jv,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new Ab:new Am,a&&(l.needsUpdate=!0)),l.source=s,l.uuid=o.uuid,void 0!==o.name&&(l.name=o.name),void 0!==o.mapping&&(l.mapping=n(o.mapping,KC)),void 0!==o.channel&&(l.channel=o.channel),void 0!==o.offset&&l.offset.fromArray(o.offset),void 0!==o.repeat&&l.repeat.fromArray(o.repeat),void 0!==o.center&&l.center.fromArray(o.center),void 0!==o.rotation&&(l.rotation=o.rotation),void 0!==o.wrap&&(l.wrapS=n(o.wrap[0],QC),l.wrapT=n(o.wrap[1],QC)),void 0!==o.format&&(l.format=o.format),void 0!==o.internalFormat&&(l.internalFormat=o.internalFormat),void 0!==o.type&&(l.type=o.type),void 0!==o.colorSpace&&(l.colorSpace=o.colorSpace),void 0!==o.encoding&&(l.encoding=o.encoding),void 0!==o.minFilter&&(l.minFilter=n(o.minFilter,eM)),void 0!==o.magFilter&&(l.magFilter=n(o.magFilter,eM)),void 0!==o.anisotropy&&(l.anisotropy=o.anisotropy),void 0!==o.flipY&&(l.flipY=o.flipY),void 0!==o.generateMipmaps&&(l.generateMipmaps=o.generateMipmaps),void 0!==o.premultiplyAlpha&&(l.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(l.unpackAlignment=o.unpackAlignment),void 0!==o.compareFunction&&(l.compareFunction=o.compareFunction),void 0!==o.userData&&(l.userData=o.userData),r[o.uuid]=l}return r}parseObject(e,t,n,r,i){let o,s,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function u(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":o=new $x,void 0!==e.background&&(Number.isInteger(e.background)?o.background=new Kg(e.background):o.background=u(e.background)),void 0!==e.environment&&(o.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?o.fog=new Xx(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(o.fog=new jx(e.fog.color,e.fog.density)),""!==e.fog.name&&(o.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(o.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(o.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":o=new Yv(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new _y(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new GC(e.color,e.intensity);break;case"DirectionalLight":o=new VC(e.color,e.intensity);break;case"PointLight":o=new HC(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new jC(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new DC(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new LC(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=(new $C).fromJSON(e);break;case"SkinnedMesh":s=l(e.geometry),a=c(e.material),o=new Mb(s,a),void 0!==e.bindMode&&(o.bindMode=e.bindMode),void 0!==e.bindMatrix&&o.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(o.skeleton=e.skeleton);break;case"Mesh":s=l(e.geometry),a=c(e.material),o=new Fv(s,a);break;case"InstancedMesh":s=l(e.geometry),a=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;o=new Fb(s,a,t),o.instanceMatrix=new Pb(new Float32Array(n.array),16),void 0!==r&&(o.instanceColor=new Pb(new Float32Array(r.array),r.itemSize));break;case"BatchedMesh":s=l(e.geometry),a=c(e.material),o=new nS(e.maxGeometryCount,e.maxVertexCount,e.maxIndexCount,a),o.geometry=s,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._visibility=e.visibility,o._active=e.active,o._bounds=e.bounds.map((e=>{const t=new Nm;t.min.fromArray(e.boxMin),t.max.fromArray(e.boxMax);const n=new tg;return n.radius=e.sphereRadius,n.center.fromArray(e.sphereCenter),{boxInitialized:e.boxInitialized,box:t,sphereInitialized:e.sphereInitialized,sphere:n}})),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":o=new mb;break;case"Line":o=new cS(l(e.geometry),c(e.material));break;case"LineLoop":o=new pS(l(e.geometry),c(e.material));break;case"LineSegments":o=new dS(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":o=new _S(l(e.geometry),c(e.material));break;case"Sprite":o=new hb(c(e.material));break;case"Group":o=new Nx;break;case"Bone":o=new Tb;break;default:o=new Bg}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(o.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.quaternion&&o.quaternion.fromArray(e.quaternion),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.up&&o.up.fromArray(e.up),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(o.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(o.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(o.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&o.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(o.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.frustumCulled&&(o.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(o.renderOrder=e.renderOrder),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.layers&&(o.layers.mask=e.layers),void 0!==e.children){const s=e.children;for(let e=0;e<s.length;e++)o.add(this.parseObject(s[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];o.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(o.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=o.getObjectByProperty("uuid",n.object);void 0!==r&&o.addLevel(r,n.distance,n.hysteresis)}}return o}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}},ObjectSpaceNormalMap:1,OctahedronGeometry:kw,OneFactor:201,OneMinusConstantAlphaFactor:214,OneMinusConstantColorFactor:212,OneMinusDstAlphaFactor:207,OneMinusDstColorFactor:209,OneMinusSrcAlphaFactor:Qd,OneMinusSrcColorFactor:203,OrthographicCamera:_y,P3Primaries:Nf,PCFShadowMap:Xd,PCFSoftShadowMap:$d,PMREMGenerator:Ly,Path:VS,PerspectiveCamera:Yv,Plane:ny,PlaneGeometry:ly,PlaneHelper:class extends cS{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960,r=new bv;r.setAttribute("position",new pv([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new rS({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const i=new bv;i.setAttribute("position",new pv([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new Fv(i,new nv({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},PointLight:HC,PointLightHelper:class extends Fv{constructor(e,t,n){super(new Nw(t,4,2),new nv({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},Points:_S,PointsMaterial:fS,PolarGridHelper:class extends dS{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;i=new Kg(i),o=new Kg(o);const s=[],a=[];if(t>1)for(let n=0;n<t;n++){const r=n/t*(2*Math.PI),l=Math.sin(r)*e,c=Math.cos(r)*e;s.push(0,0,0),s.push(l,0,c);const u=1&n?i:o;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let t=0;t<n;t++){const l=1&t?i:o,c=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(2*Math.PI),n=Math.sin(t)*c,i=Math.cos(t)*c;s.push(n,0,i),a.push(l.r,l.g,l.b),t=(e+1)/r*(2*Math.PI),n=Math.sin(t)*c,i=Math.cos(t)*c,s.push(n,0,i),a.push(l.r,l.g,l.b)}}const l=new bv;l.setAttribute("position",new pv(s,3)),l.setAttribute("color",new pv(a,3));super(l,new rS({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},PolyhedronGeometry:qS,PositionalAudio:class extends dM{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(pM,fM,mM),gM.set(0,0,1).applyQuaternion(fM);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(pM.x,e),t.positionY.linearRampToValueAtTime(pM.y,e),t.positionZ.linearRampToValueAtTime(pM.z,e),t.orientationX.linearRampToValueAtTime(gM.x,e),t.orientationY.linearRampToValueAtTime(gM.y,e),t.orientationZ.linearRampToValueAtTime(gM.z,e)}else t.setPosition(pM.x,pM.y,pM.z),t.setOrientation(gM.x,gM.y,gM.z)}},PropertyBinding:CM,PropertyMixer:vM,QuadraticBezierCurve:US,QuadraticBezierCurve3:FS,Quaternion:Om,QuaternionKeyframeTrack:gC,QuaternionLinearInterpolant:mC,RED_GREEN_RGTC2_Format:vf,RED_RGTC1_Format:36283,REVISION:jd,RGBADepthPacking:3201,RGBAFormat:Bp,RGBAIntegerFormat:zp,RGBA_ASTC_10x10_Format:uf,RGBA_ASTC_10x5_Format:af,RGBA_ASTC_10x6_Format:lf,RGBA_ASTC_10x8_Format:cf,RGBA_ASTC_12x10_Format:hf,RGBA_ASTC_12x12_Format:df,RGBA_ASTC_4x4_Format:Kp,RGBA_ASTC_5x4_Format:Qp,RGBA_ASTC_5x5_Format:ef,RGBA_ASTC_6x5_Format:tf,RGBA_ASTC_6x6_Format:nf,RGBA_ASTC_8x5_Format:rf,RGBA_ASTC_8x6_Format:of,RGBA_ASTC_8x8_Format:sf,RGBA_BPTC_Format:pf,RGBA_ETC2_EAC_Format:Jp,RGBA_PVRTC_2BPPV1_Format:Yp,RGBA_PVRTC_4BPPV1_Format:$p,RGBA_S3TC_DXT1_Format:Wp,RGBA_S3TC_DXT3_Format:Vp,RGBA_S3TC_DXT5_Format:Gp,RGB_BPTC_SIGNED_Format:ff,RGB_BPTC_UNSIGNED_Format:mf,RGB_ETC1_Format:qp,RGB_ETC2_Format:Zp,RGB_PVRTC_2BPPV1_Format:Xp,RGB_PVRTC_4BPPV1_Format:jp,RGB_S3TC_DXT1_Format:Hp,RGFormat:1030,RGIntegerFormat:Fp,RawShaderMaterial:Xw,Ray:cg,Raycaster:class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new cg(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new bg,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return LM(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(RM),t}intersectObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let r=0,i=e.length;r<i;r++)LM(e[r],this,n,t);return n.sort(RM),n}},Rec709Primaries:Df,RectAreaLight:jC,RedFormat:1028,RedIntegerFormat:Up,ReinhardToneMapping:op,RenderTarget:Rm,RepeatWrapping:vp,ReplaceStencilOp:7681,ReverseSubtractEquation:102,RingGeometry:Bw,SIGNED_RED_GREEN_RGTC2_Format:yf,SIGNED_RED_RGTC1_Format:gf,SRGBColorSpace:Lf,SRGBTransfer:Bf,Scene:$x,ShaderChunk:cy,ShaderLib:hy,ShaderMaterial:Xv,ShadowMaterial:jw,Shape:nw,ShapeGeometry:Dw,ShapePath:class{constructor(){this.type="ShapePath",this.color=new Kg,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new VS,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,o){return this.currentPath.bezierCurveTo(e,t,n,r,i,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,o=0;o<n;i=o++){let n=t[i],s=t[o],a=s.x-n.x,l=s.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[o],a=-a,s=t[i],l=-l),e.y<n.y||e.y>s.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-a*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(s.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=s.x)return!0}}return r}const n=Ew.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,o,s;const a=[];if(1===r.length)return o=r[0],s=new nw,s.curves=o.curves,a.push(s),a;let l=!n(r[0].getPoints());l=e?!l:l;const c=[],u=[];let h,d,p=[],f=0;u[f]=void 0,p[f]=[];for(let t=0,s=r.length;t<s;t++)o=r[t],h=o.getPoints(),i=n(h),i=e?!i:i,i?(!l&&u[f]&&f++,u[f]={s:new nw,p:h},u[f].s.curves=o.curves,l&&f++,p[f]=[]):p[f].push({h:o,p:h[0]});if(!u[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new nw;i.curves=r.curves,t.push(i)}return t}(r);if(u.length>1){let e=!1,n=0;for(let e=0,t=u.length;e<t;e++)c[e]=[];for(let r=0,i=u.length;r<i;r++){const i=p[r];for(let o=0;o<i.length;o++){const s=i[o];let a=!0;for(let i=0;i<u.length;i++)t(s.p,u[i].p)&&(r!==i&&n++,a?(a=!1,c[i].push(s)):e=!0);a&&c[r].push(s)}}n>0&&!1===e&&(p=c)}for(let e=0,t=u.length;e<t;e++){s=u[e].s,a.push(s),d=p[e];for(let e=0,t=d.length;e<t;e++)s.holes.push(d[e].h)}return a}},ShapeUtils:Ew,ShortType:1011,Skeleton:Lb,SkeletonHelper:class extends dS{constructor(e){const t=UM(e),n=new bv,r=[],i=[],o=new Kg(0,0,1),s=new Kg(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(s.r,s.g,s.b))}n.setAttribute("position",new pv(r,3)),n.setAttribute("color",new pv(i,3));super(n,new rS({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");NM.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(DM.multiplyMatrices(NM,i.matrixWorld),BM.setFromMatrixPosition(DM),r.setXYZ(n,BM.x,BM.y,BM.z),DM.multiplyMatrices(NM,i.parent.matrixWorld),BM.setFromMatrixPosition(DM),r.setXYZ(n+1,BM.x,BM.y,BM.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}},SkinnedMesh:Mb,Source:Cm,Sphere:tg,SphereGeometry:Nw,Spherical:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Zf(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},SphericalHarmonics3:XC,SplineCurve:zS,SpotLight:DC,SpotLightHelper:class extends Bg{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new bv,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e<n;e++,t++){const i=e/n*Math.PI*2,o=t/n*Math.PI*2;r.push(Math.cos(i),Math.sin(i),1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new pv(r,3));const i=new rS({fog:!1,toneMapped:!1});this.cone=new dS(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),kM.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(kM),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},Sprite:hb,SpriteMaterial:Jx,SrcAlphaFactor:Kd,SrcAlphaSaturateFactor:210,SrcColorFactor:202,StaticCopyUsage:35046,StaticDrawUsage:Ff,StaticReadUsage:35045,StereoCamera:class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Yv,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Yv,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,oM.copy(e.projectionMatrix);const n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan($f*t.fov*.5)/t.zoom;let o,s;iM.elements[12]=-n,rM.elements[12]=n,o=-i*t.aspect+r,s=i*t.aspect+r,oM.elements[0]=2*t.near/(s-o),oM.elements[8]=(s+o)/(s-o),this.cameraL.projectionMatrix.copy(oM),o=-i*t.aspect-r,s=i*t.aspect-r,oM.elements[0]=2*t.near/(s-o),oM.elements[8]=(s+o)/(s-o),this.cameraR.projectionMatrix.copy(oM)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(iM),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(rM)}},StreamCopyUsage:35042,StreamDrawUsage:35040,StreamReadUsage:35041,StringKeyframeTrack:vC,SubtractEquation:101,SubtractiveBlending:3,TOUCH:{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},TangentSpaceNormalMap:0,TetrahedronGeometry:Uw,Texture:Am,TextureLoader:class extends CC{constructor(e){super(e)}load(e,t,n,r){const i=new Am,o=new EC(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}},TorusGeometry:Fw,TorusKnotGeometry:zw,Triangle:$g,TriangleFanDrawMode:2,TriangleStripDrawMode:1,TrianglesDrawMode:0,TubeGeometry:Hw,TwoPassDoubleSide:2,UVMapping:hp,Uint16BufferAttribute:hv,Uint32BufferAttribute:dv,Uint8BufferAttribute:class extends uv{constructor(e,t,n){super(new Uint8Array(e),t,n)}},Uint8ClampedBufferAttribute:class extends uv{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}},Uniform:AM,UniformsGroup:class extends Gf{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:EM++}),this.name="",this.usage=Ff,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let e=0,n=t.length;e<n;e++)this.uniforms.push(t[e].clone());return this}clone(){return(new this.constructor).copy(this)}},UniformsLib:uy,UniformsUtils:jv,UnsignedByteType:Tp,UnsignedInt248Type:kp,UnsignedIntType:Rp,UnsignedShort4444Type:Ip,UnsignedShort5551Type:Op,UnsignedShortType:Ap,VSMShadowMap:Yd,Vector2:im,Vector3:km,Vector4:Em,VectorKeyframeTrack:yC,VideoTexture:class extends Am{constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r,i,o,s,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==o?o:wp,this.magFilter=void 0!==i?i:wp,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)}},WebGL1Renderer:Gx,WebGL3DRenderTarget:class extends Lm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Im(null,e,t,n),this.texture.isRenderTargetTexture=!0}},WebGLArrayRenderTarget:class extends Lm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Pm(null,e,t,n),this.texture.isRenderTargetTexture=!0}},WebGLCoordinateSystem:Wf,WebGLCubeRenderTarget:Kv,WebGLMultipleRenderTargets:class extends Lm{constructor(){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGLMultipleRenderTargets=!0;const t=this.texture;this.texture=[];for(let n=0;n<e;n++)this.texture[n]=t.clone(),this.texture[n].isRenderTargetTexture=!0}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}},WebGLRenderTarget:Lm,WebGLRenderer:Vx,WebGLUtils:Bx,WebGPUCoordinateSystem:Vf,WireframeGeometry:Ww,WrapAroundEnding:Cf,ZeroCurvatureEnding:Sf,ZeroFactor:200,ZeroSlopeEnding:wf,ZeroStencilOp:0,_SRGBAFormat:Hf,createCanvasElement:hm,sRGBEncoding:Ef});class tT extends Bg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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.center=new im(.5,.5),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.center=e.center,this}}const nT=new km,rT=new ug,iT=new ug,oT=new km,sT=new km;class aT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this;let n,r,i,o;const s={objects:new WeakMap},a=void 0!==e.element?e.element:document.createElement("div");function l(e,n,r){if(e.isCSS2DObject){nT.setFromMatrixPosition(e.matrixWorld),nT.applyMatrix4(iT);const l=!0===e.visible&&nT.z>=-1&&nT.z<=1&&!0===e.layers.test(r.layers);if(e.element.style.display=!0===l?"":"none",!0===l){e.onBeforeRender(t,n,r);const s=e.element;s.style.transform="translate("+-100*e.center.x+"%,"+-100*e.center.y+"%)translate("+(nT.x*i+i)+"px,"+(-nT.y*o+o)+"px)",s.parentNode!==a&&a.appendChild(s),e.onAfterRender(t,n,r)}const u={distanceToCameraSquared:c(r,e)};s.objects.set(e,u)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],n,r)}function c(e,t){return oT.setFromMatrixPosition(e.matrixWorld),sT.setFromMatrixPosition(t.matrixWorld),oT.distanceToSquared(sT)}a.style.overflow="hidden",this.domElement=a,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),rT.copy(t.matrixWorldInverse),iT.multiplyMatrices(t.projectionMatrix,rT),l(e,e,t),function(e){const t=function(e){const t=[];return e.traverse((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;return s.objects.get(e).distanceToCameraSquared-s.objects.get(t).distanceToCameraSquared})),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,o=r/2,a.style.width=e+"px",a.style.height=t+"px"}}}
|
|
20
|
+
/*!
|
|
21
|
+
* camera-controls
|
|
22
|
+
* https://github.com/yomotsu/camera-controls
|
|
23
|
+
* (c) 2017 @yomotsu
|
|
24
|
+
* Released under the MIT License.
|
|
25
|
+
*/const lT=1,cT=2,uT=4,hT=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}),dT=0,pT=1,fT=-1;function mT(e){return e.isPerspectiveCamera}function gT(e){return e.isOrthographicCamera}const vT=2*Math.PI,yT=Math.PI/2,_T=1e-5,xT=Math.PI/180;function bT(e,t,n){return Math.max(t,Math.min(n,e))}function ST(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_T;return Math.abs(e)<t}function wT(e,t){return ST(e-t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:_T)}function CT(e,t){return Math.round(e/t)*t}function MT(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function TT(e){return Math.abs(e)<Number.MAX_VALUE?e:e*(1/0)}function AT(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0;const s=2/(r=Math.max(1e-4,r)),a=s*o,l=1/(1+a+.48*a*a+.235*a*a*a);let c=e-t;const u=t,h=i*r;c=bT(c,-h,h),t=e-c;const d=(n.value+s*c)*o;n.value=(n.value-s*d)*l;let p=t+(c+d)*l;return u-e>0==p>u&&(p=u,n.value=(p-u)/o),p}function ET(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;const a=2/(r=Math.max(1e-4,r)),l=a*o,c=1/(1+l+.48*l*l+.235*l*l*l);let u=t.x,h=t.y,d=t.z,p=e.x-u,f=e.y-h,m=e.z-d;const g=u,v=h,y=d,_=i*r,x=p*p+f*f+m*m;if(x>_*_){const e=Math.sqrt(x);p=p/e*_,f=f/e*_,m=m/e*_}u=e.x-p,h=e.y-f,d=e.z-m;const b=(n.x+a*p)*o,S=(n.y+a*f)*o,w=(n.z+a*m)*o;n.x=(n.x-a*b)*c,n.y=(n.y-a*S)*c,n.z=(n.z-a*w)*c,s.x=u+(p+b)*c,s.y=h+(f+S)*c,s.z=d+(m+w)*c;const C=g-e.x,M=v-e.y,T=y-e.z;return C*(s.x-g)+M*(s.y-v)+T*(s.z-y)>0&&(s.x=g,s.y=v,s.z=y,n.x=(s.x-g)/o,n.y=(s.y-v)/o,n.z=(s.z-y)/o),s}function RT(e,t){t.set(0,0),e.forEach((e=>{t.x+=e.clientX,t.y+=e.clientY})),t.x/=e.length,t.y/=e.length}function LT(e,t){return!!gT(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}class PT{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}removeAllEventListeners(e){e?Array.isArray(this._listeners[e])&&(this._listeners[e].length=0):this._listeners={}}dispatchEvent(e){const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e)}}}const IT=1/8,OT="undefined"!=typeof window,kT=OT&&/Mac/.test(navigator.platform),BT=!(OT&&"PointerEvent"in window);let DT,NT,UT,FT,zT,HT,WT,VT,GT,jT,XT,$T,YT,qT,ZT,JT,KT,QT,eA,tA,nA,rA,iA;class oA extends PT{static install(e){DT=e.THREE,NT=Object.freeze(new DT.Vector3(0,0,0)),UT=Object.freeze(new DT.Vector3(0,1,0)),FT=Object.freeze(new DT.Vector3(0,0,1)),zT=new DT.Vector2,HT=new DT.Vector3,WT=new DT.Vector3,VT=new DT.Vector3,GT=new DT.Vector3,jT=new DT.Vector3,XT=new DT.Vector3,$T=new DT.Vector3,YT=new DT.Vector3,qT=new DT.Vector3,ZT=new DT.Spherical,JT=new DT.Spherical,KT=new DT.Box3,QT=new DT.Box3,eA=new DT.Sphere,tA=new DT.Quaternion,nA=new DT.Quaternion,rA=new DT.Matrix4,iA=new DT.Raycaster}static get ACTION(){return hT}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=hT.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=dT,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new DT.Vector3,this._focalOffsetVelocity=new DT.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(mT(this._camera)){const n=HT.copy(this._camera.position).sub(this._target),o=this._camera.getEffectiveFOV()*xT,s=n.length()*Math.tan(.5*o);r=this.truckSpeed*e*s/this._elementRect.height,i=this.truckSpeed*t*s/this._elementRect.height}else{if(!gT(this._camera))return;{const n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}}this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{const n=vT*this.azimuthRotateSpeed*e/this._elementRect.height,r=vT*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{const r=Math.pow(.95,-e*this.dollySpeed),i=this._sphericalEnd.radius,o=this._sphericalEnd.radius*r,s=bT(o,this.minDistance,this.maxDistance),a=s-o;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(o,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(a,!0),this._dollyToNoClamp(s,!0)):this._dollyToNoClamp(s,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?o:s)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{const r=Math.pow(.95,e*this.dollySpeed),i=this._zoom,o=this._zoom*r;this.zoomTo(o,!0),this.dollyToCursor&&(this._changedZoom+=o-i,this._dollyControlCoord.set(t,n))},void 0===DT&&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 DT.Quaternion).setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=hT.NONE,this._target=new DT.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new DT.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new DT.Spherical).setFromVector3(HT.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new DT.Vector3,new DT.Vector3,new DT.Vector3,new DT.Vector3],this._updateNearPlaneCorners(),this._boundary=new DT.Box3(new DT.Vector3(-1/0,-1/0,-1/0),new DT.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new DT.Vector2,this.mouseButtons={left:hT.ROTATE,middle:hT.DOLLY,right:hT.TRUCK,wheel:mT(this._camera)?hT.DOLLY:gT(this._camera)?hT.ZOOM:hT.NONE},this.touches={one:hT.TOUCH_ROTATE,two:mT(this._camera)?hT.TOUCH_DOLLY_TRUCK:gT(this._camera)?hT.TOUCH_ZOOM_TRUCK:hT.NONE,three:hT.TOUCH_TRUCK};const n=new DT.Vector2,r=new DT.Vector2,i=new DT.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t="mouse"!==e.pointerType?null:(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&lT)===lT&&this._lockedPointer)return;const n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),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),this._isDragging=!0,f(e)},s=e=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t=(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}const n={pointerId:1,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:(e.buttons&lT)===lT?lT:(e.buttons&uT)===lT?uT:(e.buttons&cT)===lT?cT:null};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,f(e)},a=e=>{e.cancelable&&e.preventDefault();const t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,"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._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);m()}},l=e=>{const t=this._lockedPointer||this._findPointerById(1);t&&(t.clientX=e.clientX,t.clientY=e.clientY,t.deltaX=e.movementX,t.deltaY=e.movementY,this._state=0,(this._lockedPointer||(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right),m())},c=e=>{const t=this._findPointerById(e.pointerId);if(!t||t!==this._lockedPointer){if(t&&this._disposePointer(t),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=hT.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=hT.NONE;g()}},u=()=>{const e=this._findPointerById(1);e&&e===this._lockedPointer||(e&&this._disposePointer(e),this._state=hT.NONE,g())};let h=-1;const d=e=>{if(!this._domElement)return;if(!this._enabled||this.mouseButtons.wheel===hT.NONE)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===hT.ROTATE||this.mouseButtons.wheel===hT.TRUCK){const e=performance.now();h-e<1e3&&this._getClientRect(this._elementRect),h=e}const t=kT?-1:-3,n=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case hT.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case hT.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case hT.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case hT.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case hT.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},p=e=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===oA.ACTION.NONE){const t=e instanceof PointerEvent?e.pointerId:(MouseEvent,0),n=this._findPointerById(t);return n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mousemove",l),void this._domElement.ownerDocument.removeEventListener("mouseup",u)}e.preventDefault()}},f=e=>{if(!this._enabled)return;RT(this._activePointers,zT),this._getClientRect(this._elementRect),n.copy(zT),r.copy(zT);if(this._activePointers.length>=2){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);i.set(0,n);const o=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),s=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);r.set(o,s)}if(this._state=0,e)if("pointerType"in e&&"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._lockedPointer||(e.buttons&lT)!==lT||(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);else this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),(this._state&hT.DOLLY)!==hT.DOLLY&&(this._state&hT.TOUCH_DOLLY)!==hT.TOUCH_DOLLY&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE||(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),(this._state&hT.ZOOM)!==hT.ZOOM&&(this._state&hT.TOUCH_ZOOM)!==hT.TOUCH_ZOOM&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,RT(this._activePointers,zT);const e=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:r.x-zT.x,o=e?-e.deltaY:r.y-zT.y;if(r.copy(zT),(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._rotateInternal(t,o),this._isUserControllingRotate=!0),(this._state&hT.DOLLY)===hT.DOLLY||(this._state&hT.ZOOM)===hT.ZOOM){const e=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,r=this.dollyDragInverted?-1:1;(this._state&hT.DOLLY)===hT.DOLLY?(this._dollyInternal(r*o*IT,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(r*o*IT,e,t),this._isUserControllingZoom=!0)}if((this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_ZOOM)===hT.TOUCH_ZOOM||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_ZOOM_TRUCK)===hT.TOUCH_ZOOM_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET||(this._state&hT.TOUCH_ZOOM_OFFSET)===hT.TOUCH_ZOOM_OFFSET||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_ZOOM_ROTATE)===hT.TOUCH_ZOOM_ROTATE){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),o=i.y-n;i.set(0,n);const s=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,a=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET?(this._dollyInternal(o*IT,s,a),this._isUserControllingDolly=!0):(this._zoomInternal(o*IT,s,a),this._isUserControllingZoom=!0)}(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._truckInternal(t,o,!1),this._isUserControllingTruck=!0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._truckInternal(t,o,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{RT(this._activePointers,zT),r.copy(zT),this._dragNeedsUpdate=!1,(0===this._activePointers.length||1===this._activePointers.length&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),0===this._activePointers.length&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",v),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),f())},this.unlockPointer=()=>{null!==this._lockedPointer&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))};const v=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),BT&&this._domElement.addEventListener("mousedown",s),this._domElement.addEventListener("pointercancel",c),this._domElement.addEventListener("wheel",d,{passive:!1}),this._domElement.addEventListener("contextmenu",p)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",s),this._domElement.removeEventListener("pointercancel",c),this._domElement.removeEventListener("wheel",d,{passive:!1}),this._domElement.removeEventListener("contextmenu",p),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==hT.NONE&&(this._state=hT.NONE,this._activePointers.length=0,g())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=bT(e.width,0,1),this._interactiveArea.height=bT(e.height,0,1),this._interactiveArea.x=bT(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=bT(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._isUserControllingRotate=!1;const r=bT(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=bT(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!n||wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._isUserControllingDolly=!1,this._lastDollyDirection=dT,this._changedDolly=0,this._dollyToNoClamp(bT(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const t=this._collisionTest(),r=wT(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._targetEnd.add(this._getCameraDirection(GT).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._isUserControllingZoom=!1,this._zoomEnd=bT(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||wT(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._camera.updateMatrix(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),jT.multiplyScalar(e),XT.multiplyScalar(-t);const r=HT.copy(jT).add(XT),i=WT.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];HT.setFromMatrixColumn(this._camera.matrix,0),HT.crossVectors(this._camera.up,HT),HT.multiplyScalar(e);const n=WT.copy(this._targetEnd).add(HT);return this.moveTo(n.x,n.y,n.z,t)}elevate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return HT.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+HT.x,this._targetEnd.y+HT.y,this._targetEnd.z+HT.z,t)}moveTo(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingTruck=!1;const i=HT.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const o=!r||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=HT.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t){let{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:o=0,paddingTop:s=0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=[],l=e.isBox3?KT.copy(e):KT.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const c=CT(this._sphericalEnd.theta,yT),u=CT(this._sphericalEnd.phi,yT);a.push(this.rotateTo(c,u,t));const h=HT.setFromSpherical(this._sphericalEnd).normalize(),d=tA.setFromUnitVectors(h,FT),p=wT(Math.abs(h.y),1);p&&d.multiply(nA.setFromAxisAngle(UT,c)),d.multiply(this._yAxisUpSpaceInverse);const f=QT.makeEmpty();WT.copy(l.min).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setX(l.max.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setY(l.max.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setZ(l.min.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setZ(l.max.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setY(l.min.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setX(l.min.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).applyQuaternion(d),f.expandByPoint(WT),f.min.x-=r,f.min.y-=o,f.max.x+=i,f.max.y+=s,d.setFromUnitVectors(FT,h),p&&d.premultiply(nA.invert()),d.premultiply(this._yAxisUpSpace);const m=f.getSize(HT),g=f.getCenter(WT).applyQuaternion(d);if(mT(this._camera)){const e=this.getDistanceToFitBox(m.x,m.y,m.z,n);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.dollyTo(e,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(gT(this._camera)){const e=this._camera,r=e.right-e.left,i=e.top-e.bottom,o=n?Math.max(r/m.x,i/m.y):Math.min(r/m.x,i/m.y);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.zoomTo(o,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const n=[],r=e instanceof DT.Sphere?eA.copy(e):oA.createBoundingSphere(e,eA);if(n.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),mT(this._camera)){const e=this.getDistanceToFitSphere(r.radius);n.push(this.dollyTo(e,t))}else if(gT(this._camera)){const e=this._camera.right-this._camera.left,i=this._camera.top-this._camera.bottom,o=2*r.radius,s=Math.min(e/o,i/o);n.push(this.zoomTo(s,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const a=WT.set(r,i,o),l=HT.set(e,t,n);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const c=!s||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(c)}lerpLookAt(e,t,n,r,i,o,s,a,l,c,u,h,d){let p=arguments.length>13&&void 0!==arguments[13]&&arguments[13];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const f=HT.set(r,i,o),m=WT.set(e,t,n);ZT.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const g=VT.set(c,u,h),v=WT.set(s,a,l);JT.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(g,d));const y=JT.theta-ZT.theta,_=JT.phi-ZT.phi,x=JT.radius-ZT.radius;this._sphericalEnd.set(ZT.radius+x*d,ZT.phi+_*d,ZT.theta+y*d),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const b=!p||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(b)}setPosition(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=this.getPosition(HT),o=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=bT(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const i=!r||wT(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&wT(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&wT(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrixWorldInverse,0),XT.setFromMatrixColumn(this._camera.matrixWorldInverse,1),$T.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=HT.set(e,t,n),i=r.distanceTo(this._camera.position),o=r.sub(this._camera.position);jT.multiplyScalar(o.x),XT.multiplyScalar(o.y),$T.multiplyScalar(o.z),HT.copy(jT).add(XT).add($T),HT.z=HT.z+i,this.dollyTo(i,!1),this.setFocalOffset(-HT.x,HT.y,-HT.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){null!==e?(this._viewport=this._viewport||new DT.Vector4,"number"==typeof e?this._viewport.set(e,t,n,r):this._viewport.copy(e)):this._viewport=null}getDistanceToFitBox(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(LT(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const i=e/t,o=this._camera.getEffectiveFOV()*xT,s=this._camera.aspect;return.5*((r?i>s:i<s)?t:e/s)/Math.tan(.5*o)+.5*n}getDistanceToFitSphere(e){if(LT(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*xT,n=2*Math.atan(Math.tan(.5*t)*this._camera.aspect),r=1<this._camera.aspect?t:n;return e/Math.sin(.5*r)}getTarget(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e instanceof DT.Spherical?e:new DT.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%vT,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=vT),this._spherical.theta+=vT*Math.round((this._sphericalEnd.theta-this._spherical.theta)/vT)}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!wT(this._camera.up.x,this._cameraUp0.x)||!wT(this._camera.up.y,this._cameraUp0.y)||!wT(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const e=this.getPosition(HT);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=HT.subVectors(this._target,this._camera.position).normalize(),t=WT.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(HT);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,i=YT.subVectors(this._targetEnd,this._target),o=qT.subVectors(this._focalOffsetEnd,this._focalOffset),s=this._zoomEnd-this._zoom;if(ST(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=AT(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=AT(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=AT(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(ST(i.x)&&ST(i.y)&&ST(i.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;ET(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(ST(o.x)&&ST(o.y)&&ST(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;ET(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(ST(s))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=AT(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}if(this.dollyToCursor)if(mT(this._camera)&&0!==this._changedDolly){const e=this._spherical.radius-this._lastDistance,t=this._camera,n=this._getCameraDirection(GT),r=HT.copy(n).cross(t.up).normalize();0===r.lengthSq()&&(r.x=1);const i=WT.crossVectors(r,n),o=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*xT*.5),s=(this._sphericalEnd.radius-e-this._sphericalEnd.radius)/this._sphericalEnd.radius,a=VT.copy(this._targetEnd).add(r.multiplyScalar(this._dollyControlCoord.x*o*t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y*o)),l=HT.copy(this._targetEnd).lerp(a,s),c=this._lastDollyDirection===pT&&this._spherical.radius<=this.minDistance,u=this._lastDollyDirection===fT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(c||u)){this._sphericalEnd.radius-=e,this._spherical.radius-=e;const t=WT.copy(n).multiplyScalar(-e);l.add(t)}this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedDolly-=e,ST(this._changedDolly)&&(this._changedDolly=0)}else if(gT(this._camera)&&0!==this._changedZoom){const e=this._zoom-this._lastZoom,t=this._camera,n=HT.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),r=WT.set(0,0,-1).applyQuaternion(t.quaternion),i=VT.copy(n).add(r.multiplyScalar(-n.dot(t.up))),o=-(this._zoom-e-this._zoom)/this._zoom,s=this._getCameraDirection(GT),a=this._targetEnd.dot(s),l=HT.copy(this._targetEnd).lerp(i,o),c=l.dot(s),u=s.multiplyScalar(c-a);l.sub(u),this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedZoom-=e,ST(this._changedZoom)&&(this._changedZoom=0)}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target);(!ST(this._focalOffset.x)||!ST(this._focalOffset.y)||!ST(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),$T.setFromMatrixColumn(this._camera.matrix,2),jT.multiplyScalar(this._focalOffset.x),XT.multiplyScalar(-this._focalOffset.y),$T.multiplyScalar(this._focalOffset.z),HT.copy(jT).add(XT).add($T),this._camera.position.add(HT)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),HT.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const l=this._needsUpdate;return l&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):l?(this.dispatchEvent({type:"update"}),ST(t,this.restThreshold)&&ST(n,this.restThreshold)&&ST(r,this.restThreshold)&&ST(i.x,this.restThreshold)&&ST(i.y,this.restThreshold)&&ST(i.z,this.restThreshold)&&ST(o.x,this.restThreshold)&&ST(o.y,this.restThreshold)&&ST(o.z,this.restThreshold)&&ST(s,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!l&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=l,this._needsUpdate=!1,l}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:MT(this.maxDistance),minZoom:this.minZoom,maxZoom:MT(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:MT(this.maxPolarAngle),minAzimuthAngle:MT(this.minAzimuthAngle),maxAzimuthAngle:MT(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:HT.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=TT(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=TT(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=TT(n.maxPolarAngle),this.minAzimuthAngle=TT(n.minAzimuthAngle),this.maxAzimuthAngle=TT(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this.verticalDragToForward=n.verticalDragToForward,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),ZT.setFromVector3(HT.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(ZT.theta,ZT.phi,t),this.dollyTo(ZT.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){this._domElement?console.warn("camera-controls is already connected."):(e.setAttribute("data-camera-controls-version","2.7.3"),this._addAllEventListeners(e),this._getClientRect(this._elementRect))}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find((t=>t.pointerId===e))}_findPointerByMouseButton(e){return this._activePointers.find((t=>t.mouseButton===e))}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(0===r)return e;const i=WT.copy(t).add(e),o=this._boundary.clampPoint(i,VT).sub(i),s=o.lengthSq();if(0===s)return e.add(t);if(s===r)return e;if(0===n)return e.add(t).add(o);{const r=1+n*s/t.dot(o);return e.add(WT.copy(t).multiplyScalar(r)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(mT(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*xT,r=Math.tan(.5*n)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(gT(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,o,0),this._nearPlaneCorners[3].set(n,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1))return e;if(LT(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(GT);rA.lookAt(NT,t,this._camera.up);for(let n=0;n<4;n++){const r=WT.copy(this._nearPlaneCorners[n]);r.applyMatrix4(rA);const i=VT.addVectors(this._target,r);iA.set(i,t),iA.far=this._spherical.radius+1;const o=iA.intersectObjects(this.colliderMeshes);0!==o.length&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise((e=>{const t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)})))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new DT.Sphere,n=t.center;KT.makeEmpty(),e.traverseVisible((e=>{e.isMesh&&KT.expandByObject(e)})),KT.getCenter(n);let r=0;return e.traverseVisible((e=>{if(!e.isMesh)return;const t=e,i=t.geometry.clone();i.applyMatrix4(t.matrixWorld);const o=i.attributes.position;for(let e=0,t=o.count;e<t;e++)HT.fromBufferAttribute(o,e),r=Math.max(r,n.distanceToSquared(HT))})),t.radius=Math.sqrt(r),t}}class sA extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){function t(e,t,n){for(let r=0,i=e.length;r<i;r++)if(e[r]!==t.getUint8(n+r))return!1;return!0}const n=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}(e);return function(e){const n=new DataView(e);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const r=[115,111,108,105,100];for(let e=0;e<5;e++)if(t(r,n,e))return!1;return!0}(n)?function(e){const t=new DataView(e),n=t.getUint32(80,!0);let r,i,o,s,a,l,c,u,h=!1;for(let e=0;e<70;e++)1129270351==t.getUint32(e,!1)&&82==t.getUint8(e+4)&&61==t.getUint8(e+5)&&(h=!0,s=new Float32Array(3*n*3),a=t.getUint8(e+6)/255,l=t.getUint8(e+7)/255,c=t.getUint8(e+8)/255,u=t.getUint8(e+9)/255);const d=new bv,p=new Float32Array(3*n*3),f=new Float32Array(3*n*3),m=new Kg;for(let e=0;e<n;e++){const n=84+50*e,u=t.getFloat32(n,!0),d=t.getFloat32(n+4,!0),g=t.getFloat32(n+8,!0);if(h){const e=t.getUint16(n+48,!0);0==(32768&e)?(r=(31&e)/31,i=(e>>5&31)/31,o=(e>>10&31)/31):(r=a,i=l,o=c)}for(let a=1;a<=3;a++){const l=n+12*a,c=3*e*3+3*(a-1);p[c]=t.getFloat32(l,!0),p[c+1]=t.getFloat32(l+4,!0),p[c+2]=t.getFloat32(l+8,!0),f[c]=u,f[c+1]=d,f[c+2]=g,h&&(m.set(r,i,o).convertSRGBToLinear(),s[c]=m.r,s[c+1]=m.g,s[c+2]=m.b)}}return d.setAttribute("position",new uv(p,3)),d.setAttribute("normal",new uv(f,3)),h&&(d.setAttribute("color",new uv(s,3)),d.hasColors=!0,d.alpha=u),d}(n):function(e){const t=new bv,n=/solid([\s\S]*?)endsolid/g,r=/facet([\s\S]*?)endfacet/g,i=/solid\s(.+)/;let o=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),l=new RegExp("normal"+s+s+s,"g"),c=[],u=[],h=[],d=new km;let p,f=0,m=0,g=0;for(;null!==(p=n.exec(e));){m=g;const e=p[0],n=null!==(p=i.exec(e))?p[1]:"";for(h.push(n);null!==(p=r.exec(e));){let e=0,t=0;const n=p[0];for(;null!==(p=l.exec(n));)d.x=parseFloat(p[1]),d.y=parseFloat(p[2]),d.z=parseFloat(p[3]),t++;for(;null!==(p=a.exec(n));)c.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),u.push(d.x,d.y,d.z),e++,g++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+o),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+o),o++}const s=m,v=g-m;t.userData.groupNames=h,t.addGroup(s,v,f),f++}return t.setAttribute("position",new pv(c,3)),t.setAttribute("normal",new pv(u,3)),t}("string"!=typeof(r=e)?(new TextDecoder).decode(r):r);var r}}let aA=e=>{let t=(e=>{let t=$n(e,((e,t)=>{let n=(e=>{let t=(e=>{let t=e.geometry;return{cs:t.boundingSphere.center,rd:t.boundingSphere.radius}})(e);return{xmin:t.cs.x-t.rd,xmax:t.cs.x+t.rd,ymin:t.cs.y-t.rd,ymax:t.cs.y+t.rd,zmin:t.cs.z-t.rd,zmax:t.cs.z+t.rd}})(e);return n}));return{xmin:fr($n(t,"xmin")),xmax:gr($n(t,"xmax")),ymin:fr($n(t,"ymin")),ymax:gr($n(t,"ymax")),zmin:fr($n(t,"zmin")),zmax:gr($n(t,"zmax"))}})(e),n=t.xmax-t.xmin,r=t.ymax-t.ymin,i=t.zmax-t.zmin;return{cs:{x:(t.xmax+t.xmin)/2,y:(t.ymax+t.ymin)/2,z:(t.zmax+t.zmin)/2},rd:gr([n,r,i])}};function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lA(Object(n),!0).forEach((function(t){ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}let uA=Math.PI/180,hA=180/Math.PI,dA=e=>e=ea.toRgbString(e);async function pA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uo(e)||(e=[]);let n=me(t,"domPanel");xo(n)||(n=document.body);let r=e=>{let t=0;if(Br(e.innerWidth))t=e.innerWidth;else{if(!Br(e.clientWidth))throw console.log("ele",e),new Error("can not get width from ele");t=e.clientWidth}let n=0;if(Br(e.innerWidth))n=e.innerHeight;else{if(!Br(e.clientWidth))throw console.log("ele",e),new Error("can not get height from ele");n=e.clientHeight}return{w:t,h:n}},i=r(n),o=i.w,s=i.h,a=me(t,"backgroundColor");ji(a)||(a="#222");let l=me(t,"useHelperAxes");ao(l)||(l=!0);let c=me(t,"helperAxesLengthRatio");$i(c)||(c=1),c=Yi(c);let u=me(t,"useHelperGrid");ao(u)||(u=!0);let h=me(t,"helperGridLengthRatio");$i(h)||(h=5),h=Yi(h);let d=me(t,"helperGridDensity");$i(d)||(d=50),d=Yi(d);let p=me(t,"helperGridPositionRatioZ");$i(p)||(p=-1),p=Yi(p);let f=me(t,"useLightAmbient");ao(f)||(f=!0);let m=me(t,"lightAmbientColor");ji(m)||(m="#999");let g=me(t,"useLightPoint");ao(g)||(g=!1);let v=me(t,"lightPointPoss");uo(v)||(v=[[5,5,5],[-5,5,5],[5,-5,5]]);let y=me(t,"lightPointColor");ji(y)||(y="#fff");let _=me(t,"lightPointIntensity");$i(_)||(_=100),_=Yi(_);let x=me(t,"lightPointDistance");$i(x)||(x=0),x=Yi(x);let b=me(t,"lightPointDecay");$i(b)||(b=2),b=Yi(b);let S=me(t,"useLightDirection");ao(S)||(S=!0);let w=me(t,"lightDirectionColor");ji(w)||(w="#fff");let C=me(t,"lightDirectionIntensity");$i(C)||(C=3),C=Yi(C);let M=me(t,"lightDirectionPos");uo(M)||(M=[10,10,10]);let T=me(t,"cameraType");"perspective"!==T&&"orthographic"!==T&&(T="perspective");let A=me(t,"cameraFov");$i(A)||(A=35),A=Yi(A);let E=me(t,"cameraNear");$i(E)||(E=.1),E=Yi(E);let R=me(t,"cameraFar");$i(R)||(R=1e3),R=Yi(R);let L=me(t,"cameraOrthographicRatio");$i(L)||(L=.5),L=Yi(L);let P=me(t,"cameraPos");uo(P)||(P=[1,1,1]);let I=me(t,"cameraAzimuthAngle");$i(I)||(I=130),I=Yi(I);let O=me(t,"cameraPolarAngle");$i(O)||(O=50),O=Yi(O);let k=me(t,"labelTextColor");ji(k)||(k="#fff");let B=me(t,"labelTextFontFamily");ji(B)||(B="Microsoft JhengHei");let D=me(t,"labelTextFontSize");ji(D)||(D="0.8rem");let N=me(t,"useAutoRotate");ao(N)||(N=!1);let U=me(t,"autoRotateDeg");$i(U)||(U=20),U=Yi(U);let F=Hi(),z=new sM,H=new $x;H.background=new Kg(dA(a));let W=null,V=()=>{W=new QM(c),W.visible=l,H.add(W)},G=()=>{H.remove(W),W.dispose(),W=null};V();let j=null,X=()=>{j=new WM(h,d),j.visible=u,j.geometry.rotateX(.5*Math.PI),j.geometry.translate(0,0,p),H.add(j)},$=()=>{H.remove(j),j.dispose(),j=null};X();let Y=null;Y=new GC(dA(m)),Y.visible=f,H.add(Y);let q=null,Z=()=>{q=[],jt(v,(e=>{let t=new HC(dA(y),_,x,b);t.visible=g;let n=me(e,0,0),r=me(e,1,0),i=me(e,2,0);t.position.set(n,r,i),H.add(t),q.push(t)}))},J=()=>{jt(q,(e=>{H.remove(e),e.dispose(),e=null})),q=null};Z();let K=null,Q=()=>{K=new VC(dA(w),C),K.visible=S;let e=me(M,0,0),t=me(M,1,0),n=me(M,2,0);K.position.set(e,t,n),H.add(K)},ee=()=>{H.remove(K),K.dispose(),K=null};Q();let te=(e,t)=>{let n=1;return t>0&&(n=e/t),n},ne=te(o,s),re=null,ie=()=>{(e=>{let t=e*s,n=o,r=s-t,i=-t,a=o,l=s;re.setViewOffset(n,r,0,i,a,l)})(-.08)},oe=()=>{"perspective"===T?re=new Yv(A,ne,E,R):"orthographic"===T&&(re=new _y(-L*ne,L*ne,L,-L,E,R)),(e=>{let t=me(e,0,0),n=me(e,1,0),r=me(e,2,0);re.position.set(t,n,r)})(P),re.up.x=0,re.up.y=0,re.up.z=1,ie()},se=()=>{re=null};oe();let ae=new Vx({antialias:!0});ae.setSize(o,s),n.appendChild(ae.domElement);let le=new aT;le.setSize(o,s),le.domElement.style.position="absolute",le.domElement.style.top="0px",le.domElement.style.left="0px",n.appendChild(le.domElement),oA.install({THREE:eT});let ce=null,ue=()=>{ce=new oA(re,le.domElement),ce.mouseButtons={left:oA.ACTION.ROTATE,middle:oA.ACTION.DOLLY,right:oA.ACTION.OFFSET,wheel:oA.ACTION.ZOOM},ce.touches={one:oA.ACTION.TOUCH_ROTATE,two:oA.ACTION.TOUCH_DOLLY_OFFSET,three:oA.ACTION.TOUCH_OFFSET}},he=()=>{ce=null};ue();let de=()=>{let e=me(ce,"azimuthAngle"),t=me(ce,"polarAngle");return{azimuthAngle:e*hA,polarAngle:t*hA}},pe=(e,t)=>{Ce(ce,"azimuthAngle",e*uA),Ce(ce,"polarAngle",t*uA)};pe(I,O);let fe=null,ge=setInterval((()=>{let e=de();Or(e,fe)||(fe=e,F.emit("change-view-angle",e))}),50),ve=null,ye=()=>{ve=new Nx,H.add(ve)},_e=()=>{ve.traverse((function(e){e.isMesh&&(e.geometry.dispose(),e.material.dispose())})),H.remove(ve),ve=null};ye();let xe=[],be=async e=>{let t=me(e,"type","");if(ji(t)||(t=function(e){if(!ji(e))return"";let t=Ya(Wd(e),".");if(gt(t)<=1)return"";let n="";try{n=ml(t)}catch(e){}return n}(e.url)),"stl"!==t)throw new Error("現在僅支援stl檔");let n=me(e,"color",""),r=ea.toRgba(n),i=ea.toRgbString(r),o=r.a,s=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=me(n,"color",null);ji(r)||(r="#fff"),r=ea.toRgbString(r);let i=me(n,"opacity",null);Br(i)||(i=1);let o=i<1,s=new sA,a=await s.loadAsync(t,(n=>{let r=n.loaded/n.total*100;e.emit("loading",{url:t,prog:r})})),l=new Kw({color:new Kg(r),depthTest:!0,depthWrite:!0,transparent:o,opacity:i,side:2});return new Fv(a,l)}(F,e.url,{color:i,opacity:o});s.name=e.name,s.color=n,xe.push(s),ve.add(s)},Se=async e=>{await So(e,(async e=>{await be(e)}))};await Se(e);let we={},Me=()=>{jt(xe,(e=>{let t=e.geometry,n=1/we.r;t.scale(n,n,n),t.translate(we.x,we.y,we.z)}))},Te=[],Ae=()=>{jt(Te,(e=>{cl(e)})),Te=[]},Ee=async()=>{Le(),await wo(1),(()=>{let e=aA(xe),t=e.cs,n=1;e.rd>0&&(n=1/e.rd),we=cA(cA({},t),{},{r:n})})(),jt(xe,(e=>{let t=e.geometry;t.translate(-we.x,-we.y,-we.z),t.scale(we.r,we.r,we.r)})),jt(xe,(e=>{let t=document.createElement("div");t.textContent=e.name,t.style.color=k,t.style.fontSize=D,t.style.fontFamily=B,t.style.visibility="visible";let n=new tT(t),r=e.geometry.boundingSphere.center;n.position.set(r.x,r.y,r.z),Te.push(t),e.add(n)})),Le()},Re=(e,t)=>{if(!xo(me(Te,e)))return null;try{let n="hidden";!0===t&&(n="visible"),Te[e].style.visibility=n}catch(e){console.log(e)}},Le=()=>{try{ae.render(H,re),le.render(H,re)}catch(e){console.log(e)}};Ee().then((()=>{F.emit("init")}));let Pe=!1,Ie=()=>{if(!Pe)try{let e=z.getDelta(),t=ce.update(e);if(N){let t=-U*uA*e;ce.azimuthAngle+=t}requestAnimationFrame(Ie),t&&Le()}catch(e){console.log(e)}};Ie();return F.render=Le,F.resize=()=>{let e=r(n);o=e.w,s=e.h,ne=te(o,s),re.aspect=ne,re.updateProjectionMatrix(),ie(),ae.setSize(o,s),le.setSize(o,s),Le()},F.dispose=()=>{F.emit("dispose"),clearInterval(ge),Pe=!0,_e(),G(),$(),H.remove(Y),Y.dispose(),Y=null,J(),ee(),Ae(),(()=>{let e=e=>{e.dispose();for(let t of Object.keys(e)){let n=e[t];n&&"object"==typeof n&&"minFilter"in n&&n.dispose()}};H.traverse((t=>{if(t.isLight&&t.dispose(),t.isMesh)if(t.geometry.dispose(),t.material.isMaterial)e(t.material);else for(let n of t.material)e(n)})),H=null})(),cl(ae.domElement),cl(le.domElement),ae.dispose(),ae=null,le=null,z=null,he(),se(),H=null},F.getUseAutoRotate=()=>N,F.setUseAutoRotate=e=>{N=e},F.setAutoRotateDeg=e=>{U=e},F.setCameraViewAngle=pe,F.getCameraViewAngle=de,F.setCameraAzimuthAngle=e=>{I=e,pe(I,O)},F.setCameraPolarAngle=e=>{O=e,pe(I,O)},F.setBackgroundColor=e=>{a=e,H.background=new Kg(dA(e)),Le()},F.getUseHelperAxes=()=>l,F.setUseHelperAxes=e=>{l=e,W.visible=e,Le()},F.setHelperAxesLengthRatio=e=>{c=e,G(),V(),Le()},F.getUseHelperGrid=()=>u,F.setUseHelperGrid=e=>{u=e,j.visible=e,Le()},F.setHelperGridLengthRatio=e=>{h=e,$(),X(),Le()},F.setHelperGridDensity=e=>{d=e,$(),X(),Le()},F.setHelperGridPositionRatioZ=e=>{p=e,$(),X(),Le()},F.setUseLightAmbient=e=>{f=e,Y.visible=e,Le()},F.setLightAmbientColor=e=>{m=e,Y.color=new Kg(dA(e)),Le()},F.setUseLightPoint=e=>{g=e,jt(q,(t=>{t.visible=e})),Le()},F.setLightPointPoss=e=>{v=e,J(),Z(),Le()},F.setLightPointColor=e=>{y=e,J(),Z(),Le()},F.setLightPointIntensity=e=>{_=e,J(),Z(),Le()},F.setLightPointDistance=e=>{x=e,J(),Z(),Le()},F.setLightPointDecay=e=>{b=e,J(),Z(),Le()},F.setUseLightDirection=e=>{S=e,K.visible=e,Le()},F.setLightDirectionColor=e=>{w=e,K.color=new Kg(dA(e)),Le()},F.setLightDirectionIntensity=e=>{C=e,ee(),Q(),Le()},F.setLightDirectionPos=e=>{M=e,ee(),Q(),Le()},F.getCameraType=()=>T,F.setCameraType=e=>{T=e,se(),oe(),he(),ue(),Le()},F.setCameraFov=e=>{A=e,re.fov=e,re.updateProjectionMatrix(),Le()},F.setCameraNear=e=>{E=e,re.near=e,re.updateProjectionMatrix(),Le()},F.setCameraFar=e=>{R=e,re.far=e,re.updateProjectionMatrix(),Le()},F.setCameraOrthographicRatio=e=>{L=e,se(),oe(),he(),ue(),Le()},F.addMesh=async e=>{Me(),Ae(),await be(e),Ee()},F.addMeshs=async e=>{Me(),Ae(),await Se(e),Ee()},F.getMeshsInfor=()=>{let e=$n(xe,((e,t)=>{let n=me(e,"color",""),r=me(Te,t),i=me(r,"textContent",""),o=me(r,"style.color",""),s=me(r,"style.fontSize",""),a=me(r,"style.fontFamily","");return{visible:e.visible,color:n,labelText:i,labelTextColor:o,labelTextFontSize:s,labelTextFontFamily:a}}));return e},F.setMeshVisible=(e,t)=>{((e,t)=>{if(!ho(me(xe,e)))return null;try{xe[e].visible=t}catch(e){console.log(e)}})(e,t),Re(e,t),Le()},F.setMeshColor=(e,t)=>{if(!ho(me(xe,e)))return null;try{let n=ea.toRgba(t),r=ea.toRgbString(n),i=n.a;xe[e].material.color=new Kg(r),xe[e].material.opacity=i,xe[e].color=t}catch(e){console.log(e)}Le()},F.setMeshLabelVisible=(e,t)=>{Re(e,t),Le()},F.setMeshLabelText=(e,t)=>{if(!xo(me(Te,e)))return null;try{Te[e].textContent=t}catch(e){console.log(e)}Le()},F.setMeshLabelTextColor=(e,t)=>{if(!xo(me(Te,e)))return null;try{Te[e].style.color=t}catch(e){console.log(e)}Le()},F.setMeshLabelTextFontSize=(e,t)=>{if(!xo(me(Te,e)))return null;try{Te[e].style.fontSize=t}catch(e){console.log(e)}Le()},F.setMeshLabelTextFontFamily=(e,t)=>{if(!xo(me(Te,e)))return null;try{Te[e].style.fontFamily=t}catch(e){console.log(e)}Le()},F.cleanMeshs=()=>{jt(xe,(e=>{ve.remove(e)})),_e(),xe=[],ye(),Ae(),Le()},F}const fA={directives:{domresize:ca()},components:{WIconLoading:ol,WGroupIconCheck:jc,WIcon:fl,WColorSelect:zd},props:{opt:{type:Object,default:()=>{}}},data:function(){return{mdiEyeOutline:"M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",mdiEyeOffOutline:"M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",loading:!0,timer:null,itemsSelectIds:[],itemsSelects:[],useSetting:!0,useAutoRotate:!1,useHelperAxes:!0,useHelperGrid:!0,usePerspective:!0,useLegend:!0,optTemp:null,meshs:[],ev:null,menuSettingIcon:"",menuSettingTooltip:"",menuAutoRotateIcon:"",menuAutoRotateTooltip:"",menuAxesIcon:"",menuAxesTooltip:"",menuGridIcon:"",menuGridTooltip:"",menuPerspectiveIcon:"",menuPerspectiveTooltip:"",menuLegendIcon:"",menuLegendTooltip:"",useLegnedBackgroundColor:"",useLegnedHeight:""}},mounted:function(){let e,t=this;t.timer=setInterval((()=>{e=t.getParam("useHelperAxes"),t.useHelperAxes!==e&&(t.useHelperAxes=e),e=t.getParam("useAutoRotate"),t.useAutoRotate!==e&&(t.useAutoRotate=e),e=t.getParam("useHelperGrid"),t.useHelperGrid!==e&&(t.useHelperGrid=e),e="perspective"===t.getParam("cameraType"),t.usePerspective!==e&&(t.usePerspective=e),e=t.getMeshs(),Or(t.meshs,e)||(t.meshs=e),t.syncItemsSelectIds(),t.updateItemsSelects(!1)}),50)},beforeDestroy:function(){clearInterval(this.timer),this.dispose()},watch:{opt:{handler(e){let t=this;t.loading?t.init().finally((()=>{t.optTemp=Ni(t.opt)})):t.modify().finally((()=>{t.optTemp=Ni(t.opt)}))},immediate:!0,deep:!0}},computed:{widthInp:function(){let e=0,t=me(this,"opt.width","");return $i(t)&&(e=Yi(t)),e},heightInp:function(){let e=0,t=me(this,"opt.height","");return $i(t)&&(e=Yi(t)),e},items:function(){let e=this;return[{id:"setting",icon:e.menuSettingIcon,tooltip:e.menuSettingTooltip},{id:"auto_rotate",icon:e.menuAutoRotateIcon,tooltip:e.menuAutoRotateTooltip},{id:"axes",icon:e.menuAxesIcon,tooltip:e.menuAxesTooltip},{id:"grid",icon:e.menuGridIcon,tooltip:e.menuGridTooltip},{id:"perspective",icon:e.menuPerspectiveIcon,tooltip:e.menuPerspectiveTooltip},{id:"legend",icon:e.menuLegendIcon,tooltip:e.menuLegendTooltip}]},useItems:function(){let e=this,t=[];return t=e.useSetting?Ni(e.items):[Ni(e.items[0])],t}},methods:{resizePanel:function(e){let t=this;if(null===t.ev)return;let n=me(t,"ev.resize");Vi(n)&&(n(),t.$emit("resize",e))},syncItemsSelectIds:function(){let e=this,t=[];e.useSetting&&t.push("setting"),e.useAutoRotate&&t.push("auto_rotate"),e.useHelperAxes&&t.push("axes"),e.useHelperGrid&&t.push("grid"),e.usePerspective&&t.push("perspective"),e.useLegend&&t.push("legend"),Or(e.itemsSelectIds,t)||(e.itemsSelectIds=t)},updateItemsSelects:function(e=!1){let t=this,n=$n(t.itemsSelects,"id");if(!e&&Or(t.itemsSelectIds,n))return;let r=[];jt(t.itemsSelectIds,(e=>{let n=ur(t.items,{id:e});ho(n)?r.push(n):console.log(`invalid id[${e}]`)})),t.itemsSelects=r},updateMenus:function(){let e=this,t=me(e,"opt.menuSettingIcon","");ji(t)||(t="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z");let n=me(e,"opt.menuSettingTooltip","");ji(n)||(n="Settings");let r=me(e,"opt.menuAutoRotateIcon","");ji(r)||(r="M10,12L14,16L10,20V16.9C5.44,16.44 2,14.42 2,12C2,9.58 5.44,7.56 10,7.1V9.09C6.55,9.43 4,10.6 4,12C4,13.4 6.55,14.57 10,14.91V12M20,12C20,10.6 17.45,9.43 14,9.09V7.1C18.56,7.56 22,9.58 22,12C22,14.16 19.26,16 15.42,16.7L16.12,16L14.92,14.79C17.89,14.36 20,13.27 20,12M11,2H13V13L11,11V2M11,22V21L13,19V22H11Z");let i=me(e,"opt.menuAutoRotateTooltip","");ji(i)||(i="Auto rotate");let o=me(e,"opt.menuAxesIcon","");ji(o)||(o="M2.61,21L1.61,19.27L11,13.85V3H13V13.85L22.39,19.27L21.39,21L12,15.58L2.61,21Z");let s=me(e,"opt.menuAxesTooltip","");ji(s)||(s="Axes");let a=me(e,"opt.menuGridIcon","");ji(a)||(a="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z");let l=me(e,"opt.menuGridTooltip","");ji(l)||(l="Grid");let c=me(e,"opt.menuPerspectiveIcon","");ji(c)||(c="M20 2H4C3.45 2 3 2.45 3 3V4C3 4.55 3.45 5 4 5H5V14H11V16.59L6.79 20.79L8.21 22.21L11 19.41V22H13V19.41L15.79 22.21L17.21 20.79L13 16.59V14H19V5H20C20.55 5 21 4.55 21 4V3C21 2.45 20.55 2 20 2M17 12H7V5H17V12Z");let u=me(e,"opt.menuPerspectiveTooltip","");ji(u)||(u="Perspective");let h=me(e,"opt.menuLegendIcon","");ji(h)||(h="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z");let d=me(e,"opt.menuLegendTooltip","");ji(d)||(d="Legend"),e.menuSettingIcon=t,e.menuSettingTooltip=n,e.menuAutoRotateIcon=r,e.menuAutoRotateTooltip=i,e.menuAxesIcon=o,e.menuAxesTooltip=s,e.menuGridIcon=a,e.menuGridTooltip=l,e.menuPerspectiveIcon=c,e.menuPerspectiveTooltip=u,e.menuLegendIcon=h,e.menuLegendTooltip=d,e.updateItemsSelects(!0)},refreshLegend:function(){let e=this,t=me(e,"opt.legnedBackgroundColor","");ji(t)||(t="rgba(90,90,90,0.5)"),e.useLegnedBackgroundColor=ea.toRgbaString(t);let n=me(e,"opt.legnedHeight",null),r=me(e,"opt.legnedHeightMax",null),i="";$i(n)&&(n=Yi(n),i+=`height:${n}px;`),$i(r)&&(r=Yi(r),i+=`max-height:${r}px;`),($i(n)||$i(r))&&(i+="overflow-y:auto;"),e.useLegnedHeight=i},init:async function(){let e=this;await async function(){e.dispose(),await no((()=>xo(e.$refs.panel))),e.loading=!0;let t=Ni(e.opt);t.domPanel=e.$refs.panel;let n=me(t,"items",[]),r=await pA(n,t);r.on("init",(()=>{e.$emit("init"),e.updateMenus(),e.refreshLegend(),e.loading=!1})),r.on("loading",(t=>{e.$emit("loading",t)})),r.on("dispose",(()=>{e.$emit("dispose")})),r.on("change-view-angle",(t=>{e.$emit("change-view-angle",t)})),e.ev=r}().catch((e=>{console.log(e)}))},modify:async function(){let e=this;await async function(){if(null===e.ev)return;await wo(300);let t=Ht(e.opt),n=Ht(e.optTemp),r=[];jt(t,(t=>{let i=me(e,`opt.${t}`,null),o=me(e,`optTemp.${t}`,null);Or(i,o)||r.push({type:"mod",k:t,vOld:o,vNew:i}),Rr(n,t)})),jt(n,(t=>{let n=me(e,`optTemp.${t}`,null);r.push({type:"del",k:t,vOld:n,vNew:null})}));let i={backgroundColor:"ev.setBackgroundColor",useAutoRotate:"ev.setUseAutoRotate",autoRotateDeg:"ev.setAutoRotateDeg",useHelperAxes:"ev.setUseHelperAxes",helperAxesLengthRatio:"ev.setHelperAxesLengthRatio",useHelperGrid:"ev.setUseHelperGrid",helperGridLengthRatio:"ev.setHelperGridLengthRatio",helperGridDensity:"ev.setHelperGridDensity",helperGridPositionRatioZ:"ev.setHelperGridPositionRatioZ",useLightAmbient:"ev.setUseLightAmbient",lightAmbientColor:"ev.setLightAmbientColor",useLightPoint:"ev.setUseLightPoint",lightPointPoss:"ev.setLightPointPoss",lightPointColor:"ev.setLightPointColor",lightPointIntensity:"ev.setLightPointIntensity",lightPointDistance:"ev.setLightPointDistance",lightPointDecay:"ev.setLightPointDecay",useLightDirection:"ev.setUseLightDirection",lightDirectionColor:"ev.setLightDirectionColor",lightDirectionIntensity:"ev.setLightDirectionIntensity",lightDirectionPos:"ev.setLightDirectionPos",cameraType:"ev.setCameraType",cameraFov:"ev.setCameraFov",cameraNear:"ev.setCameraNear",cameraFar:"ev.setCameraFar",cameraOrthographicRatio:"ev.setCameraOrthographicRatio",cameraAzimuthAngle:"ev.setCameraAzimuthAngle",cameraPolarAngle:"ev.setCameraPolarAngle",menuSettingIcon:"updateMenus",menuSettingTooltip:"updateMenus",menuAutoRotateIcon:"updateMenus",menuAutoRotateTooltip:"updateMenus",menuAxesIcon:"updateMenus",menuAxesTooltip:"updateMenus",menuGridIcon:"updateMenus",menuGridTooltip:"updateMenus",menuPerspectiveIcon:"updateMenus",menuPerspectiveTooltip:"updateMenus",menuLegendIcon:"updateMenus",menuLegendTooltip:"updateMenus",legnedBackgroundColor:"refreshLegend",legnedHeight:"refreshLegend",legnedHeightMax:"refreshLegend"};jt(r,(t=>{let n=t.k;if(io(i,n)){let r=me(e,i[n]);try{r(t.vNew)}catch(e){console.log(e)}}else console.log(`尚未建置 ${n} 之 set 函數`)}))}().catch((e=>{console.log(e)}))},dispose:function(){let e=this;setTimeout((()=>{if(null===e.ev)return;Vi(me(e,"ev.dispose"))&&(e.ev.dispose(),e.ev=null)}),1)},getInst:function(){return me(this,"ev")},getMeshs:function(){let e=me(this,"ev.getMeshsInfor"),t=[];return Vi(e)&&(t=e()),t},getMeshColor:function(e){let t=me(e,"color","");return t=ea.toRgbaString(t),t},setMeshColor:function(e,t,n){this.ev.setMeshColor(t,n)},toggleMeshVisible:function(e,t){this.ev.setMeshVisible(t,!e.visible)},strUpperHead:function(e){let t=Mo(e,1);return t=hr(t),`${t}${Ao(e,1)}`},getParam:function(e){let t=null,n=me(this,`ev.get${e=this.strUpperHead(e)}`);return Vi(n)&&(t=n()),t},setParam:function(e,t){let n=me(this,`ev.set${e=this.strUpperHead(e)}`);Vi(n)&&n(t)},toggleParam:function(e){let t=this.getParam(e);t=!t,this.setParam(e,t)},ckItem:function(e){let t=this,n={setting:()=>{t.useSetting=!t.useSetting},axes:()=>{t.toggleParam("useHelperAxes")},auto_rotate:()=>{t.toggleParam("useAutoRotate")},grid:()=>{t.toggleParam("useHelperGrid")},perspective:()=>{t.usePerspective?t.setParam("cameraType","orthographic"):t.setParam("cameraType","perspective")},legend:()=>{t.useLegend=!t.useLegend}},r=me(e,"id",""),i=me(n,r);Vi(i)?i():(console.log("item",e),console.log("kp",n),console.log(`invalid id[${r}]`))}}};var mA=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.widthInp+"px; min-width:"+e.widthInp+"px; height:"+e.heightInp+"px; overflow-y:hidden;"},[e.loading?n("div",{staticStyle:{position:"relative",width:"0px",height:"0px"}},[n("div",{staticStyle:{position:"absolute",top:"0px",left:"0px"}},[n("WIconLoading")],1)]):e._e(),e._v(" "),n("div",{staticStyle:{position:"relative"}},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"panel",style:"position:relative; width:"+e.widthInp+"px; height:"+e.heightInp+"px; opacity:"+(e.loading?0:1)+";",on:{domresize:e.resizePanel}}),e._v(" "),e.loading?e._e():n("div",{style:"position:absolute; top:0px; left:0px;"},[n("div",{staticStyle:{padding:"10px",display:"flex","align-items":"flex-start"}},[n("WGroupIconCheck",{attrs:{items:e.useItems,dir:"vertical",iconColor:"#aaa",iconColorHover:"#ccc",iconColorFocus:"#ccc",iconColorActive:"#fff",backgroundColor:"#000",backgroundColorHover:"#111",backgroundColorFocus:"#111",backgroundColorActive:"#444",seplineColor:"#333",tooltipTextFontSize:"0.7rem",value:e.itemsSelects,_input:"updateItem"},on:{click:e.ckItem}}),e._v(" "),e.useLegend?[n("div",{style:"padding-left:10px;"}),e._v(" "),n("div",{style:"padding:5px; border-radius:4px; background:"+e.useLegnedBackgroundColor+";"},[n("div",{style:""+e.useLegnedHeight},e._l(e.meshs,(function(t,r){return n("div",{key:"km-"+r,style:""},[n("div",{staticStyle:{display:"flex","align-items":"center",padding:"3px"}},[n("WIcon",{staticStyle:{cursor:"pointer"},attrs:{icon:t.visible?e.mdiEyeOutline:e.mdiEyeOffOutline,color:"#ccc",colorHover:"#ddd",size:20},on:{click:function(n){return e.toggleMeshVisible(t,r)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WColorSelect",{attrs:{colorBlockBorderColor:"#888",showColorText:!1,_colorTextColor:"'#ddd'",panelBackgroundColor:"#111",toolBackgroundColor:"#222",menuIconColor:"#666",menuIconColorHover:"#777",menuIconColorActive:"#ddd",borderColor:"#333",borderColorHover:"#333",borderColorActive:"#444",backgroundColor:"#111",menuBackgroundColor:"#111",menuBackgroundColorHover:"#222",menuBackgroundColorActive:"#333",menuTextColor:"#b2b2b2",menuTextColorHover:"#ccc",menuTextColorActive:"#ddd",menuTextFontSize:"0.75rem",inputBorderColor:"#444",inputBorderColorHover:"#555",inputBorderColorActive:"#666",inputBackgroundColor:"#000",inputBackgroundColorHover:"#111",inputBackgroundColorActive:"#222",inputTextColor:"#999",inputLabelColor:"#888",barProgColor:"#888",barProgBackgroundColor:"#222",barSliderBackgroundColor:"#ccc",barSliderBackgroundColorHover:"#ddd",btnTextColor:"#eee",btnTextColorHover:"#fff",btnTextColorActive:"#fff",btnBackgroundColor:"#444",btnBackgroundColorHover:"#555",btnBackgroundColorActive:"#555",value:e.getMeshColor(t)},on:{input:function(n){e.setMeshColor(t,r,n)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("div",{style:"color:"+t.labelTextColor+"; font-size:"+t.labelTextFontSize+"; font-family:"+t.labelTextFontFamily+";"},[e._v("\n "+e._s(t.labelText)+"\n ")])],1)])})),0)])]:e._e()],2)])])])};mA._withStripped=!0;return Ka({render:mA,staticRenderFns:[]},(function(e){e&&e("data-v-7131ee8a_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WThreejsVue.vue"},media:void 0})}),fA,"data-v-7131ee8a",false,undefined,!1,el,void 0,void 0)}));
|
|
26
|
+
//# sourceMappingURL=w-threejs-vue.umd.js.map
|