@iwer/devui 1.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,n={exports:{}},i={};var r,a,o,s={exports:{}},l={};function c(){if(r)return l;r=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function y(){}function x(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var _=x.prototype=new y;_.constructor=x,m(_,v.prototype),_.isPureReactComponent=!0;var b=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},w=Object.prototype.hasOwnProperty;function M(t,n,i,r,a,o){return i=o.ref,{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:o}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var T=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function C(){}function R(n,i,r,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,u=!1;if(null===n)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case e:case t:u=!0;break;case h:return R((u=n._init)(n._payload),i,r,a,o)}}if(u)return o=o(n),u=""===a?"."+A(n,0):a,b(o)?(r="",null!=u&&(r=u.replace(T,"$&/")+"/"),R(o,i,r,"",(function(e){return e}))):null!=o&&(E(o)&&(l=o,c=r+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(T,"$&/")+"/")+u,o=M(l.type,c,void 0,0,0,l.props)),i.push(o)),1;u=0;var d,p=""===a?".":a+":";if(b(n))for(var m=0;m<n.length;m++)u+=R(a=n[m],i,r,s=p+A(a,m),o);else if("function"==typeof(m=null===(d=n)||"object"!=typeof d?null:"function"==typeof(d=f&&d[f]||d["@@iterator"])?d:null))for(n=m.call(n),m=0;!(a=n.next()).done;)u+=R(a=a.value,i,r,s=p+A(a,m++),o);else if("object"===s){if("function"==typeof n.then)return R(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(C,C):(e.status="pending",e.then((function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)}),(function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)}))),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),i,r,a,o);throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return u}function P(e,t,n){if(null==e)return e;var i=[],r=0;return R(e,i,"","",(function(e){return t.call(n,e,r++)})),i}function L(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function N(){}return l.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},l.Component=v,l.Fragment=n,l.Profiler=a,l.PureComponent=x,l.StrictMode=i,l.Suspense=u,l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,l.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},l.cache=function(e){return function(){return e.apply(null,arguments)}},l.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=m({},e.props),r=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(r=""+t.key),t)!w.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(i[a]=t[a]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];i.children=o}return M(e.type,r,void 0,0,0,i)},l.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},l.createElement=function(e,t,n){var i,r={},a=null;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)w.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in o=e.defaultProps)void 0===r[i]&&(r[i]=o[i]);return M(e,a,void 0,0,0,r)},l.createRef=function(){return{current:null}},l.forwardRef=function(e){return{$$typeof:c,render:e}},l.isValidElement=E,l.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},l.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},l.startTransition=function(e){var t=S.T,n={};S.T=n;try{var i=e(),r=S.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(N,k)}catch(e){k(e)}finally{S.T=t}},l.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},l.use=function(e){return S.H.use(e)},l.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},l.useCallback=function(e,t){return S.H.useCallback(e,t)},l.useContext=function(e){return S.H.useContext(e)},l.useDebugValue=function(){},l.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},l.useEffect=function(e,t,n){var i=S.H;if("function"==typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(e,t)},l.useId=function(){return S.H.useId()},l.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},l.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},l.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},l.useMemo=function(e,t){return S.H.useMemo(e,t)},l.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},l.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},l.useRef=function(e){return S.H.useRef(e)},l.useState=function(e){return S.H.useState(e)},l.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},l.useTransition=function(){return S.H.useTransition()},l.version="19.1.0",l}function u(){return a||(a=1,s.exports=c()),s.exports}var d=(o||(o=1,n.exports=function(){if(t)return i;t=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(t,n,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==n.key&&(r=""+n.key),"key"in n)for(var a in i={},n)"key"!==a&&(i[a]=n[a]);else i=n;return n=i.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:i}}return i.Fragment=n,i.jsx=r,i.jsxs=r,i}()),n.exports);const h=()=>{};let f={},p={},m=null,g={mark:h,measure:h};try{"undefined"!=typeof window&&(f=window),"undefined"!=typeof document&&(p=document),"undefined"!=typeof MutationObserver&&(m=MutationObserver),"undefined"!=typeof performance&&(g=performance)}catch(e){}const{userAgent:v=""}=f.navigator||{},y=f,x=p,_=m,b=g;y.document;const S=!!x.documentElement&&!!x.head&&"function"==typeof x.addEventListener&&"function"==typeof x.createElement,w=~v.indexOf("MSIE")||~v.indexOf("Trident/");var M="classic",E="duotone",T="sharp",A="sharp-duotone",C=[M,E,T,A],R={fak:"kit","fa-kit":"kit"},P={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},L={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},k=[1,2,3,4,5,6,7,8,9,10],N=k.concat([11,12,13,14,15,16,17,18,19,20]),D={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},I=[...Object.keys({classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]}),"solid","regular","light","thin","duotone","brands","2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",D.GROUP,D.SWAP_OPACITY,D.PRIMARY,D.SECONDARY].concat(k.map((e=>"".concat(e,"x")))).concat(N.map((e=>"w-".concat(e)))),O={kit:"fak"},U={"kit-duotone":"fakd"};const z="___FONT_AWESOME___",F=16,B="fa",H="svg-inline--fa",V="data-fa-i2svg",j="data-fa-pseudo-element",G="data-fa-pseudo-element-pending",W="data-prefix",X="data-icon",$="fontawesome-i2svg",q="async",Y=["HTML","HEAD","STYLE","SCRIPT"],Z=(()=>{try{return!0}catch(e){return!1}})(),K=[M,T,A];function Q(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[M]})}const J={...L};J[M]={...L[M],...R,...P};const ee=Q(J),te={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}};te[M]={...te[M],...O,...U};const ne=Q(te),ie={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}};ie[M]={...ie[M],fak:"fa-kit"};const re=Q(ie),ae={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}};ae[M]={...ae[M],"fa-kit":"fak"};const oe=Q(ae),se=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,le="fa-layers-text",ce=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;Q({classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}});const ue=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],de=D,he=new Set;Object.keys(ne[M]).map(he.add.bind(he)),Object.keys(ne[T]).map(he.add.bind(he)),Object.keys(ne[A]).map(he.add.bind(he));const fe=["kit",...I],pe=y.FontAwesomeConfig||{};if(x&&"function"==typeof x.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((e=>{let[t,n]=e;const i=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=x.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=i&&(pe[n]=i)}))}const me={styleDefault:"solid",familyDefault:"classic",cssPrefix:B,replacementClass:H,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};pe.familyPrefix&&(pe.cssPrefix=pe.familyPrefix);const ge={...me,...pe};ge.autoReplaceSvg||(ge.observeMutations=!1);const ve={};Object.keys(me).forEach((e=>{Object.defineProperty(ve,e,{enumerable:!0,set:function(t){ge[e]=t,ye.forEach((e=>e(ve)))},get:function(){return ge[e]}})})),Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(e){ge.cssPrefix=e,ye.forEach((e=>e(ve)))},get:function(){return ge.cssPrefix}}),y.FontAwesomeConfig=ve;const ye=[];const xe=F,_e={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};const be="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Se(){let e=12,t="";for(;e-- >0;)t+=be[62*Math.random()|0];return t}function we(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Me(e){return e.classList?we(e.classList):(e.getAttribute("class")||"").split(" ").filter((e=>e))}function Ee(e){return"".concat(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Te(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";")),"")}function Ae(e){return e.size!==_e.size||e.x!==_e.x||e.y!==_e.y||e.rotate!==_e.rotate||e.flipX||e.flipY}var Ce=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-counter-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(-1 * var(--fa-li-width, 2em));\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n animation-name: fa-beat;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n animation-name: fa-bounce;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n animation-name: fa-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n animation-name: fa-beat-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n animation-name: fa-flip;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n animation-name: fa-shake;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n animation-name: fa-spin;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 2s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n animation-name: fa-spin;\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n animation-delay: -1ms;\n animation-duration: 1ms;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n transform: scale(1);\n }\n 45% {\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-bounce {\n 0% {\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-flip {\n 50% {\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-shake {\n 0% {\n transform: rotate(-15deg);\n }\n 4% {\n transform: rotate(15deg);\n }\n 8%, 24% {\n transform: rotate(-18deg);\n }\n 12%, 28% {\n transform: rotate(18deg);\n }\n 16% {\n transform: rotate(-22deg);\n }\n 20% {\n transform: rotate(22deg);\n }\n 32% {\n transform: rotate(-12deg);\n }\n 36% {\n transform: rotate(12deg);\n }\n 40%, 100% {\n transform: rotate(0deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';function Re(){const e=B,t=H,n=ve.cssPrefix,i=ve.replacementClass;let r=Ce;if(n!==e||i!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");r=r.replace(a,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(i))}return r}let Pe=!1;function Le(){ve.autoAddCss&&!Pe&&(!function(e){if(!e||!S)return;const t=x.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=x.head.childNodes;let i=null;for(let e=n.length-1;e>-1;e--){const t=n[e],r=(t.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=t)}x.head.insertBefore(t,i)}(Re()),Pe=!0)}var ke={mixout:()=>({dom:{css:Re,insertCss:Le}}),hooks:()=>({beforeDOMElementCreation(){Le()},beforeI2svg(){Le()}})};const Ne=y||{};Ne[z]||(Ne[z]={}),Ne[z].styles||(Ne[z].styles={}),Ne[z].hooks||(Ne[z].hooks={}),Ne[z].shims||(Ne[z].shims=[]);var De=Ne[z];const Ie=[],Oe=function(){x.removeEventListener("DOMContentLoaded",Oe),Ue=1,Ie.map((e=>e()))};let Ue=!1;function ze(e){const{tag:t,attributes:n={},children:i=[]}=e;return"string"==typeof e?Ee(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,'="').concat(Ee(e[n]),'" ')),"").trim()}(n),">").concat(i.map(ze).join(""),"</").concat(t,">")}function Fe(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}S&&(Ue=(x.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(x.readyState),Ue||x.addEventListener("DOMContentLoaded",Oe));var Be=function(e,t,n,i){var r,a,o,s=Object.keys(e),l=s.length,c=t;for(void 0===n?(r=1,o=e[s[0]]):(r=0,o=n);r<l;r++)o=c(o,e[a=s[r]],a,e);return o};function He(e){const t=function(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&r)<<10)+(1023&i)+65536):(t.push(r),n--)}else t.push(r)}return t}(e);return 1===t.length?t[0].toString(16):null}function Ve(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return!!i.icon?t[i.iconName]=i.icon:t[n]=i,t}),{})}function je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:i=!1}=n,r=Ve(t);"function"!=typeof De.hooks.addPack||i?De.styles[e]={...De.styles[e]||{},...r}:De.hooks.addPack(e,Ve(t)),"fas"===e&&je("fa",t)}const{styles:Ge,shims:We}=De,Xe={[M]:Object.values(re[M]),[T]:Object.values(re[T]),[A]:Object.values(re[A])};let $e=null,qe={},Ye={},Ze={},Ke={},Qe={};const Je={[M]:Object.keys(ee[M]),[T]:Object.keys(ee[T]),[A]:Object.keys(ee[A])};function et(e,t){const n=t.split("-"),i=n[0],r=n.slice(1).join("-");return i!==e||""===r||(a=r,~fe.indexOf(a))?null:r;var a}const tt=()=>{const e=e=>Be(Ge,((t,n,i)=>(t[i]=Be(n,e,{}),t)),{});qe=e(((e,t,n)=>{if(t[3]&&(e[t[3]]=n),t[2]){t[2].filter((e=>"number"==typeof e)).forEach((t=>{e[t.toString(16)]=n}))}return e})),Ye=e(((e,t,n)=>{if(e[n]=n,t[2]){t[2].filter((e=>"string"==typeof e)).forEach((t=>{e[t]=n}))}return e})),Qe=e(((e,t,n)=>{const i=t[2];return e[n]=n,i.forEach((t=>{e[t]=n})),e}));const t="far"in Ge||ve.autoFetchSvg,n=Be(We,((e,n)=>{const i=n[0];let r=n[1];const a=n[2];return"far"!==r||t||(r="fas"),"string"==typeof i&&(e.names[i]={prefix:r,iconName:a}),"number"==typeof i&&(e.unicodes[i.toString(16)]={prefix:r,iconName:a}),e}),{names:{},unicodes:{}});Ze=n.names,Ke=n.unicodes,$e=lt(ve.styleDefault,{family:ve.familyDefault})};var nt;function it(e,t){return(qe[e]||{})[t]}function rt(e,t){return(Qe[e]||{})[t]}function at(e){return Ze[e]||{prefix:null,iconName:null}}function ot(){return $e}nt=e=>{$e=lt(e.styleDefault,{family:ve.familyDefault})},ye.push(nt),tt();const st=()=>({prefix:null,iconName:null,rest:[]});function lt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:n=M}=t,i=ee[n][e],r=ne[n][e]||ne[n][i],a=e in De.styles?e:null;return r||a||null}const ct={[M]:Object.keys(re[M]),[T]:Object.keys(re[T]),[A]:Object.keys(re[A])};function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:n=!1}=t,i={[M]:"".concat(ve.cssPrefix,"-").concat(M),[T]:"".concat(ve.cssPrefix,"-").concat(T),[A]:"".concat(ve.cssPrefix,"-").concat(A)};let r=null,a=M;const o=C.filter((e=>e!==E));o.forEach((t=>{(e.includes(i[t])||e.some((e=>ct[t].includes(e))))&&(a=t)}));const s=e.reduce(((e,t)=>{const s=et(ve.cssPrefix,t);if(Ge[t]?(t=Xe[a].includes(t)?oe[a][t]:t,r=t,e.prefix=t):Je[a].indexOf(t)>-1?(r=t,e.prefix=lt(t,{family:a})):s?e.iconName=s:t===ve.replacementClass||o.some((e=>t===i[e]))||e.rest.push(t),!n&&e.prefix&&e.iconName){const t="fa"===r?at(e.iconName):{},n=rt(e.prefix,e.iconName);t.prefix&&(r=null),e.iconName=t.iconName||n||e.iconName,e.prefix=t.prefix||e.prefix,"far"!==e.prefix||Ge.far||!Ge.fas||ve.autoFetchSvg||(e.prefix="fas")}return e}),st());return(e.includes("fa-brands")||e.includes("fab"))&&(s.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(s.prefix="fad"),s.prefix||a!==T||!Ge.fass&&!ve.autoFetchSvg||(s.prefix="fass",s.iconName=rt(s.prefix,s.iconName)||s.iconName),s.prefix||a!==A||!Ge.fasds&&!ve.autoFetchSvg||(s.prefix="fasds",s.iconName=rt(s.prefix,s.iconName)||s.iconName),"fa"!==s.prefix&&"fa"!==r||(s.prefix=ot()||"fas"),s}let dt=[],ht={};const ft={},pt=Object.keys(ft);function mt(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return(ht[e]||[]).forEach((e=>{t=e.apply(null,[t,...i])})),t}function gt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(ht[e]||[]).forEach((e=>{e.apply(null,n)}))}function vt(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return ft[e]?ft[e].apply(null,t):void 0}function yt(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||ot();if(t)return t=rt(n,t)||t,Fe(xt.definitions,n,t)||Fe(De.styles,n,t)}const xt=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.reduce(this._pullDefinitions,{});Object.keys(i).forEach((e=>{this.definitions[e]={...this.definitions[e]||{},...i[e]},je(e,i[e]);const t=re[M][e];t&&je(t,i[e]),tt()}))}reset(){this.definitions={}}_pullDefinitions(e,t){const n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map((t=>{const{prefix:i,iconName:r,icon:a}=n[t],o=a[2];e[i]||(e[i]={}),o.length>0&&o.forEach((t=>{"string"==typeof t&&(e[i][t]=a)})),e[i][r]=a})),e}},_t={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return S?(gt("beforeI2svg",e),vt("pseudoElements2svg",e),vt("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;var n;!1===ve.autoReplaceSvg&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,n=()=>{wt({autoReplaceSvgRoot:t}),gt("watch",e)},S&&(Ue?setTimeout(n,0):Ie.push(n))}},bt={icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:rt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],n=lt(e[0]);return{prefix:n,iconName:rt(n,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(ve.cssPrefix,"-"))>-1||e.match(se))){const t=ut(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||ot(),iconName:rt(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=ot();return{prefix:t,iconName:rt(t,e)||e}}}},St={noAuto:()=>{ve.autoReplaceSvg=!1,ve.observeMutations=!1,gt("noAuto")},config:ve,dom:_t,parse:bt,library:xt,findIconDefinition:yt,toHtml:ze},wt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=x}=e;(Object.keys(De.styles).length>0||ve.autoFetchSvg)&&S&&ve.autoReplaceSvg&&St.dom.i2svg({node:t})};function Mt(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((e=>ze(e)))}}),Object.defineProperty(e,"node",{get:function(){if(!S)return;const t=x.createElement("div");return t.innerHTML=e.html,t.children}}),e}function Et(e){const{icons:{main:t,mask:n},prefix:i,iconName:r,transform:a,symbol:o,title:s,maskId:l,titleId:c,extra:u,watchable:d=!1}=e,{width:h,height:f}=n.found?n:t,p="fak"===i,m=[ve.replacementClass,r?"".concat(ve.cssPrefix,"-").concat(r):""].filter((e=>-1===u.classes.indexOf(e))).filter((e=>""!==e||!!e)).concat(u.classes).join(" ");let g={children:[],attributes:{...u.attributes,"data-prefix":i,"data-icon":r,class:m,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(f)}};const v=p&&!~u.classes.indexOf("fa-fw")?{width:"".concat(h/f*16*.0625,"em")}:{};d&&(g.attributes[V]=""),s&&(g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(c||Se())},children:[s]}),delete g.attributes.title);const y={...g,prefix:i,iconName:r,main:t,mask:n,maskId:l,transform:a,symbol:o,styles:{...v,...u.styles}},{children:x,attributes:_}=n.found&&t.found?vt("generateAbstractMask",y)||{children:[],attributes:{}}:vt("generateAbstractIcon",y)||{children:[],attributes:{}};return y.children=x,y.attributes=_,o?function(e){let{prefix:t,iconName:n,children:i,attributes:r,symbol:a}=e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...r,id:!0===a?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):a},children:i}]}]}(y):function(e){let{children:t,main:n,mask:i,attributes:r,styles:a,transform:o}=e;if(Ae(o)&&n.found&&!i.found){const{width:e,height:t}=n,i={x:e/t/2,y:.5};r.style=Te({...a,"transform-origin":"".concat(i.x+o.x/16,"em ").concat(i.y+o.y/16,"em")})}return[{tag:"svg",attributes:r,children:t}]}(y)}function Tt(e){const{content:t,width:n,height:i,transform:r,title:a,extra:o,watchable:s=!1}=e,l={...o.attributes,...a?{title:a}:{},class:o.classes.join(" ")};s&&(l[V]="");const c={...o.styles};Ae(r)&&(c.transform=function(e){let{transform:t,width:n=F,height:i=F,startCentered:r=!1}=e,a="";return a+=r&&w?"translate(".concat(t.x/xe-n/2,"em, ").concat(t.y/xe-i/2,"em) "):r?"translate(calc(-50% + ".concat(t.x/xe,"em), calc(-50% + ").concat(t.y/xe,"em)) "):"translate(".concat(t.x/xe,"em, ").concat(t.y/xe,"em) "),a+="scale(".concat(t.size/xe*(t.flipX?-1:1),", ").concat(t.size/xe*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}({transform:r,startCentered:!0,width:n,height:i}),c["-webkit-transform"]=c.transform);const u=Te(c);u.length>0&&(l.style=u);const d=[];return d.push({tag:"span",attributes:l,children:[t]}),a&&d.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),d}const{styles:At}=De;function Ct(e){const t=e[0],n=e[1],[i]=e.slice(4);let r=null;return r=Array.isArray(i)?{tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.PRIMARY),fill:"currentColor",d:i[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:t,height:n,icon:r}}const Rt={found:!1,width:512,height:512};function Pt(e,t){let n=t;return"fa"===t&&null!==ve.styleDefault&&(t=ot()),new Promise(((i,r)=>{if("fa"===n){const n=at(e)||{};e=n.iconName||e,t=n.prefix||t}if(e&&t&&At[t]&&At[t][e]){return i(Ct(At[t][e]))}!function(e,t){Z||ve.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),i({...Rt,icon:ve.showMissingIcons&&e&&vt("missingIconAbstract")||{}})}))}const Lt=()=>{},kt=ve.measurePerformance&&b&&b.mark&&b.measure?b:{mark:Lt,measure:Lt},Nt='FA "6.6.0"',Dt=e=>{kt.mark("".concat(Nt," ").concat(e," ends")),kt.measure("".concat(Nt," ").concat(e),"".concat(Nt," ").concat(e," begins"),"".concat(Nt," ").concat(e," ends"))};var It={begin:e=>(kt.mark("".concat(Nt," ").concat(e," begins")),()=>Dt(e)),end:Dt};const Ot=()=>{};function Ut(e){return"string"==typeof(e.getAttribute?e.getAttribute(V):null)}function zt(e){return x.createElementNS("http://www.w3.org/2000/svg",e)}function Ft(e){return x.createElement(e)}function Bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:n=("svg"===e.tag?zt:Ft)}=t;if("string"==typeof e)return x.createTextNode(e);const i=n(e.tag);Object.keys(e.attributes||[]).forEach((function(t){i.setAttribute(t,e.attributes[t])}));return(e.children||[]).forEach((function(e){i.appendChild(Bt(e,{ceFn:n}))})),i}const Ht={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach((e=>{t.parentNode.insertBefore(Bt(e),t)})),null===t.getAttribute(V)&&ve.keepOriginalSource){let e=x.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~Me(t).indexOf(ve.replacementClass))return Ht.replace(e);const i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const e=n[0].attributes.class.split(" ").reduce(((e,t)=>(t===ve.replacementClass||t.match(i)?e.toSvg.push(t):e.toNode.push(t),e)),{toNode:[],toSvg:[]});n[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const r=n.map((e=>ze(e))).join("\n");t.setAttribute(V,""),t.innerHTML=r}};function Vt(e){e()}function jt(e,t){const n="function"==typeof t?t:Ot;if(0===e.length)n();else{let t=Vt;ve.mutateApproach===q&&(t=y.requestAnimationFrame||Vt),t((()=>{const t=!0===ve.autoReplaceSvg?Ht.replace:Ht[ve.autoReplaceSvg]||Ht.replace,i=It.begin("mutate");e.map(t),i(),n()}))}}let Gt=!1;function Wt(){Gt=!0}function Xt(){Gt=!1}let $t=null;function qt(e){if(!_)return;if(!ve.observeMutations)return;const{treeCallback:t=Ot,nodeCallback:n=Ot,pseudoElementsCallback:i=Ot,observeMutationsRoot:r=x}=e;$t=new _((e=>{if(Gt)return;const r=ot();we(e).forEach((e=>{if("childList"===e.type&&e.addedNodes.length>0&&!Ut(e.addedNodes[0])&&(ve.searchPseudoElements&&i(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&ve.searchPseudoElements&&i(e.target.parentNode),"attributes"===e.type&&Ut(e.target)&&~ue.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(W):null,n=e.getAttribute?e.getAttribute(X):null;return t&&n}(e.target)){const{prefix:t,iconName:n}=ut(Me(e.target));e.target.setAttribute(W,t||r),n&&e.target.setAttribute(X,n)}else(function(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)})(e.target)&&n(e.target)}))})),S&&$t.observe(r,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function Yt(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),i=void 0!==e.innerText?e.innerText.trim():"";let r=ut(Me(e));return r.prefix||(r.prefix=ot()),t&&n&&(r.prefix=t,r.iconName=n),r.iconName&&r.prefix||(r.prefix&&i.length>0&&(r.iconName=function(e,t){return(Ye[e]||{})[t]}(r.prefix,e.innerText)||it(r.prefix,He(e.innerText))),!r.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(r.iconName=e.firstChild.data)),r}function Zt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:n,prefix:i,rest:r}=Yt(e),a=function(e){const t=we(e.attributes).reduce(((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e)),{}),n=e.getAttribute("title"),i=e.getAttribute("data-fa-title-id");return ve.autoA11y&&(n?t["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(i||Se()):(t["aria-hidden"]="true",t.focusable="false")),t}(e),o=mt("parseNodeAttributes",{},e);let s=t.styleParser?function(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce(((e,t)=>{const n=t.split(":"),i=n[0],r=n.slice(1);return i&&r.length>0&&(e[i]=r.join(":").trim()),e}),{})),n}(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:_e,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:r,styles:s,attributes:a},...o}}const{styles:Kt}=De;function Qt(e){const t="nest"===ve.autoReplaceSvg?Zt(e,{styleParser:!1}):Zt(e);return~t.extra.classes.indexOf(le)?vt("generateLayersText",e,t):vt("generateSvgReplacementMutation",e,t)}let Jt=new Set;function en(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!S)return Promise.resolve();const n=x.documentElement.classList,i=e=>n.add("".concat($,"-").concat(e)),r=e=>n.remove("".concat($,"-").concat(e)),a=ve.autoFetchSvg?Jt:K.map((e=>"fa-".concat(e))).concat(Object.keys(Kt));a.includes("fa")||a.push("fa");const o=[".".concat(le,":not([").concat(V,"])")].concat(a.map((e=>".".concat(e,":not([").concat(V,"])")))).join(", ");if(0===o.length)return Promise.resolve();let s=[];try{s=we(e.querySelectorAll(o))}catch(e){}if(!(s.length>0))return Promise.resolve();i("pending"),r("complete");const l=It.begin("onTree"),c=s.reduce(((e,t)=>{try{const n=Qt(t);n&&e.push(n)}catch(e){Z||"MissingIcon"===e.name&&console.error(e)}return e}),[]);return new Promise(((e,n)=>{Promise.all(c).then((n=>{jt(n,(()=>{i("active"),i("complete"),r("pending"),"function"==typeof t&&t(),l(),e()}))})).catch((e=>{l(),n(e)}))}))}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qt(e).then((e=>{e&&jt([e],t)}))}function nn(e){return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(t||{}).icon?t:yt(t||{});let{mask:r}=n;return r&&(r=(r||{}).icon?r:yt(r||{})),e(i,{...n,mask:r})}}K.map((e=>{Jt.add("fa-".concat(e))})),Object.keys(ee[M]).map(Jt.add.bind(Jt)),Object.keys(ee[T]).map(Jt.add.bind(Jt)),Object.keys(ee[A]).map(Jt.add.bind(Jt)),Jt=[...Jt];const rn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=_e,symbol:i=!1,mask:r=null,maskId:a=null,title:o=null,titleId:s=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:d,iconName:h,icon:f}=e;return Mt({type:"icon",...e},(()=>(gt("beforeDOMElementCreation",{iconDefinition:e,params:t}),ve.autoA11y&&(o?c["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(s||Se()):(c["aria-hidden"]="true",c.focusable="false")),Et({icons:{main:Ct(f),mask:r?Ct(r.icon):{found:!1,width:null,height:null,icon:{}}},prefix:d,iconName:h,transform:{..._e,...n},symbol:i,title:o,maskId:a,titleId:s,extra:{attributes:c,styles:u,classes:l}}))))};var an={mixout:()=>({icon:nn(rn)}),hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=en,e.nodeCallback=tn,e)}),provides(e){e.i2svg=function(e){const{node:t=x,callback:n=()=>{}}=e;return en(t,n)},e.generateSvgReplacementMutation=function(e,t){const{iconName:n,title:i,titleId:r,prefix:a,transform:o,symbol:s,mask:l,maskId:c,extra:u}=t;return new Promise(((t,d)=>{Promise.all([Pt(n,a),l.iconName?Pt(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((l=>{let[d,h]=l;t([e,Et({icons:{main:d,mask:h},prefix:a,iconName:n,transform:o,symbol:s,maskId:c,title:i,titleId:r,extra:u,watchable:!0})])})).catch(d)}))},e.generateAbstractIcon=function(e){let{children:t,attributes:n,main:i,transform:r,styles:a}=e;const o=Te(a);let s;return o.length>0&&(n.style=o),Ae(r)&&(s=vt("generateAbstractTransformGrouping",{main:i,transform:r,containerWidth:i.width,iconWidth:i.width})),t.push(s||i.icon),{children:t,attributes:n}}}},on={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:n=[]}=t;return Mt({type:"layer"},(()=>{gt("beforeDOMElementCreation",{assembler:e,params:t});let i=[];return e((e=>{Array.isArray(e)?e.map((e=>{i=i.concat(e.abstract)})):i=i.concat(e.abstract)})),[{tag:"span",attributes:{class:["".concat(ve.cssPrefix,"-layers"),...n].join(" ")},children:i}]}))}})},sn={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:n=null,classes:i=[],attributes:r={},styles:a={}}=t;return Mt({type:"counter",content:e},(()=>(gt("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:n,extra:i}=e,r={...i.attributes,...n?{title:n}:{},class:i.classes.join(" ")},a=Te(i.styles);a.length>0&&(r.style=a);const o=[];return o.push({tag:"span",attributes:r,children:[t]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}({content:e.toString(),title:n,extra:{attributes:r,styles:a,classes:["".concat(ve.cssPrefix,"-layers-counter"),...i]}}))))}})},ln={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=_e,title:i=null,classes:r=[],attributes:a={},styles:o={}}=t;return Mt({type:"text",content:e},(()=>(gt("beforeDOMElementCreation",{content:e,params:t}),Tt({content:e,transform:{..._e,...n},title:i,extra:{attributes:a,styles:o,classes:["".concat(ve.cssPrefix,"-layers-text"),...r]}}))))}}),provides(e){e.generateLayersText=function(e,t){const{title:n,transform:i,extra:r}=t;let a=null,o=null;if(w){const t=parseInt(getComputedStyle(e).fontSize,10),n=e.getBoundingClientRect();a=n.width/t,o=n.height/t}return ve.autoA11y&&!n&&(r.attributes["aria-hidden"]="true"),Promise.resolve([e,Tt({content:e.innerHTML,width:a,height:o,transform:i,title:n,extra:r,watchable:!0})])}}};const cn=new RegExp('"',"ug"),un=[1105920,1112319],dn={FontAwesome:{normal:"fas",400:"fas"},"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"},"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"},"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},hn=Object.keys(dn).reduce(((e,t)=>(e[t.toLowerCase()]=dn[t],e)),{}),fn=Object.keys(hn).reduce(((e,t)=>{const n=hn[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e}),{});function pn(e,t){const n="".concat(G).concat(t.replace(":","-"));return new Promise(((i,r)=>{if(null!==e.getAttribute(n))return i();const a=we(e.children).filter((e=>e.getAttribute(j)===t))[0],o=y.getComputedStyle(e,t),s=o.getPropertyValue("font-family"),l=s.match(ce),c=o.getPropertyValue("font-weight"),u=o.getPropertyValue("content");if(a&&!l)return e.removeChild(a),i();if(l&&"none"!==u&&""!==u){const u=o.getPropertyValue("content");let d=function(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(t),r=isNaN(i)?"normal":i;return(hn[n]||{})[r]||fn[n]}(s,c);const{value:h,isSecondary:f}=function(e){const t=e.replace(cn,""),n=function(e,t){const n=e.length;let i,r=e.charCodeAt(t);return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?1024*(r-55296)+i-56320+65536:r}(t,0),i=n>=un[0]&&n<=un[1],r=2===t.length&&t[0]===t[1];return{value:He(r?t[0]:t),isSecondary:i||r}}(u),p=l[0].startsWith("FontAwesome");let m=it(d,h),g=m;if(p){const e=function(e){const t=Ke[e],n=it("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}(h);e.iconName&&e.prefix&&(m=e.iconName,d=e.prefix)}if(!m||f||a&&a.getAttribute(W)===d&&a.getAttribute(X)===g)i();else{e.setAttribute(n,g),a&&e.removeChild(a);const o={iconName:null,title:null,titleId:null,prefix:null,transform:_e,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:s}=o;s.attributes[j]=t,Pt(m,d).then((r=>{const a=Et({...o,icons:{main:r,mask:st()},prefix:d,iconName:g,extra:s,watchable:!0}),l=x.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=a.map((e=>ze(e))).join("\n"),e.removeAttribute(n),i()})).catch(r)}}else i()}))}function mn(e){return Promise.all([pn(e,"::before"),pn(e,"::after")])}function gn(e){return!(e.parentNode===document.head||~Y.indexOf(e.tagName.toUpperCase())||e.getAttribute(j)||e.parentNode&&"svg"===e.parentNode.tagName)}function vn(e){if(S)return new Promise(((t,n)=>{const i=we(e.querySelectorAll("*")).filter(gn).map(mn),r=It.begin("searchPseudoElements");Wt(),Promise.all(i).then((()=>{r(),Xt(),t()})).catch((()=>{r(),Xt(),n()}))}))}var yn={hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=vn,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=x}=e;ve.searchPseudoElements&&vn(t)}}};let xn=!1;var _n={mixout:()=>({dom:{unwatch(){Wt(),xn=!0}}}),hooks:()=>({bootstrap(){qt(mt("mutationObserverCallbacks",{}))},noAuto(){$t&&$t.disconnect()},watch(e){const{observeMutationsRoot:t}=e;xn?Xt():qt(mt("mutationObserverCallbacks",{observeMutationsRoot:t}))}})};const bn=e=>e.toLowerCase().split(" ").reduce(((e,t)=>{const n=t.toLowerCase().split("-"),i=n[0];let r=n.slice(1).join("-");if(i&&"h"===r)return e.flipX=!0,e;if(i&&"v"===r)return e.flipY=!0,e;if(r=parseFloat(r),isNaN(r))return e;switch(i){case"grow":e.size=e.size+r;break;case"shrink":e.size=e.size-r;break;case"left":e.x=e.x-r;break;case"right":e.x=e.x+r;break;case"up":e.y=e.y-r;break;case"down":e.y=e.y+r;break;case"rotate":e.rotate=e.rotate+r}return e}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});var Sn={mixout:()=>({parse:{transform:e=>bn(e)}}),hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=bn(n)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:n,containerWidth:i,iconWidth:r}=e;const a={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(32*n.x,", ").concat(32*n.y,") "),s="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),l="rotate(".concat(n.rotate," 0 0)"),c={transform:"".concat(o," ").concat(s," ").concat(l)},u={transform:"translate(".concat(r/2*-1," -256)")};return{tag:"g",attributes:{...a},children:[{tag:"g",attributes:{...c},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...u}}]}]}}}};const wn={x:0,y:0,width:"100%",height:"100%"};function Mn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var En={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),i=n?ut(n.split(" ").map((e=>e.trim()))):st();return i.prefix||(i.prefix=ot()),e.mask=i,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:n,main:i,mask:r,maskId:a,transform:o}=e;const{width:s,icon:l}=i,{width:c,icon:u}=r,d=function(e){let{transform:t,containerWidth:n,iconWidth:i}=e;const r={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(a," ").concat(o," ").concat(s)},path:{transform:"translate(".concat(i/2*-1," -256)")}}}({transform:o,containerWidth:c,iconWidth:s}),h={tag:"rect",attributes:{...wn,fill:"white"}},f=l.children?{children:l.children.map(Mn)}:{},p={tag:"g",attributes:{...d.inner},children:[Mn({tag:l.tag,attributes:{...l.attributes,...d.path},...f})]},m={tag:"g",attributes:{...d.outer},children:[p]},g="mask-".concat(a||Se()),v="clip-".concat(a||Se()),y={tag:"mask",attributes:{...wn,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[h,m]},x={tag:"defs",children:[{tag:"clipPath",attributes:{id:v},children:(_=u,"g"===_.tag?_.children:[_])},y]};var _;return t.push(x,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(v,")"),mask:"url(#".concat(g,")"),...wn}}),{children:t,attributes:n}}}},Tn={provides(e){let t=!1;y.matchMedia&&(t=y.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],n={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:{...n,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const r={...i,attributeName:"opacity"},a={tag:"circle",attributes:{...n,cx:"256",cy:"364",r:"28"},children:[]};return t||a.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...r,values:"1;0;1;1;0;1;"}}),e.push(a),e.push({tag:"path",attributes:{...n,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...r,values:"1;0;0;0;0;1;"}}]}),t||e.push({tag:"path",attributes:{...n,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...r,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:e}}}},An={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),i=null!==n&&(""===n||n);return e.symbol=i,e}})};!function(e,t){let{mixoutsTo:n}=t;dt=e,ht={},Object.keys(ft).forEach((e=>{-1===pt.indexOf(e)&&delete ft[e]})),dt.forEach((e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach((e=>{"function"==typeof t[e]&&(n[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEach((i=>{n[e]||(n[e]={}),n[e][i]=t[e][i]}))})),e.hooks){const t=e.hooks();Object.keys(t).forEach((e=>{ht[e]||(ht[e]=[]),ht[e].push(t[e])}))}e.provides&&e.provides(ft)}))}([ke,an,on,sn,ln,yn,_n,Sn,En,Tn,An],{mixoutsTo:St});const Cn=St.parse,Rn=St.icon;var Pn,Ln,kn,Nn,Dn,In={exports:{}};function On(){if(Ln)return Pn;Ln=1;return Pn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Un(){if(Nn)return kn;Nn=1;var e=On();function t(){}function n(){}return n.resetWarningCache=t,kn=function(){function i(t,n,i,r,a,o){if(o!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return i}i.isRequired=i;var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},kn}function zn(){return Dn||(Dn=1,In.exports=Un()()),In.exports}var Fn=e(zn()),Bn=u(),Hn=e(Bn);function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(n),!0).forEach((function(t){Wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gn(e){return Gn="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},Gn(e)}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $n(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Yn(e){return t=e,(t-=0)==t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}var Zn=["style"];var Kn=!1;try{Kn=!0}catch(e){}function Qn(e){return e&&"object"===Gn(e)&&e.prefix&&e.iconName&&e.icon?e:Cn.icon?Cn.icon(e):null===e?null:e&&"object"===Gn(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function Jn(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?Wn({},e,t):{}}var ei={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},ti=Hn.forwardRef((function(e,t){var n=jn(jn({},ei),e),i=n.icon,r=n.mask,a=n.symbol,o=n.className,s=n.title,l=n.titleId,c=n.maskId,u=Qn(i),d=Jn("classes",[].concat($n(function(e){var t,n=e.beat,i=e.fade,r=e.beatFade,a=e.bounce,o=e.shake,s=e.flash,l=e.spin,c=e.spinPulse,u=e.spinReverse,d=e.pulse,h=e.fixedWidth,f=e.inverse,p=e.border,m=e.listItem,g=e.flip,v=e.size,y=e.rotation,x=e.pull,_=(Wn(t={"fa-beat":n,"fa-fade":i,"fa-beat-fade":r,"fa-bounce":a,"fa-shake":o,"fa-flash":s,"fa-spin":l,"fa-spin-reverse":u,"fa-spin-pulse":c,"fa-pulse":d,"fa-fw":h,"fa-inverse":f,"fa-border":p,"fa-li":m,"fa-flip":!0===g,"fa-flip-horizontal":"horizontal"===g||"both"===g,"fa-flip-vertical":"vertical"===g||"both"===g},"fa-".concat(v),null!=v),Wn(t,"fa-rotate-".concat(y),null!=y&&0!==y),Wn(t,"fa-pull-".concat(x),null!=x),Wn(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(_).map((function(e){return _[e]?e:null})).filter((function(e){return e}))}(n)),$n((o||"").split(" ")))),h=Jn("transform","string"==typeof n.transform?Cn.transform(n.transform):n.transform),f=Jn("mask",Qn(r)),p=Rn(u,jn(jn(jn(jn({},d),h),f),{},{symbol:a,title:s,titleId:l,maskId:c}));if(!p)return function(){var e;!Kn&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",u),null;var m=p.abstract,g={ref:t};return Object.keys(n).forEach((function(e){ei.hasOwnProperty(e)||(g[e]=n[e])})),ni(m[0],g)}));ti.displayName="FontAwesomeIcon",ti.propTypes={beat:Fn.bool,border:Fn.bool,beatFade:Fn.bool,bounce:Fn.bool,className:Fn.string,fade:Fn.bool,flash:Fn.bool,mask:Fn.oneOfType([Fn.object,Fn.array,Fn.string]),maskId:Fn.string,fixedWidth:Fn.bool,inverse:Fn.bool,flip:Fn.oneOf([!0,!1,"horizontal","vertical","both"]),icon:Fn.oneOfType([Fn.object,Fn.array,Fn.string]),listItem:Fn.bool,pull:Fn.oneOf(["right","left"]),pulse:Fn.bool,rotation:Fn.oneOf([0,90,180,270]),shake:Fn.bool,size:Fn.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Fn.bool,spinPulse:Fn.bool,spinReverse:Fn.bool,symbol:Fn.oneOfType([Fn.bool,Fn.string]),title:Fn.string,titleId:Fn.string,transform:Fn.oneOfType([Fn.string,Fn.object]),swapOpacity:Fn.bool};var ni=function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var r=(n.children||[]).map((function(n){return e(t,n)})),a=Object.keys(n.attributes||{}).reduce((function(e,t){var i=n.attributes[t];switch(t){case"class":e.attrs.className=i,delete n.attributes.class;break;case"style":e.attrs.style=i.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,i=t.indexOf(":"),r=Yn(t.slice(0,i)),a=t.slice(i+1).trim();return r.startsWith("webkit")?e[(n=r,n.charAt(0).toUpperCase()+n.slice(1))]=a:e[r]=a,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=i:e.attrs[Yn(t)]=i}return e}),{attrs:{}}),o=i.style,s=void 0===o?{}:o,l=Xn(i,Zn);return a.attrs.style=jn(jn({},a.attrs.style),s),t.apply(void 0,[n.tag,jn(jn({},a.attrs),l)].concat($n(r)))}.bind(null,Hn.createElement),ii=function(){return ii=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ii.apply(this,arguments)};function ri(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ai,oi;var si=e(oi?ai:(oi=1,ai=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var c=a[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(r=n?n.call(i,u,d,c):void 0)||void 0===r&&u!==d)return!1}return!0})),li="-ms-",ci="-moz-",ui="-webkit-",di="comm",hi="rule",fi="decl",pi="@import",mi="@keyframes",gi="@layer",vi=Math.abs,yi=String.fromCharCode,xi=Object.assign;function _i(e){return e.trim()}function bi(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,n){return e.replace(t,n)}function wi(e,t,n){return e.indexOf(t,n)}function Mi(e,t){return 0|e.charCodeAt(t)}function Ei(e,t,n){return e.slice(t,n)}function Ti(e){return e.length}function Ai(e){return e.length}function Ci(e,t){return t.push(e),e}function Ri(e,t){return e.filter((function(e){return!bi(e,t)}))}var Pi=1,Li=1,ki=0,Ni=0,Di=0,Ii="";function Oi(e,t,n,i,r,a,o,s){return{value:e,root:t,parent:n,type:i,props:r,children:a,line:Pi,column:Li,length:o,return:"",siblings:s}}function Ui(e,t){return xi(Oi("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function zi(e){for(;e.root;)e=Ui(e.root,{children:[e]});Ci(e,e.siblings)}function Fi(){return Di=Ni>0?Mi(Ii,--Ni):0,Li--,10===Di&&(Li=1,Pi--),Di}function Bi(){return Di=Ni<ki?Mi(Ii,Ni++):0,Li++,10===Di&&(Li=1,Pi++),Di}function Hi(){return Mi(Ii,Ni)}function Vi(){return Ni}function ji(e,t){return Ei(Ii,e,t)}function Gi(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Wi(e){return _i(ji(Ni-1,qi(91===e?e+2:40===e?e+1:e)))}function Xi(e){for(;(Di=Hi())&&Di<33;)Bi();return Gi(e)>2||Gi(Di)>3?"":" "}function $i(e,t){for(;--t&&Bi()&&!(Di<48||Di>102||Di>57&&Di<65||Di>70&&Di<97););return ji(e,Vi()+(t<6&&32==Hi()&&32==Bi()))}function qi(e){for(;Bi();)switch(Di){case e:return Ni;case 34:case 39:34!==e&&39!==e&&qi(Di);break;case 40:41===e&&qi(e);break;case 92:Bi()}return Ni}function Yi(e,t){for(;Bi()&&e+Di!==57&&(e+Di!==84||47!==Hi()););return"/*"+ji(t,Ni-1)+"*"+yi(47===e?e:Bi())}function Zi(e){for(;!Gi(Hi());)Bi();return ji(e,Ni)}function Ki(e){return function(e){return Ii="",e}(Qi("",null,null,null,[""],e=function(e){return Pi=Li=1,ki=Ti(Ii=e),Ni=0,[]}(e),0,[0],e))}function Qi(e,t,n,i,r,a,o,s,l){for(var c=0,u=0,d=o,h=0,f=0,p=0,m=1,g=1,v=1,y=0,x="",_=r,b=a,S=i,w=x;g;)switch(p=y,y=Bi()){case 40:if(108!=p&&58==Mi(w,d-1)){-1!=wi(w+=Si(Wi(y),"&","&\f"),"&\f",vi(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:w+=Wi(y);break;case 9:case 10:case 13:case 32:w+=Xi(p);break;case 92:w+=$i(Vi()-1,7);continue;case 47:switch(Hi()){case 42:case 47:Ci(er(Yi(Bi(),Vi()),t,n,l),l);break;default:w+="/"}break;case 123*m:s[c++]=Ti(w)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(w=Si(w,/\f/g,"")),f>0&&Ti(w)-d&&Ci(f>32?tr(w+";",i,n,d-1,l):tr(Si(w," ","")+";",i,n,d-2,l),l);break;case 59:w+=";";default:if(Ci(S=Ji(w,t,n,c,u,r,s,x,_=[],b=[],d,a),a),123===y)if(0===u)Qi(w,t,S,S,_,a,d,s,b);else switch(99===h&&110===Mi(w,3)?100:h){case 100:case 108:case 109:case 115:Qi(e,S,S,i&&Ci(Ji(e,S,S,0,0,r,s,x,r,_=[],d,b),b),r,b,d,s,i?_:b);break;default:Qi(w,S,S,S,[""],b,0,s,b)}}c=u=f=0,m=v=1,x=w="",d=o;break;case 58:d=1+Ti(w),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Fi())continue;switch(w+=yi(y),y*m){case 38:v=u>0?1:(w+="\f",-1);break;case 44:s[c++]=(Ti(w)-1)*v,v=1;break;case 64:45===Hi()&&(w+=Wi(Bi())),h=Hi(),u=d=Ti(x=w+=Zi(Vi())),y++;break;case 45:45===p&&2==Ti(w)&&(m=0)}}return a}function Ji(e,t,n,i,r,a,o,s,l,c,u,d){for(var h=r-1,f=0===r?a:[""],p=Ai(f),m=0,g=0,v=0;m<i;++m)for(var y=0,x=Ei(e,h+1,h=vi(g=o[m])),_=e;y<p;++y)(_=_i(g>0?f[y]+" "+x:Si(x,/&\f/g,f[y])))&&(l[v++]=_);return Oi(e,t,n,0===r?hi:s,l,c,u,d)}function er(e,t,n,i){return Oi(e,t,n,di,yi(Di),Ei(e,2,-2),0,i)}function tr(e,t,n,i,r){return Oi(e,t,n,fi,Ei(e,0,i),Ei(e,i+1,-1),i,r)}function nr(e,t,n){switch(function(e,t){return 45^Mi(e,0)?(((t<<2^Mi(e,0))<<2^Mi(e,1))<<2^Mi(e,2))<<2^Mi(e,3):0}(e,t)){case 5103:return ui+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ui+e+e;case 4789:return ci+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ui+e+ci+e+li+e+e;case 5936:switch(Mi(e,t+11)){case 114:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ui+e+li+e+e;case 6165:return ui+e+li+"flex-"+e+e;case 5187:return ui+e+Si(e,/(\w+).+(:[^]+)/,ui+"box-$1$2"+li+"flex-$1$2")+e;case 5443:return ui+e+li+"flex-item-"+Si(e,/flex-|-self/g,"")+(bi(e,/flex-|baseline/)?"":li+"grid-row-"+Si(e,/flex-|-self/g,""))+e;case 4675:return ui+e+li+"flex-line-pack"+Si(e,/align-content|flex-|-self/g,"")+e;case 5548:return ui+e+li+Si(e,"shrink","negative")+e;case 5292:return ui+e+li+Si(e,"basis","preferred-size")+e;case 6060:return ui+"box-"+Si(e,"-grow","")+ui+e+li+Si(e,"grow","positive")+e;case 4554:return ui+Si(e,/([^-])(transform)/g,"$1"+ui+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ui+"$1"),/(image-set)/,ui+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ui+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ui+"box-pack:$3"+li+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ui+e+e;case 4200:if(!bi(e,/flex-|baseline/))return li+"grid-column-align"+Ei(e,t)+e;break;case 2592:case 3360:return li+Si(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,bi(e.props,/grid-\w+-end/)}))?~wi(e+(n=n[t].value),"span",0)?e:li+Si(e,"-start","")+e+li+"grid-row-span:"+(~wi(n,"span",0)?bi(n,/\d+/):+bi(n,/\d+/)-+bi(e,/\d+/))+";":li+Si(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return bi(e.props,/grid-\w+-start/)}))?e:li+Si(Si(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ui+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ti(e)-1-t>6)switch(Mi(e,t+1)){case 109:if(45!==Mi(e,t+4))break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ui+"$2-$3$1"+ci+(108==Mi(e,t+3)?"$3":"$2-$3"))+e;case 115:return~wi(e,"stretch",0)?nr(Si(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Si(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,i,r,a,o,s){return li+n+":"+i+s+(r?li+n+"-span:"+(a?o:+o-+i)+s:"")+e}));case 4949:if(121===Mi(e,t+6))return Si(e,":",":"+ui)+e;break;case 6444:switch(Mi(e,45===Mi(e,14)?18:11)){case 120:return Si(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ui+(45===Mi(e,14)?"inline-":"")+"box$3$1"+ui+"$2$3$1"+li+"$2box$3")+e;case 100:return Si(e,":",":"+li)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Si(e,"scroll-","scroll-snap-")+e}return e}function ir(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function rr(e,t,n,i){switch(e.type){case gi:if(e.children.length)break;case pi:case fi:return e.return=e.return||e.value;case di:return"";case mi:return e.return=e.value+"{"+ir(e.children,i)+"}";case hi:if(!Ti(e.value=e.props.join(",")))return""}return Ti(n=ir(e.children,i))?e.return=e.value+"{"+n+"}":""}function ar(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case fi:return void(e.return=nr(e.value,e.length,n));case mi:return ir([Ui(e,{value:Si(e.value,"@","@"+ui)})],i);case hi:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(bi(t,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zi(Ui(e,{props:[Si(t,/:(read-\w+)/,":"+ci+"$1")]})),zi(Ui(e,{props:[t]})),xi(e,{props:Ri(n,i)});break;case"::placeholder":zi(Ui(e,{props:[Si(t,/:(plac\w+)/,":"+ui+"input-$1")]})),zi(Ui(e,{props:[Si(t,/:(plac\w+)/,":"+ci+"$1")]})),zi(Ui(e,{props:[Si(t,/:(plac\w+)/,li+"input-$1")]})),zi(Ui(e,{props:[t]})),xi(e,{props:Ri(n,i)})}return""}))}}var or={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},sr="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",lr="active",cr="data-styled-version",ur="6.1.19",dr="/*!sc*/\n",hr="undefined"!=typeof window&&"undefined"!=typeof document,fr=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&("false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),pr=Object.freeze([]),mr=Object.freeze({});var gr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),vr=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,yr=/(^-|-$)/g;function xr(e){return e.replace(vr,"-").replace(yr,"")}var _r=/(a)(d)/gi,br=52,Sr=function(e){return String.fromCharCode(e+(e>25?39:97))};function wr(e){var t,n="";for(t=Math.abs(e);t>br;t=t/br|0)n=Sr(t%br)+n;return(Sr(t%br)+n).replace(_r,"$1-$2")}var Mr,Er=5381,Tr=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ar=function(e){return Tr(Er,e)};function Cr(e){return"string"==typeof e&&!0}var Rr="function"==typeof Symbol&&Symbol.for,Pr=Rr?Symbol.for("react.memo"):60115,Lr=Rr?Symbol.for("react.forward_ref"):60112,kr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Nr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Dr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ir=((Mr={})[Lr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mr[Pr]=Dr,Mr);function Or(e){return("type"in(t=e)&&t.type.$$typeof)===Pr?Dr:"$$typeof"in e?Ir[e.$$typeof]:kr;var t}var Ur=Object.defineProperty,zr=Object.getOwnPropertyNames,Fr=Object.getOwnPropertySymbols,Br=Object.getOwnPropertyDescriptor,Hr=Object.getPrototypeOf,Vr=Object.prototype;function jr(e,t,n){if("string"!=typeof t){if(Vr){var i=Hr(t);i&&i!==Vr&&jr(e,i,n)}var r=zr(t);Fr&&(r=r.concat(Fr(t)));for(var a=Or(e),o=Or(t),s=0;s<r.length;++s){var l=r[s];if(!(l in Nr||n&&n[l]||o&&l in o||a&&l in a)){var c=Br(t,l);try{Ur(e,l,c)}catch(e){}}}}return e}function Gr(e){return"function"==typeof e}function Wr(e){return"object"==typeof e&&"styledComponentId"in e}function Xr(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function $r(e,t){if(0===e.length)return"";for(var n=e[0],i=1;i<e.length;i++)n+=e[i];return n}function qr(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Yr(e,t,n){if(void 0===n&&(n=!1),!n&&!qr(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var i=0;i<t.length;i++)e[i]=Yr(e[i],t[i]);else if(qr(t))for(var i in t)e[i]=Yr(e[i],t[i]);return e}function Zr(e,t){Object.defineProperty(e,"toString",{value:t})}function Kr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var Qr=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,r=i;e>=r;)if((r<<=1)<0)throw Kr(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var a=i;a<r;a++)this.groupSizes[a]=0}for(var o=this.indexOfGroup(e+1),s=(a=0,t.length);a<s;a++)this.tag.insertRule(o,t[a])&&(this.groupSizes[e]++,o++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),i=n+t;this.groupSizes[e]=0;for(var r=n;r<i;r++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),r=i+n,a=i;a<r;a++)t+="".concat(this.tag.getRule(a)).concat(dr);return t},e}(),Jr=new Map,ea=new Map,ta=1,na=function(e){if(Jr.has(e))return Jr.get(e);for(;ea.has(ta);)ta++;var t=ta++;return Jr.set(e,t),ea.set(t,e),t},ia=function(e,t){ta=t+1,Jr.set(e,t),ea.set(t,e)},ra="style[".concat(sr,"][").concat(cr,'="').concat(ur,'"]'),aa=new RegExp("^".concat(sr,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),oa=function(e,t,n){for(var i,r=n.split(","),a=0,o=r.length;a<o;a++)(i=r[a])&&e.registerName(t,i)},sa=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(dr),r=[],a=0,o=i.length;a<o;a++){var s=i[a].trim();if(s){var l=s.match(aa);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(ia(u,c),oa(e,u,l[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(s)}}},la=function(e){for(var t=document.querySelectorAll(ra),n=0,i=t.length;n<i;n++){var r=t[n];r&&r.getAttribute(sr)!==lr&&(sa(e,r),r.parentNode&&r.parentNode.removeChild(r))}};var ca=function(e){var t=document.head,n=e||t,i=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(sr,"]")));return t[t.length-1]}(n),a=void 0!==r?r.nextSibling:null;i.setAttribute(sr,lr),i.setAttribute(cr,ur);var o="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return o&&i.setAttribute("nonce",o),n.insertBefore(i,a),i},ua=function(){function e(e){this.element=ca(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n<i;n++){var r=t[n];if(r.ownerNode===e)return r}throw Kr(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),da=function(){function e(e){this.element=ca(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),ha=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),fa=hr,pa={isServer:!hr,useCSSOMInjection:!fr},ma=function(){function e(e,t,n){void 0===e&&(e=mr),void 0===t&&(t={});var i=this;this.options=ii(ii({},pa),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&hr&&fa&&(fa=!1,la(this)),Zr(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",r=function(n){var r=function(e){return ea.get(e)}(n);if(void 0===r)return"continue";var a=e.names.get(r),o=t.getGroup(n);if(void 0===a||!a.size||0===o.length)return"continue";var s="".concat(sr,".g").concat(n,'[id="').concat(r,'"]'),l="";void 0!==a&&a.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),i+="".concat(o).concat(s,'{content:"').concat(l,'"}').concat(dr)},a=0;a<n;a++)r(a);return i}(i)}))}return e.registerId=function(e){return na(e)},e.prototype.rehydrate=function(){!this.server&&hr&&la(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(ii(ii({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new ha(n):t?new ua(n):new da(n)}(this.options),new Qr(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(na(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(na(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(na(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),ga=/&/g,va=/^\s*\/\/.*$/gm;function ya(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=ya(e.children,t)),e}))}function xa(e){var t,n,i,r=void 0===e?mr:e,a=r.options,o=void 0===a?mr:a,s=r.plugins,l=void 0===s?pr:s,c=function(e,i,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===hi&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ga,n).replace(i,c))})),o.prefix&&u.push(ar),u.push(rr);var d=function(e,r,a,s){void 0===r&&(r=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,n=r,i=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(va,""),c=Ki(a||r?"".concat(a," ").concat(r," { ").concat(l," }"):l);o.namespace&&(c=ya(c,o.namespace));var d,h=[];return ir(c,function(e){var t=Ai(e);return function(n,i,r,a){for(var o="",s=0;s<t;s++)o+=e[s](n,i,r,a)||"";return o}}(u.concat((d=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),h};return d.hash=l.length?l.reduce((function(e,t){return t.name||Kr(15),Tr(e,t.name)}),Er).toString():"",d}var _a=new ma,ba=xa(),Sa=Hn.createContext({shouldForwardProp:void 0,styleSheet:_a,stylis:ba});Sa.Consumer;var wa=Hn.createContext(void 0);function Ma(){return Bn.useContext(Sa)}function Ea(e){var t=Bn.useState(e.stylisPlugins),n=t[0],i=t[1],r=Ma().styleSheet,a=Bn.useMemo((function(){var t=r;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,r]),o=Bn.useMemo((function(){return xa({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Bn.useEffect((function(){si(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var s=Bn.useMemo((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:a,stylis:o}}),[e.shouldForwardProp,a,o]);return Hn.createElement(Sa.Provider,{value:s},Hn.createElement(wa.Provider,{value:o},e.children))}var Ta=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ba);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Zr(this,(function(){throw Kr(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=ba),this.name+e.hash},e}(),Aa=function(e){return e>="A"&&e<="Z"};function Ca(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;Aa(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Ra=function(e){return null==e||!1===e||""===e},Pa=function(e){var t,n,i=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Ra(a)&&(Array.isArray(a)&&a.isCss||Gr(a)?i.push("".concat(Ca(r),":"),a,";"):qr(a)?i.push.apply(i,ri(ri(["".concat(r," {")],Pa(a),!1),["}"],!1)):i.push("".concat(Ca(r),": ").concat((t=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in or||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function La(e,t,n,i){return Ra(e)?[]:Wr(e)?[".".concat(e.styledComponentId)]:Gr(e)?!Gr(r=e)||r.prototype&&r.prototype.isReactComponent||!t?[e]:La(e(t),t,n,i):e instanceof Ta?n?(e.inject(n,i),[e.getName(i)]):[e]:qr(e)?Pa(e):Array.isArray(e)?Array.prototype.concat.apply(pr,e.map((function(e){return La(e,t,n,i)}))):[e.toString()];var r}var ka=Ar(ur),Na=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Gr(n)&&!Wr(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Tr(ka,t),this.baseStyle=n,ma.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=Xr(i,this.staticRulesId);else{var r=$r(La(this.rules,e,t,n)),a=wr(Tr(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,a)){var o=n(r,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,o)}i=Xr(i,a),this.staticRulesId=a}else{for(var s=Tr(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=$r(La(u,e,t,n));s=Tr(s,d+c),l+=d}}if(l){var h=wr(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),i=Xr(i,h)}}return i},e}(),Da=Hn.createContext(void 0);Da.Consumer;var Ia={};new Set;function Oa(e,t,n){var i=Wr(e),r=e,a=!Cr(e),o=t.attrs,s=void 0===o?pr:o,l=t.componentId,c=void 0===l?function(e,t){var n="string"!=typeof e?"sc":xr(e);Ia[n]=(Ia[n]||0)+1;var i="".concat(n,"-").concat(function(e){return wr(Ar(e)>>>0)}(ur+n+Ia[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):l,u=t.displayName,d=void 0===u?function(e){return Cr(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e):u,h=t.displayName&&t.componentId?"".concat(xr(t.displayName),"-").concat(t.componentId):t.componentId||c,f=i&&r.attrs?r.attrs.concat(s).filter(Boolean):s,p=t.shouldForwardProp;if(i&&r.shouldForwardProp){var m=r.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;p=function(e,t){return m(e,t)&&g(e,t)}}else p=m}var v=new Na(n,h,i?r.componentStyle:void 0);function y(e,t){return function(e,t,n){var i=e.attrs,r=e.componentStyle,a=e.defaultProps,o=e.foldedComponentIds,s=e.styledComponentId,l=e.target,c=Hn.useContext(Da),u=Ma(),d=e.shouldForwardProp||u.shouldForwardProp,h=function(e,t,n){return void 0===n&&(n=mr),e.theme!==n.theme&&e.theme||t||n.theme}(t,c,a)||mr,f=function(e,t,n){for(var i,r=ii(ii({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var o=Gr(i=e[a])?i(r):i;for(var s in o)r[s]="className"===s?Xr(r[s],o[s]):"style"===s?ii(ii({},r[s]),o[s]):o[s]}return t.className&&(r.className=Xr(r.className,t.className)),r}(i,t,h),p=f.as||l,m={};for(var g in f)void 0===f[g]||"$"===g[0]||"as"===g||"theme"===g&&f.theme===h||("forwardedAs"===g?m.as=f.forwardedAs:d&&!d(g,p)||(m[g]=f[g]));var v=function(e,t){var n=Ma();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(r,f),y=Xr(o,s);return v&&(y+=" "+v),f.className&&(y+=" "+f.className),m[Cr(p)&&!gr.has(p)?"class":"className"]=y,n&&(m.ref=n),Bn.createElement(p,m)}(x,e,t)}y.displayName=d;var x=Hn.forwardRef(y);return x.attrs=f,x.componentStyle=v,x.displayName=d,x.shouldForwardProp=p,x.foldedComponentIds=i?Xr(r.foldedComponentIds,r.styledComponentId):"",x.styledComponentId=h,x.target=i?r.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,r=t;i<r.length;i++)Yr(e,r[i],!0);return e}({},r.defaultProps,e):e}}),Zr(x,(function(){return".".concat(x.styledComponentId)})),a&&jr(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Ua(e,t){for(var n=[e[0]],i=0,r=t.length;i<r;i+=1)n.push(t[i],e[i+1]);return n}var za=function(e){return Object.assign(e,{isCss:!0})};function Fa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Gr(e)||qr(e))return za(La(Ua(pr,ri([e],t,!0))));var i=e;return 0===t.length&&1===i.length&&"string"==typeof i[0]?La(i):za(La(Ua(i,t)))}function Ba(e,t,n){if(void 0===n&&(n=mr),!t)throw Kr(1,t);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,Fa.apply(void 0,ri([i],r,!1)))};return i.attrs=function(i){return Ba(e,t,ii(ii({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ba(e,t,ii(ii({},n),i))},i}var Ha=function(e){return Ba(Oa,e)},Va=Ha;gr.forEach((function(e){Va[e]=Ha(e)}));const ja="rgba(223, 223, 223, 1)",Ga="rgba(156, 156, 156, 1)",Wa="rgba(243, 151, 143, 1)",Xa="rgba(240, 97, 84,1)",$a="rgba(38, 38, 38, 0.7)",qa="rgba(61, 61, 63, 0.7)",Ya="rgba(61, 61, 63, 0.6)",Za="rgba(61, 61, 63, 1)",Ka="linear-gradient(to bottom, #343434, #393939)",Qa="linear-gradient(to bottom, rgba(52, 52, 52, 0.75), rgba(57, 57, 57, 0.75))",Ja="linear-gradient(to bottom, rgba(75, 75, 75, 0.75), rgba(80, 80, 80, 0.75))",eo="30px",to="30px",no="14px",io="3px",ro="10px",ao="10px 3px 3px 10px",oo="3px 10px 10px 3px",so="70px",lo="30px",co="3px",uo=Va.button`
1
+ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,n={exports:{}},i={};var r,a,o,s={exports:{}},l={};function c(){if(r)return l;r=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function y(){}function x(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var _=x.prototype=new y;_.constructor=x,m(_,v.prototype),_.isPureReactComponent=!0;var b=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},w=Object.prototype.hasOwnProperty;function M(t,n,i,r,a,o){return i=o.ref,{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:o}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var T=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return i[e]}))):t.toString(36);var n,i}function C(){}function P(n,i,r,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,u=!1;if(null===n)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case e:case t:u=!0;break;case h:return P((u=n._init)(n._payload),i,r,a,o)}}if(u)return o=o(n),u=""===a?"."+A(n,0):a,b(o)?(r="",null!=u&&(r=u.replace(T,"$&/")+"/"),P(o,i,r,"",(function(e){return e}))):null!=o&&(E(o)&&(l=o,c=r+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(T,"$&/")+"/")+u,o=M(l.type,c,void 0,0,0,l.props)),i.push(o)),1;u=0;var d,p=""===a?".":a+":";if(b(n))for(var m=0;m<n.length;m++)u+=P(a=n[m],i,r,s=p+A(a,m),o);else if("function"==typeof(m=null===(d=n)||"object"!=typeof d?null:"function"==typeof(d=f&&d[f]||d["@@iterator"])?d:null))for(n=m.call(n),m=0;!(a=n.next()).done;)u+=P(a=a.value,i,r,s=p+A(a,m++),o);else if("object"===s){if("function"==typeof n.then)return P(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(C,C):(e.status="pending",e.then((function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)}),(function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)}))),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),i,r,a,o);throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return u}function R(e,t,n){if(null==e)return e;var i=[],r=0;return P(e,i,"","",(function(e){return t.call(n,e,r++)})),i}function L(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function N(){}return l.Children={map:R,forEach:function(e,t,n){R(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return R(e,(function(){t++})),t},toArray:function(e){return R(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},l.Component=v,l.Fragment=n,l.Profiler=a,l.PureComponent=x,l.StrictMode=i,l.Suspense=u,l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,l.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},l.cache=function(e){return function(){return e.apply(null,arguments)}},l.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=m({},e.props),r=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(r=""+t.key),t)!w.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(i[a]=t[a]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];i.children=o}return M(e.type,r,void 0,0,0,i)},l.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},l.createElement=function(e,t,n){var i,r={},a=null;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)w.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in o=e.defaultProps)void 0===r[i]&&(r[i]=o[i]);return M(e,a,void 0,0,0,r)},l.createRef=function(){return{current:null}},l.forwardRef=function(e){return{$$typeof:c,render:e}},l.isValidElement=E,l.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},l.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},l.startTransition=function(e){var t=S.T,n={};S.T=n;try{var i=e(),r=S.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(N,k)}catch(e){k(e)}finally{S.T=t}},l.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},l.use=function(e){return S.H.use(e)},l.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},l.useCallback=function(e,t){return S.H.useCallback(e,t)},l.useContext=function(e){return S.H.useContext(e)},l.useDebugValue=function(){},l.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},l.useEffect=function(e,t,n){var i=S.H;if("function"==typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(e,t)},l.useId=function(){return S.H.useId()},l.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},l.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},l.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},l.useMemo=function(e,t){return S.H.useMemo(e,t)},l.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},l.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},l.useRef=function(e){return S.H.useRef(e)},l.useState=function(e){return S.H.useState(e)},l.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},l.useTransition=function(){return S.H.useTransition()},l.version="19.1.0",l}function u(){return a||(a=1,s.exports=c()),s.exports}var d=(o||(o=1,n.exports=function(){if(t)return i;t=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(t,n,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==n.key&&(r=""+n.key),"key"in n)for(var a in i={},n)"key"!==a&&(i[a]=n[a]);else i=n;return n=i.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:i}}return i.Fragment=n,i.jsx=r,i.jsxs=r,i}()),n.exports);const h=()=>{};let f={},p={},m=null,g={mark:h,measure:h};try{"undefined"!=typeof window&&(f=window),"undefined"!=typeof document&&(p=document),"undefined"!=typeof MutationObserver&&(m=MutationObserver),"undefined"!=typeof performance&&(g=performance)}catch(e){}const{userAgent:v=""}=f.navigator||{},y=f,x=p,_=m,b=g;y.document;const S=!!x.documentElement&&!!x.head&&"function"==typeof x.addEventListener&&"function"==typeof x.createElement,w=~v.indexOf("MSIE")||~v.indexOf("Trident/");var M="classic",E="duotone",T="sharp",A="sharp-duotone",C=[M,E,T,A],P={fak:"kit","fa-kit":"kit"},R={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},L={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},k=[1,2,3,4,5,6,7,8,9,10],N=k.concat([11,12,13,14,15,16,17,18,19,20]),D={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},I=[...Object.keys({classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]}),"solid","regular","light","thin","duotone","brands","2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",D.GROUP,D.SWAP_OPACITY,D.PRIMARY,D.SECONDARY].concat(k.map((e=>"".concat(e,"x")))).concat(N.map((e=>"w-".concat(e)))),O={kit:"fak"},U={"kit-duotone":"fakd"};const z="___FONT_AWESOME___",F=16,B="fa",H="svg-inline--fa",V="data-fa-i2svg",j="data-fa-pseudo-element",G="data-fa-pseudo-element-pending",W="data-prefix",X="data-icon",q="fontawesome-i2svg",$="async",Y=["HTML","HEAD","STYLE","SCRIPT"],Z=(()=>{try{return!0}catch(e){return!1}})(),K=[M,T,A];function Q(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[M]})}const J={...L};J[M]={...L[M],...P,...R};const ee=Q(J),te={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}};te[M]={...te[M],...O,...U};const ne=Q(te),ie={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}};ie[M]={...ie[M],fak:"fa-kit"};const re=Q(ie),ae={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}};ae[M]={...ae[M],"fa-kit":"fak"};const oe=Q(ae),se=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,le="fa-layers-text",ce=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;Q({classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}});const ue=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],de=D,he=new Set;Object.keys(ne[M]).map(he.add.bind(he)),Object.keys(ne[T]).map(he.add.bind(he)),Object.keys(ne[A]).map(he.add.bind(he));const fe=["kit",...I],pe=y.FontAwesomeConfig||{};if(x&&"function"==typeof x.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((e=>{let[t,n]=e;const i=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=x.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=i&&(pe[n]=i)}))}const me={styleDefault:"solid",familyDefault:"classic",cssPrefix:B,replacementClass:H,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};pe.familyPrefix&&(pe.cssPrefix=pe.familyPrefix);const ge={...me,...pe};ge.autoReplaceSvg||(ge.observeMutations=!1);const ve={};Object.keys(me).forEach((e=>{Object.defineProperty(ve,e,{enumerable:!0,set:function(t){ge[e]=t,ye.forEach((e=>e(ve)))},get:function(){return ge[e]}})})),Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(e){ge.cssPrefix=e,ye.forEach((e=>e(ve)))},get:function(){return ge.cssPrefix}}),y.FontAwesomeConfig=ve;const ye=[];const xe=F,_e={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};const be="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Se(){let e=12,t="";for(;e-- >0;)t+=be[62*Math.random()|0];return t}function we(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Me(e){return e.classList?we(e.classList):(e.getAttribute("class")||"").split(" ").filter((e=>e))}function Ee(e){return"".concat(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Te(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";")),"")}function Ae(e){return e.size!==_e.size||e.x!==_e.x||e.y!==_e.y||e.rotate!==_e.rotate||e.flipX||e.flipY}var Ce=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-counter-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(-1 * var(--fa-li-width, 2em));\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n animation-name: fa-beat;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n animation-name: fa-bounce;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n animation-name: fa-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n animation-name: fa-beat-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n animation-name: fa-flip;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n animation-name: fa-shake;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n animation-name: fa-spin;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 2s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n animation-name: fa-spin;\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n animation-delay: -1ms;\n animation-duration: 1ms;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n transform: scale(1);\n }\n 45% {\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-bounce {\n 0% {\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-flip {\n 50% {\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-shake {\n 0% {\n transform: rotate(-15deg);\n }\n 4% {\n transform: rotate(15deg);\n }\n 8%, 24% {\n transform: rotate(-18deg);\n }\n 12%, 28% {\n transform: rotate(18deg);\n }\n 16% {\n transform: rotate(-22deg);\n }\n 20% {\n transform: rotate(22deg);\n }\n 32% {\n transform: rotate(-12deg);\n }\n 36% {\n transform: rotate(12deg);\n }\n 40%, 100% {\n transform: rotate(0deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';function Pe(){const e=B,t=H,n=ve.cssPrefix,i=ve.replacementClass;let r=Ce;if(n!==e||i!==t){const a=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");r=r.replace(a,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(i))}return r}let Re=!1;function Le(){ve.autoAddCss&&!Re&&(!function(e){if(!e||!S)return;const t=x.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=x.head.childNodes;let i=null;for(let e=n.length-1;e>-1;e--){const t=n[e],r=(t.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=t)}x.head.insertBefore(t,i)}(Pe()),Re=!0)}var ke={mixout:()=>({dom:{css:Pe,insertCss:Le}}),hooks:()=>({beforeDOMElementCreation(){Le()},beforeI2svg(){Le()}})};const Ne=y||{};Ne[z]||(Ne[z]={}),Ne[z].styles||(Ne[z].styles={}),Ne[z].hooks||(Ne[z].hooks={}),Ne[z].shims||(Ne[z].shims=[]);var De=Ne[z];const Ie=[],Oe=function(){x.removeEventListener("DOMContentLoaded",Oe),Ue=1,Ie.map((e=>e()))};let Ue=!1;function ze(e){const{tag:t,attributes:n={},children:i=[]}=e;return"string"==typeof e?Ee(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,'="').concat(Ee(e[n]),'" ')),"").trim()}(n),">").concat(i.map(ze).join(""),"</").concat(t,">")}function Fe(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}S&&(Ue=(x.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(x.readyState),Ue||x.addEventListener("DOMContentLoaded",Oe));var Be=function(e,t,n,i){var r,a,o,s=Object.keys(e),l=s.length,c=t;for(void 0===n?(r=1,o=e[s[0]]):(r=0,o=n);r<l;r++)o=c(o,e[a=s[r]],a,e);return o};function He(e){const t=function(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&r)<<10)+(1023&i)+65536):(t.push(r),n--)}else t.push(r)}return t}(e);return 1===t.length?t[0].toString(16):null}function Ve(e){return Object.keys(e).reduce(((t,n)=>{const i=e[n];return!!i.icon?t[i.iconName]=i.icon:t[n]=i,t}),{})}function je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:i=!1}=n,r=Ve(t);"function"!=typeof De.hooks.addPack||i?De.styles[e]={...De.styles[e]||{},...r}:De.hooks.addPack(e,Ve(t)),"fas"===e&&je("fa",t)}const{styles:Ge,shims:We}=De,Xe={[M]:Object.values(re[M]),[T]:Object.values(re[T]),[A]:Object.values(re[A])};let qe=null,$e={},Ye={},Ze={},Ke={},Qe={};const Je={[M]:Object.keys(ee[M]),[T]:Object.keys(ee[T]),[A]:Object.keys(ee[A])};function et(e,t){const n=t.split("-"),i=n[0],r=n.slice(1).join("-");return i!==e||""===r||(a=r,~fe.indexOf(a))?null:r;var a}const tt=()=>{const e=e=>Be(Ge,((t,n,i)=>(t[i]=Be(n,e,{}),t)),{});$e=e(((e,t,n)=>{if(t[3]&&(e[t[3]]=n),t[2]){t[2].filter((e=>"number"==typeof e)).forEach((t=>{e[t.toString(16)]=n}))}return e})),Ye=e(((e,t,n)=>{if(e[n]=n,t[2]){t[2].filter((e=>"string"==typeof e)).forEach((t=>{e[t]=n}))}return e})),Qe=e(((e,t,n)=>{const i=t[2];return e[n]=n,i.forEach((t=>{e[t]=n})),e}));const t="far"in Ge||ve.autoFetchSvg,n=Be(We,((e,n)=>{const i=n[0];let r=n[1];const a=n[2];return"far"!==r||t||(r="fas"),"string"==typeof i&&(e.names[i]={prefix:r,iconName:a}),"number"==typeof i&&(e.unicodes[i.toString(16)]={prefix:r,iconName:a}),e}),{names:{},unicodes:{}});Ze=n.names,Ke=n.unicodes,qe=lt(ve.styleDefault,{family:ve.familyDefault})};var nt;function it(e,t){return($e[e]||{})[t]}function rt(e,t){return(Qe[e]||{})[t]}function at(e){return Ze[e]||{prefix:null,iconName:null}}function ot(){return qe}nt=e=>{qe=lt(e.styleDefault,{family:ve.familyDefault})},ye.push(nt),tt();const st=()=>({prefix:null,iconName:null,rest:[]});function lt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:n=M}=t,i=ee[n][e],r=ne[n][e]||ne[n][i],a=e in De.styles?e:null;return r||a||null}const ct={[M]:Object.keys(re[M]),[T]:Object.keys(re[T]),[A]:Object.keys(re[A])};function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:n=!1}=t,i={[M]:"".concat(ve.cssPrefix,"-").concat(M),[T]:"".concat(ve.cssPrefix,"-").concat(T),[A]:"".concat(ve.cssPrefix,"-").concat(A)};let r=null,a=M;const o=C.filter((e=>e!==E));o.forEach((t=>{(e.includes(i[t])||e.some((e=>ct[t].includes(e))))&&(a=t)}));const s=e.reduce(((e,t)=>{const s=et(ve.cssPrefix,t);if(Ge[t]?(t=Xe[a].includes(t)?oe[a][t]:t,r=t,e.prefix=t):Je[a].indexOf(t)>-1?(r=t,e.prefix=lt(t,{family:a})):s?e.iconName=s:t===ve.replacementClass||o.some((e=>t===i[e]))||e.rest.push(t),!n&&e.prefix&&e.iconName){const t="fa"===r?at(e.iconName):{},n=rt(e.prefix,e.iconName);t.prefix&&(r=null),e.iconName=t.iconName||n||e.iconName,e.prefix=t.prefix||e.prefix,"far"!==e.prefix||Ge.far||!Ge.fas||ve.autoFetchSvg||(e.prefix="fas")}return e}),st());return(e.includes("fa-brands")||e.includes("fab"))&&(s.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(s.prefix="fad"),s.prefix||a!==T||!Ge.fass&&!ve.autoFetchSvg||(s.prefix="fass",s.iconName=rt(s.prefix,s.iconName)||s.iconName),s.prefix||a!==A||!Ge.fasds&&!ve.autoFetchSvg||(s.prefix="fasds",s.iconName=rt(s.prefix,s.iconName)||s.iconName),"fa"!==s.prefix&&"fa"!==r||(s.prefix=ot()||"fas"),s}let dt=[],ht={};const ft={},pt=Object.keys(ft);function mt(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return(ht[e]||[]).forEach((e=>{t=e.apply(null,[t,...i])})),t}function gt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(ht[e]||[]).forEach((e=>{e.apply(null,n)}))}function vt(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return ft[e]?ft[e].apply(null,t):void 0}function yt(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||ot();if(t)return t=rt(n,t)||t,Fe(xt.definitions,n,t)||Fe(De.styles,n,t)}const xt=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.reduce(this._pullDefinitions,{});Object.keys(i).forEach((e=>{this.definitions[e]={...this.definitions[e]||{},...i[e]},je(e,i[e]);const t=re[M][e];t&&je(t,i[e]),tt()}))}reset(){this.definitions={}}_pullDefinitions(e,t){const n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map((t=>{const{prefix:i,iconName:r,icon:a}=n[t],o=a[2];e[i]||(e[i]={}),o.length>0&&o.forEach((t=>{"string"==typeof t&&(e[i][t]=a)})),e[i][r]=a})),e}},_t={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return S?(gt("beforeI2svg",e),vt("pseudoElements2svg",e),vt("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;var n;!1===ve.autoReplaceSvg&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,n=()=>{wt({autoReplaceSvgRoot:t}),gt("watch",e)},S&&(Ue?setTimeout(n,0):Ie.push(n))}},bt={icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:rt(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],n=lt(e[0]);return{prefix:n,iconName:rt(n,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(ve.cssPrefix,"-"))>-1||e.match(se))){const t=ut(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||ot(),iconName:rt(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=ot();return{prefix:t,iconName:rt(t,e)||e}}}},St={noAuto:()=>{ve.autoReplaceSvg=!1,ve.observeMutations=!1,gt("noAuto")},config:ve,dom:_t,parse:bt,library:xt,findIconDefinition:yt,toHtml:ze},wt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=x}=e;(Object.keys(De.styles).length>0||ve.autoFetchSvg)&&S&&ve.autoReplaceSvg&&St.dom.i2svg({node:t})};function Mt(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((e=>ze(e)))}}),Object.defineProperty(e,"node",{get:function(){if(!S)return;const t=x.createElement("div");return t.innerHTML=e.html,t.children}}),e}function Et(e){const{icons:{main:t,mask:n},prefix:i,iconName:r,transform:a,symbol:o,title:s,maskId:l,titleId:c,extra:u,watchable:d=!1}=e,{width:h,height:f}=n.found?n:t,p="fak"===i,m=[ve.replacementClass,r?"".concat(ve.cssPrefix,"-").concat(r):""].filter((e=>-1===u.classes.indexOf(e))).filter((e=>""!==e||!!e)).concat(u.classes).join(" ");let g={children:[],attributes:{...u.attributes,"data-prefix":i,"data-icon":r,class:m,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(f)}};const v=p&&!~u.classes.indexOf("fa-fw")?{width:"".concat(h/f*16*.0625,"em")}:{};d&&(g.attributes[V]=""),s&&(g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(c||Se())},children:[s]}),delete g.attributes.title);const y={...g,prefix:i,iconName:r,main:t,mask:n,maskId:l,transform:a,symbol:o,styles:{...v,...u.styles}},{children:x,attributes:_}=n.found&&t.found?vt("generateAbstractMask",y)||{children:[],attributes:{}}:vt("generateAbstractIcon",y)||{children:[],attributes:{}};return y.children=x,y.attributes=_,o?function(e){let{prefix:t,iconName:n,children:i,attributes:r,symbol:a}=e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...r,id:!0===a?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):a},children:i}]}]}(y):function(e){let{children:t,main:n,mask:i,attributes:r,styles:a,transform:o}=e;if(Ae(o)&&n.found&&!i.found){const{width:e,height:t}=n,i={x:e/t/2,y:.5};r.style=Te({...a,"transform-origin":"".concat(i.x+o.x/16,"em ").concat(i.y+o.y/16,"em")})}return[{tag:"svg",attributes:r,children:t}]}(y)}function Tt(e){const{content:t,width:n,height:i,transform:r,title:a,extra:o,watchable:s=!1}=e,l={...o.attributes,...a?{title:a}:{},class:o.classes.join(" ")};s&&(l[V]="");const c={...o.styles};Ae(r)&&(c.transform=function(e){let{transform:t,width:n=F,height:i=F,startCentered:r=!1}=e,a="";return a+=r&&w?"translate(".concat(t.x/xe-n/2,"em, ").concat(t.y/xe-i/2,"em) "):r?"translate(calc(-50% + ".concat(t.x/xe,"em), calc(-50% + ").concat(t.y/xe,"em)) "):"translate(".concat(t.x/xe,"em, ").concat(t.y/xe,"em) "),a+="scale(".concat(t.size/xe*(t.flipX?-1:1),", ").concat(t.size/xe*(t.flipY?-1:1),") "),a+="rotate(".concat(t.rotate,"deg) "),a}({transform:r,startCentered:!0,width:n,height:i}),c["-webkit-transform"]=c.transform);const u=Te(c);u.length>0&&(l.style=u);const d=[];return d.push({tag:"span",attributes:l,children:[t]}),a&&d.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),d}const{styles:At}=De;function Ct(e){const t=e[0],n=e[1],[i]=e.slice(4);let r=null;return r=Array.isArray(i)?{tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(de.PRIMARY),fill:"currentColor",d:i[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:t,height:n,icon:r}}const Pt={found:!1,width:512,height:512};function Rt(e,t){let n=t;return"fa"===t&&null!==ve.styleDefault&&(t=ot()),new Promise(((i,r)=>{if("fa"===n){const n=at(e)||{};e=n.iconName||e,t=n.prefix||t}if(e&&t&&At[t]&&At[t][e]){return i(Ct(At[t][e]))}!function(e,t){Z||ve.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),i({...Pt,icon:ve.showMissingIcons&&e&&vt("missingIconAbstract")||{}})}))}const Lt=()=>{},kt=ve.measurePerformance&&b&&b.mark&&b.measure?b:{mark:Lt,measure:Lt},Nt='FA "6.6.0"',Dt=e=>{kt.mark("".concat(Nt," ").concat(e," ends")),kt.measure("".concat(Nt," ").concat(e),"".concat(Nt," ").concat(e," begins"),"".concat(Nt," ").concat(e," ends"))};var It={begin:e=>(kt.mark("".concat(Nt," ").concat(e," begins")),()=>Dt(e)),end:Dt};const Ot=()=>{};function Ut(e){return"string"==typeof(e.getAttribute?e.getAttribute(V):null)}function zt(e){return x.createElementNS("http://www.w3.org/2000/svg",e)}function Ft(e){return x.createElement(e)}function Bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:n=("svg"===e.tag?zt:Ft)}=t;if("string"==typeof e)return x.createTextNode(e);const i=n(e.tag);Object.keys(e.attributes||[]).forEach((function(t){i.setAttribute(t,e.attributes[t])}));return(e.children||[]).forEach((function(e){i.appendChild(Bt(e,{ceFn:n}))})),i}const Ht={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach((e=>{t.parentNode.insertBefore(Bt(e),t)})),null===t.getAttribute(V)&&ve.keepOriginalSource){let e=x.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~Me(t).indexOf(ve.replacementClass))return Ht.replace(e);const i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const e=n[0].attributes.class.split(" ").reduce(((e,t)=>(t===ve.replacementClass||t.match(i)?e.toSvg.push(t):e.toNode.push(t),e)),{toNode:[],toSvg:[]});n[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const r=n.map((e=>ze(e))).join("\n");t.setAttribute(V,""),t.innerHTML=r}};function Vt(e){e()}function jt(e,t){const n="function"==typeof t?t:Ot;if(0===e.length)n();else{let t=Vt;ve.mutateApproach===$&&(t=y.requestAnimationFrame||Vt),t((()=>{const t=!0===ve.autoReplaceSvg?Ht.replace:Ht[ve.autoReplaceSvg]||Ht.replace,i=It.begin("mutate");e.map(t),i(),n()}))}}let Gt=!1;function Wt(){Gt=!0}function Xt(){Gt=!1}let qt=null;function $t(e){if(!_)return;if(!ve.observeMutations)return;const{treeCallback:t=Ot,nodeCallback:n=Ot,pseudoElementsCallback:i=Ot,observeMutationsRoot:r=x}=e;qt=new _((e=>{if(Gt)return;const r=ot();we(e).forEach((e=>{if("childList"===e.type&&e.addedNodes.length>0&&!Ut(e.addedNodes[0])&&(ve.searchPseudoElements&&i(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&ve.searchPseudoElements&&i(e.target.parentNode),"attributes"===e.type&&Ut(e.target)&&~ue.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(W):null,n=e.getAttribute?e.getAttribute(X):null;return t&&n}(e.target)){const{prefix:t,iconName:n}=ut(Me(e.target));e.target.setAttribute(W,t||r),n&&e.target.setAttribute(X,n)}else(function(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)})(e.target)&&n(e.target)}))})),S&&qt.observe(r,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function Yt(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),i=void 0!==e.innerText?e.innerText.trim():"";let r=ut(Me(e));return r.prefix||(r.prefix=ot()),t&&n&&(r.prefix=t,r.iconName=n),r.iconName&&r.prefix||(r.prefix&&i.length>0&&(r.iconName=function(e,t){return(Ye[e]||{})[t]}(r.prefix,e.innerText)||it(r.prefix,He(e.innerText))),!r.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(r.iconName=e.firstChild.data)),r}function Zt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:n,prefix:i,rest:r}=Yt(e),a=function(e){const t=we(e.attributes).reduce(((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e)),{}),n=e.getAttribute("title"),i=e.getAttribute("data-fa-title-id");return ve.autoA11y&&(n?t["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(i||Se()):(t["aria-hidden"]="true",t.focusable="false")),t}(e),o=mt("parseNodeAttributes",{},e);let s=t.styleParser?function(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce(((e,t)=>{const n=t.split(":"),i=n[0],r=n.slice(1);return i&&r.length>0&&(e[i]=r.join(":").trim()),e}),{})),n}(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:_e,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:r,styles:s,attributes:a},...o}}const{styles:Kt}=De;function Qt(e){const t="nest"===ve.autoReplaceSvg?Zt(e,{styleParser:!1}):Zt(e);return~t.extra.classes.indexOf(le)?vt("generateLayersText",e,t):vt("generateSvgReplacementMutation",e,t)}let Jt=new Set;function en(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!S)return Promise.resolve();const n=x.documentElement.classList,i=e=>n.add("".concat(q,"-").concat(e)),r=e=>n.remove("".concat(q,"-").concat(e)),a=ve.autoFetchSvg?Jt:K.map((e=>"fa-".concat(e))).concat(Object.keys(Kt));a.includes("fa")||a.push("fa");const o=[".".concat(le,":not([").concat(V,"])")].concat(a.map((e=>".".concat(e,":not([").concat(V,"])")))).join(", ");if(0===o.length)return Promise.resolve();let s=[];try{s=we(e.querySelectorAll(o))}catch(e){}if(!(s.length>0))return Promise.resolve();i("pending"),r("complete");const l=It.begin("onTree"),c=s.reduce(((e,t)=>{try{const n=Qt(t);n&&e.push(n)}catch(e){Z||"MissingIcon"===e.name&&console.error(e)}return e}),[]);return new Promise(((e,n)=>{Promise.all(c).then((n=>{jt(n,(()=>{i("active"),i("complete"),r("pending"),"function"==typeof t&&t(),l(),e()}))})).catch((e=>{l(),n(e)}))}))}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qt(e).then((e=>{e&&jt([e],t)}))}function nn(e){return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(t||{}).icon?t:yt(t||{});let{mask:r}=n;return r&&(r=(r||{}).icon?r:yt(r||{})),e(i,{...n,mask:r})}}K.map((e=>{Jt.add("fa-".concat(e))})),Object.keys(ee[M]).map(Jt.add.bind(Jt)),Object.keys(ee[T]).map(Jt.add.bind(Jt)),Object.keys(ee[A]).map(Jt.add.bind(Jt)),Jt=[...Jt];const rn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=_e,symbol:i=!1,mask:r=null,maskId:a=null,title:o=null,titleId:s=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:d,iconName:h,icon:f}=e;return Mt({type:"icon",...e},(()=>(gt("beforeDOMElementCreation",{iconDefinition:e,params:t}),ve.autoA11y&&(o?c["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(s||Se()):(c["aria-hidden"]="true",c.focusable="false")),Et({icons:{main:Ct(f),mask:r?Ct(r.icon):{found:!1,width:null,height:null,icon:{}}},prefix:d,iconName:h,transform:{..._e,...n},symbol:i,title:o,maskId:a,titleId:s,extra:{attributes:c,styles:u,classes:l}}))))};var an={mixout:()=>({icon:nn(rn)}),hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=en,e.nodeCallback=tn,e)}),provides(e){e.i2svg=function(e){const{node:t=x,callback:n=()=>{}}=e;return en(t,n)},e.generateSvgReplacementMutation=function(e,t){const{iconName:n,title:i,titleId:r,prefix:a,transform:o,symbol:s,mask:l,maskId:c,extra:u}=t;return new Promise(((t,d)=>{Promise.all([Rt(n,a),l.iconName?Rt(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((l=>{let[d,h]=l;t([e,Et({icons:{main:d,mask:h},prefix:a,iconName:n,transform:o,symbol:s,maskId:c,title:i,titleId:r,extra:u,watchable:!0})])})).catch(d)}))},e.generateAbstractIcon=function(e){let{children:t,attributes:n,main:i,transform:r,styles:a}=e;const o=Te(a);let s;return o.length>0&&(n.style=o),Ae(r)&&(s=vt("generateAbstractTransformGrouping",{main:i,transform:r,containerWidth:i.width,iconWidth:i.width})),t.push(s||i.icon),{children:t,attributes:n}}}},on={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:n=[]}=t;return Mt({type:"layer"},(()=>{gt("beforeDOMElementCreation",{assembler:e,params:t});let i=[];return e((e=>{Array.isArray(e)?e.map((e=>{i=i.concat(e.abstract)})):i=i.concat(e.abstract)})),[{tag:"span",attributes:{class:["".concat(ve.cssPrefix,"-layers"),...n].join(" ")},children:i}]}))}})},sn={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:n=null,classes:i=[],attributes:r={},styles:a={}}=t;return Mt({type:"counter",content:e},(()=>(gt("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:n,extra:i}=e,r={...i.attributes,...n?{title:n}:{},class:i.classes.join(" ")},a=Te(i.styles);a.length>0&&(r.style=a);const o=[];return o.push({tag:"span",attributes:r,children:[t]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}({content:e.toString(),title:n,extra:{attributes:r,styles:a,classes:["".concat(ve.cssPrefix,"-layers-counter"),...i]}}))))}})},ln={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=_e,title:i=null,classes:r=[],attributes:a={},styles:o={}}=t;return Mt({type:"text",content:e},(()=>(gt("beforeDOMElementCreation",{content:e,params:t}),Tt({content:e,transform:{..._e,...n},title:i,extra:{attributes:a,styles:o,classes:["".concat(ve.cssPrefix,"-layers-text"),...r]}}))))}}),provides(e){e.generateLayersText=function(e,t){const{title:n,transform:i,extra:r}=t;let a=null,o=null;if(w){const t=parseInt(getComputedStyle(e).fontSize,10),n=e.getBoundingClientRect();a=n.width/t,o=n.height/t}return ve.autoA11y&&!n&&(r.attributes["aria-hidden"]="true"),Promise.resolve([e,Tt({content:e.innerHTML,width:a,height:o,transform:i,title:n,extra:r,watchable:!0})])}}};const cn=new RegExp('"',"ug"),un=[1105920,1112319],dn={FontAwesome:{normal:"fas",400:"fas"},"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"},"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"},"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},hn=Object.keys(dn).reduce(((e,t)=>(e[t.toLowerCase()]=dn[t],e)),{}),fn=Object.keys(hn).reduce(((e,t)=>{const n=hn[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e}),{});function pn(e,t){const n="".concat(G).concat(t.replace(":","-"));return new Promise(((i,r)=>{if(null!==e.getAttribute(n))return i();const a=we(e.children).filter((e=>e.getAttribute(j)===t))[0],o=y.getComputedStyle(e,t),s=o.getPropertyValue("font-family"),l=s.match(ce),c=o.getPropertyValue("font-weight"),u=o.getPropertyValue("content");if(a&&!l)return e.removeChild(a),i();if(l&&"none"!==u&&""!==u){const u=o.getPropertyValue("content");let d=function(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(t),r=isNaN(i)?"normal":i;return(hn[n]||{})[r]||fn[n]}(s,c);const{value:h,isSecondary:f}=function(e){const t=e.replace(cn,""),n=function(e,t){const n=e.length;let i,r=e.charCodeAt(t);return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?1024*(r-55296)+i-56320+65536:r}(t,0),i=n>=un[0]&&n<=un[1],r=2===t.length&&t[0]===t[1];return{value:He(r?t[0]:t),isSecondary:i||r}}(u),p=l[0].startsWith("FontAwesome");let m=it(d,h),g=m;if(p){const e=function(e){const t=Ke[e],n=it("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}(h);e.iconName&&e.prefix&&(m=e.iconName,d=e.prefix)}if(!m||f||a&&a.getAttribute(W)===d&&a.getAttribute(X)===g)i();else{e.setAttribute(n,g),a&&e.removeChild(a);const o={iconName:null,title:null,titleId:null,prefix:null,transform:_e,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:s}=o;s.attributes[j]=t,Rt(m,d).then((r=>{const a=Et({...o,icons:{main:r,mask:st()},prefix:d,iconName:g,extra:s,watchable:!0}),l=x.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=a.map((e=>ze(e))).join("\n"),e.removeAttribute(n),i()})).catch(r)}}else i()}))}function mn(e){return Promise.all([pn(e,"::before"),pn(e,"::after")])}function gn(e){return!(e.parentNode===document.head||~Y.indexOf(e.tagName.toUpperCase())||e.getAttribute(j)||e.parentNode&&"svg"===e.parentNode.tagName)}function vn(e){if(S)return new Promise(((t,n)=>{const i=we(e.querySelectorAll("*")).filter(gn).map(mn),r=It.begin("searchPseudoElements");Wt(),Promise.all(i).then((()=>{r(),Xt(),t()})).catch((()=>{r(),Xt(),n()}))}))}var yn={hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=vn,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=x}=e;ve.searchPseudoElements&&vn(t)}}};let xn=!1;var _n={mixout:()=>({dom:{unwatch(){Wt(),xn=!0}}}),hooks:()=>({bootstrap(){$t(mt("mutationObserverCallbacks",{}))},noAuto(){qt&&qt.disconnect()},watch(e){const{observeMutationsRoot:t}=e;xn?Xt():$t(mt("mutationObserverCallbacks",{observeMutationsRoot:t}))}})};const bn=e=>e.toLowerCase().split(" ").reduce(((e,t)=>{const n=t.toLowerCase().split("-"),i=n[0];let r=n.slice(1).join("-");if(i&&"h"===r)return e.flipX=!0,e;if(i&&"v"===r)return e.flipY=!0,e;if(r=parseFloat(r),isNaN(r))return e;switch(i){case"grow":e.size=e.size+r;break;case"shrink":e.size=e.size-r;break;case"left":e.x=e.x-r;break;case"right":e.x=e.x+r;break;case"up":e.y=e.y-r;break;case"down":e.y=e.y+r;break;case"rotate":e.rotate=e.rotate+r}return e}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});var Sn={mixout:()=>({parse:{transform:e=>bn(e)}}),hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=bn(n)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:n,containerWidth:i,iconWidth:r}=e;const a={transform:"translate(".concat(i/2," 256)")},o="translate(".concat(32*n.x,", ").concat(32*n.y,") "),s="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),l="rotate(".concat(n.rotate," 0 0)"),c={transform:"".concat(o," ").concat(s," ").concat(l)},u={transform:"translate(".concat(r/2*-1," -256)")};return{tag:"g",attributes:{...a},children:[{tag:"g",attributes:{...c},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...u}}]}]}}}};const wn={x:0,y:0,width:"100%",height:"100%"};function Mn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var En={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),i=n?ut(n.split(" ").map((e=>e.trim()))):st();return i.prefix||(i.prefix=ot()),e.mask=i,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:n,main:i,mask:r,maskId:a,transform:o}=e;const{width:s,icon:l}=i,{width:c,icon:u}=r,d=function(e){let{transform:t,containerWidth:n,iconWidth:i}=e;const r={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(a," ").concat(o," ").concat(s)},path:{transform:"translate(".concat(i/2*-1," -256)")}}}({transform:o,containerWidth:c,iconWidth:s}),h={tag:"rect",attributes:{...wn,fill:"white"}},f=l.children?{children:l.children.map(Mn)}:{},p={tag:"g",attributes:{...d.inner},children:[Mn({tag:l.tag,attributes:{...l.attributes,...d.path},...f})]},m={tag:"g",attributes:{...d.outer},children:[p]},g="mask-".concat(a||Se()),v="clip-".concat(a||Se()),y={tag:"mask",attributes:{...wn,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[h,m]},x={tag:"defs",children:[{tag:"clipPath",attributes:{id:v},children:(_=u,"g"===_.tag?_.children:[_])},y]};var _;return t.push(x,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(v,")"),mask:"url(#".concat(g,")"),...wn}}),{children:t,attributes:n}}}},Tn={provides(e){let t=!1;y.matchMedia&&(t=y.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],n={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:{...n,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const r={...i,attributeName:"opacity"},a={tag:"circle",attributes:{...n,cx:"256",cy:"364",r:"28"},children:[]};return t||a.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...r,values:"1;0;1;1;0;1;"}}),e.push(a),e.push({tag:"path",attributes:{...n,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...r,values:"1;0;0;0;0;1;"}}]}),t||e.push({tag:"path",attributes:{...n,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...r,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:e}}}},An={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),i=null!==n&&(""===n||n);return e.symbol=i,e}})};!function(e,t){let{mixoutsTo:n}=t;dt=e,ht={},Object.keys(ft).forEach((e=>{-1===pt.indexOf(e)&&delete ft[e]})),dt.forEach((e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach((e=>{"function"==typeof t[e]&&(n[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEach((i=>{n[e]||(n[e]={}),n[e][i]=t[e][i]}))})),e.hooks){const t=e.hooks();Object.keys(t).forEach((e=>{ht[e]||(ht[e]=[]),ht[e].push(t[e])}))}e.provides&&e.provides(ft)}))}([ke,an,on,sn,ln,yn,_n,Sn,En,Tn,An],{mixoutsTo:St});const Cn=St.parse,Pn=St.icon;var Rn,Ln,kn,Nn,Dn,In={exports:{}};function On(){if(Ln)return Rn;Ln=1;return Rn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Un(){if(Nn)return kn;Nn=1;var e=On();function t(){}function n(){}return n.resetWarningCache=t,kn=function(){function i(t,n,i,r,a,o){if(o!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function r(){return i}i.isRequired=i;var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},kn}function zn(){return Dn||(Dn=1,In.exports=Un()()),In.exports}var Fn=e(zn()),Bn=u(),Hn=e(Bn);function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(n),!0).forEach((function(t){Wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gn(e){return Gn="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},Gn(e)}function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qn(e){return function(e){if(Array.isArray(e))return $n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $n(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $n(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Yn(e){return t=e,(t-=0)==t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}var Zn=["style"];var Kn=!1;try{Kn=!0}catch(e){}function Qn(e){return e&&"object"===Gn(e)&&e.prefix&&e.iconName&&e.icon?e:Cn.icon?Cn.icon(e):null===e?null:e&&"object"===Gn(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function Jn(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?Wn({},e,t):{}}var ei={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},ti=Hn.forwardRef((function(e,t){var n=jn(jn({},ei),e),i=n.icon,r=n.mask,a=n.symbol,o=n.className,s=n.title,l=n.titleId,c=n.maskId,u=Qn(i),d=Jn("classes",[].concat(qn(function(e){var t,n=e.beat,i=e.fade,r=e.beatFade,a=e.bounce,o=e.shake,s=e.flash,l=e.spin,c=e.spinPulse,u=e.spinReverse,d=e.pulse,h=e.fixedWidth,f=e.inverse,p=e.border,m=e.listItem,g=e.flip,v=e.size,y=e.rotation,x=e.pull,_=(Wn(t={"fa-beat":n,"fa-fade":i,"fa-beat-fade":r,"fa-bounce":a,"fa-shake":o,"fa-flash":s,"fa-spin":l,"fa-spin-reverse":u,"fa-spin-pulse":c,"fa-pulse":d,"fa-fw":h,"fa-inverse":f,"fa-border":p,"fa-li":m,"fa-flip":!0===g,"fa-flip-horizontal":"horizontal"===g||"both"===g,"fa-flip-vertical":"vertical"===g||"both"===g},"fa-".concat(v),null!=v),Wn(t,"fa-rotate-".concat(y),null!=y&&0!==y),Wn(t,"fa-pull-".concat(x),null!=x),Wn(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(_).map((function(e){return _[e]?e:null})).filter((function(e){return e}))}(n)),qn((o||"").split(" ")))),h=Jn("transform","string"==typeof n.transform?Cn.transform(n.transform):n.transform),f=Jn("mask",Qn(r)),p=Pn(u,jn(jn(jn(jn({},d),h),f),{},{symbol:a,title:s,titleId:l,maskId:c}));if(!p)return function(){var e;!Kn&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",u),null;var m=p.abstract,g={ref:t};return Object.keys(n).forEach((function(e){ei.hasOwnProperty(e)||(g[e]=n[e])})),ri(m[0],g)}));ti.displayName="FontAwesomeIcon",ti.propTypes={beat:Fn.bool,border:Fn.bool,beatFade:Fn.bool,bounce:Fn.bool,className:Fn.string,fade:Fn.bool,flash:Fn.bool,mask:Fn.oneOfType([Fn.object,Fn.array,Fn.string]),maskId:Fn.string,fixedWidth:Fn.bool,inverse:Fn.bool,flip:Fn.oneOf([!0,!1,"horizontal","vertical","both"]),icon:Fn.oneOfType([Fn.object,Fn.array,Fn.string]),listItem:Fn.bool,pull:Fn.oneOf(["right","left"]),pulse:Fn.bool,rotation:Fn.oneOf([0,90,180,270]),shake:Fn.bool,size:Fn.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Fn.bool,spinPulse:Fn.bool,spinReverse:Fn.bool,symbol:Fn.oneOfType([Fn.bool,Fn.string]),title:Fn.string,titleId:Fn.string,transform:Fn.oneOfType([Fn.string,Fn.object]),swapOpacity:Fn.bool};var ni,ii,ri=function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var r=(n.children||[]).map((function(n){return e(t,n)})),a=Object.keys(n.attributes||{}).reduce((function(e,t){var i=n.attributes[t];switch(t){case"class":e.attrs.className=i,delete n.attributes.class;break;case"style":e.attrs.style=i.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,i=t.indexOf(":"),r=Yn(t.slice(0,i)),a=t.slice(i+1).trim();return r.startsWith("webkit")?e[(n=r,n.charAt(0).toUpperCase()+n.slice(1))]=a:e[r]=a,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=i:e.attrs[Yn(t)]=i}return e}),{attrs:{}}),o=i.style,s=void 0===o?{}:o,l=Xn(i,Zn);return a.attrs.style=jn(jn({},a.attrs.style),s),t.apply(void 0,[n.tag,jn(jn({},a.attrs),l)].concat(qn(r)))}.bind(null,Hn.createElement),ai=function(){return ai=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ai.apply(this,arguments)};function oi(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var si=e(ii?ni:(ii=1,ni=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<a.length;l++){var c=a[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(r=n?n.call(i,u,d,c):void 0)||void 0===r&&u!==d)return!1}return!0})),li="-ms-",ci="-moz-",ui="-webkit-",di="comm",hi="rule",fi="decl",pi="@import",mi="@keyframes",gi="@layer",vi=Math.abs,yi=String.fromCharCode,xi=Object.assign;function _i(e){return e.trim()}function bi(e,t){return(e=t.exec(e))?e[0]:e}function Si(e,t,n){return e.replace(t,n)}function wi(e,t,n){return e.indexOf(t,n)}function Mi(e,t){return 0|e.charCodeAt(t)}function Ei(e,t,n){return e.slice(t,n)}function Ti(e){return e.length}function Ai(e){return e.length}function Ci(e,t){return t.push(e),e}function Pi(e,t){return e.filter((function(e){return!bi(e,t)}))}var Ri=1,Li=1,ki=0,Ni=0,Di=0,Ii="";function Oi(e,t,n,i,r,a,o,s){return{value:e,root:t,parent:n,type:i,props:r,children:a,line:Ri,column:Li,length:o,return:"",siblings:s}}function Ui(e,t){return xi(Oi("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function zi(e){for(;e.root;)e=Ui(e.root,{children:[e]});Ci(e,e.siblings)}function Fi(){return Di=Ni>0?Mi(Ii,--Ni):0,Li--,10===Di&&(Li=1,Ri--),Di}function Bi(){return Di=Ni<ki?Mi(Ii,Ni++):0,Li++,10===Di&&(Li=1,Ri++),Di}function Hi(){return Mi(Ii,Ni)}function Vi(){return Ni}function ji(e,t){return Ei(Ii,e,t)}function Gi(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Wi(e){return _i(ji(Ni-1,$i(91===e?e+2:40===e?e+1:e)))}function Xi(e){for(;(Di=Hi())&&Di<33;)Bi();return Gi(e)>2||Gi(Di)>3?"":" "}function qi(e,t){for(;--t&&Bi()&&!(Di<48||Di>102||Di>57&&Di<65||Di>70&&Di<97););return ji(e,Vi()+(t<6&&32==Hi()&&32==Bi()))}function $i(e){for(;Bi();)switch(Di){case e:return Ni;case 34:case 39:34!==e&&39!==e&&$i(Di);break;case 40:41===e&&$i(e);break;case 92:Bi()}return Ni}function Yi(e,t){for(;Bi()&&e+Di!==57&&(e+Di!==84||47!==Hi()););return"/*"+ji(t,Ni-1)+"*"+yi(47===e?e:Bi())}function Zi(e){for(;!Gi(Hi());)Bi();return ji(e,Ni)}function Ki(e){return function(e){return Ii="",e}(Qi("",null,null,null,[""],e=function(e){return Ri=Li=1,ki=Ti(Ii=e),Ni=0,[]}(e),0,[0],e))}function Qi(e,t,n,i,r,a,o,s,l){for(var c=0,u=0,d=o,h=0,f=0,p=0,m=1,g=1,v=1,y=0,x="",_=r,b=a,S=i,w=x;g;)switch(p=y,y=Bi()){case 40:if(108!=p&&58==Mi(w,d-1)){-1!=wi(w+=Si(Wi(y),"&","&\f"),"&\f",vi(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:w+=Wi(y);break;case 9:case 10:case 13:case 32:w+=Xi(p);break;case 92:w+=qi(Vi()-1,7);continue;case 47:switch(Hi()){case 42:case 47:Ci(er(Yi(Bi(),Vi()),t,n,l),l);break;default:w+="/"}break;case 123*m:s[c++]=Ti(w)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(w=Si(w,/\f/g,"")),f>0&&Ti(w)-d&&Ci(f>32?tr(w+";",i,n,d-1,l):tr(Si(w," ","")+";",i,n,d-2,l),l);break;case 59:w+=";";default:if(Ci(S=Ji(w,t,n,c,u,r,s,x,_=[],b=[],d,a),a),123===y)if(0===u)Qi(w,t,S,S,_,a,d,s,b);else switch(99===h&&110===Mi(w,3)?100:h){case 100:case 108:case 109:case 115:Qi(e,S,S,i&&Ci(Ji(e,S,S,0,0,r,s,x,r,_=[],d,b),b),r,b,d,s,i?_:b);break;default:Qi(w,S,S,S,[""],b,0,s,b)}}c=u=f=0,m=v=1,x=w="",d=o;break;case 58:d=1+Ti(w),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Fi())continue;switch(w+=yi(y),y*m){case 38:v=u>0?1:(w+="\f",-1);break;case 44:s[c++]=(Ti(w)-1)*v,v=1;break;case 64:45===Hi()&&(w+=Wi(Bi())),h=Hi(),u=d=Ti(x=w+=Zi(Vi())),y++;break;case 45:45===p&&2==Ti(w)&&(m=0)}}return a}function Ji(e,t,n,i,r,a,o,s,l,c,u,d){for(var h=r-1,f=0===r?a:[""],p=Ai(f),m=0,g=0,v=0;m<i;++m)for(var y=0,x=Ei(e,h+1,h=vi(g=o[m])),_=e;y<p;++y)(_=_i(g>0?f[y]+" "+x:Si(x,/&\f/g,f[y])))&&(l[v++]=_);return Oi(e,t,n,0===r?hi:s,l,c,u,d)}function er(e,t,n,i){return Oi(e,t,n,di,yi(Di),Ei(e,2,-2),0,i)}function tr(e,t,n,i,r){return Oi(e,t,n,fi,Ei(e,0,i),Ei(e,i+1,-1),i,r)}function nr(e,t,n){switch(function(e,t){return 45^Mi(e,0)?(((t<<2^Mi(e,0))<<2^Mi(e,1))<<2^Mi(e,2))<<2^Mi(e,3):0}(e,t)){case 5103:return ui+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ui+e+e;case 4789:return ci+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ui+e+ci+e+li+e+e;case 5936:switch(Mi(e,t+11)){case 114:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ui+e+li+Si(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ui+e+li+e+e;case 6165:return ui+e+li+"flex-"+e+e;case 5187:return ui+e+Si(e,/(\w+).+(:[^]+)/,ui+"box-$1$2"+li+"flex-$1$2")+e;case 5443:return ui+e+li+"flex-item-"+Si(e,/flex-|-self/g,"")+(bi(e,/flex-|baseline/)?"":li+"grid-row-"+Si(e,/flex-|-self/g,""))+e;case 4675:return ui+e+li+"flex-line-pack"+Si(e,/align-content|flex-|-self/g,"")+e;case 5548:return ui+e+li+Si(e,"shrink","negative")+e;case 5292:return ui+e+li+Si(e,"basis","preferred-size")+e;case 6060:return ui+"box-"+Si(e,"-grow","")+ui+e+li+Si(e,"grow","positive")+e;case 4554:return ui+Si(e,/([^-])(transform)/g,"$1"+ui+"$2")+e;case 6187:return Si(Si(Si(e,/(zoom-|grab)/,ui+"$1"),/(image-set)/,ui+"$1"),e,"")+e;case 5495:case 3959:return Si(e,/(image-set\([^]*)/,ui+"$1$`$1");case 4968:return Si(Si(e,/(.+:)(flex-)?(.*)/,ui+"box-pack:$3"+li+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ui+e+e;case 4200:if(!bi(e,/flex-|baseline/))return li+"grid-column-align"+Ei(e,t)+e;break;case 2592:case 3360:return li+Si(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,bi(e.props,/grid-\w+-end/)}))?~wi(e+(n=n[t].value),"span",0)?e:li+Si(e,"-start","")+e+li+"grid-row-span:"+(~wi(n,"span",0)?bi(n,/\d+/):+bi(n,/\d+/)-+bi(e,/\d+/))+";":li+Si(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return bi(e.props,/grid-\w+-start/)}))?e:li+Si(Si(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Si(e,/(.+)-inline(.+)/,ui+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ti(e)-1-t>6)switch(Mi(e,t+1)){case 109:if(45!==Mi(e,t+4))break;case 102:return Si(e,/(.+:)(.+)-([^]+)/,"$1"+ui+"$2-$3$1"+ci+(108==Mi(e,t+3)?"$3":"$2-$3"))+e;case 115:return~wi(e,"stretch",0)?nr(Si(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Si(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,i,r,a,o,s){return li+n+":"+i+s+(r?li+n+"-span:"+(a?o:+o-+i)+s:"")+e}));case 4949:if(121===Mi(e,t+6))return Si(e,":",":"+ui)+e;break;case 6444:switch(Mi(e,45===Mi(e,14)?18:11)){case 120:return Si(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ui+(45===Mi(e,14)?"inline-":"")+"box$3$1"+ui+"$2$3$1"+li+"$2box$3")+e;case 100:return Si(e,":",":"+li)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Si(e,"scroll-","scroll-snap-")+e}return e}function ir(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function rr(e,t,n,i){switch(e.type){case gi:if(e.children.length)break;case pi:case fi:return e.return=e.return||e.value;case di:return"";case mi:return e.return=e.value+"{"+ir(e.children,i)+"}";case hi:if(!Ti(e.value=e.props.join(",")))return""}return Ti(n=ir(e.children,i))?e.return=e.value+"{"+n+"}":""}function ar(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case fi:return void(e.return=nr(e.value,e.length,n));case mi:return ir([Ui(e,{value:Si(e.value,"@","@"+ui)})],i);case hi:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(bi(t,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zi(Ui(e,{props:[Si(t,/:(read-\w+)/,":"+ci+"$1")]})),zi(Ui(e,{props:[t]})),xi(e,{props:Pi(n,i)});break;case"::placeholder":zi(Ui(e,{props:[Si(t,/:(plac\w+)/,":"+ui+"input-$1")]})),zi(Ui(e,{props:[Si(t,/:(plac\w+)/,":"+ci+"$1")]})),zi(Ui(e,{props:[Si(t,/:(plac\w+)/,li+"input-$1")]})),zi(Ui(e,{props:[t]})),xi(e,{props:Pi(n,i)})}return""}))}}var or={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},sr="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",lr="active",cr="data-styled-version",ur="6.1.19",dr="/*!sc*/\n",hr="undefined"!=typeof window&&"undefined"!=typeof document,fr=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&("false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),pr=Object.freeze([]),mr=Object.freeze({});var gr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),vr=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,yr=/(^-|-$)/g;function xr(e){return e.replace(vr,"-").replace(yr,"")}var _r=/(a)(d)/gi,br=52,Sr=function(e){return String.fromCharCode(e+(e>25?39:97))};function wr(e){var t,n="";for(t=Math.abs(e);t>br;t=t/br|0)n=Sr(t%br)+n;return(Sr(t%br)+n).replace(_r,"$1-$2")}var Mr,Er=5381,Tr=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ar=function(e){return Tr(Er,e)};function Cr(e){return"string"==typeof e&&!0}var Pr="function"==typeof Symbol&&Symbol.for,Rr=Pr?Symbol.for("react.memo"):60115,Lr=Pr?Symbol.for("react.forward_ref"):60112,kr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Nr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Dr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ir=((Mr={})[Lr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mr[Rr]=Dr,Mr);function Or(e){return("type"in(t=e)&&t.type.$$typeof)===Rr?Dr:"$$typeof"in e?Ir[e.$$typeof]:kr;var t}var Ur=Object.defineProperty,zr=Object.getOwnPropertyNames,Fr=Object.getOwnPropertySymbols,Br=Object.getOwnPropertyDescriptor,Hr=Object.getPrototypeOf,Vr=Object.prototype;function jr(e,t,n){if("string"!=typeof t){if(Vr){var i=Hr(t);i&&i!==Vr&&jr(e,i,n)}var r=zr(t);Fr&&(r=r.concat(Fr(t)));for(var a=Or(e),o=Or(t),s=0;s<r.length;++s){var l=r[s];if(!(l in Nr||n&&n[l]||o&&l in o||a&&l in a)){var c=Br(t,l);try{Ur(e,l,c)}catch(e){}}}}return e}function Gr(e){return"function"==typeof e}function Wr(e){return"object"==typeof e&&"styledComponentId"in e}function Xr(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function qr(e,t){if(0===e.length)return"";for(var n=e[0],i=1;i<e.length;i++)n+=e[i];return n}function $r(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Yr(e,t,n){if(void 0===n&&(n=!1),!n&&!$r(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var i=0;i<t.length;i++)e[i]=Yr(e[i],t[i]);else if($r(t))for(var i in t)e[i]=Yr(e[i],t[i]);return e}function Zr(e,t){Object.defineProperty(e,"toString",{value:t})}function Kr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var Qr=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,r=i;e>=r;)if((r<<=1)<0)throw Kr(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var a=i;a<r;a++)this.groupSizes[a]=0}for(var o=this.indexOfGroup(e+1),s=(a=0,t.length);a<s;a++)this.tag.insertRule(o,t[a])&&(this.groupSizes[e]++,o++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),i=n+t;this.groupSizes[e]=0;for(var r=n;r<i;r++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),r=i+n,a=i;a<r;a++)t+="".concat(this.tag.getRule(a)).concat(dr);return t},e}(),Jr=new Map,ea=new Map,ta=1,na=function(e){if(Jr.has(e))return Jr.get(e);for(;ea.has(ta);)ta++;var t=ta++;return Jr.set(e,t),ea.set(t,e),t},ia=function(e,t){ta=t+1,Jr.set(e,t),ea.set(t,e)},ra="style[".concat(sr,"][").concat(cr,'="').concat(ur,'"]'),aa=new RegExp("^".concat(sr,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),oa=function(e,t,n){for(var i,r=n.split(","),a=0,o=r.length;a<o;a++)(i=r[a])&&e.registerName(t,i)},sa=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(dr),r=[],a=0,o=i.length;a<o;a++){var s=i[a].trim();if(s){var l=s.match(aa);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(ia(u,c),oa(e,u,l[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(s)}}},la=function(e){for(var t=document.querySelectorAll(ra),n=0,i=t.length;n<i;n++){var r=t[n];r&&r.getAttribute(sr)!==lr&&(sa(e,r),r.parentNode&&r.parentNode.removeChild(r))}};var ca=function(e){var t=document.head,n=e||t,i=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(sr,"]")));return t[t.length-1]}(n),a=void 0!==r?r.nextSibling:null;i.setAttribute(sr,lr),i.setAttribute(cr,ur);var o="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return o&&i.setAttribute("nonce",o),n.insertBefore(i,a),i},ua=function(){function e(e){this.element=ca(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n<i;n++){var r=t[n];if(r.ownerNode===e)return r}throw Kr(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),da=function(){function e(e){this.element=ca(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),ha=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),fa=hr,pa={isServer:!hr,useCSSOMInjection:!fr},ma=function(){function e(e,t,n){void 0===e&&(e=mr),void 0===t&&(t={});var i=this;this.options=ai(ai({},pa),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&hr&&fa&&(fa=!1,la(this)),Zr(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",r=function(n){var r=function(e){return ea.get(e)}(n);if(void 0===r)return"continue";var a=e.names.get(r),o=t.getGroup(n);if(void 0===a||!a.size||0===o.length)return"continue";var s="".concat(sr,".g").concat(n,'[id="').concat(r,'"]'),l="";void 0!==a&&a.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),i+="".concat(o).concat(s,'{content:"').concat(l,'"}').concat(dr)},a=0;a<n;a++)r(a);return i}(i)}))}return e.registerId=function(e){return na(e)},e.prototype.rehydrate=function(){!this.server&&hr&&la(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(ai(ai({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new ha(n):t?new ua(n):new da(n)}(this.options),new Qr(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(na(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(na(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(na(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),ga=/&/g,va=/^\s*\/\/.*$/gm;function ya(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=ya(e.children,t)),e}))}function xa(e){var t,n,i,r=void 0===e?mr:e,a=r.options,o=void 0===a?mr:a,s=r.plugins,l=void 0===s?pr:s,c=function(e,i,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},u=l.slice();u.push((function(e){e.type===hi&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ga,n).replace(i,c))})),o.prefix&&u.push(ar),u.push(rr);var d=function(e,r,a,s){void 0===r&&(r=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,n=r,i=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(va,""),c=Ki(a||r?"".concat(a," ").concat(r," { ").concat(l," }"):l);o.namespace&&(c=ya(c,o.namespace));var d,h=[];return ir(c,function(e){var t=Ai(e);return function(n,i,r,a){for(var o="",s=0;s<t;s++)o+=e[s](n,i,r,a)||"";return o}}(u.concat((d=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),h};return d.hash=l.length?l.reduce((function(e,t){return t.name||Kr(15),Tr(e,t.name)}),Er).toString():"",d}var _a=new ma,ba=xa(),Sa=Hn.createContext({shouldForwardProp:void 0,styleSheet:_a,stylis:ba});Sa.Consumer;var wa=Hn.createContext(void 0);function Ma(){return Bn.useContext(Sa)}function Ea(e){var t=Bn.useState(e.stylisPlugins),n=t[0],i=t[1],r=Ma().styleSheet,a=Bn.useMemo((function(){var t=r;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,r]),o=Bn.useMemo((function(){return xa({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Bn.useEffect((function(){si(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var s=Bn.useMemo((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:a,stylis:o}}),[e.shouldForwardProp,a,o]);return Hn.createElement(Sa.Provider,{value:s},Hn.createElement(wa.Provider,{value:o},e.children))}var Ta=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ba);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Zr(this,(function(){throw Kr(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=ba),this.name+e.hash},e}(),Aa=function(e){return e>="A"&&e<="Z"};function Ca(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;Aa(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Pa=function(e){return null==e||!1===e||""===e},Ra=function(e){var t,n,i=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Pa(a)&&(Array.isArray(a)&&a.isCss||Gr(a)?i.push("".concat(Ca(r),":"),a,";"):$r(a)?i.push.apply(i,oi(oi(["".concat(r," {")],Ra(a),!1),["}"],!1)):i.push("".concat(Ca(r),": ").concat((t=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in or||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function La(e,t,n,i){return Pa(e)?[]:Wr(e)?[".".concat(e.styledComponentId)]:Gr(e)?!Gr(r=e)||r.prototype&&r.prototype.isReactComponent||!t?[e]:La(e(t),t,n,i):e instanceof Ta?n?(e.inject(n,i),[e.getName(i)]):[e]:$r(e)?Ra(e):Array.isArray(e)?Array.prototype.concat.apply(pr,e.map((function(e){return La(e,t,n,i)}))):[e.toString()];var r}var ka=Ar(ur),Na=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Gr(n)&&!Wr(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Tr(ka,t),this.baseStyle=n,ma.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=Xr(i,this.staticRulesId);else{var r=qr(La(this.rules,e,t,n)),a=wr(Tr(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,a)){var o=n(r,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,o)}i=Xr(i,a),this.staticRulesId=a}else{for(var s=Tr(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=qr(La(u,e,t,n));s=Tr(s,d+c),l+=d}}if(l){var h=wr(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),i=Xr(i,h)}}return i},e}(),Da=Hn.createContext(void 0);Da.Consumer;var Ia={};function Oa(e,t,n){var i=Wr(e),r=e,a=!Cr(e),o=t.attrs,s=void 0===o?pr:o,l=t.componentId,c=void 0===l?function(e,t){var n="string"!=typeof e?"sc":xr(e);Ia[n]=(Ia[n]||0)+1;var i="".concat(n,"-").concat(function(e){return wr(Ar(e)>>>0)}(ur+n+Ia[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):l,u=t.displayName,d=void 0===u?function(e){return Cr(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e):u,h=t.displayName&&t.componentId?"".concat(xr(t.displayName),"-").concat(t.componentId):t.componentId||c,f=i&&r.attrs?r.attrs.concat(s).filter(Boolean):s,p=t.shouldForwardProp;if(i&&r.shouldForwardProp){var m=r.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;p=function(e,t){return m(e,t)&&g(e,t)}}else p=m}var v=new Na(n,h,i?r.componentStyle:void 0);function y(e,t){return function(e,t,n){var i=e.attrs,r=e.componentStyle,a=e.defaultProps,o=e.foldedComponentIds,s=e.styledComponentId,l=e.target,c=Hn.useContext(Da),u=Ma(),d=e.shouldForwardProp||u.shouldForwardProp,h=function(e,t,n){return void 0===n&&(n=mr),e.theme!==n.theme&&e.theme||t||n.theme}(t,c,a)||mr,f=function(e,t,n){for(var i,r=ai(ai({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var o=Gr(i=e[a])?i(r):i;for(var s in o)r[s]="className"===s?Xr(r[s],o[s]):"style"===s?ai(ai({},r[s]),o[s]):o[s]}return t.className&&(r.className=Xr(r.className,t.className)),r}(i,t,h),p=f.as||l,m={};for(var g in f)void 0===f[g]||"$"===g[0]||"as"===g||"theme"===g&&f.theme===h||("forwardedAs"===g?m.as=f.forwardedAs:d&&!d(g,p)||(m[g]=f[g]));var v=function(e,t){var n=Ma();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(r,f),y=Xr(o,s);return v&&(y+=" "+v),f.className&&(y+=" "+f.className),m[Cr(p)&&!gr.has(p)?"class":"className"]=y,n&&(m.ref=n),Bn.createElement(p,m)}(x,e,t)}y.displayName=d;var x=Hn.forwardRef(y);return x.attrs=f,x.componentStyle=v,x.displayName=d,x.shouldForwardProp=p,x.foldedComponentIds=i?Xr(r.foldedComponentIds,r.styledComponentId):"",x.styledComponentId=h,x.target=i?r.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,r=t;i<r.length;i++)Yr(e,r[i],!0);return e}({},r.defaultProps,e):e}}),Zr(x,(function(){return".".concat(x.styledComponentId)})),a&&jr(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Ua(e,t){for(var n=[e[0]],i=0,r=t.length;i<r;i+=1)n.push(t[i],e[i+1]);return n}var za=function(e){return Object.assign(e,{isCss:!0})};function Fa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Gr(e)||$r(e))return za(La(Ua(pr,oi([e],t,!0))));var i=e;return 0===t.length&&1===i.length&&"string"==typeof i[0]?La(i):za(La(Ua(i,t)))}function Ba(e,t,n){if(void 0===n&&(n=mr),!t)throw Kr(1,t);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,Fa.apply(void 0,oi([i],r,!1)))};return i.attrs=function(i){return Ba(e,t,ai(ai({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ba(e,t,ai(ai({},n),i))},i}var Ha=function(e){return Ba(Oa,e)},Va=Ha;gr.forEach((function(e){Va[e]=Ha(e)}));const ja="rgba(223, 223, 223, 1)",Ga="rgba(156, 156, 156, 1)",Wa="rgba(243, 151, 143, 1)",Xa="rgba(240, 97, 84,1)",qa="rgba(38, 38, 38, 0.7)",$a="rgba(61, 61, 63, 0.7)",Ya="rgba(61, 61, 63, 0.6)",Za="rgba(61, 61, 63, 1)",Ka="linear-gradient(to bottom, #343434, #393939)",Qa="linear-gradient(to bottom, rgba(52, 52, 52, 0.75), rgba(57, 57, 57, 0.75))",Ja="linear-gradient(to bottom, rgba(75, 75, 75, 0.75), rgba(80, 80, 80, 0.75))",eo="30px",to="30px",no="14px",io="3px",ro="10px",ao="10px 3px 3px 10px",oo="3px 10px 10px 3px",so="70px",lo="30px",co="3px",uo=Va.button`
2
2
  background: ${Qa};
3
3
  border: none;
4
4
  display: flex;
@@ -30,8 +30,8 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
30
30
  `,ho=Va.div`
31
31
  padding: 2px;
32
32
  display: flex;
33
- background-color: ${$a};
34
- border: 1px solid ${qa};
33
+ background-color: ${qa};
34
+ border: 1px solid ${$a};
35
35
  backdrop-filter: blur(40px);
36
36
  -webkit-backdrop-filter: blur(40px);
37
37
  justify-content: center;
@@ -203,8 +203,8 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
203
203
  font-family: Arial, sans-serif;
204
204
  color: ${ja};
205
205
  pointer-events: all;
206
- background-color: ${$a};
207
- border: 1px solid ${qa};
206
+ background-color: ${qa};
207
+ border: 1px solid ${$a};
208
208
  backdrop-filter: blur(40px);
209
209
  -webkit-backdrop-filter: blur(40px);
210
210
  border-radius: 12px;
@@ -215,7 +215,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
215
215
  `,bo=Va.hr`
216
216
  width: ${({$horizontal:e=!0})=>e?"unset":"1px"};
217
217
  height: ${({$horizontal:e=!0})=>e?"1px":"unset"};
218
- background-color: ${qa};
218
+ background-color: ${$a};
219
219
  margin: 5px 3px;
220
220
  border: none;
221
221
  `,So=Va.button`
@@ -274,7 +274,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
274
274
  pointer-events: none;
275
275
  color: ${Ga};
276
276
  font-size: 10px;
277
- `,To={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Ao={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},Co={prefix:"fas",iconName:"gamepad",icon:[640,512,[],"f11b","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"]},Ro={prefix:"fas",iconName:"hand",icon:[512,512,[129306,9995,"hand-paper"],"f256","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z"]},Po={prefix:"fas",iconName:"plug",icon:[384,512,[128268],"f1e6","M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2C297 398 352 333.4 352 256l0-32c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]},Lo={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},ko={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},No={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},Do={prefix:"fas",iconName:"person-shelter",icon:[512,512,[],"e54f","M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.4L256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280l0-88 16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]},Io={prefix:"fas",iconName:"hand-scissors",icon:[512,512,[],"f257","M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9c0 0 0 .1 0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]},Oo={prefix:"fas",iconName:"street-view",icon:[512,512,[],"f21d","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]},Uo={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},zo={prefix:"fas",iconName:"bug",icon:[512,512,[],"f188","M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]},Fo={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},Bo={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},Ho={prefix:"fas",iconName:"hand-lizard",icon:[512,512,[],"f258","M0 112C0 85.5 21.5 64 48 64l112 0 80 0 46.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 12 0 16 0 48c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8L273.9 352 240 352l-80 0-48 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l48 0 80 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-80 0L48 160c-26.5 0-48-21.5-48-48z"]},Vo={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},jo={prefix:"fas",iconName:"vr-cardboard",icon:[640,512,[],"f729","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]},Go={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Wo={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},Xo=eo,$o={"x-button-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),"y-button-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),"a-button-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),"b-button-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-up-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-down-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-right-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),"pose-left":()=>d.jsx(xo,{icon:Io,$reverse:!0}),"pinch-left":()=>d.jsx(xo,{icon:Ho,$reverse:!0}),"thumbstick-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-up-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-down-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-right-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),"trigger-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"trigger-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"squeeze-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),"squeeze-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbrest-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbrest-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"pose-right":()=>d.jsx(xo,{icon:Io,$reverse:!1}),"pinch-right":()=>d.jsx(xo,{icon:Ho,$reverse:!1})},qo=({buttonName:e,handedness:t})=>{const n=$o[`${e}-${t}`];return n?d.jsx(n,{}):d.jsx("div",{style:{width:eo,height:eo}})},Yo=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.5,d:"M7 13.037V5.512m-.324.289 6.3-2.275m-11.952 0 6.3 2.275m.23 6.937 4.233-1.528a1.627 1.627 0 0 0 1.076-1.53V4.396c0-.685-.43-1.297-1.076-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.075 1.53V9.68c0 .686.43 1.298 1.075 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),Zo=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.2,d:"M7 13.037V5.512M3.937 11.9V4.375m6.126 7.525V4.375M6.675 5.8l6.3-2.275m-9.275.962 6.3-2.275M1.024 3.526l6.3 2.275M6.85 9.388l6.3-2.275m-12.302 0 6.3 2.276m-3.15-7.176 6.3 2.276m-2.746 8.248 4.234-1.527a1.627 1.627 0 0 0 1.075-1.53V4.396c0-.685-.43-1.297-1.075-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.076 1.53V9.68c0 .686.43 1.298 1.076 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),Ko=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.2,d:"M1.225 8.225h11.55M2.1 5.075h9.8m-7 7L5.6 2.1m3.5 9.975L8.4 2.1m-5.708 9.712h8.617a1.75 1.75 0 0 0 1.696-2.183l-1.567-6.125a1.75 1.75 0 0 0-1.695-1.317H4.258c-.8 0-1.498.542-1.696 1.317L.996 9.629a1.75 1.75 0 0 0 1.696 2.183Z",style:{stroke:t,strokeOpacity:1}})}),Qo=({size:e=14,color:t=ja})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[d.jsx("path",{fill:t,d:"M10.5 8.367a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8Z",style:{fill:t,fillOpacity:1}}),d.jsx("path",{fill:t,fillRule:"evenodd",d:"M0 5.8A2.8 2.8 0 0 1 2.8 3h8.4A2.8 2.8 0 0 1 14 5.8v2.8a2.8 2.8 0 0 1-2.8 2.8H9.526c-.619 0-1.184-.35-1.46-.903l-.108-.214a.933.933 0 0 0-.835-.516h-.246c-.354 0-.677.2-.835.516l-.107.214a1.633 1.633 0 0 1-1.461.903H2.8A2.8 2.8 0 0 1 0 8.6V5.8Zm4.9 1.167a1.4 1.4 0 1 1-2.8 0 1.4 1.4 0 0 1 2.8 0Zm8.367-.768a.268.268 0 0 0 .076-.292 2.942 2.942 0 0 0-.187-.407l-.055-.096a3.012 3.012 0 0 0-.262-.37.27.27 0 0 0-.29-.08l-.66.21a2.279 2.279 0 0 0-.522-.302l-.148-.676a.268.268 0 0 0-.215-.211 3.062 3.062 0 0 0-1.008.001.268.268 0 0 0-.215.21l-.148.677a2.28 2.28 0 0 0-.522.301l-.66-.21a.268.268 0 0 0-.29.081c-.096.116-.184.24-.262.37l-.056.096c-.072.13-.135.265-.187.406a.268.268 0 0 0 .076.292l.513.467a2.293 2.293 0 0 0 0 .603l-.513.467a.268.268 0 0 0-.076.291c.052.141.115.276.187.407l.056.096c.078.13.166.253.262.37a.27.27 0 0 0 .29.08l.66-.211c.158.122.333.224.52.3l.149.677a.268.268 0 0 0 .215.211 3.06 3.06 0 0 0 1.007 0 .268.268 0 0 0 .216-.21l.148-.677a2.28 2.28 0 0 0 .521-.301l.66.21c.105.033.22.004.29-.08.097-.117.184-.24.263-.37l.055-.097c.073-.13.135-.265.188-.406a.268.268 0 0 0-.076-.292l-.513-.466a2.299 2.299 0 0 0 0-.602l.513-.467Z",clipRule:"evenodd",style:{fill:t,fillOpacity:1}})]}),Jo={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:d.jsx(yo,{icon:{prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]}}),Backspace:d.jsx(yo,{icon:{prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]}}),Enter:d.jsx(yo,{style:{transform:"rotate(90deg)"},icon:{prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]}}),ShiftLeft:d.jsx(yo,{icon:Fo}),ShiftRight:d.jsx(yo,{icon:Fo}),Space:" ",ArrowUp:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]}}),ArrowDown:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]}}),ArrowLeft:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]}}),ArrowRight:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]}}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:d.jsx((({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("g",{clipPath:"url(#a)",children:d.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),d.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("defs",{children:d.jsx("clipPath",{id:"a",children:d.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{}),MouseRight:d.jsx((({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("g",{clipPath:"url(#a)",children:d.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),d.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("defs",{children:d.jsx("clipPath",{id:"a",children:d.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{})},es=e=>{let t;const n=new Set,i=(e,i)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=i?i:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach((n=>n(t,e)))}},r=()=>t,a={setState:i,getState:r,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=t=e(i,r,a);return a};var ts,ns,is,rs,as={exports:{}},os={},ss={exports:{}},ls={};function cs(){return ns||(ns=1,ss.exports=function(){if(ts)return ls;ts=1;var e=u(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,i=e.useEffect,r=e.useLayoutEffect,a=e.useDebugValue;function o(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!t(e,i)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),l=n({inst:{value:s,getSnapshot:t}}),c=l[0].inst,u=l[1];return r((function(){c.value=s,c.getSnapshot=t,o(c)&&u({inst:c})}),[e,s,t]),i((function(){return o(c)&&u({inst:c}),e((function(){o(c)&&u({inst:c})}))}),[e]),a(s),s};return ls.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,ls}()),ss.exports}
277
+ `,To={prefix:"fas",iconName:"right-from-bracket",icon:[512,512,["sign-out-alt"],"f2f5","M377.9 105.9L500.7 228.7c7.2 7.2 11.3 17.1 11.3 27.3s-4.1 20.1-11.3 27.3L377.9 406.1c-6.4 6.4-15 9.9-24 9.9c-18.7 0-33.9-15.2-33.9-33.9l0-62.1-128 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l128 0 0-62.1c0-18.7 15.2-33.9 33.9-33.9c9 0 17.6 3.6 24 9.9zM160 96L96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-53 0-96-43-96-96L0 128C0 75 43 32 96 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32z"]},Ao={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256l0 24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},Co={prefix:"fas",iconName:"gamepad",icon:[640,512,[],"f11b","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"]},Po={prefix:"fas",iconName:"hand",icon:[512,512,[129306,9995,"hand-paper"],"f256","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4s-14.6 41.3 1.4 56.6L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z"]},Ro={prefix:"fas",iconName:"plug",icon:[384,512,[128268],"f1e6","M96 0C78.3 0 64 14.3 64 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM288 0c-17.7 0-32 14.3-32 32l0 96 64 0 0-96c0-17.7-14.3-32-32-32zM32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 32c0 77.4 55 142 128 156.8l0 67.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-67.2C297 398 352 333.4 352 256l0-32c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z"]},Lo={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},ko={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"]},No={prefix:"fas",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"]},Do={prefix:"fas",iconName:"person-shelter",icon:[512,512,[],"e54f","M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.4L256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 280l0-88 16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-37.9-70.3c-15.3-28.5-45.1-46.3-77.5-46.3l-19.5 0c-32.4 0-62.1 17.8-77.5 46.3l-37.9 70.3c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24z"]},Io={prefix:"fas",iconName:"hand-scissors",icon:[512,512,[],"f257","M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32c0 25.3 19.5 46 44.3 47.9c-7.7 8.5-12.3 19.8-12.3 32.1c0 26.5 21.5 48 48 48l32 0 64 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3C444.8 76.8 413.9 64 381.7 64L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4L288 129.9c0 0 0 .1 0 .1L84 65.8C62.9 59.2 40.5 70.9 33.8 92s5.1 43.5 26.2 50.2L269.5 208 40 208z"]},Oo={prefix:"fas",iconName:"street-view",icon:[512,512,[],"f21d","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"]},Uo={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},zo={prefix:"fas",iconName:"bug",icon:[512,512,[],"f188","M256 0c53 0 96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6c0-53 43-96 96-96zM41.4 105.4c12.5-12.5 32.8-12.5 45.3 0l64 64c.7 .7 1.3 1.4 1.9 2.1c14.2-7.3 30.4-11.4 47.5-11.4l112 0c17.1 0 33.2 4.1 47.5 11.4c.6-.7 1.2-1.4 1.9-2.1l64-64c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64c-.7 .7-1.4 1.3-2.1 1.9c6.2 12 10.1 25.3 11.1 39.5l64.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c0 24.6-5.5 47.8-15.4 68.6c2.2 1.3 4.2 2.9 6 4.8l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-63.1-63.1c-24.5 21.8-55.8 36.2-90.3 39.6L272 240c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 239.2c-34.5-3.4-65.8-17.8-90.3-39.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c1.9-1.9 3.9-3.4 6-4.8C101.5 367.8 96 344.6 96 320l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.3 0c1.1-14.1 5-27.5 11.1-39.5c-.7-.6-1.4-1.2-2.1-1.9l-64-64c-12.5-12.5-12.5-32.8 0-45.3z"]},Fo={prefix:"fas",iconName:"angle-up",icon:[448,512,[8963],"f106","M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z"]},Bo={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},Ho={prefix:"fas",iconName:"hand-lizard",icon:[512,512,[],"f258","M0 112C0 85.5 21.5 64 48 64l112 0 80 0 46.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 12 0 16 0 48c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8L273.9 352 240 352l-80 0-48 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l48 0 80 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-80 0L48 160c-26.5 0-48-21.5-48-48z"]},Vo={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},jo={prefix:"fas",iconName:"vr-cardboard",icon:[640,512,[],"f729","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]},Go={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},Wo={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M0 128C0 92.7 28.7 64 64 64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2l0 256c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1l0-17.1 0-128 0-17.1 14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"]},Xo=eo,qo={"x-button-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M16.529 16.1h-.893l-1.653-2.713-1.68 2.713h-.832l2.074-3.255-1.942-2.992h.875l1.531 2.45 1.54-2.45h.831l-1.933 2.975 2.082 3.272Z",style:{fill:"#fff",fillOpacity:1}})]}),"y-button-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"m14.086 12.924 1.627-3.071h.849l-2.083 3.823V16.1h-.787v-2.389L11.61 9.853h.857l1.619 3.07Z",style:{fill:"#fff",fillOpacity:1}})]}),"a-button-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"m15.975 16.1-.753-1.934h-2.476l-.744 1.934h-.796l2.441-6.274h.709l2.432 6.274h-.813Zm-1.69-4.524a29.052 29.052 0 0 1-.21-.63 5.175 5.175 0 0 0-.087-.306c-.029.117-.06.236-.096.359-.03.116-.061.224-.096.323-.03.1-.056.184-.079.254l-.709 1.89h1.978l-.7-1.89Z",style:{fill:"#fff",fillOpacity:1}})]}),"b-button-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7 13.125a7 7 0 1 0 14 0v1.75a7 7 0 0 1-14 0v-1.75Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.55,d:"M14 19.863a6.738 6.738 0 1 0 0-13.476 6.738 6.738 0 0 0 0 13.476Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.876 9.853c.519 0 .954.05 1.304.148.355.1.62.263.796.49.18.228.271.531.271.91 0 .245-.047.464-.14.656a1.198 1.198 0 0 1-.402.473 1.62 1.62 0 0 1-.648.254v.043c.262.041.499.117.709.228.216.11.385.268.507.473.123.204.184.47.184.796 0 .379-.088.703-.262.971a1.663 1.663 0 0 1-.753.604c-.32.134-.706.201-1.155.201h-2.196V9.853h1.785Zm.157 2.66c.537 0 .905-.085 1.103-.254.198-.175.297-.432.297-.77 0-.344-.122-.59-.367-.735-.24-.152-.624-.228-1.155-.228h-1.033v1.986h1.155Zm-1.155.656v2.266h1.26c.555 0 .94-.108 1.155-.324.216-.216.324-.498.324-.849 0-.221-.05-.414-.149-.577-.093-.163-.254-.289-.481-.376-.222-.093-.525-.14-.91-.14h-1.199Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.5,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.247h.787v5.547h2.73v.7h-3.517ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-up-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-down-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-right-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M12.642 17.325v-6.248h.787v5.548h2.73v.7h-3.517ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),"pose-left":()=>d.jsx(xo,{icon:Io,$reverse:!0}),"pinch-left":()=>d.jsx(xo,{icon:Ho,$reverse:!0}),"thumbstick-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 6.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875L14.478 6.39Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m13.045 6.711-1.093-1.22a8.75 8.75 0 1 0 4.24.036L15.11 6.733A7.352 7.352 0 0 1 14 21.35a7.35 7.35 0 0 1-.955-14.639Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-up-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM13.697.611a.525.525 0 0 1 .782 0l2.234 2.495a.525.525 0 0 1-.39.875h-4.47a.525.525 0 0 1-.391-.875L13.697.61Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-down-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM14.479 27.389a.525.525 0 0 1-.782 0l-2.235-2.495a.525.525 0 0 1 .39-.875h4.47c.454 0 .694.537.391.875l-2.235 2.495Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-right-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM27.389 13.521a.525.525 0 0 1 0 .782l-2.495 2.235a.525.525 0 0 1-.875-.39v-4.47c0-.454.537-.694.875-.391l2.495 2.234Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbstick-left-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:1.5,d:"M14 22.05a8.05 8.05 0 1 0 0-16.1 8.05 8.05 0 0 0 0 16.1Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.75,d:"M14 19.95a5.95 5.95 0 1 0 0-11.9 5.95 5.95 0 0 0 0 11.9Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M13.938 11.077c.52 0 .945.068 1.278.202.338.128.59.323.752.586.164.262.245.592.245.989 0 .332-.06.61-.183.83-.123.223-.28.4-.473.535a2.61 2.61 0 0 1-.595.306l1.715 2.8h-.919l-1.513-2.581h-1.243v2.58h-.787v-6.247h1.723Zm-.043.683h-.893v2.319h.936c.339 0 .616-.044.832-.132a.956.956 0 0 0 .472-.402c.105-.175.158-.394.158-.656 0-.274-.056-.493-.167-.657a.905.905 0 0 0-.49-.358c-.221-.076-.504-.114-.848-.114ZM.611 14.303a.525.525 0 0 1 0-.782l2.495-2.234a.525.525 0 0 1 .875.39v4.47a.525.525 0 0 1-.875.391L.61 14.303Z",style:{fill:"#fff",fillOpacity:1}})]}),"trigger-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M10.209 15.662V9.415h.787v5.548h2.73v.7H10.21Zm6.395 0h-.787v-5.556h-1.952v-.691h4.682v.691h-1.943v5.556Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"trigger-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M14 20.212a7.612 7.612 0 1 0 0-15.224 7.612 7.612 0 0 0 0 15.224Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M11.42 9.415c.52 0 .945.067 1.277.201.339.129.59.324.753.587.163.262.245.592.245.988 0 .333-.061.61-.184.832-.122.221-.28.4-.472.533-.187.129-.385.23-.595.307l1.715 2.8h-.92l-1.513-2.582h-1.242v2.582h-.788V9.415h1.724Zm-.044.683h-.892v2.318h.936c.338 0 .615-.043.831-.131a.956.956 0 0 0 .473-.402c.105-.175.157-.394.157-.657 0-.274-.055-.493-.166-.656a.905.905 0 0 0-.49-.359c-.222-.075-.505-.114-.849-.114Zm5.74 5.564h-.787v-5.556h-1.951v-.691h4.681v.691h-1.942v5.556Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M21.235 17.5a8.31 8.31 0 0 1-7.205 4.165A8.31 8.31 0 0 1 6.825 17.5c.823 3.4 3.737 5.915 7.205 5.915 3.469 0 6.382-2.514 7.205-5.915Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"squeeze-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M7.525 7.875c-2.283 1.22-3.82 3.507-3.82 6.125s1.537 4.904 3.82 6.125C4.405 19.425 2.1 16.948 2.1 14s2.306-5.425 5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M24.702 10.954a2.187 2.187 0 0 0-2.095-2.817H11.025a5.863 5.863 0 0 0 0 11.726h9.377c.966 0 1.818-.634 2.095-1.56l2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M10.594 17.15v-6.248h.788v5.548h2.73v.7h-3.518Zm7.13-3.299h2.162v3.063c-.338.11-.68.192-1.024.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.567 2.567 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.55 4.55 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018.146-.017.277-.037.394-.06.123-.024.236-.047.341-.07V14.55h-1.373v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),"squeeze-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M20.441 7.875c2.283 1.22 3.82 3.507 3.82 6.125s-1.537 4.904-3.82 6.125c3.12-.7 5.425-3.177 5.425-6.125s-2.305-5.425-5.425-6.125Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{stroke:"#fff",strokeWidth:.7,d:"M3.264 10.954a2.187 2.187 0 0 1 2.095-2.817h11.582a5.862 5.862 0 0 1 0 11.726H7.564a2.188 2.188 0 0 1-2.095-1.56l-2.205-7.35Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",d:"M9.497 10.902c.519 0 .945.068 1.277.202.339.128.59.323.753.586.163.262.245.592.245.989 0 .332-.062.61-.184.83-.122.223-.28.4-.472.535-.187.128-.386.23-.595.306l1.714 2.8h-.918l-1.514-2.581H8.56v2.58h-.787v-6.247h1.724Zm-.044.683H8.56v2.319h.937c.338 0 .615-.044.831-.132a.956.956 0 0 0 .473-.402c.104-.175.157-.394.157-.656 0-.274-.055-.493-.166-.657a.905.905 0 0 0-.49-.358c-.222-.076-.505-.114-.849-.114Zm6.476 2.266h2.16v3.063c-.337.11-.679.192-1.023.245a7.837 7.837 0 0 1-1.172.078c-.648 0-1.193-.128-1.637-.385a2.568 2.568 0 0 1-1.015-1.11c-.227-.485-.34-1.057-.34-1.716 0-.653.127-1.219.384-1.697a2.699 2.699 0 0 1 1.103-1.112c.484-.268 1.067-.402 1.75-.402.35 0 .68.032.988.096.315.064.607.155.875.271l-.297.683a4.551 4.551 0 0 0-.753-.254 3.453 3.453 0 0 0-.857-.105c-.496 0-.922.102-1.278.306a2.004 2.004 0 0 0-.813.875c-.187.374-.28.82-.28 1.34 0 .495.078.935.236 1.32.163.38.417.677.761.893.344.21.796.315 1.356.315.187 0 .35-.006.49-.018a5.17 5.17 0 0 0 .394-.06c.123-.024.236-.047.341-.07V14.55H15.93v-.7Z",style:{fill:"#fff",fillOpacity:1}})]}),"thumbrest-left":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",d:"m20.01 15.768-4.242 4.242a5.5 5.5 0 1 1-7.778-7.778l4.242-4.242a5.5 5.5 0 1 1 7.778 7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M11.172 16.828a1 1 0 0 0 1.414 0L15.414 14l.707.707-2.828 2.828a2 2 0 1 1-2.829-2.828l.708.707a1 1 0 0 0 0 1.414ZM12.586 14l2.828-2.829a1 1 0 1 1 1.414 1.415l.708.707a2 2 0 0 0-2.829-2.829l-2.828 2.829.707.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M15.414 16.828 18.243 14a3 3 0 0 0-2.289-5.117l-.869-.869a4 4 0 0 1 3.864 6.693l-2.828 2.828-.707-.707Zm-.707 2.122a4 4 0 1 1-5.657-5.657l4.243-4.243.707.707L9.757 14A3 3 0 1 0 14 18.242l.707.708Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"thumbrest-right":({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Xo,height:Xo,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("path",{stroke:"#fff",d:"m15.768 7.99 4.242 4.242a5.5 5.5 0 1 1-7.778 7.778L7.99 15.768a5.5 5.5 0 1 1 7.778-7.778Z",style:{stroke:"#fff",strokeOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 16.828a1 1 0 0 0 0-1.414L14 12.586l.707-.707 2.828 2.828a2 2 0 1 1-2.828 2.828l.707-.707a1 1 0 0 0 1.414 0ZM14 15.414l-2.828-2.828a1 1 0 0 1 1.414-1.414l.707-.708a2 2 0 0 0-2.829 2.829l2.829 2.828.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}}),d.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16.828 12.586 14 9.757a3 3 0 0 0-5.117 2.289l-.869.869a4 4 0 0 1 6.693-3.864l2.828 2.828-.707.707Zm2.122.707a4 4 0 1 1-5.657 5.657L9.05 14.707 9.757 14 14 18.243A3 3 0 1 0 18.243 14l.707-.707Z",clipRule:"evenodd",style:{fill:"#fff",fillOpacity:1}})]}),"pose-right":()=>d.jsx(xo,{icon:Io,$reverse:!1}),"pinch-right":()=>d.jsx(xo,{icon:Ho,$reverse:!1})},$o=({buttonName:e,handedness:t})=>{const n=qo[`${e}-${t}`];return n?d.jsx(n,{}):d.jsx("div",{style:{width:eo,height:eo}})},Yo=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.5,d:"M7 13.037V5.512m-.324.289 6.3-2.275m-11.952 0 6.3 2.275m.23 6.937 4.233-1.528a1.627 1.627 0 0 0 1.076-1.53V4.396c0-.685-.43-1.297-1.076-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.075 1.53V9.68c0 .686.43 1.298 1.075 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),Zo=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.2,d:"M7 13.037V5.512M3.937 11.9V4.375m6.126 7.525V4.375M6.675 5.8l6.3-2.275m-9.275.962 6.3-2.275M1.024 3.526l6.3 2.275M6.85 9.388l6.3-2.275m-12.302 0 6.3 2.276m-3.15-7.176 6.3 2.276m-2.746 8.248 4.234-1.527a1.627 1.627 0 0 0 1.075-1.53V4.396c0-.685-.43-1.297-1.075-1.53L7.553 1.339a1.63 1.63 0 0 0-1.106 0L2.213 2.867a1.627 1.627 0 0 0-1.076 1.53V9.68c0 .686.43 1.298 1.076 1.53l4.234 1.529a1.63 1.63 0 0 0 1.106 0Z",style:{stroke:t,strokeOpacity:1}})}),Ko=({size:e=14,color:t=ja})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:d.jsx("path",{stroke:t,strokeWidth:1.2,d:"M1.225 8.225h11.55M2.1 5.075h9.8m-7 7L5.6 2.1m3.5 9.975L8.4 2.1m-5.708 9.712h8.617a1.75 1.75 0 0 0 1.696-2.183l-1.567-6.125a1.75 1.75 0 0 0-1.695-1.317H4.258c-.8 0-1.498.542-1.696 1.317L.996 9.629a1.75 1.75 0 0 0 1.696 2.183Z",style:{stroke:t,strokeOpacity:1}})}),Qo=({size:e=14,color:t=ja})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[d.jsx("path",{fill:t,d:"M10.5 8.367a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8Z",style:{fill:t,fillOpacity:1}}),d.jsx("path",{fill:t,fillRule:"evenodd",d:"M0 5.8A2.8 2.8 0 0 1 2.8 3h8.4A2.8 2.8 0 0 1 14 5.8v2.8a2.8 2.8 0 0 1-2.8 2.8H9.526c-.619 0-1.184-.35-1.46-.903l-.108-.214a.933.933 0 0 0-.835-.516h-.246c-.354 0-.677.2-.835.516l-.107.214a1.633 1.633 0 0 1-1.461.903H2.8A2.8 2.8 0 0 1 0 8.6V5.8Zm4.9 1.167a1.4 1.4 0 1 1-2.8 0 1.4 1.4 0 0 1 2.8 0Zm8.367-.768a.268.268 0 0 0 .076-.292 2.942 2.942 0 0 0-.187-.407l-.055-.096a3.012 3.012 0 0 0-.262-.37.27.27 0 0 0-.29-.08l-.66.21a2.279 2.279 0 0 0-.522-.302l-.148-.676a.268.268 0 0 0-.215-.211 3.062 3.062 0 0 0-1.008.001.268.268 0 0 0-.215.21l-.148.677a2.28 2.28 0 0 0-.522.301l-.66-.21a.268.268 0 0 0-.29.081c-.096.116-.184.24-.262.37l-.056.096c-.072.13-.135.265-.187.406a.268.268 0 0 0 .076.292l.513.467a2.293 2.293 0 0 0 0 .603l-.513.467a.268.268 0 0 0-.076.291c.052.141.115.276.187.407l.056.096c.078.13.166.253.262.37a.27.27 0 0 0 .29.08l.66-.211c.158.122.333.224.52.3l.149.677a.268.268 0 0 0 .215.211 3.06 3.06 0 0 0 1.007 0 .268.268 0 0 0 .216-.21l.148-.677a2.28 2.28 0 0 0 .521-.301l.66.21c.105.033.22.004.29-.08.097-.117.184-.24.263-.37l.055-.097c.073-.13.135-.265.188-.406a.268.268 0 0 0-.076-.292l-.513-.466a2.299 2.299 0 0 0 0-.602l.513-.467Z",clipRule:"evenodd",style:{fill:t,fillOpacity:1}})]}),Jo={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Tab:d.jsx(yo,{icon:{prefix:"fas",iconName:"arrow-right-to-bracket",icon:[512,512,["sign-in"],"f090","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"]}}),Backspace:d.jsx(yo,{icon:{prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]}}),Enter:d.jsx(yo,{style:{transform:"rotate(90deg)"},icon:{prefix:"fas",iconName:"arrow-turn-down",icon:[384,512,["level-down"],"f149","M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z"]}}),ShiftLeft:d.jsx(yo,{icon:Fo}),ShiftRight:d.jsx(yo,{icon:Fo}),Space:" ",ArrowUp:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"]}}),ArrowDown:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"]}}),ArrowLeft:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-left",icon:[256,512,[],"f0d9","M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"]}}),ArrowRight:d.jsx(yo,{icon:{prefix:"fas",iconName:"caret-right",icon:[256,512,[],"f0da","M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"]}}),Semicolon:";",Equal:"=",Comma:",",Minus:"-",Period:".",Slash:"/",Backquote:"`",BracketLeft:"[",Backslash:"\\",BracketRight:"]",Quote:"'",MouseLeft:d.jsx((({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("g",{clipPath:"url(#a)",children:d.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),d.jsx("path",{fill:"#fff",d:"M.5 6.5H6v-6H5C2.237.5.5 2.237.5 5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("defs",{children:d.jsx("clipPath",{id:"a",children:d.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{}),MouseRight:d.jsx((({scale:e=1.2})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:16,fill:"none",transform:`scale(${e}, ${e})`,children:[d.jsx("g",{clipPath:"url(#a)",children:d.jsx("path",{stroke:"#fff",d:"M.5 6.5H6m-5.5 0V5C.5 2.237 2.237.5 5 .5h1m-5.5 6V11c0 2.762 1.737 4.5 4.5 4.5h2c2.762 0 4.5-1.738 4.5-4.5V6.5M6 6.5v-6m0 6h5.5M6 .5h1c2.762 0 4.5 1.737 4.5 4.5v1.5",style:{stroke:"#fff",strokeOpacity:1}})}),d.jsx("path",{fill:"#fff",d:"M11.5 6.5H6v-6h1c2.762 0 4.5 1.737 4.5 4.5v1.5Z",style:{fill:"#fff",fillOpacity:1}}),d.jsx("defs",{children:d.jsx("clipPath",{id:"a",children:d.jsx("path",{fill:"#fff",d:"M0 0h12v16H0z",style:{fill:"#fff",fillOpacity:1}})})})]})),{})},es=e=>{let t;const n=new Set,i=(e,i)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=i?i:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach((n=>n(t,e)))}},r=()=>t,a={setState:i,getState:r,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=t=e(i,r,a);return a};var ts,ns,is,rs,as={exports:{}},os={},ss={exports:{}},ls={};function cs(){return ns||(ns=1,ss.exports=function(){if(ts)return ls;ts=1;var e=u(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,i=e.useEffect,r=e.useLayoutEffect,a=e.useDebugValue;function o(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!t(e,i)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),l=n({inst:{value:s,getSnapshot:t}}),c=l[0].inst,u=l[1];return r((function(){c.value=s,c.getSnapshot=t,o(c)&&u({inst:c})}),[e,s,t]),i((function(){return o(c)&&u({inst:c}),e((function(){o(c)&&u({inst:c})}))}),[e]),a(s),s};return ls.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,ls}()),ss.exports}
278
278
  /**
279
279
  * @license React
280
280
  * use-sync-external-store-shim/with-selector.production.js
@@ -293,7 +293,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
293
293
  &:last-child {
294
294
  margin-bottom: 0;
295
295
  }
296
- `,bs=({handedness:e,actions:t})=>{const{keyMap:n,bindKey:i}=xs(),[r,a]=Bn.useState(null);return Bn.useEffect((()=>{const t=t=>{r&&Jo[t.code]&&(i(e,r.action,t.code),a(null))},n=t=>{if(r){const n=0===t.button?"MouseLeft":2===t.button?"MouseRight":null;n&&Jo[n]&&(i(e,r.action,n),a(null))}},o=e=>{e.preventDefault()};return window.addEventListener("keydown",t),window.addEventListener("mousedown",n),window.addEventListener("contextmenu",o),()=>{window.removeEventListener("keydown",t),window.removeEventListener("mousedown",n),window.removeEventListener("contextmenu",o)}}),[r]),Object.keys(n[e]).filter((e=>t.includes(e))).map((t=>d.jsxs(_s,{children:[d.jsx(qo,{buttonName:"up"===t?"thumbstick":t,handedness:e}),d.jsxs(go,{$reverse:!1,children:[d.jsx(uo,{$reverse:!1,style:{width:"100px",background:r&&r.action===t?Ja:Qa},onClick:()=>(e=>{a({action:e})})(t),onContextMenu:e=>e.preventDefault(),children:n[e][t]}),d.jsx(uo,{style:{width:lo},$reverse:!1,onClick:()=>i(e,t),onContextMenu:e=>e.preventDefault(),children:d.jsx(ti,{icon:Lo})})]})]},t)))},Ss=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:i})=>{const[r,a]=Bn.useState(!1),[o,s]=Bn.useState(!1),[l,c]=Bn.useState(!1),[u,h]=Bn.useState(0),f=e.inputSource.handedness;return Bn.useEffect((()=>{const r=n=>{n.code===i&&(e.updateButtonValue(t,1),c(!0))},a=n=>{n.code===i&&(e.updateButtonValue(t,0),c(!1))},o=n=>{("MouseLeft"===i&&0===n.button||"MouseRight"===i&&2===n.button)&&(e.updateButtonValue(t,1),c(!0))},s=n=>{("MouseLeft"===i&&0===n.button||"MouseRight"===i&&2===n.button)&&(e.updateButtonValue(t,0),c(!1))};return n?"MouseLeft"===i||"MouseRight"===i?(window.addEventListener("mousedown",o),window.addEventListener("mouseup",s)):(window.addEventListener("keydown",r),window.addEventListener("keyup",a)):"MouseLeft"===i||"MouseRight"===i?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)),()=>{"MouseLeft"===i||"MouseRight"===i?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a))}}),[i,n,t,e]),d.jsxs(mo,{$reverse:"right"===f,children:[d.jsx(qo,{buttonName:t,handedness:f}),d.jsx(go,{$reverse:"right"===f,children:n?d.jsx(po,{$pressed:l,children:Jo[i]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===f,style:{background:o?Ja:Qa,width:so},onClick:()=>{s(!0),e.updateButtonValue(t,1),setTimeout((()=>{s(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),d.jsx(uo,{title:"Click to toggle touch state",$reverse:"right"===f,style:{background:r?Ja:Qa,width:lo},onClick:()=>{a(!r),e.updateButtonTouch(t,!r)},children:d.jsx(yo,{icon:Ao})}),d.jsx(vo,{$reverse:"right"===f,value:u,onChange:n=>{const i=Number(n.target.value);h(i),e.updateButtonValue(t,i/100)},min:"0",max:"100"})]})})]})},ws=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:i})=>{const[r,a]=Bn.useState(!1),[o,s]=Bn.useState(!1),[l,c]=Bn.useState(!1),[u,h]=Bn.useState(!1),f=e.inputSource.handedness;return Bn.useEffect((()=>{const r=n=>{n.code===i&&(e.updateButtonValue(t,1),h(!0))},a=n=>{n.code===i&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",r),window.addEventListener("keyup",a)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)}}),[i,n,t,e]),d.jsxs(mo,{$reverse:"right"===f,children:[d.jsx(qo,{buttonName:t,handedness:f}),d.jsx(go,{$reverse:"right"===f,children:n?d.jsx(po,{$pressed:u,children:Jo[i]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===f,style:{background:l?Ja:Qa,width:so},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout((()=>{c(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),d.jsx(uo,{title:"Click to toggle touch state",$reverse:"right"===f,style:{background:r?Ja:Qa,width:lo},onClick:()=>{a(!r),e.updateButtonTouch(t,!r)},children:d.jsx(yo,{icon:Ao})}),d.jsx(uo,{$reverse:"right"===f,style:{background:o?Ja:Qa,width:so},onClick:()=>{s(!o),e.updateButtonValue(t,o?0:1)},children:"Hold"})]})})]})},Ms=Va.div`
296
+ `,bs=({handedness:e,actions:t})=>{const{keyMap:n,bindKey:i}=xs(),[r,a]=Bn.useState(null);return Bn.useEffect((()=>{const t=t=>{r&&Jo[t.code]&&(i(e,r.action,t.code),a(null))},n=t=>{if(r){const n=0===t.button?"MouseLeft":2===t.button?"MouseRight":null;n&&Jo[n]&&(i(e,r.action,n),a(null))}},o=e=>{e.preventDefault()};return window.addEventListener("keydown",t),window.addEventListener("mousedown",n),window.addEventListener("contextmenu",o),()=>{window.removeEventListener("keydown",t),window.removeEventListener("mousedown",n),window.removeEventListener("contextmenu",o)}}),[r]),Object.keys(n[e]).filter((e=>t.includes(e))).map((t=>d.jsxs(_s,{children:[d.jsx($o,{buttonName:"up"===t?"thumbstick":t,handedness:e}),d.jsxs(go,{$reverse:!1,children:[d.jsx(uo,{$reverse:!1,style:{width:"100px",background:r&&r.action===t?Ja:Qa},onClick:()=>(e=>{a({action:e})})(t),onContextMenu:e=>e.preventDefault(),children:n[e][t]}),d.jsx(uo,{style:{width:lo},$reverse:!1,onClick:()=>i(e,t),onContextMenu:e=>e.preventDefault(),children:d.jsx(ti,{icon:Lo})})]})]},t)))},Ss=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:i})=>{const[r,a]=Bn.useState(!1),[o,s]=Bn.useState(!1),[l,c]=Bn.useState(!1),[u,h]=Bn.useState(0),f=e.inputSource.handedness;return Bn.useEffect((()=>{const r=n=>{n.code===i&&(e.updateButtonValue(t,1),c(!0))},a=n=>{n.code===i&&(e.updateButtonValue(t,0),c(!1))},o=n=>{("MouseLeft"===i&&0===n.button||"MouseRight"===i&&2===n.button)&&(e.updateButtonValue(t,1),c(!0))},s=n=>{("MouseLeft"===i&&0===n.button||"MouseRight"===i&&2===n.button)&&(e.updateButtonValue(t,0),c(!1))};return n?"MouseLeft"===i||"MouseRight"===i?(window.addEventListener("mousedown",o),window.addEventListener("mouseup",s)):(window.addEventListener("keydown",r),window.addEventListener("keyup",a)):"MouseLeft"===i||"MouseRight"===i?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)),()=>{"MouseLeft"===i||"MouseRight"===i?(window.removeEventListener("mousedown",o),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a))}}),[i,n,t,e]),d.jsxs(mo,{$reverse:"right"===f,children:[d.jsx($o,{buttonName:t,handedness:f}),d.jsx(go,{$reverse:"right"===f,children:n?d.jsx(po,{$pressed:l,children:Jo[i]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===f,style:{background:o?Ja:Qa,width:so},onClick:()=>{s(!0),e.updateButtonValue(t,1),setTimeout((()=>{s(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),d.jsx(uo,{title:"Click to toggle touch state",$reverse:"right"===f,style:{background:r?Ja:Qa,width:lo},onClick:()=>{a(!r),e.updateButtonTouch(t,!r)},children:d.jsx(yo,{icon:Ao})}),d.jsx(vo,{$reverse:"right"===f,value:u,onChange:n=>{const i=Number(n.target.value);h(i),e.updateButtonValue(t,i/100)},min:"0",max:"100"})]})})]})},ws=({xrController:e,buttonId:t,pointerLocked:n,mappedKey:i})=>{const[r,a]=Bn.useState(!1),[o,s]=Bn.useState(!1),[l,c]=Bn.useState(!1),[u,h]=Bn.useState(!1),f=e.inputSource.handedness;return Bn.useEffect((()=>{const r=n=>{n.code===i&&(e.updateButtonValue(t,1),h(!0))},a=n=>{n.code===i&&(e.updateButtonValue(t,0),h(!1))};return n?(window.addEventListener("keydown",r),window.addEventListener("keyup",a)):(window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)}}),[i,n,t,e]),d.jsxs(mo,{$reverse:"right"===f,children:[d.jsx($o,{buttonName:t,handedness:f}),d.jsx(go,{$reverse:"right"===f,children:n?d.jsx(po,{$pressed:u,children:Jo[i]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===f,style:{background:l?Ja:Qa,width:so},onClick:()=>{c(!0),e.updateButtonValue(t,1),setTimeout((()=>{c(!1),e.updateButtonValue(t,0)}),250)},children:"Press"}),d.jsx(uo,{title:"Click to toggle touch state",$reverse:"right"===f,style:{background:r?Ja:Qa,width:lo},onClick:()=>{a(!r),e.updateButtonTouch(t,!r)},children:d.jsx(yo,{icon:Ao})}),d.jsx(uo,{$reverse:"right"===f,style:{background:o?Ja:Qa,width:so},onClick:()=>{s(!o),e.updateButtonValue(t,o?0:1)},children:"Hold"})]})})]})},Ms=Va.div`
297
297
  display: flex;
298
298
  align-items: center;
299
299
  margin-bottom: ${co};
@@ -324,7 +324,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
324
324
  font-size: ${no};
325
325
 
326
326
  ${({$reverse:e})=>e?`\n &:first-child {\n border-radius: ${oo};\n }\n\n &:last-child {\n border-radius: ${ao};\n }\n `:`\n &:first-child {\n border-radius: ${ao};\n }\n\n &:last-child {\n border-radius: ${oo};\n }\n `}
327
- `,Rs=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:i,mappedKeyDown:r,mappedKeyLeft:a,mappedKeyRight:o,mappedKeyPressed:s})=>{const l=Bn.useRef(null),[c,u]=Bn.useState(!1),[h,f]=Bn.useState(!1),[p,m]=Bn.useState(!1),[g,v]=Bn.useState(!1),[y,x]=Bn.useState({x:0,y:0}),[_,b]=Bn.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),S=e.inputSource.handedness,w=t=>{if(c&&l.current){const i=t.clientX-y.x,r=t.clientY-y.y,a=12;let o,s;if(Math.sqrt(i*i+r*r)<a)o=i,s=r;else{const e=Math.atan2(r,i);o=Math.cos(e)*a,s=Math.sin(e)*a}l.current.style.transform=`translate(${o}px, ${s}px)`;const c=o/a,u=s/a;e.updateAxes(n,c,u)}},M=()=>{u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return Bn.useEffect((()=>{const l=t=>{const l={..._};t.code===i&&(l.up=!0),t.code===r&&(l.down=!0),t.code===a&&(l.left=!0),t.code===o&&(l.right=!0),t.code===s&&(l.pressed=!0,e.updateButtonValue(n,1)),b(l),u(l)},c=t=>{const l={..._};t.code===i&&(l.up=!1),t.code===r&&(l.down=!1),t.code===a&&(l.left=!1),t.code===o&&(l.right=!1),t.code===s&&(l.pressed=!1,e.updateButtonValue(n,0)),b(l),u(l)},u=t=>{const i=(t.right?1:0)-(t.left?1:0),r=(t.down?1:0)-(t.up?1:0),a=Math.sqrt(i*i+r*r);if(0===a)return void e.updateAxes(n,0,0);const o=i/a,s=r/a;e.updateAxes(n,o,s)};return t?(window.addEventListener("keydown",l),window.addEventListener("keyup",c)):(window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)),()=>{window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)}}),[i,r,a,o,t,_]),Bn.useEffect((()=>(document.addEventListener("mousemove",w),document.addEventListener("mouseup",M),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",M)})),[c,y]),t?d.jsxs(d.Fragment,{children:[d.jsxs(mo,{$reverse:"right"===S,children:[d.jsx(qo,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),d.jsxs(go,{$reverse:"right"===S,children:[d.jsx(po,{$pressed:_.up,children:Jo[i]}),d.jsx(po,{$pressed:_.pressed,children:Jo[s]})]})]}),d.jsx(mo,{$reverse:"right"===S,style:"right"===S?{marginRight:"2px"}:{marginLeft:"2px"},children:d.jsxs(go,{$reverse:!1,style:{margin:0},children:[d.jsx(po,{$pressed:_.left,children:Jo[a]}),d.jsx(po,{$pressed:_.down,children:Jo[r]}),d.jsx(po,{$pressed:_.right,children:Jo[o]})]})})]}):d.jsx(Ms,{style:{flexDirection:"left"===e.inputSource.handedness?"row":"row-reverse",alignItems:"flex-start"},children:d.jsxs(d.Fragment,{children:[d.jsx(qo,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),d.jsx(Ts,{style:{margin:"0 5px"},children:d.jsx(As,{ref:l,onMouseDown:()=>{if(l.current){const e=l.current.getBoundingClientRect();x({x:e.left+e.width/2,y:e.top+e.height/2}),u(!0)}},children:d.jsx(yo,{icon:Go,$size:50})})}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"right"===S?"start":"end"},children:[d.jsx(uo,{$reverse:"right"===S,style:{background:g?Ja:Qa,width:`calc(${so} + ${lo} + ${co})`,marginBottom:co,borderRadius:ro},onClick:()=>{v(!0),e.updateButtonValue(n,1),setTimeout((()=>{v(!1),e.updateButtonValue(n,0)}),250)},children:"Press"}),d.jsxs(go,{$reverse:"right"===S,children:[d.jsx(Cs,{title:"Click to toggle touch state",$reverse:"left"!==e.inputSource.handedness,style:{background:h?Ja:Qa,width:lo},onClick:()=>{f(!h),e.updateButtonTouch(n,!h)},children:d.jsx(yo,{icon:Ao})}),d.jsx(Cs,{$reverse:"left"!==e.inputSource.handedness,style:{background:p?Ja:Qa,width:so},onClick:()=>{m(!p),e.updateButtonValue(n,p?0:1)},children:"Hold"})]})]})]})})};function Ps(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Ls=Va.div`
327
+ `,Ps=({xrController:e,pointerLocked:t,buttonId:n,mappedKeyUp:i,mappedKeyDown:r,mappedKeyLeft:a,mappedKeyRight:o,mappedKeyPressed:s})=>{const l=Bn.useRef(null),[c,u]=Bn.useState(!1),[h,f]=Bn.useState(!1),[p,m]=Bn.useState(!1),[g,v]=Bn.useState(!1),[y,x]=Bn.useState({x:0,y:0}),[_,b]=Bn.useState({up:!1,down:!1,left:!1,right:!1,pressed:!1}),S=e.inputSource.handedness,w=t=>{if(c&&l.current){const i=t.clientX-y.x,r=t.clientY-y.y,a=12;let o,s;if(Math.sqrt(i*i+r*r)<a)o=i,s=r;else{const e=Math.atan2(r,i);o=Math.cos(e)*a,s=Math.sin(e)*a}l.current.style.transform=`translate(${o}px, ${s}px)`;const c=o/a,u=s/a;e.updateAxes(n,c,u)}},M=()=>{u(!1),l.current&&(l.current.style.transform="translate(0, 0)",e.updateAxes(n,0,0))};return Bn.useEffect((()=>{const l=t=>{const l={..._};t.code===i&&(l.up=!0),t.code===r&&(l.down=!0),t.code===a&&(l.left=!0),t.code===o&&(l.right=!0),t.code===s&&(l.pressed=!0,e.updateButtonValue(n,1)),b(l),u(l)},c=t=>{const l={..._};t.code===i&&(l.up=!1),t.code===r&&(l.down=!1),t.code===a&&(l.left=!1),t.code===o&&(l.right=!1),t.code===s&&(l.pressed=!1,e.updateButtonValue(n,0)),b(l),u(l)},u=t=>{const i=(t.right?1:0)-(t.left?1:0),r=(t.down?1:0)-(t.up?1:0),a=Math.sqrt(i*i+r*r);if(0===a)return void e.updateAxes(n,0,0);const o=i/a,s=r/a;e.updateAxes(n,o,s)};return t?(window.addEventListener("keydown",l),window.addEventListener("keyup",c)):(window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)),()=>{window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)}}),[i,r,a,o,t,_]),Bn.useEffect((()=>(document.addEventListener("mousemove",w),document.addEventListener("mouseup",M),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",M)})),[c,y]),t?d.jsxs(d.Fragment,{children:[d.jsxs(mo,{$reverse:"right"===S,children:[d.jsx($o,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),d.jsxs(go,{$reverse:"right"===S,children:[d.jsx(po,{$pressed:_.up,children:Jo[i]}),d.jsx(po,{$pressed:_.pressed,children:Jo[s]})]})]}),d.jsx(mo,{$reverse:"right"===S,style:"right"===S?{marginRight:"2px"}:{marginLeft:"2px"},children:d.jsxs(go,{$reverse:!1,style:{margin:0},children:[d.jsx(po,{$pressed:_.left,children:Jo[a]}),d.jsx(po,{$pressed:_.down,children:Jo[r]}),d.jsx(po,{$pressed:_.right,children:Jo[o]})]})})]}):d.jsx(Ms,{style:{flexDirection:"left"===e.inputSource.handedness?"row":"row-reverse",alignItems:"flex-start"},children:d.jsxs(d.Fragment,{children:[d.jsx($o,{buttonName:"thumbstick",handedness:e.inputSource.handedness}),d.jsx(Ts,{style:{margin:"0 5px"},children:d.jsx(As,{ref:l,onMouseDown:()=>{if(l.current){const e=l.current.getBoundingClientRect();x({x:e.left+e.width/2,y:e.top+e.height/2}),u(!0)}},children:d.jsx(yo,{icon:Go,$size:50})})}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"right"===S?"start":"end"},children:[d.jsx(uo,{$reverse:"right"===S,style:{background:g?Ja:Qa,width:`calc(${so} + ${lo} + ${co})`,marginBottom:co,borderRadius:ro},onClick:()=>{v(!0),e.updateButtonValue(n,1),setTimeout((()=>{v(!1),e.updateButtonValue(n,0)}),250)},children:"Press"}),d.jsxs(go,{$reverse:"right"===S,children:[d.jsx(Cs,{title:"Click to toggle touch state",$reverse:"left"!==e.inputSource.handedness,style:{background:h?Ja:Qa,width:lo},onClick:()=>{f(!h),e.updateButtonTouch(n,!h)},children:d.jsx(yo,{icon:Ao})}),d.jsx(Cs,{$reverse:"left"!==e.inputSource.handedness,style:{background:p?Ja:Qa,width:so},onClick:()=>{m(!p),e.updateButtonValue(n,p?0:1)},children:"Hold"})]})]})]})})};function Rs(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Ls=Va.div`
328
328
  width: 100%;
329
329
  display: flex;
330
330
  flex-direction: row;
@@ -332,7 +332,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
332
332
  align-items: center;
333
333
  margin: 0;
334
334
  font-size: 12px;
335
- `,ks=({vector:e,label:t="",icon:n,multiplier:i=1,precision:r=2,onValidInput:a=()=>{},marginBottom:o="0"})=>{const[s,l]=Bn.useState({x:(e.x/i).toFixed(r),y:(e.y/i).toFixed(r),z:(e.z/i).toFixed(r)}),c=Bn.useRef({x:Ps(e.x/i,r),y:Ps(e.y/i,r),z:Ps(e.z/i,r)}),u=Bn.useRef(null),h=()=>{const t={x:Ps(e.x/i,r),y:Ps(e.y/i,r),z:Ps(e.z/i,r)},{x:n,y:a,z:o}=c.current;t.x===n&&t.y===a&&t.z===o||(c.current=t,l({x:t.x.toFixed(r),y:t.y.toFixed(r),z:t.z.toFixed(r)})),u.current=requestAnimationFrame(h)};Bn.useEffect((()=>(u.current=requestAnimationFrame(h),()=>{u.current&&cancelAnimationFrame(u.current)})),[e,i,r]);const f=t=>n=>{const r=n.target.value,o=parseFloat(r);l((e=>({...e,[t]:r}))),isNaN(o)||(c.current[t]=o,e[t]=o*i,a())};return d.jsxs(Ls,{style:{marginBottom:o},children:[n?d.jsx(yo,{icon:n,style:{marginRight:"5px"}}):d.jsx("span",{style:{marginRight:"5px"},children:t}),d.jsx(wo,{children:["x","y","z"].map((e=>d.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[d.jsx(Mo,{value:s[e],onChange:f(e),className:parseFloat(s[e])!==c.current[e]?"invalid":void 0}),d.jsx(Eo,{children:e.toUpperCase()})]},`${t}-${e}`)))})]})};const Ns=({controller:e,handle:t,handedness:n,pointerLocked:i})=>{const{keyMap:r}=xs(),[a,o]=Hn.useState(e.connected),[s,l]=Hn.useState(!1),c=function(e){const t=new Set;for(const n of e.axes)n&&n.id&&t.add(n.id);const n=e.buttons.filter((e=>null!==e)).map((e=>({id:e.id,type:e.type,hasAxes:t.has(e.id)})));return n.sort(((e,t)=>e.hasAxes&&!t.hasAxes?-1:!e.hasAxes&&t.hasAxes?1:0)),n}(e.gamepadConfig),u=c.flatMap((e=>e.hasAxes?[`${e.id}-left`,`${e.id}-right`,`${e.id}-up`,`${e.id}-down`,e.id]:e.id));return Hn.useEffect((()=>{i&&l(!1)}),[i]),d.jsxs(_o,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!i&&d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[d.jsx(yo,{icon:Co,style:{marginRight:"5px"}}),"Controller ",d.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:a?d.jsxs(d.Fragment,{children:[d.jsx(So,{title:`Click to ${s?"close":"change"} key bindings`,onClick:()=>{l(!s)},children:d.jsx(yo,{icon:Uo})}),d.jsx(So,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,o(!1)},children:d.jsx(yo,{icon:Go})})]}):d.jsx(So,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,o(!0)},style:{marginLeft:"5px"},children:d.jsx(yo,{icon:Po})})})]})}),a&&!i&&d.jsxs(d.Fragment,{children:[!s&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{}),d.jsx(ks,{vector:t.position,label:"Position",marginBottom:co}),d.jsx(ks,{vector:t.rotation,label:"Rotation"})]}),d.jsx(bo,{})]}),a&&(s?d.jsx(bs,{handedness:n,actions:u}):c.map((t=>{const a=r[n];return t.hasAxes?d.jsx(Rs,{xrController:e,pointerLocked:i,buttonId:t.id,mappedKeyUp:r[n][`${t.id}-up`],mappedKeyDown:a[`${t.id}-down`],mappedKeyLeft:a[`${t.id}-left`],mappedKeyRight:a[`${t.id}-right`],mappedKeyPressed:a[t.id]},t.id):"analog"===t.type?d.jsx(Ss,{xrController:e,buttonId:t.id,mappedKey:a[t.id],pointerLocked:i},t.id):d.jsx(ws,{xrController:e,buttonId:t.id,mappedKey:a[t.id],pointerLocked:i},t.id)})))]},n)},Ds=`calc(${so} + ${lo} + ${co})`,Is=({hand:e,pointerLocked:t,mappedKey:n})=>{const[i,r]=Bn.useState(!1),[a,o]=Bn.useState(!1),[s,l]=Bn.useState(0),c=e.inputSource.handedness;return Bn.useEffect((()=>{const i=t=>{t.code===n&&(e.updatePinchValue(1),o(!0))},r=t=>{t.code===n&&(e.updatePinchValue(0),o(!1))},a=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(1),o(!0))},s=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(0),o(!1))};return t?"MouseLeft"===n||"MouseRight"===n?(window.addEventListener("mousedown",a),window.addEventListener("mouseup",s)):(window.addEventListener("keydown",i),window.addEventListener("keyup",r)):"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",a),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r)),()=>{"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",a),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r))}}),[n,t,e]),d.jsxs(mo,{$reverse:"right"===c,children:[d.jsx(xo,{icon:Ho,$reverse:"left"===c}),d.jsx(go,{$reverse:"right"===c,children:t?d.jsx(po,{$pressed:a,children:Jo[n]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===c,style:{background:i?Ja:Qa,width:so},onClick:()=>{r(!0),e.updatePinchValue(1),setTimeout((()=>{r(!1),e.updatePinchValue(0)}),250)},children:"Pinch"}),d.jsx(vo,{$reverse:"right"===c,value:s,onChange:t=>{const n=Number(t.target.value);l(n),e.updatePinchValue(n/100)},style:{width:Ds},min:"0",max:"100"})]})})]})},Os=["default","point"],Us=`calc(2 * ${so} - ${lo})`,zs=({hand:e,pointerLocked:t,mappedKey:n})=>{const[i,r]=Bn.useState(e.poseId),[a,o]=Bn.useState(!1),s=e.inputSource.handedness,l=t=>{const n=(Os.indexOf(e.poseId)+Os.length+t)%Os.length;r(Os[n]),e.poseId=Os[n]},c="right"===s;return Bn.useEffect((()=>{const e=e=>{e.code===n&&(l(1),o(!0))},i=e=>{e.code===n&&o(!1)};return t?(window.addEventListener("keydown",e),window.addEventListener("keyup",i)):(window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)}}),[n,t,e]),d.jsxs(mo,{$reverse:c,children:[d.jsx(xo,{icon:Io,$reverse:"left"===s}),d.jsx(go,{$reverse:c,children:t?d.jsx(po,{$pressed:a,children:Jo[n]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:c,style:{width:lo},onClick:()=>{l(c?1:-1)},children:d.jsx(yo,{icon:c?Vo:Bo})}),d.jsxs(uo,{$reverse:c,style:{width:Us},disabled:!0,children:["Pose: ",i]}),d.jsx(uo,{$reverse:c,style:{width:lo},onClick:()=>{l(c?-1:1)},children:d.jsx(yo,{icon:c?Bo:Vo})})]})})]})},Fs=({hand:e,handle:t,handedness:n,pointerLocked:i})=>{const{keyMap:r}=xs(),[a,o]=Hn.useState(e.connected),[s,l]=Hn.useState(!1);return Hn.useEffect((()=>{i&&l(!1)}),[i]),d.jsxs(_o,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!i&&d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[d.jsx(yo,{icon:Ro,$reverse:"left"===n,style:{marginRight:"5px"}}),"Hand ",d.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:a?d.jsxs(d.Fragment,{children:[d.jsx(So,{title:`Click to ${s?"close":"change"} key bindings`,onClick:()=>{l(!s)},children:d.jsx(yo,{icon:Uo})}),d.jsx(So,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,o(!1)},children:d.jsx(yo,{icon:Go})})]}):d.jsx(So,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,o(!0)},style:{marginLeft:"5px"},children:d.jsx(yo,{icon:Po})})})]})}),a&&!i&&d.jsxs(d.Fragment,{children:[!s&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{}),d.jsx(ks,{vector:t.position,label:"Position",marginBottom:co}),d.jsx(ks,{vector:t.rotation,label:"Rotation"})]}),d.jsx(bo,{})]}),a&&(s?d.jsx(bs,{handedness:n,actions:["pose","pinch"]}):d.jsxs(d.Fragment,{children:[d.jsx(zs,{hand:e,pointerLocked:i,mappedKey:r[n].pose}),d.jsx(Is,{hand:e,pointerLocked:i,mappedKey:r[n].pinch})]}))]},n)},Bs=vs((e=>({inputMode:"controller",setInputMode:t=>e((()=>({inputMode:t})))}))),Hs=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const{inputMode:i}=Bs();return d.jsx(d.Fragment,{children:"controller"===i?Object.entries(e.controllers).map((([e,i])=>d.jsx(Ns,{controller:i,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`controller-${e}`))):Object.entries(e.hands).map((([e,i])=>d.jsx(Fs,{hand:i,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`hand-${e}`)))})},Vs=Va.td`
335
+ `,ks=({vector:e,label:t="",icon:n,multiplier:i=1,precision:r=2,onValidInput:a=()=>{},marginBottom:o="0"})=>{const[s,l]=Bn.useState({x:(e.x/i).toFixed(r),y:(e.y/i).toFixed(r),z:(e.z/i).toFixed(r)}),c=Bn.useRef({x:Rs(e.x/i,r),y:Rs(e.y/i,r),z:Rs(e.z/i,r)}),u=Bn.useRef(null),h=()=>{const t={x:Rs(e.x/i,r),y:Rs(e.y/i,r),z:Rs(e.z/i,r)},{x:n,y:a,z:o}=c.current;t.x===n&&t.y===a&&t.z===o||(c.current=t,l({x:t.x.toFixed(r),y:t.y.toFixed(r),z:t.z.toFixed(r)})),u.current=requestAnimationFrame(h)};Bn.useEffect((()=>(u.current=requestAnimationFrame(h),()=>{u.current&&cancelAnimationFrame(u.current)})),[e,i,r]);const f=t=>n=>{const r=n.target.value,o=parseFloat(r);l((e=>({...e,[t]:r}))),isNaN(o)||(c.current[t]=o,e[t]=o*i,a())};return d.jsxs(Ls,{style:{marginBottom:o},children:[n?d.jsx(yo,{icon:n,style:{marginRight:"5px"}}):d.jsx("span",{style:{marginRight:"5px"},children:t}),d.jsx(wo,{children:["x","y","z"].map((e=>d.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[d.jsx(Mo,{value:s[e],onChange:f(e),className:parseFloat(s[e])!==c.current[e]?"invalid":void 0}),d.jsx(Eo,{children:e.toUpperCase()})]},`${t}-${e}`)))})]})};const Ns=({controller:e,handle:t,handedness:n,pointerLocked:i})=>{const{keyMap:r}=xs(),[a,o]=Hn.useState(e.connected),[s,l]=Hn.useState(!1),c=function(e){const t=new Set;for(const n of e.axes)n&&n.id&&t.add(n.id);const n=e.buttons.filter((e=>null!==e)).map((e=>({id:e.id,type:e.type,hasAxes:t.has(e.id)})));return n.sort(((e,t)=>e.hasAxes&&!t.hasAxes?-1:!e.hasAxes&&t.hasAxes?1:0)),n}(e.gamepadConfig),u=c.flatMap((e=>e.hasAxes?[`${e.id}-left`,`${e.id}-right`,`${e.id}-up`,`${e.id}-down`,e.id]:e.id));return Hn.useEffect((()=>{i&&l(!1)}),[i]),d.jsxs(_o,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!i&&d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[d.jsx(yo,{icon:Co,style:{marginRight:"5px"}}),"Controller ",d.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:a?d.jsxs(d.Fragment,{children:[d.jsx(So,{title:`Click to ${s?"close":"change"} key bindings`,onClick:()=>{l(!s)},children:d.jsx(yo,{icon:Uo})}),d.jsx(So,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,o(!1)},children:d.jsx(yo,{icon:Go})})]}):d.jsx(So,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,o(!0)},style:{marginLeft:"5px"},children:d.jsx(yo,{icon:Ro})})})]})}),a&&!i&&d.jsxs(d.Fragment,{children:[!s&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{}),d.jsx(ks,{vector:t.position,label:"Position",marginBottom:co}),d.jsx(ks,{vector:t.rotation,label:"Rotation"})]}),d.jsx(bo,{})]}),a&&(s?d.jsx(bs,{handedness:n,actions:u}):c.map((t=>{const a=r[n];return t.hasAxes?d.jsx(Ps,{xrController:e,pointerLocked:i,buttonId:t.id,mappedKeyUp:r[n][`${t.id}-up`],mappedKeyDown:a[`${t.id}-down`],mappedKeyLeft:a[`${t.id}-left`],mappedKeyRight:a[`${t.id}-right`],mappedKeyPressed:a[t.id]},t.id):"analog"===t.type?d.jsx(Ss,{xrController:e,buttonId:t.id,mappedKey:a[t.id],pointerLocked:i},t.id):d.jsx(ws,{xrController:e,buttonId:t.id,mappedKey:a[t.id],pointerLocked:i},t.id)})))]},n)},Ds=`calc(${so} + ${lo} + ${co})`,Is=({hand:e,pointerLocked:t,mappedKey:n})=>{const[i,r]=Bn.useState(!1),[a,o]=Bn.useState(!1),[s,l]=Bn.useState(0),c=e.inputSource.handedness;return Bn.useEffect((()=>{const i=t=>{t.code===n&&(e.updatePinchValue(1),o(!0))},r=t=>{t.code===n&&(e.updatePinchValue(0),o(!1))},a=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(1),o(!0))},s=t=>{("MouseLeft"===n&&0===t.button||"MouseRight"===n&&2===t.button)&&(e.updatePinchValue(0),o(!1))};return t?"MouseLeft"===n||"MouseRight"===n?(window.addEventListener("mousedown",a),window.addEventListener("mouseup",s)):(window.addEventListener("keydown",i),window.addEventListener("keyup",r)):"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",a),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r)),()=>{"MouseLeft"===n||"MouseRight"===n?(window.removeEventListener("mousedown",a),window.removeEventListener("mouseup",s)):(window.removeEventListener("keydown",i),window.removeEventListener("keyup",r))}}),[n,t,e]),d.jsxs(mo,{$reverse:"right"===c,children:[d.jsx(xo,{icon:Ho,$reverse:"left"===c}),d.jsx(go,{$reverse:"right"===c,children:t?d.jsx(po,{$pressed:a,children:Jo[n]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:"right"===c,style:{background:i?Ja:Qa,width:so},onClick:()=>{r(!0),e.updatePinchValue(1),setTimeout((()=>{r(!1),e.updatePinchValue(0)}),250)},children:"Pinch"}),d.jsx(vo,{$reverse:"right"===c,value:s,onChange:t=>{const n=Number(t.target.value);l(n),e.updatePinchValue(n/100)},style:{width:Ds},min:"0",max:"100"})]})})]})},Os=["default","point"],Us=`calc(2 * ${so} - ${lo})`,zs=({hand:e,pointerLocked:t,mappedKey:n})=>{const[i,r]=Bn.useState(e.poseId),[a,o]=Bn.useState(!1),s=e.inputSource.handedness,l=t=>{const n=(Os.indexOf(e.poseId)+Os.length+t)%Os.length;r(Os[n]),e.poseId=Os[n]},c="right"===s;return Bn.useEffect((()=>{const e=e=>{e.code===n&&(l(1),o(!0))},i=e=>{e.code===n&&o(!1)};return t?(window.addEventListener("keydown",e),window.addEventListener("keyup",i)):(window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)}}),[n,t,e]),d.jsxs(mo,{$reverse:c,children:[d.jsx(xo,{icon:Io,$reverse:"left"===s}),d.jsx(go,{$reverse:c,children:t?d.jsx(po,{$pressed:a,children:Jo[n]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{$reverse:c,style:{width:lo},onClick:()=>{l(c?1:-1)},children:d.jsx(yo,{icon:c?Vo:Bo})}),d.jsxs(uo,{$reverse:c,style:{width:Us},disabled:!0,children:["Pose: ",i]}),d.jsx(uo,{$reverse:c,style:{width:lo},onClick:()=>{l(c?-1:1)},children:d.jsx(yo,{icon:c?Bo:Vo})})]})})]})},Fs=({hand:e,handle:t,handedness:n,pointerLocked:i})=>{const{keyMap:r}=xs(),[a,o]=Hn.useState(e.connected),[s,l]=Hn.useState(!1);return Hn.useEffect((()=>{i&&l(!1)}),[i]),d.jsxs(_o,{style:"left"===n?{left:"8px",bottom:"8px"}:{right:"8px",bottom:"8px"},children:[!i&&d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center"},children:[d.jsx(yo,{icon:Po,$reverse:"left"===n,style:{marginRight:"5px"}}),"Hand ",d.jsxs("span",{style:{fontWeight:"bold"},children:["[","left"===n?"L":"R","]"]})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:a?d.jsxs(d.Fragment,{children:[d.jsx(So,{title:`Click to ${s?"close":"change"} key bindings`,onClick:()=>{l(!s)},children:d.jsx(yo,{icon:Uo})}),d.jsx(So,{title:`Click to disconnect ${n} controller`,$isRed:!0,onClick:()=>{e.connected=!1,o(!1)},children:d.jsx(yo,{icon:Go})})]}):d.jsx(So,{title:`Click to reconnect ${n} controller`,onClick:()=>{e.connected=!0,o(!0)},style:{marginLeft:"5px"},children:d.jsx(yo,{icon:Ro})})})]})}),a&&!i&&d.jsxs(d.Fragment,{children:[!s&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{}),d.jsx(ks,{vector:t.position,label:"Position",marginBottom:co}),d.jsx(ks,{vector:t.rotation,label:"Rotation"})]}),d.jsx(bo,{})]}),a&&(s?d.jsx(bs,{handedness:n,actions:["pose","pinch"]}):d.jsxs(d.Fragment,{children:[d.jsx(zs,{hand:e,pointerLocked:i,mappedKey:r[n].pose}),d.jsx(Is,{hand:e,pointerLocked:i,mappedKey:r[n].pinch})]}))]},n)},Bs=vs((e=>({inputMode:"controller",setInputMode:t=>e((()=>({inputMode:t})))}))),Hs=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const{inputMode:i}=Bs();return d.jsx(d.Fragment,{children:"controller"===i?Object.entries(e.controllers).map((([e,i])=>d.jsx(Ns,{controller:i,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`controller-${e}`))):Object.entries(e.hands).map((([e,i])=>d.jsx(Fs,{hand:i,handle:t.transformHandles.get(e),handedness:e,pointerLocked:n},`hand-${e}`)))})},Vs=Va.td`
336
336
  text-align: right;
337
337
  color: ${ja};
338
338
  padding: 0 8px 0 0;
@@ -341,7 +341,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
341
341
  text-align: left;
342
342
  color: ${Ga};
343
343
  padding: 0;
344
- `,Gs=["meeting_room","living_room","music_room","office_large","office_small"],Ws=vs((e=>({infoPanelOpen:!1,envDropDownOpen:!1,setInfoPanelOpen:t=>e((()=>({infoPanelOpen:t}))),setEnvDropDownOpen:t=>e((()=>({envDropDownOpen:t})))})));const Xs=({xrDevice:e,inputLayer:t})=>{var n,i,r;const[a,o]=Hn.useState(Boolean(null===(n=e.sem)||void 0===n?void 0:n.planesVisible)),[s,l]=Hn.useState(Boolean(null===(i=e.sem)||void 0===i?void 0:i.boundingBoxesVisible)),[c,u]=Hn.useState(Boolean(null===(r=e.sem)||void 0===r?void 0:r.meshesVisible)),{inputMode:h,setInputMode:f}=Bs(),{infoPanelOpen:p,setInfoPanelOpen:m,envDropDownOpen:g,setEnvDropDownOpen:v}=Ws();return d.jsxs("div",{style:{display:"flex",justifyContent:"center",flexDirection:"row",alignItems:"center",gap:"6px",padding:"8px"},children:[d.jsx(ho,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[d.jsx(fo,{title:"Click to reset device transforms",onClick:()=>{t.resetDeviceTransforms()},children:d.jsx(yo,{icon:ko,$size:16})}),d.jsx(fo,{title:"Click to activate play mode",onClick:()=>{t.lockPointer(),v(!1),m(!1)},children:d.jsx(yo,{icon:No,$size:16})}),d.jsx(fo,{title:"Click to toggle input mode",onClick:()=>{"controller"===h?(f("hand"),e.primaryInputMode="hand"):(f("controller"),e.primaryInputMode="controller")},children:d.jsx(yo,{icon:"controller"===h?Co:Ro,$size:16})}),e.sem&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{$horizontal:!1}),d.jsx(fo,{title:"Click to select/change emulated environment",onClick:()=>v(!g),children:d.jsx(yo,{icon:Do,$size:16})}),d.jsx(fo,{title:"Click to toggle visibility of planes",onClick:()=>{e.sem.planesVisible=!a,o(!a)},children:d.jsx(Ko,{size:16,color:a?ja:Ga})}),d.jsx(fo,{title:"Click to toggle visibility of bounding boxes",onClick:()=>{e.sem.boundingBoxesVisible=!s,l(!s)},children:d.jsx(Yo,{size:16,color:s?ja:Ga})}),d.jsx(fo,{title:"Click to toggle visibility of meshes",onClick:()=>{e.sem.meshesVisible=!c,u(!c)},children:d.jsx(Zo,{size:16,color:c?ja:Ga})})]}),d.jsx(bo,{$horizontal:!1}),d.jsx(fo,{title:"Click to exit XR session",onClick:()=>{const t=e.activeSession;null==t||t.end()},children:d.jsx(yo,{icon:To,$size:16})})]})}),d.jsx(ho,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[d.jsx(fo,{title:"About IWER",onClick:()=>{m(!p)},children:d.jsx(Qo,{size:16})}),d.jsx(fo,{title:"Report issues",onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/issues","_blank")},children:d.jsx(yo,{icon:zo,$size:16})})]})}),p&&d.jsxs(_o,{style:{top:"50vh",left:"50vw",transform:"translate(-50%, -50%)",maxWidth:"240px",gap:"4px"},children:[d.jsx("div",{style:{display:"flex",justifyContent:"end"},children:d.jsx(So,{$isRed:!0,onClick:()=>{m(!1)},children:d.jsx(yo,{icon:Go})})}),d.jsx("div",{style:{display:"flex",justifyContent:"center"},children:d.jsx(Qo,{size:100})}),d.jsxs("p",{style:{textAlign:"center",padding:"0 5px",margin:"0"},children:[d.jsx("b",{children:"Immersive Web Emulation Runtime"})," (IWER) is a free, open-source WebXR developer tool created by Meta Platforms, Inc."]}),d.jsx("table",{style:{width:"100%",borderCollapse:"collapse",display:"flex",justifyContent:"center",fontSize:"12px",padding:"8px"},children:d.jsxs("tbody",{children:[d.jsxs("tr",{children:[d.jsx(Vs,{children:"IWER"}),d.jsxs(js,{children:["v",e.version]})]}),d.jsxs("tr",{children:[d.jsx(Vs,{children:"DevUI"}),d.jsxs(js,{children:["v",e.devui.version]})]}),e.sem&&d.jsxs("tr",{children:[d.jsx(Vs,{children:"SEM"}),d.jsxs(js,{children:["v",e.sem.version]})]})]})}),d.jsx(uo,{style:{borderRadius:ro},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/blob/main/LICENSE","_blank")},children:"MIT License"}),d.jsx(uo,{style:{borderRadius:ro},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime","_blank")},children:"View Source on GitHub"})]}),g&&d.jsx(_o,{style:{position:"absolute",top:"40px"},children:Gs.map((t=>{return d.jsx("div",{children:d.jsx(fo,{style:{fontSize:"12px",width:"100%",justifyContent:"start",borderRadius:"8px"},onClick:()=>{e.sem.loadDefaultEnvironment(t)},children:(n=t,n.split("_").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))})},t);var n}))})]})},$s=Va.div`
344
+ `,Gs=["meeting_room","living_room","music_room","office_large","office_small"],Ws=vs((e=>({infoPanelOpen:!1,envDropDownOpen:!1,setInfoPanelOpen:t=>e((()=>({infoPanelOpen:t}))),setEnvDropDownOpen:t=>e((()=>({envDropDownOpen:t})))})));const Xs=({xrDevice:e,inputLayer:t})=>{var n,i,r;const[a,o]=Hn.useState(Boolean(null===(n=e.sem)||void 0===n?void 0:n.planesVisible)),[s,l]=Hn.useState(Boolean(null===(i=e.sem)||void 0===i?void 0:i.boundingBoxesVisible)),[c,u]=Hn.useState(Boolean(null===(r=e.sem)||void 0===r?void 0:r.meshesVisible)),{inputMode:h,setInputMode:f}=Bs(),{infoPanelOpen:p,setInfoPanelOpen:m,envDropDownOpen:g,setEnvDropDownOpen:v}=Ws();return d.jsxs("div",{style:{display:"flex",justifyContent:"center",flexDirection:"row",alignItems:"center",gap:"6px",padding:"8px"},children:[d.jsx(ho,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[d.jsx(fo,{title:"Click to reset device transforms",onClick:()=>{t.resetDeviceTransforms()},children:d.jsx(yo,{icon:ko,$size:16})}),d.jsx(fo,{title:"Click to activate play mode",onClick:()=>{t.lockPointer(),v(!1),m(!1)},children:d.jsx(yo,{icon:No,$size:16})}),d.jsx(fo,{title:"Click to toggle input mode",onClick:()=>{"controller"===h?(f("hand"),e.primaryInputMode="hand"):(f("controller"),e.primaryInputMode="controller")},children:d.jsx(yo,{icon:"controller"===h?Co:Po,$size:16})}),e.sem&&d.jsxs(d.Fragment,{children:[d.jsx(bo,{$horizontal:!1}),d.jsx(fo,{title:"Click to select/change emulated environment",onClick:()=>v(!g),children:d.jsx(yo,{icon:Do,$size:16})}),d.jsx(fo,{title:"Click to toggle visibility of planes",onClick:()=>{e.sem.planesVisible=!a,o(!a)},children:d.jsx(Ko,{size:16,color:a?ja:Ga})}),d.jsx(fo,{title:"Click to toggle visibility of bounding boxes",onClick:()=>{e.sem.boundingBoxesVisible=!s,l(!s)},children:d.jsx(Yo,{size:16,color:s?ja:Ga})}),d.jsx(fo,{title:"Click to toggle visibility of meshes",onClick:()=>{e.sem.meshesVisible=!c,u(!c)},children:d.jsx(Zo,{size:16,color:c?ja:Ga})})]}),d.jsx(bo,{$horizontal:!1}),d.jsx(fo,{title:"Click to exit XR session",onClick:()=>{const t=e.activeSession;null==t||t.end()},children:d.jsx(yo,{icon:To,$size:16})})]})}),d.jsx(ho,{children:d.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"1px"},children:[d.jsx(fo,{title:"About IWER",onClick:()=>{m(!p)},children:d.jsx(Qo,{size:16})}),d.jsx(fo,{title:"Report issues",onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/issues","_blank")},children:d.jsx(yo,{icon:zo,$size:16})})]})}),p&&d.jsxs(_o,{style:{top:"50vh",left:"50vw",transform:"translate(-50%, -50%)",maxWidth:"240px",gap:"4px"},children:[d.jsx("div",{style:{display:"flex",justifyContent:"end"},children:d.jsx(So,{$isRed:!0,onClick:()=>{m(!1)},children:d.jsx(yo,{icon:Go})})}),d.jsx("div",{style:{display:"flex",justifyContent:"center"},children:d.jsx(Qo,{size:100})}),d.jsxs("p",{style:{textAlign:"center",padding:"0 5px",margin:"0"},children:[d.jsx("b",{children:"Immersive Web Emulation Runtime"})," (IWER) is a free, open-source WebXR developer tool created by Meta Platforms, Inc."]}),d.jsx("table",{style:{width:"100%",borderCollapse:"collapse",display:"flex",justifyContent:"center",fontSize:"12px",padding:"8px"},children:d.jsxs("tbody",{children:[d.jsxs("tr",{children:[d.jsx(Vs,{children:"IWER"}),d.jsxs(js,{children:["v",e.version]})]}),d.jsxs("tr",{children:[d.jsx(Vs,{children:"DevUI"}),d.jsxs(js,{children:["v",e.devui.version]})]}),e.sem&&d.jsxs("tr",{children:[d.jsx(Vs,{children:"SEM"}),d.jsxs(js,{children:["v",e.sem.version]})]})]})}),d.jsx(uo,{style:{borderRadius:ro},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime/blob/main/LICENSE","_blank")},children:"MIT License"}),d.jsx(uo,{style:{borderRadius:ro},onClick:()=>{window.open("https://github.com/meta-quest/immersive-web-emulation-runtime","_blank")},children:"View Source on GitHub"})]}),g&&d.jsx(_o,{style:{position:"absolute",top:"40px"},children:Gs.map((t=>{return d.jsx("div",{children:d.jsx(fo,{style:{fontSize:"12px",width:"100%",justifyContent:"start",borderRadius:"8px"},onClick:()=>{e.sem.loadDefaultEnvironment(t)},children:(n=t,n.split("_").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))})},t);var n}))})]})},qs=Va.div`
345
345
  width: 100%;
346
346
  display: flex;
347
347
  flex-direction: row;
@@ -349,7 +349,7 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
349
349
  align-items: center;
350
350
  margin-top: ${co};
351
351
  font-size: 12px;
352
- `,qs=Va.input.attrs({type:"range"})`
352
+ `,$s=Va.input.attrs({type:"range"})`
353
353
  -webkit-appearance: none;
354
354
  appearance: none;
355
355
  background: ${Ka};
@@ -386,4 +386,4 @@ function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
386
386
  background-color: ${ja};
387
387
  border-radius: ${io};
388
388
  }
389
- `,Ys=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const[i,r]=Hn.useState(e.fovy);return d.jsxs(_o,{style:{left:"8px",top:"8px"},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:"20px"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"start"},children:[d.jsx(yo,{icon:jo,style:{marginRight:"5px"}}),d.jsx("div",{style:{alignItems:"end"},children:e.name})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"}})]}),d.jsx(bo,{}),d.jsx(ks,{vector:t.combinedCameraPosition,icon:Oo}),!n&&d.jsxs($s,{children:[d.jsx(yo,{icon:Wo,style:{marginRight:"5px"}}),d.jsxs(wo,{children:[d.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[d.jsx(Mo,{type:"text",value:(i/Math.PI*180).toFixed(0)+"°",readOnly:!0,style:{width:"73px"}}),d.jsx(Eo,{children:"FOV-Y"})]}),d.jsx("div",{style:{position:"relative",display:"inline-block"},children:d.jsx(qs,{value:i,onChange:t=>{const n=Number(t.target.value);r(n),e.fovy=n},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48,style:{width:"80px"}})})]})]})]})},Zs="165",Ks=1,Qs=2,Js=3,el=0,tl=1,nl=2,il=100,rl=101,al=102,ol=200,sl=201,ll=202,cl=203,ul=204,dl=205,hl=206,fl=207,pl=208,ml=209,gl=210,vl=211,yl=212,xl=213,_l=214,bl=0,Sl=1,wl=2,Ml=0,El=1,Tl=2,Al=3,Cl=4,Rl=5,Pl=6,Ll=7,kl=301,Nl=302,Dl=306,Il=1e3,Ol=1001,Ul=1002,zl=1003,Fl=1004,Bl=1005,Hl=1006,Vl=1007,jl=1008,Gl=1009,Wl=1012,Xl=1013,$l=1014,ql=1015,Yl=1016,Zl=1020,Kl=1023,Ql=1026,Jl=1027,ec=33776,tc=33777,nc=33778,ic=33779,rc=36492,ac="",oc="srgb",sc="srgb-linear",lc="display-p3",cc="display-p3-linear",uc="linear",dc="srgb",hc="rec709",fc="p3",pc=7680,mc=512,gc=513,vc=514,yc=515,xc=516,_c=517,bc=518,Sc=519,wc="300 es",Mc=2e3,Ec=2001;class Tc{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,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}const Ac=["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"],Cc=Math.PI/180,Rc=180/Math.PI;function Pc(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Ac[255&e]+Ac[e>>8&255]+Ac[e>>16&255]+Ac[e>>24&255]+"-"+Ac[255&t]+Ac[t>>8&255]+"-"+Ac[t>>16&15|64]+Ac[t>>24&255]+"-"+Ac[63&n|128]+Ac[n>>8&255]+"-"+Ac[n>>16&255]+Ac[n>>24&255]+Ac[255&i]+Ac[i>>8&255]+Ac[i>>16&255]+Ac[i>>24&255]).toLowerCase()}function Lc(e,t,n){return Math.max(t,Math.min(n,e))}function kc(e,t,n){return(1-n)*e+n*t}function Nc(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 Dc(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.")}}class Ic{constructor(e=0,t=0){Ic.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,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){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(Lc(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,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Oc{constructor(e,t,n,i,r,a,o,s,l){Oc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,o,s,l)}set(e,t,n,i,r,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=r,c[5]=s,c[6]=n,c[7]=a,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,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],h=n[5],f=n[8],p=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],S=i[8];return r[0]=a*p+o*v+s*_,r[3]=a*m+o*y+s*b,r[6]=a*g+o*x+s*S,r[1]=l*p+c*v+u*_,r[4]=l*m+c*y+u*b,r[7]=l*g+c*x+u*S,r[2]=d*p+h*v+f*_,r[5]=d*m+h*y+f*b,r[8]=d*g+h*x+f*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],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*r*c+n*o*s+i*r*l-i*a*s}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,d=o*s-c*r,h=l*r-a*s,f=t*u+n*d+i*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(i*l-c*n)*p,e[2]=(o*n-i*a)*p,e[3]=d*p,e[4]=(c*t-i*s)*p,e[5]=(i*r-o*t)*p,e[6]=h*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*r)*p,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,i,r,a,o){const s=Math.cos(r),l=Math.sin(r);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-i*l,i*s,-i*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Uc.makeScale(e,t)),this}rotate(e){return this.premultiply(Uc.makeRotation(-e)),this}translate(e,t){return this.premultiply(Uc.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,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Uc=new Oc;function zc(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Fc(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function Bc(){const e=Fc("canvas");return e.style.display="block",e}const Hc={};function Vc(e){e in Hc||(Hc[e]=!0,console.warn(e))}const jc=(new Oc).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Gc=(new Oc).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Wc={[sc]:{transfer:uc,primaries:hc,toReference:e=>e,fromReference:e=>e},[oc]:{transfer:dc,primaries:hc,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[cc]:{transfer:uc,primaries:fc,toReference:e=>e.applyMatrix3(Gc),fromReference:e=>e.applyMatrix3(jc)},[lc]:{transfer:dc,primaries:fc,toReference:e=>e.convertSRGBToLinear().applyMatrix3(Gc),fromReference:e=>e.applyMatrix3(jc).convertLinearToSRGB()}},Xc=new Set([sc,cc]),$c={enabled:!0,_workingColorSpace:sc,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Xc.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 i=Wc[t].toReference;return(0,Wc[n].fromReference)(i(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 Wc[e].primaries},getTransfer:function(e){return e===ac?uc:Wc[e].transfer}};function qc(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Yc(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Zc;class Kc{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===Zc&&(Zc=Fc("canvas")),Zc.width=e.width,Zc.height=e.height;const n=Zc.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zc}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=Fc("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*qc(r[e]/255);return n.putImageData(i,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*qc(t[e]/255)):t[e]=qc(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 Qc=0;class Jc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qc++}),this.uuid=Pc(),this.data=e,this.dataReady=!0,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:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(eu(i[t].image)):e.push(eu(i[t]))}else e=eu(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function eu(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Kc.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 tu=0;class nu extends Tc{constructor(e=nu.DEFAULT_IMAGE,t=nu.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,o=1023,s=1009,l=nu.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tu++}),this.uuid=Pc(),this.name="",this.source=new Jc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Ic(0,0),this.repeat=new Ic(1,1),this.center=new Ic(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Oc,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(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(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Il:e.x=e.x-Math.floor(e.x);break;case Ol:e.x=e.x<0?0:1;break;case Ul: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 Il:e.y=e.y-Math.floor(e.y);break;case Ol:e.y=e.y<0?0:1;break;case Ul: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)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}nu.DEFAULT_IMAGE=null,nu.DEFAULT_MAPPING=300,nu.DEFAULT_ANISOTROPY=1;class iu{constructor(e=0,t=0,n=0,i=1){iu.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=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,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,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,i,r;const a=.01,o=.1,s=e.elements,l=s[0],c=s[4],u=s[8],d=s[1],h=s[5],f=s[9],p=s[2],m=s[6],g=s[10];if(Math.abs(c-d)<a&&Math.abs(u-p)<a&&Math.abs(f-m)<a){if(Math.abs(c+d)<o&&Math.abs(u+p)<o&&Math.abs(f+m)<o&&Math.abs(l+h+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,s=(h+1)/2,v=(g+1)/2,y=(c+d)/4,x=(u+p)/4,_=(f+m)/4;return e>s&&e>v?e<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=y/n,r=x/n):s>v?s<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=y/i,r=_/i):v<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=x/r,i=_/r),this.set(n,i,r,t),this}let v=Math.sqrt((m-f)*(m-f)+(u-p)*(u-p)+(d-c)*(d-c));return Math.abs(v)<.001&&(v=1),this.x=(m-f)/v,this.y=(u-p)/v,this.z=(d-c)/v,this.w=Math.acos((l+h+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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ru extends Tc{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new iu(0,0,e,t),this.scissorTest=!1,this.viewport=new iu(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Hl,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new nu(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let e=0;e<a;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].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.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Jc(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class au extends ru{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class ou extends nu{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zl,this.minFilter=zl,this.wrapR=Ol,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class su extends nu{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zl,this.minFilter=zl,this.wrapR=Ol,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class lu{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let s=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const d=r[a+0],h=r[a+1],f=r[a+2],p=r[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===o)return e[t+0]=d,e[t+1]=h,e[t+2]=f,void(e[t+3]=p);if(u!==p||s!==d||l!==h||c!==f){let e=1-o;const t=s*d+l*h+c*f+u*p,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),a=Math.atan2(r,t*n);e=Math.sin(e*a)/r,o=Math.sin(o*a)/r}const r=o*n;if(s=s*e+d*r,l=l*e+h*r,c=c*e+f*r,u=u*e+p*r,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],s=n[i+1],l=n[i+2],c=n[i+3],u=r[a],d=r[a+1],h=r[a+2],f=r[a+3];return e[t]=o*f+c*u+s*h-l*d,e[t+1]=s*f+c*d+l*u-o*h,e[t+2]=l*f+c*h+o*d-s*u,e[t+3]=c*f-o*u-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(i/2),u=o(r/2),d=s(n/2),h=s(i/2),f=s(r/2);switch(a){case"XYZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"YXZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"ZXY":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"ZYX":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"YZX":this._x=d*c*u+l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u-d*h*f;break;case"XZY":this._x=d*c*u-l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(s+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(Lc(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+i*l-r*s,this._y=i*c+a*s+r*o-n*l,this._z=r*c+a*l+n*s-i*o,this._w=a*c-n*o-i*s-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),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 cu{constructor(e=0,t=0,n=0){cu.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(du.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(du.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*i-o*n),c=2*(o*t-r*i),u=2*(r*n-a*t);return this.x=t+s*l+a*u-o*c,this.y=n+s*c+o*l-r*u,this.z=i+s*u+r*c-a*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,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const 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,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,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 uu.copy(this).projectOnVector(e),this.sub(uu)}reflect(e){return this.sub(uu.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(Lc(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const uu=new cu,du=new lu;class hu{constructor(e=new cu(1/0,1/0,1/0),t=new cu(-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(pu.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(pu.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=pu.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,pu):pu.fromBufferAttribute(i,t),pu.applyMatrix4(e.matrixWorld),this.expandByPoint(pu);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),mu.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),mu.copy(n.boundingBox)),mu.applyMatrix4(e.matrixWorld),this.union(mu)}const i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[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,pu),pu.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(Su),wu.subVectors(this.max,Su),gu.subVectors(e.a,Su),vu.subVectors(e.b,Su),yu.subVectors(e.c,Su),xu.subVectors(vu,gu),_u.subVectors(yu,vu),bu.subVectors(gu,yu);let t=[0,-xu.z,xu.y,0,-_u.z,_u.y,0,-bu.z,bu.y,xu.z,0,-xu.x,_u.z,0,-_u.x,bu.z,0,-bu.x,-xu.y,xu.x,0,-_u.y,_u.x,0,-bu.y,bu.x,0];return!!Tu(t,gu,vu,yu,wu)&&(t=[1,0,0,0,1,0,0,0,1],!!Tu(t,gu,vu,yu,wu)&&(Mu.crossVectors(xu,_u),t=[Mu.x,Mu.y,Mu.z],Tu(t,gu,vu,yu,wu)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pu).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(pu).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()||(fu[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fu[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fu[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fu[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fu[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fu[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fu[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fu[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fu)),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 fu=[new cu,new cu,new cu,new cu,new cu,new cu,new cu,new cu],pu=new cu,mu=new hu,gu=new cu,vu=new cu,yu=new cu,xu=new cu,_u=new cu,bu=new cu,Su=new cu,wu=new cu,Mu=new cu,Eu=new cu;function Tu(e,t,n,i,r){for(let a=0,o=e.length-3;a<=o;a+=3){Eu.fromArray(e,a);const o=r.x*Math.abs(Eu.x)+r.y*Math.abs(Eu.y)+r.z*Math.abs(Eu.z),s=t.dot(Eu),l=n.dot(Eu),c=i.dot(Eu);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const Au=new hu,Cu=new cu,Ru=new cu;class Pu{constructor(e=new cu,t=-1){this.isSphere=!0,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):Au.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),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;Cu.subVectors(e,this.center);const t=Cu.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Cu,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):(Ru.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Cu.copy(e.center).add(Ru)),this.expandByPoint(Cu.copy(e.center).sub(Ru))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Lu=new cu,ku=new cu,Nu=new cu,Du=new cu,Iu=new cu,Ou=new cu,Uu=new cu;class zu{constructor(e=new cu,t=new cu(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,Lu)),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=Lu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Lu.copy(this.origin).addScaledVector(this.direction,t),Lu.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){ku.copy(e).add(t).multiplyScalar(.5),Nu.copy(t).sub(e).normalize(),Du.copy(this.origin).sub(ku);const r=.5*e.distanceTo(t),a=-this.direction.dot(Nu),o=Du.dot(this.direction),s=-Du.dot(Nu),l=Du.lengthSq(),c=Math.abs(1-a*a);let u,d,h,f;if(c>0)if(u=a*s-o,d=a*o-s,f=r*c,u>=0)if(d>=-f)if(d<=f){const e=1/c;u*=e,d*=e,h=u*(u+a*d+2*o)+d*(a*u+d+2*s)+l}else d=r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d=-r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d<=-f?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-s),r),h=-u*u+d*(d+2*s)+l):d<=f?(u=0,d=Math.min(Math.max(-r,-s),r),h=d*(d+2*s)+l):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-s),r),h=-u*u+d*(d+2*s)+l);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(ku).addScaledVector(Nu,d),h}intersectSphere(e,t){Lu.subVectors(e.center,this.origin);const n=Lu.dot(this.direction),i=Lu.dot(Lu)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,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,i,r,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),c>=0?(r=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(r=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),n>a||r>i?null:((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,Lu)}intersectTriangle(e,t,n,i,r){Iu.subVectors(t,e),Ou.subVectors(n,e),Uu.crossVectors(Iu,Ou);let a,o=this.direction.dot(Uu);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Du.subVectors(this.origin,e);const s=a*this.direction.dot(Ou.crossVectors(Du,Ou));if(s<0)return null;const l=a*this.direction.dot(Iu.cross(Du));if(l<0)return null;if(s+l>o)return null;const c=-a*Du.dot(Uu);return c<0?null:this.at(c/o,r)}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 Fu{constructor(e,t,n,i,r,a,o,s,l,c,u,d,h,f,p,m){Fu.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,i,r,a,o,s,l,c,u,d,h,f,p,m)}set(e,t,n,i,r,a,o,s,l,c,u,d,h,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=f,g[11]=p,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 Fu).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,i=1/Bu.setFromMatrixColumn(e,0).length(),r=1/Bu.setFromMatrixColumn(e,1).length(),a=1/Bu.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,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,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){const e=a*c,n=a*u,i=o*c,r=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-o*s,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,i=l*c,r=l*u;t[0]=e+r*o,t[4]=i*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-i,t[6]=r+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,i=l*c,r=l*u;t[0]=e-r*o,t[4]=-a*u,t[8]=i+n*o,t[1]=n+i*o,t[5]=a*c,t[9]=r-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,i=o*c,r=o*u;t[0]=s*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=s*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,i=o*s,r=o*l;t[0]=s*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if("XZY"===e.order){const e=a*s,n=a*l,i=o*s,r=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=a*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=o*c,t[10]=r*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(Vu,e,ju)}lookAt(e,t,n){const i=this.elements;return Xu.subVectors(e,t),0===Xu.lengthSq()&&(Xu.z=1),Xu.normalize(),Gu.crossVectors(n,Xu),0===Gu.lengthSq()&&(1===Math.abs(n.z)?Xu.x+=1e-4:Xu.z+=1e-4,Xu.normalize(),Gu.crossVectors(n,Xu)),Gu.normalize(),Wu.crossVectors(Xu,Gu),i[0]=Gu.x,i[4]=Wu.x,i[8]=Xu.x,i[1]=Gu.y,i[5]=Wu.y,i[9]=Xu.y,i[2]=Gu.z,i[6]=Wu.z,i[10]=Xu.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],h=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],S=i[4],w=i[8],M=i[12],E=i[1],T=i[5],A=i[9],C=i[13],R=i[2],P=i[6],L=i[10],k=i[14],N=i[3],D=i[7],I=i[11],O=i[15];return r[0]=a*b+o*E+s*R+l*N,r[4]=a*S+o*T+s*P+l*D,r[8]=a*w+o*A+s*L+l*I,r[12]=a*M+o*C+s*k+l*O,r[1]=c*b+u*E+d*R+h*N,r[5]=c*S+u*T+d*P+h*D,r[9]=c*w+u*A+d*L+h*I,r[13]=c*M+u*C+d*k+h*O,r[2]=f*b+p*E+m*R+g*N,r[6]=f*S+p*T+m*P+g*D,r[10]=f*w+p*A+m*L+g*I,r[14]=f*M+p*C+m*k+g*O,r[3]=v*b+y*E+x*R+_*N,r[7]=v*S+y*T+x*P+_*D,r[11]=v*w+y*A+x*L+_*I,r[15]=v*M+y*C+x*k+_*O,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],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+r*s*u-i*l*u-r*o*d+n*l*d+i*o*h-n*s*h)+e[7]*(+t*s*h-t*l*d+r*a*d-i*a*h+i*l*c-r*s*c)+e[11]*(+t*l*u-t*o*h-r*a*u+n*a*h+r*o*c-n*l*c)+e[15]*(-i*o*c-t*s*u+t*o*d+i*a*u-n*a*d+n*s*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 i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*d*l+p*s*h-o*m*h-u*s*g+o*d*g,y=f*d*l-c*m*l-f*s*h+a*m*h+c*s*g-a*d*g,x=c*p*l-f*u*l+f*o*h-a*p*h-c*o*g+a*u*g,_=f*u*s-c*p*s-f*o*d+a*p*d+c*o*m-a*u*m,b=t*v+n*y+i*x+r*_;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]=(p*d*r-u*m*r-p*i*h+n*m*h+u*i*g-n*d*g)*S,e[2]=(o*m*r-p*s*r+p*i*l-n*m*l-o*i*g+n*s*g)*S,e[3]=(u*s*r-o*d*r-u*i*l+n*d*l+o*i*h-n*s*h)*S,e[4]=y*S,e[5]=(c*m*r-f*d*r+f*i*h-t*m*h-c*i*g+t*d*g)*S,e[6]=(f*s*r-a*m*r-f*i*l+t*m*l+a*i*g-t*s*g)*S,e[7]=(a*d*r-c*s*r+c*i*l-t*d*l-a*i*h+t*s*h)*S,e[8]=x*S,e[9]=(f*u*r-c*p*r-f*n*h+t*p*h+c*n*g-t*u*g)*S,e[10]=(a*p*r-f*o*r+f*n*l-t*p*l-a*n*g+t*o*g)*S,e[11]=(c*o*r-a*u*r-c*n*l+t*u*l+a*n*h-t*o*h)*S,e[12]=_*S,e[13]=(c*p*i-f*u*i+f*n*d-t*p*d-c*n*m+t*u*m)*S,e[14]=(f*o*i-a*p*i-f*n*s+t*p*s+a*n*m-t*o*m)*S,e[15]=(a*u*i-c*o*i+c*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return 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),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,l=r*a,c=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,c*o+n,c*s-i*a,0,l*s-i*o,c*s+i*a,r*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,l=r+r,c=a+a,u=o+o,d=r*l,h=r*c,f=r*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,_=n.x,b=n.y,S=n.z;return i[0]=(1-(p+g))*_,i[1]=(h+x)*_,i[2]=(f-y)*_,i[3]=0,i[4]=(h-x)*b,i[5]=(1-(d+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(f+y)*S,i[9]=(m-v)*S,i[10]=(1-(d+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Bu.set(i[0],i[1],i[2]).length();const a=Bu.set(i[4],i[5],i[6]).length(),o=Bu.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Hu.copy(this);const s=1/r,l=1/a,c=1/o;return Hu.elements[0]*=s,Hu.elements[1]*=s,Hu.elements[2]*=s,Hu.elements[4]*=l,Hu.elements[5]*=l,Hu.elements[6]*=l,Hu.elements[8]*=c,Hu.elements[9]*=c,Hu.elements[10]*=c,t.setFromRotationMatrix(Hu),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=2e3){const s=this.elements,l=2*r/(t-e),c=2*r/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let h,f;if(o===Mc)h=-(a+r)/(a-r),f=-2*a*r/(a-r);else{if(o!==Ec)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-r),f=-a*r/(a-r)}return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=d,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=2e3){const s=this.elements,l=1/(t-e),c=1/(n-i),u=1/(a-r),d=(t+e)*l,h=(n+i)*c;let f,p;if(o===Mc)f=(a+r)*u,p=-2*u;else{if(o!==Ec)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=r*u,p=-1*u}return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-d,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=p,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Bu=new cu,Hu=new Fu,Vu=new cu(0,0,0),ju=new cu(1,1,1),Gu=new cu,Wu=new cu,Xu=new cu,$u=new Fu,qu=new lu;class Yu{constructor(e=0,t=0,n=0,i=Yu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],s=i[1],l=i[5],c=i[9],u=i[2],d=i[6],h=i[10];switch(t){case"XYZ":this._y=Math.asin(Lc(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Lc(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Lc(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,r));break;case"ZYX":this._y=Math.asin(-Lc(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(s,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Lc(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Lc(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-c,h),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 $u.makeRotationFromQuaternion(e),this.setFromRotationMatrix($u,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return qu.setFromEuler(this),this.setFromQuaternion(qu,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yu.DEFAULT_ORDER="XYZ";class Zu{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let Ku=0;const Qu=new cu,Ju=new lu,ed=new Fu,td=new cu,nd=new cu,id=new cu,rd=new lu,ad=new cu(1,0,0),od=new cu(0,1,0),sd=new cu(0,0,1),ld={type:"added"},cd={type:"removed"},ud={type:"childadded",child:null},dd={type:"childremoved",child:null};class hd extends Tc{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Ku++}),this.uuid=Pc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hd.DEFAULT_UP.clone();const e=new cu,t=new Yu,n=new lu,i=new cu(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:i},modelViewMatrix:{value:new Fu},normalMatrix:{value:new Oc}}),this.matrix=new Fu,this.matrixWorld=new Fu,this.matrixAutoUpdate=hd.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Zu,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 Ju.setFromAxisAngle(e,t),this.quaternion.multiply(Ju),this}rotateOnWorldAxis(e,t){return Ju.setFromAxisAngle(e,t),this.quaternion.premultiply(Ju),this}rotateX(e){return this.rotateOnAxis(ad,e)}rotateY(e){return this.rotateOnAxis(od,e)}rotateZ(e){return this.rotateOnAxis(sd,e)}translateOnAxis(e,t){return Qu.copy(e).applyQuaternion(this.quaternion),this.position.add(Qu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ad,e)}translateY(e){return this.translateOnAxis(od,e)}translateZ(e){return this.translateOnAxis(sd,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ed.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?td.copy(e):td.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),nd.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ed.lookAt(nd,td,this.up):ed.lookAt(td,nd,this.up),this.quaternion.setFromRotationMatrix(ed),i&&(ed.extractRotation(i.matrixWorld),Ju.setFromRotationMatrix(ed),this.quaternion.premultiply(Ju.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?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(ld),ud.child=e,this.dispatchEvent(ud),ud.child=null):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(cd),dd.child=e,this.dispatchEvent(dd),dd.child=null),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),ed.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ed.multiply(e.parent.matrixWorld)),e.applyMatrix4(ed),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ld),ud.child=e,this.dispatchEvent(ud),ud.child=null,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,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].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(nd,e,id),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nd,rd,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,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;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,i=t.length;n<i;n++){const i=t[n];!0!==i.matrixWorldAutoUpdate&&!0!==e||i.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 i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(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,i=n.length;t<i;t++){const i=n[t];r(e.shapes,i)}else r(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(r(e.materials,this.material[n]));i.material=t}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(r(e.animations,n))}}if(t){const t=a(e.geometries),i=a(e.materials),r=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function a(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.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}}hd.DEFAULT_UP=new cu(0,1,0),hd.DEFAULT_MATRIX_AUTO_UPDATE=!0,hd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const fd=new cu,pd=new cu,md=new cu,gd=new cu,vd=new cu,yd=new cu,xd=new cu,_d=new cu,bd=new cu,Sd=new cu;class wd{constructor(e=new cu,t=new cu,n=new cu){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),fd.subVectors(e,t),i.cross(fd);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){fd.subVectors(i,t),pd.subVectors(n,t),md.subVectors(e,t);const a=fd.dot(fd),o=fd.dot(pd),s=fd.dot(md),l=pd.dot(pd),c=pd.dot(md),u=a*l-o*o;if(0===u)return r.set(0,0,0),null;const d=1/u,h=(l*s-o*c)*d,f=(a*c-o*s)*d;return r.set(1-h-f,f,h)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,gd)&&(gd.x>=0&&gd.y>=0&&gd.x+gd.y<=1)}static getInterpolation(e,t,n,i,r,a,o,s){return null===this.getBarycoord(e,t,n,i,gd)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(r,gd.x),s.addScaledVector(a,gd.y),s.addScaledVector(o,gd.z),s)}static isFrontFacing(e,t,n,i){return fd.subVectors(n,t),pd.subVectors(e,t),fd.cross(pd).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fd.subVectors(this.c,this.b),pd.subVectors(this.a,this.b),.5*fd.cross(pd).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wd.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wd.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return wd.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return wd.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wd.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;vd.subVectors(i,n),yd.subVectors(r,n),_d.subVectors(e,n);const s=vd.dot(_d),l=yd.dot(_d);if(s<=0&&l<=0)return t.copy(n);bd.subVectors(e,i);const c=vd.dot(bd),u=yd.dot(bd);if(c>=0&&u<=c)return t.copy(i);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(vd,a);Sd.subVectors(e,r);const h=vd.dot(Sd),f=yd.dot(Sd);if(f>=0&&h<=f)return t.copy(r);const p=h*l-s*f;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(n).addScaledVector(yd,o);const m=c*f-h*u;if(m<=0&&u-c>=0&&h-f>=0)return xd.subVectors(r,i),o=(u-c)/(u-c+(h-f)),t.copy(i).addScaledVector(xd,o);const g=1/(m+p+d);return a=p*g,o=d*g,t.copy(n).addScaledVector(vd,a).addScaledVector(yd,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Md={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},Ed={h:0,s:0,l:0},Td={h:0,s:0,l:0};function Ad(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 Cd{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,t=oc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,$c.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=$c.workingColorSpace){return this.r=e,this.g=t,this.b=n,$c.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=$c.workingColorSpace){if(e=function(e,t){return(e%t+t)%t}(e,1),t=Lc(t,0,1),n=Lc(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Ad(r,i,e+1/3),this.g=Ad(r,i,e),this.b=Ad(r,i,e-1/3)}return $c.toWorkingColorSpace(this,i),this}setStyle(e,t=oc){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=oc){const n=Md[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=qc(e.r),this.g=qc(e.g),this.b=qc(e.b),this}copyLinearToSRGB(e){return this.r=Yc(e.r),this.g=Yc(e.g),this.b=Yc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oc){return $c.fromWorkingColorSpace(Rd.copy(this),e),65536*Math.round(Lc(255*Rd.r,0,255))+256*Math.round(Lc(255*Rd.g,0,255))+Math.round(Lc(255*Rd.b,0,255))}getHexString(e=oc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=$c.workingColorSpace){$c.fromWorkingColorSpace(Rd.copy(this),t);const n=Rd.r,i=Rd.g,r=Rd.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let s,l;const c=(o+a)/2;if(o===a)s=0,l=0;else{const e=a-o;switch(l=c<=.5?e/(a+o):e/(2-a-o),a){case n:s=(i-r)/e+(i<r?6:0);break;case i:s=(r-n)/e+2;break;case r:s=(n-i)/e+4}s/=6}return e.h=s,e.s=l,e.l=c,e}getRGB(e,t=$c.workingColorSpace){return $c.fromWorkingColorSpace(Rd.copy(this),t),e.r=Rd.r,e.g=Rd.g,e.b=Rd.b,e}getStyle(e=oc){$c.fromWorkingColorSpace(Rd.copy(this),e);const t=Rd.r,n=Rd.g,i=Rd.b;return e!==oc?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(Ed),this.setHSL(Ed.h+e,Ed.s+t,Ed.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(Ed),e.getHSL(Td);const n=kc(Ed.h,Td.h,t),i=kc(Ed.s,Td.s,t),r=kc(Ed.l,Td.l,t);return this.setHSL(n,i,r),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,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Rd=new Cd;Cd.NAMES=Md;let Pd=0;class Ld extends Tc{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Pd++}),this.uuid=Pc(),this.name="",this.type="Material",this.blending=1,this.side=el,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=il,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Cd(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=pc,this.stencilZFail=pc,this.stencilZPass=pc,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 i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.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 i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}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()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==el&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==il&&(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!==pc&&(n.stencilFail=this.stencilFail),this.stencilZFail!==pc&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==pc&&(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=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}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 i=0;i!==e;++i)n[i]=t[i].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 kd extends Ld{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Cd(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.envMapRotation=new Yu,this.combine=bl,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Nd=new cu,Dd=new Ic;class Id{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ql,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Vc("THREE.BufferAttribute: updateRange() is deprecated and will be 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 i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];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++)Dd.fromBufferAttribute(this,t),Dd.applyMatrix3(e),this.setXY(t,Dd.x,Dd.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyMatrix3(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyMatrix4(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyNormalMatrix(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.transformDirection(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Nc(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Dc(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Nc(t,this.array)),t}setX(e,t){return this.normalized&&(t=Dc(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Nc(t,this.array)),t}setY(e,t){return this.normalized&&(t=Dc(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=Nc(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Dc(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=Nc(t,this.array)),t}setW(e,t){return this.normalized&&(t=Dc(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array),i=Dc(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array),i=Dc(i,this.array),r=Dc(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,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),35044!==this.usage&&(e.usage=this.usage),e}}class Od extends Id{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Ud extends Id{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class zd extends Id{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Fd=0;const Bd=new Fu,Hd=new hd,Vd=new cu,jd=new hu,Gd=new hu,Wd=new cu;class Xd extends Tc{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Fd++}),this.uuid=Pc(),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(zc(e)?Ud:Od)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Oc).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Bd.makeRotationFromQuaternion(e),this.applyMatrix4(Bd),this}rotateX(e){return Bd.makeRotationX(e),this.applyMatrix4(Bd),this}rotateY(e){return Bd.makeRotationY(e),this.applyMatrix4(Bd),this}rotateZ(e){return Bd.makeRotationZ(e),this.applyMatrix4(Bd),this}translate(e,t,n){return Bd.makeTranslation(e,t,n),this.applyMatrix4(Bd),this}scale(e,t,n){return Bd.makeScale(e,t,n),this.applyMatrix4(Bd),this}lookAt(e){return Hd.lookAt(e),Hd.updateMatrix(),this.applyMatrix4(Hd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vd).negate(),this.translate(Vd.x,Vd.y,Vd.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new zd(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new hu);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.",this),void this.boundingBox.set(new cu(-1/0,-1/0,-1/0),new cu(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];jd.setFromBufferAttribute(n),this.morphTargetsRelative?(Wd.addVectors(this.boundingBox.min,jd.min),this.boundingBox.expandByPoint(Wd),Wd.addVectors(this.boundingBox.max,jd.max),this.boundingBox.expandByPoint(Wd)):(this.boundingBox.expandByPoint(jd.min),this.boundingBox.expandByPoint(jd.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 Pu);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.",this),void this.boundingSphere.set(new cu,1/0);if(e){const n=this.boundingSphere.center;if(jd.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Gd.setFromBufferAttribute(n),this.morphTargetsRelative?(Wd.addVectors(jd.min,Gd.min),jd.expandByPoint(Wd),Wd.addVectors(jd.max,Gd.max),jd.expandByPoint(Wd)):(jd.expandByPoint(Gd.min),jd.expandByPoint(Gd.max))}jd.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)Wd.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(Wd));if(t)for(let r=0,a=t.length;r<a;r++){const a=t[r],o=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)Wd.fromBufferAttribute(a,t),o&&(Vd.fromBufferAttribute(e,t),Wd.add(Vd)),i=Math.max(i,n.distanceToSquared(Wd))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){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=t.position,i=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Id(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new cu,s[e]=new cu;const l=new cu,c=new cu,u=new cu,d=new Ic,h=new Ic,f=new Ic,p=new cu,m=new cu;function g(e,t,i){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),d.fromBufferAttribute(r,e),h.fromBufferAttribute(r,t),f.fromBufferAttribute(r,i),c.sub(l),u.sub(l),h.sub(d),f.sub(d);const a=1/(h.x*f.y-f.x*h.y);isFinite(a)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-h.y).multiplyScalar(a),m.copy(u).multiplyScalar(h.x).addScaledVector(c,-f.x).multiplyScalar(a),o[e].add(p),o[t].add(p),o[i].add(p),s[e].add(m),s[t].add(m),s[i].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:e.count}]);for(let t=0,n=v.length;t<n;++t){const n=v[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const y=new cu,x=new cu,_=new cu,b=new cu;function S(e){_.fromBufferAttribute(i,e),b.copy(_);const t=o[e];y.copy(t),y.sub(_.multiplyScalar(_.dot(t))).normalize(),x.crossVectors(b,t);const n=x.dot(s[e])<0?-1:1;a.setXYZW(e,y.x,y.y,y.z,n)}for(let t=0,n=v.length;t<n;++t){const n=v[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+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 Id(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 i=new cu,r=new cu,a=new cu,o=new cu,s=new cu,l=new cu,c=new cu,u=new cu;if(e)for(let d=0,h=e.count;d<h;d+=3){const h=e.getX(d+0),f=e.getX(d+1),p=e.getX(d+2);i.fromBufferAttribute(t,h),r.fromBufferAttribute(t,f),a.fromBufferAttribute(t,p),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),o.add(c),s.add(c),l.add(c),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),u.subVectors(i,r),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++)Wd.fromBufferAttribute(e,t),Wd.normalize(),e.setXYZ(t,Wd.x,Wd.y,Wd.z)}toNonIndexed(){function e(e,t){const n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i);let o=0,s=0;for(let r=0,l=t.length;r<l;r++){o=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)a[s++]=n[o++]}return new Id(a,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Xd,n=this.index.array,i=this.attributes;for(const r in i){const a=e(i[r],n);t.setAttribute(r,a)}const r=this.morphAttributes;for(const i in r){const a=[],o=r[i];for(let t=0,i=o.length;t<i;t++){const i=e(o[t],n);a.push(i)}t.morphAttributes[i]=a}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let e=0,n=a.length;e<n;e++){const n=a[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 i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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 i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let e=0,t=a.length;e<t;e++){const t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const $d=new Fu,qd=new zu,Yd=new Pu,Zd=new cu,Kd=new cu,Qd=new cu,Jd=new cu,eh=new cu,th=new cu,nh=new Ic,ih=new Ic,rh=new Ic,ah=new cu,oh=new cu,sh=new cu,lh=new cu,ch=new cu;class uh extends hd{constructor(e=new Xd,t=new kd){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,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){th.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=o[n],s=r[n];0!==i&&(eh.fromBufferAttribute(s,e),a?th.addScaledVector(eh,i):th.addScaledVector(eh.sub(t),i))}t.add(th)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),Yd.copy(n.boundingSphere),Yd.applyMatrix4(r),qd.copy(e.ray).recast(e.near),!1===Yd.containsPoint(qd.origin)){if(null===qd.intersectSphere(Yd,Zd))return;if(qd.origin.distanceToSquared(Zd)>(e.far-e.near)**2)return}$d.copy(r).invert(),qd.copy(e.ray).applyMatrix4($d),null!==n.boundingBox&&!1===qd.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,qd)}}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,s=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,d=r.groups,h=r.drawRange;if(null!==o)if(Array.isArray(a))for(let r=0,s=d.length;r<s;r++){const s=d[r],f=a[s.materialIndex];for(let r=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));r<a;r+=3){i=dh(this,f,e,n,l,c,u,o.getX(r),o.getX(r+1),o.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,t.push(i))}}else{for(let r=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);r<s;r+=3){i=dh(this,a,e,n,l,c,u,o.getX(r),o.getX(r+1),o.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}else if(void 0!==s)if(Array.isArray(a))for(let r=0,o=d.length;r<o;r++){const o=d[r],f=a[o.materialIndex];for(let r=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));r<a;r+=3){i=dh(this,f,e,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,t.push(i))}}else{for(let r=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);r<o;r+=3){i=dh(this,a,e,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}}}function dh(e,t,n,i,r,a,o,s,l,c){e.getVertexPosition(s,Kd),e.getVertexPosition(l,Qd),e.getVertexPosition(c,Jd);const u=function(e,t,n,i,r,a,o,s){let l;if(l=t.side===tl?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side===el,s),null===l)return null;ch.copy(s),ch.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(ch);return c<n.near||c>n.far?null:{distance:c,point:ch.clone(),object:e}}(e,t,n,i,Kd,Qd,Jd,lh);if(u){r&&(nh.fromBufferAttribute(r,s),ih.fromBufferAttribute(r,l),rh.fromBufferAttribute(r,c),u.uv=wd.getInterpolation(lh,Kd,Qd,Jd,nh,ih,rh,new Ic)),a&&(nh.fromBufferAttribute(a,s),ih.fromBufferAttribute(a,l),rh.fromBufferAttribute(a,c),u.uv1=wd.getInterpolation(lh,Kd,Qd,Jd,nh,ih,rh,new Ic)),o&&(ah.fromBufferAttribute(o,s),oh.fromBufferAttribute(o,l),sh.fromBufferAttribute(o,c),u.normal=wd.getInterpolation(lh,Kd,Qd,Jd,ah,oh,sh,new cu),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const e={a:s,b:l,c:c,normal:new cu,materialIndex:0};wd.getNormal(Kd,Qd,Jd,e.normal),u.face=e}return u}class hh extends Xd{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const s=[],l=[],c=[],u=[];let d=0,h=0;function f(e,t,n,i,r,a,f,p,m,g,v){const y=a/m,x=f/g,_=a/2,b=f/2,S=p/2,w=m+1,M=g+1;let E=0,T=0;const A=new cu;for(let a=0;a<M;a++){const o=a*x-b;for(let s=0;s<w;s++){const d=s*y-_;A[e]=d*i,A[t]=o*r,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(s/m),u.push(1-a/g),E+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=d+t+w*e,i=d+t+w*(e+1),r=d+(t+1)+w*(e+1),a=d+(t+1)+w*e;s.push(n,i,a),s.push(i,r,a),T+=6}o.addGroup(h,T,v),h+=T,d+=E}f("z","y","x",-1,-1,n,t,e,a,r,0),f("z","y","x",1,-1,n,t,-e,a,r,1),f("x","z","y",1,1,e,n,t,i,a,2),f("x","z","y",1,-1,e,n,-t,i,a,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(s),this.setAttribute("position",new zd(l,3)),this.setAttribute("normal",new zd(c,3)),this.setAttribute("uv",new zd(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hh(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function fh(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}}return t}function ph(e){const t={};for(let n=0;n<e.length;n++){const i=fh(e[n]);for(const e in i)t[e]=i[e]}return t}function mh(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:$c.workingColorSpace}const gh={clone:fh,merge:ph};class vh extends Ld{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={clipCullDistance:!1,multiDraw:!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=fh(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 i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}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 yh extends hd{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fu,this.projectionMatrix=new Fu,this.projectionMatrixInverse=new Fu,this.coordinateSystem=Mc}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)}}const xh=new cu,_h=new Ic,bh=new Ic;class Sh extends yh{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=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*Rc*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Cc*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Rc*Math.atan(Math.tan(.5*Cc*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){xh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(xh.x,xh.y).multiplyScalar(-e/xh.z),xh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(xh.x,xh.y).multiplyScalar(-e/xh.z)}getViewSize(e,t){return this.getViewBounds(e,_h,bh),t.subVectors(bh,_h)}setViewOffset(e,t,n,i,r,a){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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Cc*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/o,i*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,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 wh=-90;class Mh extends hd{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Sh(wh,1,e,t);i.layers=this.layers,this.add(i);const r=new Sh(wh,1,e,t);r.layers=this.layers,this.add(r);const a=new Sh(wh,1,e,t);a.layers=this.layers,this.add(a);const o=new Sh(wh,1,e,t);o.layers=this.layers,this.add(o);const s=new Sh(wh,1,e,t);s.layers=this.layers,this.add(s);const l=new Sh(wh,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,s]=t;for(const e of t)this.remove(e);if(e===Mc)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(e!==Ec)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.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:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,s,l,c]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,s),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(u,d,h),e.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class Eh extends nu{constructor(e,t,n,i,r,a,o,s,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:kl,n,i,r,a,o,s,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Th extends au{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new Eh(i,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:Hl}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"},i=new hh(5,5,5),r=new vh({name:"CubemapFromEquirect",uniforms:fh(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:tl,blending:0});r.uniforms.tEquirect.value=t;const a=new uh(i,r),o=t.minFilter;t.minFilter===jl&&(t.minFilter=Hl);return new Mh(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}const Ah=new cu,Ch=new cu,Rh=new Oc;class Ph{constructor(e=new cu(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Ah.subVectors(n,t).cross(Ch.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Ah),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}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||Rh.getNormalMatrix(e),i=this.coplanarPoint(Ah).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),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 Lh=new Pu,kh=new cu;class Nh{constructor(e=new Ph,t=new Ph,n=new Ph,i=new Ph,r=new Ph,a=new Ph){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],c=i[5],u=i[6],d=i[7],h=i[8],f=i[9],p=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15];if(n[0].setComponents(s-r,d-l,m-h,x-g).normalize(),n[1].setComponents(s+r,d+l,m+h,x+g).normalize(),n[2].setComponents(s+a,d+c,m+f,x+v).normalize(),n[3].setComponents(s-a,d-c,m-f,x-v).normalize(),n[4].setComponents(s-o,d-u,m-p,x-y).normalize(),t===Mc)n[5].setComponents(s+o,d+u,m+p,x+y).normalize();else{if(t!==Ec)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,u,p,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Lh.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Lh.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Lh)}intersectsSprite(e){return Lh.center.set(0,0,0),Lh.radius=.7071067811865476,Lh.applyMatrix4(e.matrixWorld),this.intersectsSphere(Lh)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<i)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(kh.x=i.normal.x>0?e.max.x:e.min.x,kh.y=i.normal.y>0?e.max.y:e.min.y,kh.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(kh)<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 Dh(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ih(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);if(void 0===r)t.set(n,function(t,n){const i=t.array,r=t.usage,a=i.byteLength,o=e.createBuffer();let s;if(e.bindBuffer(n,o),e.bufferData(n,i,r),t.onUploadCallback(),i instanceof Float32Array)s=e.FLOAT;else if(i instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)s=e.SHORT;else if(i instanceof Uint32Array)s=e.UNSIGNED_INT;else if(i instanceof Int32Array)s=e.INT;else if(i instanceof Int8Array)s=e.BYTE;else if(i instanceof Uint8Array)s=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);s=e.UNSIGNED_BYTE}return{buffer:o,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,i));else if(r.version<n.version){if(r.size!==n.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,n,i){const r=n.array,a=n._updateRange,o=n.updateRanges;if(e.bindBuffer(i,t),-1===a.count&&0===o.length&&e.bufferSubData(i,0,r),0!==o.length){for(let t=0,n=o.length;t<n;t++){const n=o[t];e.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r,a.offset,a.count),a.count=-1),n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class Oh extends Xd{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),s=Math.floor(i),l=o+1,c=s+1,u=e/o,d=t/s,h=[],f=[],p=[],m=[];for(let e=0;e<c;e++){const t=e*d-a;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-t,0),p.push(0,0,1),m.push(n/o),m.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;h.push(n,i,a),h.push(i,r,a)}this.setIndex(h),this.setAttribute("position",new zd(f,3)),this.setAttribute("normal",new zd(p,3)),this.setAttribute("uv",new zd(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oh(e.width,e.height,e.widthSegments,e.heightSegments)}}const Uh={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\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\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\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\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#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\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 ) || defined( USE_BATCHING_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 ) || defined( USE_BATCHING_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\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( batchId );\n\tvColor.xyz *= batchingColor.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_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\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, envMapRotation * 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\tuniform mat3 envMapRotation;\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, envMapRotation * 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, envMapRotation * 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_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\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\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_DISPERSION\n\tmaterial.dispersion = dispersion;\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\tfloat dispersion;\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 )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\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",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\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\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\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\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\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.dispersion, 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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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#include <morphinstance_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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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#include <morphinstance_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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\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 ), diffuseColor.a );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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_DISPERSION\n\tuniform float dispersion;\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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\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}"},zh={common:{diffuse:{value:new Cd(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Oc},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Oc}},envmap:{envMap:{value:null},envMapRotation:{value:new Oc},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Oc}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Oc}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Oc},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Oc},normalScale:{value:new Ic(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Oc},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Oc}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Oc}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Oc}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Cd(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 Cd(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0},uvTransform:{value:new Oc}},sprite:{diffuse:{value:new Cd(16777215)},opacity:{value:1},center:{value:new Ic(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Oc},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0}}},Fh={basic:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.fog]),vertexShader:Uh.meshbasic_vert,fragmentShader:Uh.meshbasic_frag},lambert:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)}}]),vertexShader:Uh.meshlambert_vert,fragmentShader:Uh.meshlambert_frag},phong:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)},specular:{value:new Cd(1118481)},shininess:{value:30}}]),vertexShader:Uh.meshphong_vert,fragmentShader:Uh.meshphong_frag},standard:{uniforms:ph([zh.common,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.roughnessmap,zh.metalnessmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Uh.meshphysical_vert,fragmentShader:Uh.meshphysical_frag},toon:{uniforms:ph([zh.common,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.gradientmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)}}]),vertexShader:Uh.meshtoon_vert,fragmentShader:Uh.meshtoon_frag},matcap:{uniforms:ph([zh.common,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,{matcap:{value:null}}]),vertexShader:Uh.meshmatcap_vert,fragmentShader:Uh.meshmatcap_frag},points:{uniforms:ph([zh.points,zh.fog]),vertexShader:Uh.points_vert,fragmentShader:Uh.points_frag},dashed:{uniforms:ph([zh.common,zh.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Uh.linedashed_vert,fragmentShader:Uh.linedashed_frag},depth:{uniforms:ph([zh.common,zh.displacementmap]),vertexShader:Uh.depth_vert,fragmentShader:Uh.depth_frag},normal:{uniforms:ph([zh.common,zh.bumpmap,zh.normalmap,zh.displacementmap,{opacity:{value:1}}]),vertexShader:Uh.meshnormal_vert,fragmentShader:Uh.meshnormal_frag},sprite:{uniforms:ph([zh.sprite,zh.fog]),vertexShader:Uh.sprite_vert,fragmentShader:Uh.sprite_frag},background:{uniforms:{uvTransform:{value:new Oc},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Uh.background_vert,fragmentShader:Uh.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Oc}},vertexShader:Uh.backgroundCube_vert,fragmentShader:Uh.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Uh.cube_vert,fragmentShader:Uh.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Uh.equirect_vert,fragmentShader:Uh.equirect_frag},distanceRGBA:{uniforms:ph([zh.common,zh.displacementmap,{referencePosition:{value:new cu},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Uh.distanceRGBA_vert,fragmentShader:Uh.distanceRGBA_frag},shadow:{uniforms:ph([zh.lights,zh.fog,{color:{value:new Cd(0)},opacity:{value:1}}]),vertexShader:Uh.shadow_vert,fragmentShader:Uh.shadow_frag}};Fh.physical={uniforms:ph([Fh.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Oc},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Oc},clearcoatNormalScale:{value:new Ic(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Oc},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Oc},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Oc},sheen:{value:0},sheenColor:{value:new Cd(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Oc},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Oc},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Oc},transmissionSamplerSize:{value:new Ic},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Oc},attenuationDistance:{value:0},attenuationColor:{value:new Cd(0)},specularColor:{value:new Cd(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Oc},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Oc},anisotropyVector:{value:new Ic},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Oc}}]),vertexShader:Uh.meshphysical_vert,fragmentShader:Uh.meshphysical_frag};const Bh={r:0,b:0,g:0},Hh=new Yu,Vh=new Fu;function jh(e,t,n,i,r,a,o){const s=new Cd(0);let l,c,u=!0===a?0:1,d=null,h=0,f=null;function p(e){let i=!0===e.isScene?e.background:null;if(i&&i.isTexture){i=(e.backgroundBlurriness>0?n:t).get(i)}return i}function m(t,n){t.getRGB(Bh,mh(e)),i.buffers.color.setClear(Bh.r,Bh.g,Bh.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),u=t,m(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,m(s,u)},render:function(t){let n=!1;const r=p(t);null===r?m(s,u):r&&r.isColor&&(m(r,1),n=!0);const a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const i=p(n);i&&(i.isCubeTexture||i.mapping===Dl)?(void 0===c&&(c=new uh(new hh(1,1,1),new vh({name:"BackgroundCubeMaterial",uniforms:fh(Fh.backgroundCube.uniforms),vertexShader:Fh.backgroundCube.vertexShader,fragmentShader:Fh.backgroundCube.fragmentShader,side:tl,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}}),r.update(c)),Hh.copy(n.backgroundRotation),Hh.x*=-1,Hh.y*=-1,Hh.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(Hh.y*=-1,Hh.z*=-1),c.material.uniforms.envMap.value=i,c.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(Vh.makeRotationFromEuler(Hh)),c.material.toneMapped=$c.getTransfer(i.colorSpace)!==dc,d===i&&h===i.version&&f===e.toneMapping||(c.material.needsUpdate=!0,d=i,h=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):i&&i.isTexture&&(void 0===l&&(l=new uh(new Oh(2,2),new vh({name:"BackgroundMaterial",uniforms:fh(Fh.background.uniforms),vertexShader:Fh.background.vertexShader,fragmentShader:Fh.background.fragmentShader,side:el,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=$c.getTransfer(i.colorSpace)!==dc,!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),d===i&&h===i.version&&f===e.toneMapping||(l.material.needsUpdate=!0,d=i,h=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function Gh(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=c(null);let a=r,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],i=[],r=[];for(let e=0;e<n;e++)t[e]=0,i[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function u(){const e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function d(e){h(e,0)}function h(t,n){const i=a.newAttributes,r=a.enabledAttributes,o=a.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function f(){const t=a.newAttributes,n=a.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function p(t,n,i,r,a,o,s){!0===s?e.vertexAttribIPointer(t,n,i,a,o):e.vertexAttribPointer(t,n,i,r,a,o)}function m(){g(),o=!0,a!==r&&(a=r,s(a.object))}function g(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,m,g){let v=!1;const y=function(t,n,r){const a=!0===r.wireframe;let o=i[t.id];void 0===o&&(o={},i[t.id]=o);let s=o[n.id];void 0===s&&(s={},o[n.id]=s);let l=s[a];void 0===l&&(l=c(e.createVertexArray()),s[a]=l);return l}(m,l,r);a!==y&&(a=y,s(a.object)),v=function(e,t,n,i){const r=a.attributes,o=t.attributes;let s=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){const n=r[t];let i=o[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;s++}}return a.attributesNum!==s||a.index!==i}(n,m,l,g),v&&function(e,t,n,i){const r={},o=t.attributes;let s=0;const l=n.getAttributes();for(const t in l){if(l[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 i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,s++}}a.attributes=r,a.attributesNum=s,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||o)&&(o=!1,function(n,i,r,a){u();const o=a.attributes,s=r.getAttributes(),l=i.defaultAttributeValues;for(const i in s){const r=s[i];if(r.location>=0){let s=o[i];if(void 0===s&&("instanceMatrix"===i&&n.instanceMatrix&&(s=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(s=n.instanceColor)),void 0!==s){const i=s.normalized,o=s.itemSize,l=t.get(s);if(void 0===l)continue;const c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===Xl;if(s.isInterleavedBufferAttribute){const t=s.data,l=t.stride,g=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)h(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,o/r.locationSize,u,i,l*f,(g+o/r.locationSize*e)*f,m)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)h(r.location+e,s.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,o/r.locationSize,u,i,o*f,o/r.locationSize*e*f,m)}}else if(void 0!==l){const t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,r,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){m();for(const e in i){const t=i[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e]}},releaseStatesOfGeometry:function(e){if(void 0===i[e.id])return;const t=i[e.id];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e.id]},releaseStatesOfProgram:function(e){for(const t in i){const n=i[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)l(r[e].object),delete r[e];delete n[e.id]}},initAttributes:u,enableAttribute:d,disableUnusedAttributes:f}}function Wh(e,t,n){let i;function r(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))}this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(e,r,a){if(0===a)return;const o=t.get("WEBGL_multi_draw");if(null===o)for(let t=0;t<a;t++)this.render(e[t],r[t]);else{o.multiDrawArraysWEBGL(i,e,0,r,0,a);let t=0;for(let e=0;e<a;e++)t+=r[e];n.update(t,i,1)}},this.renderMultiDrawInstances=function(e,a,o,s){if(0===o)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)r(e[t],a[t],s[t]);else{l.multiDrawArraysInstancedWEBGL(i,e,0,a,0,s,0,o);let t=0;for(let e=0;e<o;e++)t+=a[e];for(let e=0;e<s.length;e++)n.update(t,i,s[e])}}}function Xh(e,t,n,i){let r;function a(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"}let o=void 0!==n.precision?n.precision:"highp";const s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,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:a,textureFormatReadable:function(t){return t===Kl||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const r=n===Yl&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==Gl&&i.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==ql&&!r)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function $h(e){const t=this;let n=null,i=0,r=!1,a=!1;const o=new Ph,s=new Oc,l={value:null,needsUpdate:!1};function c(e,n,i,r){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==r||null===c){const t=i+4*a,r=n.matrixWorldInverse;s.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(r,s),o.normal.toArray(c,n),c[n+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,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!==i||r;return r=t,i=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(o,s,u){const d=o.clippingPlanes,h=o.clipIntersection,f=o.clipShadows,p=e.get(o);if(!r||null===d||0===d.length||a&&!f)a?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);t.numPlanes=i,t.numIntersection=0}();else{const e=a?0:i,t=4*e;let r=p.clippingState||null;l.value=r,r=c(d,s,t,u);for(let e=0;e!==t;++e)r[e]=n[e];p.clippingState=r,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function qh(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=kl:304===t&&(e.mapping=Nl),e}function i(e){const n=e.target;n.removeEventListener("dispose",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const a=r.mapping;if(303===a||304===a){if(t.has(r)){return n(t.get(r).texture,r.mapping)}{const a=r.image;if(a&&a.height>0){const o=new Th(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener("dispose",i),n(o.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}class Yh extends yh{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,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,i,r,a){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=i,this.view.width=r,this.view.height=a,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,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,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 Zh=[.125,.215,.35,.446,.526,.582],Kh=20,Qh=new Yh,Jh=new Cd;let ef=null,tf=0,nf=0,rf=!1;const af=(1+Math.sqrt(5))/2,of=1/af,sf=[new cu(-af,of,0),new cu(af,of,0),new cu(-of,0,af),new cu(of,0,af),new cu(0,af,-of),new cu(0,af,of),new cu(-1,1,-1),new cu(1,1,-1),new cu(-1,1,1),new cu(1,1,1)];class lf{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){ef=this._renderer.getRenderTarget(),tf=this._renderer.getActiveCubeFace(),nf=this._renderer.getActiveMipmapLevel(),rf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,n,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=hf(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=df(),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(ef,tf,nf),this._renderer.xr.enabled=rf,e.scissorTest=!1,uf(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===kl||e.mapping===Nl?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ef=this._renderer.getRenderTarget(),tf=this._renderer.getActiveCubeFace(),nf=this._renderer.getActiveMipmapLevel(),rf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;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:Hl,minFilter:Hl,generateMipmaps:!1,type:Yl,format:Kl,colorSpace:sc,depthBuffer:!1},i=cf(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=cf(e,t,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],i=[];let r=e;const a=e-4+1+Zh.length;for(let o=0;o<a;o++){const a=Math.pow(2,r);n.push(a);let s=1/a;o>e-4?s=Zh[o-e+4-1]:0===o&&(s=0),i.push(s);const l=1/(a-2),c=-l,u=1+l,d=[c,c,u,c,u,u,c,c,u,u,c,u],h=6,f=6,p=3,m=2,g=1,v=new Float32Array(p*f*h),y=new Float32Array(m*f*h),x=new Float32Array(g*f*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[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(i,p*f*e),y.set(d,m*f*e);const r=[e,e,e,e,e,e];x.set(r,g*f*e)}const _=new Xd;_.setAttribute("position",new Id(v,p)),_.setAttribute("uv",new Id(y,m)),_.setAttribute("faceIndex",new Id(x,g)),t.push(_),r>4&&r--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(e,t,n){const i=new Float32Array(Kh),r=new cu(0,1,0),a=new vh({name:"SphericalGaussianBlur",defines:{n:Kh,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ff(),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 a}(i,e,t)}return i}_compileMaterial(e){const t=new uh(this._lodPlanes[0],e);this._renderer.compile(t,Qh)}_sceneToCubeUV(e,t,n,i){const r=new Sh(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,c=s.toneMapping;s.getClearColor(Jh),s.toneMapping=Ml,s.autoClear=!1;const u=new kd({name:"PMREM.Background",side:tl,depthWrite:!1,depthTest:!1}),d=new uh(new hh,u);let h=!1;const f=e.background;f?f.isColor&&(u.color.copy(f),e.background=null,h=!0):(u.color.copy(Jh),h=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(r.up.set(0,a[t],0),r.lookAt(o[t],0,0)):1===n?(r.up.set(0,0,a[t]),r.lookAt(0,o[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,o[t]));const l=this._cubeSize;uf(i,n*l,t>2?l:0,l,l),s.setRenderTarget(i),h&&s.render(d,r),s.render(e,r)}d.geometry.dispose(),d.material.dispose(),s.toneMapping=c,s.autoClear=l,e.background=f}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===kl||e.mapping===Nl;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=hf()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=df());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new uh(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const o=this._cubeSize;uf(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,Qh)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let t=1;t<i;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=sf[(i-t-1)%sf.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new uh(this._lodPlanes[i],l),u=l.uniforms,d=this._sizeLods[n]-1,h=isFinite(r)?Math.PI/(2*d):2*Math.PI/39,f=r/h,p=isFinite(r)?1+Math.floor(3*f):Kh;p>Kh&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<Kh;++e){const t=e/f,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<p&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;u.envMap.value=e.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===a,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=h,u.mipInt.value=v-n;const y=this._sizeLods[i];uf(t,3*y*(i>v-4?i-v+4:0),4*(this._cubeSize-y),3*y,2*y),s.setRenderTarget(t),s.render(c,Qh)}}function cf(e,t,n){const i=new au(e,t,n);return i.texture.mapping=Dl,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function uf(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function df(){return new vh({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ff(),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 hf(){return new vh({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ff(),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 ff(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function pf(e){let t=new WeakMap,n=null;function i(e){const n=e.target;n.removeEventListener("dispose",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const a=r.mapping,o=303===a||304===a,s=a===kl||a===Nl;if(o||s){let a=t.get(r);const l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new lf(e)),a=o?n.fromEquirectangular(r,a):n.fromCubemap(r,a),a.texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;if(void 0!==a)return a.texture;{const l=r.image;return o&&l&&l.height>0||s&&l&&function(e){let t=0;const n=6;for(let i=0;i<n;i++)void 0!==e[i]&&t++;return t===n}(l)?(null===n&&(n=new lf(e)),a=o?n.fromEquirectangular(r):n.fromCubemap(r),a.texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function mf(e){const t={};function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&Vc("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function gf(e,t,n,i){const r={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);for(const e in s.morphAttributes){const n=s.morphAttributes[e];for(let e=0,i=n.length;e<i;e++)t.remove(n[e])}s.removeEventListener("dispose",o),delete r[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],i=e.index,r=e.attributes.position;let o=0;if(null!==i){const e=i.array;o=i.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{if(void 0===r)return;{const e=r.array;o=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}}const s=new(zc(n)?Ud:Od)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",o),r[t.id]=!0,n.memory.geometries++),t},update:function(n){const i=n.attributes;for(const n in i)t.update(i[n],e.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)t.update(i[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function vf(e,t,n){let i,r,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(i,o,r,t*a,s),n.update(o,i,s))}this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(i,o,r,t*a),n.update(o,i,1)},this.renderInstances=o,this.renderMultiDraw=function(e,o,s){if(0===s)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<s;t++)this.render(e[t]/a,o[t]);else{l.multiDrawElementsWEBGL(i,o,0,r,e,0,s);let t=0;for(let e=0;e<s;e++)t+=o[e];n.update(t,i,1)}},this.renderMultiDrawInstances=function(e,s,l,c){if(0===l)return;const u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)o(e[t]/a,s[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(i,s,0,r,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=s[e];for(let e=0;e<c.length;e++)n.update(t,i,c[e])}}}function yf(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,i,r){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=r*(n/3);break;case e.LINES:t.lines+=r*(n/2);break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function xf(e,t,n){const i=new WeakMap,r=new iu;return{update:function(a,o,s){const l=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==c?c.length:0;let d=i.get(o);if(void 0===d||d.count!==u){void 0!==d&&d.texture.dispose();const h=void 0!==o.morphAttributes.position,f=void 0!==o.morphAttributes.normal,p=void 0!==o.morphAttributes.color,m=o.morphAttributes.position||[],g=o.morphAttributes.normal||[],v=o.morphAttributes.color||[];let y=0;!0===h&&(y=1),!0===f&&(y=2),!0===p&&(y=3);let x=o.attributes.position.count*y,_=1;x>t.maxTextureSize&&(_=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize);const b=new Float32Array(x*_*4*u),S=new ou(b,x,_,u);S.type=ql,S.needsUpdate=!0;const w=4*y;for(let E=0;E<u;E++){const T=m[E],A=g[E],C=v[E],R=x*_*4*E;for(let P=0;P<T.count;P++){const L=P*w;!0===h&&(r.fromBufferAttribute(T,P),b[R+L+0]=r.x,b[R+L+1]=r.y,b[R+L+2]=r.z,b[R+L+3]=0),!0===f&&(r.fromBufferAttribute(A,P),b[R+L+4]=r.x,b[R+L+5]=r.y,b[R+L+6]=r.z,b[R+L+7]=0),!0===p&&(r.fromBufferAttribute(C,P),b[R+L+8]=r.x,b[R+L+9]=r.y,b[R+L+10]=r.z,b[R+L+11]=4===C.itemSize?r.w:1)}}function M(){S.dispose(),i.delete(o),o.removeEventListener("dispose",M)}d={count:u,texture:S,size:new Ic(x,_)},i.set(o,d),o.addEventListener("dispose",M)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let k=0;for(let D=0;D<l.length;D++)k+=l[D];const N=o.morphTargetsRelative?1:1-k;s.getUniforms().setValue(e,"morphTargetBaseInfluence",N),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",d.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function _f(e,t,n,i){let r=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const s=i.render.frame,l=o.geometry,c=t.get(o,l);if(r.get(c)!==s&&(t.update(c),r.set(c,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),r.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),r.set(o,s))),o.isSkinnedMesh){const e=o.skeleton;r.get(e)!==s&&(e.update(),r.set(e,s))}return c},dispose:function(){r=new WeakMap}}}class bf extends nu{constructor(e,t,n,i,r,a,o,s,l,c=1026){if(c!==Ql&&c!==Jl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Ql&&(n=$l),void 0===n&&c===Jl&&(n=Zl),super(null,i,r,a,o,s,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:zl,this.minFilter=void 0!==s?s:zl,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 Sf=new nu,wf=new bf(1,1);wf.compareFunction=515;const Mf=new ou,Ef=new su,Tf=new Eh,Af=[],Cf=[],Rf=new Float32Array(16),Pf=new Float32Array(9),Lf=new Float32Array(4);function kf(e,t,n){const i=e[0];if(i<=0||i>0)return e;const r=t*n;let a=Af[r];if(void 0===a&&(a=new Float32Array(r),Af[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function Nf(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Df(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function If(e,t){let n=Cf[t];void 0===n&&(n=new Int32Array(t),Cf[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Of(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Uf(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(Nf(n,t))return;e.uniform2fv(this.addr,t),Df(n,t)}}function zf(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(Nf(n,t))return;e.uniform3fv(this.addr,t),Df(n,t)}}function Ff(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(Nf(n,t))return;e.uniform4fv(this.addr,t),Df(n,t)}}function Bf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Lf.set(i),e.uniformMatrix2fv(this.addr,!1,Lf),Df(n,i)}}function Hf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Pf.set(i),e.uniformMatrix3fv(this.addr,!1,Pf),Df(n,i)}}function Vf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Rf.set(i),e.uniformMatrix4fv(this.addr,!1,Rf),Df(n,i)}}function jf(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Gf(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(Nf(n,t))return;e.uniform2iv(this.addr,t),Df(n,t)}}function Wf(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(Nf(n,t))return;e.uniform3iv(this.addr,t),Df(n,t)}}function Xf(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(Nf(n,t))return;e.uniform4iv(this.addr,t),Df(n,t)}}function $f(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function qf(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(Nf(n,t))return;e.uniform2uiv(this.addr,t),Df(n,t)}}function Yf(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(Nf(n,t))return;e.uniform3uiv(this.addr,t),Df(n,t)}}function Zf(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(Nf(n,t))return;e.uniform4uiv(this.addr,t),Df(n,t)}}function Kf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r);const a=this.type===e.SAMPLER_2D_SHADOW?wf:Sf;n.setTexture2D(t||a,r)}function Qf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ef,r)}function Jf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||Tf,r)}function ep(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Mf,r)}function tp(e,t){e.uniform1fv(this.addr,t)}function np(e,t){const n=kf(t,this.size,2);e.uniform2fv(this.addr,n)}function ip(e,t){const n=kf(t,this.size,3);e.uniform3fv(this.addr,n)}function rp(e,t){const n=kf(t,this.size,4);e.uniform4fv(this.addr,n)}function ap(e,t){const n=kf(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function op(e,t){const n=kf(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function sp(e,t){const n=kf(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function lp(e,t){e.uniform1iv(this.addr,t)}function cp(e,t){e.uniform2iv(this.addr,t)}function up(e,t){e.uniform3iv(this.addr,t)}function dp(e,t){e.uniform4iv(this.addr,t)}function hp(e,t){e.uniform1uiv(this.addr,t)}function fp(e,t){e.uniform2uiv(this.addr,t)}function pp(e,t){e.uniform3uiv(this.addr,t)}function mp(e,t){e.uniform4uiv(this.addr,t)}function gp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture2D(t[e]||Sf,a[e])}function vp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture3D(t[e]||Ef,a[e])}function yp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTextureCube(t[e]||Tf,a[e])}function xp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||Mf,a[e])}class _p{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 Of;case 35664:return Uf;case 35665:return zf;case 35666:return Ff;case 35674:return Bf;case 35675:return Hf;case 35676:return Vf;case 5124:case 35670:return jf;case 35667:case 35671:return Gf;case 35668:case 35672:return Wf;case 35669:case 35673:return Xf;case 5125:return $f;case 36294:return qf;case 36295:return Yf;case 36296:return Zf;case 35678:case 36198:case 36298:case 36306:case 35682:return Kf;case 35679:case 36299:case 36307:return Qf;case 35680:case 36300:case 36308:case 36293:return Jf;case 36289:case 36303:case 36311:case 36292:return ep}}(t.type)}}class bp{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 tp;case 35664:return np;case 35665:return ip;case 35666:return rp;case 35674:return ap;case 35675:return op;case 35676:return sp;case 5124:case 35670:return lp;case 35667:case 35671:return cp;case 35668:case 35672:return up;case 35669:case 35673:return dp;case 5125:return hp;case 36294:return fp;case 36295:return pp;case 36296:return mp;case 35678:case 36198:case 36298:case 36306:case 35682:return gp;case 35679:case 36299:case 36307:return vp;case 35680:case 36300:case 36308:case 36293:return yp;case 36289:case 36303:case 36311:case 36292:return xp}}(t.type)}}class Sp{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const a=i[r];a.setValue(e,t[a.id],n)}}}const wp=/(\w+)(\])?(\[|\.)?/g;function Mp(e,t){e.seq.push(t),e.map[t.id]=t}function Ep(e,t,n){const i=e.name,r=i.length;for(wp.lastIndex=0;;){const a=wp.exec(i),o=wp.lastIndex;let s=a[1];const l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===r){Mp(n,void 0===c?new _p(s,e,t):new bp(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new Sp(s),Mp(n,e)),n=e}}}class Tp{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i);Ep(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,i){const r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const a=t[r],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const r=e[i];r.id in t&&n.push(r)}return n}}function Ap(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}const Cp=37297;let Rp=0;function Pp(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(i&&""===r)return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){const n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e<a;e++){const r=e+1;i.push(`${r===t?">":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return r}function Lp(e,t){const n=function(e){const t=$c.getPrimaries($c.workingColorSpace),n=$c.getPrimaries(e);let i;switch(t===n?i="":t===fc&&n===hc?i="LinearDisplayP3ToLinearSRGB":t===hc&&n===fc&&(i="LinearSRGBToLinearDisplayP3"),e){case sc:case cc:return[i,"LinearTransferOETF"];case oc:case lc:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[i,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function kp(e,t){let n;switch(t){case El:n="Linear";break;case Tl:n="Reinhard";break;case Al:n="OptimizedCineon";break;case Cl:n="ACESFilmic";break;case Pl:n="AgX";break;case Ll:n="Neutral";break;case Rl:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Np(e){return""!==e}function Dp(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 Ip(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Op=/^[ \t]*#include +<([\w\d./]+)>/gm;function Up(e){return e.replace(Op,Fp)}const zp=new Map;function Fp(e,t){let n=Uh[t];if(void 0===n){const e=zp.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=Uh[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return Up(n)}const Bp=/#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 Hp(e){return e.replace(Bp,Vp)}function Vp(e,t,n,i){let r="";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function jp(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;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 Gp(e,t,n,i){const r=e.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Ks?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===Qs?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Js&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case kl:case Nl:t="ENVMAP_TYPE_CUBE";break;case Dl:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===Nl&&(t="ENVMAP_MODE_REFRACTION");return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case bl:t="ENVMAP_BLENDING_MULTIPLY";break;case Sl:t="ENVMAP_BLENDING_MIX";break;case wl:t="ENVMAP_BLENDING_ADD"}return t}(n),h=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),f=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Np).join("\n")}(n),p=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(a),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Np).join("\n"),g.length>0&&(g+="\n"),v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Np).join("\n"),v.length>0&&(v+="\n")):(g=[jp(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",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?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#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.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#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","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Np).join("\n"),v=[jp(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",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 "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.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.dispersion?"#define USE_DISPERSION":"",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||n.batchingColor?"#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.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Ml?"#define TONE_MAPPING":"",n.toneMapping!==Ml?Uh.tonemapping_pars_fragment:"",n.toneMapping!==Ml?kp("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Uh.colorspace_pars_fragment,Lp("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Np).join("\n")),o=Up(o),o=Dp(o,n),o=Ip(o,n),s=Up(s),s=Dp(s,n),s=Ip(s,n),o=Hp(o),s=Hp(s),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===wc?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===wc?"":"#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 x=y+g+o,_=y+v+s,b=Ap(r,r.VERTEX_SHADER,x),S=Ap(r,r.FRAGMENT_SHADER,_);function w(t){if(e.debug.checkShaderErrors){const n=r.getProgramInfoLog(m).trim(),i=r.getShaderInfoLog(b).trim(),a=r.getShaderInfoLog(S).trim();let o=!0,s=!0;if(!1===r.getProgramParameter(m,r.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(r,m,b,S);else{const e=Pp(r,b,"vertex"),i=Pp(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==a||(s=!1);s&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:i,prefix:g},fragmentShader:{log:a,prefix:v}})}r.deleteShader(b),r.deleteShader(S),M=new Tp(r,m),E=function(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r),a=i.name;let o=1;i.type===e.FLOAT_MAT2&&(o=2),i.type===e.FLOAT_MAT3&&(o=3),i.type===e.FLOAT_MAT4&&(o=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}(r,m)}let M,E;r.attachShader(m,b),r.attachShader(m,S),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),this.getUniforms=function(){return void 0===M&&w(this),M},this.getAttributes=function(){return void 0===E&&w(this),E};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=r.getProgramParameter(m,Cp)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Rp++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=S,this}let Wp=0;class Xp{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.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 $p(e),t.set(e,n)),n}}class $p{constructor(e){this.id=Wp++,this.code=e,this.usedTimes=0}}function qp(e,t,n,i,r,a,o){const s=new Zu,l=new Xp,c=new Set,u=[],d=r.logarithmicDepthBuffer,h=r.vertexTextures;let f=r.precision;const p={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 c.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(a,s,u,g,v){const y=g.fog,x=v.geometry,_=a.isMeshStandardMaterial?g.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||_),S=b&&b.mapping===Dl?b.image.height:null,w=p[a.type];null!==a.precision&&(f=r.getMaxPrecision(a.precision),f!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead."));const M=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,E=void 0!==M?M.length:0;let T,A,C,R,P=0;if(void 0!==x.morphAttributes.position&&(P=1),void 0!==x.morphAttributes.normal&&(P=2),void 0!==x.morphAttributes.color&&(P=3),w){const e=Fh[w];T=e.vertexShader,A=e.fragmentShader}else T=a.vertexShader,A=a.fragmentShader,l.update(a),C=l.getVertexShaderID(a),R=l.getFragmentShaderID(a);const L=e.getRenderTarget(),k=!0===v.isInstancedMesh,N=!0===v.isBatchedMesh,D=!!a.map,I=!!a.matcap,O=!!b,U=!!a.aoMap,z=!!a.lightMap,F=!!a.bumpMap,B=!!a.normalMap,H=!!a.displacementMap,V=!!a.emissiveMap,j=!!a.metalnessMap,G=!!a.roughnessMap,W=a.anisotropy>0,X=a.clearcoat>0,$=a.dispersion>0,q=a.iridescence>0,Y=a.sheen>0,Z=a.transmission>0,K=W&&!!a.anisotropyMap,Q=X&&!!a.clearcoatMap,J=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,te=q&&!!a.iridescenceMap,ne=q&&!!a.iridescenceThicknessMap,ie=Y&&!!a.sheenColorMap,re=Y&&!!a.sheenRoughnessMap,ae=!!a.specularMap,oe=!!a.specularColorMap,se=!!a.specularIntensityMap,le=Z&&!!a.transmissionMap,ce=Z&&!!a.thicknessMap,ue=!!a.gradientMap,de=!!a.alphaMap,he=a.alphaTest>0,fe=!!a.alphaHash,pe=!!a.extensions;let me=Ml;a.toneMapped&&(null!==L&&!0!==L.isXRRenderTarget||(me=e.toneMapping));const ge={shaderID:w,shaderType:a.type,shaderName:a.name,vertexShader:T,fragmentShader:A,defines:a.defines,customVertexShaderID:C,customFragmentShaderID:R,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:N,batchingColor:N&&null!==v._colorsTexture,instancing:k,instancingColor:k&&null!==v.instanceColor,instancingMorph:k&&null!==v.morphTexture,supportsVertexTextures:h,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:sc,alphaToCoverage:!!a.alphaToCoverage,map:D,matcap:I,envMap:O,envMapMode:O&&b.mapping,envMapCubeUVHeight:S,aoMap:U,lightMap:z,bumpMap:F,normalMap:B,displacementMap:h&&H,emissiveMap:V,normalMapObjectSpace:B&&1===a.normalMapType,normalMapTangentSpace:B&&0===a.normalMapType,metalnessMap:j,roughnessMap:G,anisotropy:W,anisotropyMap:K,clearcoat:X,clearcoatMap:Q,clearcoatNormalMap:J,clearcoatRoughnessMap:ee,dispersion:$,iridescence:q,iridescenceMap:te,iridescenceThicknessMap:ne,sheen:Y,sheenColorMap:ie,sheenRoughnessMap:re,specularMap:ae,specularColorMap:oe,specularIntensityMap:se,transmission:Z,transmissionMap:le,thicknessMap:ce,gradientMap:ue,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:de,alphaTest:he,alphaHash:fe,combine:a.combine,mapUv:D&&m(a.map.channel),aoMapUv:U&&m(a.aoMap.channel),lightMapUv:z&&m(a.lightMap.channel),bumpMapUv:F&&m(a.bumpMap.channel),normalMapUv:B&&m(a.normalMap.channel),displacementMapUv:H&&m(a.displacementMap.channel),emissiveMapUv:V&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:G&&m(a.roughnessMap.channel),anisotropyMapUv:K&&m(a.anisotropyMap.channel),clearcoatMapUv:Q&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:J&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ne&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:ie&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:re&&m(a.sheenRoughnessMap.channel),specularMapUv:ae&&m(a.specularMap.channel),specularColorMapUv:oe&&m(a.specularColorMap.channel),specularIntensityMapUv:se&&m(a.specularIntensityMap.channel),transmissionMapUv:le&&m(a.transmissionMap.channel),thicknessMapUv:ce&&m(a.thicknessMap.channel),alphaMapUv:de&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(B||W),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!x.attributes.uv&&(D||de),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:E,morphTextureStride:P,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:me,decodeVideoTexture:D&&!0===a.map.isVideoTexture&&$c.getTransfer(a.map.colorSpace)===dc,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===tl,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:pe&&!0===a.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:pe&&!0===a.extensions.multiDraw&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ge.vertexUv1s=c.has(1),ge.vertexUv2s=c.has(2),ge.vertexUv3s=c.has(3),c.clear(),ge},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){s.disableAll(),t.supportsVertexTextures&&s.enable(0);t.instancing&&s.enable(1);t.instancingColor&&s.enable(2);t.instancingMorph&&s.enable(3);t.matcap&&s.enable(4);t.envMap&&s.enable(5);t.normalMapObjectSpace&&s.enable(6);t.normalMapTangentSpace&&s.enable(7);t.clearcoat&&s.enable(8);t.iridescence&&s.enable(9);t.alphaTest&&s.enable(10);t.vertexColors&&s.enable(11);t.vertexAlphas&&s.enable(12);t.vertexUv1s&&s.enable(13);t.vertexUv2s&&s.enable(14);t.vertexUv3s&&s.enable(15);t.vertexTangents&&s.enable(16);t.anisotropy&&s.enable(17);t.alphaHash&&s.enable(18);t.batching&&s.enable(19);t.dispersion&&s.enable(20);t.batchingColor&&s.enable(21);e.push(s.mask),s.disableAll(),t.fog&&s.enable(0);t.useFog&&s.enable(1);t.flatShading&&s.enable(2);t.logarithmicDepthBuffer&&s.enable(3);t.skinning&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.morphColors&&s.enable(7);t.premultipliedAlpha&&s.enable(8);t.shadowMapEnabled&&s.enable(9);t.doubleSided&&s.enable(10);t.flipSided&&s.enable(11);t.useDepthPacking&&s.enable(12);t.dithering&&s.enable(13);t.transmission&&s.enable(14);t.sheen&&s.enable(15);t.opaque&&s.enable(16);t.pointsUvs&&s.enable(17);t.decodeVideoTexture&&s.enable(18);t.alphaToCoverage&&s.enable(19);e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=p[e.type];let n;if(t){const e=Fh[t];n=gh.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=u.length;e<t;e++){const t=u[e];if(t.cacheKey===n){i=t,++i.usedTimes;break}}return void 0===i&&(i=new Gp(e,n,t,a),u.push(i)),i},releaseProgram:function(e){if(0==--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function Yp(){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,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function Zp(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 Kp(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 Qp(){const e=[];let t=0;const n=[],i=[],r=[];function a(n,i,r,a,o,s){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?i.push(u):!0===o.transparent?r.push(u):n.push(u)},unshift:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?i.unshift(u):!0===o.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=t,i=e.length;n<i;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||Zp),i.length>1&&i.sort(t||Kp),r.length>1&&r.sort(t||Kp)}}}function Jp(){let e=new WeakMap;return{get:function(t,n){const i=e.get(t);let r;return void 0===i?(r=new Qp,e.set(t,[r])):n>=i.length?(r=new Qp,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function em(){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 cu,color:new Cd};break;case"SpotLight":n={position:new cu,direction:new cu,color:new Cd,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new cu,color:new Cd,distance:0,decay:0};break;case"HemisphereLight":n={direction:new cu,skyColor:new Cd,groundColor:new Cd};break;case"RectAreaLight":n={color:new Cd,position:new cu,halfWidth:new cu,halfHeight:new cu}}return e[t.id]=n,n}}}let tm=0;function nm(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function im(e){const t=new em,n=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 Ic};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ic,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 cu);const r=new cu,a=new Fu,o=new Fu;return{setup:function(r){let a=0,o=0,s=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let l=0,c=0,u=0,d=0,h=0,f=0,p=0,m=0,g=0,v=0,y=0;r.sort(nm);for(let e=0,x=r.length;e<x;e++){const x=r[e],_=x.color,b=x.intensity,S=x.distance,w=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)a+=_.r*b,o+=_.g*b,s+=_.b*b;else if(x.isLightProbe){for(let e=0;e<9;e++)i.probe[e].addScaledVector(x.sh.coefficients[e],b);y++}else if(x.isDirectionalLight){const e=t.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),x.castShadow){const e=x.shadow,t=n.get(x);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,i.directionalShadow[l]=t,i.directionalShadowMap[l]=w,i.directionalShadowMatrix[l]=x.shadow.matrix,f++}i.directional[l]=e,l++}else if(x.isSpotLight){const e=t.get(x);e.position.setFromMatrixPosition(x.matrixWorld),e.color.copy(_).multiplyScalar(b),e.distance=S,e.coneCos=Math.cos(x.angle),e.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),e.decay=x.decay,i.spot[u]=e;const r=x.shadow;if(x.map&&(i.spotLightMap[g]=x.map,g++,r.updateMatrices(x),x.castShadow&&v++),i.spotLightMatrix[u]=r.matrix,x.castShadow){const e=n.get(x);e.shadowBias=r.bias,e.shadowNormalBias=r.normalBias,e.shadowRadius=r.radius,e.shadowMapSize=r.mapSize,i.spotShadow[u]=e,i.spotShadowMap[u]=w,m++}u++}else if(x.isRectAreaLight){const e=t.get(x);e.color.copy(_).multiplyScalar(b),e.halfWidth.set(.5*x.width,0,0),e.halfHeight.set(0,.5*x.height,0),i.rectArea[d]=e,d++}else if(x.isPointLight){const e=t.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),e.distance=x.distance,e.decay=x.decay,x.castShadow){const e=x.shadow,t=n.get(x);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,i.pointShadow[c]=t,i.pointShadowMap[c]=w,i.pointShadowMatrix[c]=x.shadow.matrix,p++}i.point[c]=e,c++}else if(x.isHemisphereLight){const e=t.get(x);e.skyColor.copy(x.color).multiplyScalar(b),e.groundColor.copy(x.groundColor).multiplyScalar(b),i.hemi[h]=e,h++}}d>0&&(!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=zh.LTC_FLOAT_1,i.rectAreaLTC2=zh.LTC_FLOAT_2):(i.rectAreaLTC1=zh.LTC_HALF_1,i.rectAreaLTC2=zh.LTC_HALF_2)),i.ambient[0]=a,i.ambient[1]=o,i.ambient[2]=s;const x=i.hash;x.directionalLength===l&&x.pointLength===c&&x.spotLength===u&&x.rectAreaLength===d&&x.hemiLength===h&&x.numDirectionalShadows===f&&x.numPointShadows===p&&x.numSpotShadows===m&&x.numSpotMaps===g&&x.numLightProbes===y||(i.directional.length=l,i.spot.length=u,i.rectArea.length=d,i.point.length=c,i.hemi.length=h,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=p,i.spotLightMatrix.length=m+g-v,i.spotLightMap.length=g,i.numSpotLightShadowsWithMaps=v,i.numLightProbes=y,x.directionalLength=l,x.pointLength=c,x.spotLength=u,x.rectAreaLength=d,x.hemiLength=h,x.numDirectionalShadows=f,x.numPointShadows=p,x.numSpotShadows=m,x.numSpotMaps=g,x.numLightProbes=y,i.version=tm++)},setupView:function(e,t){let n=0,s=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),n++}else if(h.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),l++}else if(h.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(h.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(h.isPointLight){const e=i.point[s];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),s++}else if(h.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(d),u++}}},state:i}}function rm(e){const t=new im(e),n=[],i=[];const r={lightsArray:n,shadowsArray:i,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){r.camera=e,n.length=0,i.length=0},state:r,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function am(e){let t=new WeakMap;return{get:function(n,i=0){const r=t.get(n);let a;return void 0===r?(a=new rm(e),t.set(n,[a])):i>=r.length?(a=new rm(e),r.push(a)):a=r[i],a},dispose:function(){t=new WeakMap}}}class om extends Ld{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 sm extends Ld{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 lm(e,t,n){let i=new Nh;const r=new Ic,a=new Ic,o=new iu,s=new om({depthPacking:3201}),l=new sm,c={},u=n.maxTextureSize,d={[el]:tl,[tl]:el,[nl]:2},h=new vh({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ic},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}"}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const p=new Xd;p.setAttribute("position",new Id(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new uh(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ks;let v=this.type;function y(n,i){const a=t.update(m);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new au(r.x,r.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,a,h,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,a,f,m,null)}function x(t,n,i,r){let a=null;const o=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===i.isPointLight?l:s,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=a.uuid,t=n.uuid;let i=c[e];void 0===i&&(i={},c[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",b)),a=r}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=r===Js?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=i}return a}function _(n,r,a,o,s){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===Js)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const i=t.update(n),l=n.material;if(Array.isArray(l)){const t=i.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],d=l[u.materialIndex];if(d&&d.visible){const t=x(n,d,o,s);n.onBeforeShadow(e,n,r,a,i,t,u),e.renderBufferDirect(a,null,i,t,n,u),n.onAfterShadow(e,n,r,a,i,t,u)}}}else if(l.visible){const t=x(n,l,o,s);n.onBeforeShadow(e,n,r,a,i,t,null),e.renderBufferDirect(a,null,i,t,n,null),n.onAfterShadow(e,n,r,a,i,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)_(l[e],r,a,o,s)}function b(e){e.target.removeEventListener("dispose",b);for(const t in c){const n=c[t],i=e.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(t,n,s){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(),d=e.getActiveMipmapLevel(),h=e.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const f=v!==Js&&this.type===Js,p=v===Js&&this.type!==Js;for(let l=0,c=t.length;l<c;l++){const c=t[l],d=c.shadow;if(void 0===d){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===d.autoUpdate&&!1===d.needsUpdate)continue;r.copy(d.mapSize);const m=d.getFrameExtents();if(r.multiply(m),a.copy(d.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/m.x),r.x=a.x*m.x,d.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/m.y),r.y=a.y*m.y,d.mapSize.y=a.y)),null===d.map||!0===f||!0===p){const e=this.type!==Js?{minFilter:zl,magFilter:zl}:{};null!==d.map&&d.map.dispose(),d.map=new au(r.x,r.y,e),d.map.texture.name=c.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const g=d.getViewportCount();for(let e=0;e<g;e++){const t=d.getViewport(e);o.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),h.viewport(o),d.updateMatrices(c,e),i=d.getFrustum(),_(n,s,d.camera,c,this.type)}!0!==d.isPointLightShadow&&this.type===Js&&y(d,s),d.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(l,c,d)}}function cm(e){const t=new function(){let t=!1;const n=new iu;let i=null;const r=new iu(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},n=new function(){let t=!1,n=null,i=null,r=null;return{setTest:function(t){t?F(e.DEPTH_TEST):B(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==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)}i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},i=new function(){let t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(n){t||(n?F(e.STENCIL_TEST):B(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&l===i||(e.stencilOp(t,n,i),o=t,s=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null}}},r=new WeakMap,a=new WeakMap;let o={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,f=null,p=null,m=null,g=null,v=null,y=null,x=new Cd(0,0,0),_=0,b=!1,S=null,w=null,M=null,E=null,T=null;const A=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let C=!1,R=0;const P=e.getParameter(e.VERSION);-1!==P.indexOf("WebGL")?(R=parseFloat(/^WebGL (\d)/.exec(P)[1]),C=R>=1):-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1]),C=R>=2);let L=null,k={};const N=e.getParameter(e.SCISSOR_BOX),D=e.getParameter(e.VIEWPORT),I=(new iu).fromArray(N),O=(new iu).fromArray(D);function U(t,n,i,r){const a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<i;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const z={};function F(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function B(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}z[e.TEXTURE_2D]=U(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=U(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),z[e.TEXTURE_2D_ARRAY]=U(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=U(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),i.setClear(0),F(e.DEPTH_TEST),n.setFunc(3),G(!1),W(1),F(e.CULL_FACE),j(0);const H={[il]:e.FUNC_ADD,[rl]:e.FUNC_SUBTRACT,[al]:e.FUNC_REVERSE_SUBTRACT};H[103]=e.MIN,H[104]=e.MAX;const V={[ol]:e.ZERO,[sl]:e.ONE,[ll]:e.SRC_COLOR,[ul]:e.SRC_ALPHA,[gl]:e.SRC_ALPHA_SATURATE,[pl]:e.DST_COLOR,[hl]:e.DST_ALPHA,[cl]:e.ONE_MINUS_SRC_COLOR,[dl]:e.ONE_MINUS_SRC_ALPHA,[ml]:e.ONE_MINUS_DST_COLOR,[fl]:e.ONE_MINUS_DST_ALPHA,[vl]:e.CONSTANT_COLOR,[yl]:e.ONE_MINUS_CONSTANT_COLOR,[xl]:e.CONSTANT_ALPHA,[_l]:e.ONE_MINUS_CONSTANT_ALPHA};function j(t,n,i,r,a,o,s,l,c,u){if(0!==t){if(!1===d&&(F(e.BLEND),d=!0),5===t)a=a||n,o=o||i,s=s||r,n===f&&a===g||(e.blendEquationSeparate(H[n],H[a]),f=n,g=a),i===p&&r===m&&o===v&&s===y||(e.blendFuncSeparate(V[i],V[r],V[o],V[s]),p=i,m=r,v=o,y=s),!1!==l.equals(x)&&c===_||(e.blendColor(l.r,l.g,l.b,c),x.copy(l),_=c),h=t,b=!1;else if(t!==h||u!==b){if(f===il&&g===il||(e.blendEquation(e.FUNC_ADD),f=il,g=il),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)}p=null,m=null,v=null,y=null,x.set(0,0,0),_=0,h=t,b=u}}else!0===d&&(B(e.BLEND),d=!1)}function G(t){S!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),S=t)}function W(t){0!==t?(F(e.CULL_FACE),t!==w&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):B(e.CULL_FACE),w=t}function X(t,n,i){t?(F(e.POLYGON_OFFSET_FILL),E===n&&T===i||(e.polygonOffset(n,i),E=n,T=i)):B(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:i},enable:F,disable:B,bindFramebuffer:function(t,n){return s[t]!==n&&(e.bindFramebuffer(t,n),s[t]=n,t===e.DRAW_FRAMEBUFFER&&(s[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(s[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let i=c,r=!1;if(t){i=l.get(n),void 0===i&&(i=[],l.set(n,i));const a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:j,setMaterial:function(r,a){2===r.side?B(e.CULL_FACE):F(e.CULL_FACE);let o=r.side===tl;a&&(o=!o),G(o),1===r.blending&&!1===r.transparent?j(0):j(r.blending,r.blendEquation,r.blendSrc,r.blendDst,r.blendEquationAlpha,r.blendSrcAlpha,r.blendDstAlpha,r.blendColor,r.blendAlpha,r.premultipliedAlpha),n.setFunc(r.depthFunc),n.setTest(r.depthTest),n.setMask(r.depthWrite),t.setMask(r.colorWrite);const s=r.stencilWrite;i.setTest(s),s&&(i.setMask(r.stencilWriteMask),i.setFunc(r.stencilFunc,r.stencilRef,r.stencilFuncMask),i.setOp(r.stencilFail,r.stencilZFail,r.stencilZPass)),X(r.polygonOffset,r.polygonOffsetFactor,r.polygonOffsetUnits),!0===r.alphaToCoverage?F(e.SAMPLE_ALPHA_TO_COVERAGE):B(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:G,setCullFace:W,setLineWidth:function(t){t!==M&&(C&&e.lineWidth(t),M=t)},setPolygonOffset:X,setScissorTest:function(t){t?F(e.SCISSOR_TEST):B(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+A-1),L!==t&&(e.activeTexture(t),L=t)},bindTexture:function(t,n,i){void 0===i&&(i=null===L?e.TEXTURE0+A-1:L);let r=k[i];void 0===r&&(r={type:void 0,texture:void 0},k[i]=r),r.type===t&&r.texture===n||(L!==i&&(e.activeTexture(i),L=i),e.bindTexture(t,n||z[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=k[L];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 i=a.get(n);void 0===i&&(i=new WeakMap,a.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function(t,n){const i=a.get(n).get(t);r.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),r.set(n,i))},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===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===O.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),O.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),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),o={},L=null,k={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,f=null,p=null,m=null,g=null,v=null,y=null,x=new Cd(0,0,0),_=0,b=!1,S=null,w=null,M=null,E=null,T=null,I.set(0,0,e.canvas.width,e.canvas.height),O.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),i.reset()}}}function um(e,t,n,i,r,a,o){const s=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Ic,u=new WeakMap;let d;const h=new WeakMap;let f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return f?new OffscreenCanvas(e,t):Fc("canvas")}function m(e,t,n){let i=1;const r=B(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===d&&(d=p(n,a));const o=t?p(n,a):d;o.width=n,o.height=a;return o.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==zl&&e.minFilter!==Hl}function v(t){e.generateMipmap(t)}function y(n,i,r,a,o=!1){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 s=i;if(i===e.RED&&(r===e.FLOAT&&(s=e.R32F),r===e.HALF_FLOAT&&(s=e.R16F),r===e.UNSIGNED_BYTE&&(s=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(s=e.R8UI),r===e.UNSIGNED_SHORT&&(s=e.R16UI),r===e.UNSIGNED_INT&&(s=e.R32UI),r===e.BYTE&&(s=e.R8I),r===e.SHORT&&(s=e.R16I),r===e.INT&&(s=e.R32I)),i===e.RG&&(r===e.FLOAT&&(s=e.RG32F),r===e.HALF_FLOAT&&(s=e.RG16F),r===e.UNSIGNED_BYTE&&(s=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(s=e.RG8UI),r===e.UNSIGNED_SHORT&&(s=e.RG16UI),r===e.UNSIGNED_INT&&(s=e.RG32UI),r===e.BYTE&&(s=e.RG8I),r===e.SHORT&&(s=e.RG16I),r===e.INT&&(s=e.RG32I)),i===e.RGB&&r===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.RGBA){const t=o?uc:$c.getTransfer(a);r===e.FLOAT&&(s=e.RGBA32F),r===e.HALF_FLOAT&&(s=e.RGBA16F),r===e.UNSIGNED_BYTE&&(s=t===dc?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return s!==e.R16F&&s!==e.R32F&&s!==e.RG16F&&s!==e.RG32F&&s!==e.RGBA16F&&s!==e.RGBA32F||t.get("EXT_color_buffer_float"),s}function x(t,n){let i;return t?null===n||n===$l||n===Zl?i=e.DEPTH24_STENCIL8:n===ql?i=e.DEPTH32F_STENCIL8:n===Wl&&(i=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===$l||n===Zl?i=e.DEPTH_COMPONENT24:n===ql?i=e.DEPTH_COMPONENT32F:n===Wl&&(i=e.DEPTH_COMPONENT16),i}function _(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==zl&&e.minFilter!==Hl?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 b(e){const t=e.target;t.removeEventListener("dispose",b),function(e){const t=i.get(e);if(void 0===t.__webglInit)return;const n=e.source,r=h.get(n);if(r){const i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&w(e),0===Object.keys(r).length&&h.delete(n)}i.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=i.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i<n.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(n.__webglFramebuffer[t][i]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=t.textures;for(let t=0,n=r.length;t<n;t++){const n=i.get(r[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),i.remove(r[t])}i.remove(t)}(n)}function w(t){const n=i.get(t);e.deleteTexture(n.__webglTexture);const r=t.source;delete h.get(r)[n.__cacheKey],o.memory.textures--}let M=0;function E(t,r){const a=i.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__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 L(a,t,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+r)}const T={[Il]:e.REPEAT,[Ol]:e.CLAMP_TO_EDGE,[Ul]:e.MIRRORED_REPEAT},A={[zl]:e.NEAREST,[Fl]:e.NEAREST_MIPMAP_NEAREST,[Bl]:e.NEAREST_MIPMAP_LINEAR,[Hl]:e.LINEAR,[Vl]:e.LINEAR_MIPMAP_NEAREST,[jl]:e.LINEAR_MIPMAP_LINEAR},C={[mc]:e.NEVER,[Sc]:e.ALWAYS,[gc]:e.LESS,[yc]:e.LEQUAL,[vc]:e.EQUAL,[bc]:e.GEQUAL,[xc]:e.GREATER,[_c]:e.NOTEQUAL};function R(n,a){if(a.type!==ql||!1!==t.has("OES_texture_float_linear")||a.magFilter!==Hl&&a.magFilter!==Vl&&a.magFilter!==Bl&&a.magFilter!==jl&&a.minFilter!==Hl&&a.minFilter!==Vl&&a.minFilter!==Bl&&a.minFilter!==jl||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(a.magFilter===zl)return;if(a.minFilter!==Bl&&a.minFilter!==jl)return;if(a.type===ql&&!1===t.has("OES_texture_float_linear"))return;if(a.anisotropy>1||i.get(a).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}}function P(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));const r=n.source;let a=h.get(r);void 0===a&&(a={},h.set(r,a));const s=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(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,i=!0),a[s].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&w(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return i}function L(t,o,s){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=P(t,o),u=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+s);const t=$c.getPrimaries($c.workingColorSpace),i=o.colorSpace===ac?null:$c.getPrimaries(o.colorSpace),h=o.colorSpace===ac||t===i?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);let f=m(o.image,!1,r.maxTextureSize);f=F(o,f);const p=a.convert(o.format,o.colorSpace),b=a.convert(o.type);let S,w=y(o.internalFormat,p,b,o.colorSpace,o.isVideoTexture);R(l,o);const M=o.mipmaps,E=!0!==o.isVideoTexture,T=void 0===d.__version||!0===c,A=u.dataReady,C=_(o,f);if(o.isDepthTexture)w=x(o.format===Jl,o.type),T&&(E?n.texStorage2D(e.TEXTURE_2D,1,w,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,w,f.width,f.height,0,p,b,null));else if(o.isDataTexture)if(M.length>0){E&&T&&n.texStorage2D(e.TEXTURE_2D,C,w,M[0].width,M[0].height);for(let t=0,i=M.length;t<i;t++)S=M[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,b,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,p,b,S.data);o.generateMipmaps=!1}else E?(T&&n.texStorage2D(e.TEXTURE_2D,C,w,f.width,f.height),A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,p,b,f.data)):n.texImage2D(e.TEXTURE_2D,0,w,f.width,f.height,0,p,b,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){E&&T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,w,M[0].width,M[0].height,f.depth);for(let t=0,i=M.length;t<i;t++)if(S=M[t],o.format!==Kl)if(null!==p)if(E){if(A)if(o.layerUpdates.size>0){for(const i of o.layerUpdates){const r=S.width*S.height;n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,S.width,S.height,1,p,S.data.slice(r*i,r*(i+1)),0,0)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,S.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,f.depth,0,S.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,b,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,f.depth,0,p,b,S.data)}else{E&&T&&n.texStorage2D(e.TEXTURE_2D,C,w,M[0].width,M[0].height);for(let t=0,i=M.length;t<i;t++)S=M[t],o.format!==Kl?null!==p?E?A&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,S.data):n.compressedTexImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,b,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,p,b,S.data)}else if(o.isDataArrayTexture)if(E){if(T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,w,f.width,f.height,f.depth),A)if(o.layerUpdates.size>0){let t;switch(b){case e.UNSIGNED_BYTE:switch(p){case e.ALPHA:case e.LUMINANCE:t=1;break;case e.LUMINANCE_ALPHA:t=2;break;case e.RGB:t=3;break;case e.RGBA:t=4;break;default:throw new Error(`Unknown texel size for format ${p}.`)}break;case e.UNSIGNED_SHORT_4_4_4_4:case e.UNSIGNED_SHORT_5_5_5_1:case e.UNSIGNED_SHORT_5_6_5:t=1;break;default:throw new Error(`Unknown texel size for type ${b}.`)}const i=f.width*f.height*t;for(const t of o.layerUpdates)n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,t,f.width,f.height,1,p,b,f.data.slice(i*t,i*(t+1)));o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,p,b,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,w,f.width,f.height,f.depth,0,p,b,f.data);else if(o.isData3DTexture)E?(T&&n.texStorage3D(e.TEXTURE_3D,C,w,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,p,b,f.data)):n.texImage3D(e.TEXTURE_3D,0,w,f.width,f.height,f.depth,0,p,b,f.data);else if(o.isFramebufferTexture){if(T)if(E)n.texStorage2D(e.TEXTURE_2D,C,w,f.width,f.height);else{let t=f.width,i=f.height;for(let r=0;r<C;r++)n.texImage2D(e.TEXTURE_2D,r,w,t,i,0,p,b,null),t>>=1,i>>=1}}else if(M.length>0){if(E&&T){const t=B(M[0]);n.texStorage2D(e.TEXTURE_2D,C,w,t.width,t.height)}for(let t=0,i=M.length;t<i;t++)S=M[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,p,b,S):n.texImage2D(e.TEXTURE_2D,t,w,p,b,S);o.generateMipmaps=!1}else if(E){if(T){const t=B(f);n.texStorage2D(e.TEXTURE_2D,C,w,t.width,t.height)}A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p,b,f)}else n.texImage2D(e.TEXTURE_2D,0,w,p,b,f);g(o)&&v(l),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function k(t,r,o,l,c,u){const d=a.convert(o.format,o.colorSpace),h=a.convert(o.type),f=y(o.internalFormat,d,h,o.colorSpace);if(!i.get(r).__hasExternalTextures){const t=Math.max(1,r.width>>u),i=Math.max(1,r.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,f,t,i,r.depth,0,d,h,null):n.texImage2D(c,u,f,t,i,0,d,h,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,i.get(o).__webglTexture,0,U(r)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,i.get(o).__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function N(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,o=x(n.stencilBuffer,a),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=U(n);z(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let r=0;r<t.length;r++){const o=t[r],l=a.convert(o.format,o.colorSpace),c=a.convert(o.type),u=y(o.internalFormat,l,c,o.colorSpace),d=U(n);i&&!1===z(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,d,u,n.width,n.height):z(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,d,u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function D(t){const r=i.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!r.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),E(r.depthTexture,0);const a=i.get(r.depthTexture).__webglTexture,o=U(r);if(r.depthTexture.format===Ql)z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(r.depthTexture.format!==Jl)throw new Error("Unknown depthTexture format");z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(r.__webglFramebuffer,t)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=e.createRenderbuffer(),N(r.__webglDepthbuffer[i],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),N(r.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}const I=[],O=[];function U(e){return Math.min(r.maxSamples,e.samples)}function z(e){const n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function F(e,t){const n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==sc&&n!==ac&&($c.getTransfer(n)===dc?i===Kl&&r===Gl||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function B(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=M;return e>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=E,this.setTexture2DArray=function(t,r){const a=i.get(t);t.version>0&&a.__version!==t.version?L(a,t,r):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r)},this.setTexture3D=function(t,r){const a=i.get(t);t.version>0&&a.__version!==t.version?L(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,o){const s=i.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(6!==o.image.length)return;const l=P(t,o),c=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const u=i.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+s);const t=$c.getPrimaries($c.workingColorSpace),i=o.colorSpace===ac?null:$c.getPrimaries(o.colorSpace),d=o.colorSpace===ac||t===i?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const h=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=h||f?f?o.image[e].image:o.image[e]:m(o.image[e],!0,r.maxCubemapSize),p[e]=F(o,p[e]);const x=p[0],b=a.convert(o.format,o.colorSpace),S=a.convert(o.type),w=y(o.internalFormat,b,S,o.colorSpace),M=!0!==o.isVideoTexture,E=void 0===u.__version||!0===l,T=c.dataReady;let A,C=_(o,x);if(R(e.TEXTURE_CUBE_MAP,o),h){M&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,x.width,x.height);for(let t=0;t<6;t++){A=p[t].mipmaps;for(let i=0;i<A.length;i++){const r=A[i];o.format!==Kl?null!==b?M?T&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,0,0,r.width,r.height,b,r.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,w,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,0,0,r.width,r.height,b,S,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,w,r.width,r.height,0,b,S,r.data)}}}else{if(A=o.mipmaps,M&&E){A.length>0&&C++;const t=B(p[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,t.width,t.height)}for(let t=0;t<6;t++)if(f){M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,b,S,p[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,p[t].width,p[t].height,0,b,S,p[t].data);for(let i=0;i<A.length;i++){const r=A[i].image[t].image;M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,r.width,r.height,b,S,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,r.width,r.height,0,b,S,r.data)}}else{M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,b,S,p[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,b,S,p[t]);for(let i=0;i<A.length;i++){const r=A[i];M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,b,S,r.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,b,S,r.image[t])}}}g(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(s,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,r){const a=i.get(t);void 0!==n&&k(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==r&&D(t)},this.setupRenderTarget=function(t){const r=t.texture,s=i.get(t),l=i.get(r);t.addEventListener("dispose",S);const c=t.textures,u=!0===t.isWebGLCubeRenderTarget,d=c.length>1;if(d||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<r.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<r.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=c.length;t<n;t++){const n=i.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===z(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const i=c[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);const r=a.convert(i.format,i.colorSpace),o=a.convert(i.type),l=y(i.internalFormat,r,o,i.colorSpace,!0===t.isXRRenderTarget),u=U(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),N(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(e.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)k(s.__webglFramebuffer[n][i],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else k(s.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(r)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let r=0,a=c.length;r<a;r++){const a=c[r],o=i.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),R(e.TEXTURE_2D,a),k(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+r,e.TEXTURE_2D,0),g(a)&&v(e.TEXTURE_2D)}n.unbindTexture()}else{let i=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(i=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),R(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)k(s.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,i,n);else k(s.__webglFramebuffer,t,r,e.COLOR_ATTACHMENT0,i,0);g(r)&&v(i),n.unbindTexture()}t.depthBuffer&&D(t)},this.updateRenderTargetMipmap=function(t){const r=t.textures;for(let a=0,o=r.length;a<o;a++){const o=r[a];if(g(o)){const r=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=i.get(o).__webglTexture;n.bindTexture(r,a),v(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===z(t)){const r=t.textures,a=t.width,o=t.height;let s=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=i.get(t),d=r.length>1;if(d)for(let t=0;t<r.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<r.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const t=i.get(r[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),!0===l&&(I.length=0,O.length=0,I.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(I.push(c),O.push(c),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,O)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,I))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<r.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=i.get(r[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=D,this.setupFrameBufferTexture=k,this.useMultisampledRTT=z}function dm(e,t){return{convert:function(n,i=""){let r;const a=$c.getTransfer(i);if(n===Gl)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===Wl)return e.UNSIGNED_SHORT;if(n===Xl)return e.INT;if(n===$l)return e.UNSIGNED_INT;if(n===ql)return e.FLOAT;if(n===Yl)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(n===Kl)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===Ql)return e.DEPTH_COMPONENT;if(n===Jl)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(n===ec||n===tc||n===nc||n===ic)if(a===dc){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===ec)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===tc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===nc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ic)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===ec)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===tc)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===nc)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ic)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(36196===n||37492===n)return a===dc?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(37496===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(37808===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===rc||36494===n||36495===n){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(n===rc)return a===dc?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===rc)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Zl?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class hm extends Sh{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class fm extends hd{constructor(){super(),this.isGroup=!0,this.type="Group"}}const pm={type:"move"};class mm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new fm,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 fm,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new cu,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new cu),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new fm,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new cu,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new cu),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 i=null,r=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=i.position.distanceTo(r.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),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));null!==o&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(pm)))}return null!==o&&(o.visible=null!==i),null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new fm;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class gm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const i=new nu;e.properties.get(i).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new vh({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new uh(new Oh(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}}class vm extends Tc{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",s=1,l=null,c=null,u=null,d=null,h=null,f=null;const p=new gm,m=t.getContextAttributes();let g=null,v=null;const y=[],x=[],_=new Ic;let b=null;const S=new Sh;S.layers.enable(1),S.viewport=new iu;const w=new Sh;w.layers.enable(2),w.viewport=new iu;const M=[S,w],E=new hm;E.layers.enable(1),E.layers.enable(2);let T=null,A=null;function C(e){const t=x.indexOf(e.inputSource);if(-1===t)return;const n=y[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function R(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",R),i.removeEventListener("inputsourceschange",P);for(let e=0;e<y.length;e++){const t=x[e];null!==t&&(x[e]=null,y[e].disconnect(t))}T=null,A=null,p.reset(),e.setRenderTarget(g),h=null,d=null,u=null,i=null,v=null,I.stop(),n.isPresenting=!1,e.setPixelRatio(b),e.setSize(_.width,_.height,!1),n.dispatchEvent({type:"sessionend"})}function P(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],i=x.indexOf(n);i>=0&&(x[i]=null,y[i].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let i=x.indexOf(n);if(-1===i){for(let e=0;e<y.length;e++){if(e>=x.length){x.push(n),i=e;break}if(null===x[e]){x[e]=n,i=e;break}}if(-1===i)break}const r=y[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==d?d:h},this.getBinding=function(){return u},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(g=e.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",R),i.addEventListener("inputsourceschange",P),!0!==m.xrCompatible&&await t.makeXRCompatible(),b=e.getPixelRatio(),e.getSize(_),void 0===i.renderState.layers){const n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),v=new au(h.framebufferWidth,h.framebufferHeight,{format:Kl,type:Gl,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,a=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=m.stencil?Jl:Ql,a=m.stencil?Zl:$l);const s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:r};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(s),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),v=new au(d.textureWidth,d.textureHeight,{format:Kl,type:Gl,depthTexture:new bf(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===d.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(s),l=null,a=await i.requestReferenceSpace(o),I.setContext(i),I.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const L=new cu,k=new cu;function N(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===i)return;null!==p.texture&&(e.near=p.depthNear,e.far=p.depthFar),E.near=w.near=S.near=e.near,E.far=w.far=S.far=e.far,T===E.near&&A===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),T=E.near,A=E.far,S.near=T,S.far=A,w.near=T,w.far=A,S.updateProjectionMatrix(),w.updateProjectionMatrix(),e.updateProjectionMatrix());const t=e.parent,n=E.cameras;N(E,t);for(let e=0;e<n.length;e++)N(n[e],t);2===n.length?function(e,t,n){L.setFromMatrixPosition(t.matrixWorld),k.setFromMatrixPosition(n.matrixWorld);const i=L.distanceTo(k),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],d=(a[8]+1)/a[0],h=o*u,f=o*d,p=i/(-u+d),m=p*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+p,v=s+p,y=h-m,x=f+(i-m),_=l*s/v*g,b=c*s/v*g;e.projectionMatrix.makePerspective(y,x,_,b,g,v),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(E,S,w):E.projectionMatrix.copy(S.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*Rc*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,E,t)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==d||null!==h)return s},this.setFoveation=function(e){s=e,null!==d&&(d.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(E)};let D=null;const I=new Dh;I.setAnimationLoop((function(t,r){if(c=r.getViewerPose(l||a),f=r,null!==c){const t=c.views;null!==h&&(e.setRenderTargetFramebuffer(v,h.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let i=0;i<t.length;i++){const r=t[i];let a=null;if(null!==h)a=h.getViewport(r);else{const t=u.getViewSubImage(d,r);a=t.viewport,0===i&&(e.setRenderTargetTextures(v,t.colorTexture,d.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let o=M[i];void 0===o&&(o=new Sh,o.layers.enable(i),o.viewport=new iu,M[i]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===i&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=u.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&p.init(e,n,i.renderState)}}for(let e=0;e<y.length;e++){const t=x[e],n=y[e];null!==t&&void 0!==n&&n.update(t,r,l||a)}D&&D(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),f=null})),this.setAnimationLoop=function(e){D=e},this.dispose=function(){}}}const ym=new Yu,xm=new Fu;function _m(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function i(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map,n(i.map,e.mapTransform)),i.alphaMap&&(e.alphaMap.value=i.alphaMap,n(i.alphaMap,e.alphaMapTransform)),i.bumpMap&&(e.bumpMap.value=i.bumpMap,n(i.bumpMap,e.bumpMapTransform),e.bumpScale.value=i.bumpScale,i.side===tl&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,n(i.normalMap,e.normalMapTransform),e.normalScale.value.copy(i.normalScale),i.side===tl&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,n(i.displacementMap,e.displacementMapTransform),e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,e.emissiveMapTransform)),i.specularMap&&(e.specularMap.value=i.specularMap,n(i.specularMap,e.specularMapTransform)),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);const r=t.get(i),a=r.envMap,o=r.envMapRotation;a&&(e.envMap.value=a,ym.copy(o),ym.x*=-1,ym.y*=-1,ym.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(ym.y*=-1,ym.z*=-1),e.envMapRotation.value.setFromMatrix4(xm.makeRotationFromEuler(ym)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,mh(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,o,s){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(i(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(i(e,r),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,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===tl&&e.clearcoatNormalScale.value.negate()));t.dispersion>0&&(e.dispersion.value=t.dispersion);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=i.texture,e.transmissionSamplerSize.value.set(i.width,i.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,r,s)):r.isMeshMatcapMaterial?(i(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),function(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,r)):r.isMeshNormalMaterial?i(e,r):r.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,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,i,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*r,t.map&&(e.map.value=t.map,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,r,a,o):r.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,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function bm(e,t,n,i){let r={},a={},o=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,i){const r=e.value,a=t+"_"+n;if(void 0===i[a])return i[a]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const e=i[a];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return i[a]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==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 i=o.indexOf(n.__bindingPointIndex);o.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){const n=t.program;i.uniformBlockBinding(e,n)},update:function(n,d){let h=r[n.id];void 0===h&&(!function(e){const t=e.uniforms;let n=0;const i=16;for(let e=0,r=t.length;e<r;e++){const r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=a.length;e<r;e++){const r=c(a[e]),o=n%i;0!==o&&i-o<r.boundary&&(n+=i-o),t.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);e.__size=n,e.__cache={}}(n),h=function(t){const n=function(){for(let e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const i=e.createBuffer(),r=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,i),e.bufferData(e.UNIFORM_BUFFER,r,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=h,n.addEventListener("dispose",u));const f=d.program;i.updateUBOMapping(n,f);const p=t.render.frame;a[n.id]!==p&&(!function(t){const n=r[t.id],i=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=i.length;t<n;t++){const n=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,t,i,a)){const t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let a=0;a<n.length;a++){const o=n[a],s=c(o);"number"==typeof o||"boolean"==typeof o?(r.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):o.isMatrix3?(r.__data[0]=o.elements[0],r.__data[1]=o.elements[1],r.__data[2]=o.elements[2],r.__data[3]=0,r.__data[4]=o.elements[3],r.__data[5]=o.elements[4],r.__data[6]=o.elements[5],r.__data[7]=0,r.__data[8]=o.elements[6],r.__data[9]=o.elements[7],r.__data[10]=o.elements[8],r.__data[11]=0):(o.toArray(r.__data,i),i+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=p)},dispose:function(){for(const t in r)e.deleteBuffer(r[t]);o=[],r={},a={}}}}class Sm{constructor(e={}){const{canvas:t=Bc(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=e;let d;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const h=new Uint32Array(4),f=new Int32Array(4);let p=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=oc,this.toneMapping=Ml,this.toneMappingExposure=1;const y=this;let x=!1,_=0,b=0,S=null,w=-1,M=null;const E=new iu,T=new iu;let A=null;const C=new Cd(0);let R=0,P=t.width,L=t.height,k=1,N=null,D=null;const I=new iu(0,0,P,L),O=new iu(0,0,P,L);let U=!1;const z=new Nh;let F=!1,B=!1;const H=new Fu,V=new cu,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let G=!1;function W(){return null===S?k:1}let X,$,q,Y,Z,K,Q,J,ee,te,ne,ie,re,ae,oe,se,le,ce,ue,de,he,fe,pe,me,ge=n;function ve(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zs}`),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",be,!1),t.addEventListener("webglcontextcreationerror",Se,!1),null===ge){const t="webgl2";if(ge=ve(t,e),null===ge)throw ve(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ye(){X=new mf(ge),X.init(),fe=new dm(ge,X),$=new Xh(ge,X,e,fe),q=new cm(ge),Y=new yf(ge),Z=new Yp,K=new um(ge,X,q,Z,$,fe,Y),Q=new qh(y),J=new pf(y),ee=new Ih(ge),pe=new Gh(ge,ee),te=new gf(ge,ee,Y,pe),ne=new _f(ge,te,ee,Y),ue=new xf(ge,$,K),se=new $h(Z),ie=new qp(y,Q,J,X,$,pe,se),re=new _m(y,Z),ae=new Jp,oe=new am(X),ce=new jh(y,Q,J,q,ne,d,s),le=new lm(y,ne,$),me=new bm(ge,Y,$,q),de=new Wh(ge,X,Y),he=new vf(ge,X,Y),Y.programs=ie.programs,y.capabilities=$,y.extensions=X,y.properties=Z,y.renderLists=ae,y.shadowMap=le,y.state=q,y.info=Y}ye();const xe=new vm(y,ge);function _e(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function be(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const e=Y.autoReset,t=le.enabled,n=le.autoUpdate,i=le.needsUpdate,r=le.type;ye(),Y.autoReset=e,le.enabled=t,le.autoUpdate=n,le.needsUpdate=i,le.type=r}function Se(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function we(e){const t=e.target;t.removeEventListener("dispose",we),function(e){(function(e){const t=Z.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),Z.remove(e)}(t)}function Me(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=tl,e.needsUpdate=!0,De(e,t,n),e.side=el,e.needsUpdate=!0,De(e,t,n),e.side=2):De(e,t,n)}this.xr=xe,this.getContext=function(){return ge},this.getContextAttributes=function(){return ge.getContextAttributes()},this.forceContextLoss=function(){const e=X.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=X.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(e){void 0!==e&&(k=e,this.setSize(P,L,!1))},this.getSize=function(e){return e.set(P,L)},this.setSize=function(e,n,i=!0){xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=e,L=n,t.width=Math.floor(e*k),t.height=Math.floor(n*k),!0===i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(P*k,L*k).floor()},this.setDrawingBufferSize=function(e,n,i){P=e,L=n,k=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(I)},this.setViewport=function(e,t,n,i){e.isVector4?I.set(e.x,e.y,e.z,e.w):I.set(e,t,n,i),q.viewport(E.copy(I).multiplyScalar(k).round())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,n,i){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,i),q.scissor(T.copy(O).multiplyScalar(k).round())},this.getScissorTest=function(){return U},this.setScissorTest=function(e){q.setScissorTest(U=e)},this.setOpaqueSort=function(e){N=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ce.getClearColor())},this.setClearColor=function(){ce.setClearColor.apply(ce,arguments)},this.getClearAlpha=function(){return ce.getClearAlpha()},this.setClearAlpha=function(){ce.setClearAlpha.apply(ce,arguments)},this.clear=function(e=!0,t=!0,n=!0){let i=0;if(e){let e=!1;if(null!==S){const t=S.texture.format;e=1033===t||1031===t||1029===t}if(e){const e=S.texture.type,t=e===Gl||e===$l||e===Wl||e===Zl||1017===e||1018===e,n=ce.getClearColor(),i=ce.getClearAlpha(),r=n.r,a=n.g,o=n.b;t?(h[0]=r,h[1]=a,h[2]=o,h[3]=i,ge.clearBufferuiv(ge.COLOR,0,h)):(f[0]=r,f[1]=a,f[2]=o,f[3]=i,ge.clearBufferiv(ge.COLOR,0,f))}else i|=ge.COLOR_BUFFER_BIT}t&&(i|=ge.DEPTH_BUFFER_BIT),n&&(i|=ge.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ge.clear(i)},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",_e,!1),t.removeEventListener("webglcontextrestored",be,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),ae.dispose(),oe.dispose(),Z.dispose(),Q.dispose(),J.dispose(),ne.dispose(),pe.dispose(),me.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Te),xe.removeEventListener("sessionend",Ae),Ce.stop()},this.renderBufferDirect=function(e,t,n,i,r,a){null===t&&(t=j);const o=r.isMesh&&r.matrixWorld.determinant()<0,s=function(e,t,n,i,r){!0!==t.isScene&&(t=j);K.resetTextureUnits();const a=t.fog,o=i.isMeshStandardMaterial?t.environment:null,s=null===S?y.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:sc,l=(i.isMeshStandardMaterial?J:Q).get(i.envMap||o),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),d=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let p=Ml;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=y.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,x=Z.get(i),_=m.state.lights;if(!0===F&&(!0===B||e!==M)){const t=e===M&&i.id===w;se.setState(i,e,t)}let b=!1;i.version===x.__version?x.needsLights&&x.lightsStateVersion!==_.state.version||x.outputColorSpace!==s||r.isBatchedMesh&&!1===x.batching?b=!0:r.isBatchedMesh||!0!==x.batching?r.isBatchedMesh&&!0===x.batchingColor&&null===r.colorTexture||r.isBatchedMesh&&!1===x.batchingColor&&null!==r.colorTexture||r.isInstancedMesh&&!1===x.instancing?b=!0:r.isInstancedMesh||!0!==x.instancing?r.isSkinnedMesh&&!1===x.skinning?b=!0:r.isSkinnedMesh||!0!==x.skinning?r.isInstancedMesh&&!0===x.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===x.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===x.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===x.instancingMorph&&null!==r.morphTexture||x.envMap!==l||!0===i.fog&&x.fog!==a?b=!0:void 0===x.numClippingPlanes||x.numClippingPlanes===se.numPlanes&&x.numIntersection===se.numIntersection?(x.vertexAlphas!==c||x.vertexTangents!==u||x.morphTargets!==d||x.morphNormals!==h||x.morphColors!==f||x.toneMapping!==p||x.morphTargetsCount!==v)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,x.__version=i.version);let E=x.currentProgram;!0===b&&(E=De(i,t,r));let T=!1,A=!1,C=!1;const R=E.getUniforms(),P=x.uniforms;q.useProgram(E.program)&&(T=!0,A=!0,C=!0);i.id!==w&&(w=i.id,A=!0);if(T||M!==e){R.setValue(ge,"projectionMatrix",e.projectionMatrix),R.setValue(ge,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(ge,V.setFromMatrixPosition(e.matrixWorld)),$.logarithmicDepthBuffer&&R.setValue(ge,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&R.setValue(ge,"isOrthographic",!0===e.isOrthographicCamera),M!==e&&(M=e,A=!0,C=!0)}if(r.isSkinnedMesh){R.setOptional(ge,r,"bindMatrix"),R.setOptional(ge,r,"bindMatrixInverse");const e=r.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(ge,"boneTexture",e.boneTexture,K))}r.isBatchedMesh&&(R.setOptional(ge,r,"batchingTexture"),R.setValue(ge,"batchingTexture",r._matricesTexture,K),R.setOptional(ge,r,"batchingColorTexture"),null!==r._colorsTexture&&R.setValue(ge,"batchingColorTexture",r._colorsTexture,K));const N=n.morphAttributes;void 0===N.position&&void 0===N.normal&&void 0===N.color||ue.update(r,n,E);(A||x.receiveShadow!==r.receiveShadow)&&(x.receiveShadow=r.receiveShadow,R.setValue(ge,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==t.environment&&(P.envMapIntensity.value=t.environmentIntensity);A&&(R.setValue(ge,"toneMappingExposure",y.toneMappingExposure),x.needsLights&&(I=C,(D=P).ambientLightColor.needsUpdate=I,D.lightProbe.needsUpdate=I,D.directionalLights.needsUpdate=I,D.directionalLightShadows.needsUpdate=I,D.pointLights.needsUpdate=I,D.pointLightShadows.needsUpdate=I,D.spotLights.needsUpdate=I,D.spotLightShadows.needsUpdate=I,D.rectAreaLights.needsUpdate=I,D.hemisphereLights.needsUpdate=I),a&&!0===i.fog&&re.refreshFogUniforms(P,a),re.refreshMaterialUniforms(P,i,k,L,m.state.transmissionRenderTarget[e.id]),Tp.upload(ge,Ie(x),P,K));var D,I;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Tp.upload(ge,Ie(x),P,K),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&R.setValue(ge,"center",r.center);if(R.setValue(ge,"modelViewMatrix",r.modelViewMatrix),R.setValue(ge,"normalMatrix",r.normalMatrix),R.setValue(ge,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const e=i.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];me.update(n,E),me.bind(n,E)}}return E}(e,t,n,i,r);q.setMaterial(i,o);let l=n.index,c=1;if(!0===i.wireframe){if(l=te.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,d=n.attributes.position;let h=u.start*c,f=(u.start+u.count)*c;null!==a&&(h=Math.max(h,a.start*c),f=Math.min(f,(a.start+a.count)*c)),null!==l?(h=Math.max(h,0),f=Math.min(f,l.count)):null!=d&&(h=Math.max(h,0),f=Math.min(f,d.count));const p=f-h;if(p<0||p===1/0)return;let g;pe.setup(r,i,s,n,l);let v=de;if(null!==l&&(g=ee.get(l),v=he,v.setIndex(g)),r.isMesh)!0===i.wireframe?(q.setLineWidth(i.wireframeLinewidth*W()),v.setMode(ge.LINES)):v.setMode(ge.TRIANGLES);else if(r.isLine){let e=i.linewidth;void 0===e&&(e=1),q.setLineWidth(e*W()),r.isLineSegments?v.setMode(ge.LINES):r.isLineLoop?v.setMode(ge.LINE_LOOP):v.setMode(ge.LINE_STRIP)}else r.isPoints?v.setMode(ge.POINTS):r.isSprite&&v.setMode(ge.TRIANGLES);if(r.isBatchedMesh)null!==r._multiDrawInstances?v.renderMultiDrawInstances(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount,r._multiDrawInstances):v.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else if(r.isInstancedMesh)v.renderInstances(h,p,r.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(h,p,t)}else v.render(h,p)},this.compile=function(e,t,n=null){null===n&&(n=e),m=oe.get(n),m.init(t),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();const i=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){const a=t[r];Me(a,n,e),i.add(a)}else Me(t,n,e),i.add(t)})),v.pop(),m=null,i},this.compileAsync=function(e,t,n=null){const i=this.compile(e,t,n);return new Promise((t=>{function n(){i.forEach((function(e){Z.get(e).currentProgram.isReady()&&i.delete(e)})),0!==i.size?setTimeout(n,10):t(e)}null!==X.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ee=null;function Te(){Ce.stop()}function Ae(){Ce.start()}const Ce=new Dh;function Re(e,t,n,i){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||z.intersectsSprite(e)){i&&V.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);const t=ne.update(e),r=e.material;r.visible&&p.push(e,t,r,n,V.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||z.intersectsObject(e))){const t=ne.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),V.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),V.copy(t.boundingSphere.center)),V.applyMatrix4(e.matrixWorld).applyMatrix4(H)),Array.isArray(r)){const i=t.groups;for(let a=0,o=i.length;a<o;a++){const o=i[a],s=r[o.materialIndex];s&&s.visible&&p.push(e,t,s,n,V.z,o)}}else r.visible&&p.push(e,t,r,n,V.z,null)}const r=e.children;for(let e=0,a=r.length;e<a;e++)Re(r[e],t,n,i)}function Pe(e,t,n,i){const r=e.opaque,a=e.transmissive,o=e.transparent;m.setupLightsView(n),!0===F&&se.setGlobalState(y.clippingPlanes,n),i&&q.viewport(E.copy(i)),r.length>0&&ke(r,t,n),a.length>0&&ke(a,t,n),o.length>0&&ke(o,t,n),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function Le(e,t,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[i.id]&&(m.state.transmissionRenderTarget[i.id]=new au(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")||X.has("EXT_color_buffer_float")?Yl:Gl,minFilter:jl,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:$c.workingColorSpace}));const a=m.state.transmissionRenderTarget[i.id],o=i.viewport||E;a.setSize(o.z,o.w);const s=y.getRenderTarget();y.setRenderTarget(a),y.getClearColor(C),R=y.getClearAlpha(),R<1&&y.setClearColor(16777215,.5),G?ce.render(n):y.clear();const l=y.toneMapping;y.toneMapping=Ml;const c=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),m.setupLightsView(i),!0===F&&se.setGlobalState(y.clippingPlanes,i),ke(e,n,i),K.updateMultisampleRenderTarget(a),K.updateRenderTargetMipmap(a),!1===X.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let r=0,a=t.length;r<a;r++){const a=t[r],o=a.object,s=a.geometry,l=a.material,c=a.group;if(2===l.side&&o.layers.test(i.layers)){const t=l.side;l.side=tl,l.needsUpdate=!0,Ne(o,n,i,s,l,c),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(K.updateMultisampleRenderTarget(a),K.updateRenderTargetMipmap(a))}y.setRenderTarget(s),y.setClearColor(C,R),void 0!==c&&(i.viewport=c),y.toneMapping=l}function ke(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){const a=e[r],o=a.object,s=a.geometry,l=null===i?a.material:i,c=a.group;o.layers.test(n.layers)&&Ne(o,t,n,s,l,c)}}function Ne(e,t,n,i,r,a){e.onBeforeRender(y,t,n,i,r,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(y,t,n,i,e,a),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=tl,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=el,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=2):y.renderBufferDirect(n,t,i,r,e,a),e.onAfterRender(y,t,n,i,r,a)}function De(e,t,n){!0!==t.isScene&&(t=j);const i=Z.get(e),r=m.state.lights,a=m.state.shadowsArray,o=r.state.version,s=ie.getParameters(e,r.state,a,t,n),l=ie.getProgramCacheKey(s);let c=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?J:Q).get(e.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",we),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===o)return Oe(e,s),u}else s.uniforms=ie.getUniforms(e),e.onBuild(n,s,y),e.onBeforeCompile(s,y),u=ie.acquireProgram(s,l),c.set(l,u),i.uniforms=s.uniforms;const d=i.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=se.uniform),Oe(e,s),i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=o,i.needsLights&&(d.ambientLightColor.value=r.state.ambient,d.lightProbe.value=r.state.probe,d.directionalLights.value=r.state.directional,d.directionalLightShadows.value=r.state.directionalShadow,d.spotLights.value=r.state.spot,d.spotLightShadows.value=r.state.spotShadow,d.rectAreaLights.value=r.state.rectArea,d.ltc_1.value=r.state.rectAreaLTC1,d.ltc_2.value=r.state.rectAreaLTC2,d.pointLights.value=r.state.point,d.pointLightShadows.value=r.state.pointShadow,d.hemisphereLights.value=r.state.hemi,d.directionalShadowMap.value=r.state.directionalShadowMap,d.directionalShadowMatrix.value=r.state.directionalShadowMatrix,d.spotShadowMap.value=r.state.spotShadowMap,d.spotLightMatrix.value=r.state.spotLightMatrix,d.spotLightMap.value=r.state.spotLightMap,d.pointShadowMap.value=r.state.pointShadowMap,d.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=u,i.uniformsList=null,u}function Ie(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=Tp.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Oe(e,t){const n=Z.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,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}Ce.setAnimationLoop((function(e){Ee&&Ee(e)})),"undefined"!=typeof self&&Ce.setContext(self),this.setAnimationLoop=function(e){Ee=e,xe.setAnimationLoop(e),null===e?Ce.stop():Ce.start()},xe.addEventListener("sessionstart",Te),xe.addEventListener("sessionend",Ae),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===x)return;if(!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=oe.get(e,v.length),m.init(t),v.push(m),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),z.setFromProjectionMatrix(H),B=this.localClippingEnabled,F=se.init(this.clippingPlanes,B),p=ae.get(e,g.length),p.init(),g.push(p),!0===xe.enabled&&!0===xe.isPresenting){const e=y.xr.getDepthSensingMesh();null!==e&&Re(e,t,-1/0,y.sortObjects)}Re(e,t,0,y.sortObjects),p.finish(),!0===y.sortObjects&&p.sort(N,D),G=!1===xe.enabled||!1===xe.isPresenting||!1===xe.hasDepthSensing(),G&&ce.addToRenderList(p,e),this.info.render.frame++,!0===F&&se.beginShadows();const n=m.state.shadowsArray;le.render(n,e,t),!0===F&&se.endShadows(),!0===this.info.autoReset&&this.info.reset();const i=p.opaque,r=p.transmissive;if(m.setupLights(),t.isArrayCamera){const n=t.cameras;if(r.length>0)for(let t=0,a=n.length;t<a;t++){Le(i,r,e,n[t])}G&&ce.render(e);for(let t=0,i=n.length;t<i;t++){const i=n[t];Pe(p,e,i,i.viewport)}}else r.length>0&&Le(i,r,e,t),G&&ce.render(e),Pe(p,e,t);null!==S&&(K.updateMultisampleRenderTarget(S),K.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(y,e,t),pe.resetDefaultState(),w=-1,M=null,v.pop(),v.length>0?(m=v[v.length-1],!0===F&&se.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),p=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){Z.get(e.texture).__webglTexture=t,Z.get(e.depthTexture).__webglTexture=n;const i=Z.get(e);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===X.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=Z.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){S=e,_=t,b=n;let i=!0,r=null,a=!1,o=!1;if(e){const s=Z.get(e);void 0!==s.__useDefaultFramebuffer?(q.bindFramebuffer(ge.FRAMEBUFFER,null),i=!1):void 0===s.__webglFramebuffer?K.setupRenderTarget(e):s.__hasExternalTextures&&K.rebindTextures(e,Z.get(e.texture).__webglTexture,Z.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],a=!0):r=e.samples>0&&!1===K.useMultisampledRTT(e)?Z.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,E.copy(e.viewport),T.copy(e.scissor),A=e.scissorTest}else E.copy(I).multiplyScalar(k).floor(),T.copy(O).multiplyScalar(k).floor(),A=U;if(q.bindFramebuffer(ge.FRAMEBUFFER,r)&&i&&q.drawBuffers(e,r),q.viewport(E),q.scissor(T),q.setScissorTest(A),a){const i=Z.get(e.texture);ge.framebufferTexture2D(ge.FRAMEBUFFER,ge.COLOR_ATTACHMENT0,ge.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(o){const i=Z.get(e.texture),r=t||0;ge.framebufferTextureLayer(ge.FRAMEBUFFER,ge.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}w=-1},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){q.bindFramebuffer(ge.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!$.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&ge.readPixels(t,n,i,r,fe.convert(s),fe.convert(l),a)}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;q.bindFramebuffer(ge.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,i,r,a,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){q.bindFramebuffer(ge.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!$.textureFormatReadable(s))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r){const e=ge.createBuffer();ge.bindBuffer(ge.PIXEL_PACK_BUFFER,e),ge.bufferData(ge.PIXEL_PACK_BUFFER,a.byteLength,ge.STREAM_READ),ge.readPixels(t,n,i,r,fe.convert(s),fe.convert(l),0),ge.flush();const o=ge.fenceSync(ge.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t,n){return new Promise((function(i,r){setTimeout((function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}}),n)}))}(ge,o,4);try{ge.bindBuffer(ge.PIXEL_PACK_BUFFER,e),ge.getBufferSubData(ge.PIXEL_PACK_BUFFER,0,a)}finally{ge.deleteBuffer(e),ge.deleteSync(o)}return a}}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;q.bindFramebuffer(ge.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,n=0){!0!==e.isTexture&&(console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=null!==t?t.x:0,s=null!==t?t.y:0;K.setTexture2D(e,0),ge.copyTexSubImage2D(ge.TEXTURE_2D,n,0,0,o,s,r,a),q.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,i=null,r=0){let a,o,s,l,c,u;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),i=arguments[0]||null,e=arguments[1],t=arguments[2],r=arguments[3]||0,n=null),null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.min.x,l=n.min.y):(a=e.image.width,o=e.image.height,s=0,l=0),null!==i?(c=i.x,u=i.y):(c=0,u=0);const d=fe.convert(t.format),h=fe.convert(t.type);K.setTexture2D(t,0),ge.pixelStorei(ge.UNPACK_FLIP_Y_WEBGL,t.flipY),ge.pixelStorei(ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ge.pixelStorei(ge.UNPACK_ALIGNMENT,t.unpackAlignment);const f=ge.getParameter(ge.UNPACK_ROW_LENGTH),p=ge.getParameter(ge.UNPACK_IMAGE_HEIGHT),m=ge.getParameter(ge.UNPACK_SKIP_PIXELS),g=ge.getParameter(ge.UNPACK_SKIP_ROWS),v=ge.getParameter(ge.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[r]:e.image;ge.pixelStorei(ge.UNPACK_ROW_LENGTH,y.width),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,y.height),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,s),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,l),e.isDataTexture?ge.texSubImage2D(ge.TEXTURE_2D,r,c,u,a,o,d,h,y.data):e.isCompressedTexture?ge.compressedTexSubImage2D(ge.TEXTURE_2D,r,c,u,y.width,y.height,d,y.data):ge.texSubImage2D(ge.TEXTURE_2D,r,c,u,d,h,y),ge.pixelStorei(ge.UNPACK_ROW_LENGTH,f),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,p),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,m),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,g),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,v),0===r&&t.generateMipmaps&&ge.generateMipmap(ge.TEXTURE_2D),q.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,i=null,r=0){let a,o,s,l,c,u,d,h,f;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,i=arguments[1]||null,e=arguments[2],t=arguments[3],r=arguments[4]||0);const p=e.isCompressedTexture?e.mipmaps[r]:e.image;null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.max.z-n.min.z,l=n.min.x,c=n.min.y,u=n.min.z):(a=p.width,o=p.height,s=p.depth,l=0,c=0,u=0),null!==i?(d=i.x,h=i.y,f=i.z):(d=0,h=0,f=0);const m=fe.convert(t.format),g=fe.convert(t.type);let v;if(t.isData3DTexture)K.setTexture3D(t,0),v=ge.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(t,0),v=ge.TEXTURE_2D_ARRAY}ge.pixelStorei(ge.UNPACK_FLIP_Y_WEBGL,t.flipY),ge.pixelStorei(ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ge.pixelStorei(ge.UNPACK_ALIGNMENT,t.unpackAlignment);const y=ge.getParameter(ge.UNPACK_ROW_LENGTH),x=ge.getParameter(ge.UNPACK_IMAGE_HEIGHT),_=ge.getParameter(ge.UNPACK_SKIP_PIXELS),b=ge.getParameter(ge.UNPACK_SKIP_ROWS),S=ge.getParameter(ge.UNPACK_SKIP_IMAGES);ge.pixelStorei(ge.UNPACK_ROW_LENGTH,p.width),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,p.height),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,l),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,c),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,u),e.isDataTexture||e.isData3DTexture?ge.texSubImage3D(v,r,d,h,f,a,o,s,m,g,p.data):t.isCompressedArrayTexture?ge.compressedTexSubImage3D(v,r,d,h,f,a,o,s,m,p.data):ge.texSubImage3D(v,r,d,h,f,a,o,s,m,g,p),ge.pixelStorei(ge.UNPACK_ROW_LENGTH,y),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,x),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,_),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,b),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,S),0===r&&t.generateMipmaps&&ge.generateMipmap(v),q.unbindTexture()},this.initRenderTarget=function(e){void 0===Z.get(e).__webglFramebuffer&&K.setupRenderTarget(e)},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(){_=0,b=0,S=null,q.reset(),pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mc}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===lc?"display-p3":"srgb",t.unpackColorSpace=$c.workingColorSpace===cc?"display-p3":"srgb"}}class wm extends hd{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Yu,this.environmentIntensity=1,this.environmentRotation=new Yu,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,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}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.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Mm extends Ld{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Cd(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 Em=new cu,Tm=new cu,Am=new Fu,Cm=new zu,Rm=new Pu,Pm=new cu,Lm=new cu;class km extends hd{constructor(e=new Xd,t=new Mm){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,i=t.count;e<i;e++)Em.fromBufferAttribute(t,e-1),Tm.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Em.distanceTo(Tm);e.setAttribute("lineDistance",new zd(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rm.copy(n.boundingSphere),Rm.applyMatrix4(i),Rm.radius+=r,!1===e.ray.intersectsSphere(Rm))return;Am.copy(i).invert(),Cm.copy(e.ray).applyMatrix4(Am);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=c.getX(r),i=c.getX(r+1),a=Nm(this,e,Cm,s,n,i);a&&t.push(a)}if(this.isLineLoop){const r=c.getX(i-1),a=c.getX(n),o=Nm(this,e,Cm,s,r,a);o&&t.push(o)}}else{const n=Math.max(0,a.start),i=Math.min(u.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=Nm(this,e,Cm,s,r,r+1);n&&t.push(n)}if(this.isLineLoop){const r=Nm(this,e,Cm,s,i-1,n);r&&t.push(r)}}}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 Nm(e,t,n,i,r,a){const o=e.geometry.attributes.position;Em.fromBufferAttribute(o,r),Tm.fromBufferAttribute(o,a);if(n.distanceSqToSegment(Em,Tm,Pm,Lm)>i)return;Pm.applyMatrix4(e.matrixWorld);const s=t.ray.origin.distanceTo(Pm);return s<t.near||s>t.far?void 0:{distance:s,point:Lm.clone().applyMatrix4(e.matrixWorld),index:r,face:null,faceIndex:null,object:e}}const Dm=new cu,Im=new cu;class Om extends km{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,i=t.count;e<i;e+=2)Dm.fromBufferAttribute(t,e),Im.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Dm.distanceTo(Im);e.setAttribute("lineDistance",new zd(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Um extends Xd{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],u=[],d=[],h=[];let f=0;const p=[],m=n/2;let g=0;function v(n){const r=f,a=new Ic,p=new cu;let v=0;const y=!0===n?e:t,x=!0===n?1:-1;for(let e=1;e<=i;e++)u.push(0,m*x,0),d.push(0,x,0),h.push(.5,.5),f++;const _=f;for(let e=0;e<=i;e++){const t=e/i*s+o,n=Math.cos(t),r=Math.sin(t);p.x=y*r,p.y=m*x,p.z=y*n,u.push(p.x,p.y,p.z),d.push(0,x,0),a.x=.5*n+.5,a.y=.5*r*x+.5,h.push(a.x,a.y),f++}for(let e=0;e<i;e++){const t=r+e,i=_+e;!0===n?c.push(i,i+1,t):c.push(i+1,i,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new cu,v=new cu;let y=0;const x=(t-e)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=i;e++){const t=e/i,r=t*s+o,l=Math.sin(r),p=Math.cos(r);v.x=y*l,v.y=-g*n+m,v.z=y*p,u.push(v.x,v.y,v.z),a.set(l,x,p).normalize(),d.push(a.x,a.y,a.z),h.push(t,1-g),c.push(f++)}p.push(c)}for(let e=0;e<i;e++)for(let t=0;t<r;t++){const n=p[t][e],i=p[t+1][e],r=p[t+1][e+1],a=p[t][e+1];c.push(n,i,a),c.push(i,r,a),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new zd(u,3)),this.setAttribute("normal",new zd(d,3)),this.setAttribute("uv",new zd(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Um(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class zm extends Xd{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],a=[];function o(e,t,n,i){const r=i+1,a=[];for(let i=0;i<=r;i++){a[i]=[];const o=e.clone().lerp(n,i/r),s=t.clone().lerp(n,i/r),l=r-i;for(let e=0;e<=l;e++)a[i][e]=0===e&&i===r?o:o.clone().lerp(s,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){const n=Math.floor(t/2);t%2==0?(s(a[e][n+1]),s(a[e+1][n]),s(a[e][n])):(s(a[e][n+1]),s(a[e+1][n+1]),s(a[e+1][n]))}}function s(e){r.push(e.x,e.y,e.z)}function l(t,n){const i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function c(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new cu,i=new cu,r=new cu;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],i),l(t[a+2],r),o(n,i,r,e)}(i),function(e){const t=new cu;for(let n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){const e=new cu;for(let n=0;n<r.length;n+=3){e.x=r[n+0],e.y=r[n+1],e.z=r[n+2];const i=u(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(i,1-o)}var t;(function(){const e=new cu,t=new cu,n=new cu,i=new cu,o=new Ic,s=new Ic,l=new Ic;for(let d=0,h=0;d<r.length;d+=9,h+=6){e.set(r[d+0],r[d+1],r[d+2]),t.set(r[d+3],r[d+4],r[d+5]),n.set(r[d+6],r[d+7],r[d+8]),o.set(a[h+0],a[h+1]),s.set(a[h+2],a[h+3]),l.set(a[h+4],a[h+5]),i.copy(e).add(t).add(n).divideScalar(3);const f=u(i);c(o,h+0,e,f),c(s,h+2,t,f),c(l,h+4,n,f)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),o=Math.min(t,n,i);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new zd(r,3)),this.setAttribute("normal",new zd(r.slice(),3)),this.setAttribute("uv",new zd(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zm(e.vertices,e.indices,e.radius,e.details)}}class Fm extends zm{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Fm(e.radius,e.detail)}}class Bm extends Xd{constructor(e=.5,t=1,n=32,i=1,r=0,a=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},n=Math.max(3,n);const o=[],s=[],l=[],c=[];let u=e;const d=(t-e)/(i=Math.max(1,i)),h=new cu,f=new Ic;for(let e=0;e<=i;e++){for(let e=0;e<=n;e++){const i=r+e/n*a;h.x=u*Math.cos(i),h.y=u*Math.sin(i),s.push(h.x,h.y,h.z),l.push(0,0,1),f.x=(h.x/t+1)/2,f.y=(h.y/t+1)/2,c.push(f.x,f.y)}u+=d}for(let e=0;e<i;e++){const t=e*(n+1);for(let e=0;e<n;e++){const i=e+t,r=i,a=i+n+1,s=i+n+2,l=i+1;o.push(r,a,l),o.push(a,s,l)}}this.setIndex(o),this.setAttribute("position",new zd(s,3)),this.setAttribute("normal",new zd(l,3)),this.setAttribute("uv",new zd(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bm(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Hm extends Xd{constructor(e=1,t=32,n=16,i=0,r=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let l=0;const c=[],u=new cu,d=new cu,h=[],f=[],p=[],m=[];for(let h=0;h<=n;h++){const g=[],v=h/n;let y=0;0===h&&0===a?y=.5/t:h===n&&s===Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;u.x=-e*Math.cos(i+s*r)*Math.sin(a+v*o),u.y=e*Math.cos(a+v*o),u.z=e*Math.sin(i+s*r)*Math.sin(a+v*o),f.push(u.x,u.y,u.z),d.copy(u).normalize(),p.push(d.x,d.y,d.z),m.push(s+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let i=0;i<t;i++){const t=c[e][i+1],r=c[e][i],o=c[e+1][i],l=c[e+1][i+1];(0!==e||a>0)&&h.push(t,r,l),(e!==n-1||s<Math.PI)&&h.push(r,o,l)}this.setIndex(h),this.setAttribute("position",new zd(f,3)),this.setAttribute("normal",new zd(p,3)),this.setAttribute("uv",new zd(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hm(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Vm extends Xd{constructor(e=1,t=.4,n=12,i=48,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const a=[],o=[],s=[],l=[],c=new cu,u=new cu,d=new cu;for(let a=0;a<=n;a++)for(let h=0;h<=i;h++){const f=h/i*r,p=a/n*Math.PI*2;u.x=(e+t*Math.cos(p))*Math.cos(f),u.y=(e+t*Math.cos(p))*Math.sin(f),u.z=t*Math.sin(p),o.push(u.x,u.y,u.z),c.x=e*Math.cos(f),c.y=e*Math.sin(f),d.subVectors(u,c).normalize(),s.push(d.x,d.y,d.z),l.push(h/i),l.push(a/n)}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*e+t-1,r=(i+1)*(e-1)+t-1,o=(i+1)*(e-1)+t,s=(i+1)*e+t;a.push(n,r,s),a.push(r,o,s)}this.setIndex(a),this.setAttribute("position",new zd(o,3)),this.setAttribute("normal",new zd(s,3)),this.setAttribute("uv",new zd(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vm(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}const jm=new Fu;class Gm{constructor(e,t,n=0,i=1/0){this.ray=new zu(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Zu,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)}setFromXRController(e){return jm.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(jm),this}intersectObject(e,t=!0,n=[]){return Xm(e,this,n,t),n.sort(Wm),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)Xm(e[i],this,n,t);return n.sort(Wm),n}}function Wm(e,t){return e.distance-t.distance}function Xm(e,t,n,i){let r=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(r=!1)}if(!0===r&&!0===i){const i=e.children;for(let e=0,r=i.length;e<r;e++)Xm(i[e],t,n,!0)}}const $m=new cu,qm=new cu;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zs}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zs);class Ym{t1;t2;_position;_quaternion;_rotation;_scale;constructor(e,t){this.t1=e,this.t2=t}get time(){return this.t1.time-this.t2.time}get position(){return this._position??=this.t1.position.clone().sub(this.t2.position)}get quaternion(){return this._quaternion??=this.t2.quaternion.clone().invert().premultiply(this.t1.quaternion)}get rotation(){return this._rotation??=(new Yu).setFromQuaternion(this.quaternion)}get scale(){return this._scale??=this.t1.scale.clone().sub(this.t2.scale)}}class Zm{cancel;previous;memo;event;initial;current;first;last;_delta;_offset;constructor(e){this.cancel=e}start(e,t){this.event=e,this.previous=void 0,this.current=t,this.initial=t,this.first=!0,this.last=!1,this.memo=void 0,this._delta=void 0,this._offset=void 0}update(e,t){this.event=e,this.previous=this.current,this.current=t,this.first=!1,this.last=!1,this._delta=void 0,this._offset=void 0}end(e){this.event=e,this.first=!1,this.last=!0,this._delta=void 0,this._offset=void 0}get delta(){if(null!=this.previous)return this._delta??=new Ym(this.current,this.previous)}get offset(){return this._offset??=new Ym(this.current,this.initial)}}function Km(e,t){if("sphere"===e.details.type)return!1;if("lines"===e.details.type){const{line:n}=e.details;return t.copy(n.end).sub(n.start).normalize(),!0}return"screen-ray"===e.details.type?(t.copy(e.details.direction),!0):(t.set(0,0,-1).applyQuaternion(e.pointerQuaternion),!0)}const Qm=new Fu,Jm=new Fu,eg={x:"XYZ",y:"YXZ",z:"ZXY"};function tg(e,t,n,i,r,a){Qm.copy(n),null!=r&&Qm.premultiply(Jm.copy(r).invert());const o=new cu,s=new lu,l=new cu;let c;Qm.decompose(o,s,l),hg(o,i.initialTargetPosition,a.translate??!0);const u=a.rotate??!0;if(!1===u)s.copy(i.initialTargetQuaternion),c=i.initialTargetRotation.clone();else if(Array.isArray(u)||!0===u||"string"!=typeof u&&!Array.isArray(u)&&!0===u.x&&!0===u.y&&!0===u.z)c=(new Yu).setFromQuaternion(s,i.initialTargetRotation.order);else if("string"==typeof u){const e=eg[u];c=(new Yu).setFromQuaternion(s,e);for(const t of e){const e=t.toLowerCase();e!==u&&(c[e]=0)}c.order=i.initialTargetRotation.order,s.setFromEuler(c)}else c=function(e,t,n){let i="",r="";for(const e of t.order)!1===n[e.toLowerCase()]?r+=e:i+=e;const a=i+r,o=(new Yu).setFromQuaternion(e,a);for(const e of a){const i=e.toLowerCase();o[i]=fg(i,o[i],t[i],n)}return e.setFromEuler(o),o}(s,i.initialTargetRotation,u);return hg(l,i.initialTargetScale,a.scale??!0),{pointerAmount:t,position:o,quaternion:s,rotation:c,scale:l,time:e}}const ng=new Ph,ig=new cu,rg=new cu,ag=new cu,og=new lu;function sg(e,t,n){return ng.normal.copy(e),ng.constant=0,function(e,t){if(0===t.x)return void e.set(1,0,0);if(0===t.y)return void e.set(0,1,0);if(0===t.z)return void e.set(0,0,1);e.set(-t.y,t.x,0)}(ig,ng.normal),rg.copy(ig),rg.applyQuaternion(og.copy(t).invert().premultiply(n)),ng.projectPoint(ig,ig).normalize(),ng.projectPoint(rg,rg).normalize(),(ag.crossVectors(ig,ng.normal).dot(rg)<0?1:-1)*ig.angleTo(rg)}const lg=new cu,cg=new Ph,ug=new cu,dg=new cu;function hg(e,t,n){if(Array.isArray(n))switch(n.length){case 0:return void e.copy(t);case 1:return e.sub(t),Rg(e,n[0]instanceof cu?n[0]:lg.fromArray(n[0])),void e.add(t);case 2:return lg.crossVectors(n[0]instanceof cu?n[0]:ug.fromArray(n[0]),n[1]instanceof cu?n[1]:dg.fromArray(n[1])),cg.setFromNormalAndCoplanarPoint(lg,t),void cg.projectPoint(e,e)}else e.x=fg("x",e.x,t.x,n),e.y=fg("y",e.y,t.y,n),e.z=fg("z",e.z,t.z,n)}function fg(e,t,n,i){if("boolean"==typeof i)return i?t:n;if("string"==typeof i)return i===e?t:n;const r=i[e];return!1===r?n:Array.isArray(r)?function(e,t,n){return Math.max(t,Math.min(n,e))}(t,...r):t}function pg(e=!0,t,n,i,r,a){if(e){switch(t.length){case 0:case 3:return;case 1:return void function(e,t,n,i,r){const a=null==r?0:1-Math.abs(t.dot(r));if(null==r||a<.001)return void Cg(i,e,t);Ag.subVectors(n,e);const o=t.dot(r),s=t.dot(Ag),l=r.dot(Ag),c=1-o*o,u=(s-o*l)/c;if((o*s-l)/c<0)return void Cg(i,e,t);Ag.copy(i),i.copy(e).addScaledVector(t,u)}(n,...t,i,r,a);case 2:return void function(e,t,n,i,r,a){Tg.crossVectors(e,t).normalize(),Eg.setFromNormalAndCoplanarPoint(Tg,n);const o=null==a?0:Math.abs(Tg.dot(a));if(null==a||o<.01)return void Eg.projectPoint(r,r);const s=Eg.distanceToPoint(i),l=-s/a.dot(Eg.normal);if(l<0)return void Eg.projectPoint(r,r);Ag.copy(r),r.copy(i).addScaledVector(a,l)}(...t,n,i,r,a)}throw new Error(`space cannot be ${t.length}D but received (${t.map((e=>e.toArray().join("/"))).join("; ")})`)}}const mg={x:new cu(1,0,0),y:new cu(0,1,0),z:new cu(0,0,1)};function gg(e,t,n,i,r){if(!1!==i){if(!0===i)return e[0]=mg.x,e[1]=mg.y,void(e[2]=mg.z);if("string"!=typeof i)if(Array.isArray(i))for(const a of i)Sg(e,t,n,a,r);else!1!==i.x&&Sg(e,t,n,"x",r),!1!==i.y&&Sg(e,t,n,"y",r),!1!==i.z&&Sg(e,t,n,"z",r);else Sg(e,t,n,i,r)}}const vg=new lu,yg=new Yu,xg=new cu,_g=new cu,bg=new cu;function Sg(e,t,n,i,r){if(Array.isArray(i)?xg.set(...i):i instanceof cu?xg.copy(i):xg.copy(mg[i]),"translate"===r)return xg.applyQuaternion(t),void Mg(e,xg);if("scale"===r)return Array.isArray(i)?vg.identity():vg.setFromEuler(n),vg.premultiply(t),xg.applyQuaternion(vg),void Mg(e,xg);if(Array.isArray(i))yg.set(0,0,0);else{yg.copy(n);for(let e=2;e>=0;e--){const t=n.order[e].toLowerCase();if(yg[t]=0,t===i)break}}vg.setFromEuler(yg).premultiply(t),xg.normalize(),_g.set(0,1,0),xg.dot(_g)>.99&&_g.set(0,0,1),bg.crossVectors(xg,_g).normalize(),_g.copy(bg),bg.applyQuaternion(vg),Mg(e,bg),bg.crossVectors(xg,_g).normalize(),bg.applyQuaternion(vg),Mg(e,bg)}const wg=new cu;function Mg(e,t){3!==e.length&&(0!==e.length?1!==e.length?(wg.crossVectors(e[0],e[1]),Math.abs(wg.dot(t))<.001||e.push(t.clone())):Math.abs(e[0].dot(t))<.999&&e.push(t.clone()):e.push(t.clone()))}const Eg=new Ph,Tg=new cu,Ag=new cu;function Cg(e,t,n){e.sub(t),Rg(e,n),e.add(t)}function Rg(e,t){const n=e.dot(t);e.copy(t).multiplyScalar(n)}const Pg=new Fu,Lg=new Fu,kg=new cu,Ng=new cu,Dg=new lu,Ig=new cu(1,1,1),Og=[];const Ug=new cu,zg=new cu,Fg=new cu,Bg=new cu,Hg=new cu,Vg=new cu,jg=new cu,Gg=new Fu,Wg=new Fu,Xg=new Fu,$g=new lu,qg=new lu,Yg=[];const Zg=new cu,Kg=new cu,Qg=new cu,Jg=new cu,ev=new cu,tv=new lu,nv=new lu,iv=new Fu,rv=new cu,av=[];const ov=new cu;class sv{target;getOptions;outputState;latestMoveEvent;inputState=new Map;capturedObjects=new Map;initialTargetPosition=new cu;initialTargetQuaternion=new lu;initialTargetRotation=new Yu;initialTargetScale=new cu;initialTargetParentWorldMatrix;prevTwoPointerDeltaRotation;prevTranslateAsDeltaRotation;prevAngle;handlers={onPointerDown:this.onPointerDown.bind(this),onPointerMove:this.onPointerMove.bind(this),onPointerUp:this.onPointerUp.bind(this)};constructor(e,t=()=>({})){this.target=e,this.getOptions=t,this.outputState=new Zm(this.cancel.bind(this))}firstOnPointer(e){const t=this.getTarget();if(null==t)return;const n=Km(e,ov)?ov.clone():void 0;e.intersection.details.type,this.inputState.set(e.pointerId,{pointerWorldDirection:n,pointerWorldPoint:e.point,pointerWorldOrigin:e.pointerPosition,pointerWorldQuaternion:e.pointerQuaternion,initialPointerWorldPoint:e.point.clone(),initialPointerWorldDirection:n?.clone(),initialPointerWorldQuaternion:e.pointerQuaternion.clone(),prevPointerWorldQuaternion:e.pointerQuaternion}),this.save(),1===this.inputState.size&&this.outputState.start(e,{pointerAmount:1,time:e.timeStamp,position:this.initialTargetPosition.clone(),quaternion:this.initialTargetQuaternion.clone(),rotation:this.initialTargetRotation.clone(),scale:this.initialTargetScale.clone()}),this.outputState.memo=this.apply(t)}onPointerDown(e){this.stopPropagation(e),this.capturePointer(e.pointerId,e.object)&&this.firstOnPointer(e)}onPointerMove(e){if(!this.capturedObjects.has(e.pointerId))return;this.stopPropagation(e);const t=this.inputState.get(e.pointerId);null!=t?(this.latestMoveEvent=e,t.pointerWorldPoint=e.point,t.prevPointerWorldQuaternion=t.pointerWorldQuaternion,t.pointerWorldQuaternion=e.pointerQuaternion,t.pointerWorldOrigin=e.pointerPosition,null!=t.pointerWorldDirection&&Km(e,t.pointerWorldDirection)):this.firstOnPointer(e)}cancel(){if(0===this.capturedObjects.size)return;for(const[e,t]of this.capturedObjects)t.releasePointerCapture(e);this.capturedObjects.clear(),this.inputState.clear(),this.outputState.end(void 0);const e=this.getTarget();null!=e&&this.apply(e)}onPointerUp(e){this.capturedObjects.has(e.pointerId)&&(this.stopPropagation(e),this.releasePointer(e.pointerId,e.object,e))}update(e){const t=this.getTarget();if(null==t||0===this.inputState.size||null==this.latestMoveEvent&&!1===(this.getOptions().alwaysUpdate??!1))return;const n=this.getOptions();let i;if("as-rotate"===n.translate||"as-rotate-and-scale"===n.translate||"as-scale"===n.translate){n.translate,this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0;const[r]=this.inputState.values(),a=t.matrixWorld,o=t.parent?.matrixWorld;i=function(e,t,n,i,r,a){if(null==r?tv.identity():r.decompose(Zg,tv,Kg),av.length=0,"as-scale"===a.translate&&gg(av,tv,n.initialTargetRotation,a.scale??!0,"scale"),"as-scale"!=a.translate&&gg(av,tv,n.initialTargetRotation,a.rotate??!0,"rotate"),iv.makeTranslation(n.initialTargetPosition),null!=n.initialTargetParentWorldMatrix&&iv.premultiply(n.initialTargetParentWorldMatrix),Jg.setFromMatrixPosition(iv),pg(a.projectRays,av,t.initialPointerWorldPoint,t.pointerWorldOrigin,Jg,void 0),Jg.negate().add(t.initialPointerWorldPoint),ev.setFromMatrixPosition(i),pg(a.projectRays,av,t.initialPointerWorldPoint,t.pointerWorldOrigin,ev,void 0),pg(a.projectRays,av,t.initialPointerWorldPoint,t.pointerWorldOrigin,Kg.copy(t.pointerWorldPoint),t.pointerWorldDirection),ev.negate().add(Kg),"as-scale"===a.translate?tv.copy(n.initialTargetQuaternion):(Zg.copy(Jg),null!=n.prevTranslateAsDeltaRotation&&Zg.applyQuaternion(n.prevTranslateAsDeltaRotation),Zg.normalize(),Kg.copy(ev).normalize(),tv.setFromUnitVectors(Zg,Kg),null==n.prevTranslateAsDeltaRotation?n.prevTranslateAsDeltaRotation=new lu:tv.multiply(n.prevTranslateAsDeltaRotation),n.prevTranslateAsDeltaRotation.copy(tv),null!=n.initialTargetParentWorldMatrix&&(nv.setFromRotationMatrix(n.initialTargetParentWorldMatrix),tv.multiply(nv.normalize()),tv.premultiply(nv.invert())),tv.multiply(n.initialTargetQuaternion)),"as-rotate"===a.translate)rv.set(1,1,1);else if("object"==typeof a.scale&&a.scale.uniform)rv.setScalar(ev.length()/Jg.length());else if("as-rotate-and-scale"===a.translate){iv.compose(n.initialTargetPosition,n.initialTargetQuaternion,n.initialTargetScale),null!=n.initialTargetParentWorldMatrix&&iv.premultiply(n.initialTargetParentWorldMatrix),iv.decompose(Kg,nv,Qg),Zg.copy(Jg).applyQuaternion(nv.invert()).divide(Qg),Zg.x=Math.abs(Zg.x),Zg.y=Math.abs(Zg.y),Zg.z=Math.abs(Zg.z);const e=Math.max(...Zg.toArray());Zg.divideScalar(e),rv.set(1,1,1),rv.addScaledVector(Zg,ev.length()/Jg.length()-1)}else null!=n.initialTargetParentWorldMatrix?(n.initialTargetParentWorldMatrix.decompose(Zg,nv,Kg),nv.multiply(n.initialTargetQuaternion)):nv.copy(n.initialTargetQuaternion),Zg.copy(Jg).applyQuaternion(nv.invert()),null!=r?(r.decompose(Kg,nv,Qg),nv.multiply(n.initialTargetQuaternion)):nv.copy(n.initialTargetQuaternion),Kg.copy(ev).applyQuaternion(nv.invert()),rv.x=Math.abs(Zg.x)<.001?1:Math.abs(Kg.x/Zg.x),rv.y=Math.abs(Zg.y)<.001?1:Math.abs(Kg.y/Zg.y),rv.z=Math.abs(Zg.z)<.001?1:Math.abs(Kg.z/Zg.z);return rv.multiply(n.initialTargetScale),iv.compose(n.initialTargetPosition,tv,rv),tg(e,1,iv,n,void 0,a)}(e,r,this,a,o,n)}else if(1===this.inputState.size){this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0,this.prevTranslateAsDeltaRotation=void 0;const[r]=this.inputState.values();i=function(e,t,n,i,r){return null==i?Dg.identity():i.decompose(kg,Dg,Ng),Og.length=0,gg(Og,Dg,n.initialTargetRotation,r.translate??!0,"translate"),Lg.makeRotationFromQuaternion(Dg.copy(t.initialPointerWorldQuaternion).invert()).multiply(Pg.makeTranslation(kg.copy(t.initialPointerWorldPoint).negate())),null!=n.initialTargetParentWorldMatrix&&Lg.multiply(n.initialTargetParentWorldMatrix),pg(r.projectRays,Og,t.initialPointerWorldPoint,t.pointerWorldOrigin,kg.copy(t.pointerWorldPoint),t.pointerWorldDirection),Dg.copy(t.pointerWorldQuaternion),!1===(r.rotate??!0)&&Dg.copy(t.initialPointerWorldQuaternion),Pg.compose(kg,Dg,Ig).multiply(Lg).multiply(Lg.compose(n.initialTargetPosition,n.initialTargetQuaternion,n.initialTargetScale)),tg(e,1,Pg,n,i,r)}(e,r,this,t.parent?.matrixWorld,n)}else{this.prevTranslateAsDeltaRotation=void 0;const[r,a]=this.inputState.values();i=function(e,t,n,i,r,a){null==r?$g.identity():r.decompose(Fg,$g,Bg),Yg.length=0,gg(Yg,$g,i.initialTargetRotation,a.translate??!0,"translate"),gg(Yg,$g,i.initialTargetRotation,a.rotate??!0,"rotate"),gg(Yg,$g,i.initialTargetRotation,a.scale??!0,"scale"),pg(a.projectRays,Yg,t.initialPointerWorldPoint,t.pointerWorldOrigin,Fg.copy(t.pointerWorldPoint),t.pointerWorldDirection),pg(a.projectRays,Yg,n.initialPointerWorldPoint,n.pointerWorldOrigin,Bg.copy(n.pointerWorldPoint),n.pointerWorldDirection),Ug.copy(n.initialPointerWorldPoint).sub(t.initialPointerWorldPoint),zg.copy(Bg).sub(Fg),Fg.copy(Ug),null!=i.prevTwoPointerDeltaRotation&&Fg.applyQuaternion(i.prevTwoPointerDeltaRotation),Fg.normalize(),Bg.copy(zg).normalize(),$g.setFromUnitVectors(Fg,Bg),null==i.prevTwoPointerDeltaRotation?i.prevTwoPointerDeltaRotation=new lu:$g.multiply(i.prevTwoPointerDeltaRotation),i.prevTwoPointerDeltaRotation.copy($g);const o=.5*(sg(Bg,t.prevPointerWorldQuaternion,t.pointerWorldQuaternion)+sg(Bg,n.prevPointerWorldQuaternion,n.pointerWorldQuaternion))+(i.prevAngle??0);if(i.prevAngle=o,$g.premultiply(qg.setFromAxisAngle(Bg,o)),"object"==typeof a.scale&&a.scale.uniform)jg.setScalar(zg.length()/Ug.length());else{Xg.compose(i.initialTargetPosition,i.initialTargetQuaternion,i.initialTargetScale),null!=i.initialTargetParentWorldMatrix&&Xg.premultiply(i.initialTargetParentWorldMatrix),Xg.decompose(Hg,qg,Vg),Fg.copy(Ug).applyQuaternion(qg.invert()).divide(Vg),Fg.x=Math.abs(Fg.x),Fg.y=Math.abs(Fg.y),Fg.z=Math.abs(Fg.z);const e=Math.max(...Fg.toArray());Fg.divideScalar(e),jg.set(1,1,1),jg.addScaledVector(Fg,zg.length()/Ug.length()-1)}return Gg.makeTranslation(Fg.copy(zg).multiplyScalar(.5).add(t.pointerWorldPoint)).multiply(Wg.makeRotationFromQuaternion($g)).multiply(Wg.makeRotationFromQuaternion(qg.invert())).multiply(Wg.makeScale(jg.x,jg.y,jg.z)).multiply(Wg.makeRotationFromQuaternion(qg.invert())).multiply(Wg.makeTranslation(Fg.copy(Ug).multiplyScalar(.5).add(t.initialPointerWorldPoint).negate())).multiply(Xg),tg(e,2,Gg,i,r,a)}(e,r,a,this,t.parent?.matrixWorld,n)}this.outputState.update(this.latestMoveEvent,i),this.outputState.memo=this.apply(t),this.latestMoveEvent=void 0}getTarget(){return this.target instanceof hd?this.target:this.target?.current}capturePointer(e,t){if(this.capturedObjects.has(e))return!1;const{multitouch:n,translate:i}=this.getOptions();return(!1!==(n??!0)&&"string"!=typeof i||1!==this.capturedObjects.size)&&(this.capturedObjects.set(e,t),t.setPointerCapture(e),!0)}releasePointer(e,t,n){const i=this.getTarget();null!=i&&this.capturedObjects.delete(e)&&(this.inputState.delete(e),t.releasePointerCapture(e),this.inputState.size>0?this.save():(this.outputState.end(n),this.apply(i)))}stopPropagation(e){null!=e&&(this.getOptions()?.stopPropagation??1)&&e.stopPropagation()}apply(e){return(this.getOptions().apply??cv)(this.outputState,e)}getState(){return 0===this.inputState.size?void 0:this.outputState}save(){const e=this.getTarget();if(null!=e){e.updateWorldMatrix(!0,!1),this.prevAngle=void 0,this.prevTwoPointerDeltaRotation=void 0,this.prevTranslateAsDeltaRotation=void 0,this.initialTargetParentWorldMatrix=e.parent?.matrixWorld.clone(),e.matrixAutoUpdate?(this.initialTargetPosition.copy(e.position),this.initialTargetQuaternion.copy(e.quaternion),this.initialTargetRotation.copy(e.rotation),this.initialTargetScale.copy(e.scale)):(e.matrix.decompose(this.initialTargetPosition,this.initialTargetQuaternion,this.initialTargetScale),this.initialTargetRotation.setFromQuaternion(this.initialTargetQuaternion,e.rotation.order));for(const e of this.inputState.values())null!=e.pointerWorldDirection&&e.initialPointerWorldDirection?.copy(e.pointerWorldDirection),e.initialPointerWorldPoint.copy(e.pointerWorldPoint),e.initialPointerWorldQuaternion.copy(e.pointerWorldQuaternion)}}bind(e){const{onPointerDown:t,onPointerMove:n,onPointerUp:i}=this.handlers;return e.addEventListener("pointerdown",t),e.addEventListener("pointermove",n),e.addEventListener("pointerup",i),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("pointermove",n),e.removeEventListener("pointerup",i),this.cancel()}}capture(e,t){return this.capturePointer(e,t)?()=>this.releasePointer(e,t,void 0):lv}}function lv(){}function cv(e,t){t.position.copy(e.current.position),t.rotation.order=e.current.rotation.order,t.quaternion.copy(e.current.quaternion),t.scale.copy(e.current.scale)}class uv{target;getOptions;handles=[];hoveredTagMap=new Map;hoverSubscriptions=[];applySubscriptions=[];space;constructor(e,t){this.target=e,this.getOptions=t}getSpace(){return this.space??"world"}getTarget(){return this.target instanceof hd?this.target:this.target.current}getHandleOptions(e,t){const n=this.getOptions?.(),i=t?.();return{...n,...i,apply:(t,r)=>(this.onApply(e,t,r),(i?.apply??n?.apply??cv)?.(t,r))}}registerHandle(e,t,n){const i={object:t,store:e,tag:n};this.handles.push(i);const r=e.bind(t),a=this.onPointerEnter.bind(this,n),o=this.onPointerLeave.bind(this);return t.addEventListener("pointerenter",a),t.addEventListener("pointerleave",o),()=>{const t=this.handles.indexOf(i);-1!=t&&this.handles.splice(t,1),r(),e.cancel()}}subscribeHover(e){return this.hoverSubscriptions.push(e),e(Array.from(this.hoveredTagMap.values())),()=>{const t=this.hoverSubscriptions.indexOf(e);-1!==t&&this.hoverSubscriptions.splice(t,1)}}subscribeApply(e){return this.applySubscriptions.push(e),()=>{const t=this.applySubscriptions.indexOf(e);-1!==t&&this.applySubscriptions.splice(t,1)}}update(e){for(const{store:t}of this.handles)t.update(e)}onPointerEnter(e,t){this.hoveredTagMap.set(t.pointerId,e),this.updateHover()}onPointerLeave(e){this.hoveredTagMap.delete(e.pointerId),this.updateHover()}updateHover(){const e=Array.from(this.hoveredTagMap.values());for(const t of this.hoverSubscriptions)t(e)}onApply(e,t,n){for(const i of this.applySubscriptions)i(e,t,n)}}const dv={depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0};function hv(e,t,n,{color:i,hoverColor:r,hoverOpacity:a,opacity:o}){if(null!=r||null!=a)return r??=i,e.subscribeHover((e=>{const s=e.some((e=>e.includes(n)));t.color.set(s?r:i),t.opacity=(s?a:o)??1}))}const fv=new lu;class pv extends Om{context;rotationOffset;constructor(e,t){super(),this.context=e,this.rotationOffset=t,this.renderOrder=1/0}update(){this.quaternion.setFromEuler(this.rotationOffset);const e=this.context.getTarget();"world"===this.context.getSpace()&&null!=e&&(e.getWorldQuaternion(fv).invert(),this.quaternion.premultiply(fv))}bind(e){this.geometry=new Xd,this.geometry.setAttribute("position",new zd([-1e3,0,0,1e3,0,0],3)),this.material=new Mm({...dv,color:this.material.color??"white",opacity:this.material.opacity??1});const t=this.context.subscribeHover((t=>{const n=t.some((t=>t.includes(e)));this.visible=n})),n=this.context.subscribeApply(((e,t)=>{if(t.last)return void this.position.set(0,0,0);this.position.copy(t.initial.position).sub(t.current.position);const n=this.context.getTarget();null!=n&&(fv.copy(n.quaternion).invert(),this.position.applyQuaternion(fv))}));return()=>{this.geometry.dispose(),this.material.dispose(),t(),n()}}}class mv extends fm{context;axis;store;options;tag;constructor(e,t,n,i){super(),this.context=e,this.axis=t,this.tag=(n??"")+t,this.store=new sv(e.target,(()=>e.getHandleOptions(this.tag,i)))}}function gv(e,t=!0){if(!1===t)return!1;if(!0===t){const t={x:!1,y:!1,z:!1,e:!1};for(const n of e)t[n]=!0;return t}if("string"==typeof t)return t===e&&{x:!1,y:!1,z:!1,e:!1,[e]:!0};const n={x:!1,y:!1,z:!1,e:!1};for(const i of e){const e=t[i]??!0;if(!1===e)return!1;n[i]=e}return n}const vv=new cu,yv=new cu;function xv(e,t,n,i){if(!n)return i;let r;return t instanceof Yh?r=(t.top-t.bottom)/t.zoom:(t.getWorldPosition(vv),e.getWorldPosition(yv),r=vv.distanceTo(yv)*Math.min(1.9*Math.tan(Math.PI*t.fov/360)/t.zoom,7)),r*i/4}const _v=new Um(0,.04,.1,12);_v.translate(0,.05,0);const bv=new Um(.0075,.0075,.5,3);bv.translate(0,.25,0);const Sv=new Yu(0,0,-Math.PI/2),wv=new Yu(0,0,Math.PI/2);class Mv extends mv{invert;showArrowBody;constructor(e,t,n="",i,r=!1,a=!0){super(e,t,n,(()=>({scale:!1,rotate:!1,translate:null!=i?[i]:this.options,multitouch:!1}))),this.invert=r,this.showArrowBody=a}bind(e,t,n){const i=gv(this.axis,n);if(!1===i)return;this.options=i;const r=this.invert?wv:Sv,a=new kd(dv),o=hv(this.context,a,this.tag,{color:e,hoverColor:t}),s=new uh(_v,a);let l,c;if(s.renderOrder=1/0,s.position.x=this.invert?-.5:.5,s.rotation.copy(r),this.add(s),this.showArrowBody){const t=new kd(dv);l=hv(this.context,t,this.tag,{color:e,hoverColor:16777024}),c=new uh(bv,t),c.renderOrder=1/0,c.rotation.copy(r),this.add(c)}const u=new uh(new Um(.13,0,.6,4));u.pointerEventsOrder=1/0,u.position.x=this.invert?-.3:.3,u.rotation.copy(r),u.visible=!1,this.add(u);const d=this.context.registerHandle(this.store,u,this.tag);return()=>{a.dispose(),d(),o?.(),l?.(),this.remove(s),null!=c&&this.remove(c),this.remove(u)}}}class Ev extends mv{constructor(e,t,n="",i){super(e,t,n,(()=>({translate:i??this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e,t,n){const i=gv(this.axis,n);if(!1===i)return;this.options=i;const r=new kd(dv),a=hv(this.context,r,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t}),o=new uh(new hh(.2,.2,.01),r);o.renderOrder=1/0,o.pointerEventsOrder=1/0,o.position.set(.15,.15,0);const s=this.context.registerHandle(this.store,o,this.tag);return this.add(o),()=>{r.dispose(),o.geometry.dispose(),s(),a?.(),this.remove(o)}}}new cu;const Tv=new lu;class Av extends mv{constructor(e){super(e,"xyz","",(()=>({translate:this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e){const t=gv(this.axis,e);if(!1===t)return;this.options=t;const n=new kd(dv),i=hv(this.context,n,this.tag,{color:16777215,hoverColor:16776960,opacity:.25,hoverOpacity:1}),r=new uh(new Fm(.1,0),n);r.renderOrder=1/0,this.add(r);const a=new uh(new Fm(.2,0));a.pointerEventsOrder=1/0,a.visible=!1,this.add(a);const o=this.context.registerHandle(this.store,a,this.tag);return()=>{n.dispose(),r.geometry.dispose(),a.geometry.dispose(),o(),i?.(),this.remove(r),this.remove(a)}}}const Cv=new cu,Rv=new lu,Pv=new lu,Lv=(new lu).setFromEuler(new Yu(0,0,Math.PI/2)),kv=(new lu).setFromEuler(new Yu(0,-Math.PI/2,0)),Nv=new lu,Dv=(new lu).setFromEuler(new Yu(0,-Math.PI/2,0)),Iv=(new lu).setFromEuler(new Yu(Math.PI/2,0,0));class Ov extends fm{context;size;fixed;free;translationX;translationY;translationZ;translationNegX;translationNegY;translationNegZ;translationXY;translationYZ;translationXZ;scaleGroup=new fm;xAxis=new cu;yAxis=new cu;zAxis=new cu;negXAxis=new cu;negYAxis=new cu;negZAxis=new cu;constructor(e,t,n){super(),this.context=e,this.size=t,this.fixed=n,this.add(this.scaleGroup),this.free=new Av(this.context),this.scaleGroup.add(this.free),this.translationX=new Mv(this.context,"x",void 0,this.xAxis),this.scaleGroup.add(this.translationX),this.translationY=new Mv(this.context,"y",void 0,this.yAxis),this.scaleGroup.add(this.translationY),this.translationZ=new Mv(this.context,"z",void 0,this.zAxis),this.scaleGroup.add(this.translationZ),this.translationNegX=new Mv(this.context,"x",void 0,this.negXAxis,!0,!1),this.scaleGroup.add(this.translationNegX),this.translationNegY=new Mv(this.context,"y",void 0,this.negYAxis,!0,!1),this.scaleGroup.add(this.translationNegY),this.translationNegZ=new Mv(this.context,"z",void 0,this.negZAxis,!0,!1),this.scaleGroup.add(this.translationNegZ),this.translationXY=new Ev(this.context,"xy",void 0,[this.xAxis,this.yAxis]),this.scaleGroup.add(this.translationXY),this.translationXZ=new Ev(this.context,"xz",void 0,[this.xAxis,this.zAxis]),this.scaleGroup.add(this.translationXZ),this.translationYZ=new Ev(this.context,"yz",void 0,[this.yAxis,this.zAxis]),this.scaleGroup.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.xAxis.set(1,0,0),this.yAxis.set(0,1,0),this.zAxis.set(0,0,1),this.free.quaternion.identity(),this.translationX.quaternion.copy(Pv),this.translationY.quaternion.copy(Lv),this.translationZ.quaternion.copy(kv),this.translationNegX.quaternion.copy(Pv),this.translationNegY.quaternion.copy(Lv),this.translationNegZ.quaternion.copy(kv),this.translationXY.quaternion.copy(Nv),this.translationYZ.quaternion.copy(Dv),this.translationXZ.quaternion.copy(Iv);const t=this.context.getSpace(),n=this.context.getTarget();"world"==t&&null!=n?(n.getWorldQuaternion(Rv).invert(),this.free.quaternion.premultiply(Rv),this.translationX.quaternion.premultiply(Rv),this.translationY.quaternion.premultiply(Rv),this.translationZ.quaternion.premultiply(Rv),this.translationNegX.quaternion.premultiply(Rv),this.translationNegY.quaternion.premultiply(Rv),this.translationNegZ.quaternion.premultiply(Rv),this.translationXY.quaternion.premultiply(Rv),this.translationYZ.quaternion.premultiply(Rv),this.translationXZ.quaternion.premultiply(Rv),null!=n.parent&&(n.parent.getWorldQuaternion(Rv).invert(),this.xAxis.applyQuaternion(Rv),this.yAxis.applyQuaternion(Rv),this.zAxis.applyQuaternion(Rv))):null!=n&&(this.xAxis.applyQuaternion(n.quaternion),this.yAxis.applyQuaternion(n.quaternion),this.zAxis.applyQuaternion(n.quaternion)),this.negXAxis.copy(this.xAxis).negate(),this.negYAxis.copy(this.yAxis).negate(),this.negZAxis.copy(this.zAxis).negate(),this.scaleGroup.scale.setScalar(1),null!=n&&(n.getWorldScale(Cv),this.scaleGroup.scale.divide(Cv)),this.scaleGroup.scale.multiplyScalar(xv(this,e,this.fixed??!0,this.size??1))}bind(e){const t=function(e,t){const n=new uh(new Fm(.01,2),new kd(dv));n.renderOrder=1/0,n.visible=!1,e.add(n);const i=new uh(new Fm(.01,2),new kd(dv));i.renderOrder=1/0,i.visible=!1,e.add(i);const r=new Xd;r.setAttribute("position",new zd([0,0,0,1,1,1],3));const a=new Om(r,new Mm(dv));a.renderOrder=1/0,a.visible=!1,e.add(a);const o=t.subscribeApply(((e,r)=>{i.position.set(0,0,0),n.position.copy(r.initial.position).sub(r.current.position);const o=t.getTarget();null!=o&&(Tv.copy(o.quaternion).invert(),n.position.applyQuaternion(Tv)),a.position.set(0,0,0),a.scale.copy(n.position),n.visible=!r.last,a.visible=!r.last,i.visible=!r.last}));return()=>{n.geometry.dispose(),n.material.dispose(),i.geometry.dispose(),i.material.dispose(),a.geometry.dispose(),a.material.dispose(),e.remove(n),e.remove(i),e.remove(a),o()}}(this,this.context),n=this.translationX.bind(16711680,16776960,e),i=this.translationY.bind(65280,16776960,e),r=this.translationZ.bind(255,16776960,e),a=this.translationNegX.bind(16711680,16776960,e),o=this.translationNegY.bind(65280,16776960,e),s=this.translationNegZ.bind(255,16776960,e),l=this.translationXY.bind(255,16776960,e),c=this.translationYZ.bind(16711680,16776960,e),u=this.translationXZ.bind(65280,16776960,e),d=this.free.bind(e);return()=>{t(),n?.(),i?.(),r?.(),a?.(),o?.(),s?.(),l?.(),c?.(),u?.(),d?.()}}}class Uv extends mv{constructor(e){super(e,"xyz","",(()=>({scale:{uniform:!0,...this.options},rotate:!1,translate:"as-scale",multitouch:!1})))}bind(e){const t=gv(this.axis,e);if(!1===t)return;this.options=t;const n=new kd(dv),i=hv(this.context,n,this.tag,{opacity:.25,hoverOpacity:1,color:16777215,hoverColor:16776960}),r=new uh(new hh(.1,.1,.1),n);r.renderOrder=1/0,this.add(r);const a=new uh(new hh(.2,.2,.2));a.visible=!1,a.pointerEventsOrder=1/0,this.add(a);const o=this.context.registerHandle(this.store,a,this.tag);return()=>{n.dispose(),a.geometry.dispose(),r.geometry.dispose(),o(),i?.(),this.remove(a),this.remove(r)}}}const zv=new Yu(0,0,-Math.PI/2),Fv=new Yu(0,0,Math.PI/2);class Bv extends mv{invert;showHandleLine;constructor(e,t,n="",i=!1,r=!0){super(e,t,n,(()=>({scale:this.options,rotate:!1,translate:"as-scale",multitouch:!1}))),this.invert=i,this.showHandleLine=r}bind(e,t,n){const i=gv(this.axis,n);if(!1===i)return;this.options=i;const r=this.invert?Fv:zv,a=new fm;a.position.x=this.invert?-.5:.5,a.rotation.copy(r),this.add(a);const o=new kd(dv),s=hv(this.context,o,this.tag,{color:e,hoverColor:t}),l=new uh(new hh(.08,.08,.08),o);let c,u,d;if(l.renderOrder=1/0,l.rotation.copy(r),a.add(l),this.showHandleLine){d=new fm,d.rotation.copy(r),this.add(d);const n=new kd(dv);c=hv(this.context,n,this.tag,{color:e,hoverColor:t}),u=new uh(new Um(.0075,.0075,.5,3),n),u.renderOrder=1/0,u.position.y=.25,d.add(u)}const h=new fm;h.visible=!1,h.rotation.copy(r),h.position.x=this.invert?-.3:.3,this.add(h);const f=new uh(new Um(.2,0,.6,4));f.pointerEventsOrder=1/0,f.position.y=.04,h.add(f);const p=this.context.registerHandle(this.store,f,this.tag);return()=>{o.dispose(),f.geometry.dispose(),l.geometry.dispose(),u?.geometry.dispose(),p(),s?.(),c?.(),this.remove(l),null!=d&&this.remove(d),this.remove(h),this.remove(a)}}}class Hv extends mv{constructor(e,t,n=""){super(e,t,n,(()=>({translate:"as-scale",scale:this.options,rotate:!1,multitouch:!1})))}bind(e,t,n){const i=gv(this.axis,n);if(!1===i)return;this.options=i;const r=new kd(dv),a=hv(this.context,r,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t}),o=new uh(new hh(.2,.2,.01),r);o.renderOrder=1/0,o.pointerEventsOrder=1/0,o.position.set(.15,.15,0);const s=this.context.registerHandle(this.store,o,this.tag);return this.add(o),()=>{r.dispose(),o.geometry.dispose(),s(),a?.(),this.remove(o)}}}const Vv=new cu;class jv extends fm{context;size;fixed;free;translationX;translationY;translationZ;translationNegX;translationNegY;translationNegZ;translationXY;translationYZ;translationXZ;constructor(e,t,n){super(),this.context=e,this.size=t,this.fixed=n,this.free=new Uv(this.context),this.add(this.free),this.translationX=new Bv(this.context,"x"),this.add(this.translationX),this.translationY=new Bv(this.context,"y"),this.translationY.rotation.z=Math.PI/2,this.add(this.translationY),this.translationZ=new Bv(this.context,"z"),this.translationZ.rotation.y=-Math.PI/2,this.add(this.translationZ),this.translationNegX=new Bv(this.context,"x",void 0,!0,!1),this.add(this.translationNegX),this.translationNegY=new Bv(this.context,"y",void 0,!0,!1),this.translationNegY.rotation.z=Math.PI/2,this.add(this.translationNegY),this.translationNegZ=new Bv(this.context,"z",void 0,!0,!1),this.translationNegZ.rotation.y=-Math.PI/2,this.add(this.translationNegZ),this.translationXY=new Hv(this.context,"xy"),this.add(this.translationXY),this.translationXZ=new Hv(this.context,"xz"),this.translationXZ.rotation.x=Math.PI/2,this.add(this.translationXZ),this.translationYZ=new Hv(this.context,"yz"),this.translationYZ.rotation.y=-Math.PI/2,this.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(Vv),this.scale.divide(Vv)),this.scale.multiplyScalar(xv(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.translationX.bind(16711680,16776960,e),n=this.translationY.bind(65280,16776960,e),i=this.translationZ.bind(255,16776960,e),r=this.translationNegX.bind(16711680,16776960,e),a=this.translationNegY.bind(65280,16776960,e),o=this.translationNegZ.bind(255,16776960,e),s=this.translationXY.bind(255,16776960,e),l=this.translationYZ.bind(16711680,16776960,e),c=this.translationXZ.bind(65280,16776960,e),u=this.free.bind(e);return()=>{t?.(),n?.(),i?.(),r?.(),a?.(),o?.(),s?.(),l?.(),c?.(),u?.()}}}const Gv={x:{vector1:new cu(0,0,-1),vector2:new cu(0,-1,0),rotationOffset:new lu,axis:[1,0,0]},y:{vector1:new cu(0,0,-1),vector2:new cu(-1,0,-1),rotationOffset:(new lu).setFromEuler(new Yu(0,0,Math.PI/2)),axis:[0,1,0]},z:{vector1:new cu(-1,0,0),vector2:new cu(0,-1,0),rotationOffset:(new lu).setFromEuler(new Yu(0,Math.PI/2,0)),axis:[0,0,1]}},Wv=new cu,Xv=new cu,$v=new cu,qv=new cu,Yv=new lu;class Zv extends mv{direction=new cu(1,0,0);constructor(e,t,n=""){super(e,t,n,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1})))}update(e){const{rotationOffset:t,vector1:n,vector2:i}=Gv[this.axis];e.getWorldPosition(Wv),this.getWorldPosition(Xv).sub(Wv),$v.copy(n),qv.copy(i);const r=this.context.getTarget(),a=this.context.getSpace();"local"===a&&null!=r&&(r.getWorldQuaternion(Yv),$v.applyQuaternion(Yv),qv.applyQuaternion(Yv)),qv.crossVectors($v,qv);const o=Xv.dot(qv);qv.multiplyScalar(o),Xv.sub(qv),this.quaternion.setFromUnitVectors($v,Xv.normalize()),"local"===a&&null!=r&&(r.getWorldQuaternion(Yv),this.quaternion.multiply(Yv)),this.quaternion.multiply(t),null!=r?.parent?(r.parent.matrixWorld.decompose(Wv,Yv,Xv),Yv.invert(),this.quaternion.premultiply(Yv)):Yv.identity(),null==this.store.getState()&&(this.direction.fromArray(Gv[this.axis].axis),this.direction.applyQuaternion("local"===a&&null!=r?r?.quaternion:Yv)),null!=r&&this.quaternion.premultiply(Yv.copy(r.quaternion).invert())}bind(e,t){const n=gv(this.axis,t);if(!1===n)return;this.options=n;const i=new kd(dv),r=hv(this.context,i,this.tag,{color:e,hoverColor:16776960}),a=new uh(sy(.5,.5),i);a.renderOrder=1/0,this.add(a);const o=new uh(new Vm(.5,.1,4,24));o.visible=!1,o.pointerEventsOrder=1/0,o.rotation.set(0,-Math.PI/2,-Math.PI/2),this.add(o);const s=this.context.registerHandle(this.store,o,this.tag);return()=>{i.dispose(),o.geometry.dispose(),a.geometry.dispose(),s(),r?.(),this.remove(o),this.remove(a)}}}const Kv=new cu,Qv=new cu,Jv=new cu(1,0,0),ey=new lu;class ty extends mv{constructor(e,t=""){super(e,"xyz",t,(()=>({scale:!1,translate:"as-rotate",rotate:this.options,multitouch:!1})))}update(e){e.getWorldPosition(Kv),this.getWorldPosition(Qv).sub(Kv),this.quaternion.setFromUnitVectors(Jv,Qv.normalize());const t=this.context.getTarget();null!=t?.parent&&(t.parent.matrixWorld.decompose(Kv,ey,Qv),ey.invert(),this.quaternion.premultiply(ey)),null!=t&&(ey.copy(t.quaternion).invert(),this.quaternion.premultiply(ey))}bind(e){const t=gv(this.axis,e);if(!1===t)return;this.options=t;const n=new kd(dv),i=hv(this.context,n,this.tag,{color:16777215,hoverColor:16776960,opacity:.25}),r=new uh(sy(.5,1),n);r.renderOrder=1/0,this.add(r);const a=new uh(new Hm(.25,10,8));a.visible=!1,a.pointerEventsOrder=1/0,this.add(a);const o=this.context.registerHandle(this.store,a,this.tag);return()=>{this.pointerEvents="none",n.dispose(),a.geometry.dispose(),r.geometry.dispose(),o(),i?.(),this.remove(a),this.remove(r)}}}const ny=new cu,iy=new cu,ry=new cu(1,0,0),ay=new lu;class oy extends mv{direction=new cu(1,0,0);constructor(e,t=""){super(e,"e",t,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1})))}update(e){e.getWorldPosition(ny),this.getWorldPosition(this.direction).sub(ny).normalize(),this.quaternion.setFromUnitVectors(ry,this.direction);const t=this.context.getTarget();null!=t?.parent&&(t.parent.matrixWorld.decompose(ny,ay,iy),ay.invert(),this.quaternion.premultiply(ay),this.direction.applyQuaternion(ay)),null!=t&&(ay.copy(t.quaternion).invert(),this.quaternion.premultiply(ay)),this.direction.negate()}bind(e){const t=gv(this.axis,e);if(!1===t)return;this.options=t;const n=new kd(dv),i=hv(this.context,n,this.tag,{color:16776960,hoverColor:16776960,opacity:.5}),r=new uh(sy(.75,1),n);r.renderOrder=1/0,this.add(r);const a=new uh(new Vm(.75,.1,2,24),new kd({color:"white"}));a.visible=!1,a.rotation.y=Math.PI/2,a.pointerEventsOrder=1/0,this.add(a);const o=this.context.registerHandle(this.store,a,this.tag);return()=>{n.dispose(),a.geometry.dispose(),r.geometry.dispose(),o(),i?.(),this.remove(a),this.remove(r)}}}function sy(e,t){const n=new Vm(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}const ly=new cu;class cy extends fm{context;fixed;size;rotationX;rotationY;rotationZ;free;screen;constructor(e,t,n){super(),this.context=e,this.fixed=t,this.size=n,this.rotationX=new Zv(this.context,"x"),this.add(this.rotationX),this.rotationY=new Zv(this.context,"y"),this.add(this.rotationY),this.rotationZ=new Zv(this.context,"z"),this.add(this.rotationZ),this.free=new ty(this.context),this.add(this.free),this.screen=new oy(this.context),this.add(this.screen)}update(e){this.updateWorldMatrix(!0,!1),this.rotationX.update(e),this.rotationY.update(e),this.rotationZ.update(e),this.free.update(e),this.screen.update(e),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(ly),this.scale.divide(ly)),this.scale.multiplyScalar(xv(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.rotationX.bind(16711680,e),n=this.rotationY.bind(65280,e),i=this.rotationZ.bind(255,e),r=this.screen.bind(e),a=this.free.bind(e);return()=>{t?.(),n?.(),i?.(),r?.(),a?.()}}}const uy=new Yu,dy=new Yu(0,0,Math.PI/2),hy=new Yu(0,-Math.PI/2,0);class fy extends fm{xAxisHighlight;yAxisHighlight;zAxisHighlight;handles;context;constructor(e){super(),this.context=new uv(this,e),this.xAxisHighlight=new pv(this.context,uy),this.add(this.xAxisHighlight),this.yAxisHighlight=new pv(this.context,dy),this.add(this.yAxisHighlight),this.zAxisHighlight=new pv(this.context,hy),this.add(this.zAxisHighlight)}set space(e){this.context.space=e}get space(){return this.context.space}update(e,t){this.context.update(e),this.xAxisHighlight.update(),this.yAxisHighlight.update(),this.zAxisHighlight.update(),this.handles?.update(t)}bind(e,t){const n=this.xAxisHighlight.bind("x"),i=this.yAxisHighlight.bind("y"),r=this.zAxisHighlight.bind("z");switch(e){case"rotate":this.handles=new cy(this.context);break;case"scale":this.handles=new jv(this.context);break;case"translate":this.handles=new Ov(this.context)}this.add(this.handles);const a=this.handles.bind(t);return()=>{null!=this.handles&&this.remove(this.handles),this.handles=void 0,a(),n(),i(),r()}}}new cu(0,0,1),new cu(0,1,0),new cu,new cu,new cu;class py{nativeEvent;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;relatedTarget=null;get altKey(){return this.getFromNative("altKey",!1)}get button(){return this.getFromNative("button",0)}get buttons(){return this.getFromNative("buttons",0)}get clientX(){return this.getFromNative("clientX",0)}get clientY(){return this.getFromNative("clientY",0)}get ctrlKey(){return this.getFromNative("ctrlKey",!1)}get layerX(){return this.getFromNative("layerX",0)}get layerY(){return this.getFromNative("layerY",0)}get metaKey(){return this.getFromNative("metaKey",!1)}get movementX(){return this.getFromNative("movementX",0)}get movementY(){return this.getFromNative("movementY",0)}get offsetX(){return this.getFromNative("offsetX",0)}get offsetY(){return this.getFromNative("offsetY",0)}get pageX(){return this.getFromNative("pageX",0)}get pageY(){return this.getFromNative("pageY",0)}get screenX(){return this.getFromNative("screenX",0)}get screenY(){return this.getFromNative("screenY",0)}get shiftKey(){return this.getFromNative("shiftKey",!1)}get x(){return this.getFromNative("x",0)}get y(){return this.getFromNative("y",0)}get detail(){return this.getFromNative("detail",0)}get view(){return this.getFromNative("view",null)}get which(){return this.getFromNative("which",0)}get cancelBubble(){return this.getFromNative("cancelBubble",!1)}get composed(){return this.getFromNative("composed",!1)}get eventPhase(){return this.getFromNative("eventPhase",0)}get isTrusted(){return this.getFromNative("isTrusted",!1)}get returnValue(){return this.getFromNative("returnValue",!1)}get timeStamp(){return this.getFromNative("timeStamp",0)}get cancelable(){return this.getFromNative("cancelable",!1)}get defaultPrevented(){return this.getFromNative("defaultPrevented",!1)}constructor(e){this.nativeEvent=e}getFromNative(e,t){return e in this.nativeEvent?this.nativeEvent[e]:t}}const my=new cu;class gy extends py{type;bubbles;internalPointer;intersection;camera;currentObject;object;propagationState;get pointerId(){return this.internalPointer.id}get pointerType(){return this.internalPointer.type}get pointerState(){return this.internalPointer.state}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return null==this._pointer&&(my.copy(this.intersection.point).project(this.camera),this._pointer=new Ic(my.x,my.y)),this._pointer}_ray;get ray(){if(null!=this._ray)return this._ray;switch(this.intersection.details.type){case"screen-ray":case"ray":case"sphere":return this._ray=new zu(this.intersection.pointerPosition,new cu(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case"lines":return this._ray=new zu(this.intersection.details.line.start,this.intersection.details.line.end.clone().sub(this.intersection.details.line.start).normalize())}}_intersections=[];get intersections(){return null==this._intersections&&(this._intersections=[{...this.intersection,eventObject:this.currentObject}]),this._intersections}_unprojectedPoint;get unprojectedPoint(){if(null==this._unprojectedPoint){const e=this.pointer;this._unprojectedPoint=new cu(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}get stopped(){return this.propagationState.stoppedImmediate||this.propagationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw new Error("not supported")}constructor(e,t,n,i,r,a,o=r.object,s=o,l={stopped:!t,stoppedImmediate:!1}){super(n),this.type=e,this.bubbles=t,this.internalPointer=i,this.intersection=r,this.camera=a,this.currentObject=o,this.object=s,this.propagationState=l}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(e){return new gy(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target,this.propagationState)}}class vy extends gy{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,i,r,a){super("wheel",!0,e,t,n,i,r,a)}retarget(e){return new vy(this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target)}}function yy(e){xy(e,e.currentObject)}function xy(e,t){if(null==t)return;const n=function(e,t){if(null!=e._listeners&&t in e._listeners)return e._listeners[t];let n;e.isVoidObject&&"click"===t&&null!=e.parent?.__r3f&&(n=e.parent.__r3f.root.getState().onPointerMissed);null!=e.__r3f&&(n=e.__r3f.handlers[_y[t]]);if(null==n)return;return[n]}(t,e.type);if(null!=n&&n.length>0){const i=e.retarget(t),r=n.length;for(let e=0;e<r&&!i.stoppedImmediate;e++)n[e](i)}e.stopped||xy(e,t.parent)}const _y={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"},by=Object.keys(_y);const Sy=new Hm(1e10),wy=new Map;function My(e){let t=wy.get(e);return null==t&&(t=new uh(Sy),t.isVoidObject=!0,t.parent=e,t.pointerEventsOrder=-1/0,wy.set(e,t)),t}function Ey(e,t){return t?!e:e}function Ty(e,t,n,i=!1,r,a,o){const s=i||function(e,t){if(t.ancestorsHaveListeners)return!0;if("pointer"===e&&t.ancestorsHavePointerListeners)return!0;if("wheel"===e&&t.ancestorsHaveWheelListeners)return!0;if(null!=t.__r3f&&t.__r3f?.eventCount>0){if("wheel"===e&&null!=t.__r3f.handlers.onWheel)return!0;if("pointer"===e&&Object.keys(t.__r3f.handlers).some((e=>"onWheel"!=e)))return!0}if(null==t._listeners)return!1;if("wheel"===e){const e=t._listeners.wheel;return null!=e&&e.length>0}const n=Object.entries(t._listeners),i=n.length;for(let e=0;e<i;e++){const t=n[e];if("wheel"!==t[0]&&(by.includes(t[0])&&null!=t[1]&&t[1].length>0))return!0}return!1}(e,t),l=t.pointerEvents??r,c=l??t.defaultPointerEvents??"listener",u=t.pointerEventsType??a??"all",d=t.pointerEventsOrder??o??0,h=function(e,t,n){if("none"===t)return!1;if("listener"===t&&!e)return!1;if("all"===n)return!0;if("function"==typeof n)return({id:e,type:t,state:i})=>n(e,t,i);let i,r;return"deny"in n?(r=!0,i=n.deny):(r=!1,i=n.allow),Array.isArray(i)?e=>Ey(i.includes(e.type),r):e=>Ey(i===e.type,r)}(s,c,u),f=n.length;if(1===f)(!0===h||"function"==typeof h&&h(n[0]))&&Ay(n[0],t,c,u,d);else if(!0===h)for(let e=0;e<f;e++)Ay(n[e],t,c,u,d);else if("function"==typeof h)for(let e=0;e<f;e++){const i=n[e];h(i)&&Ay(i,t,c,u,d)}if(0===t.children.length||!1===t.intersectChildren)return;const p=t.interactableDescendants??t.children,m=p.length;for(let t=0;t<m;t++)Ty(e,p[t],n,s,l,u,d)}function Ay({intersector:e,options:t},n,i,r,a){!1!==t.filter?.(n,i,r,a)&&e.executeIntersection(n,a)}function Cy(e,t=0,n,i=0){return t!=i?i-t:e.distance-n.distance}const Ry=1e7;const Py=Symbol("buttonsDownTime"),Ly=Symbol("buttonsClickTime"),ky=new Map;function Ny(e){return ky.get(e)}hd.prototype.setPointerCapture=function(e){Ny(e)?.setCapture(this)},hd.prototype.releasePointerCapture=function(e){const t=Ny(e);null!=t&&t.hasCaptured(this)&&t.setCapture(void 0)},hd.prototype.hasPointerCapture=function(e){return Ny(e)?.hasCaptured(this)??!1};class Dy{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,i,r,a,o,s,l={}){this.id=e,this.type=t,this.state=n,this.intersector=i,this.getCamera=r,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=s,this.options=l,ky.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(null!=this.pointerCapture&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),null!=e&&null!=this.intersection&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(e||null==this.pointerCapture||(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return null!=this.pointerCapture?this.intersector.intersectPointerCapture(this.pointerCapture,n):(this.intersector.startIntersection(n),Ty(e,t,[this]),this.intersector.finalizeIntersection(t))}setIntersection(e){this.intersection=e}commit(e,t){const n=this.getCamera(),i=this.prevEnabled?this.prevIntersection:void 0,r=this.enabled?this.intersection:void 0;null!=i&&i.object!=r?.object&&yy(new gy("pointerout",!0,e,this,i,n));const a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,Iy(r?.object,this.pointerEntered,a,this.pointerEnteredHelper);const o=a.length;for(let t=0;t<o;t++){const r=a[t];yy(new gy("pointerleave",!1,e,this,i,n,r))}null!=r&&i?.object!=r.object&&yy(new gy("pointerover",!0,e,this,r,n));for(let t=this.pointerEnteredHelper.length-1;t>=0;t--){const i=this.pointerEnteredHelper[t];yy(new gy("pointerenter",!1,e,this,r,n,i))}if(t&&null!=r&&yy(new gy("pointermove",!0,e,this,r,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;t<e;t++)this.onFirstMove[t](n);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection("pointer",e,t),this.commit(t,!0)}emitMove(e){null!=this.intersection&&yy(new gy("pointermove",!0,e,this,this.intersection,this.getCamera()))}down(e){if(this.buttonsDown.add(e.button),!this.enabled)return;if(!this.wasMoved)return void this.onFirstMove.push(this.down.bind(this,e));if(null==this.intersection)return;yy(new gy("pointerdown",!0,e,this,this.intersection,this.getCamera()));const{object:t}=this.intersection;t[Py]??=new Map,t[Py].set(e.button,e.timeStamp),this.buttonsDownTime.set(e.button,e.timeStamp)}up(e){if(this.buttonsDown.delete(e.button),!this.enabled)return;if(!this.wasMoved)return void this.onFirstMove.push(this.up.bind(this,e));if(null==this.intersection)return;const{contextMenuButton:t=2,dblClickThresholdMs:n=500,clickThesholdMs:i=300}=this.options;this.pointerCapture=void 0;const r=function(e,t,n,i,r){if(null==t)return!1;const a=t.get(n);if(null==a)return!1;if(i-a>r)return!1;if(a!=e.get(n))return!1;return!0}(this.buttonsDownTime,this.intersection.object[Py],e.button,e.timeStamp,i),a=this.getCamera();if(r&&e.button===t&&yy(new gy("contextmenu",!0,e,this,this.intersection,a)),yy(new gy("pointerup",!0,e,this,this.intersection,a)),!r||e.button===t)return;yy(new gy("click",!0,e,this,this.intersection,a));const{object:o}=this.intersection,s=o[Ly]??=new Map,l=s.get(e.button);null==l||e.timeStamp-l>n?s.set(e.button,e.timeStamp):(yy(new gy("dblclick",!0,e,this,this.intersection,a)),s.delete(e.button))}cancel(e){this.enabled&&(this.wasMoved?null!=this.intersection&&yy(new gy("pointercancel",!0,e,this,this.intersection,this.getCamera())):this.onFirstMove.push(this.cancel.bind(this,e)))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n)return void this.onFirstMove.push(this.wheel.bind(this,e,t,n));n||(this.wheelIntersection=this.computeIntersection("wheel",e,t));const i=n?this.intersection:this.wheelIntersection;null!=i&&yy(new vy(t,this,i,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t)return void this.onFirstMove.push(this.emitWheel.bind(this,e,t));const n=t?this.intersection:this.wheelIntersection;null!=n&&yy(new vy(e,this,n,this.getCamera()))}exit(e){this.wasMoved&&(null!=this.pointerCapture&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}}function Iy(e,t,n,i){if(null==e)return;const r=n.indexOf(e);-1!=r?n.splice(r,1):i.push(e),t.push(e),Iy(e.parent,t,n,i)}const Oy=new wd,Uy=new wd,zy=new Ic,Fy=new Ic,By=new Ic,Hy=new cu,Vy=new Fu,jy=new cu;function Gy(e,t,n){jy.copy(t).applyMatrix4(Vy.copy(n.matrixWorld).invert());const i=n.geometry.attributes.uv;if(null==i||!(i instanceof Id))return!1;let r;return function(e,t){const n=e.geometry.drawRange;if(null!=e.geometry.index){const i=e.geometry.index,r=Math.max(0,n.start),a=Math.min(i.count,n.start+n.count);for(let e=r;e<a;e+=3)t(i.getX(e),i.getX(e+1),i.getX(e+2));return}const i=e.geometry.attributes.position;if(null==i)return;const r=Math.max(0,n.start),a=Math.min(i.count,n.start+n.count);for(let e=r;e<a;e+=3)t(e,e+1,e+2)}(n,((e,t,a)=>{n.getVertexPosition(e,Oy.a),n.getVertexPosition(t,Oy.b),n.getVertexPosition(a,Oy.c);const o=Oy.closestPointToPoint(jy,Hy).distanceTo(jy);null!=r&&o>=r||(r=o,Uy.copy(Oy),zy.fromBufferAttribute(i,e),Fy.fromBufferAttribute(i,t),By.fromBufferAttribute(i,a))})),null!=r&&(Uy.closestPointToPoint(jy,Hy),Uy.getInterpolation(Hy,zy,Fy,By,e),!0)}new Fu,new class{constructor(e=new cu,t=new cu){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){$m.subVectors(e,this.start),qm.subVectors(this.end,this.start);const n=qm.dot(qm);let i=qm.dot($m)/n;return t&&(i=Lc(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},new cu,new Ph,new zu,new Ic,new cu(0,0,0),new cu(0,0,1);const Wy=new Fu,Xy=new cu;new cu(0,0,-1),new Ph;const $y=new Ic,qy=new cu;class Yy{prepareTransformation;options;raycaster=new Gm;cameraQuaternion=new lu;fromPosition=new cu;fromQuaternion=new lu;coords=new Ic;viewPlane=new Ph;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},n){const i=e.details;if("screen-ray"!=i.type)throw new Error(`unable to process a pointer capture of type "${e.details.type}" with a camera ray intersector`);if(!this.startIntersection(n))return e;this.viewPlane.constant-=i.distanceViewPlane;const r=this.raycaster.ray.intersectPlane(this.viewPlane,new cu);if(null==r)return e;e.object.updateWorldMatrix(!0,!1),function(e,t,n){const i=t.normal??t.face?.normal;null!=i&&(e.setFromNormalAndCoplanarPoint(i,t.localPoint),e.applyMatrix4(n))}(this.viewPlane,e,e.object.matrixWorld);let a=e.uv;return e.object instanceof uh&&Gy($y,r,e.object)&&(a=$y.clone()),{...e,details:{...i,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:a,object:t,point:r,pointOnFace:r,pointerPosition:this.raycaster.ray.origin.clone(),pointerQuaternion:this.cameraQuaternion.clone()}}startIntersection(e){const t=this.prepareTransformation(e,this.coords);return null!=t&&(t.updateWorldMatrix(!0,!1),t.matrixWorld.decompose(this.fromPosition,this.fromQuaternion,Xy),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(qy),this.raycaster.ray.origin),!0)}executeIntersection(e,t){const n=this.intersects.length;e.raycast(this.raycaster,this.intersects),function(e,t,n){for(;n>0;)e.push(t),--n}(this.pointerEventsOrders,t,this.intersects.length-n)}finalizeIntersection(e){const t=this.fromPosition.clone(),n=this.cameraQuaternion.clone(),i=this.raycaster.ray.direction.clone(),r=function(e,t,{customSort:n=Cy}={},i){let r,a,o;const s=e.length;for(let i=0;i<s;i++){const s=e[i],l=t?.[i];(null==r||n(s,l,r,a)<0)&&(o=i,r=s,a=l)}return o}(this.intersects,this.pointerEventsOrders,this.options),a=null==r?void 0:this.intersects[r];return this.intersects.length=0,this.pointerEventsOrders.length=0,null==a?function(e,t,n,i,r,a=0){const o=t.direction.clone().multiplyScalar(Ry),s=Ry;return{distance:s+a,object:My(e),point:o,normal:t.origin.clone().sub(o).normalize(),details:n(o,s),pointerPosition:i,pointerQuaternion:r,pointOnFace:o,localPoint:o}}(e,this.raycaster.ray,((e,t)=>({type:"screen-ray",distanceViewPlane:t,screenPoint:this.coords.clone(),direction:i})),t,n):(a.object.updateWorldMatrix(!0,!1),Wy.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:"screen-ray",distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:i},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(Wy)}))}}new cu,new Ic,new Fu,new cu,new Ph,new Pu,new cu,new cu,new cu,new cu(1e-4,1e-4,1e-4),new Fu;let Zy=23412;function Ky(e,t,n){if(!(t instanceof globalThis.MouseEvent))return n.set(0,0);const{width:i,height:r,top:a,left:o}=e.getBoundingClientRect(),s=t.clientX-o,l=t.clientY-a;return n.set(s/i*2-1,-l/r*2+1)}function Qy(e,t,n,i){return function(e,t,n,i,r,a,o={}){const s=o?.forwardPointerCapture??!0,l=new Map,c=o.pointerTypePrefix??"forward-",u=(e,u)=>{let d=l.get(e.pointerId);return null!=d||(d=new Dy(Zy++,`${c}${e.pointerType}`,e.pointerState,new Yy(((e,n)=>(i(e,n),t())),o),t,void 0,s?r.bind(null,e.pointerId):void 0,s?a.bind(null,e.pointerId):void 0,o),"move"!=u&&"wheel"!=u&&(d.setIntersection(d.computeIntersection("pointer",n,e)),d.commit(e,!1)),l.set(e.pointerId,d)),d},d=new Map,h=new Map,f=[],p=[],m=(e,t,i)=>{switch(e){case"move":return void i.move(n,t);case"wheel":return void i.wheel(n,t);case"cancel":return void i.cancel(t);case"down":if(!Jy(t))return;return void i.down(t);case"up":if(!Jy(t))return;return void i.up(t);case"exit":return h.delete(i),d.delete(i),void i.exit(t)}},g=(e,t)=>{const n=u(t,e);"move"===e&&h.set(n,t),"wheel"===e&&d.set(n,t),o.batchEvents??1?p.push({type:e,event:t}):m(e,t,n)},v=g.bind(null,"move"),y=g.bind(null,"cancel"),x=g.bind(null,"down"),_=g.bind(null,"up"),b=g.bind(null,"wheel"),S=g.bind(null,"exit");return e.addEventListener("pointermove",v),e.addEventListener("pointercancel",y),e.addEventListener("pointerdown",x),e.addEventListener("pointerup",_),e.addEventListener("wheel",b),e.addEventListener("pointerleave",S),{destroy(){e.removeEventListener("pointermove",v),e.removeEventListener("pointercancel",y),e.removeEventListener("pointerdown",x),e.removeEventListener("pointerup",_),e.removeEventListener("wheel",b),e.removeEventListener("pointerleave",S),h.clear(),d.clear()},update(){const e=p.length;for(let t=0;t<e;t++){const{type:e,event:n}=p[t],i=u(n,e);"move"!==e||(f.push(i),h.get(i)==n)?"wheel"!==e||d.get(i)==n?m(e,n,i):i.emitWheel(n):i.emitMove(n)}if(p.length=0,o.intersectEveryFrame)for(const[e,t]of h.entries())f.includes(e)||e.move(n,t);f.length=0}}}(e,"function"==typeof t?t:()=>t,n,Ky.bind(null,e),e.setPointerCapture.bind(e),e.releasePointerCapture.bind(e),{pointerTypePrefix:"screen-",...i})}function Jy(e){return null!=e.button}new Ic,new cu,new cu,new cu,new Ic,new Ic,new cu,new cu,new Ic,new Ic,new Ic,new Ic,new cu,new cu;class ex{constructor(e){this.xrDevice=e,this.combinedCameraPosition=new cu,this.isPointerLocked=!1,this.vec3=new cu,this.quat=new lu,this.keyState={ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},this.lastTime=0,this.scene=new wm,this.camera=new Sh(50,window.innerWidth/window.innerHeight,.1,40),this.playerRig=new fm,this.cameraRig=new fm,this.scene.add(this.playerRig),this.playerRig.add(this.cameraRig),this.cameraRig.position.fromArray(e.position.vec3),this.cameraRig.quaternion.fromArray(e.quaternion.quat),this.cameraRig.add(this.camera),this.camera.position.x-=e.ipd/2;const t=new uh(new Bm(.25,.27,32),new kd({color:16777215,side:el}));t.rotateX(-Math.PI/2),this.scene.add(t),this.renderer=new Sm({alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setClearColor(0,0),this.renderer.domElement.style.position="fixed",this.renderer.domElement.style.top="50vh",this.renderer.domElement.style.left="50vw",this.renderer.domElement.style.transform="translate(-50%, -50%)",this.transformHandles=new Map,["left","right"].forEach((t=>{const n=new fy;n.scale.setScalar(.1),n.position.fromArray(e.controllers[t].position.vec3),n.quaternion.fromArray(e.controllers[t].quaternion.quat),this.cameraRig.attach(n),n.userData={defaultPosition:n.position.toArray(),defaultQuaternion:n.quaternion.toArray()},n.userData.setMode=e=>{var t,i;null===(i=(t=n.userData).modeCleanup)||void 0===i||i.call(t),n.userData.modeCleanup=n.bind(e),n.userData.mode=e},n.userData.setMode("translate"),n.space="local",this.transformHandles.set(t,n),n.addEventListener("click",(()=>{"translate"===n.userData.mode?n.userData.setMode("rotate"):n.userData.setMode("translate")}))})),window.transformHandles=this.transformHandles,this.mouseMoveHandler=t=>{if(!this.isPointerLocked)return;const n=t.movementX||t.mozMovementX||t.webkitMovementX||0,i=t.movementY||t.mozMovementY||t.webkitMovementY||0;this.playerRig.rotation.y-=.002*n,this.cameraRig.rotation.x-=.002*i,e.quaternion.copy(this.cameraRig.getWorldQuaternion(new lu))},this.cameraRig.getWorldPosition(this.combinedCameraPosition),this.headsetDefaultPosition=this.cameraRig.position.clone(),this.headsetDefaultQuaternion=this.cameraRig.quaternion.clone(),this.forwardHtmlEvents=Qy(this.renderer.domElement,(()=>this.camera),this.scene).update,document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){this.renderer.domElement.requestPointerLock=this.renderer.domElement.requestPointerLock||this.renderer.domElement.mozRequestPointerLock||this.renderer.domElement.webkitRequestPointerLock,this.renderer.domElement.requestPointerLock()}pointerLockChangeHandler(){this.isPointerLocked=document.pointerLockElement===this.renderer.domElement||document.mozPointerLockElement===this.renderer.domElement||document.webkitPointerLockElement===this.renderer.domElement,this.isPointerLocked?(document.addEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEach((e=>{e.visible=!1}))):(document.removeEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEach((e=>{e.visible=!0})))}keyDownHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!0),t.ShiftLeft&&t.ArrowUp&&(this.cameraRig.position.y+=.05),t.ShiftLeft&&t.ArrowDown&&(this.cameraRig.position.y-=.05)}keyUpHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!1)}movePlayerRig(e){const{playerRig:t,keyState:n,vec3:i}=this;i.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),i.lengthSq()>0&&n.ShiftLeft&&(i.normalize().multiplyScalar(2*e).applyQuaternion(t.quaternion),t.position.add(i))}resetDeviceTransforms(){const{playerRig:e,cameraRig:t,transformHandles:n}=this;t.position.copy(this.headsetDefaultPosition),t.quaternion.copy(this.headsetDefaultQuaternion),e.position.set(0,0,0),e.quaternion.set(0,0,0,1),n.forEach((e=>{e.position.fromArray(e.userData.defaultPosition),e.quaternion.fromArray(e.userData.defaultQuaternion)}))}syncDeviceTransforms(){const{xrDevice:e,cameraRig:t,transformHandles:n}=this;e.position.copy(t.getWorldPosition(this.vec3)),e.quaternion.copy(t.getWorldQuaternion(this.quat)),n.forEach(((t,n)=>{const i="controller"===e.primaryInputMode?e.controllers[n]:e.hands[n];i.position.copy(t.getWorldPosition(this.vec3)),i.quaternion.copy(t.getWorldQuaternion(this.quat))}))}renderScene(e){const t=this.xrDevice.fovy/Math.PI*180;let n=!1;this.camera.fov!==t&&(this.camera.fov=t,n=!0);const i=this.xrDevice.canvasDimensions;if(i){const e=this.renderer.domElement;(e.width!==i.width||e.height!==i.height)&&(this.camera.aspect=i.width/i.height,this.renderer.setSize(i.width,i.height),n=!0)}n&&this.camera.updateProjectionMatrix(),this.isPointerLocked?this.cameraRig.getWorldPosition(this.combinedCameraPosition):(this.cameraRig.position.y=this.combinedCameraPosition.y,this.playerRig.position.x=this.combinedCameraPosition.x,this.playerRig.position.z=this.combinedCameraPosition.z),this.forwardHtmlEvents(),this.transformHandles.forEach(((t,n)=>{var i;const r=Boolean(null===(i=this.xrDevice.controllers[n])||void 0===i?void 0:i.connected);t.visible=r&&!this.isPointerLocked,r&&t.update(e,this.camera)}));const r=Math.min((e-this.lastTime)/1e3,.1);this.movePlayerRig(r),this.syncDeviceTransforms(),this.renderer.render(this.scene,this.camera),this.lastTime=e}get domElement(){return this.renderer.domElement}dispose(){this.renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this.mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const tx="1.1.1";var nx,ix,rx={exports:{}},ax={},ox={exports:{}},sx={};function lx(){return ix||(ix=1,ox.exports=(nx||(nx=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,a=e[i];if(!(0<r(a,t)))break e;e[i]=t,e[n]=a,n=i}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,a=e.length,o=a>>>1;i<o;){var s=2*(i+1)-1,l=e[s],c=s+1,u=e[c];if(0>r(l,n))c<a&&0>r(u,l)?(e[i]=u,e[c]=n,i=c):(e[i]=l,e[s]=n,i=s);else{if(!(c<a&&0>r(u,n)))break e;e[i]=u,e[c]=n,i=c}}}return t}function r(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var r=n(c);null!==r;){if(null===r.callback)i(c);else{if(!(r.startTime<=e))break;i(c),r.sortIndex=r.expirationTime,t(l,r)}r=n(c)}}function b(e){if(m=!1,_(e),!p)if(null!==n(l))p=!0,w||(w=!0,S());else{var t=n(c);null!==t&&L(b,t.startTime-e)}}var S,w=!1,M=-1,E=5,T=-1;function A(){return!(!g&&e.unstable_now()-T<E)}function C(){if(g=!1,w){var t=e.unstable_now();T=t;var r=!0;try{e:{p=!1,m&&(m=!1,y(M),M=-1),f=!0;var a=h;try{t:{for(_(t),d=n(l);null!==d&&!(d.expirationTime>t&&A());){var o=d.callback;if("function"==typeof o){d.callback=null,h=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,_(t),r=!0;break t}d===n(l)&&i(l),_(t)}else i(l);d=n(l)}if(null!==d)r=!0;else{var u=n(c);null!==u&&L(b,u.startTime-t),r=!1}}break e}finally{d=null,h=a,f=!1}r=void 0}}finally{r?S():w=!1}}}if("function"==typeof x)S=function(){x(C)};else if("undefined"!=typeof MessageChannel){var R=new MessageChannel,P=R.port2;R.port1.onmessage=C,S=function(){P.postMessage(null)}}else S=function(){v(C,0)};function L(t,n){M=v((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(i,r,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,i){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(i.sortIndex=a,t(c,i),null===n(l)&&i===n(c)&&(m?(y(M),M=-1):m=!0,L(b,a-o))):(i.sortIndex=s,t(l,i),p||f||(p=!0,w||(w=!0,S()))),i},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(sx)),sx)),ox.exports}var cx,ux,dx,hx,fx={exports:{}},px={};function mx(){if(cx)return px;cx=1;var e=u();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return px.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,px.createPortal=function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:r,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,n,null,i)},px.flushSync=function(e){var t=a.T,n=i.p;try{if(a.T=null,i.p=2,e)return e()}finally{a.T=t,i.p=n,i.d.f()}},px.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},px.prefetchDNS=function(e){"string"==typeof e&&i.d.D(e)},px.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:s}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},px.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},px.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},px.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);i.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},px.requestFormReset=function(e){i.d.r(e)},px.unstable_batchedUpdates=function(e,t){return e(t)},px.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},px.useFormStatus=function(){return a.H.useHostTransitionStatus()},px.version="19.1.0",px}function gx(){if(dx)return ax;dx=1;var e=lx(),t=u(),n=(ux||(ux=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),fx.exports=mx()),fx.exports);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function o(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(a(e)!==e)throw Error(i(188))}function l(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=l(e)))return t;e=e.sibling}return null}var c=Object.assign,d=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),y=Symbol.for("react.consumer"),x=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),A=Symbol.iterator;function C(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=A&&e[A]||e["@@iterator"])?e:null}var R=Symbol.for("react.client.reference");function P(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===R?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case p:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case b:return"Suspense";case S:return"SuspenseList";case E:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case f:return"Portal";case x:return(e.displayName||"Context")+".Provider";case y:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case w:return null!==(t=e.displayName||null)?t:P(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return P(e(t))}catch(e){}}return null}var L=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},I=[],O=-1;function U(e){return{current:e}}function z(e){0>O||(e.current=I[O],I[O]=null,O--)}function F(e,t){O++,I[O]=e.current,e.current=t}var B=U(null),H=U(null),V=U(null),j=U(null);function G(e,t){switch(F(V,t),F(H,e),F(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=id(t=nd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(B),F(B,e)}function W(){z(B),z(H),z(V)}function X(e){null!==e.memoizedState&&F(j,e);var t=B.current,n=id(t,e.type);t!==n&&(F(H,e),F(B,n))}function $(e){H.current===e&&(z(B),z(H)),j.current===e&&(z(j),Xd._currentValue=D)}var q=Object.prototype.hasOwnProperty,Y=e.unstable_scheduleCallback,Z=e.unstable_cancelCallback,K=e.unstable_shouldYield,Q=e.unstable_requestPaint,J=e.unstable_now,ee=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,ne=e.unstable_UserBlockingPriority,ie=e.unstable_NormalPriority,re=e.unstable_LowPriority,ae=e.unstable_IdlePriority,oe=e.log,se=e.unstable_setDisableYieldValue,le=null,ce=null;function ue(e){if("function"==typeof oe&&se(e),ce&&"function"==typeof ce.setStrictMode)try{ce.setStrictMode(le,e)}catch(e){}}var de=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(he(e)/fe|0)|0},he=Math.log,fe=Math.LN2;var pe=256,me=4194304;function ge(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ve(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=134217727&i;return 0!==s?0!==(i=s&~a)?r=ge(i):0!==(o&=s)?r=ge(o):n||0!==(n=s&~e)&&(r=ge(n)):0!==(s=i&~a)?r=ge(s):0!==o?r=ge(o):n||0!==(n=i&~e)&&(r=ge(n)),0===r?0:0!==t&&t!==r&&!(t&a)&&((a=r&-r)>=(n=t&-t)||32===a&&4194048&n)?t:r}function ye(e,t){return!(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function _e(){var e=pe;return!(4194048&(pe<<=1))&&(pe=256),e}function be(){var e=me;return!(62914560&(me<<=1))&&(me=4194304),e}function Se(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function we(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Me(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-de(t);e.entangledLanes|=t,e.entanglements[i]=1073741824|e.entanglements[i]|4194090&n}function Ee(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-de(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function Te(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ae(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Ce(){var e=N.p;return 0!==e?e:void 0===(e=window.event)?32:sh(e.type)}var Re=Math.random().toString(36).slice(2),Pe="__reactFiber$"+Re,Le="__reactProps$"+Re,ke="__reactContainer$"+Re,Ne="__reactEvents$"+Re,De="__reactListeners$"+Re,Ie="__reactHandles$"+Re,Oe="__reactResources$"+Re,Ue="__reactMarker$"+Re;function ze(e){delete e[Pe],delete e[Le],delete e[Ne],delete e[De],delete e[Ie]}function Fe(e){var t=e[Pe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ke]||n[Pe]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=vd(e);null!==e;){if(n=e[Pe])return n;e=vd(e)}return t}n=(e=n).parentNode}return null}function Be(e){if(e=e[Pe]||e[ke]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function He(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(i(33))}function Ve(e){var t=e[Oe];return t||(t=e[Oe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function je(e){e[Ue]=!0}var Ge=new Set,We={};function Xe(e,t){$e(e,t),$e(e+"Capture",t)}function $e(e,t){for(We[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var qe,Ye,Ze=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ke={},Qe={};function Je(e,t,n){if(r=t,q.call(Qe,r)||!q.call(Ke,r)&&(Ze.test(r)?Qe[r]=!0:(Ke[r]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var r}function et(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function tt(e,t,n,i){if(null===i)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+i)}}function nt(e){if(void 0===qe)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);qe=t&&t[1]||"",Ye=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+qe+e+Ye}var it=!1;function rt(e,t){if(!e||it)return"";it=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var i=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){i=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){i=e}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(1!==i||1!==r)do{if(i--,0>--r||l[i]!==c[r]){var u="\n"+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=i&&0<=r);break}}}finally{it=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nt(n):""}function at(e){switch(e.tag){case 26:case 27:case 5:return nt(e.type);case 16:return nt("Lazy");case 13:return nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return rt(e.type,!1);case 11:return rt(e.type.render,!1);case 1:return rt(e.type,!0);case 31:return nt("Activity");default:return""}}function ot(e){try{var t="";do{t+=at(e),e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function st(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ct(e){e._valueTracker||(e._valueTracker=function(e){var t=lt(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ut(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=lt(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function dt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var ht=/[\n"\\]/g;function ft(e){return e.replace(ht,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function pt(e,t,n,i,r,a,o,s){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+st(t)):e.value!==""+st(t)&&(e.value=""+st(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?gt(e,o,st(t)):null!=n?gt(e,o,st(n)):null!=i&&e.removeAttribute("value"),null==r&&null!=a&&(e.defaultChecked=!!a),null!=r&&(e.checked=r&&"function"!=typeof r&&"symbol"!=typeof r),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+st(s):e.removeAttribute("name")}function mt(e,t,n,i,r,a,o,s){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return;n=null!=n?""+st(n):"",t=null!=t?""+st(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}i="function"!=typeof(i=null!=i?i:r)&&"symbol"!=typeof i&&!!i,e.checked=s?e.checked:!!i,e.defaultChecked=!!i,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function gt(e,t,n){"number"===t&&dt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function vt(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+st(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function yt(e,t,n){null==t||((t=""+st(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+st(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function xt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(i(92));if(L(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=st(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function _t(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var bt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function St(e,t,n){var i=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?i?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":i?e.setProperty(t,n):"number"!=typeof n||0===n||bt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function wt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&St(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&St(e,o,t[o])}function Mt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Et=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Tt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function At(e){return Tt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ct=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Pt=null,Lt=null;function kt(e){var t=Be(e);if(t&&(e=t.stateNode)){var n=e[Le]||null;e:switch(e=t.stateNode,t.type){case"input":if(pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Le]||null;if(!a)throw Error(i(90));pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&ut(r)}break e;case"textarea":yt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&vt(e,!!n.multiple,t,!1)}}}var Nt=!1;function Dt(e,t,n){if(Nt)return e(t,n);Nt=!0;try{return e(t)}finally{if(Nt=!1,(null!==Pt||null!==Lt)&&(Fc(),Pt&&(t=Pt,e=Lt,Lt=Pt=null,kt(t),e)))for(t=0;t<e.length;t++)kt(e[t])}}function It(e,t){var n=e.stateNode;if(null===n)return null;var r=n[Le]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}var Ot=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ut=!1;if(Ot)try{var zt={};Object.defineProperty(zt,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",zt,zt),window.removeEventListener("test",zt,zt)}catch(e){Ut=!1}var Ft=null,Bt=null,Ht=null;function Vt(){if(Ht)return Ht;var e,t,n=Bt,i=n.length,r="value"in Ft?Ft.value:Ft.textContent,a=r.length;for(e=0;e<i&&n[e]===r[e];e++);var o=i-e;for(t=1;t<=o&&n[i-t]===r[a-t];t++);return Ht=r.slice(e,1<t?1-t:void 0)}function jt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gt(){return!0}function Wt(){return!1}function Xt(e){function t(t,n,i,r,a){for(var o in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(r):r[o]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?Gt:Wt,this.isPropagationStopped=Wt,this}return c(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),t}var $t,qt,Yt,Zt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kt=Xt(Zt),Qt=c({},Zt,{view:0,detail:0}),Jt=Xt(Qt),en=c({},Qt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yt&&(Yt&&"mousemove"===e.type?($t=e.screenX-Yt.screenX,qt=e.screenY-Yt.screenY):qt=$t=0,Yt=e),$t)},movementY:function(e){return"movementY"in e?e.movementY:qt}}),tn=Xt(en),nn=Xt(c({},en,{dataTransfer:0})),rn=Xt(c({},Qt,{relatedTarget:0})),an=Xt(c({},Zt,{animationName:0,elapsedTime:0,pseudoElement:0})),on=Xt(c({},Zt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),sn=Xt(c({},Zt,{data:0})),ln={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},un={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=un[e])&&!!t[e]}function hn(){return dn}var fn=Xt(c({},Qt,{key:function(e){if(e.key){var t=ln[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=jt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hn,charCode:function(e){return"keypress"===e.type?jt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?jt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),pn=Xt(c({},en,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mn=Xt(c({},Qt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hn})),gn=Xt(c({},Zt,{propertyName:0,elapsedTime:0,pseudoElement:0})),vn=Xt(c({},en,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),yn=Xt(c({},Zt,{newState:0,oldState:0})),xn=[9,13,27,32],_n=Ot&&"CompositionEvent"in window,bn=null;Ot&&"documentMode"in document&&(bn=document.documentMode);var Sn=Ot&&"TextEvent"in window&&!bn,wn=Ot&&(!_n||bn&&8<bn&&11>=bn),Mn=String.fromCharCode(32),En=!1;function Tn(e,t){switch(e){case"keyup":return-1!==xn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function An(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Cn=!1;var Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function Ln(e,t,n,i){Pt?Lt?Lt.push(i):Lt=[i]:Pt=i,0<(t=Vu(t,"onChange")).length&&(n=new Kt("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var kn=null,Nn=null;function Dn(e){Du(e,0)}function In(e){if(ut(He(e)))return e}function On(e,t){if("change"===e)return t}var Un=!1;if(Ot){var zn;if(Ot){var Fn="oninput"in document;if(!Fn){var Bn=document.createElement("div");Bn.setAttribute("oninput","return;"),Fn="function"==typeof Bn.oninput}zn=Fn}else zn=!1;Un=zn&&(!document.documentMode||9<document.documentMode)}function Hn(){kn&&(kn.detachEvent("onpropertychange",Vn),Nn=kn=null)}function Vn(e){if("value"===e.propertyName&&In(Nn)){var t=[];Ln(t,Nn,e,Rt(e)),Dt(Dn,t)}}function jn(e,t,n){"focusin"===e?(Hn(),Nn=n,(kn=t).attachEvent("onpropertychange",Vn)):"focusout"===e&&Hn()}function Gn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return In(Nn)}function Wn(e,t){if("click"===e)return In(t)}function Xn(e,t){if("input"===e||"change"===e)return In(t)}var $n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function qn(e,t){if($n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!q.call(t,r)||!$n(e[r],t[r]))return!1}return!0}function Yn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zn(e,t){var n,i=Yn(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Yn(i)}}function Kn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Kn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Qn(e){for(var t=dt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=dt((e=t.contentWindow).document)}return t}function Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ei=Ot&&"documentMode"in document&&11>=document.documentMode,ti=null,ni=null,ii=null,ri=!1;function ai(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ri||null==ti||ti!==dt(i)||("selectionStart"in(i=ti)&&Jn(i)?i={start:i.selectionStart,end:i.selectionEnd}:i={anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},ii&&qn(ii,i)||(ii=i,0<(i=Vu(ni,"onSelect")).length&&(t=new Kt("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ti)))}function oi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var si={animationend:oi("Animation","AnimationEnd"),animationiteration:oi("Animation","AnimationIteration"),animationstart:oi("Animation","AnimationStart"),transitionrun:oi("Transition","TransitionRun"),transitionstart:oi("Transition","TransitionStart"),transitioncancel:oi("Transition","TransitionCancel"),transitionend:oi("Transition","TransitionEnd")},li={},ci={};function ui(e){if(li[e])return li[e];if(!si[e])return e;var t,n=si[e];for(t in n)if(n.hasOwnProperty(t)&&t in ci)return li[e]=n[t];return e}Ot&&(ci=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);var di=ui("animationend"),hi=ui("animationiteration"),fi=ui("animationstart"),pi=ui("transitionrun"),mi=ui("transitionstart"),gi=ui("transitioncancel"),vi=ui("transitionend"),yi=new Map,xi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _i(e,t){yi.set(e,t),Xe(t,[e])}xi.push("scrollEnd");var bi=new WeakMap;function Si(e,t){if("object"==typeof e&&null!==e){var n=bi.get(e);return void 0!==n?n:(t={value:e,source:t,stack:ot(t)},bi.set(e,t),t)}return{value:e,source:t,stack:ot(t)}}var wi=[],Mi=0,Ei=0;function Ti(){for(var e=Mi,t=Ei=Mi=0;t<e;){var n=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var a=wi[t];if(wi[t++]=null,null!==i&&null!==r){var o=i.pending;null===o?r.next=r:(r.next=o.next,o.next=r),i.pending=r}0!==a&&Pi(n,r,a)}}function Ai(e,t,n,i){wi[Mi++]=e,wi[Mi++]=t,wi[Mi++]=n,wi[Mi++]=i,Ei|=i,e.lanes|=i,null!==(e=e.alternate)&&(e.lanes|=i)}function Ci(e,t,n,i){return Ai(e,t,n,i),Li(e)}function Ri(e,t){return Ai(e,null,null,t),Li(e)}function Pi(e,t,n){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n);for(var r=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(i=a.alternate)&&(i.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(r=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,r&&null!==t&&(r=31-de(n),null===(i=(e=a.hiddenUpdates)[r])?e[r]=[t]:i.push(t),t.lane=536870912|n),a):null}function Li(e){if(50<Pc)throw Pc=0,Lc=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var ki={};function Ni(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,i){return new Ni(e,t,n,i)}function Ii(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return null===n?((n=Di(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ui(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zi(e,t,n,r,a,o){var s=0;if(r=e,"function"==typeof e)Ii(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,B.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case E:return(e=Di(31,n,t,a)).elementType=E,e.lanes=o,e;case p:return Fi(n.children,a,o,t);case m:s=8,a|=24;break;case g:return(e=Di(12,n,t,2|a)).elementType=g,e.lanes=o,e;case b:return(e=Di(13,n,t,a)).elementType=b,e.lanes=o,e;case S:return(e=Di(19,n,t,a)).elementType=S,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case v:case x:s=10;break e;case y:s=9;break e;case _:s=11;break e;case w:s=14;break e;case M:s=16,r=null;break e}s=29,n=Error(i(130,null===e?"null":typeof e,"")),r=null}return(t=Di(s,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,i){return(e=Di(7,e,i,t)).lanes=n,e}function Bi(e,t,n){return(e=Di(6,e,null,t)).lanes=n,e}function Hi(e,t,n){return(t=Di(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=[],ji=0,Gi=null,Wi=0,Xi=[],$i=0,qi=null,Yi=1,Zi="";function Ki(e,t){Vi[ji++]=Wi,Vi[ji++]=Gi,Gi=e,Wi=t}function Qi(e,t,n){Xi[$i++]=Yi,Xi[$i++]=Zi,Xi[$i++]=qi,qi=e;var i=Yi;e=Zi;var r=32-de(i)-1;i&=~(1<<r),n+=1;var a=32-de(t)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Yi=1<<32-de(t)+r|n<<r|i,Zi=a+e}else Yi=1<<a|n<<r|i,Zi=e}function Ji(e){null!==e.return&&(Ki(e,1),Qi(e,1,0))}function er(e){for(;e===Gi;)Gi=Vi[--ji],Vi[ji]=null,Wi=Vi[--ji],Vi[ji]=null;for(;e===qi;)qi=Xi[--$i],Xi[$i]=null,Zi=Xi[--$i],Xi[$i]=null,Yi=Xi[--$i],Xi[$i]=null}var tr=null,nr=null,ir=!1,rr=null,ar=!1,or=Error(i(519));function sr(e){throw fr(Si(Error(i(418,"")),e)),or}function lr(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Pe]=e,t[Le]=i,n){case"dialog":Iu("cancel",t),Iu("close",t);break;case"iframe":case"object":case"embed":Iu("load",t);break;case"video":case"audio":for(n=0;n<ku.length;n++)Iu(ku[n],t);break;case"source":Iu("error",t);break;case"img":case"image":case"link":Iu("error",t),Iu("load",t);break;case"details":Iu("toggle",t);break;case"input":Iu("invalid",t),mt(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),ct(t);break;case"select":Iu("invalid",t);break;case"textarea":Iu("invalid",t),xt(t,i.value,i.defaultValue,i.children),ct(t)}"string"!=typeof(n=i.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===i.suppressHydrationWarning||qu(t.textContent,n)?(null!=i.popover&&(Iu("beforetoggle",t),Iu("toggle",t)),null!=i.onScroll&&Iu("scroll",t),null!=i.onScrollEnd&&Iu("scrollend",t),null!=i.onClick&&(t.onclick=Yu),t=!0):t=!1,t||sr(e)}function cr(e){for(tr=e.return;tr;)switch(tr.tag){case 5:case 13:return void(ar=!1);case 27:case 3:return void(ar=!0);default:tr=tr.return}}function ur(e){if(e!==tr)return!1;if(!ir)return cr(e),ir=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||rd(e.type,e.memoizedProps)),t=!t),t&&nr&&sr(e),cr(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){nr=md(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}nr=null}}else 27===n?(n=nr,dd(e.type)?(e=gd,gd=null,nr=e):nr=n):nr=tr?md(e.stateNode.nextSibling):null;return!0}function dr(){nr=tr=null,ir=!1}function hr(){var e=rr;return null!==e&&(null===vc?vc=e:vc.push.apply(vc,e),rr=null),e}function fr(e){null===rr?rr=[e]:rr.push(e)}var pr=U(null),mr=null,gr=null;function vr(e,t,n){F(pr,t._currentValue),t._currentValue=n}function yr(e){e._currentValue=pr.current,z(pr)}function xr(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function _r(e,t,n,r){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var o=a.dependencies;if(null!==o){var s=a.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),xr(o.return,n,e),r||(s=null);break e}o=l.next}}else if(18===a.tag){if(null===(s=a.return))throw Error(i(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),xr(s,n,e),s=null}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}}function br(e,t,n,r){e=null;for(var a=t,o=!1;null!==a;){if(!o)if(524288&a.flags)o=!0;else if(262144&a.flags)break;if(10===a.tag){var s=a.alternate;if(null===s)throw Error(i(387));if(null!==(s=s.memoizedProps)){var l=a.type;$n(a.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(a===j.current){if(null===(s=a.alternate))throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(Xd):e=[Xd])}a=a.return}null!==e&&_r(t,e,n,r),t.flags|=262144}function Sr(e){for(e=e.firstContext;null!==e;){if(!$n(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wr(e){mr=e,gr=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Mr(e){return Tr(mr,e)}function Er(e,t){return null===mr&&wr(e),Tr(e,t)}function Tr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===gr){if(null===e)throw Error(i(308));gr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gr=gr.next=t;return n}var Ar="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},Cr=e.unstable_scheduleCallback,Rr=e.unstable_NormalPriority,Pr={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lr(){return{controller:new Ar,data:new Map,refCount:0}}function kr(e){e.refCount--,0===e.refCount&&Cr(Rr,(function(){e.controller.abort()}))}var Nr=null,Dr=0,Ir=0,Or=null;function Ur(){if(0==--Dr&&null!==Nr){null!==Or&&(Or.status="fulfilled");var e=Nr;Nr=null,Ir=0,Or=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var zr=k.S;k.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Nr){var n=Nr=[];Dr=0,Ir=Au(),Or={status:"pending",value:void 0,then:function(e){n.push(e)}}}Dr++,t.then(Ur,Ur)}(0,t),null!==zr&&zr(e,t)};var Fr=U(null);function Br(){var e=Fr.current;return null!==e?e:tc.pooledCache}function Hr(e,t){F(Fr,null===t?Fr.current:t.pool)}function Vr(){var e=Br();return null===e?null:{parent:Pr._currentValue,pool:e}}var jr=Error(i(460)),Gr=Error(i(474)),Wr=Error(i(542)),Xr={then:function(){}};function $r(e){return"fulfilled"===(e=e.status)||"rejected"===e}function qr(){}function Yr(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(qr,qr),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw Qr(e=t.reason),e;default:if("string"==typeof t.status)t.then(qr,qr);else{if(null!==(e=tc)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))}switch(t.status){case"fulfilled":return t.value;case"rejected":throw Qr(e=t.reason),e}throw Zr=t,jr}}var Zr=null;function Kr(){if(null===Zr)throw Error(i(459));var e=Zr;return Zr=null,e}function Qr(e){if(e===jr||e===Wr)throw Error(i(483))}var Jr=!1;function ea(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ta(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ia(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,2&ec){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Li(e),Pi(e,null,n),t}return Ai(e,i,t,n),Li(e)}function ra(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Ee(e,n)}}function aa(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?r=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?r=a=t:a=a.next=t}else r=a=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oa=!1;function sa(){if(oa){if(null!==Or)throw Or}}function la(e,t,n,i){oa=!1;var r=e.updateQueue;Jr=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,s=r.shared.pending;if(null!==s){r.shared.pending=null;var l=s,u=l.next;l.next=null,null===o?a=u:o.next=u,o=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===s?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=l))}if(null!==a){var h=r.baseState;for(o=0,d=u=l=null,s=a;;){var f=-536870913&s.lane,p=f!==s.lane;if(p?(ic&f)===f:(i&f)===f){0!==f&&f===Ir&&(oa=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;f=t;var v=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(v,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(v,h,f):m))break e;h=c({},h,f);break e;case 2:Jr=!0}}null!==(f=s.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(u=d=p,l=h):d=d.next=p,o|=f;if(null===(s=s.next)){if(null===(s=r.shared.pending))break;s=(p=s).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===d&&(l=h),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,null===a&&(r.shared.lanes=0),dc|=o,e.lanes=o,e.memoizedState=h}}function ca(e,t){if("function"!=typeof e)throw Error(i(191,e));e.call(t)}function ua(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ca(n[e],t)}var da=U(null),ha=U(0);function fa(e,t){F(ha,e=cc),F(da,t),cc=e|t.baseLanes}function pa(){F(ha,cc),F(da,da.current)}function ma(){cc=ha.current,z(da),z(ha)}var ga=0,va=null,ya=null,xa=null,_a=!1,ba=!1,Sa=!1,wa=0,Ma=0,Ea=null,Ta=0;function Aa(){throw Error(i(321))}function Ca(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$n(e[n],t[n]))return!1;return!0}function Ra(e,t,n,i,r,a){return ga=a,va=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=null===e||null===e.memoizedState?Go:Wo,Sa=!1,a=n(i,r),Sa=!1,ba&&(a=La(t,n,i,r)),Pa(e),a}function Pa(e){k.H=jo;var t=null!==ya&&null!==ya.next;if(ga=0,xa=ya=va=null,_a=!1,Ma=0,Ea=null,t)throw Error(i(300));null===e||Es||null!==(e=e.dependencies)&&Sr(e)&&(Es=!0)}function La(e,t,n,r){va=e;var a=0;do{if(ba&&(Ea=null),Ma=0,ba=!1,25<=a)throw Error(i(301));if(a+=1,xa=ya=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}k.H=Xo,o=t(n,r)}while(ba);return o}function ka(){var e=k.H,t=e.useState()[0];return t="function"==typeof t.then?za(t):t,e=e.useState()[0],(null!==ya?ya.memoizedState:null)!==e&&(va.flags|=1024),t}function Na(){var e=0!==wa;return wa=0,e}function Da(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ia(e){if(_a){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}_a=!1}ga=0,xa=ya=va=null,ba=!1,Ma=wa=0,Ea=null}function Oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===xa?va.memoizedState=xa=e:xa=xa.next=e,xa}function Ua(){if(null===ya){var e=va.alternate;e=null!==e?e.memoizedState:null}else e=ya.next;var t=null===xa?va.memoizedState:xa.next;if(null!==t)xa=t,ya=e;else{if(null===e){if(null===va.alternate)throw Error(i(467));throw Error(i(310))}e={memoizedState:(ya=e).memoizedState,baseState:ya.baseState,baseQueue:ya.baseQueue,queue:ya.queue,next:null},null===xa?va.memoizedState=xa=e:xa=xa.next=e}return xa}function za(e){var t=Ma;return Ma+=1,null===Ea&&(Ea=[]),e=Yr(Ea,e,t),t=va,null===(null===xa?t.memoizedState:xa.next)&&(t=t.alternate,k.H=null===t||null===t.memoizedState?Go:Wo),e}function Fa(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return za(e);if(e.$$typeof===x)return Mr(e)}throw Error(i(438,String(e)))}function Ba(e){var t=null,n=va.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var i=va.alternate;null!==i&&(null!==(i=i.updateQueue)&&(null!=(i=i.memoCache)&&(t={data:i.data.map((function(e){return e.slice()})),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=T;return t.index++,n}function Ha(e,t){return"function"==typeof t?t(e):t}function Va(e){return ja(Ua(),ya,e)}function ja(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,null===a)e.memoizedState=o;else{var l=s=null,c=null,u=t=a.next,d=!1;do{var h=-536870913&u.lane;if(h!==u.lane?(ic&h)===h:(ga&h)===h){var f=u.revertLane;if(0===f)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),h===Ir&&(d=!0);else{if((ga&f)===f){u=u.next,f===Ir&&(d=!0);continue}h={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=h,s=o):c=c.next=h,va.lanes|=f,dc|=f}h=u.action,Sa&&n(o,h),o=u.hasEagerState?u.eagerState:n(o,h)}else f={lane:h,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=o):c=c.next=f,va.lanes|=h,dc|=h;u=u.next}while(null!==u&&u!==t);if(null===c?s=o:c.next=l,!$n(o,e.memoizedState)&&(Es=!0,d&&null!==(n=Or)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,r.lastRenderedState=o}return null===a&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ga(e){var t=Ua(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{o=e(o,s.action),s=s.next}while(s!==a);$n(o,t.memoizedState)||(Es=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wa(e,t,n){var r=va,a=Ua(),o=ir;if(o){if(void 0===n)throw Error(i(407));n=n()}else n=t();var s=!$n((ya||a).memoizedState,n);if(s&&(a.memoizedState=n,Es=!0),a=a.queue,mo(2048,8,qa.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||null!==xa&&1&xa.memoizedState.tag){if(r.flags|=2048,ho(9,{destroy:void 0,resource:void 0},$a.bind(null,r,a,n,t),null),null===tc)throw Error(i(349));o||124&ga||Xa(r,t,n)}return n}function Xa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=va.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function $a(e,t,n,i){t.value=n,t.getSnapshot=i,Ya(t)&&Za(e)}function qa(e,t,n){return n((function(){Ya(t)&&Za(e)}))}function Ya(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$n(e,n)}catch(e){return!0}}function Za(e){var t=Ri(e,2);null!==t&&Dc(t,e,2)}function Ka(e){var t=Oa();if("function"==typeof e){var n=e;if(e=n(),Sa){ue(!0);try{n()}finally{ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:e},t}function Qa(e,t,n,i){return e.baseState=n,ja(e,ya,"function"==typeof i?i:Ha)}function Ja(e,t,n,r,a){if(Bo(e))throw Error(i(485));if(null!==(e=t.action)){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==k.T?n(!0):o.isTransition=!1,r(o),null===(n=t.pending)?(o.next=t.pending=o,eo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function eo(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(r,i),l=k.S;null!==l&&l(o,s),to(e,t,s)}catch(n){io(e,t,n)}finally{k.T=a}}else try{to(e,t,a=n(r,i))}catch(n){io(e,t,n)}}function to(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then((function(n){no(e,t,n)}),(function(n){return io(e,t,n)})):no(e,t,n)}function no(e,t,n){t.status="fulfilled",t.value=n,ro(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,eo(e,n)))}function io(e,t,n){var i=e.pending;if(e.pending=null,null!==i){i=i.next;do{t.status="rejected",t.reason=n,ro(t),t=t.next}while(t!==i)}e.action=null}function ro(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function oo(e,t){if(ir){var n=tc.formState;if(null!==n){e:{var i=va;if(ir){if(nr){t:{for(var r=nr,a=ar;8!==r.nodeType;){if(!a){r=null;break t}if(null===(r=md(r.nextSibling))){r=null;break t}}r="F!"===(a=r.data)||"F"===a?r:null}if(r){nr=md(r.nextSibling),i="F!"===r.data;break e}}sr(i)}i=!1}i&&(t=n[0])}}return(n=Oa()).memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},n.queue=i,n=Uo.bind(null,va,i),i.dispatch=n,i=Ka(!1),a=Fo.bind(null,va,!1,i.queue),r={state:t,dispatch:null,action:e,pending:null},(i=Oa()).queue=r,n=Ja.bind(null,va,r,a,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function so(e){return lo(Ua(),ya,e)}function lo(e,t,n){if(t=ja(e,t,ao)[0],e=Va(Ha)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var i=za(t)}catch(e){if(e===jr)throw Wr;throw e}else i=t;var r=(t=Ua()).queue,a=r.dispatch;return n!==t.memoizedState&&(va.flags|=2048,ho(9,{destroy:void 0,resource:void 0},co.bind(null,r,n),null)),[i,a,e]}function co(e,t){e.action=t}function uo(e){var t=Ua(),n=ya;if(null!==n)return lo(t,n,e);Ua(),t=t.memoizedState;var i=(n=Ua()).queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ho(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},null===(t=va.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function fo(){return Ua().memoizedState}function po(e,t,n,i){var r=Oa();i=void 0===i?null:i,va.flags|=e,r.memoizedState=ho(1|t,{destroy:void 0,resource:void 0},n,i)}function mo(e,t,n,i){var r=Ua();i=void 0===i?null:i;var a=r.memoizedState.inst;null!==ya&&null!==i&&Ca(i,ya.memoizedState.deps)?r.memoizedState=ho(t,a,n,i):(va.flags|=e,r.memoizedState=ho(1|t,a,n,i))}function go(e,t){po(8390656,8,e,t)}function vo(e,t){mo(2048,8,e,t)}function yo(e,t){return mo(4,2,e,t)}function xo(e,t){return mo(4,4,e,t)}function _o(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function bo(e,t,n){n=null!=n?n.concat([e]):null,mo(4,4,_o.bind(null,t,e),n)}function So(){}function wo(e,t){var n=Ua();t=void 0===t?null:t;var i=n.memoizedState;return null!==t&&Ca(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Mo(e,t){var n=Ua();t=void 0===t?null:t;var i=n.memoizedState;if(null!==t&&Ca(t,i[1]))return i[0];if(i=e(),Sa){ue(!0);try{e()}finally{ue(!1)}}return n.memoizedState=[i,t],i}function Eo(e,t,n){return void 0===n||1073741824&ga?e.memoizedState=t:(e.memoizedState=n,e=Nc(),va.lanes|=e,dc|=e,n)}function To(e,t,n,i){return $n(n,t)?n:null!==da.current?(e=Eo(e,n,i),$n(e,t)||(Es=!0),e):42&ga?(e=Nc(),va.lanes|=e,dc|=e,t):(Es=!0,e.memoizedState=n)}function Ao(e,t,n,i,r){var a=N.p;N.p=0!==a&&8>a?a:8;var o,s,l,c=k.T,u={};k.T=u,Fo(e,!1,t,n);try{var d=r(),h=k.S;if(null!==h&&h(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)zo(e,t,(o=i,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then((function(){l.status="fulfilled",l.value=o;for(var e=0;e<s.length;e++)(0,s[e])(o)}),(function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)})),l),kc());else zo(e,t,i,kc())}catch(n){zo(e,t,{then:function(){},status:"rejected",reason:n},kc())}finally{N.p=a,k.T=c}}function Co(){}function Ro(e,t,n,r){if(5!==e.tag)throw Error(i(476));var a=Po(e).queue;Ao(e,a,t,D,null===n?Co:function(){return Lo(e),n(r)})}function Po(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:D},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Lo(e){zo(e,Po(e).next.queue,{},kc())}function ko(){return Mr(Xd)}function No(){return Ua().memoizedState}function Do(){return Ua().memoizedState}function Io(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=kc(),i=ia(t,e=na(n),n);return null!==i&&(Dc(i,t,n),ra(i,t,n)),t={cache:Lr()},void(e.payload=t)}t=t.return}}function Oo(e,t,n){var i=kc();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Bo(e)?Ho(t,n):null!==(n=Ci(e,t,n,i))&&(Dc(n,e,i),Vo(n,t,i))}function Uo(e,t,n){zo(e,t,n,kc())}function zo(e,t,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bo(e))Ho(t,r);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(r.hasEagerState=!0,r.eagerState=s,$n(s,o))return Ai(e,t,r,0),null===tc&&Ti(),!1}catch(e){}if(null!==(n=Ci(e,t,r,i)))return Dc(n,e,i),Vo(n,t,i),!0}return!1}function Fo(e,t,n,r){if(r={lane:2,revertLane:Au(),action:r,hasEagerState:!1,eagerState:null,next:null},Bo(e)){if(t)throw Error(i(479))}else null!==(t=Ci(e,n,r,2))&&Dc(t,e,2)}function Bo(e){var t=e.alternate;return e===va||null!==t&&t===va}function Ho(e,t){ba=_a=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vo(e,t,n){if(4194048&n){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Ee(e,n)}}var jo={readContext:Mr,use:Fa,useCallback:Aa,useContext:Aa,useEffect:Aa,useImperativeHandle:Aa,useLayoutEffect:Aa,useInsertionEffect:Aa,useMemo:Aa,useReducer:Aa,useRef:Aa,useState:Aa,useDebugValue:Aa,useDeferredValue:Aa,useTransition:Aa,useSyncExternalStore:Aa,useId:Aa,useHostTransitionStatus:Aa,useFormState:Aa,useActionState:Aa,useOptimistic:Aa,useMemoCache:Aa,useCacheRefresh:Aa},Go={readContext:Mr,use:Fa,useCallback:function(e,t){return Oa().memoizedState=[e,void 0===t?null:t],e},useContext:Mr,useEffect:go,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,po(4194308,4,_o.bind(null,t,e),n)},useLayoutEffect:function(e,t){return po(4194308,4,e,t)},useInsertionEffect:function(e,t){po(4,2,e,t)},useMemo:function(e,t){var n=Oa();t=void 0===t?null:t;var i=e();if(Sa){ue(!0);try{e()}finally{ue(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Oa();if(void 0!==n){var r=n(t);if(Sa){ue(!0);try{n(t)}finally{ue(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=Oo.bind(null,va,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},Oa().memoizedState=e},useState:function(e){var t=(e=Ka(e)).queue,n=Uo.bind(null,va,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:So,useDeferredValue:function(e,t){return Eo(Oa(),e,t)},useTransition:function(){var e=Ka(!1);return e=Ao.bind(null,va,e.queue,!0,!1),Oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=va,a=Oa();if(ir){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===tc)throw Error(i(349));124&ic||Xa(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,go(qa.bind(null,r,o,e),[e]),r.flags|=2048,ho(9,{destroy:void 0,resource:void 0},$a.bind(null,r,o,n,t),null),n},useId:function(){var e=Oa(),t=tc.identifierPrefix;if(ir){var n=Zi;t="«"+t+"R"+(n=(Yi&~(1<<32-de(Yi)-1)).toString(32)+n),0<(n=wa++)&&(t+="H"+n.toString(32)),t+="»"}else t="«"+t+"r"+(n=Ta++).toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:ko,useFormState:oo,useActionState:oo,useOptimistic:function(e){var t=Oa();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fo.bind(null,va,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ba,useCacheRefresh:function(){return Oa().memoizedState=Io.bind(null,va)}},Wo={readContext:Mr,use:Fa,useCallback:wo,useContext:Mr,useEffect:vo,useImperativeHandle:bo,useInsertionEffect:yo,useLayoutEffect:xo,useMemo:Mo,useReducer:Va,useRef:fo,useState:function(){return Va(Ha)},useDebugValue:So,useDeferredValue:function(e,t){return To(Ua(),ya.memoizedState,e,t)},useTransition:function(){var e=Va(Ha)[0],t=Ua().memoizedState;return["boolean"==typeof e?e:za(e),t]},useSyncExternalStore:Wa,useId:No,useHostTransitionStatus:ko,useFormState:so,useActionState:so,useOptimistic:function(e,t){return Qa(Ua(),0,e,t)},useMemoCache:Ba,useCacheRefresh:Do},Xo={readContext:Mr,use:Fa,useCallback:wo,useContext:Mr,useEffect:vo,useImperativeHandle:bo,useInsertionEffect:yo,useLayoutEffect:xo,useMemo:Mo,useReducer:Ga,useRef:fo,useState:function(){return Ga(Ha)},useDebugValue:So,useDeferredValue:function(e,t){var n=Ua();return null===ya?Eo(n,e,t):To(n,ya.memoizedState,e,t)},useTransition:function(){var e=Ga(Ha)[0],t=Ua().memoizedState;return["boolean"==typeof e?e:za(e),t]},useSyncExternalStore:Wa,useId:No,useHostTransitionStatus:ko,useFormState:uo,useActionState:uo,useOptimistic:function(e,t){var n=Ua();return null!==ya?Qa(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ba,useCacheRefresh:Do},$o=null,qo=0;function Yo(e){var t=qo;return qo+=1,null===$o&&($o=[]),Yr($o,e,t)}function Zo(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Ko(e,t){if(t.$$typeof===d)throw Error(i(525));throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qo(e){return(0,e._init)(e._payload)}function Jo(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=Oi(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=67108866,n):i:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=Bi(n,e.mode,i)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,i){var r=n.type;return r===p?d(e,t,n.props.children,i,n.key):null!==t&&(t.elementType===r||"object"==typeof r&&null!==r&&r.$$typeof===M&&Qo(r)===t.type)?(Zo(t=a(t,n.props),n),t.return=e,t):(Zo(t=zi(n.type,n.key,n.props,null,e.mode,i),n),t.return=e,t)}function u(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Hi(n,e.mode,i)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,i,r){return null===t||7!==t.tag?((t=Fi(n,e.mode,i,r)).return=e,t):((t=a(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Bi(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case h:return Zo(n=zi(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case f:return(t=Hi(t,e.mode,n)).return=e,t;case M:return m(e,t=(0,t._init)(t._payload),n)}if(L(t)||C(t))return(t=Fi(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,Yo(t),n);if(t.$$typeof===x)return m(e,Er(e,t),n);Ko(e,t)}return null}function g(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:l(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case h:return n.key===r?c(e,t,n,i):null;case f:return n.key===r?u(e,t,n,i):null;case M:return g(e,t,n=(r=n._init)(n._payload),i)}if(L(n)||C(n))return null!==r?null:d(e,t,n,i,null);if("function"==typeof n.then)return g(e,t,Yo(n),i);if(n.$$typeof===x)return g(e,t,Er(e,n),i);Ko(e,n)}return null}function v(e,t,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i||"bigint"==typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case h:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case f:return u(t,e=e.get(null===i.key?n:i.key)||null,i,r);case M:return v(e,t,n,i=(0,i._init)(i._payload),r)}if(L(i)||C(i))return d(t,e=e.get(n)||null,i,r,null);if("function"==typeof i.then)return v(e,t,n,Yo(i),r);if(i.$$typeof===x)return v(e,t,n,Er(t,i),r);Ko(t,i)}return null}function y(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===p&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case h:e:{for(var _=u.key;null!==c;){if(c.key===_){if((_=u.type)===p){if(7===c.tag){n(l,c.sibling),(d=a(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===_||"object"==typeof _&&null!==_&&_.$$typeof===M&&Qo(_)===c.type){n(l,c.sibling),Zo(d=a(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===p?((d=Fi(u.props.children,l.mode,d,u.key)).return=l,l=d):(Zo(d=zi(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case f:e:{for(_=u.key;null!==c;){if(c.key===_){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=a(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Hi(u,l.mode,d)).return=l,l=d}return s(l);case M:return y(l,c,u=(_=u._init)(u._payload),d)}if(L(u))return function(i,a,s,l){for(var c=null,u=null,d=a,h=a=0,f=null;null!==d&&h<s.length;h++){d.index>h?(f=d,d=null):f=d.sibling;var p=g(i,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(i,d),a=o(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(i,d),ir&&Ki(i,h),c;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(a=o(d,a,h),null===u?c=d:u.sibling=d,u=d);return ir&&Ki(i,h),c}for(d=r(d);h<s.length;h++)null!==(f=v(d,i,h,s[h],l))&&(e&&null!==f.alternate&&d.delete(null===f.key?h:f.key),a=o(f,a,h),null===u?c=f:u.sibling=f,u=f);return e&&d.forEach((function(e){return t(i,e)})),ir&&Ki(i,h),c}(l,c,u,d);if(C(u)){if("function"!=typeof(_=C(u)))throw Error(i(150));return function(a,s,l,c){if(null==l)throw Error(i(151));for(var u=null,d=null,h=s,f=s=0,p=null,y=l.next();null!==h&&!y.done;f++,y=l.next()){h.index>f?(p=h,h=null):p=h.sibling;var x=g(a,h,y.value,c);if(null===x){null===h&&(h=p);break}e&&h&&null===x.alternate&&t(a,h),s=o(x,s,f),null===d?u=x:d.sibling=x,d=x,h=p}if(y.done)return n(a,h),ir&&Ki(a,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=m(a,y.value,c))&&(s=o(y,s,f),null===d?u=y:d.sibling=y,d=y);return ir&&Ki(a,f),u}for(h=r(h);!y.done;f++,y=l.next())null!==(y=v(h,a,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=o(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(a,e)})),ir&&Ki(a,f),u}(l,c,u=_.call(u),d)}if("function"==typeof u.then)return y(l,c,Yo(u),d);if(u.$$typeof===x)return y(l,c,Er(l,u),d);Ko(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=a(c,u)).return=l,l=d):(n(l,c),(d=Bi(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,i){try{qo=0;var r=y(e,t,n,i);return $o=null,r}catch(t){if(t===jr||t===Wr)throw t;var a=Di(29,t,null,e.mode);return a.lanes=i,a.return=e,a}}}var es=Jo(!0),ts=Jo(!1),ns=U(null),is=null;function rs(e){var t=e.alternate;F(ls,1&ls.current),F(ns,e),null===is&&(null===t||null!==da.current||null!==t.memoizedState)&&(is=e)}function as(e){if(22===e.tag){if(F(ls,ls.current),F(ns,e),null===is){var t=e.alternate;null!==t&&null!==t.memoizedState&&(is=e)}}else os()}function os(){F(ls,ls.current),F(ns,ns.current)}function ss(e){z(ns),is===e&&(is=null),z(ls)}var ls=U(0);function cs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||pd(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function us(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:c({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ds={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=kc(),r=na(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=ia(e,r,i))&&(Dc(t,e,i),ra(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=kc(),r=na(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=ia(e,r,i))&&(Dc(t,e,i),ra(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kc(),i=na(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=ia(e,i,n))&&(Dc(t,e,n),ra(t,e,n))}};function hs(e,t,n,i,r,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!qn(n,i)||!qn(r,a))}function fs(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ds.enqueueReplaceState(t,t.state,null)}function ps(e,t){var n=t;if("ref"in t)for(var i in n={},t)"ref"!==i&&(n[i]=t[i]);if(e=e.defaultProps)for(var r in n===t&&(n=c({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}var ms="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function gs(e){ms(e)}function vs(e){console.error(e)}function ys(e){ms(e)}function xs(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout((function(){throw e}))}}function _s(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout((function(){throw e}))}}function bs(e,t,n){return(n=na(n)).tag=3,n.payload={element:null},n.callback=function(){xs(e,t)},n}function Ss(e){return(e=na(e)).tag=3,e}function ws(e,t,n,i){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var a=i.value;e.payload=function(){return r(a)},e.callback=function(){_s(t,n,i)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){_s(t,n,i),"function"!=typeof r&&(null===Sc?Sc=new Set([this]):Sc.add(this));var e=i.stack;this.componentDidCatch(i.value,{componentStack:null!==e?e:""})})}var Ms=Error(i(461)),Es=!1;function Ts(e,t,n,i){t.child=null===e?ts(t,null,n,i):es(t,e.child,n,i)}function As(e,t,n,i,r){n=n.render;var a=t.ref;if("ref"in i){var o={};for(var s in i)"ref"!==s&&(o[s]=i[s])}else o=i;return wr(t),i=Ra(e,t,n,o,a,r),s=Na(),null===e||Es?(ir&&s&&Ji(t),t.flags|=1,Ts(e,t,i,r),t.child):(Da(e,t,r),$s(e,t,r))}function Cs(e,t,n,i,r){if(null===e){var a=n.type;return"function"!=typeof a||Ii(a)||void 0!==a.defaultProps||null!==n.compare?((e=zi(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Rs(e,t,a,i,r))}if(a=e.child,!qs(e,r)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:qn)(o,i)&&e.ref===t.ref)return $s(e,t,r)}return t.flags|=1,(e=Oi(a,i)).ref=t.ref,e.return=t,t.child=e}function Rs(e,t,n,i,r){if(null!==e){var a=e.memoizedProps;if(qn(a,i)&&e.ref===t.ref){if(Es=!1,t.pendingProps=i=a,!qs(e,r))return t.lanes=e.lanes,$s(e,t,r);131072&e.flags&&(Es=!0)}}return Ns(e,t,n,i,r)}function Ps(e,t,n){var i=t.pendingProps,r=i.children,a=null!==e?e.memoizedState:null;if("hidden"===i.mode){if(128&t.flags){if(i=null!==a?a.baseLanes|n:n,null!==e){for(r=t.child=e.child,a=0;null!==r;)a=a|r.lanes|r.childLanes,r=r.sibling;t.childLanes=a&~i}else t.childLanes=0,t.child=null;return Ls(e,t,i,n)}if(!(536870912&n))return t.lanes=t.childLanes=536870912,Ls(e,t,null!==a?a.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Hr(0,null!==a?a.cachePool:null),null!==a?fa(t,a):pa(),as(t)}else null!==a?(Hr(0,a.cachePool),fa(t,a),os(),t.memoizedState=null):(null!==e&&Hr(0,null),pa(),os());return Ts(e,t,r,n),t.child}function Ls(e,t,n,i){var r=Br();return r=null===r?null:{parent:Pr._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},null!==e&&Hr(0,null),pa(),as(t),null!==e&&br(e,t,i,!0),null}function ks(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(i(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Ns(e,t,n,i,r){return wr(t),n=Ra(e,t,n,i,void 0,r),i=Na(),null===e||Es?(ir&&i&&Ji(t),t.flags|=1,Ts(e,t,n,r),t.child):(Da(e,t,r),$s(e,t,r))}function Ds(e,t,n,i,r,a){return wr(t),t.updateQueue=null,n=La(t,i,n,r),Pa(e),i=Na(),null===e||Es?(ir&&i&&Ji(t),t.flags|=1,Ts(e,t,n,a),t.child):(Da(e,t,a),$s(e,t,a))}function Is(e,t,n,i,r){if(wr(t),null===t.stateNode){var a=ki,o=n.contextType;"object"==typeof o&&null!==o&&(a=Mr(o)),a=new n(i,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=ds,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=i,a.state=t.memoizedState,a.refs={},ea(t),o=n.contextType,a.context="object"==typeof o&&null!==o?Mr(o):ki,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(us(t,n,o,i),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&ds.enqueueReplaceState(a,a.state,null),la(t,i,a,r),sa(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=ps(n,s);a.props=l;var c=a.context,u=n.contextType;o=ki,"object"==typeof u&&null!==u&&(o=Mr(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s||c!==o)&&fs(t,a,i,o),Jr=!1;var h=t.memoizedState;a.state=h,la(t,i,a,r),sa(),c=t.memoizedState,s||h!==c||Jr?("function"==typeof d&&(us(t,n,d,i),c=t.memoizedState),(l=Jr||hs(t,n,l,i,h,c,o))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),a.props=i,a.state=c,a.context=o,i=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!1)}else{a=t.stateNode,ta(e,t),u=ps(n,o=t.memoizedProps),a.props=u,d=t.pendingProps,h=a.context,c=n.contextType,l=ki,"object"==typeof c&&null!==c&&(l=Mr(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||h!==l)&&fs(t,a,i,l),Jr=!1,h=t.memoizedState,a.state=h,la(t,i,a,r),sa();var f=t.memoizedState;o!==d||h!==f||Jr||null!==e&&null!==e.dependencies&&Sr(e.dependencies)?("function"==typeof s&&(us(t,n,s,i),f=t.memoizedState),(u=Jr||hs(t,n,u,i,h,f,l)||null!==e&&null!==e.dependencies&&Sr(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,f,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,f,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),a.props=i,a.state=f,a.context=l,i=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return a=i,ks(e,t),i=!!(128&t.flags),a||i?(a=t.stateNode,n=i&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&i?(t.child=es(t,e.child,null,r),t.child=es(t,null,n,r)):Ts(e,t,n,r),t.memoizedState=a.state,e=t.child):e=$s(e,t,r),e}function Os(e,t,n,i){return dr(),t.flags|=256,Ts(e,t,n,i),t.child}var Us={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zs(e){return{baseLanes:e,cachePool:Vr()}}function Fs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=pc),e}function Bs(e,t,n){var r,a=t.pendingProps,o=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&ls.current)),r&&(o=!0,t.flags&=-129),r=!!(32&t.flags),t.flags&=-33,null===e){if(ir){if(o?rs(t):os(),ir){var l,c=nr;if(l=c){e:{for(l=c,c=ar;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=md(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==qi?{id:Yi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},(l=Di(18,null,null,0)).stateNode=c,l.return=t,t.child=l,tr=t,nr=null,l=!0):l=!1}l||sr(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return pd(c)?t.lanes=32:t.lanes=536870912,null;ss(t)}return c=a.children,a=a.fallback,o?(os(),c=Vs({mode:"hidden",children:c},o=t.mode),a=Fi(a,o,n,null),c.return=t,a.return=t,c.sibling=a,t.child=c,(o=t.child).memoizedState=zs(n),o.childLanes=Fs(e,r,n),t.memoizedState=Us,a):(rs(t),Hs(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(s)256&t.flags?(rs(t),t.flags&=-257,t=js(e,t,n)):null!==t.memoizedState?(os(),t.child=e.child,t.flags|=128,t=null):(os(),o=a.fallback,c=t.mode,a=Vs({mode:"visible",children:a.children},c),(o=Fi(o,c,n,null)).flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,es(t,e.child,null,n),(a=t.child).memoizedState=zs(n),a.childLanes=Fs(e,r,n),t.memoizedState=Us,t=o);else if(rs(t),pd(c)){if(r=c.nextSibling&&c.nextSibling.dataset)var u=r.dgst;r=u,(a=Error(i(419))).stack="",a.digest=r,fr({value:a,source:null,stack:null}),t=js(e,t,n)}else if(Es||br(e,t,n,!1),r=!!(n&e.childLanes),Es||r){if(null!==(r=tc)&&(0!==(a=(a=42&(a=n&-n)?1:Te(a))&(r.suspendedLanes|n)?0:a)&&a!==l.retryLane))throw l.retryLane=a,Ri(e,a),Dc(r,e,a),Ms;"$?"===c.data||Wc(),t=js(e,t,n)}else"$?"===c.data?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,nr=md(c.nextSibling),tr=t,ir=!0,rr=null,ar=!1,null!==e&&(Xi[$i++]=Yi,Xi[$i++]=Zi,Xi[$i++]=qi,Yi=e.id,Zi=e.overflow,qi=t),(t=Hs(t,a.children)).flags|=4096);return t}return o?(os(),o=a.fallback,c=t.mode,u=(l=e.child).sibling,(a=Oi(l,{mode:"hidden",children:a.children})).subtreeFlags=65011712&l.subtreeFlags,null!==u?o=Oi(u,o):(o=Fi(o,c,n,null)).flags|=2,o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,null===(c=e.child.memoizedState)?c=zs(n):(null!==(l=c.cachePool)?(u=Pr._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Vr(),c={baseLanes:c.baseLanes|n,cachePool:l}),o.memoizedState=c,o.childLanes=Fs(e,r,n),t.memoizedState=Us,a):(rs(t),e=(n=e.child).sibling,(n=Oi(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Hs(e,t){return(t=Vs({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Vs(e,t){return(e=Di(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function js(e,t,n){return es(t,e.child,null,n),(e=Hs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Gs(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),xr(e.return,t,n)}function Ws(e,t,n,i,r){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r)}function Xs(e,t,n){var i=t.pendingProps,r=i.revealOrder,a=i.tail;if(Ts(e,t,i.children,n),2&(i=ls.current))i=1&i|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Gs(e,n,t);else if(19===e.tag)Gs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(F(ls,i),r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===cs(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ws(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===cs(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ws(t,!0,n,null,a);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $s(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),dc|=t.lanes,!(n&t.childLanes)){if(null===e)return null;if(br(e,t,n,!1),!(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Oi(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oi(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function qs(e,t){return!!(e.lanes&t)||!(null===(e=e.dependencies)||!Sr(e))}function Ys(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Es=!0;else{if(!(qs(e,n)||128&t.flags))return Es=!1,function(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),vr(0,Pr,e.memoizedState.cache),dr();break;case 27:case 5:X(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:vr(0,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(null!==i)return null!==i.dehydrated?(rs(t),t.flags|=128,null):n&t.child.childLanes?Bs(e,t,n):(rs(t),null!==(e=$s(e,t,n))?e.sibling:null);rs(t);break;case 19:var r=!!(128&e.flags);if((i=!!(n&t.childLanes))||(br(e,t,n,!1),i=!!(n&t.childLanes)),r){if(i)return Xs(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),F(ls,ls.current),i)break;return null;case 22:case 23:return t.lanes=0,Ps(e,t,n);case 24:vr(0,Pr,e.memoizedState.cache)}return $s(e,t,n)}(e,t,n);Es=!!(131072&e.flags)}else Es=!1,ir&&1048576&t.flags&&Qi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,a=r._init;if(r=a(r._payload),t.type=r,"function"!=typeof r){if(null!=r){if((a=r.$$typeof)===_){t.tag=11,t=As(null,t,r,e,n);break e}if(a===w){t.tag=14,t=Cs(null,t,r,e,n);break e}}throw t=P(r)||r,Error(i(306,t,""))}Ii(r)?(e=ps(r,e),t.tag=1,t=Is(null,t,r,e,n)):(t.tag=0,t=Ns(null,t,r,e,n))}return t;case 0:return Ns(e,t,t.type,t.pendingProps,n);case 1:return Is(e,t,r=t.type,a=ps(r,t.pendingProps),n);case 3:e:{if(G(t,t.stateNode.containerInfo),null===e)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ta(e,t),la(t,r,null,n);var s=t.memoizedState;if(r=s.cache,vr(0,Pr,r),r!==o.cache&&_r(t,[Pr],n,!0),sa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Os(e,t,r,n);break e}if(r!==a){fr(a=Si(Error(i(424)),t)),t=Os(e,t,r,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(nr=md(e.firstChild),tr=t,ir=!0,rr=null,ar=!0,n=ts(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(dr(),r===a){t=$s(e,t,n);break e}Ts(e,t,r,n)}t=t.child}return t;case 26:return ks(e,t),null===e?(n=Td(t.type,null,t.pendingProps,null))?t.memoizedState=n:ir||(n=t.type,e=t.pendingProps,(r=td(V.current).createElement(n))[Pe]=t,r[Le]=e,Qu(r,n,e),je(r),t.stateNode=r):t.memoizedState=Td(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),null===e&&ir&&(r=t.stateNode=yd(t.type,t.pendingProps,V.current),tr=t,ar=!0,a=nr,dd(t.type)?(gd=a,nr=md(r.firstChild)):nr=a),Ts(e,t,t.pendingProps.children,n),ks(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&ir&&((a=r=nr)&&(null!==(r=function(e,t,n,i){for(;1===e.nodeType;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(i){if(!e[Ue])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===a)return e}if(null===(e=md(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,ar))?(t.stateNode=r,tr=t,nr=md(r.firstChild),ar=!1,a=!0):a=!1),a||sr(t)),X(t),a=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,r=o.children,rd(a,o)?r=null:null!==s&&rd(a,s)&&(t.flags|=32),null!==t.memoizedState&&(a=Ra(e,t,ka,null,null,n),Xd._currentValue=a),ks(e,t),Ts(e,t,r,n),t.child;case 6:return null===e&&ir&&((e=n=nr)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=md(e.nextSibling)))return null}return e}(n,t.pendingProps,ar))?(t.stateNode=n,tr=t,nr=null,e=!0):e=!1),e||sr(t)),null;case 13:return Bs(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=es(t,null,r,n):Ts(e,t,r,n),t.child;case 11:return As(e,t,t.type,t.pendingProps,n);case 7:return Ts(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ts(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,vr(0,t.type,r.value),Ts(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,wr(t),r=r(a=Mr(a)),t.flags|=1,Ts(e,t,r,n),t.child;case 14:return Cs(e,t,t.type,t.pendingProps,n);case 15:return Rs(e,t,t.type,t.pendingProps,n);case 19:return Xs(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},null===e?((n=Vs(r,n)).ref=t.ref,t.child=n,n.return=t,t=n):((n=Oi(e.child,r)).ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Ps(e,t,n);case 24:return wr(t),r=Mr(Pr),null===e?(null===(a=Br())&&(a=tc,o=Lr(),a.pooledCache=o,o.refCount++,null!==o&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ea(t),vr(0,Pr,a)):(!!(e.lanes&n)&&(ta(e,t),la(t,null,null,n),sa()),a=e.memoizedState,o=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),vr(0,Pr,r)):(r=o.cache,vr(0,Pr,r),r!==a.cache&&_r(t,[Pr],n,!0))),Ts(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Zs(e){e.flags|=4}function Ks(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!Fd(t)){if(null!==(t=ns.current)&&((4194048&ic)===ic?null!==is:(62914560&ic)!==ic&&!(536870912&ic)||t!==is))throw Zr=Xr,Gr;e.flags|=8192}}function Qs(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?be():536870912,e.lanes|=t,mc|=t)}function Js(e,t){if(!ir)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function el(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=65011712&r.subtreeFlags,i|=65011712&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function tl(e,t,n){var r=t.pendingProps;switch(er(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return el(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),yr(Pr),W(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ur(t)?Zs(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,hr())),el(t),null;case 26:return n=t.memoizedState,null===e?(Zs(t),null!==n?(el(t),Ks(t,n)):(el(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Zs(t),el(t),Ks(t,n)):(el(t),t.flags&=-16777217):(e.memoizedProps!==r&&Zs(t),el(t),t.flags&=-16777217),null;case 27:$(t),n=V.current;var a=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return el(t),null}e=B.current,ur(t)?lr(t):(e=yd(a,r,n),t.stateNode=e,Zs(t))}return el(t),null;case 5:if($(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return el(t),null}if(e=B.current,ur(t))lr(t);else{switch(a=td(V.current),e){case 1:e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?a.createElement(n,{is:r.is}):a.createElement(n)}}e[Pe]=t,e[Le]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)e.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;e:switch(Qu(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Zs(t)}}return el(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=V.current,ur(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(a=tr))switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Pe]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||qu(e.nodeValue,n)))||sr(t)}else(e=td(e).createTextNode(r))[Pe]=t,t.stateNode=e}return el(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ur(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[Pe]=t}else dr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;el(t),a=!1}else a=hr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(ss(t),t):(ss(t),null)}if(ss(t),128&t.flags)return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){a=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(a=r.alternate.memoizedState.cachePool.pool);var o=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Qs(t,t.updateQueue),el(t),null;case 4:return W(),null===e&&zu(t.stateNode.containerInfo),el(t),null;case 10:return yr(t.type),el(t),null;case 19:if(z(ls),null===(a=t.memoizedState))return el(t),null;if(r=!!(128&t.flags),null===(o=a.rendering))if(r)Js(a,!1);else{if(0!==uc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=cs(e))){for(t.flags|=128,Js(a,!1),e=o.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ui(n,e),n=n.sibling;return F(ls,1&ls.current|2),t.child}e=e.sibling}null!==a.tail&&J()>_c&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=cs(o))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Js(a,!0),null===a.tail&&"hidden"===a.tailMode&&!o.alternate&&!ir)return el(t),null}else 2*J()-a.renderingStartTime>_c&&536870912!==n&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=a.last)?e.sibling=o:t.child=o,a.last=o)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=J(),t.sibling=null,e=ls.current,F(ls,r?1&e|2:1&e),t):(el(t),null);case 22:case 23:return ss(t),ma(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(el(t),6&t.subtreeFlags&&(t.flags|=8192)):el(t),null!==(n=t.updateQueue)&&Qs(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&z(Fr),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),yr(Pr),el(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function nl(e,t){switch(er(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return yr(Pr),W(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return $(t),null;case 13:if(ss(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));dr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return z(ls),null;case 4:return W(),null;case 10:return yr(t.type),null;case 22:case 23:return ss(t),ma(),null!==e&&z(Fr),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return yr(Pr),null;default:return null}}function il(e,t){switch(er(t),t.tag){case 3:yr(Pr),W();break;case 26:case 27:case 5:$(t);break;case 4:W();break;case 13:ss(t);break;case 19:z(ls);break;case 10:yr(t.type);break;case 22:case 23:ss(t),ma(),null!==e&&z(Fr);break;case 24:yr(Pr)}}function rl(e,t){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var a=n.create,o=n.inst;i=a(),o.destroy=i}n=n.next}while(n!==r)}}catch(e){lu(t,t.return,e)}}function al(e,t,n){try{var i=t.updateQueue,r=null!==i?i.lastEffect:null;if(null!==r){var a=r.next;i=a;do{if((i.tag&e)===e){var o=i.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,r=t;var l=n,c=s;try{c()}catch(e){lu(r,l,e)}}}i=i.next}while(i!==a)}}catch(e){lu(t,t.return,e)}}function ol(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ua(t,n)}catch(t){lu(e,e.return,t)}}}function sl(e,t,n){n.props=ps(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){lu(e,t,n)}}function ll(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;default:i=e.stateNode}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(n){lu(e,t,n)}}function cl(e,t){var n=e.ref,i=e.refCleanup;if(null!==n)if("function"==typeof i)try{i()}catch(n){lu(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){lu(e,t,n)}else n.current=null}function ul(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(t){lu(e,e.return,t)}}function dl(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,s=null,l=null,c=null,u=null,d=null;for(p in n){var h=n[p];if(n.hasOwnProperty(p)&&null!=h)switch(p){case"checked":case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(p)||Zu(e,t,p,null,r,h)}}for(var f in r){var p=r[f];if(h=n[f],r.hasOwnProperty(f)&&(null!=p||null!=h))switch(f){case"type":o=p;break;case"name":a=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":s=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(i(137,t));break;default:p!==h&&Zu(e,t,f,p,r,h)}}return void pt(e,s,l,c,u,d,o,a);case"select":for(o in p=s=l=f=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":p=c;default:r.hasOwnProperty(o)||Zu(e,t,o,null,r,c)}for(a in r)if(o=r[a],c=n[a],r.hasOwnProperty(a)&&(null!=o||null!=c))switch(a){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":s=o;default:o!==c&&Zu(e,t,a,o,r,c)}return t=l,n=s,r=p,void(null!=f?vt(e,!!n,f,!1):!!r!=!!n&&(null!=t?vt(e,!!n,t,!0):vt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Zu(e,t,l,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(null!=a||null!=o))switch(s){case"value":f=a;break;case"defaultValue":p=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(i(91));break;default:a!==o&&Zu(e,t,s,a,r,o)}return void yt(e,f,p);case"option":for(var m in n)if(f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m))if("selected"===m)e.selected=!1;else Zu(e,t,m,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))if("selected"===c)e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f;else Zu(e,t,c,f,r,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&Zu(e,t,g,null,r,f);for(u in r)if(f=r[u],p=n[u],r.hasOwnProperty(u)&&f!==p&&(null!=f||null!=p))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(i(137,t));break;default:Zu(e,t,u,f,r,p)}return;default:if(Mt(t)){for(var v in n)f=n[v],n.hasOwnProperty(v)&&void 0!==f&&!r.hasOwnProperty(v)&&Ku(e,t,v,void 0,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||void 0===f&&void 0===p||Ku(e,t,d,f,r,p);return}}for(var y in n)f=n[y],n.hasOwnProperty(y)&&null!=f&&!r.hasOwnProperty(y)&&Zu(e,t,y,null,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||null==f&&null==p||Zu(e,t,h,f,r,p)}(r,e.type,n,t),r[Le]=t}catch(t){lu(e,e.return,t)}}function hl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&dd(e.type)||4===e.tag}function fl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||hl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&dd(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function pl(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Yu));else if(4!==i&&(27===i&&dd(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(pl(e,t,n),e=e.sibling;null!==e;)pl(e,t,n),e=e.sibling}function ml(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&(27===i&&dd(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(ml(e,t,n),e=e.sibling;null!==e;)ml(e,t,n),e=e.sibling}function gl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Qu(t,i,n),t[Pe]=e,t[Le]=n}catch(t){lu(e,e.return,t)}}var vl=!1,yl=!1,xl=!1,_l="function"==typeof WeakSet?WeakSet:Set,bl=null;function Sl(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Il(e,n),4&i&&rl(5,n);break;case 1:if(Il(e,n),4&i)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){lu(n,n.return,e)}else{var r=ps(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){lu(n,n.return,e)}}64&i&&ol(n),512&i&&ll(n,n.return);break;case 3:if(Il(e,n),64&i&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ua(e,t)}catch(e){lu(n,n.return,e)}}break;case 27:null===t&&4&i&&gl(n);case 26:case 5:Il(e,n),null===t&&4&i&&ul(n),512&i&&ll(n,n.return);break;case 12:Il(e,n);break;case 13:Il(e,n),4&i&&Cl(e,n),64&i&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$?"!==e.data||"complete"===n.readyState)t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}(e,n=hu.bind(null,n))));break;case 22:if(!(i=null!==n.memoizedState||vl)){t=null!==t&&null!==t.memoizedState||yl,r=vl;var a=yl;vl=i,(yl=t)&&!a?Ul(e,n,!!(8772&n.subtreeFlags)):Il(e,n),vl=r,yl=a}break;case 30:break;default:Il(e,n)}}function wl(e){var t=e.alternate;null!==t&&(e.alternate=null,wl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&ze(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ml=null,El=!1;function Tl(e,t,n){for(n=n.child;null!==n;)Al(e,t,n),n=n.sibling}function Al(e,t,n){if(ce&&"function"==typeof ce.onCommitFiberUnmount)try{ce.onCommitFiberUnmount(le,n)}catch(e){}switch(n.tag){case 26:yl||cl(n,t),Tl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:yl||cl(n,t);var i=Ml,r=El;dd(n.type)&&(Ml=n.stateNode,El=!1),Tl(e,t,n),xd(n.stateNode),Ml=i,El=r;break;case 5:yl||cl(n,t);case 6:if(i=Ml,r=El,Ml=null,Tl(e,t,n),El=r,null!==(Ml=i))if(El)try{(9===Ml.nodeType?Ml.body:"HTML"===Ml.nodeName?Ml.ownerDocument.body:Ml).removeChild(n.stateNode)}catch(e){lu(n,t,e)}else try{Ml.removeChild(n.stateNode)}catch(e){lu(n,t,e)}break;case 18:null!==Ml&&(El?(hd(9===(e=Ml).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Eh(e)):hd(Ml,n.stateNode));break;case 4:i=Ml,r=El,Ml=n.stateNode.containerInfo,El=!0,Tl(e,t,n),Ml=i,El=r;break;case 0:case 11:case 14:case 15:yl||al(2,n,t),yl||al(4,n,t),Tl(e,t,n);break;case 1:yl||(cl(n,t),"function"==typeof(i=n.stateNode).componentWillUnmount&&sl(n,t,i)),Tl(e,t,n);break;case 21:Tl(e,t,n);break;case 22:yl=(i=yl)||null!==n.memoizedState,Tl(e,t,n),yl=i;break;default:Tl(e,t,n)}}function Cl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Eh(e)}catch(e){lu(t,t.return,e)}}function Rl(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new _l),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new _l),t;default:throw Error(i(435,e.tag))}}(e);t.forEach((function(t){var i=fu.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}function Pl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(dd(l.type)){Ml=l.stateNode,El=!1;break e}break;case 5:Ml=l.stateNode,El=!1;break e;case 3:case 4:Ml=l.stateNode.containerInfo,El=!0;break e}l=l.return}if(null===Ml)throw Error(i(160));Al(o,s,a),Ml=null,El=!1,null!==(o=a.alternate)&&(o.return=null),a.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)kl(t,e),t=t.sibling}var Ll=null;function kl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pl(t,e),Nl(e),4&r&&(al(3,e,e.return),rl(3,e),al(5,e,e.return));break;case 1:Pl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),64&r&&vl&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var a=Ll;if(Pl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),4&r){var o=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":(!(o=a.getElementsByTagName("title")[0])||o[Ue]||o[Pe]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector("head > title"))),Qu(o,r,n),o[Pe]=e,je(o),r=o;break e;case"link":var s=Ud("link","href",a).get(r+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((o=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}Qu(o=a.createElement(r),r,n),a.head.appendChild(o);break;case"meta":if(s=Ud("meta","content",a).get(r+(n.content||"")))for(l=0;l<s.length;l++)if((o=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}Qu(o=a.createElement(r),r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[Pe]=e,je(o),r=o}e.stateNode=r}else zd(a,e.type,e.stateNode);else e.stateNode=kd(a,r,e.memoizedProps);else o!==r?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===r?zd(a,e.type,e.stateNode):kd(a,r,e.memoizedProps)):null===r&&null!==e.stateNode&&dl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),null!==n&&4&r&&dl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),32&e.flags){a=e.stateNode;try{_t(a,"")}catch(t){lu(e,e.return,t)}}4&r&&null!=e.stateNode&&dl(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&r&&(xl=!0);break;case 6:if(Pl(t,e),Nl(e),4&r){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){lu(e,e.return,t)}}break;case 3:if(Od=null,a=Ll,Ll=Sd(t.containerInfo),Pl(t,e),Ll=a,Nl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Eh(t.containerInfo)}catch(t){lu(e,e.return,t)}xl&&(xl=!1,Dl(e));break;case 4:r=Ll,Ll=Sd(e.stateNode.containerInfo),Pl(t,e),Nl(e),Ll=r;break;case 12:default:Pl(t,e),Nl(e);break;case 13:Pl(t,e),Nl(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(xc=J()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Rl(e,r)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=vl,d=yl;if(vl=u||a,yl=d||c,Pl(t,e),yl=d,vl=u,Nl(e),8192&r)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||vl||yl||Ol(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(o=c.stateNode,a)"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,f=null!=h&&h.hasOwnProperty("display")?h.display:null;l.style.display=null==f||"boolean"==typeof f?"":(""+f).trim()}}catch(e){lu(c,c.return,e)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(e){lu(c,c.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,Rl(e,n))));break;case 19:Pl(t,e),Nl(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Rl(e,r)));case 30:case 21:}}function Nl(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(hl(r)){n=r;break}r=r.return}if(null==n)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ml(e,fl(e),a);break;case 5:var o=n.stateNode;32&n.flags&&(_t(o,""),n.flags&=-33),ml(e,fl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;pl(e,fl(e),s);break;default:throw Error(i(161))}}catch(t){lu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Dl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Dl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Il(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Sl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:al(4,t,t.return),Ol(t);break;case 1:cl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&sl(t,t.return,n),Ol(t);break;case 27:xd(t.stateNode);case 26:case 5:cl(t,t.return),Ol(t);break;case 22:null===t.memoizedState&&Ol(t);break;default:Ol(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var i=t.alternate,r=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ul(r,a,n),rl(4,a);break;case 1:if(Ul(r,a,n),"function"==typeof(r=(i=a).stateNode).componentDidMount)try{r.componentDidMount()}catch(e){lu(i,i.return,e)}if(null!==(r=(i=a).updateQueue)){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(null!==l)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)ca(l[r],s)}catch(e){lu(i,i.return,e)}}n&&64&o&&ol(a),ll(a,a.return);break;case 27:gl(a);case 26:case 5:Ul(r,a,n),n&&null===i&&4&o&&ul(a),ll(a,a.return);break;case 12:Ul(r,a,n);break;case 13:Ul(r,a,n),n&&4&o&&Cl(r,a);break;case 22:null===a.memoizedState&&Ul(r,a,n),ll(a,a.return);break;case 30:break;default:Ul(r,a,n)}t=t.sibling}}function zl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&kr(n))}function Fl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&kr(e))}function Bl(e,t,n,i){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Hl(e,t,n,i),t=t.sibling}function Hl(e,t,n,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Bl(e,t,n,i),2048&r&&rl(9,t);break;case 1:case 13:default:Bl(e,t,n,i);break;case 3:Bl(e,t,n,i),2048&r&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&kr(e)));break;case 12:if(2048&r){Bl(e,t,n,i),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"==typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){lu(t,t.return,e)}}else Bl(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,null!==t.memoizedState?2&a._visibility?Bl(e,t,n,i):jl(e,t):2&a._visibility?Bl(e,t,n,i):(a._visibility|=2,Vl(e,t,n,i,!!(10256&t.subtreeFlags))),2048&r&&zl(o,t);break;case 24:Bl(e,t,n,i),2048&r&&Fl(t.alternate,t)}}function Vl(e,t,n,i,r){for(r=r&&!!(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,o=t,s=n,l=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:Vl(a,o,s,l,r),rl(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?2&u._visibility?Vl(a,o,s,l,r):jl(a,o):(u._visibility|=2,Vl(a,o,s,l,r)),r&&2048&c&&zl(o.alternate,o);break;case 24:Vl(a,o,s,l,r),r&&2048&c&&Fl(o.alternate,o);break;default:Vl(a,o,s,l,r)}t=t.sibling}}function jl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:jl(n,i),2048&r&&zl(i.alternate,i);break;case 24:jl(n,i),2048&r&&Fl(i.alternate,i);break;default:jl(n,i)}t=t.sibling}}var Gl=8192;function Wl(e){if(e.subtreeFlags&Gl)for(e=e.child;null!==e;)Xl(e),e=e.sibling}function Xl(e){switch(e.tag){case 26:Wl(e),e.flags&Gl&&null!==e.memoizedState&&function(e,t,n){if(null===Bd)throw Error(i(475));var r=Bd;if(!("stylesheet"!==t.type||"string"==typeof n.media&&!1===matchMedia(n.media).matches||4&t.state.loading)){if(null===t.instance){var a=Ad(n.href),o=e.querySelector(Cd(a));if(o)return null!==(e=o._p)&&"object"==typeof e&&"function"==typeof e.then&&(r.count++,r=Vd.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=o,void je(o);o=e.ownerDocument||e,n=Rd(n),(a=_d.get(a))&&Dd(n,a),je(o=o.createElement("link"));var s=o;s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Qu(o,"link",n),t.instance=o}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(3&t.state.loading)&&(r.count++,t=Vd.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(Ll,e.memoizedState,e.memoizedProps);break;case 5:default:Wl(e);break;case 3:case 4:var t=Ll;Ll=Sd(e.stateNode.containerInfo),Wl(e),Ll=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Gl,Gl=16777216,Wl(e),Gl=t):Wl(e))}}function $l(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function ql(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];bl=i,Kl(i,e)}$l(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Yl(e),e=e.sibling}function Yl(e){switch(e.tag){case 0:case 11:case 15:ql(e),2048&e.flags&&al(9,e,e.return);break;case 3:case 12:default:ql(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Zl(e)):ql(e)}}function Zl(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];bl=i,Kl(i,e)}$l(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:al(8,t,t.return),Zl(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Zl(t));break;default:Zl(t)}e=e.sibling}}function Kl(e,t){for(;null!==bl;){var n=bl;switch(n.tag){case 0:case 11:case 15:al(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var i=n.memoizedState.cachePool.pool;null!=i&&i.refCount++}break;case 24:kr(n.memoizedState.cache)}if(null!==(i=n.child))i.return=n,bl=i;else e:for(n=e;null!==bl;){var r=(i=bl).sibling,a=i.return;if(wl(i),i===n){bl=null;break e}if(null!==r){r.return=a,bl=r;break e}bl=a}}}var Ql={getCacheForType:function(e){var t=Mr(Pr),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},Jl="function"==typeof WeakMap?WeakMap:Map,ec=0,tc=null,nc=null,ic=0,rc=0,ac=null,oc=!1,sc=!1,lc=!1,cc=0,uc=0,dc=0,hc=0,fc=0,pc=0,mc=0,gc=null,vc=null,yc=!1,xc=0,_c=1/0,bc=null,Sc=null,wc=0,Mc=null,Ec=null,Tc=0,Ac=0,Cc=null,Rc=null,Pc=0,Lc=null;function kc(){if(2&ec&&0!==ic)return ic&-ic;if(null!==k.T){return 0!==Ir?Ir:Au()}return Ce()}function Nc(){0===pc&&(pc=536870912&ic&&!ir?536870912:_e());var e=ns.current;return null!==e&&(e.flags|=32),pc}function Dc(e,t,n){(e!==tc||2!==rc&&9!==rc)&&null===e.cancelPendingCommit||(Hc(e,0),zc(e,ic,pc,!1)),we(e,n),2&ec&&e===tc||(e===tc&&(!(2&ec)&&(hc|=n),4===uc&&zc(e,ic,pc,!1)),_u(e))}function Ic(e,t,n){if(6&ec)throw Error(i(327));for(var r=!n&&!(124&t)&&!(t&e.expiredLanes)||ye(e,t),a=r?function(e,t){var n=ec;ec|=2;var r=jc(),a=Gc();tc!==e||ic!==t?(bc=null,_c=J()+500,Hc(e,t)):sc=ye(e,t);e:for(;;)try{if(0!==rc&&null!==nc){t=nc;var o=ac;t:switch(rc){case 1:rc=0,ac=null,Kc(e,t,o,1);break;case 2:case 9:if($r(o)){rc=0,ac=null,Zc(t);break}t=function(){2!==rc&&9!==rc||tc!==e||(rc=7),_u(e)},o.then(t,t);break e;case 3:rc=7;break e;case 4:rc=5;break e;case 7:$r(o)?(rc=0,ac=null,Zc(t)):(rc=0,ac=null,Kc(e,t,o,7));break;case 5:var s=null;switch(nc.tag){case 26:s=nc.memoizedState;case 5:case 27:var l=nc;if(!s||Fd(s)){rc=0,ac=null;var c=l.sibling;if(null!==c)nc=c;else{var u=l.return;null!==u?(nc=u,Qc(u)):nc=null}break t}}rc=0,ac=null,Kc(e,t,o,5);break;case 6:rc=0,ac=null,Kc(e,t,o,6);break;case 8:Bc(),uc=6;break e;default:throw Error(i(462))}}qc();break}catch(t){Vc(e,t)}return gr=mr=null,k.H=r,k.A=a,ec=n,null!==nc?0:(tc=null,ic=0,Ti(),uc)}(e,t):Xc(e,t,!0),o=r;;){if(0===a){sc&&!r&&zc(e,t,0,!1);break}if(n=e.current.alternate,!o||Uc(n)){if(2===a){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;a=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Hc(l,s).flags|=256),2!==(s=Xc(l,s,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=o,hc|=o,a=4;break e}o=vc,vc=a,null!==o&&(null===vc?vc=o:vc.push.apply(vc,o))}a=s}if(o=!1,2!==a)continue}}if(1===a){Hc(e,0),zc(e,t,0,!0);break}e:{switch(r=e,o=a){case 0:case 1:throw Error(i(345));case 4:if((4194048&t)!==t)break;case 6:zc(r,t,pc,!oc);break e;case 2:vc=null;break;case 3:case 5:break;default:throw Error(i(329))}if((62914560&t)===t&&10<(a=xc+300-J())){if(zc(r,t,pc,!oc),0!==ve(r,0,!0))break e;r.timeoutHandle=od(Oc.bind(null,r,n,vc,bc,yc,t,pc,hc,mc,oc,o,2,-0,0),a)}else Oc(r,n,vc,bc,yc,t,pc,hc,mc,oc,o,0,-0,0)}break}a=Xc(e,t,!1),o=!1}_u(e)}function Oc(e,t,n,r,a,o,s,l,c,u,d,h,f,p){if(e.timeoutHandle=-1,(8192&(h=t.subtreeFlags)||!(16785408&~h))&&(Bd={stylesheets:null,count:0,unsuspend:Hd},Xl(t),null!==(h=function(){if(null===Bd)throw Error(i(475));var e=Bd;return e.stylesheets&&0===e.count&&Gd(e,e.stylesheets),0<e.count?function(t){var n=setTimeout((function(){if(e.stylesheets&&Gd(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}),6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=h(eu.bind(null,e,t,o,n,r,a,s,l,c,d,1,f,p)),void zc(e,o,s,!u);eu(e,t,o,n,r,a,s,l,c)}function Uc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!$n(a(),r))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zc(e,t,n,i){t&=~fc,t&=~hc,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var a=31-de(r),o=1<<a;i[a]=-1,r&=~o}0!==n&&Me(e,n,t)}function Fc(){return!!(6&ec)||(bu(0),!1)}function Bc(){if(null!==nc){if(0===rc)var e=nc.return;else gr=mr=null,Ia(e=nc),$o=null,qo=0,e=nc;for(;null!==e;)il(e.alternate,e),e=e.return;nc=null}}function Hc(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,sd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Bc(),tc=e,nc=n=Oi(e.current,null),ic=t,rc=0,ac=null,oc=!1,sc=ye(e,t),lc=!1,mc=pc=fc=hc=dc=uc=0,vc=gc=null,yc=!1,8&t&&(t|=32&t);var i=e.entangledLanes;if(0!==i)for(e=e.entanglements,i&=t;0<i;){var r=31-de(i),a=1<<r;t|=e[r],i&=~a}return cc=t,Ti(),n}function Vc(e,t){va=null,k.H=jo,t===jr||t===Wr?(t=Kr(),rc=3):t===Gr?(t=Kr(),rc=4):rc=t===Ms?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,ac=t,null===nc&&(uc=1,xs(e,Si(t,e.current)))}function jc(){var e=k.H;return k.H=jo,null===e?jo:e}function Gc(){var e=k.A;return k.A=Ql,e}function Wc(){uc=4,oc||(4194048&ic)!==ic&&null!==ns.current||(sc=!0),!(134217727&dc)&&!(134217727&hc)||null===tc||zc(tc,ic,pc,!1)}function Xc(e,t,n){var i=ec;ec|=2;var r=jc(),a=Gc();tc===e&&ic===t||(bc=null,Hc(e,t)),t=!1;var o=uc;e:for(;;)try{if(0!==rc&&null!==nc){var s=nc,l=ac;switch(rc){case 8:Bc(),o=6;break e;case 3:case 2:case 9:case 6:null===ns.current&&(t=!0);var c=rc;if(rc=0,ac=null,Kc(e,s,l,c),n&&sc){o=0;break e}break;default:c=rc,rc=0,ac=null,Kc(e,s,l,c)}}$c(),o=uc;break}catch(t){Vc(e,t)}return t&&e.shellSuspendCounter++,gr=mr=null,ec=i,k.H=r,k.A=a,null===nc&&(tc=null,ic=0,Ti()),o}function $c(){for(;null!==nc;)Yc(nc)}function qc(){for(;null!==nc&&!K();)Yc(nc)}function Yc(e){var t=Ys(e.alternate,e,cc);e.memoizedProps=e.pendingProps,null===t?Qc(e):nc=t}function Zc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ds(n,t,t.pendingProps,t.type,void 0,ic);break;case 11:t=Ds(n,t,t.pendingProps,t.type.render,t.ref,ic);break;case 5:Ia(t);default:il(n,t),t=Ys(n,t=nc=Ui(t,cc),cc)}e.memoizedProps=e.pendingProps,null===t?Qc(e):nc=t}function Kc(e,t,n,r){gr=mr=null,Ia(t),$o=null,qo=0;var a=t.return;try{if(function(e,t,n,r,a){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&br(t,n,a,!0),null!==(n=ns.current)){switch(n.tag){case 13:return null===is?Wc():null===n.alternate&&0===uc&&(uc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xr?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),cu(e,r,a)),!1;case 22:return n.flags|=65536,r===Xr?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),cu(e,r,a)),!1}throw Error(i(435,n.tag))}return cu(e,r,a),Wc(),!1}if(ir)return null!==(t=ns.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==or&&fr(Si(e=Error(i(422),{cause:r}),n))):(r!==or&&fr(Si(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,r=Si(r,n),aa(e,a=bs(e.stateNode,r,a)),4!==uc&&(uc=2)),!1;var o=Error(i(520),{cause:r});if(o=Si(o,n),null===gc?gc=[o]:gc.push(o),4!==uc&&(uc=2),null===t)return!0;r=Si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,aa(n,e=bs(n.stateNode,r,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Sc&&Sc.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,ws(a=Ss(a),e,n,r),aa(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,ic))return uc=1,xs(e,Si(n,e.current)),void(nc=null)}catch(t){if(null!==a)throw nc=a,t;return uc=1,xs(e,Si(n,e.current)),void(nc=null)}32768&t.flags?(ir||1===r?e=!0:sc||536870912&ic?e=!1:(oc=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=ns.current)&&13===r.tag&&(r.flags|=16384))),Jc(t,e)):Qc(t)}function Qc(e){var t=e;do{if(32768&t.flags)return void Jc(t,oc);e=t.return;var n=tl(t.alternate,t,cc);if(null!==n)return void(nc=n);if(null!==(t=t.sibling))return void(nc=t);nc=t=e}while(null!==t);0===uc&&(uc=5)}function Jc(e,t){do{var n=nl(e.alternate,e);if(null!==n)return n.flags&=32767,void(nc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(nc=e);nc=e=n}while(null!==e);uc=6,nc=null}function eu(e,t,n,r,a,o,s,l,c){e.cancelPendingCommit=null;do{au()}while(0!==wc);if(6&ec)throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,function(e,t,n,i,r,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-de(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(null!==h)for(c[u]=null,u=0;u<h.length;u++){var f=h[u];null!==f&&(f.lane&=-536870913)}n&=~d}0!==i&&Me(e,i,0),0!==a&&0===r&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,o|=Ei,s,l,c),e===tc&&(nc=tc=null,ic=0),Ec=t,Mc=e,Tc=n,Ac=o,Cc=a,Rc=r,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,Y(ie,(function(){return ou(),null}))):(e.callbackNode=null,e.callbackPriority=0),r=!!(13878&t.flags),13878&t.subtreeFlags||r){r=k.T,k.T=null,a=N.p,N.p=2,s=ec,ec|=4;try{!function(e,t){if(e=e.containerInfo,Ju=eh,Jn(e=Qn(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||0!==a&&3!==h.nodeType||(l=s+a),h!==o||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(p=h.firstChild);)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===a&&(l=s),f===o&&++d===r&&(c=s),null!==(p=h.nextSibling))break;f=(h=f).parentNode}h=p}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ed={focusedElem:e,selectionRange:n},eh=!1,bl=t;null!==bl;)if(e=(t=bl).child,1024&t.subtreeFlags&&null!==e)e.return=t,bl=e;else for(;null!==bl;){switch(o=(t=bl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==o){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var m=ps(n.type,a,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(m,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){lu(n,n.return,e)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))fd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fd(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(i(163))}if(null!==(e=t.sibling)){e.return=t.return,bl=e;break}bl=t.return}}(e,t)}finally{ec=s,N.p=a,k.T=r}}wc=1,tu(),nu(),iu()}}function tu(){if(1===wc){wc=0;var e=Mc,t=Ec,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=k.T,k.T=null;var i=N.p;N.p=2;var r=ec;ec|=4;try{kl(t,e);var a=ed,o=Qn(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kn(s.ownerDocument.documentElement,s)){if(null!==l&&Jn(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var f=h.getSelection(),p=s.textContent.length,m=Math.min(l.start,p),g=void 0===l.end?m:Math.min(l.end,p);!f.extend&&m>g&&(o=g,g=m,m=o);var v=Zn(s,m),y=Zn(s,g);if(v&&y&&(1!==f.rangeCount||f.anchorNode!==v.node||f.anchorOffset!==v.offset||f.focusNode!==y.node||f.focusOffset!==y.offset)){var x=d.createRange();x.setStart(v.node,v.offset),f.removeAllRanges(),m>g?(f.addRange(x),f.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),f.addRange(x))}}}}for(d=[],f=s;f=f.parentNode;)1===f.nodeType&&d.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var _=d[s];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}eh=!!Ju,ed=Ju=null}finally{ec=r,N.p=i,k.T=n}}e.current=t,wc=2}}function nu(){if(2===wc){wc=0;var e=Mc,t=Ec,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=k.T,k.T=null;var i=N.p;N.p=2;var r=ec;ec|=4;try{Sl(e,t.alternate,t)}finally{ec=r,N.p=i,k.T=n}}wc=3}}function iu(){if(4===wc||3===wc){wc=0,Q();var e=Mc,t=Ec,n=Tc,i=Rc;10256&t.subtreeFlags||10256&t.flags?wc=5:(wc=0,Ec=Mc=null,ru(e,e.pendingLanes));var r=e.pendingLanes;if(0===r&&(Sc=null),Ae(n),t=t.stateNode,ce&&"function"==typeof ce.onCommitFiberRoot)try{ce.onCommitFiberRoot(le,t,void 0,!(128&~t.current.flags))}catch(e){}if(null!==i){t=k.T,r=N.p,N.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<i.length;o++){var s=i[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,N.p=r}}3&Tc&&au(),_u(e),r=e.pendingLanes,4194090&n&&42&r?e===Lc?Pc++:(Pc=0,Lc=e):Pc=0,bu(0)}}function ru(e,t){0==(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,kr(t)))}function au(e){return tu(),nu(),iu(),ou()}function ou(){if(5!==wc)return!1;var e=Mc,t=Ac;Ac=0;var n=Ae(Tc),r=k.T,a=N.p;try{N.p=32>n?32:n,k.T=null,n=Cc,Cc=null;var o=Mc,s=Tc;if(wc=0,Ec=Mc=null,Tc=0,6&ec)throw Error(i(331));var l=ec;if(ec|=4,Yl(o.current),Hl(o,o.current,s,n),ec=l,bu(0,!1),ce&&"function"==typeof ce.onPostCommitFiberRoot)try{ce.onPostCommitFiberRoot(le,o)}catch(e){}return!0}finally{N.p=a,k.T=r,ru(e,t)}}function su(e,t,n){t=Si(n,t),null!==(e=ia(e,t=bs(e.stateNode,t,2),2))&&(we(e,2),_u(e))}function lu(e,t,n){if(3===e.tag)su(e,e,n);else for(;null!==t;){if(3===t.tag){su(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Sc||!Sc.has(i))){e=Si(n,e),null!==(i=ia(t,n=Ss(2),2))&&(ws(n,i,t,e),we(i,2),_u(i));break}}t=t.return}}function cu(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new Jl;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(lc=!0,r.add(n),e=uu.bind(null,e,t,n),t.then(e,e))}function uu(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,tc===e&&(ic&n)===n&&(4===uc||3===uc&&(62914560&ic)===ic&&300>J()-xc?!(2&ec)&&Hc(e,0):fc|=n,mc===ic&&(mc=0)),_u(e)}function du(e,t){0===t&&(t=be()),null!==(e=Ri(e,t))&&(we(e,t),_u(e))}function hu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),du(e,n)}function fu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),du(e,n)}var pu=null,mu=null,gu=!1,vu=!1,yu=!1,xu=0;function _u(e){e!==mu&&null===e.next&&(null===mu?pu=mu=e:mu=mu.next=e),vu=!0,gu||(gu=!0,cd((function(){6&ec?Y(te,Su):wu()})))}function bu(e,t){if(!yu&&vu){yu=!0;do{for(var n=!1,i=pu;null!==i;){if(0!==e){var r=i.pendingLanes;if(0===r)var a=0;else{var o=i.suspendedLanes,s=i.pingedLanes;a=(1<<31-de(42|e)+1)-1,a=201326741&(a&=r&~(o&~s))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Tu(i,a))}else a=ic,!(3&(a=ve(i,i===tc?a:0,null!==i.cancelPendingCommit||-1!==i.timeoutHandle)))||ye(i,a)||(n=!0,Tu(i,a));i=i.next}}while(n);yu=!1}}function Su(){wu()}function wu(){vu=gu=!1;var e=0;0!==xu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==ad&&(ad=e,!0);return ad=null,!1}()&&(e=xu),xu=0);for(var t=J(),n=null,i=pu;null!==i;){var r=i.next,a=Mu(i,t);0===a?(i.next=null,null===n?pu=r:n.next=r,null===r&&(mu=n)):(n=i,(0!==e||3&a)&&(vu=!0)),i=r}bu(e)}function Mu(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-de(a),s=1<<o,l=r[o];-1===l?s&n&&!(s&i)||(r[o]=xe(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(n=ic,n=ve(e,e===(t=tc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),i=e.callbackNode,0===n||e===t&&(2===rc||9===rc)||null!==e.cancelPendingCommit)return null!==i&&null!==i&&Z(i),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||ye(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==i&&Z(i),Ae(n)){case 2:case 8:n=ne;break;case 32:default:n=ie;break;case 268435456:n=ae}return i=Eu.bind(null,e),n=Y(n,i),e.callbackPriority=t,e.callbackNode=n,t}return null!==i&&null!==i&&Z(i),e.callbackPriority=2,e.callbackNode=null,2}function Eu(e,t){if(0!==wc&&5!==wc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(au()&&e.callbackNode!==n)return null;var i=ic;return 0===(i=ve(e,e===tc?i:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Ic(e,i,t),Mu(e,J()),null!=e.callbackNode&&e.callbackNode===n?Eu.bind(null,e):null)}function Tu(e,t){if(au())return null;Ic(e,t,!0)}function Au(){return 0===xu&&(xu=_e()),xu}function Cu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:At(""+e)}function Ru(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Pu=0;Pu<xi.length;Pu++){var Lu=xi[Pu];_i(Lu.toLowerCase(),"on"+(Lu[0].toUpperCase()+Lu.slice(1)))}_i(di,"onAnimationEnd"),_i(hi,"onAnimationIteration"),_i(fi,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(pi,"onTransitionRun"),_i(mi,"onTransitionStart"),_i(gi,"onTransitionCancel"),_i(vi,"onTransitionEnd"),$e("onMouseEnter",["mouseout","mouseover"]),$e("onMouseLeave",["mouseout","mouseover"]),$e("onPointerEnter",["pointerout","pointerover"]),$e("onPointerLeave",["pointerout","pointerover"]),Xe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xe("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ku));function Du(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var a=void 0;if(t)for(var o=i.length-1;0<=o;o--){var s=i[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(e){ms(e)}r.currentTarget=null,a=l}else for(o=0;o<i.length;o++){if(l=(s=i[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(e){ms(e)}r.currentTarget=null,a=l}}}}function Iu(e,t){var n=t[Ne];void 0===n&&(n=t[Ne]=new Set);var i=e+"__bubble";n.has(i)||(Fu(t,e,2,!1),n.add(i))}function Ou(e,t,n){var i=0;t&&(i|=4),Fu(n,e,i,t)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function zu(e){if(!e[Uu]){e[Uu]=!0,Ge.forEach((function(t){"selectionchange"!==t&&(Nu.has(t)||Ou(t,!1,e),Ou(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Uu]||(t[Uu]=!0,Ou("selectionchange",!1,t))}}function Fu(e,t,n,i){switch(sh(t)){case 2:var r=th;break;case 8:r=nh;break;default:r=ih}n=r.bind(null,t,n,e),r=void 0,!Ut||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Bu(e,t,n,i,r){var o=i;if(!(1&t||2&t||null===i))e:for(;;){if(null===i)return;var s=i.tag;if(3===s||4===s){var l=i.stateNode.containerInfo;if(l===r)break;if(4===s)for(s=i.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===r)return;s=s.return}for(;null!==l;){if(null===(s=Fe(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){i=o=s;continue e}l=l.parentNode}}i=i.return}Dt((function(){var i=o,r=Rt(n),s=[];e:{var l=yi.get(e);if(void 0!==l){var c=Kt,u=e;switch(e){case"keypress":if(0===jt(n))break e;case"keydown":case"keyup":c=fn;break;case"focusin":u="focus",c=rn;break;case"focusout":u="blur",c=rn;break;case"beforeblur":case"afterblur":c=rn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=nn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=mn;break;case di:case hi:case fi:c=an;break;case vi:c=gn;break;case"scroll":case"scrollend":c=Jt;break;case"wheel":c=vn;break;case"copy":case"cut":case"paste":c=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=pn;break;case"toggle":case"beforetoggle":c=yn}var d=!!(4&t),h=!d&&("scroll"===e||"scrollend"===e),f=d?null!==l?l+"Capture":null:l;d=[];for(var p,m=i;null!==m;){var g=m;if(p=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===p||null===f||null!=(g=It(m,f))&&d.push(Hu(m,g,p)),h)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,r),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===Ct||!(u=n.relatedTarget||n.fromElement)||!Fe(u)&&!u[ke])&&(c||l)&&(l=r.window===r?r:(l=r.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=i,null!==(u=(u=n.relatedTarget||n.toElement)?Fe(u):null)&&(h=a(u),d=u.tag,u!==h||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=i),c!==u)){if(d=tn,g="onMouseLeave",f="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=pn,g="onPointerLeave",f="onPointerEnter",m="pointer"),h=null==c?l:He(c),p=null==u?l:He(u),(l=new d(g,m+"leave",c,n,r)).target=h,l.relatedTarget=p,g=null,Fe(r)===i&&((d=new d(f,m+"enter",u,n,r)).target=p,d.relatedTarget=h,g=d),h=g,c&&u)e:{for(f=u,m=0,p=d=c;p;p=ju(p))m++;for(p=0,g=f;g;g=ju(g))p++;for(;0<m-p;)d=ju(d),m--;for(;0<p-m;)f=ju(f),p--;for(;m--;){if(d===f||null!==f&&d===f.alternate)break e;d=ju(d),f=ju(f)}d=null}else d=null;null!==c&&Gu(s,l,c,d,!1),null!==u&&null!==h&&Gu(s,h,u,d,!0)}if("select"===(c=(l=i?He(i):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var v=On;else if(Pn(l))if(Un)v=Xn;else{v=Gn;var y=jn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?i&&Mt(i.elementType)&&(v=On):v=Wn;switch(v&&(v=v(e,i))?Ln(s,v,n,r):(y&&y(e,l,i),"focusout"===e&&i&&"number"===l.type&&null!=i.memoizedProps.value&&gt(l,"number",l.value)),y=i?He(i):window,e){case"focusin":(Pn(y)||"true"===y.contentEditable)&&(ti=y,ni=i,ii=null);break;case"focusout":ii=ni=ti=null;break;case"mousedown":ri=!0;break;case"contextmenu":case"mouseup":case"dragend":ri=!1,ai(s,n,r);break;case"selectionchange":if(ei)break;case"keydown":case"keyup":ai(s,n,r)}var x;if(_n)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Cn?Tn(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(wn&&"ko"!==n.locale&&(Cn||"onCompositionStart"!==_?"onCompositionEnd"===_&&Cn&&(x=Vt()):(Bt="value"in(Ft=r)?Ft.value:Ft.textContent,Cn=!0)),0<(y=Vu(i,_)).length&&(_=new sn(_,e,null,n,r),s.push({event:_,listeners:y}),x?_.data=x:null!==(x=An(n))&&(_.data=x))),(x=Sn?function(e,t){switch(e){case"compositionend":return An(t);case"keypress":return 32!==t.which?null:(En=!0,Mn);case"textInput":return(e=t.data)===Mn&&En?null:e;default:return null}}(e,n):function(e,t){if(Cn)return"compositionend"===e||!_n&&Tn(e,t)?(e=Vt(),Ht=Bt=Ft=null,Cn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(_=Vu(i,"onBeforeInput")).length&&(y=new sn("onBeforeInput","beforeinput",null,n,r),s.push({event:y,listeners:_}),y.data=x)),function(e,t,n,i,r){if("submit"===t&&n&&n.stateNode===r){var a=Cu((r[Le]||null).action),o=i.submitter;o&&null!==(t=(t=o[Le]||null)?Cu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new Kt("action","action",null,i,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(0!==xu){var e=o?Ru(r,o):new FormData(r);Ro(n,{pending:!0,data:e,method:r.method,action:a},null,e)}}else"function"==typeof a&&(s.preventDefault(),e=o?Ru(r,o):new FormData(r),Ro(n,{pending:!0,data:e,method:r.method,action:a},a,e))},currentTarget:r}]})}}(s,e,i,n,r)}Du(s,t)}))}function Hu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vu(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,a=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===a||(null!=(r=It(e,n))&&i.unshift(Hu(e,r,a)),null!=(r=It(e,t))&&i.push(Hu(e,r,a))),3===e.tag)return i;e=e.return}return[]}function ju(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Gu(e,t,n,i,r){for(var a=t._reactName,o=[];null!==n&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===i)break;5!==s&&26!==s&&27!==s||null===c||(l=c,r?null!=(c=It(n,a))&&o.unshift(Hu(n,c,l)):r||null!=(c=It(n,a))&&o.push(Hu(n,c,l))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Wu=/\r\n?/g,Xu=/\u0000|\uFFFD/g;function $u(e){return("string"==typeof e?e:""+e).replace(Wu,"\n").replace(Xu,"")}function qu(e,t){return t=$u(t),$u(e)===t}function Yu(){}function Zu(e,t,n,r,a,o){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||_t(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&_t(e,""+r);break;case"className":et(e,"class",r);break;case"tabIndex":et(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":et(e,n,r);break;case"style":wt(e,r,o);break;case"data":if("object"!==t){et(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof o&&("formAction"===n?("input"!==t&&Zu(e,t,"name",a.name,a,null),Zu(e,t,"formEncType",a.formEncType,a,null),Zu(e,t,"formMethod",a.formMethod,a,null),Zu(e,t,"formTarget",a.formTarget,a,null)):(Zu(e,t,"encType",a.encType,a,null),Zu(e,t,"method",a.method,a,null),Zu(e,t,"target",a.target,a,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Yu);break;case"onScroll":null!=r&&Iu("scroll",e);break;case"onScrollEnd":null!=r&&Iu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=At(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Iu("beforetoggle",e),Iu("toggle",e),Je(e,"popover",r);break;case"xlinkActuate":tt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":tt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":tt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":tt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":tt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":tt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":tt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":tt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":tt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Je(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&Je(e,n=Et.get(n)||n,r)}}function Ku(e,t,n,r,a,o){switch(n){case"style":wt(e,r,o);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"children":"string"==typeof r?_t(e,r):("number"==typeof r||"bigint"==typeof r)&&_t(e,""+r);break;case"onScroll":null!=r&&Iu("scroll",e);break;case"onScrollEnd":null!=r&&Iu("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Yu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:We.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(o=null!=(o=e[Le]||null)?o[n]:null)&&e.removeEventListener(t,o,a),"function"!=typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):Je(e,n,r):("function"!=typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a)))}}function Qu(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Iu("error",e),Iu("load",e);var r,a=!1,o=!1;for(r in n)if(n.hasOwnProperty(r)){var s=n[r];if(null!=s)switch(r){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Zu(e,t,r,s,n,null)}}return o&&Zu(e,t,"srcSet",n.srcSet,n,null),void(a&&Zu(e,t,"src",n.src,n,null));case"input":Iu("invalid",e);var l=r=s=o=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":o=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(i(137,t));break;default:Zu(e,t,a,d,n,null)}}return mt(e,r,l,c,u,s,o,!1),void ct(e);case"select":for(o in Iu("invalid",e),a=s=r=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":r=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:Zu(e,t,o,l,n,null)}return t=r,n=s,e.multiple=!!a,void(null!=t?vt(e,!!a,t,!1):null!=n&&vt(e,!!a,n,!0));case"textarea":for(s in Iu("invalid",e),r=o=a=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":a=l;break;case"defaultValue":o=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(i(91));break;default:Zu(e,t,s,l,n,null)}return xt(e,a,o,r),void ct(e);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else Zu(e,t,c,a,n,null);return;case"dialog":Iu("beforetoggle",e),Iu("toggle",e),Iu("cancel",e),Iu("close",e);break;case"iframe":case"object":Iu("load",e);break;case"video":case"audio":for(a=0;a<ku.length;a++)Iu(ku[a],e);break;case"image":Iu("error",e),Iu("load",e);break;case"details":Iu("toggle",e);break;case"embed":case"source":case"link":Iu("error",e),Iu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Zu(e,t,u,a,n,null)}return;default:if(Mt(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&Ku(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&Zu(e,t,l,a,n,null))}var Ju=null,ed=null;function td(e){return 9===e.nodeType?e:e.ownerDocument}function nd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function id(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function rd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ad=null;var od="function"==typeof setTimeout?setTimeout:void 0,sd="function"==typeof clearTimeout?clearTimeout:void 0,ld="function"==typeof Promise?Promise:void 0,cd="function"==typeof queueMicrotask?queueMicrotask:void 0!==ld?function(e){return ld.resolve(null).then(e).catch(ud)}:od;function ud(e){setTimeout((function(){throw e}))}function dd(e){return"head"===e}function hd(e,t){var n=t,i=0,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0<i&&8>i){n=i;var o=e.ownerDocument;if(1&n&&xd(o.documentElement),2&n&&xd(o.body),4&n)for(xd(n=o.head),o=n.firstChild;o;){var s=o.nextSibling,l=o.nodeName;o[Ue]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===o.rel.toLowerCase()||n.removeChild(o),o=s}}if(0===r)return e.removeChild(a),void Eh(t);r--}else"$"===n||"$?"===n||"$!"===n?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);Eh(t)}function fd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":fd(n),ze(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function pd(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function md(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var gd=null;function vd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function yd(e,t,n){switch(t=td(n),e){case"html":if(!(e=t.documentElement))throw Error(i(452));return e;case"head":if(!(e=t.head))throw Error(i(453));return e;case"body":if(!(e=t.body))throw Error(i(454));return e;default:throw Error(i(451))}}function xd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ze(e)}var _d=new Map,bd=new Set;function Sd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var wd=N.d;N.d={f:function(){var e=wd.f(),t=Fc();return e||t},r:function(e){var t=Be(e);null!==t&&5===t.tag&&"form"===t.type?Lo(t):wd.r(e)},D:function(e){wd.D(e),Ed("dns-prefetch",e,null)},C:function(e,t){wd.C(e,t),Ed("preconnect",e,t)},L:function(e,t,n){wd.L(e,t,n);var i=Md;if(i&&e&&t){var r='link[rel="preload"][as="'+ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ft(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+ft(n.imageSizes)+'"]')):r+='[href="'+ft(e)+'"]';var a=r;switch(t){case"style":a=Ad(e);break;case"script":a=Pd(e)}_d.has(a)||(e=c({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),_d.set(a,e),null!==i.querySelector(r)||"style"===t&&i.querySelector(Cd(a))||"script"===t&&i.querySelector(Ld(a))||(Qu(t=i.createElement("link"),"link",e),je(t),i.head.appendChild(t)))}},m:function(e,t){wd.m(e,t);var n=Md;if(n&&e){var i=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+ft(i)+'"][href="'+ft(e)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Pd(e)}if(!_d.has(a)&&(e=c({rel:"modulepreload",href:e},t),_d.set(a,e),null===n.querySelector(r))){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ld(a)))return}Qu(i=n.createElement("link"),"link",e),je(i),n.head.appendChild(i)}}},X:function(e,t){wd.X(e,t);var n=Md;if(n&&e){var i=Ve(n).hoistableScripts,r=Pd(e),a=i.get(r);a||((a=n.querySelector(Ld(r)))||(e=c({src:e,async:!0},t),(t=_d.get(r))&&Id(e,t),je(a=n.createElement("script")),Qu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}},S:function(e,t,n){wd.S(e,t,n);var i=Md;if(i&&e){var r=Ve(i).hoistableStyles,a=Ad(e);t=t||"default";var o=r.get(a);if(!o){var s={loading:0,preload:null};if(o=i.querySelector(Cd(a)))s.loading=5;else{e=c({rel:"stylesheet",href:e,"data-precedence":t},n),(n=_d.get(a))&&Dd(e,n);var l=o=i.createElement("link");je(l),Qu(l,"link",e),l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),l.addEventListener("load",(function(){s.loading|=1})),l.addEventListener("error",(function(){s.loading|=2})),s.loading|=4,Nd(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:s},r.set(a,o)}}},M:function(e,t){wd.M(e,t);var n=Md;if(n&&e){var i=Ve(n).hoistableScripts,r=Pd(e),a=i.get(r);a||((a=n.querySelector(Ld(r)))||(e=c({src:e,async:!0,type:"module"},t),(t=_d.get(r))&&Id(e,t),je(a=n.createElement("script")),Qu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}};var Md="undefined"==typeof document?null:document;function Ed(e,t,n){var i=Md;if(i&&"string"==typeof t&&t){var r=ft(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),bd.has(r)||(bd.add(r),e={rel:e,crossOrigin:n,href:t},null===i.querySelector(r)&&(Qu(t=i.createElement("link"),"link",e),je(t),i.head.appendChild(t)))}}function Td(e,t,n,r){var a,o,s,l,c=(c=V.current)?Sd(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Ad(n.href),(r=(n=Ve(c).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Ad(n.href);var u=Ve(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Cd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),_d.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_d.set(e,n),u||(a=c,o=e,s=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=a.createElement("link"),l.preload=o,o.addEventListener("load",(function(){return l.loading|=1})),o.addEventListener("error",(function(){return l.loading|=2})),Qu(o,"link",s),je(o),a.head.appendChild(o))))),t&&null===r)throw Error(i(528,""));return d}if(t&&null!==r)throw Error(i(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Pd(n),(r=(n=Ve(c).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ad(e){return'href="'+ft(e)+'"'}function Cd(e){return'link[rel="stylesheet"]['+e+"]"}function Rd(e){return c({},e,{"data-precedence":e.precedence,precedence:null})}function Pd(e){return'[src="'+ft(e)+'"]'}function Ld(e){return"script[async]"+e}function kd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ft(n.href)+'"]');if(r)return t.instance=r,je(r),r;var a=c({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return je(r=(e.ownerDocument||e).createElement("style")),Qu(r,"style",a),Nd(r,n.precedence,e),t.instance=r;case"stylesheet":a=Ad(n.href);var o=e.querySelector(Cd(a));if(o)return t.state.loading|=4,t.instance=o,je(o),o;r=Rd(n),(a=_d.get(a))&&Dd(r,a),je(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Qu(o,"link",r),t.state.loading|=4,Nd(o,n.precedence,e),t.instance=o;case"script":return o=Pd(n.src),(a=e.querySelector(Ld(o)))?(t.instance=a,je(a),a):(r=n,(a=_d.get(o))&&Id(r=c({},n),a),je(a=(e=e.ownerDocument||e).createElement("script")),Qu(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(i(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Nd(r,n.precedence,e));return t.instance}function Nd(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var s=i[o];if(s.dataset.precedence===t)a=s;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Dd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Id(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Od=null;function Ud(e,t,n){if(null===Od){var i=new Map,r=Od=new Map;r.set(n,i)}else(i=(r=Od).get(n))||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[Ue]||a[Pe]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=i.get(o);s?s.push(a):i.set(o,[a])}}return i}function zd(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function Fd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var Bd=null;function Hd(){}function Vd(){if(this.count--,0===this.count)if(this.stylesheets)Gd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var jd=null;function Gd(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,jd=new Map,t.forEach(Wd,e),jd=null,Vd.call(e))}function Wd(e,t){if(!(4&t.state.loading)){var n=jd.get(e);if(n)var i=n.get(null);else{n=new Map,jd.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}o=(r=t.instance).getAttribute("data-precedence"),(a=n.get(o)||i)===i&&n.set(null,r),n.set(o,r),this.count++,i=Vd.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var Xd={$$typeof:x,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function $d(e,t,n,i,r,a,o,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Se(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Se(0),this.hiddenUpdates=Se(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function qd(e,t,n,i,r,a,o,s,l,c,u,d){return e=new $d(e,t,n,o,s,l,c,d),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,(t=Lr()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:t},ea(a),e}function Yd(e){return e?e=ki:ki}function Zd(e,t,n,i,r,a){r=Yd(r),null===i.context?i.context=r:i.pendingContext=r,(i=na(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(i.callback=a),null!==(n=ia(e,i,t))&&(Dc(n,0,t),ra(n,e,t))}function Kd(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Qd(e,t){Kd(e,t),(e=e.alternate)&&Kd(e,t)}function Jd(e){if(13===e.tag){var t=Ri(e,67108864);null!==t&&Dc(t,0,67108864),Qd(e,67108864)}}var eh=!0;function th(e,t,n,i){var r=k.T;k.T=null;var a=N.p;try{N.p=2,ih(e,t,n,i)}finally{N.p=a,k.T=r}}function nh(e,t,n,i){var r=k.T;k.T=null;var a=N.p;try{N.p=8,ih(e,t,n,i)}finally{N.p=a,k.T=r}}function ih(e,t,n,i){if(eh){var r=rh(i);if(null===r)Bu(e,t,i,ah,n),gh(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return ch=vh(ch,e,t,n,i,r),!0;case"dragenter":return uh=vh(uh,e,t,n,i,r),!0;case"mouseover":return dh=vh(dh,e,t,n,i,r),!0;case"pointerover":var a=r.pointerId;return hh.set(a,vh(hh.get(a)||null,e,t,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,fh.set(a,vh(fh.get(a)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(gh(e,i),4&t&&-1<mh.indexOf(e)){for(;null!==r;){var a=Be(r);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=ge(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-de(o);s.entanglements[1]|=l,o&=~l}_u(a),!(6&ec)&&(_c=J()+500,bu(0))}}break;case 13:null!==(s=Ri(a,2))&&Dc(s,0,2),Fc(),Qd(a,2)}if(null===(a=rh(i))&&Bu(e,t,i,ah,n),a===r)break;r=a}null!==r&&i.stopPropagation()}else Bu(e,t,i,null,n)}}function rh(e){return oh(e=Rt(e))}var ah=null;function oh(e){if(ah=null,null!==(e=Fe(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=o(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ah=e,null}function sh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case te:return 2;case ne:return 8;case ie:case re:return 32;case ae:return 268435456;default:return 32}default:return 32}}var lh=!1,ch=null,uh=null,dh=null,hh=new Map,fh=new Map,ph=[],mh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gh(e,t){switch(e){case"focusin":case"focusout":ch=null;break;case"dragenter":case"dragleave":uh=null;break;case"mouseover":case"mouseout":dh=null;break;case"pointerover":case"pointerout":hh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fh.delete(t.pointerId)}}function vh(e,t,n,i,r,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},null!==t&&(null!==(t=Be(t))&&Jd(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function yh(e){var t=Fe(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=o(n)))return e.blockedOn=t,void function(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}(e.priority,(function(){if(13===n.tag){var e=kc();e=Te(e);var t=Ri(n,e);null!==t&&Dc(t,0,e),Qd(n,e)}}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function xh(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=rh(e.nativeEvent);if(null!==n)return null!==(t=Be(n))&&Jd(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);Ct=i,n.target.dispatchEvent(i),Ct=null,t.shift()}return!0}function _h(e,t,n){xh(e)&&n.delete(t)}function bh(){lh=!1,null!==ch&&xh(ch)&&(ch=null),null!==uh&&xh(uh)&&(uh=null),null!==dh&&xh(dh)&&(dh=null),hh.forEach(_h),fh.forEach(_h)}function Sh(t,n){t.blockedOn===n&&(t.blockedOn=null,lh||(lh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bh)))}var wh=null;function Mh(t){wh!==t&&(wh=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,(function(){wh===t&&(wh=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if("function"!=typeof i){if(null===oh(i||n))continue;break}var a=Be(n);null!==a&&(t.splice(e,3),e-=3,Ro(a,{pending:!0,data:r,method:n.method,action:i},i,r))}})))}function Eh(e){function t(t){return Sh(t,e)}null!==ch&&Sh(ch,e),null!==uh&&Sh(uh,e),null!==dh&&Sh(dh,e),hh.forEach(t),fh.forEach(t);for(var n=0;n<ph.length;n++){var i=ph[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ph.length&&null===(n=ph[0]).blockedOn;)yh(n),null===n.blockedOn&&ph.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],o=r[Le]||null;if("function"==typeof a)o||Mh(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Le]||null)s=o.formAction;else if(null!==oh(r))continue}else s=o.action;"function"==typeof s?n[i+1]=s:(n.splice(i,3),i-=3),Mh(n)}}}function Th(e){this._internalRoot=e}function Ah(e){this._internalRoot=e}Ah.prototype.render=Th.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Zd(t.current,kc(),e,t,null,null)},Ah.prototype.unmount=Th.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zd(e.current,2,null,e,null,null),Fc(),t[ke]=null}},Ah.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ce();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ph.length&&0!==t&&t<ph[n].priority;n++);ph.splice(n,0,e),0===n&&yh(e)}};var Ch=t.version;if("19.1.0"!==Ch)throw Error(i(527,Ch,"19.1.0"));N.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var l=o.alternate;if(null===l){if(null!==(r=o.return)){n=r;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return s(o),e;if(l===r)return s(o),t;l=l.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=l;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,r=l;break}if(u===r){c=!0,r=o,n=l;break}u=u.sibling}if(!c){for(u=l.child;u;){if(u===n){c=!0,n=l,r=o;break}if(u===r){c=!0,r=l,n=o;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?l(e):null)?null:e.stateNode};var Rh={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ph.isDisabled&&Ph.supportsFiber)try{le=Ph.inject(Rh),ce=Ph}catch(e){}}return ax.createRoot=function(e,t){if(!r(e))throw Error(i(299));var n=!1,a="",o=gs,s=vs,l=ys;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=qd(e,1,!1,null,0,n,a,o,s,l,0,null),e[ke]=t.current,zu(e),new Th(t)},ax.hydrateRoot=function(e,t,n){if(!r(e))throw Error(i(299));var a=!1,o="",s=gs,l=vs,c=ys,u=null;return null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(u=n.formState)),(t=qd(e,1,!0,t,0,a,o,s,l,c,0,u)).context=Yd(null),n=t.current,(o=na(a=Te(a=kc()))).callback=null,ia(n,o,a),n=a,t.current.lanes=n,we(t,n),_u(t),e[ke]=t.current,zu(e),new Ah(t)},ax.version="19.1.0",ax}var vx=(hx||(hx=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),rx.exports=gx()),rx.exports);class yx{constructor(e){this.version=tx,e.ipd=0,Bs.getState().setInputMode(e.primaryInputMode),this.devUIContainer=document.createElement("div"),this.devUIContainer.style.position="fixed",this.devUIContainer.style.width="100vw",this.devUIContainer.style.height="100vh",this.devUIContainer.style.top="50vh",this.devUIContainer.style.left="50vw",this.devUIContainer.style.transform="translate(-50%, -50%)",this.devUIContainer.style.pointerEvents="none";const t=this.devUIContainer.attachShadow({mode:"open"});this.inputLayer=new ex(e);vx.createRoot(t).render(d.jsx(xx,{xrDevice:e,inputLayer:this.inputLayer,shadowRoot:t}));const n=()=>{const t=document.createElement("div");document.body.appendChild(t);const n=t.attachShadow({mode:"open"});vx.createRoot(n).render(d.jsx(_x,{xrDevice:e,shadowRoot:n}))};document.body?n():window.onload=n}render(e){this.inputLayer.renderScene(e)}get devUICanvas(){return this.inputLayer.domElement}}const xx=({xrDevice:e,inputLayer:t,shadowRoot:n})=>{const[i,r]=Bn.useState(!1);return Bn.useEffect((()=>{const e=()=>{const e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!e)};return document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),()=>{document.removeEventListener("pointerlockchange",e,!1),document.removeEventListener("mozpointerlockchange",e,!1),document.removeEventListener("webkitpointerlockchange",e,!1)}}),[]),d.jsx(Ea,{target:n,disableCSSOMInjection:!0,children:d.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none"},children:[d.jsx(Xs,{xrDevice:e,inputLayer:t}),d.jsx(Ys,{xrDevice:e,inputLayer:t,pointerLocked:i}),d.jsx(Hs,{xrDevice:e,inputLayer:t,pointerLocked:i})]})})},_x=({xrDevice:e,shadowRoot:t})=>{const[n,i]=Hn.useState(e.sessionOffered&&!e.activeSession);return Hn.useEffect((()=>{setInterval((()=>{i(e.sessionOffered&&!e.activeSession)}),1e3)}),[]),d.jsx(Ea,{target:t,disableCSSOMInjection:!0,children:d.jsxs(ho,{style:{zIndex:899,position:"fixed",top:n?"8px":"-30px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"space-between",left:"50vw",transform:"translateX(-50%)",transition:"all 0.2s ease-in-out",paddingLeft:"5px",gap:"3px"},children:[d.jsx(Qo,{size:24}),d.jsx(fo,{onClick:()=>{e.grantOfferedSession()},style:{fontSize:"16px"},children:"Enter XR"})]})})};export{yx as DevUI,tx as VERSION};
389
+ `,Ys=({xrDevice:e,inputLayer:t,pointerLocked:n})=>{const[i,r]=Hn.useState(e.fovy);return d.jsxs(_o,{style:{left:"8px",top:"8px"},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:"20px"},children:[d.jsxs("div",{style:{fontSize:"13px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"start"},children:[d.jsx(yo,{icon:jo,style:{marginRight:"5px"}}),d.jsx("div",{style:{alignItems:"end"},children:e.name})]}),d.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"1px"}})]}),d.jsx(bo,{}),d.jsx(ks,{vector:t.combinedCameraPosition,icon:Oo}),!n&&d.jsxs(qs,{children:[d.jsx(yo,{icon:Wo,style:{marginRight:"5px"}}),d.jsxs(wo,{children:[d.jsxs("div",{style:{position:"relative",display:"inline-block",height:"25px"},children:[d.jsx(Mo,{type:"text",value:(i/Math.PI*180).toFixed(0)+"°",readOnly:!0,style:{width:"73px"}}),d.jsx(Eo,{children:"FOV-Y"})]}),d.jsx("div",{style:{position:"relative",display:"inline-block"},children:d.jsx($s,{value:i,onChange:t=>{const n=Number(t.target.value);r(n),e.fovy=n},min:Math.PI/6,max:Math.PI/1.5,step:Math.PI/48,style:{width:"80px"}})})]})]})]})},Zs="165",Ks=1,Qs=2,Js=3,el=0,tl=1,nl=2,il=100,rl=101,al=102,ol=200,sl=201,ll=202,cl=203,ul=204,dl=205,hl=206,fl=207,pl=208,ml=209,gl=210,vl=211,yl=212,xl=213,_l=214,bl=0,Sl=1,wl=2,Ml=0,El=1,Tl=2,Al=3,Cl=4,Pl=5,Rl=6,Ll=7,kl=301,Nl=302,Dl=306,Il=1e3,Ol=1001,Ul=1002,zl=1003,Fl=1004,Bl=1005,Hl=1006,Vl=1007,jl=1008,Gl=1009,Wl=1012,Xl=1013,ql=1014,$l=1015,Yl=1016,Zl=1020,Kl=1023,Ql=1026,Jl=1027,ec=33776,tc=33777,nc=33778,ic=33779,rc=36492,ac="",oc="srgb",sc="srgb-linear",lc="display-p3",cc="display-p3-linear",uc="linear",dc="srgb",hc="rec709",fc="p3",pc=7680,mc=512,gc=513,vc=514,yc=515,xc=516,_c=517,bc=518,Sc=519,wc="300 es",Mc=2e3,Ec=2001;class Tc{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,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}const Ac=["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"],Cc=Math.PI/180,Pc=180/Math.PI;function Rc(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Ac[255&e]+Ac[e>>8&255]+Ac[e>>16&255]+Ac[e>>24&255]+"-"+Ac[255&t]+Ac[t>>8&255]+"-"+Ac[t>>16&15|64]+Ac[t>>24&255]+"-"+Ac[63&n|128]+Ac[n>>8&255]+"-"+Ac[n>>16&255]+Ac[n>>24&255]+Ac[255&i]+Ac[i>>8&255]+Ac[i>>16&255]+Ac[i>>24&255]).toLowerCase()}function Lc(e,t,n){return Math.max(t,Math.min(n,e))}function kc(e,t,n){return(1-n)*e+n*t}function Nc(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 Dc(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.")}}class Ic{constructor(e=0,t=0){Ic.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,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){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(Lc(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,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Oc{constructor(e,t,n,i,r,a,o,s,l){Oc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,o,s,l)}set(e,t,n,i,r,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=r,c[5]=s,c[6]=n,c[7]=a,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,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],h=n[5],f=n[8],p=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],S=i[8];return r[0]=a*p+o*v+s*_,r[3]=a*m+o*y+s*b,r[6]=a*g+o*x+s*S,r[1]=l*p+c*v+u*_,r[4]=l*m+c*y+u*b,r[7]=l*g+c*x+u*S,r[2]=d*p+h*v+f*_,r[5]=d*m+h*y+f*b,r[8]=d*g+h*x+f*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],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*r*c+n*o*s+i*r*l-i*a*s}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,d=o*s-c*r,h=l*r-a*s,f=t*u+n*d+i*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(i*l-c*n)*p,e[2]=(o*n-i*a)*p,e[3]=d*p,e[4]=(c*t-i*s)*p,e[5]=(i*r-o*t)*p,e[6]=h*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*r)*p,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,i,r,a,o){const s=Math.cos(r),l=Math.sin(r);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-i*l,i*s,-i*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Uc.makeScale(e,t)),this}rotate(e){return this.premultiply(Uc.makeRotation(-e)),this}translate(e,t){return this.premultiply(Uc.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,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Uc=new Oc;function zc(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Fc(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function Bc(){const e=Fc("canvas");return e.style.display="block",e}const Hc={};function Vc(e){e in Hc||(Hc[e]=!0,console.warn(e))}const jc=(new Oc).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Gc=(new Oc).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Wc={[sc]:{transfer:uc,primaries:hc,toReference:e=>e,fromReference:e=>e},[oc]:{transfer:dc,primaries:hc,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[cc]:{transfer:uc,primaries:fc,toReference:e=>e.applyMatrix3(Gc),fromReference:e=>e.applyMatrix3(jc)},[lc]:{transfer:dc,primaries:fc,toReference:e=>e.convertSRGBToLinear().applyMatrix3(Gc),fromReference:e=>e.applyMatrix3(jc).convertLinearToSRGB()}},Xc=new Set([sc,cc]),qc={enabled:!0,_workingColorSpace:sc,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Xc.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 i=Wc[t].toReference;return(0,Wc[n].fromReference)(i(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 Wc[e].primaries},getTransfer:function(e){return e===ac?uc:Wc[e].transfer}};function $c(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Yc(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Zc;class Kc{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===Zc&&(Zc=Fc("canvas")),Zc.width=e.width,Zc.height=e.height;const n=Zc.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zc}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=Fc("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*$c(r[e]/255);return n.putImageData(i,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*$c(t[e]/255)):t[e]=$c(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 Qc=0;class Jc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qc++}),this.uuid=Rc(),this.data=e,this.dataReady=!0,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:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(eu(i[t].image)):e.push(eu(i[t]))}else e=eu(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function eu(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Kc.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 tu=0;class nu extends Tc{constructor(e=nu.DEFAULT_IMAGE,t=nu.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,o=1023,s=1009,l=nu.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tu++}),this.uuid=Rc(),this.name="",this.source=new Jc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Ic(0,0),this.repeat=new Ic(1,1),this.center=new Ic(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Oc,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(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(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Il:e.x=e.x-Math.floor(e.x);break;case Ol:e.x=e.x<0?0:1;break;case Ul: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 Il:e.y=e.y-Math.floor(e.y);break;case Ol:e.y=e.y<0?0:1;break;case Ul: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)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}nu.DEFAULT_IMAGE=null,nu.DEFAULT_MAPPING=300,nu.DEFAULT_ANISOTROPY=1;class iu{constructor(e=0,t=0,n=0,i=1){iu.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=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,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,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,i,r;const a=.01,o=.1,s=e.elements,l=s[0],c=s[4],u=s[8],d=s[1],h=s[5],f=s[9],p=s[2],m=s[6],g=s[10];if(Math.abs(c-d)<a&&Math.abs(u-p)<a&&Math.abs(f-m)<a){if(Math.abs(c+d)<o&&Math.abs(u+p)<o&&Math.abs(f+m)<o&&Math.abs(l+h+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,s=(h+1)/2,v=(g+1)/2,y=(c+d)/4,x=(u+p)/4,_=(f+m)/4;return e>s&&e>v?e<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=y/n,r=x/n):s>v?s<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=y/i,r=_/i):v<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=x/r,i=_/r),this.set(n,i,r,t),this}let v=Math.sqrt((m-f)*(m-f)+(u-p)*(u-p)+(d-c)*(d-c));return Math.abs(v)<.001&&(v=1),this.x=(m-f)/v,this.y=(u-p)/v,this.z=(d-c)/v,this.w=Math.acos((l+h+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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ru extends Tc{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new iu(0,0,e,t),this.scissorTest=!1,this.viewport=new iu(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Hl,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new nu(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let e=0;e<a;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].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.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Jc(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class au extends ru{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class ou extends nu{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zl,this.minFilter=zl,this.wrapR=Ol,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class su extends nu{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zl,this.minFilter=zl,this.wrapR=Ol,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class lu{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let s=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const d=r[a+0],h=r[a+1],f=r[a+2],p=r[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===o)return e[t+0]=d,e[t+1]=h,e[t+2]=f,void(e[t+3]=p);if(u!==p||s!==d||l!==h||c!==f){let e=1-o;const t=s*d+l*h+c*f+u*p,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),a=Math.atan2(r,t*n);e=Math.sin(e*a)/r,o=Math.sin(o*a)/r}const r=o*n;if(s=s*e+d*r,l=l*e+h*r,c=c*e+f*r,u=u*e+p*r,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],s=n[i+1],l=n[i+2],c=n[i+3],u=r[a],d=r[a+1],h=r[a+2],f=r[a+3];return e[t]=o*f+c*u+s*h-l*d,e[t+1]=s*f+c*d+l*u-o*h,e[t+2]=l*f+c*h+o*d-s*u,e[t+3]=c*f-o*u-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(i/2),u=o(r/2),d=s(n/2),h=s(i/2),f=s(r/2);switch(a){case"XYZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"YXZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"ZXY":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"ZYX":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"YZX":this._x=d*c*u+l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u-d*h*f;break;case"XZY":this._x=d*c*u-l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(s+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(Lc(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+i*l-r*s,this._y=i*c+a*s+r*o-n*l,this._z=r*c+a*l+n*s-i*o,this._w=a*c-n*o-i*s-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),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 cu{constructor(e=0,t=0,n=0){cu.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(du.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(du.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*i-o*n),c=2*(o*t-r*i),u=2*(r*n-a*t);return this.x=t+s*l+a*u-o*c,this.y=n+s*c+o*l-r*u,this.z=i+s*u+r*c-a*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,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const 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,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,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 uu.copy(this).projectOnVector(e),this.sub(uu)}reflect(e){return this.sub(uu.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(Lc(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const uu=new cu,du=new lu;class hu{constructor(e=new cu(1/0,1/0,1/0),t=new cu(-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(pu.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(pu.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=pu.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,pu):pu.fromBufferAttribute(i,t),pu.applyMatrix4(e.matrixWorld),this.expandByPoint(pu);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),mu.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),mu.copy(n.boundingBox)),mu.applyMatrix4(e.matrixWorld),this.union(mu)}const i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[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,pu),pu.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(Su),wu.subVectors(this.max,Su),gu.subVectors(e.a,Su),vu.subVectors(e.b,Su),yu.subVectors(e.c,Su),xu.subVectors(vu,gu),_u.subVectors(yu,vu),bu.subVectors(gu,yu);let t=[0,-xu.z,xu.y,0,-_u.z,_u.y,0,-bu.z,bu.y,xu.z,0,-xu.x,_u.z,0,-_u.x,bu.z,0,-bu.x,-xu.y,xu.x,0,-_u.y,_u.x,0,-bu.y,bu.x,0];return!!Tu(t,gu,vu,yu,wu)&&(t=[1,0,0,0,1,0,0,0,1],!!Tu(t,gu,vu,yu,wu)&&(Mu.crossVectors(xu,_u),t=[Mu.x,Mu.y,Mu.z],Tu(t,gu,vu,yu,wu)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pu).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(pu).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()||(fu[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fu[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fu[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fu[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fu[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fu[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fu[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fu[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fu)),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 fu=[new cu,new cu,new cu,new cu,new cu,new cu,new cu,new cu],pu=new cu,mu=new hu,gu=new cu,vu=new cu,yu=new cu,xu=new cu,_u=new cu,bu=new cu,Su=new cu,wu=new cu,Mu=new cu,Eu=new cu;function Tu(e,t,n,i,r){for(let a=0,o=e.length-3;a<=o;a+=3){Eu.fromArray(e,a);const o=r.x*Math.abs(Eu.x)+r.y*Math.abs(Eu.y)+r.z*Math.abs(Eu.z),s=t.dot(Eu),l=n.dot(Eu),c=i.dot(Eu);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const Au=new hu,Cu=new cu,Pu=new cu;class Ru{constructor(e=new cu,t=-1){this.isSphere=!0,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):Au.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),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;Cu.subVectors(e,this.center);const t=Cu.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(Cu,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):(Pu.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Cu.copy(e.center).add(Pu)),this.expandByPoint(Cu.copy(e.center).sub(Pu))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Lu=new cu,ku=new cu,Nu=new cu,Du=new cu,Iu=new cu,Ou=new cu,Uu=new cu;class zu{constructor(e=new cu,t=new cu(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,Lu)),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=Lu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Lu.copy(this.origin).addScaledVector(this.direction,t),Lu.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){ku.copy(e).add(t).multiplyScalar(.5),Nu.copy(t).sub(e).normalize(),Du.copy(this.origin).sub(ku);const r=.5*e.distanceTo(t),a=-this.direction.dot(Nu),o=Du.dot(this.direction),s=-Du.dot(Nu),l=Du.lengthSq(),c=Math.abs(1-a*a);let u,d,h,f;if(c>0)if(u=a*s-o,d=a*o-s,f=r*c,u>=0)if(d>=-f)if(d<=f){const e=1/c;u*=e,d*=e,h=u*(u+a*d+2*o)+d*(a*u+d+2*s)+l}else d=r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d=-r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;else d<=-f?(u=Math.max(0,-(-a*r+o)),d=u>0?-r:Math.min(Math.max(-r,-s),r),h=-u*u+d*(d+2*s)+l):d<=f?(u=0,d=Math.min(Math.max(-r,-s),r),h=d*(d+2*s)+l):(u=Math.max(0,-(a*r+o)),d=u>0?r:Math.min(Math.max(-r,-s),r),h=-u*u+d*(d+2*s)+l);else d=a>0?-r:r,u=Math.max(0,-(a*d+o)),h=-u*u+d*(d+2*s)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(ku).addScaledVector(Nu,d),h}intersectSphere(e,t){Lu.subVectors(e.center,this.origin);const n=Lu.dot(this.direction),i=Lu.dot(Lu)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,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,i,r,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),c>=0?(r=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(r=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),n>a||r>i?null:((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,Lu)}intersectTriangle(e,t,n,i,r){Iu.subVectors(t,e),Ou.subVectors(n,e),Uu.crossVectors(Iu,Ou);let a,o=this.direction.dot(Uu);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Du.subVectors(this.origin,e);const s=a*this.direction.dot(Ou.crossVectors(Du,Ou));if(s<0)return null;const l=a*this.direction.dot(Iu.cross(Du));if(l<0)return null;if(s+l>o)return null;const c=-a*Du.dot(Uu);return c<0?null:this.at(c/o,r)}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 Fu{constructor(e,t,n,i,r,a,o,s,l,c,u,d,h,f,p,m){Fu.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,i,r,a,o,s,l,c,u,d,h,f,p,m)}set(e,t,n,i,r,a,o,s,l,c,u,d,h,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=f,g[11]=p,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 Fu).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,i=1/Bu.setFromMatrixColumn(e,0).length(),r=1/Bu.setFromMatrixColumn(e,1).length(),a=1/Bu.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,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,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){const e=a*c,n=a*u,i=o*c,r=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-o*s,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,i=l*c,r=l*u;t[0]=e+r*o,t[4]=i*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-i,t[6]=r+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,i=l*c,r=l*u;t[0]=e-r*o,t[4]=-a*u,t[8]=i+n*o,t[1]=n+i*o,t[5]=a*c,t[9]=r-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,i=o*c,r=o*u;t[0]=s*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=s*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,i=o*s,r=o*l;t[0]=s*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if("XZY"===e.order){const e=a*s,n=a*l,i=o*s,r=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=a*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=o*c,t[10]=r*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(Vu,e,ju)}lookAt(e,t,n){const i=this.elements;return Xu.subVectors(e,t),0===Xu.lengthSq()&&(Xu.z=1),Xu.normalize(),Gu.crossVectors(n,Xu),0===Gu.lengthSq()&&(1===Math.abs(n.z)?Xu.x+=1e-4:Xu.z+=1e-4,Xu.normalize(),Gu.crossVectors(n,Xu)),Gu.normalize(),Wu.crossVectors(Xu,Gu),i[0]=Gu.x,i[4]=Wu.x,i[8]=Xu.x,i[1]=Gu.y,i[5]=Wu.y,i[9]=Xu.y,i[2]=Gu.z,i[6]=Wu.z,i[10]=Xu.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],h=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],S=i[4],w=i[8],M=i[12],E=i[1],T=i[5],A=i[9],C=i[13],P=i[2],R=i[6],L=i[10],k=i[14],N=i[3],D=i[7],I=i[11],O=i[15];return r[0]=a*b+o*E+s*P+l*N,r[4]=a*S+o*T+s*R+l*D,r[8]=a*w+o*A+s*L+l*I,r[12]=a*M+o*C+s*k+l*O,r[1]=c*b+u*E+d*P+h*N,r[5]=c*S+u*T+d*R+h*D,r[9]=c*w+u*A+d*L+h*I,r[13]=c*M+u*C+d*k+h*O,r[2]=f*b+p*E+m*P+g*N,r[6]=f*S+p*T+m*R+g*D,r[10]=f*w+p*A+m*L+g*I,r[14]=f*M+p*C+m*k+g*O,r[3]=v*b+y*E+x*P+_*N,r[7]=v*S+y*T+x*R+_*D,r[11]=v*w+y*A+x*L+_*I,r[15]=v*M+y*C+x*k+_*O,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],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+r*s*u-i*l*u-r*o*d+n*l*d+i*o*h-n*s*h)+e[7]*(+t*s*h-t*l*d+r*a*d-i*a*h+i*l*c-r*s*c)+e[11]*(+t*l*u-t*o*h-r*a*u+n*a*h+r*o*c-n*l*c)+e[15]*(-i*o*c-t*s*u+t*o*d+i*a*u-n*a*d+n*s*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 i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*d*l+p*s*h-o*m*h-u*s*g+o*d*g,y=f*d*l-c*m*l-f*s*h+a*m*h+c*s*g-a*d*g,x=c*p*l-f*u*l+f*o*h-a*p*h-c*o*g+a*u*g,_=f*u*s-c*p*s-f*o*d+a*p*d+c*o*m-a*u*m,b=t*v+n*y+i*x+r*_;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]=(p*d*r-u*m*r-p*i*h+n*m*h+u*i*g-n*d*g)*S,e[2]=(o*m*r-p*s*r+p*i*l-n*m*l-o*i*g+n*s*g)*S,e[3]=(u*s*r-o*d*r-u*i*l+n*d*l+o*i*h-n*s*h)*S,e[4]=y*S,e[5]=(c*m*r-f*d*r+f*i*h-t*m*h-c*i*g+t*d*g)*S,e[6]=(f*s*r-a*m*r-f*i*l+t*m*l+a*i*g-t*s*g)*S,e[7]=(a*d*r-c*s*r+c*i*l-t*d*l-a*i*h+t*s*h)*S,e[8]=x*S,e[9]=(f*u*r-c*p*r-f*n*h+t*p*h+c*n*g-t*u*g)*S,e[10]=(a*p*r-f*o*r+f*n*l-t*p*l-a*n*g+t*o*g)*S,e[11]=(c*o*r-a*u*r-c*n*l+t*u*l+a*n*h-t*o*h)*S,e[12]=_*S,e[13]=(c*p*i-f*u*i+f*n*d-t*p*d-c*n*m+t*u*m)*S,e[14]=(f*o*i-a*p*i-f*n*s+t*p*s+a*n*m-t*o*m)*S,e[15]=(a*u*i-c*o*i+c*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return 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),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,l=r*a,c=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,c*o+n,c*s-i*a,0,l*s-i*o,c*s+i*a,r*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,l=r+r,c=a+a,u=o+o,d=r*l,h=r*c,f=r*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,_=n.x,b=n.y,S=n.z;return i[0]=(1-(p+g))*_,i[1]=(h+x)*_,i[2]=(f-y)*_,i[3]=0,i[4]=(h-x)*b,i[5]=(1-(d+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(f+y)*S,i[9]=(m-v)*S,i[10]=(1-(d+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Bu.set(i[0],i[1],i[2]).length();const a=Bu.set(i[4],i[5],i[6]).length(),o=Bu.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Hu.copy(this);const s=1/r,l=1/a,c=1/o;return Hu.elements[0]*=s,Hu.elements[1]*=s,Hu.elements[2]*=s,Hu.elements[4]*=l,Hu.elements[5]*=l,Hu.elements[6]*=l,Hu.elements[8]*=c,Hu.elements[9]*=c,Hu.elements[10]*=c,t.setFromRotationMatrix(Hu),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=2e3){const s=this.elements,l=2*r/(t-e),c=2*r/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let h,f;if(o===Mc)h=-(a+r)/(a-r),f=-2*a*r/(a-r);else{if(o!==Ec)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-r),f=-a*r/(a-r)}return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=d,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=2e3){const s=this.elements,l=1/(t-e),c=1/(n-i),u=1/(a-r),d=(t+e)*l,h=(n+i)*c;let f,p;if(o===Mc)f=(a+r)*u,p=-2*u;else{if(o!==Ec)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=r*u,p=-1*u}return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-d,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=p,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Bu=new cu,Hu=new Fu,Vu=new cu(0,0,0),ju=new cu(1,1,1),Gu=new cu,Wu=new cu,Xu=new cu,qu=new Fu,$u=new lu;class Yu{constructor(e=0,t=0,n=0,i=Yu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],s=i[1],l=i[5],c=i[9],u=i[2],d=i[6],h=i[10];switch(t){case"XYZ":this._y=Math.asin(Lc(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Lc(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Lc(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,r));break;case"ZYX":this._y=Math.asin(-Lc(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(s,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Lc(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Lc(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-c,h),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 qu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(qu,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $u.setFromEuler(this),this.setFromQuaternion($u,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yu.DEFAULT_ORDER="XYZ";class Zu{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let Ku=0;const Qu=new cu,Ju=new lu,ed=new Fu,td=new cu,nd=new cu,id=new cu,rd=new lu,ad=new cu(1,0,0),od=new cu(0,1,0),sd=new cu(0,0,1),ld={type:"added"},cd={type:"removed"},ud={type:"childadded",child:null},dd={type:"childremoved",child:null};class hd extends Tc{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Ku++}),this.uuid=Rc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hd.DEFAULT_UP.clone();const e=new cu,t=new Yu,n=new lu,i=new cu(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:i},modelViewMatrix:{value:new Fu},normalMatrix:{value:new Oc}}),this.matrix=new Fu,this.matrixWorld=new Fu,this.matrixAutoUpdate=hd.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Zu,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 Ju.setFromAxisAngle(e,t),this.quaternion.multiply(Ju),this}rotateOnWorldAxis(e,t){return Ju.setFromAxisAngle(e,t),this.quaternion.premultiply(Ju),this}rotateX(e){return this.rotateOnAxis(ad,e)}rotateY(e){return this.rotateOnAxis(od,e)}rotateZ(e){return this.rotateOnAxis(sd,e)}translateOnAxis(e,t){return Qu.copy(e).applyQuaternion(this.quaternion),this.position.add(Qu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ad,e)}translateY(e){return this.translateOnAxis(od,e)}translateZ(e){return this.translateOnAxis(sd,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ed.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?td.copy(e):td.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),nd.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ed.lookAt(nd,td,this.up):ed.lookAt(td,nd,this.up),this.quaternion.setFromRotationMatrix(ed),i&&(ed.extractRotation(i.matrixWorld),Ju.setFromRotationMatrix(ed),this.quaternion.premultiply(Ju.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?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(ld),ud.child=e,this.dispatchEvent(ud),ud.child=null):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(cd),dd.child=e,this.dispatchEvent(dd),dd.child=null),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),ed.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ed.multiply(e.parent.matrixWorld)),e.applyMatrix4(ed),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(ld),ud.child=e,this.dispatchEvent(ud),ud.child=null,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,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].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(nd,e,id),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nd,rd,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,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;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,i=t.length;n<i;n++){const i=t[n];!0!==i.matrixWorldAutoUpdate&&!0!==e||i.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 i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(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,i=n.length;t<i;t++){const i=n[t];r(e.shapes,i)}else r(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(r(e.materials,this.material[n]));i.material=t}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(r(e.animations,n))}}if(t){const t=a(e.geometries),i=a(e.materials),r=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function a(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.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}}hd.DEFAULT_UP=new cu(0,1,0),hd.DEFAULT_MATRIX_AUTO_UPDATE=!0,hd.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const fd=new cu,pd=new cu,md=new cu,gd=new cu,vd=new cu,yd=new cu,xd=new cu,_d=new cu,bd=new cu,Sd=new cu;class wd{constructor(e=new cu,t=new cu,n=new cu){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),fd.subVectors(e,t),i.cross(fd);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){fd.subVectors(i,t),pd.subVectors(n,t),md.subVectors(e,t);const a=fd.dot(fd),o=fd.dot(pd),s=fd.dot(md),l=pd.dot(pd),c=pd.dot(md),u=a*l-o*o;if(0===u)return r.set(0,0,0),null;const d=1/u,h=(l*s-o*c)*d,f=(a*c-o*s)*d;return r.set(1-h-f,f,h)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,gd)&&(gd.x>=0&&gd.y>=0&&gd.x+gd.y<=1)}static getInterpolation(e,t,n,i,r,a,o,s){return null===this.getBarycoord(e,t,n,i,gd)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(r,gd.x),s.addScaledVector(a,gd.y),s.addScaledVector(o,gd.z),s)}static isFrontFacing(e,t,n,i){return fd.subVectors(n,t),pd.subVectors(e,t),fd.cross(pd).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fd.subVectors(this.c,this.b),pd.subVectors(this.a,this.b),.5*fd.cross(pd).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wd.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wd.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return wd.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return wd.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wd.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;vd.subVectors(i,n),yd.subVectors(r,n),_d.subVectors(e,n);const s=vd.dot(_d),l=yd.dot(_d);if(s<=0&&l<=0)return t.copy(n);bd.subVectors(e,i);const c=vd.dot(bd),u=yd.dot(bd);if(c>=0&&u<=c)return t.copy(i);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(vd,a);Sd.subVectors(e,r);const h=vd.dot(Sd),f=yd.dot(Sd);if(f>=0&&h<=f)return t.copy(r);const p=h*l-s*f;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(n).addScaledVector(yd,o);const m=c*f-h*u;if(m<=0&&u-c>=0&&h-f>=0)return xd.subVectors(r,i),o=(u-c)/(u-c+(h-f)),t.copy(i).addScaledVector(xd,o);const g=1/(m+p+d);return a=p*g,o=d*g,t.copy(n).addScaledVector(vd,a).addScaledVector(yd,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Md={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},Ed={h:0,s:0,l:0},Td={h:0,s:0,l:0};function Ad(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 Cd{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,t=oc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,qc.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=qc.workingColorSpace){return this.r=e,this.g=t,this.b=n,qc.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=qc.workingColorSpace){if(e=function(e,t){return(e%t+t)%t}(e,1),t=Lc(t,0,1),n=Lc(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Ad(r,i,e+1/3),this.g=Ad(r,i,e),this.b=Ad(r,i,e-1/3)}return qc.toWorkingColorSpace(this,i),this}setStyle(e,t=oc){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=oc){const n=Md[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=$c(e.r),this.g=$c(e.g),this.b=$c(e.b),this}copyLinearToSRGB(e){return this.r=Yc(e.r),this.g=Yc(e.g),this.b=Yc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oc){return qc.fromWorkingColorSpace(Pd.copy(this),e),65536*Math.round(Lc(255*Pd.r,0,255))+256*Math.round(Lc(255*Pd.g,0,255))+Math.round(Lc(255*Pd.b,0,255))}getHexString(e=oc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=qc.workingColorSpace){qc.fromWorkingColorSpace(Pd.copy(this),t);const n=Pd.r,i=Pd.g,r=Pd.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let s,l;const c=(o+a)/2;if(o===a)s=0,l=0;else{const e=a-o;switch(l=c<=.5?e/(a+o):e/(2-a-o),a){case n:s=(i-r)/e+(i<r?6:0);break;case i:s=(r-n)/e+2;break;case r:s=(n-i)/e+4}s/=6}return e.h=s,e.s=l,e.l=c,e}getRGB(e,t=qc.workingColorSpace){return qc.fromWorkingColorSpace(Pd.copy(this),t),e.r=Pd.r,e.g=Pd.g,e.b=Pd.b,e}getStyle(e=oc){qc.fromWorkingColorSpace(Pd.copy(this),e);const t=Pd.r,n=Pd.g,i=Pd.b;return e!==oc?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(Ed),this.setHSL(Ed.h+e,Ed.s+t,Ed.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(Ed),e.getHSL(Td);const n=kc(Ed.h,Td.h,t),i=kc(Ed.s,Td.s,t),r=kc(Ed.l,Td.l,t);return this.setHSL(n,i,r),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,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Pd=new Cd;Cd.NAMES=Md;let Rd=0;class Ld extends Tc{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Rd++}),this.uuid=Rc(),this.name="",this.type="Material",this.blending=1,this.side=el,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=il,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Cd(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=pc,this.stencilZFail=pc,this.stencilZPass=pc,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 i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.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 i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}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()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==el&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==il&&(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!==pc&&(n.stencilFail=this.stencilFail),this.stencilZFail!==pc&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==pc&&(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=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}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 i=0;i!==e;++i)n[i]=t[i].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 kd extends Ld{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Cd(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.envMapRotation=new Yu,this.combine=bl,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.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Nd=new cu,Dd=new Ic;class Id{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=$l,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Vc("THREE.BufferAttribute: updateRange() is deprecated and will be 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 i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];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++)Dd.fromBufferAttribute(this,t),Dd.applyMatrix3(e),this.setXY(t,Dd.x,Dd.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyMatrix3(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyMatrix4(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.applyNormalMatrix(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Nd.fromBufferAttribute(this,t),Nd.transformDirection(e),this.setXYZ(t,Nd.x,Nd.y,Nd.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Nc(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Dc(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Nc(t,this.array)),t}setX(e,t){return this.normalized&&(t=Dc(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Nc(t,this.array)),t}setY(e,t){return this.normalized&&(t=Dc(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=Nc(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Dc(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=Nc(t,this.array)),t}setW(e,t){return this.normalized&&(t=Dc(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array),i=Dc(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=Dc(t,this.array),n=Dc(n,this.array),i=Dc(i,this.array),r=Dc(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,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),35044!==this.usage&&(e.usage=this.usage),e}}class Od extends Id{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Ud extends Id{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class zd extends Id{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Fd=0;const Bd=new Fu,Hd=new hd,Vd=new cu,jd=new hu,Gd=new hu,Wd=new cu;class Xd extends Tc{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Fd++}),this.uuid=Rc(),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(zc(e)?Ud:Od)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Oc).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return Bd.makeRotationFromQuaternion(e),this.applyMatrix4(Bd),this}rotateX(e){return Bd.makeRotationX(e),this.applyMatrix4(Bd),this}rotateY(e){return Bd.makeRotationY(e),this.applyMatrix4(Bd),this}rotateZ(e){return Bd.makeRotationZ(e),this.applyMatrix4(Bd),this}translate(e,t,n){return Bd.makeTranslation(e,t,n),this.applyMatrix4(Bd),this}scale(e,t,n){return Bd.makeScale(e,t,n),this.applyMatrix4(Bd),this}lookAt(e){return Hd.lookAt(e),Hd.updateMatrix(),this.applyMatrix4(Hd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vd).negate(),this.translate(Vd.x,Vd.y,Vd.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new zd(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new hu);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.",this),void this.boundingBox.set(new cu(-1/0,-1/0,-1/0),new cu(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];jd.setFromBufferAttribute(n),this.morphTargetsRelative?(Wd.addVectors(this.boundingBox.min,jd.min),this.boundingBox.expandByPoint(Wd),Wd.addVectors(this.boundingBox.max,jd.max),this.boundingBox.expandByPoint(Wd)):(this.boundingBox.expandByPoint(jd.min),this.boundingBox.expandByPoint(jd.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 Ru);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.",this),void this.boundingSphere.set(new cu,1/0);if(e){const n=this.boundingSphere.center;if(jd.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Gd.setFromBufferAttribute(n),this.morphTargetsRelative?(Wd.addVectors(jd.min,Gd.min),jd.expandByPoint(Wd),Wd.addVectors(jd.max,Gd.max),jd.expandByPoint(Wd)):(jd.expandByPoint(Gd.min),jd.expandByPoint(Gd.max))}jd.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)Wd.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(Wd));if(t)for(let r=0,a=t.length;r<a;r++){const a=t[r],o=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)Wd.fromBufferAttribute(a,t),o&&(Vd.fromBufferAttribute(e,t),Wd.add(Vd)),i=Math.max(i,n.distanceToSquared(Wd))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){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=t.position,i=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Id(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new cu,s[e]=new cu;const l=new cu,c=new cu,u=new cu,d=new Ic,h=new Ic,f=new Ic,p=new cu,m=new cu;function g(e,t,i){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),d.fromBufferAttribute(r,e),h.fromBufferAttribute(r,t),f.fromBufferAttribute(r,i),c.sub(l),u.sub(l),h.sub(d),f.sub(d);const a=1/(h.x*f.y-f.x*h.y);isFinite(a)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-h.y).multiplyScalar(a),m.copy(u).multiplyScalar(h.x).addScaledVector(c,-f.x).multiplyScalar(a),o[e].add(p),o[t].add(p),o[i].add(p),s[e].add(m),s[t].add(m),s[i].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:e.count}]);for(let t=0,n=v.length;t<n;++t){const n=v[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const y=new cu,x=new cu,_=new cu,b=new cu;function S(e){_.fromBufferAttribute(i,e),b.copy(_);const t=o[e];y.copy(t),y.sub(_.multiplyScalar(_.dot(t))).normalize(),x.crossVectors(b,t);const n=x.dot(s[e])<0?-1:1;a.setXYZW(e,y.x,y.y,y.z,n)}for(let t=0,n=v.length;t<n;++t){const n=v[t],i=n.start;for(let t=i,r=i+n.count;t<r;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+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 Id(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 i=new cu,r=new cu,a=new cu,o=new cu,s=new cu,l=new cu,c=new cu,u=new cu;if(e)for(let d=0,h=e.count;d<h;d+=3){const h=e.getX(d+0),f=e.getX(d+1),p=e.getX(d+2);i.fromBufferAttribute(t,h),r.fromBufferAttribute(t,f),a.fromBufferAttribute(t,p),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),o.add(c),s.add(c),l.add(c),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),u.subVectors(i,r),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++)Wd.fromBufferAttribute(e,t),Wd.normalize(),e.setXYZ(t,Wd.x,Wd.y,Wd.z)}toNonIndexed(){function e(e,t){const n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i);let o=0,s=0;for(let r=0,l=t.length;r<l;r++){o=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)a[s++]=n[o++]}return new Id(a,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Xd,n=this.index.array,i=this.attributes;for(const r in i){const a=e(i[r],n);t.setAttribute(r,a)}const r=this.morphAttributes;for(const i in r){const a=[],o=r[i];for(let t=0,i=o.length;t<i;t++){const i=e(o[t],n);a.push(i)}t.morphAttributes[i]=a}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let e=0,n=a.length;e<n;e++){const n=a[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 i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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 i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let e=0,t=a.length;e<t;e++){const t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const qd=new Fu,$d=new zu,Yd=new Ru,Zd=new cu,Kd=new cu,Qd=new cu,Jd=new cu,eh=new cu,th=new cu,nh=new Ic,ih=new Ic,rh=new Ic,ah=new cu,oh=new cu,sh=new cu,lh=new cu,ch=new cu;class uh extends hd{constructor(e=new Xd,t=new kd){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,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){th.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=o[n],s=r[n];0!==i&&(eh.fromBufferAttribute(s,e),a?th.addScaledVector(eh,i):th.addScaledVector(eh.sub(t),i))}t.add(th)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),Yd.copy(n.boundingSphere),Yd.applyMatrix4(r),$d.copy(e.ray).recast(e.near),!1===Yd.containsPoint($d.origin)){if(null===$d.intersectSphere(Yd,Zd))return;if($d.origin.distanceToSquared(Zd)>(e.far-e.near)**2)return}qd.copy(r).invert(),$d.copy(e.ray).applyMatrix4(qd),null!==n.boundingBox&&!1===$d.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,$d)}}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,s=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,d=r.groups,h=r.drawRange;if(null!==o)if(Array.isArray(a))for(let r=0,s=d.length;r<s;r++){const s=d[r],f=a[s.materialIndex];for(let r=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));r<a;r+=3){i=dh(this,f,e,n,l,c,u,o.getX(r),o.getX(r+1),o.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,t.push(i))}}else{for(let r=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);r<s;r+=3){i=dh(this,a,e,n,l,c,u,o.getX(r),o.getX(r+1),o.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}else if(void 0!==s)if(Array.isArray(a))for(let r=0,o=d.length;r<o;r++){const o=d[r],f=a[o.materialIndex];for(let r=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));r<a;r+=3){i=dh(this,f,e,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,t.push(i))}}else{for(let r=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);r<o;r+=3){i=dh(this,a,e,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),t.push(i))}}}}function dh(e,t,n,i,r,a,o,s,l,c){e.getVertexPosition(s,Kd),e.getVertexPosition(l,Qd),e.getVertexPosition(c,Jd);const u=function(e,t,n,i,r,a,o,s){let l;if(l=t.side===tl?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side===el,s),null===l)return null;ch.copy(s),ch.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(ch);return c<n.near||c>n.far?null:{distance:c,point:ch.clone(),object:e}}(e,t,n,i,Kd,Qd,Jd,lh);if(u){r&&(nh.fromBufferAttribute(r,s),ih.fromBufferAttribute(r,l),rh.fromBufferAttribute(r,c),u.uv=wd.getInterpolation(lh,Kd,Qd,Jd,nh,ih,rh,new Ic)),a&&(nh.fromBufferAttribute(a,s),ih.fromBufferAttribute(a,l),rh.fromBufferAttribute(a,c),u.uv1=wd.getInterpolation(lh,Kd,Qd,Jd,nh,ih,rh,new Ic)),o&&(ah.fromBufferAttribute(o,s),oh.fromBufferAttribute(o,l),sh.fromBufferAttribute(o,c),u.normal=wd.getInterpolation(lh,Kd,Qd,Jd,ah,oh,sh,new cu),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const e={a:s,b:l,c:c,normal:new cu,materialIndex:0};wd.getNormal(Kd,Qd,Jd,e.normal),u.face=e}return u}class hh extends Xd{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const s=[],l=[],c=[],u=[];let d=0,h=0;function f(e,t,n,i,r,a,f,p,m,g,v){const y=a/m,x=f/g,_=a/2,b=f/2,S=p/2,w=m+1,M=g+1;let E=0,T=0;const A=new cu;for(let a=0;a<M;a++){const o=a*x-b;for(let s=0;s<w;s++){const d=s*y-_;A[e]=d*i,A[t]=o*r,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(s/m),u.push(1-a/g),E+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=d+t+w*e,i=d+t+w*(e+1),r=d+(t+1)+w*(e+1),a=d+(t+1)+w*e;s.push(n,i,a),s.push(i,r,a),T+=6}o.addGroup(h,T,v),h+=T,d+=E}f("z","y","x",-1,-1,n,t,e,a,r,0),f("z","y","x",1,-1,n,t,-e,a,r,1),f("x","z","y",1,1,e,n,t,i,a,2),f("x","z","y",1,-1,e,n,-t,i,a,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(s),this.setAttribute("position",new zd(l,3)),this.setAttribute("normal",new zd(c,3)),this.setAttribute("uv",new zd(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hh(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function fh(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}}return t}function ph(e){const t={};for(let n=0;n<e.length;n++){const i=fh(e[n]);for(const e in i)t[e]=i[e]}return t}function mh(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:qc.workingColorSpace}const gh={clone:fh,merge:ph};class vh extends Ld{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={clipCullDistance:!1,multiDraw:!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=fh(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 i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}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 yh extends hd{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fu,this.projectionMatrix=new Fu,this.projectionMatrixInverse=new Fu,this.coordinateSystem=Mc}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)}}const xh=new cu,_h=new Ic,bh=new Ic;class Sh extends yh{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=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*Pc*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Cc*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Pc*Math.atan(Math.tan(.5*Cc*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){xh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(xh.x,xh.y).multiplyScalar(-e/xh.z),xh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(xh.x,xh.y).multiplyScalar(-e/xh.z)}getViewSize(e,t){return this.getViewBounds(e,_h,bh),t.subVectors(bh,_h)}setViewOffset(e,t,n,i,r,a){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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Cc*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/o,i*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,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 wh=-90;class Mh extends hd{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Sh(wh,1,e,t);i.layers=this.layers,this.add(i);const r=new Sh(wh,1,e,t);r.layers=this.layers,this.add(r);const a=new Sh(wh,1,e,t);a.layers=this.layers,this.add(a);const o=new Sh(wh,1,e,t);o.layers=this.layers,this.add(o);const s=new Sh(wh,1,e,t);s.layers=this.layers,this.add(s);const l=new Sh(wh,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,s]=t;for(const e of t)this.remove(e);if(e===Mc)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(e!==Ec)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.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:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,s,l,c]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,s),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(u,d,h),e.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class Eh extends nu{constructor(e,t,n,i,r,a,o,s,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:kl,n,i,r,a,o,s,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Th extends au{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new Eh(i,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:Hl}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"},i=new hh(5,5,5),r=new vh({name:"CubemapFromEquirect",uniforms:fh(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:tl,blending:0});r.uniforms.tEquirect.value=t;const a=new uh(i,r),o=t.minFilter;t.minFilter===jl&&(t.minFilter=Hl);return new Mh(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,i){const r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}const Ah=new cu,Ch=new cu,Ph=new Oc;class Rh{constructor(e=new cu(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Ah.subVectors(n,t).cross(Ch.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Ah),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}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||Ph.getNormalMatrix(e),i=this.coplanarPoint(Ah).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),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 Lh=new Ru,kh=new cu;class Nh{constructor(e=new Rh,t=new Rh,n=new Rh,i=new Rh,r=new Rh,a=new Rh){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],c=i[5],u=i[6],d=i[7],h=i[8],f=i[9],p=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15];if(n[0].setComponents(s-r,d-l,m-h,x-g).normalize(),n[1].setComponents(s+r,d+l,m+h,x+g).normalize(),n[2].setComponents(s+a,d+c,m+f,x+v).normalize(),n[3].setComponents(s-a,d-c,m-f,x-v).normalize(),n[4].setComponents(s-o,d-u,m-p,x-y).normalize(),t===Mc)n[5].setComponents(s+o,d+u,m+p,x+y).normalize();else{if(t!==Ec)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,u,p,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Lh.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Lh.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Lh)}intersectsSprite(e){return Lh.center.set(0,0,0),Lh.radius=.7071067811865476,Lh.applyMatrix4(e.matrixWorld),this.intersectsSphere(Lh)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<i)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(kh.x=i.normal.x>0?e.max.x:e.min.x,kh.y=i.normal.y>0?e.max.y:e.min.y,kh.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(kh)<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 Dh(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ih(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);if(void 0===r)t.set(n,function(t,n){const i=t.array,r=t.usage,a=i.byteLength,o=e.createBuffer();let s;if(e.bindBuffer(n,o),e.bufferData(n,i,r),t.onUploadCallback(),i instanceof Float32Array)s=e.FLOAT;else if(i instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)s=e.SHORT;else if(i instanceof Uint32Array)s=e.UNSIGNED_INT;else if(i instanceof Int32Array)s=e.INT;else if(i instanceof Int8Array)s=e.BYTE;else if(i instanceof Uint8Array)s=e.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);s=e.UNSIGNED_BYTE}return{buffer:o,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,i));else if(r.version<n.version){if(r.size!==n.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,n,i){const r=n.array,a=n._updateRange,o=n.updateRanges;if(e.bindBuffer(i,t),-1===a.count&&0===o.length&&e.bufferSubData(i,0,r),0!==o.length){for(let t=0,n=o.length;t<n;t++){const n=o[t];e.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r,a.offset,a.count),a.count=-1),n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class Oh extends Xd{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),s=Math.floor(i),l=o+1,c=s+1,u=e/o,d=t/s,h=[],f=[],p=[],m=[];for(let e=0;e<c;e++){const t=e*d-a;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-t,0),p.push(0,0,1),m.push(n/o),m.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;h.push(n,i,a),h.push(i,r,a)}this.setIndex(h),this.setAttribute("position",new zd(f,3)),this.setAttribute("normal",new zd(p,3)),this.setAttribute("uv",new zd(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Oh(e.width,e.height,e.widthSegments,e.heightSegments)}}const Uh={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\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\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\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\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#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\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 ) || defined( USE_BATCHING_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 ) || defined( USE_BATCHING_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\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( batchId );\n\tvColor.xyz *= batchingColor.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_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\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, envMapRotation * 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\tuniform mat3 envMapRotation;\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, envMapRotation * 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, envMapRotation * 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_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\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\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_DISPERSION\n\tmaterial.dispersion = dispersion;\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\tfloat dispersion;\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 )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\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",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\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\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\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\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\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.dispersion, 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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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#include <morphinstance_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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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#include <morphinstance_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\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\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 ), diffuseColor.a );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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_DISPERSION\n\tuniform float dispersion;\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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\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 <morphinstance_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\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}"},zh={common:{diffuse:{value:new Cd(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Oc},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Oc}},envmap:{envMap:{value:null},envMapRotation:{value:new Oc},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Oc}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Oc}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Oc},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Oc},normalScale:{value:new Ic(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Oc},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Oc}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Oc}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Oc}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Cd(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 Cd(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0},uvTransform:{value:new Oc}},sprite:{diffuse:{value:new Cd(16777215)},opacity:{value:1},center:{value:new Ic(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Oc},alphaMap:{value:null},alphaMapTransform:{value:new Oc},alphaTest:{value:0}}},Fh={basic:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.fog]),vertexShader:Uh.meshbasic_vert,fragmentShader:Uh.meshbasic_frag},lambert:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)}}]),vertexShader:Uh.meshlambert_vert,fragmentShader:Uh.meshlambert_frag},phong:{uniforms:ph([zh.common,zh.specularmap,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)},specular:{value:new Cd(1118481)},shininess:{value:30}}]),vertexShader:Uh.meshphong_vert,fragmentShader:Uh.meshphong_frag},standard:{uniforms:ph([zh.common,zh.envmap,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.roughnessmap,zh.metalnessmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Uh.meshphysical_vert,fragmentShader:Uh.meshphysical_frag},toon:{uniforms:ph([zh.common,zh.aomap,zh.lightmap,zh.emissivemap,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.gradientmap,zh.fog,zh.lights,{emissive:{value:new Cd(0)}}]),vertexShader:Uh.meshtoon_vert,fragmentShader:Uh.meshtoon_frag},matcap:{uniforms:ph([zh.common,zh.bumpmap,zh.normalmap,zh.displacementmap,zh.fog,{matcap:{value:null}}]),vertexShader:Uh.meshmatcap_vert,fragmentShader:Uh.meshmatcap_frag},points:{uniforms:ph([zh.points,zh.fog]),vertexShader:Uh.points_vert,fragmentShader:Uh.points_frag},dashed:{uniforms:ph([zh.common,zh.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Uh.linedashed_vert,fragmentShader:Uh.linedashed_frag},depth:{uniforms:ph([zh.common,zh.displacementmap]),vertexShader:Uh.depth_vert,fragmentShader:Uh.depth_frag},normal:{uniforms:ph([zh.common,zh.bumpmap,zh.normalmap,zh.displacementmap,{opacity:{value:1}}]),vertexShader:Uh.meshnormal_vert,fragmentShader:Uh.meshnormal_frag},sprite:{uniforms:ph([zh.sprite,zh.fog]),vertexShader:Uh.sprite_vert,fragmentShader:Uh.sprite_frag},background:{uniforms:{uvTransform:{value:new Oc},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Uh.background_vert,fragmentShader:Uh.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Oc}},vertexShader:Uh.backgroundCube_vert,fragmentShader:Uh.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Uh.cube_vert,fragmentShader:Uh.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Uh.equirect_vert,fragmentShader:Uh.equirect_frag},distanceRGBA:{uniforms:ph([zh.common,zh.displacementmap,{referencePosition:{value:new cu},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Uh.distanceRGBA_vert,fragmentShader:Uh.distanceRGBA_frag},shadow:{uniforms:ph([zh.lights,zh.fog,{color:{value:new Cd(0)},opacity:{value:1}}]),vertexShader:Uh.shadow_vert,fragmentShader:Uh.shadow_frag}};Fh.physical={uniforms:ph([Fh.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Oc},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Oc},clearcoatNormalScale:{value:new Ic(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Oc},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Oc},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Oc},sheen:{value:0},sheenColor:{value:new Cd(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Oc},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Oc},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Oc},transmissionSamplerSize:{value:new Ic},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Oc},attenuationDistance:{value:0},attenuationColor:{value:new Cd(0)},specularColor:{value:new Cd(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Oc},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Oc},anisotropyVector:{value:new Ic},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Oc}}]),vertexShader:Uh.meshphysical_vert,fragmentShader:Uh.meshphysical_frag};const Bh={r:0,b:0,g:0},Hh=new Yu,Vh=new Fu;function jh(e,t,n,i,r,a,o){const s=new Cd(0);let l,c,u=!0===a?0:1,d=null,h=0,f=null;function p(e){let i=!0===e.isScene?e.background:null;if(i&&i.isTexture){i=(e.backgroundBlurriness>0?n:t).get(i)}return i}function m(t,n){t.getRGB(Bh,mh(e)),i.buffers.color.setClear(Bh.r,Bh.g,Bh.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),u=t,m(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,m(s,u)},render:function(t){let n=!1;const r=p(t);null===r?m(s,u):r&&r.isColor&&(m(r,1),n=!0);const a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const i=p(n);i&&(i.isCubeTexture||i.mapping===Dl)?(void 0===c&&(c=new uh(new hh(1,1,1),new vh({name:"BackgroundCubeMaterial",uniforms:fh(Fh.backgroundCube.uniforms),vertexShader:Fh.backgroundCube.vertexShader,fragmentShader:Fh.backgroundCube.fragmentShader,side:tl,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}}),r.update(c)),Hh.copy(n.backgroundRotation),Hh.x*=-1,Hh.y*=-1,Hh.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(Hh.y*=-1,Hh.z*=-1),c.material.uniforms.envMap.value=i,c.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(Vh.makeRotationFromEuler(Hh)),c.material.toneMapped=qc.getTransfer(i.colorSpace)!==dc,d===i&&h===i.version&&f===e.toneMapping||(c.material.needsUpdate=!0,d=i,h=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):i&&i.isTexture&&(void 0===l&&(l=new uh(new Oh(2,2),new vh({name:"BackgroundMaterial",uniforms:fh(Fh.background.uniforms),vertexShader:Fh.background.vertexShader,fragmentShader:Fh.background.fragmentShader,side:el,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=qc.getTransfer(i.colorSpace)!==dc,!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),d===i&&h===i.version&&f===e.toneMapping||(l.material.needsUpdate=!0,d=i,h=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function Gh(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=c(null);let a=r,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],i=[],r=[];for(let e=0;e<n;e++)t[e]=0,i[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function u(){const e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function d(e){h(e,0)}function h(t,n){const i=a.newAttributes,r=a.enabledAttributes,o=a.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function f(){const t=a.newAttributes,n=a.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function p(t,n,i,r,a,o,s){!0===s?e.vertexAttribIPointer(t,n,i,a,o):e.vertexAttribPointer(t,n,i,r,a,o)}function m(){g(),o=!0,a!==r&&(a=r,s(a.object))}function g(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,m,g){let v=!1;const y=function(t,n,r){const a=!0===r.wireframe;let o=i[t.id];void 0===o&&(o={},i[t.id]=o);let s=o[n.id];void 0===s&&(s={},o[n.id]=s);let l=s[a];void 0===l&&(l=c(e.createVertexArray()),s[a]=l);return l}(m,l,r);a!==y&&(a=y,s(a.object)),v=function(e,t,n,i){const r=a.attributes,o=t.attributes;let s=0;const l=n.getAttributes();for(const t in l){if(l[t].location>=0){const n=r[t];let i=o[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;s++}}return a.attributesNum!==s||a.index!==i}(n,m,l,g),v&&function(e,t,n,i){const r={},o=t.attributes;let s=0;const l=n.getAttributes();for(const t in l){if(l[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 i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,s++}}a.attributes=r,a.attributesNum=s,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||o)&&(o=!1,function(n,i,r,a){u();const o=a.attributes,s=r.getAttributes(),l=i.defaultAttributeValues;for(const i in s){const r=s[i];if(r.location>=0){let s=o[i];if(void 0===s&&("instanceMatrix"===i&&n.instanceMatrix&&(s=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(s=n.instanceColor)),void 0!==s){const i=s.normalized,o=s.itemSize,l=t.get(s);if(void 0===l)continue;const c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===Xl;if(s.isInterleavedBufferAttribute){const t=s.data,l=t.stride,g=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)h(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,o/r.locationSize,u,i,l*f,(g+o/r.locationSize*e)*f,m)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)h(r.location+e,s.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)d(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,o/r.locationSize,u,i,o*f,o/r.locationSize*e*f,m)}}else if(void 0!==l){const t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,r,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){m();for(const e in i){const t=i[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e]}},releaseStatesOfGeometry:function(e){if(void 0===i[e.id])return;const t=i[e.id];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e.id]},releaseStatesOfProgram:function(e){for(const t in i){const n=i[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)l(r[e].object),delete r[e];delete n[e.id]}},initAttributes:u,enableAttribute:d,disableUnusedAttributes:f}}function Wh(e,t,n){let i;function r(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))}this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(e,r,a){if(0===a)return;const o=t.get("WEBGL_multi_draw");if(null===o)for(let t=0;t<a;t++)this.render(e[t],r[t]);else{o.multiDrawArraysWEBGL(i,e,0,r,0,a);let t=0;for(let e=0;e<a;e++)t+=r[e];n.update(t,i,1)}},this.renderMultiDrawInstances=function(e,a,o,s){if(0===o)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)r(e[t],a[t],s[t]);else{l.multiDrawArraysInstancedWEBGL(i,e,0,a,0,s,0,o);let t=0;for(let e=0;e<o;e++)t+=a[e];for(let e=0;e<s.length;e++)n.update(t,i,s[e])}}}function Xh(e,t,n,i){let r;function a(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"}let o=void 0!==n.precision?n.precision:"highp";const s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,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:a,textureFormatReadable:function(t){return t===Kl||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const r=n===Yl&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==Gl&&i.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==$l&&!r)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function qh(e){const t=this;let n=null,i=0,r=!1,a=!1;const o=new Rh,s=new Oc,l={value:null,needsUpdate:!1};function c(e,n,i,r){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==r||null===c){const t=i+4*a,r=n.matrixWorldInverse;s.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(r,s),o.normal.toArray(c,n),c[n+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,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!==i||r;return r=t,i=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(o,s,u){const d=o.clippingPlanes,h=o.clipIntersection,f=o.clipShadows,p=e.get(o);if(!r||null===d||0===d.length||a&&!f)a?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);t.numPlanes=i,t.numIntersection=0}();else{const e=a?0:i,t=4*e;let r=p.clippingState||null;l.value=r,r=c(d,s,t,u);for(let e=0;e!==t;++e)r[e]=n[e];p.clippingState=r,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function $h(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=kl:304===t&&(e.mapping=Nl),e}function i(e){const n=e.target;n.removeEventListener("dispose",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const a=r.mapping;if(303===a||304===a){if(t.has(r)){return n(t.get(r).texture,r.mapping)}{const a=r.image;if(a&&a.height>0){const o=new Th(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener("dispose",i),n(o.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}class Yh extends yh{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,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,i,r,a){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=i,this.view.width=r,this.view.height=a,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,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,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 Zh=[.125,.215,.35,.446,.526,.582],Kh=20,Qh=new Yh,Jh=new Cd;let ef=null,tf=0,nf=0,rf=!1;const af=(1+Math.sqrt(5))/2,of=1/af,sf=[new cu(-af,of,0),new cu(af,of,0),new cu(-of,0,af),new cu(of,0,af),new cu(0,af,-of),new cu(0,af,of),new cu(-1,1,-1),new cu(1,1,-1),new cu(-1,1,1),new cu(1,1,1)];class lf{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){ef=this._renderer.getRenderTarget(),tf=this._renderer.getActiveCubeFace(),nf=this._renderer.getActiveMipmapLevel(),rf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,n,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=hf(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=df(),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(ef,tf,nf),this._renderer.xr.enabled=rf,e.scissorTest=!1,uf(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===kl||e.mapping===Nl?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ef=this._renderer.getRenderTarget(),tf=this._renderer.getActiveCubeFace(),nf=this._renderer.getActiveMipmapLevel(),rf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;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:Hl,minFilter:Hl,generateMipmaps:!1,type:Yl,format:Kl,colorSpace:sc,depthBuffer:!1},i=cf(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=cf(e,t,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],i=[];let r=e;const a=e-4+1+Zh.length;for(let o=0;o<a;o++){const a=Math.pow(2,r);n.push(a);let s=1/a;o>e-4?s=Zh[o-e+4-1]:0===o&&(s=0),i.push(s);const l=1/(a-2),c=-l,u=1+l,d=[c,c,u,c,u,u,c,c,u,u,c,u],h=6,f=6,p=3,m=2,g=1,v=new Float32Array(p*f*h),y=new Float32Array(m*f*h),x=new Float32Array(g*f*h);for(let e=0;e<h;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[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(i,p*f*e),y.set(d,m*f*e);const r=[e,e,e,e,e,e];x.set(r,g*f*e)}const _=new Xd;_.setAttribute("position",new Id(v,p)),_.setAttribute("uv",new Id(y,m)),_.setAttribute("faceIndex",new Id(x,g)),t.push(_),r>4&&r--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(e,t,n){const i=new Float32Array(Kh),r=new cu(0,1,0),a=new vh({name:"SphericalGaussianBlur",defines:{n:Kh,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ff(),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 a}(i,e,t)}return i}_compileMaterial(e){const t=new uh(this._lodPlanes[0],e);this._renderer.compile(t,Qh)}_sceneToCubeUV(e,t,n,i){const r=new Sh(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,c=s.toneMapping;s.getClearColor(Jh),s.toneMapping=Ml,s.autoClear=!1;const u=new kd({name:"PMREM.Background",side:tl,depthWrite:!1,depthTest:!1}),d=new uh(new hh,u);let h=!1;const f=e.background;f?f.isColor&&(u.color.copy(f),e.background=null,h=!0):(u.color.copy(Jh),h=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(r.up.set(0,a[t],0),r.lookAt(o[t],0,0)):1===n?(r.up.set(0,0,a[t]),r.lookAt(0,o[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,o[t]));const l=this._cubeSize;uf(i,n*l,t>2?l:0,l,l),s.setRenderTarget(i),h&&s.render(d,r),s.render(e,r)}d.geometry.dispose(),d.material.dispose(),s.toneMapping=c,s.autoClear=l,e.background=f}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===kl||e.mapping===Nl;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=hf()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=df());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new uh(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const o=this._cubeSize;uf(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,Qh)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let t=1;t<i;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=sf[(i-t-1)%sf.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new uh(this._lodPlanes[i],l),u=l.uniforms,d=this._sizeLods[n]-1,h=isFinite(r)?Math.PI/(2*d):2*Math.PI/39,f=r/h,p=isFinite(r)?1+Math.floor(3*f):Kh;p>Kh&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<Kh;++e){const t=e/f,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<p&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;u.envMap.value=e.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===a,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=h,u.mipInt.value=v-n;const y=this._sizeLods[i];uf(t,3*y*(i>v-4?i-v+4:0),4*(this._cubeSize-y),3*y,2*y),s.setRenderTarget(t),s.render(c,Qh)}}function cf(e,t,n){const i=new au(e,t,n);return i.texture.mapping=Dl,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function uf(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function df(){return new vh({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ff(),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 hf(){return new vh({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ff(),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 ff(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function pf(e){let t=new WeakMap,n=null;function i(e){const n=e.target;n.removeEventListener("dispose",i);const r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const a=r.mapping,o=303===a||304===a,s=a===kl||a===Nl;if(o||s){let a=t.get(r);const l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new lf(e)),a=o?n.fromEquirectangular(r,a):n.fromCubemap(r,a),a.texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;if(void 0!==a)return a.texture;{const l=r.image;return o&&l&&l.height>0||s&&l&&function(e){let t=0;const n=6;for(let i=0;i<n;i++)void 0!==e[i]&&t++;return t===n}(l)?(null===n&&(n=new lf(e)),a=o?n.fromEquirectangular(r):n.fromCubemap(r),a.texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function mf(e){const t={};function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&Vc("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function gf(e,t,n,i){const r={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);for(const e in s.morphAttributes){const n=s.morphAttributes[e];for(let e=0,i=n.length;e<i;e++)t.remove(n[e])}s.removeEventListener("dispose",o),delete r[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],i=e.index,r=e.attributes.position;let o=0;if(null!==i){const e=i.array;o=i.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{if(void 0===r)return;{const e=r.array;o=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}}const s=new(zc(n)?Ud:Od)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",o),r[t.id]=!0,n.memory.geometries++),t},update:function(n){const i=n.attributes;for(const n in i)t.update(i[n],e.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)t.update(i[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function vf(e,t,n){let i,r,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(i,o,r,t*a,s),n.update(o,i,s))}this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(i,o,r,t*a),n.update(o,i,1)},this.renderInstances=o,this.renderMultiDraw=function(e,o,s){if(0===s)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<s;t++)this.render(e[t]/a,o[t]);else{l.multiDrawElementsWEBGL(i,o,0,r,e,0,s);let t=0;for(let e=0;e<s;e++)t+=o[e];n.update(t,i,1)}},this.renderMultiDrawInstances=function(e,s,l,c){if(0===l)return;const u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)o(e[t]/a,s[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(i,s,0,r,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=s[e];for(let e=0;e<c.length;e++)n.update(t,i,c[e])}}}function yf(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,i,r){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=r*(n/3);break;case e.LINES:t.lines+=r*(n/2);break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function xf(e,t,n){const i=new WeakMap,r=new iu;return{update:function(a,o,s){const l=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==c?c.length:0;let d=i.get(o);if(void 0===d||d.count!==u){void 0!==d&&d.texture.dispose();const h=void 0!==o.morphAttributes.position,f=void 0!==o.morphAttributes.normal,p=void 0!==o.morphAttributes.color,m=o.morphAttributes.position||[],g=o.morphAttributes.normal||[],v=o.morphAttributes.color||[];let y=0;!0===h&&(y=1),!0===f&&(y=2),!0===p&&(y=3);let x=o.attributes.position.count*y,_=1;x>t.maxTextureSize&&(_=Math.ceil(x/t.maxTextureSize),x=t.maxTextureSize);const b=new Float32Array(x*_*4*u),S=new ou(b,x,_,u);S.type=$l,S.needsUpdate=!0;const w=4*y;for(let E=0;E<u;E++){const T=m[E],A=g[E],C=v[E],P=x*_*4*E;for(let R=0;R<T.count;R++){const L=R*w;!0===h&&(r.fromBufferAttribute(T,R),b[P+L+0]=r.x,b[P+L+1]=r.y,b[P+L+2]=r.z,b[P+L+3]=0),!0===f&&(r.fromBufferAttribute(A,R),b[P+L+4]=r.x,b[P+L+5]=r.y,b[P+L+6]=r.z,b[P+L+7]=0),!0===p&&(r.fromBufferAttribute(C,R),b[P+L+8]=r.x,b[P+L+9]=r.y,b[P+L+10]=r.z,b[P+L+11]=4===C.itemSize?r.w:1)}}function M(){S.dispose(),i.delete(o),o.removeEventListener("dispose",M)}d={count:u,texture:S,size:new Ic(x,_)},i.set(o,d),o.addEventListener("dispose",M)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let k=0;for(let D=0;D<l.length;D++)k+=l[D];const N=o.morphTargetsRelative?1:1-k;s.getUniforms().setValue(e,"morphTargetBaseInfluence",N),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",d.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function _f(e,t,n,i){let r=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const s=i.render.frame,l=o.geometry,c=t.get(o,l);if(r.get(c)!==s&&(t.update(c),r.set(c,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),r.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),r.set(o,s))),o.isSkinnedMesh){const e=o.skeleton;r.get(e)!==s&&(e.update(),r.set(e,s))}return c},dispose:function(){r=new WeakMap}}}class bf extends nu{constructor(e,t,n,i,r,a,o,s,l,c=1026){if(c!==Ql&&c!==Jl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Ql&&(n=ql),void 0===n&&c===Jl&&(n=Zl),super(null,i,r,a,o,s,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:zl,this.minFilter=void 0!==s?s:zl,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 Sf=new nu,wf=new bf(1,1);wf.compareFunction=515;const Mf=new ou,Ef=new su,Tf=new Eh,Af=[],Cf=[],Pf=new Float32Array(16),Rf=new Float32Array(9),Lf=new Float32Array(4);function kf(e,t,n){const i=e[0];if(i<=0||i>0)return e;const r=t*n;let a=Af[r];if(void 0===a&&(a=new Float32Array(r),Af[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function Nf(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Df(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function If(e,t){let n=Cf[t];void 0===n&&(n=new Int32Array(t),Cf[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Of(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Uf(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(Nf(n,t))return;e.uniform2fv(this.addr,t),Df(n,t)}}function zf(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(Nf(n,t))return;e.uniform3fv(this.addr,t),Df(n,t)}}function Ff(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(Nf(n,t))return;e.uniform4fv(this.addr,t),Df(n,t)}}function Bf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Lf.set(i),e.uniformMatrix2fv(this.addr,!1,Lf),Df(n,i)}}function Hf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Rf.set(i),e.uniformMatrix3fv(this.addr,!1,Rf),Df(n,i)}}function Vf(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Nf(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Df(n,t)}else{if(Nf(n,i))return;Pf.set(i),e.uniformMatrix4fv(this.addr,!1,Pf),Df(n,i)}}function jf(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Gf(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(Nf(n,t))return;e.uniform2iv(this.addr,t),Df(n,t)}}function Wf(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(Nf(n,t))return;e.uniform3iv(this.addr,t),Df(n,t)}}function Xf(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(Nf(n,t))return;e.uniform4iv(this.addr,t),Df(n,t)}}function qf(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(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.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Nf(n,t))return;e.uniform2uiv(this.addr,t),Df(n,t)}}function Yf(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(Nf(n,t))return;e.uniform3uiv(this.addr,t),Df(n,t)}}function Zf(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(Nf(n,t))return;e.uniform4uiv(this.addr,t),Df(n,t)}}function Kf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r);const a=this.type===e.SAMPLER_2D_SHADOW?wf:Sf;n.setTexture2D(t||a,r)}function Qf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ef,r)}function Jf(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||Tf,r)}function ep(e,t,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Mf,r)}function tp(e,t){e.uniform1fv(this.addr,t)}function np(e,t){const n=kf(t,this.size,2);e.uniform2fv(this.addr,n)}function ip(e,t){const n=kf(t,this.size,3);e.uniform3fv(this.addr,n)}function rp(e,t){const n=kf(t,this.size,4);e.uniform4fv(this.addr,n)}function ap(e,t){const n=kf(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function op(e,t){const n=kf(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function sp(e,t){const n=kf(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function lp(e,t){e.uniform1iv(this.addr,t)}function cp(e,t){e.uniform2iv(this.addr,t)}function up(e,t){e.uniform3iv(this.addr,t)}function dp(e,t){e.uniform4iv(this.addr,t)}function hp(e,t){e.uniform1uiv(this.addr,t)}function fp(e,t){e.uniform2uiv(this.addr,t)}function pp(e,t){e.uniform3uiv(this.addr,t)}function mp(e,t){e.uniform4uiv(this.addr,t)}function gp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture2D(t[e]||Sf,a[e])}function vp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture3D(t[e]||Ef,a[e])}function yp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTextureCube(t[e]||Tf,a[e])}function xp(e,t,n){const i=this.cache,r=t.length,a=If(n,r);Nf(i,a)||(e.uniform1iv(this.addr,a),Df(i,a));for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||Mf,a[e])}class _p{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 Of;case 35664:return Uf;case 35665:return zf;case 35666:return Ff;case 35674:return Bf;case 35675:return Hf;case 35676:return Vf;case 5124:case 35670:return jf;case 35667:case 35671:return Gf;case 35668:case 35672:return Wf;case 35669:case 35673:return Xf;case 5125:return qf;case 36294:return $f;case 36295:return Yf;case 36296:return Zf;case 35678:case 36198:case 36298:case 36306:case 35682:return Kf;case 35679:case 36299:case 36307:return Qf;case 35680:case 36300:case 36308:case 36293:return Jf;case 36289:case 36303:case 36311:case 36292:return ep}}(t.type)}}class bp{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 tp;case 35664:return np;case 35665:return ip;case 35666:return rp;case 35674:return ap;case 35675:return op;case 35676:return sp;case 5124:case 35670:return lp;case 35667:case 35671:return cp;case 35668:case 35672:return up;case 35669:case 35673:return dp;case 5125:return hp;case 36294:return fp;case 36295:return pp;case 36296:return mp;case 35678:case 36198:case 36298:case 36306:case 35682:return gp;case 35679:case 36299:case 36307:return vp;case 35680:case 36300:case 36308:case 36293:return yp;case 36289:case 36303:case 36311:case 36292:return xp}}(t.type)}}class Sp{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const a=i[r];a.setValue(e,t[a.id],n)}}}const wp=/(\w+)(\])?(\[|\.)?/g;function Mp(e,t){e.seq.push(t),e.map[t.id]=t}function Ep(e,t,n){const i=e.name,r=i.length;for(wp.lastIndex=0;;){const a=wp.exec(i),o=wp.lastIndex;let s=a[1];const l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===r){Mp(n,void 0===c?new _p(s,e,t):new bp(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new Sp(s),Mp(n,e)),n=e}}}class Tp{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i);Ep(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,i){const r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const a=t[r],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const r=e[i];r.id in t&&n.push(r)}return n}}function Ap(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}const Cp=37297;let Pp=0;function Rp(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();if(i&&""===r)return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){const n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;e<a;e++){const r=e+1;i.push(`${r===t?">":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return r}function Lp(e,t){const n=function(e){const t=qc.getPrimaries(qc.workingColorSpace),n=qc.getPrimaries(e);let i;switch(t===n?i="":t===fc&&n===hc?i="LinearDisplayP3ToLinearSRGB":t===hc&&n===fc&&(i="LinearSRGBToLinearDisplayP3"),e){case sc:case cc:return[i,"LinearTransferOETF"];case oc:case lc:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[i,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function kp(e,t){let n;switch(t){case El:n="Linear";break;case Tl:n="Reinhard";break;case Al:n="OptimizedCineon";break;case Cl:n="ACESFilmic";break;case Rl:n="AgX";break;case Ll:n="Neutral";break;case Pl:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Np(e){return""!==e}function Dp(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 Ip(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Op=/^[ \t]*#include +<([\w\d./]+)>/gm;function Up(e){return e.replace(Op,Fp)}const zp=new Map;function Fp(e,t){let n=Uh[t];if(void 0===n){const e=zp.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=Uh[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return Up(n)}const Bp=/#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 Hp(e){return e.replace(Bp,Vp)}function Vp(e,t,n,i){let r="";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function jp(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;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 Gp(e,t,n,i){const r=e.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===Ks?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===Qs?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Js&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case kl:case Nl:t="ENVMAP_TYPE_CUBE";break;case Dl:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===Nl&&(t="ENVMAP_MODE_REFRACTION");return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case bl:t="ENVMAP_BLENDING_MULTIPLY";break;case Sl:t="ENVMAP_BLENDING_MIX";break;case wl:t="ENVMAP_BLENDING_ADD"}return t}(n),h=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),f=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Np).join("\n")}(n),p=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(a),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Np).join("\n"),g.length>0&&(g+="\n"),v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Np).join("\n"),v.length>0&&(v+="\n")):(g=[jp(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",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?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#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.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#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","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Np).join("\n"),v=[jp(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",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 "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.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.dispersion?"#define USE_DISPERSION":"",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||n.batchingColor?"#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.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Ml?"#define TONE_MAPPING":"",n.toneMapping!==Ml?Uh.tonemapping_pars_fragment:"",n.toneMapping!==Ml?kp("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Uh.colorspace_pars_fragment,Lp("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Np).join("\n")),o=Up(o),o=Dp(o,n),o=Ip(o,n),s=Up(s),s=Dp(s,n),s=Ip(s,n),o=Hp(o),s=Hp(s),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===wc?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===wc?"":"#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 x=y+g+o,_=y+v+s,b=Ap(r,r.VERTEX_SHADER,x),S=Ap(r,r.FRAGMENT_SHADER,_);function w(t){if(e.debug.checkShaderErrors){const n=r.getProgramInfoLog(m).trim(),i=r.getShaderInfoLog(b).trim(),a=r.getShaderInfoLog(S).trim();let o=!0,s=!0;if(!1===r.getProgramParameter(m,r.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(r,m,b,S);else{const e=Rp(r,b,"vertex"),i=Rp(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==a||(s=!1);s&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:i,prefix:g},fragmentShader:{log:a,prefix:v}})}r.deleteShader(b),r.deleteShader(S),M=new Tp(r,m),E=function(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r),a=i.name;let o=1;i.type===e.FLOAT_MAT2&&(o=2),i.type===e.FLOAT_MAT3&&(o=3),i.type===e.FLOAT_MAT4&&(o=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}(r,m)}let M,E;r.attachShader(m,b),r.attachShader(m,S),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),this.getUniforms=function(){return void 0===M&&w(this),M},this.getAttributes=function(){return void 0===E&&w(this),E};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=r.getProgramParameter(m,Cp)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Pp++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=S,this}let Wp=0;class Xp{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.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 qp(e),t.set(e,n)),n}}class qp{constructor(e){this.id=Wp++,this.code=e,this.usedTimes=0}}function $p(e,t,n,i,r,a,o){const s=new Zu,l=new Xp,c=new Set,u=[],d=r.logarithmicDepthBuffer,h=r.vertexTextures;let f=r.precision;const p={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 c.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(a,s,u,g,v){const y=g.fog,x=v.geometry,_=a.isMeshStandardMaterial?g.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||_),S=b&&b.mapping===Dl?b.image.height:null,w=p[a.type];null!==a.precision&&(f=r.getMaxPrecision(a.precision),f!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead."));const M=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,E=void 0!==M?M.length:0;let T,A,C,P,R=0;if(void 0!==x.morphAttributes.position&&(R=1),void 0!==x.morphAttributes.normal&&(R=2),void 0!==x.morphAttributes.color&&(R=3),w){const e=Fh[w];T=e.vertexShader,A=e.fragmentShader}else T=a.vertexShader,A=a.fragmentShader,l.update(a),C=l.getVertexShaderID(a),P=l.getFragmentShaderID(a);const L=e.getRenderTarget(),k=!0===v.isInstancedMesh,N=!0===v.isBatchedMesh,D=!!a.map,I=!!a.matcap,O=!!b,U=!!a.aoMap,z=!!a.lightMap,F=!!a.bumpMap,B=!!a.normalMap,H=!!a.displacementMap,V=!!a.emissiveMap,j=!!a.metalnessMap,G=!!a.roughnessMap,W=a.anisotropy>0,X=a.clearcoat>0,q=a.dispersion>0,$=a.iridescence>0,Y=a.sheen>0,Z=a.transmission>0,K=W&&!!a.anisotropyMap,Q=X&&!!a.clearcoatMap,J=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,te=$&&!!a.iridescenceMap,ne=$&&!!a.iridescenceThicknessMap,ie=Y&&!!a.sheenColorMap,re=Y&&!!a.sheenRoughnessMap,ae=!!a.specularMap,oe=!!a.specularColorMap,se=!!a.specularIntensityMap,le=Z&&!!a.transmissionMap,ce=Z&&!!a.thicknessMap,ue=!!a.gradientMap,de=!!a.alphaMap,he=a.alphaTest>0,fe=!!a.alphaHash,pe=!!a.extensions;let me=Ml;a.toneMapped&&(null!==L&&!0!==L.isXRRenderTarget||(me=e.toneMapping));const ge={shaderID:w,shaderType:a.type,shaderName:a.name,vertexShader:T,fragmentShader:A,defines:a.defines,customVertexShaderID:C,customFragmentShaderID:P,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:N,batchingColor:N&&null!==v._colorsTexture,instancing:k,instancingColor:k&&null!==v.instanceColor,instancingMorph:k&&null!==v.morphTexture,supportsVertexTextures:h,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:sc,alphaToCoverage:!!a.alphaToCoverage,map:D,matcap:I,envMap:O,envMapMode:O&&b.mapping,envMapCubeUVHeight:S,aoMap:U,lightMap:z,bumpMap:F,normalMap:B,displacementMap:h&&H,emissiveMap:V,normalMapObjectSpace:B&&1===a.normalMapType,normalMapTangentSpace:B&&0===a.normalMapType,metalnessMap:j,roughnessMap:G,anisotropy:W,anisotropyMap:K,clearcoat:X,clearcoatMap:Q,clearcoatNormalMap:J,clearcoatRoughnessMap:ee,dispersion:q,iridescence:$,iridescenceMap:te,iridescenceThicknessMap:ne,sheen:Y,sheenColorMap:ie,sheenRoughnessMap:re,specularMap:ae,specularColorMap:oe,specularIntensityMap:se,transmission:Z,transmissionMap:le,thicknessMap:ce,gradientMap:ue,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:de,alphaTest:he,alphaHash:fe,combine:a.combine,mapUv:D&&m(a.map.channel),aoMapUv:U&&m(a.aoMap.channel),lightMapUv:z&&m(a.lightMap.channel),bumpMapUv:F&&m(a.bumpMap.channel),normalMapUv:B&&m(a.normalMap.channel),displacementMapUv:H&&m(a.displacementMap.channel),emissiveMapUv:V&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:G&&m(a.roughnessMap.channel),anisotropyMapUv:K&&m(a.anisotropyMap.channel),clearcoatMapUv:Q&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:J&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ne&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:ie&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:re&&m(a.sheenRoughnessMap.channel),specularMapUv:ae&&m(a.specularMap.channel),specularColorMapUv:oe&&m(a.specularColorMap.channel),specularIntensityMapUv:se&&m(a.specularIntensityMap.channel),transmissionMapUv:le&&m(a.transmissionMap.channel),thicknessMapUv:ce&&m(a.thicknessMap.channel),alphaMapUv:de&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(B||W),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!x.attributes.uv&&(D||de),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:E,morphTextureStride:R,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:me,decodeVideoTexture:D&&!0===a.map.isVideoTexture&&qc.getTransfer(a.map.colorSpace)===dc,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===tl,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:pe&&!0===a.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:pe&&!0===a.extensions.multiDraw&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ge.vertexUv1s=c.has(1),ge.vertexUv2s=c.has(2),ge.vertexUv3s=c.has(3),c.clear(),ge},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){s.disableAll(),t.supportsVertexTextures&&s.enable(0);t.instancing&&s.enable(1);t.instancingColor&&s.enable(2);t.instancingMorph&&s.enable(3);t.matcap&&s.enable(4);t.envMap&&s.enable(5);t.normalMapObjectSpace&&s.enable(6);t.normalMapTangentSpace&&s.enable(7);t.clearcoat&&s.enable(8);t.iridescence&&s.enable(9);t.alphaTest&&s.enable(10);t.vertexColors&&s.enable(11);t.vertexAlphas&&s.enable(12);t.vertexUv1s&&s.enable(13);t.vertexUv2s&&s.enable(14);t.vertexUv3s&&s.enable(15);t.vertexTangents&&s.enable(16);t.anisotropy&&s.enable(17);t.alphaHash&&s.enable(18);t.batching&&s.enable(19);t.dispersion&&s.enable(20);t.batchingColor&&s.enable(21);e.push(s.mask),s.disableAll(),t.fog&&s.enable(0);t.useFog&&s.enable(1);t.flatShading&&s.enable(2);t.logarithmicDepthBuffer&&s.enable(3);t.skinning&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.morphColors&&s.enable(7);t.premultipliedAlpha&&s.enable(8);t.shadowMapEnabled&&s.enable(9);t.doubleSided&&s.enable(10);t.flipSided&&s.enable(11);t.useDepthPacking&&s.enable(12);t.dithering&&s.enable(13);t.transmission&&s.enable(14);t.sheen&&s.enable(15);t.opaque&&s.enable(16);t.pointsUvs&&s.enable(17);t.decodeVideoTexture&&s.enable(18);t.alphaToCoverage&&s.enable(19);e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=p[e.type];let n;if(t){const e=Fh[t];n=gh.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=u.length;e<t;e++){const t=u[e];if(t.cacheKey===n){i=t,++i.usedTimes;break}}return void 0===i&&(i=new Gp(e,n,t,a),u.push(i)),i},releaseProgram:function(e){if(0==--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function Yp(){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,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function Zp(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 Kp(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 Qp(){const e=[];let t=0;const n=[],i=[],r=[];function a(n,i,r,a,o,s){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?i.push(u):!0===o.transparent?r.push(u):n.push(u)},unshift:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?i.unshift(u):!0===o.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=t,i=e.length;n<i;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||Zp),i.length>1&&i.sort(t||Kp),r.length>1&&r.sort(t||Kp)}}}function Jp(){let e=new WeakMap;return{get:function(t,n){const i=e.get(t);let r;return void 0===i?(r=new Qp,e.set(t,[r])):n>=i.length?(r=new Qp,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function em(){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 cu,color:new Cd};break;case"SpotLight":n={position:new cu,direction:new cu,color:new Cd,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new cu,color:new Cd,distance:0,decay:0};break;case"HemisphereLight":n={direction:new cu,skyColor:new Cd,groundColor:new Cd};break;case"RectAreaLight":n={color:new Cd,position:new cu,halfWidth:new cu,halfHeight:new cu}}return e[t.id]=n,n}}}let tm=0;function nm(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function im(e){const t=new em,n=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 Ic};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ic,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 cu);const r=new cu,a=new Fu,o=new Fu;return{setup:function(r){let a=0,o=0,s=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let l=0,c=0,u=0,d=0,h=0,f=0,p=0,m=0,g=0,v=0,y=0;r.sort(nm);for(let e=0,x=r.length;e<x;e++){const x=r[e],_=x.color,b=x.intensity,S=x.distance,w=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)a+=_.r*b,o+=_.g*b,s+=_.b*b;else if(x.isLightProbe){for(let e=0;e<9;e++)i.probe[e].addScaledVector(x.sh.coefficients[e],b);y++}else if(x.isDirectionalLight){const e=t.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),x.castShadow){const e=x.shadow,t=n.get(x);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,i.directionalShadow[l]=t,i.directionalShadowMap[l]=w,i.directionalShadowMatrix[l]=x.shadow.matrix,f++}i.directional[l]=e,l++}else if(x.isSpotLight){const e=t.get(x);e.position.setFromMatrixPosition(x.matrixWorld),e.color.copy(_).multiplyScalar(b),e.distance=S,e.coneCos=Math.cos(x.angle),e.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),e.decay=x.decay,i.spot[u]=e;const r=x.shadow;if(x.map&&(i.spotLightMap[g]=x.map,g++,r.updateMatrices(x),x.castShadow&&v++),i.spotLightMatrix[u]=r.matrix,x.castShadow){const e=n.get(x);e.shadowBias=r.bias,e.shadowNormalBias=r.normalBias,e.shadowRadius=r.radius,e.shadowMapSize=r.mapSize,i.spotShadow[u]=e,i.spotShadowMap[u]=w,m++}u++}else if(x.isRectAreaLight){const e=t.get(x);e.color.copy(_).multiplyScalar(b),e.halfWidth.set(.5*x.width,0,0),e.halfHeight.set(0,.5*x.height,0),i.rectArea[d]=e,d++}else if(x.isPointLight){const e=t.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),e.distance=x.distance,e.decay=x.decay,x.castShadow){const e=x.shadow,t=n.get(x);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,i.pointShadow[c]=t,i.pointShadowMap[c]=w,i.pointShadowMatrix[c]=x.shadow.matrix,p++}i.point[c]=e,c++}else if(x.isHemisphereLight){const e=t.get(x);e.skyColor.copy(x.color).multiplyScalar(b),e.groundColor.copy(x.groundColor).multiplyScalar(b),i.hemi[h]=e,h++}}d>0&&(!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=zh.LTC_FLOAT_1,i.rectAreaLTC2=zh.LTC_FLOAT_2):(i.rectAreaLTC1=zh.LTC_HALF_1,i.rectAreaLTC2=zh.LTC_HALF_2)),i.ambient[0]=a,i.ambient[1]=o,i.ambient[2]=s;const x=i.hash;x.directionalLength===l&&x.pointLength===c&&x.spotLength===u&&x.rectAreaLength===d&&x.hemiLength===h&&x.numDirectionalShadows===f&&x.numPointShadows===p&&x.numSpotShadows===m&&x.numSpotMaps===g&&x.numLightProbes===y||(i.directional.length=l,i.spot.length=u,i.rectArea.length=d,i.point.length=c,i.hemi.length=h,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=p,i.spotLightMatrix.length=m+g-v,i.spotLightMap.length=g,i.numSpotLightShadowsWithMaps=v,i.numLightProbes=y,x.directionalLength=l,x.pointLength=c,x.spotLength=u,x.rectAreaLength=d,x.hemiLength=h,x.numDirectionalShadows=f,x.numPointShadows=p,x.numSpotShadows=m,x.numSpotMaps=g,x.numLightProbes=y,i.version=tm++)},setupView:function(e,t){let n=0,s=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),n++}else if(h.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),l++}else if(h.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(h.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(h.isPointLight){const e=i.point[s];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(d),s++}else if(h.isHemisphereLight){const e=i.hemi[u];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(d),u++}}},state:i}}function rm(e){const t=new im(e),n=[],i=[];const r={lightsArray:n,shadowsArray:i,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){r.camera=e,n.length=0,i.length=0},state:r,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function am(e){let t=new WeakMap;return{get:function(n,i=0){const r=t.get(n);let a;return void 0===r?(a=new rm(e),t.set(n,[a])):i>=r.length?(a=new rm(e),r.push(a)):a=r[i],a},dispose:function(){t=new WeakMap}}}class om extends Ld{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 sm extends Ld{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 lm(e,t,n){let i=new Nh;const r=new Ic,a=new Ic,o=new iu,s=new om({depthPacking:3201}),l=new sm,c={},u=n.maxTextureSize,d={[el]:tl,[tl]:el,[nl]:2},h=new vh({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ic},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}"}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const p=new Xd;p.setAttribute("position",new Id(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new uh(p,h),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ks;let v=this.type;function y(n,i){const a=t.update(m);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new au(r.x,r.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,a,h,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,a,f,m,null)}function x(t,n,i,r){let a=null;const o=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===i.isPointLight?l:s,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=a.uuid,t=n.uuid;let i=c[e];void 0===i&&(i={},c[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",b)),a=r}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=r===Js?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=i}return a}function _(n,r,a,o,s){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===Js)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const i=t.update(n),l=n.material;if(Array.isArray(l)){const t=i.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],d=l[u.materialIndex];if(d&&d.visible){const t=x(n,d,o,s);n.onBeforeShadow(e,n,r,a,i,t,u),e.renderBufferDirect(a,null,i,t,n,u),n.onAfterShadow(e,n,r,a,i,t,u)}}}else if(l.visible){const t=x(n,l,o,s);n.onBeforeShadow(e,n,r,a,i,t,null),e.renderBufferDirect(a,null,i,t,n,null),n.onAfterShadow(e,n,r,a,i,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)_(l[e],r,a,o,s)}function b(e){e.target.removeEventListener("dispose",b);for(const t in c){const n=c[t],i=e.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(t,n,s){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(),d=e.getActiveMipmapLevel(),h=e.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const f=v!==Js&&this.type===Js,p=v===Js&&this.type!==Js;for(let l=0,c=t.length;l<c;l++){const c=t[l],d=c.shadow;if(void 0===d){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===d.autoUpdate&&!1===d.needsUpdate)continue;r.copy(d.mapSize);const m=d.getFrameExtents();if(r.multiply(m),a.copy(d.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/m.x),r.x=a.x*m.x,d.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/m.y),r.y=a.y*m.y,d.mapSize.y=a.y)),null===d.map||!0===f||!0===p){const e=this.type!==Js?{minFilter:zl,magFilter:zl}:{};null!==d.map&&d.map.dispose(),d.map=new au(r.x,r.y,e),d.map.texture.name=c.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const g=d.getViewportCount();for(let e=0;e<g;e++){const t=d.getViewport(e);o.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),h.viewport(o),d.updateMatrices(c,e),i=d.getFrustum(),_(n,s,d.camera,c,this.type)}!0!==d.isPointLightShadow&&this.type===Js&&y(d,s),d.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(l,c,d)}}function cm(e){const t=new function(){let t=!1;const n=new iu;let i=null;const r=new iu(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},n=new function(){let t=!1,n=null,i=null,r=null;return{setTest:function(t){t?F(e.DEPTH_TEST):B(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==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)}i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},i=new function(){let t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(n){t||(n?F(e.STENCIL_TEST):B(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&l===i||(e.stencilOp(t,n,i),o=t,s=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null}}},r=new WeakMap,a=new WeakMap;let o={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,f=null,p=null,m=null,g=null,v=null,y=null,x=new Cd(0,0,0),_=0,b=!1,S=null,w=null,M=null,E=null,T=null;const A=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let C=!1,P=0;const R=e.getParameter(e.VERSION);-1!==R.indexOf("WebGL")?(P=parseFloat(/^WebGL (\d)/.exec(R)[1]),C=P>=1):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),C=P>=2);let L=null,k={};const N=e.getParameter(e.SCISSOR_BOX),D=e.getParameter(e.VIEWPORT),I=(new iu).fromArray(N),O=(new iu).fromArray(D);function U(t,n,i,r){const a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<i;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const z={};function F(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function B(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}z[e.TEXTURE_2D]=U(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=U(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),z[e.TEXTURE_2D_ARRAY]=U(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=U(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),i.setClear(0),F(e.DEPTH_TEST),n.setFunc(3),G(!1),W(1),F(e.CULL_FACE),j(0);const H={[il]:e.FUNC_ADD,[rl]:e.FUNC_SUBTRACT,[al]:e.FUNC_REVERSE_SUBTRACT};H[103]=e.MIN,H[104]=e.MAX;const V={[ol]:e.ZERO,[sl]:e.ONE,[ll]:e.SRC_COLOR,[ul]:e.SRC_ALPHA,[gl]:e.SRC_ALPHA_SATURATE,[pl]:e.DST_COLOR,[hl]:e.DST_ALPHA,[cl]:e.ONE_MINUS_SRC_COLOR,[dl]:e.ONE_MINUS_SRC_ALPHA,[ml]:e.ONE_MINUS_DST_COLOR,[fl]:e.ONE_MINUS_DST_ALPHA,[vl]:e.CONSTANT_COLOR,[yl]:e.ONE_MINUS_CONSTANT_COLOR,[xl]:e.CONSTANT_ALPHA,[_l]:e.ONE_MINUS_CONSTANT_ALPHA};function j(t,n,i,r,a,o,s,l,c,u){if(0!==t){if(!1===d&&(F(e.BLEND),d=!0),5===t)a=a||n,o=o||i,s=s||r,n===f&&a===g||(e.blendEquationSeparate(H[n],H[a]),f=n,g=a),i===p&&r===m&&o===v&&s===y||(e.blendFuncSeparate(V[i],V[r],V[o],V[s]),p=i,m=r,v=o,y=s),!1!==l.equals(x)&&c===_||(e.blendColor(l.r,l.g,l.b,c),x.copy(l),_=c),h=t,b=!1;else if(t!==h||u!==b){if(f===il&&g===il||(e.blendEquation(e.FUNC_ADD),f=il,g=il),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)}p=null,m=null,v=null,y=null,x.set(0,0,0),_=0,h=t,b=u}}else!0===d&&(B(e.BLEND),d=!1)}function G(t){S!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),S=t)}function W(t){0!==t?(F(e.CULL_FACE),t!==w&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):B(e.CULL_FACE),w=t}function X(t,n,i){t?(F(e.POLYGON_OFFSET_FILL),E===n&&T===i||(e.polygonOffset(n,i),E=n,T=i)):B(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:i},enable:F,disable:B,bindFramebuffer:function(t,n){return s[t]!==n&&(e.bindFramebuffer(t,n),s[t]=n,t===e.DRAW_FRAMEBUFFER&&(s[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(s[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let i=c,r=!1;if(t){i=l.get(n),void 0===i&&(i=[],l.set(n,i));const a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:j,setMaterial:function(r,a){2===r.side?B(e.CULL_FACE):F(e.CULL_FACE);let o=r.side===tl;a&&(o=!o),G(o),1===r.blending&&!1===r.transparent?j(0):j(r.blending,r.blendEquation,r.blendSrc,r.blendDst,r.blendEquationAlpha,r.blendSrcAlpha,r.blendDstAlpha,r.blendColor,r.blendAlpha,r.premultipliedAlpha),n.setFunc(r.depthFunc),n.setTest(r.depthTest),n.setMask(r.depthWrite),t.setMask(r.colorWrite);const s=r.stencilWrite;i.setTest(s),s&&(i.setMask(r.stencilWriteMask),i.setFunc(r.stencilFunc,r.stencilRef,r.stencilFuncMask),i.setOp(r.stencilFail,r.stencilZFail,r.stencilZPass)),X(r.polygonOffset,r.polygonOffsetFactor,r.polygonOffsetUnits),!0===r.alphaToCoverage?F(e.SAMPLE_ALPHA_TO_COVERAGE):B(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:G,setCullFace:W,setLineWidth:function(t){t!==M&&(C&&e.lineWidth(t),M=t)},setPolygonOffset:X,setScissorTest:function(t){t?F(e.SCISSOR_TEST):B(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+A-1),L!==t&&(e.activeTexture(t),L=t)},bindTexture:function(t,n,i){void 0===i&&(i=null===L?e.TEXTURE0+A-1:L);let r=k[i];void 0===r&&(r={type:void 0,texture:void 0},k[i]=r),r.type===t&&r.texture===n||(L!==i&&(e.activeTexture(i),L=i),e.bindTexture(t,n||z[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=k[L];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 i=a.get(n);void 0===i&&(i=new WeakMap,a.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function(t,n){const i=a.get(n).get(t);r.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),r.set(n,i))},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===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===O.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),O.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),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),o={},L=null,k={},s={},l=new WeakMap,c=[],u=null,d=!1,h=null,f=null,p=null,m=null,g=null,v=null,y=null,x=new Cd(0,0,0),_=0,b=!1,S=null,w=null,M=null,E=null,T=null,I.set(0,0,e.canvas.width,e.canvas.height),O.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),i.reset()}}}function um(e,t,n,i,r,a,o){const s=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Ic,u=new WeakMap;let d;const h=new WeakMap;let f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return f?new OffscreenCanvas(e,t):Fc("canvas")}function m(e,t,n){let i=1;const r=B(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===d&&(d=p(n,a));const o=t?p(n,a):d;o.width=n,o.height=a;return o.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==zl&&e.minFilter!==Hl}function v(t){e.generateMipmap(t)}function y(n,i,r,a,o=!1){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 s=i;if(i===e.RED&&(r===e.FLOAT&&(s=e.R32F),r===e.HALF_FLOAT&&(s=e.R16F),r===e.UNSIGNED_BYTE&&(s=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(s=e.R8UI),r===e.UNSIGNED_SHORT&&(s=e.R16UI),r===e.UNSIGNED_INT&&(s=e.R32UI),r===e.BYTE&&(s=e.R8I),r===e.SHORT&&(s=e.R16I),r===e.INT&&(s=e.R32I)),i===e.RG&&(r===e.FLOAT&&(s=e.RG32F),r===e.HALF_FLOAT&&(s=e.RG16F),r===e.UNSIGNED_BYTE&&(s=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(s=e.RG8UI),r===e.UNSIGNED_SHORT&&(s=e.RG16UI),r===e.UNSIGNED_INT&&(s=e.RG32UI),r===e.BYTE&&(s=e.RG8I),r===e.SHORT&&(s=e.RG16I),r===e.INT&&(s=e.RG32I)),i===e.RGB&&r===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.RGBA){const t=o?uc:qc.getTransfer(a);r===e.FLOAT&&(s=e.RGBA32F),r===e.HALF_FLOAT&&(s=e.RGBA16F),r===e.UNSIGNED_BYTE&&(s=t===dc?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return s!==e.R16F&&s!==e.R32F&&s!==e.RG16F&&s!==e.RG32F&&s!==e.RGBA16F&&s!==e.RGBA32F||t.get("EXT_color_buffer_float"),s}function x(t,n){let i;return t?null===n||n===ql||n===Zl?i=e.DEPTH24_STENCIL8:n===$l?i=e.DEPTH32F_STENCIL8:n===Wl&&(i=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===ql||n===Zl?i=e.DEPTH_COMPONENT24:n===$l?i=e.DEPTH_COMPONENT32F:n===Wl&&(i=e.DEPTH_COMPONENT16),i}function _(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==zl&&e.minFilter!==Hl?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 b(e){const t=e.target;t.removeEventListener("dispose",b),function(e){const t=i.get(e);if(void 0===t.__webglInit)return;const n=e.source,r=h.get(n);if(r){const i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&w(e),0===Object.keys(r).length&&h.delete(n)}i.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=i.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i<n.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(n.__webglFramebuffer[t][i]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=t.textures;for(let t=0,n=r.length;t<n;t++){const n=i.get(r[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),i.remove(r[t])}i.remove(t)}(n)}function w(t){const n=i.get(t);e.deleteTexture(n.__webglTexture);const r=t.source;delete h.get(r)[n.__cacheKey],o.memory.textures--}let M=0;function E(t,r){const a=i.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__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 L(a,t,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+r)}const T={[Il]:e.REPEAT,[Ol]:e.CLAMP_TO_EDGE,[Ul]:e.MIRRORED_REPEAT},A={[zl]:e.NEAREST,[Fl]:e.NEAREST_MIPMAP_NEAREST,[Bl]:e.NEAREST_MIPMAP_LINEAR,[Hl]:e.LINEAR,[Vl]:e.LINEAR_MIPMAP_NEAREST,[jl]:e.LINEAR_MIPMAP_LINEAR},C={[mc]:e.NEVER,[Sc]:e.ALWAYS,[gc]:e.LESS,[yc]:e.LEQUAL,[vc]:e.EQUAL,[bc]:e.GEQUAL,[xc]:e.GREATER,[_c]:e.NOTEQUAL};function P(n,a){if(a.type!==$l||!1!==t.has("OES_texture_float_linear")||a.magFilter!==Hl&&a.magFilter!==Vl&&a.magFilter!==Bl&&a.magFilter!==jl&&a.minFilter!==Hl&&a.minFilter!==Vl&&a.minFilter!==Bl&&a.minFilter!==jl||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(a.magFilter===zl)return;if(a.minFilter!==Bl&&a.minFilter!==jl)return;if(a.type===$l&&!1===t.has("OES_texture_float_linear"))return;if(a.anisotropy>1||i.get(a).__currentAnisotropy){const o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}}function R(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",b));const r=n.source;let a=h.get(r);void 0===a&&(a={},h.set(r,a));const s=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(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,i=!0),a[s].usedTimes++;const r=a[t.__cacheKey];void 0!==r&&(a[t.__cacheKey].usedTimes--,0===r.usedTimes&&w(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return i}function L(t,o,s){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=R(t,o),u=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const d=i.get(u);if(u.version!==d.__version||!0===c){n.activeTexture(e.TEXTURE0+s);const t=qc.getPrimaries(qc.workingColorSpace),i=o.colorSpace===ac?null:qc.getPrimaries(o.colorSpace),h=o.colorSpace===ac||t===i?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);let f=m(o.image,!1,r.maxTextureSize);f=F(o,f);const p=a.convert(o.format,o.colorSpace),b=a.convert(o.type);let S,w=y(o.internalFormat,p,b,o.colorSpace,o.isVideoTexture);P(l,o);const M=o.mipmaps,E=!0!==o.isVideoTexture,T=void 0===d.__version||!0===c,A=u.dataReady,C=_(o,f);if(o.isDepthTexture)w=x(o.format===Jl,o.type),T&&(E?n.texStorage2D(e.TEXTURE_2D,1,w,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,w,f.width,f.height,0,p,b,null));else if(o.isDataTexture)if(M.length>0){E&&T&&n.texStorage2D(e.TEXTURE_2D,C,w,M[0].width,M[0].height);for(let t=0,i=M.length;t<i;t++)S=M[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,b,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,p,b,S.data);o.generateMipmaps=!1}else E?(T&&n.texStorage2D(e.TEXTURE_2D,C,w,f.width,f.height),A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,p,b,f.data)):n.texImage2D(e.TEXTURE_2D,0,w,f.width,f.height,0,p,b,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){E&&T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,w,M[0].width,M[0].height,f.depth);for(let t=0,i=M.length;t<i;t++)if(S=M[t],o.format!==Kl)if(null!==p)if(E){if(A)if(o.layerUpdates.size>0){for(const i of o.layerUpdates){const r=S.width*S.height;n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,S.width,S.height,1,p,S.data.slice(r*i,r*(i+1)),0,0)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,S.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,f.depth,0,S.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,b,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,w,S.width,S.height,f.depth,0,p,b,S.data)}else{E&&T&&n.texStorage2D(e.TEXTURE_2D,C,w,M[0].width,M[0].height);for(let t=0,i=M.length;t<i;t++)S=M[t],o.format!==Kl?null!==p?E?A&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,S.data):n.compressedTexImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,b,S.data):n.texImage2D(e.TEXTURE_2D,t,w,S.width,S.height,0,p,b,S.data)}else if(o.isDataArrayTexture)if(E){if(T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,w,f.width,f.height,f.depth),A)if(o.layerUpdates.size>0){let t;switch(b){case e.UNSIGNED_BYTE:switch(p){case e.ALPHA:case e.LUMINANCE:t=1;break;case e.LUMINANCE_ALPHA:t=2;break;case e.RGB:t=3;break;case e.RGBA:t=4;break;default:throw new Error(`Unknown texel size for format ${p}.`)}break;case e.UNSIGNED_SHORT_4_4_4_4:case e.UNSIGNED_SHORT_5_5_5_1:case e.UNSIGNED_SHORT_5_6_5:t=1;break;default:throw new Error(`Unknown texel size for type ${b}.`)}const i=f.width*f.height*t;for(const t of o.layerUpdates)n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,t,f.width,f.height,1,p,b,f.data.slice(i*t,i*(t+1)));o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,p,b,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,w,f.width,f.height,f.depth,0,p,b,f.data);else if(o.isData3DTexture)E?(T&&n.texStorage3D(e.TEXTURE_3D,C,w,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,p,b,f.data)):n.texImage3D(e.TEXTURE_3D,0,w,f.width,f.height,f.depth,0,p,b,f.data);else if(o.isFramebufferTexture){if(T)if(E)n.texStorage2D(e.TEXTURE_2D,C,w,f.width,f.height);else{let t=f.width,i=f.height;for(let r=0;r<C;r++)n.texImage2D(e.TEXTURE_2D,r,w,t,i,0,p,b,null),t>>=1,i>>=1}}else if(M.length>0){if(E&&T){const t=B(M[0]);n.texStorage2D(e.TEXTURE_2D,C,w,t.width,t.height)}for(let t=0,i=M.length;t<i;t++)S=M[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,p,b,S):n.texImage2D(e.TEXTURE_2D,t,w,p,b,S);o.generateMipmaps=!1}else if(E){if(T){const t=B(f);n.texStorage2D(e.TEXTURE_2D,C,w,t.width,t.height)}A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p,b,f)}else n.texImage2D(e.TEXTURE_2D,0,w,p,b,f);g(o)&&v(l),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function k(t,r,o,l,c,u){const d=a.convert(o.format,o.colorSpace),h=a.convert(o.type),f=y(o.internalFormat,d,h,o.colorSpace);if(!i.get(r).__hasExternalTextures){const t=Math.max(1,r.width>>u),i=Math.max(1,r.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,f,t,i,r.depth,0,d,h,null):n.texImage2D(c,u,f,t,i,0,d,h,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,i.get(o).__webglTexture,0,U(r)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,i.get(o).__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function N(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,o=x(n.stencilBuffer,a),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=U(n);z(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let r=0;r<t.length;r++){const o=t[r],l=a.convert(o.format,o.colorSpace),c=a.convert(o.type),u=y(o.internalFormat,l,c,o.colorSpace),d=U(n);i&&!1===z(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,d,u,n.width,n.height):z(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,d,u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function D(t){const r=i.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!r.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),E(r.depthTexture,0);const a=i.get(r.depthTexture).__webglTexture,o=U(r);if(r.depthTexture.format===Ql)z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(r.depthTexture.format!==Jl)throw new Error("Unknown depthTexture format");z(r)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(r.__webglFramebuffer,t)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=e.createRenderbuffer(),N(r.__webglDepthbuffer[i],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),N(r.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}const I=[],O=[];function U(e){return Math.min(r.maxSamples,e.samples)}function z(e){const n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function F(e,t){const n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==sc&&n!==ac&&(qc.getTransfer(n)===dc?i===Kl&&r===Gl||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function B(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=M;return e>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=E,this.setTexture2DArray=function(t,r){const a=i.get(t);t.version>0&&a.__version!==t.version?L(a,t,r):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r)},this.setTexture3D=function(t,r){const a=i.get(t);t.version>0&&a.__version!==t.version?L(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,o){const s=i.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(6!==o.image.length)return;const l=R(t,o),c=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const u=i.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+s);const t=qc.getPrimaries(qc.workingColorSpace),i=o.colorSpace===ac?null:qc.getPrimaries(o.colorSpace),d=o.colorSpace===ac||t===i?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const h=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=h||f?f?o.image[e].image:o.image[e]:m(o.image[e],!0,r.maxCubemapSize),p[e]=F(o,p[e]);const x=p[0],b=a.convert(o.format,o.colorSpace),S=a.convert(o.type),w=y(o.internalFormat,b,S,o.colorSpace),M=!0!==o.isVideoTexture,E=void 0===u.__version||!0===l,T=c.dataReady;let A,C=_(o,x);if(P(e.TEXTURE_CUBE_MAP,o),h){M&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,x.width,x.height);for(let t=0;t<6;t++){A=p[t].mipmaps;for(let i=0;i<A.length;i++){const r=A[i];o.format!==Kl?null!==b?M?T&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,0,0,r.width,r.height,b,r.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,w,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,0,0,r.width,r.height,b,S,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i,w,r.width,r.height,0,b,S,r.data)}}}else{if(A=o.mipmaps,M&&E){A.length>0&&C++;const t=B(p[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,t.width,t.height)}for(let t=0;t<6;t++)if(f){M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,b,S,p[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,p[t].width,p[t].height,0,b,S,p[t].data);for(let i=0;i<A.length;i++){const r=A[i].image[t].image;M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,r.width,r.height,b,S,r.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,r.width,r.height,0,b,S,r.data)}}else{M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,b,S,p[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,b,S,p[t]);for(let i=0;i<A.length;i++){const r=A[i];M?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,0,0,b,S,r.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,i+1,w,b,S,r.image[t])}}}g(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(s,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,r){const a=i.get(t);void 0!==n&&k(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==r&&D(t)},this.setupRenderTarget=function(t){const r=t.texture,s=i.get(t),l=i.get(r);t.addEventListener("dispose",S);const c=t.textures,u=!0===t.isWebGLCubeRenderTarget,d=c.length>1;if(d||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<r.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<r.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=c.length;t<n;t++){const n=i.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===z(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const i=c[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);const r=a.convert(i.format,i.colorSpace),o=a.convert(i.type),l=y(i.internalFormat,r,o,i.colorSpace,!0===t.isXRRenderTarget),u=U(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),N(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),P(e.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)k(s.__webglFramebuffer[n][i],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else k(s.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(r)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let r=0,a=c.length;r<a;r++){const a=c[r],o=i.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),P(e.TEXTURE_2D,a),k(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+r,e.TEXTURE_2D,0),g(a)&&v(e.TEXTURE_2D)}n.unbindTexture()}else{let i=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(i=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),P(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)k(s.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,i,n);else k(s.__webglFramebuffer,t,r,e.COLOR_ATTACHMENT0,i,0);g(r)&&v(i),n.unbindTexture()}t.depthBuffer&&D(t)},this.updateRenderTargetMipmap=function(t){const r=t.textures;for(let a=0,o=r.length;a<o;a++){const o=r[a];if(g(o)){const r=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=i.get(o).__webglTexture;n.bindTexture(r,a),v(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===z(t)){const r=t.textures,a=t.width,o=t.height;let s=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=i.get(t),d=r.length>1;if(d)for(let t=0;t<r.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<r.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const t=i.get(r[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),!0===l&&(I.length=0,O.length=0,I.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(I.push(c),O.push(c),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,O)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,I))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<r.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);const a=i.get(r[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=D,this.setupFrameBufferTexture=k,this.useMultisampledRTT=z}function dm(e,t){return{convert:function(n,i=""){let r;const a=qc.getTransfer(i);if(n===Gl)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===Wl)return e.UNSIGNED_SHORT;if(n===Xl)return e.INT;if(n===ql)return e.UNSIGNED_INT;if(n===$l)return e.FLOAT;if(n===Yl)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(n===Kl)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===Ql)return e.DEPTH_COMPONENT;if(n===Jl)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(n===ec||n===tc||n===nc||n===ic)if(a===dc){if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===ec)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===tc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===nc)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ic)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=t.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===ec)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===tc)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===nc)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ic)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(r=t.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n){if(r=t.get("WEBGL_compressed_texture_etc"),null===r)return null;if(36196===n||37492===n)return a===dc?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(37496===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(r=t.get("WEBGL_compressed_texture_astc"),null===r)return null;if(37808===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===dc?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===rc||36494===n||36495===n){if(r=t.get("EXT_texture_compression_bptc"),null===r)return null;if(n===rc)return a===dc?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(r=t.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===rc)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===Zl?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class hm extends Sh{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class fm extends hd{constructor(){super(),this.isGroup=!0,this.type="Group"}}const pm={type:"move"};class mm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new fm,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 fm,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new cu,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new cu),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new fm,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new cu,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new cu),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 i=null,r=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],o=i.position.distanceTo(r.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),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));null!==o&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(pm)))}return null!==o&&(o.visible=null!==i),null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new fm;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class gm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const i=new nu;e.properties.get(i).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new vh({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new uh(new Oh(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}}class vm extends Tc{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",s=1,l=null,c=null,u=null,d=null,h=null,f=null;const p=new gm,m=t.getContextAttributes();let g=null,v=null;const y=[],x=[],_=new Ic;let b=null;const S=new Sh;S.layers.enable(1),S.viewport=new iu;const w=new Sh;w.layers.enable(2),w.viewport=new iu;const M=[S,w],E=new hm;E.layers.enable(1),E.layers.enable(2);let T=null,A=null;function C(e){const t=x.indexOf(e.inputSource);if(-1===t)return;const n=y[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function P(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",R);for(let e=0;e<y.length;e++){const t=x[e];null!==t&&(x[e]=null,y[e].disconnect(t))}T=null,A=null,p.reset(),e.setRenderTarget(g),h=null,d=null,u=null,i=null,v=null,I.stop(),n.isPresenting=!1,e.setPixelRatio(b),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],i=x.indexOf(n);i>=0&&(x[i]=null,y[i].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let i=x.indexOf(n);if(-1===i){for(let e=0;e<y.length;e++){if(e>=x.length){x.push(n),i=e;break}if(null===x[e]){x[e]=n,i=e;break}}if(-1===i)break}const r=y[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new mm,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==d?d:h},this.getBinding=function(){return u},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(g=e.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",P),i.addEventListener("inputsourceschange",R),!0!==m.xrCompatible&&await t.makeXRCompatible(),b=e.getPixelRatio(),e.getSize(_),void 0===i.renderState.layers){const n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:h}),e.setPixelRatio(1),e.setSize(h.framebufferWidth,h.framebufferHeight,!1),v=new au(h.framebufferWidth,h.framebufferHeight,{format:Kl,type:Gl,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,a=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=m.stencil?Jl:Ql,a=m.stencil?Zl:ql);const s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:r};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(s),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),v=new au(d.textureWidth,d.textureHeight,{format:Kl,type:Gl,depthTexture:new bf(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===d.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(s),l=null,a=await i.requestReferenceSpace(o),I.setContext(i),I.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const L=new cu,k=new cu;function N(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===i)return;null!==p.texture&&(e.near=p.depthNear,e.far=p.depthFar),E.near=w.near=S.near=e.near,E.far=w.far=S.far=e.far,T===E.near&&A===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),T=E.near,A=E.far,S.near=T,S.far=A,w.near=T,w.far=A,S.updateProjectionMatrix(),w.updateProjectionMatrix(),e.updateProjectionMatrix());const t=e.parent,n=E.cameras;N(E,t);for(let e=0;e<n.length;e++)N(n[e],t);2===n.length?function(e,t,n){L.setFromMatrixPosition(t.matrixWorld),k.setFromMatrixPosition(n.matrixWorld);const i=L.distanceTo(k),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],d=(a[8]+1)/a[0],h=o*u,f=o*d,p=i/(-u+d),m=p*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+p,v=s+p,y=h-m,x=f+(i-m),_=l*s/v*g,b=c*s/v*g;e.projectionMatrix.makePerspective(y,x,_,b,g,v),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(E,S,w):E.projectionMatrix.copy(S.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*Pc*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,E,t)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==d||null!==h)return s},this.setFoveation=function(e){s=e,null!==d&&(d.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(E)};let D=null;const I=new Dh;I.setAnimationLoop((function(t,r){if(c=r.getViewerPose(l||a),f=r,null!==c){const t=c.views;null!==h&&(e.setRenderTargetFramebuffer(v,h.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let i=0;i<t.length;i++){const r=t[i];let a=null;if(null!==h)a=h.getViewport(r);else{const t=u.getViewSubImage(d,r);a=t.viewport,0===i&&(e.setRenderTargetTextures(v,t.colorTexture,d.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let o=M[i];void 0===o&&(o=new Sh,o.layers.enable(i),o.viewport=new iu,M[i]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===i&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=u.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&p.init(e,n,i.renderState)}}for(let e=0;e<y.length;e++){const t=x[e],n=y[e];null!==t&&void 0!==n&&n.update(t,r,l||a)}D&&D(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),f=null})),this.setAnimationLoop=function(e){D=e},this.dispose=function(){}}}const ym=new Yu,xm=new Fu;function _m(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function i(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map,n(i.map,e.mapTransform)),i.alphaMap&&(e.alphaMap.value=i.alphaMap,n(i.alphaMap,e.alphaMapTransform)),i.bumpMap&&(e.bumpMap.value=i.bumpMap,n(i.bumpMap,e.bumpMapTransform),e.bumpScale.value=i.bumpScale,i.side===tl&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,n(i.normalMap,e.normalMapTransform),e.normalScale.value.copy(i.normalScale),i.side===tl&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,n(i.displacementMap,e.displacementMapTransform),e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,e.emissiveMapTransform)),i.specularMap&&(e.specularMap.value=i.specularMap,n(i.specularMap,e.specularMapTransform)),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);const r=t.get(i),a=r.envMap,o=r.envMapRotation;a&&(e.envMap.value=a,ym.copy(o),ym.x*=-1,ym.y*=-1,ym.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(ym.y*=-1,ym.z*=-1),e.envMapRotation.value.setFromMatrix4(xm.makeRotationFromEuler(ym)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,mh(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,o,s){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(i(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(i(e,r),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform));e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform));t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(e,t,i){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,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===tl&&e.clearcoatNormalScale.value.negate()));t.dispersion>0&&(e.dispersion.value=t.dispersion);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=i.texture,e.transmissionSamplerSize.value.set(i.width,i.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,r,s)):r.isMeshMatcapMaterial?(i(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),function(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,r)):r.isMeshNormalMaterial?i(e,r):r.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,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,i,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*r,t.map&&(e.map.value=t.map,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,r,a,o):r.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,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function bm(e,t,n,i){let r={},a={},o=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,i){const r=e.value,a=t+"_"+n;if(void 0===i[a])return i[a]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const e=i[a];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return i[a]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==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 i=o.indexOf(n.__bindingPointIndex);o.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){const n=t.program;i.uniformBlockBinding(e,n)},update:function(n,d){let h=r[n.id];void 0===h&&(!function(e){const t=e.uniforms;let n=0;const i=16;for(let e=0,r=t.length;e<r;e++){const r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=a.length;e<r;e++){const r=c(a[e]),o=n%i;0!==o&&i-o<r.boundary&&(n+=i-o),t.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);e.__size=n,e.__cache={}}(n),h=function(t){const n=function(){for(let e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const i=e.createBuffer(),r=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,i),e.bufferData(e.UNIFORM_BUFFER,r,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=h,n.addEventListener("dispose",u));const f=d.program;i.updateUBOMapping(n,f);const p=t.render.frame;a[n.id]!==p&&(!function(t){const n=r[t.id],i=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=i.length;t<n;t++){const n=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,t,i,a)){const t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let a=0;a<n.length;a++){const o=n[a],s=c(o);"number"==typeof o||"boolean"==typeof o?(r.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):o.isMatrix3?(r.__data[0]=o.elements[0],r.__data[1]=o.elements[1],r.__data[2]=o.elements[2],r.__data[3]=0,r.__data[4]=o.elements[3],r.__data[5]=o.elements[4],r.__data[6]=o.elements[5],r.__data[7]=0,r.__data[8]=o.elements[6],r.__data[9]=o.elements[7],r.__data[10]=o.elements[8],r.__data[11]=0):(o.toArray(r.__data,i),i+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=p)},dispose:function(){for(const t in r)e.deleteBuffer(r[t]);o=[],r={},a={}}}}class Sm{constructor(e={}){const{canvas:t=Bc(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=e;let d;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const h=new Uint32Array(4),f=new Int32Array(4);let p=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=oc,this.toneMapping=Ml,this.toneMappingExposure=1;const y=this;let x=!1,_=0,b=0,S=null,w=-1,M=null;const E=new iu,T=new iu;let A=null;const C=new Cd(0);let P=0,R=t.width,L=t.height,k=1,N=null,D=null;const I=new iu(0,0,R,L),O=new iu(0,0,R,L);let U=!1;const z=new Nh;let F=!1,B=!1;const H=new Fu,V=new cu,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let G=!1;function W(){return null===S?k:1}let X,q,$,Y,Z,K,Q,J,ee,te,ne,ie,re,ae,oe,se,le,ce,ue,de,he,fe,pe,me,ge=n;function ve(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zs}`),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",be,!1),t.addEventListener("webglcontextcreationerror",Se,!1),null===ge){const t="webgl2";if(ge=ve(t,e),null===ge)throw ve(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ye(){X=new mf(ge),X.init(),fe=new dm(ge,X),q=new Xh(ge,X,e,fe),$=new cm(ge),Y=new yf(ge),Z=new Yp,K=new um(ge,X,$,Z,q,fe,Y),Q=new $h(y),J=new pf(y),ee=new Ih(ge),pe=new Gh(ge,ee),te=new gf(ge,ee,Y,pe),ne=new _f(ge,te,ee,Y),ue=new xf(ge,q,K),se=new qh(Z),ie=new $p(y,Q,J,X,q,pe,se),re=new _m(y,Z),ae=new Jp,oe=new am(X),ce=new jh(y,Q,J,$,ne,d,s),le=new lm(y,ne,q),me=new bm(ge,Y,q,$),de=new Wh(ge,X,Y),he=new vf(ge,X,Y),Y.programs=ie.programs,y.capabilities=q,y.extensions=X,y.properties=Z,y.renderLists=ae,y.shadowMap=le,y.state=$,y.info=Y}ye();const xe=new vm(y,ge);function _e(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function be(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const e=Y.autoReset,t=le.enabled,n=le.autoUpdate,i=le.needsUpdate,r=le.type;ye(),Y.autoReset=e,le.enabled=t,le.autoUpdate=n,le.needsUpdate=i,le.type=r}function Se(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function we(e){const t=e.target;t.removeEventListener("dispose",we),function(e){(function(e){const t=Z.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),Z.remove(e)}(t)}function Me(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=tl,e.needsUpdate=!0,De(e,t,n),e.side=el,e.needsUpdate=!0,De(e,t,n),e.side=2):De(e,t,n)}this.xr=xe,this.getContext=function(){return ge},this.getContextAttributes=function(){return ge.getContextAttributes()},this.forceContextLoss=function(){const e=X.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=X.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return k},this.setPixelRatio=function(e){void 0!==e&&(k=e,this.setSize(R,L,!1))},this.getSize=function(e){return e.set(R,L)},this.setSize=function(e,n,i=!0){xe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(R=e,L=n,t.width=Math.floor(e*k),t.height=Math.floor(n*k),!0===i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(R*k,L*k).floor()},this.setDrawingBufferSize=function(e,n,i){R=e,L=n,k=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(I)},this.setViewport=function(e,t,n,i){e.isVector4?I.set(e.x,e.y,e.z,e.w):I.set(e,t,n,i),$.viewport(E.copy(I).multiplyScalar(k).round())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,n,i){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,i),$.scissor(T.copy(O).multiplyScalar(k).round())},this.getScissorTest=function(){return U},this.setScissorTest=function(e){$.setScissorTest(U=e)},this.setOpaqueSort=function(e){N=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(ce.getClearColor())},this.setClearColor=function(){ce.setClearColor.apply(ce,arguments)},this.getClearAlpha=function(){return ce.getClearAlpha()},this.setClearAlpha=function(){ce.setClearAlpha.apply(ce,arguments)},this.clear=function(e=!0,t=!0,n=!0){let i=0;if(e){let e=!1;if(null!==S){const t=S.texture.format;e=1033===t||1031===t||1029===t}if(e){const e=S.texture.type,t=e===Gl||e===ql||e===Wl||e===Zl||1017===e||1018===e,n=ce.getClearColor(),i=ce.getClearAlpha(),r=n.r,a=n.g,o=n.b;t?(h[0]=r,h[1]=a,h[2]=o,h[3]=i,ge.clearBufferuiv(ge.COLOR,0,h)):(f[0]=r,f[1]=a,f[2]=o,f[3]=i,ge.clearBufferiv(ge.COLOR,0,f))}else i|=ge.COLOR_BUFFER_BIT}t&&(i|=ge.DEPTH_BUFFER_BIT),n&&(i|=ge.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ge.clear(i)},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",_e,!1),t.removeEventListener("webglcontextrestored",be,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),ae.dispose(),oe.dispose(),Z.dispose(),Q.dispose(),J.dispose(),ne.dispose(),pe.dispose(),me.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",Te),xe.removeEventListener("sessionend",Ae),Ce.stop()},this.renderBufferDirect=function(e,t,n,i,r,a){null===t&&(t=j);const o=r.isMesh&&r.matrixWorld.determinant()<0,s=function(e,t,n,i,r){!0!==t.isScene&&(t=j);K.resetTextureUnits();const a=t.fog,o=i.isMeshStandardMaterial?t.environment:null,s=null===S?y.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:sc,l=(i.isMeshStandardMaterial?J:Q).get(i.envMap||o),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),d=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let p=Ml;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=y.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,x=Z.get(i),_=m.state.lights;if(!0===F&&(!0===B||e!==M)){const t=e===M&&i.id===w;se.setState(i,e,t)}let b=!1;i.version===x.__version?x.needsLights&&x.lightsStateVersion!==_.state.version||x.outputColorSpace!==s||r.isBatchedMesh&&!1===x.batching?b=!0:r.isBatchedMesh||!0!==x.batching?r.isBatchedMesh&&!0===x.batchingColor&&null===r.colorTexture||r.isBatchedMesh&&!1===x.batchingColor&&null!==r.colorTexture||r.isInstancedMesh&&!1===x.instancing?b=!0:r.isInstancedMesh||!0!==x.instancing?r.isSkinnedMesh&&!1===x.skinning?b=!0:r.isSkinnedMesh||!0!==x.skinning?r.isInstancedMesh&&!0===x.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===x.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===x.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===x.instancingMorph&&null!==r.morphTexture||x.envMap!==l||!0===i.fog&&x.fog!==a?b=!0:void 0===x.numClippingPlanes||x.numClippingPlanes===se.numPlanes&&x.numIntersection===se.numIntersection?(x.vertexAlphas!==c||x.vertexTangents!==u||x.morphTargets!==d||x.morphNormals!==h||x.morphColors!==f||x.toneMapping!==p||x.morphTargetsCount!==v)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,x.__version=i.version);let E=x.currentProgram;!0===b&&(E=De(i,t,r));let T=!1,A=!1,C=!1;const P=E.getUniforms(),R=x.uniforms;$.useProgram(E.program)&&(T=!0,A=!0,C=!0);i.id!==w&&(w=i.id,A=!0);if(T||M!==e){P.setValue(ge,"projectionMatrix",e.projectionMatrix),P.setValue(ge,"viewMatrix",e.matrixWorldInverse);const t=P.map.cameraPosition;void 0!==t&&t.setValue(ge,V.setFromMatrixPosition(e.matrixWorld)),q.logarithmicDepthBuffer&&P.setValue(ge,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&P.setValue(ge,"isOrthographic",!0===e.isOrthographicCamera),M!==e&&(M=e,A=!0,C=!0)}if(r.isSkinnedMesh){P.setOptional(ge,r,"bindMatrix"),P.setOptional(ge,r,"bindMatrixInverse");const e=r.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),P.setValue(ge,"boneTexture",e.boneTexture,K))}r.isBatchedMesh&&(P.setOptional(ge,r,"batchingTexture"),P.setValue(ge,"batchingTexture",r._matricesTexture,K),P.setOptional(ge,r,"batchingColorTexture"),null!==r._colorsTexture&&P.setValue(ge,"batchingColorTexture",r._colorsTexture,K));const N=n.morphAttributes;void 0===N.position&&void 0===N.normal&&void 0===N.color||ue.update(r,n,E);(A||x.receiveShadow!==r.receiveShadow)&&(x.receiveShadow=r.receiveShadow,P.setValue(ge,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==t.environment&&(R.envMapIntensity.value=t.environmentIntensity);A&&(P.setValue(ge,"toneMappingExposure",y.toneMappingExposure),x.needsLights&&(I=C,(D=R).ambientLightColor.needsUpdate=I,D.lightProbe.needsUpdate=I,D.directionalLights.needsUpdate=I,D.directionalLightShadows.needsUpdate=I,D.pointLights.needsUpdate=I,D.pointLightShadows.needsUpdate=I,D.spotLights.needsUpdate=I,D.spotLightShadows.needsUpdate=I,D.rectAreaLights.needsUpdate=I,D.hemisphereLights.needsUpdate=I),a&&!0===i.fog&&re.refreshFogUniforms(R,a),re.refreshMaterialUniforms(R,i,k,L,m.state.transmissionRenderTarget[e.id]),Tp.upload(ge,Ie(x),R,K));var D,I;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Tp.upload(ge,Ie(x),R,K),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&P.setValue(ge,"center",r.center);if(P.setValue(ge,"modelViewMatrix",r.modelViewMatrix),P.setValue(ge,"normalMatrix",r.normalMatrix),P.setValue(ge,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const e=i.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];me.update(n,E),me.bind(n,E)}}return E}(e,t,n,i,r);$.setMaterial(i,o);let l=n.index,c=1;if(!0===i.wireframe){if(l=te.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,d=n.attributes.position;let h=u.start*c,f=(u.start+u.count)*c;null!==a&&(h=Math.max(h,a.start*c),f=Math.min(f,(a.start+a.count)*c)),null!==l?(h=Math.max(h,0),f=Math.min(f,l.count)):null!=d&&(h=Math.max(h,0),f=Math.min(f,d.count));const p=f-h;if(p<0||p===1/0)return;let g;pe.setup(r,i,s,n,l);let v=de;if(null!==l&&(g=ee.get(l),v=he,v.setIndex(g)),r.isMesh)!0===i.wireframe?($.setLineWidth(i.wireframeLinewidth*W()),v.setMode(ge.LINES)):v.setMode(ge.TRIANGLES);else if(r.isLine){let e=i.linewidth;void 0===e&&(e=1),$.setLineWidth(e*W()),r.isLineSegments?v.setMode(ge.LINES):r.isLineLoop?v.setMode(ge.LINE_LOOP):v.setMode(ge.LINE_STRIP)}else r.isPoints?v.setMode(ge.POINTS):r.isSprite&&v.setMode(ge.TRIANGLES);if(r.isBatchedMesh)null!==r._multiDrawInstances?v.renderMultiDrawInstances(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount,r._multiDrawInstances):v.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else if(r.isInstancedMesh)v.renderInstances(h,p,r.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(h,p,t)}else v.render(h,p)},this.compile=function(e,t,n=null){null===n&&(n=e),m=oe.get(n),m.init(t),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();const i=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){const a=t[r];Me(a,n,e),i.add(a)}else Me(t,n,e),i.add(t)})),v.pop(),m=null,i},this.compileAsync=function(e,t,n=null){const i=this.compile(e,t,n);return new Promise((t=>{function n(){i.forEach((function(e){Z.get(e).currentProgram.isReady()&&i.delete(e)})),0!==i.size?setTimeout(n,10):t(e)}null!==X.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ee=null;function Te(){Ce.stop()}function Ae(){Ce.start()}const Ce=new Dh;function Pe(e,t,n,i){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||z.intersectsSprite(e)){i&&V.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);const t=ne.update(e),r=e.material;r.visible&&p.push(e,t,r,n,V.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||z.intersectsObject(e))){const t=ne.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),V.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),V.copy(t.boundingSphere.center)),V.applyMatrix4(e.matrixWorld).applyMatrix4(H)),Array.isArray(r)){const i=t.groups;for(let a=0,o=i.length;a<o;a++){const o=i[a],s=r[o.materialIndex];s&&s.visible&&p.push(e,t,s,n,V.z,o)}}else r.visible&&p.push(e,t,r,n,V.z,null)}const r=e.children;for(let e=0,a=r.length;e<a;e++)Pe(r[e],t,n,i)}function Re(e,t,n,i){const r=e.opaque,a=e.transmissive,o=e.transparent;m.setupLightsView(n),!0===F&&se.setGlobalState(y.clippingPlanes,n),i&&$.viewport(E.copy(i)),r.length>0&&ke(r,t,n),a.length>0&&ke(a,t,n),o.length>0&&ke(o,t,n),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Le(e,t,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[i.id]&&(m.state.transmissionRenderTarget[i.id]=new au(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")||X.has("EXT_color_buffer_float")?Yl:Gl,minFilter:jl,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:qc.workingColorSpace}));const a=m.state.transmissionRenderTarget[i.id],o=i.viewport||E;a.setSize(o.z,o.w);const s=y.getRenderTarget();y.setRenderTarget(a),y.getClearColor(C),P=y.getClearAlpha(),P<1&&y.setClearColor(16777215,.5),G?ce.render(n):y.clear();const l=y.toneMapping;y.toneMapping=Ml;const c=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),m.setupLightsView(i),!0===F&&se.setGlobalState(y.clippingPlanes,i),ke(e,n,i),K.updateMultisampleRenderTarget(a),K.updateRenderTargetMipmap(a),!1===X.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let r=0,a=t.length;r<a;r++){const a=t[r],o=a.object,s=a.geometry,l=a.material,c=a.group;if(2===l.side&&o.layers.test(i.layers)){const t=l.side;l.side=tl,l.needsUpdate=!0,Ne(o,n,i,s,l,c),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(K.updateMultisampleRenderTarget(a),K.updateRenderTargetMipmap(a))}y.setRenderTarget(s),y.setClearColor(C,P),void 0!==c&&(i.viewport=c),y.toneMapping=l}function ke(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){const a=e[r],o=a.object,s=a.geometry,l=null===i?a.material:i,c=a.group;o.layers.test(n.layers)&&Ne(o,t,n,s,l,c)}}function Ne(e,t,n,i,r,a){e.onBeforeRender(y,t,n,i,r,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(y,t,n,i,e,a),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=tl,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=el,r.needsUpdate=!0,y.renderBufferDirect(n,t,i,r,e,a),r.side=2):y.renderBufferDirect(n,t,i,r,e,a),e.onAfterRender(y,t,n,i,r,a)}function De(e,t,n){!0!==t.isScene&&(t=j);const i=Z.get(e),r=m.state.lights,a=m.state.shadowsArray,o=r.state.version,s=ie.getParameters(e,r.state,a,t,n),l=ie.getProgramCacheKey(s);let c=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?J:Q).get(e.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",we),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===o)return Oe(e,s),u}else s.uniforms=ie.getUniforms(e),e.onBuild(n,s,y),e.onBeforeCompile(s,y),u=ie.acquireProgram(s,l),c.set(l,u),i.uniforms=s.uniforms;const d=i.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=se.uniform),Oe(e,s),i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=o,i.needsLights&&(d.ambientLightColor.value=r.state.ambient,d.lightProbe.value=r.state.probe,d.directionalLights.value=r.state.directional,d.directionalLightShadows.value=r.state.directionalShadow,d.spotLights.value=r.state.spot,d.spotLightShadows.value=r.state.spotShadow,d.rectAreaLights.value=r.state.rectArea,d.ltc_1.value=r.state.rectAreaLTC1,d.ltc_2.value=r.state.rectAreaLTC2,d.pointLights.value=r.state.point,d.pointLightShadows.value=r.state.pointShadow,d.hemisphereLights.value=r.state.hemi,d.directionalShadowMap.value=r.state.directionalShadowMap,d.directionalShadowMatrix.value=r.state.directionalShadowMatrix,d.spotShadowMap.value=r.state.spotShadowMap,d.spotLightMatrix.value=r.state.spotLightMatrix,d.spotLightMap.value=r.state.spotLightMap,d.pointShadowMap.value=r.state.pointShadowMap,d.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=u,i.uniformsList=null,u}function Ie(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=Tp.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Oe(e,t){const n=Z.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,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}Ce.setAnimationLoop((function(e){Ee&&Ee(e)})),"undefined"!=typeof self&&Ce.setContext(self),this.setAnimationLoop=function(e){Ee=e,xe.setAnimationLoop(e),null===e?Ce.stop():Ce.start()},xe.addEventListener("sessionstart",Te),xe.addEventListener("sessionend",Ae),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===x)return;if(!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=oe.get(e,v.length),m.init(t),v.push(m),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),z.setFromProjectionMatrix(H),B=this.localClippingEnabled,F=se.init(this.clippingPlanes,B),p=ae.get(e,g.length),p.init(),g.push(p),!0===xe.enabled&&!0===xe.isPresenting){const e=y.xr.getDepthSensingMesh();null!==e&&Pe(e,t,-1/0,y.sortObjects)}Pe(e,t,0,y.sortObjects),p.finish(),!0===y.sortObjects&&p.sort(N,D),G=!1===xe.enabled||!1===xe.isPresenting||!1===xe.hasDepthSensing(),G&&ce.addToRenderList(p,e),this.info.render.frame++,!0===F&&se.beginShadows();const n=m.state.shadowsArray;le.render(n,e,t),!0===F&&se.endShadows(),!0===this.info.autoReset&&this.info.reset();const i=p.opaque,r=p.transmissive;if(m.setupLights(),t.isArrayCamera){const n=t.cameras;if(r.length>0)for(let t=0,a=n.length;t<a;t++){Le(i,r,e,n[t])}G&&ce.render(e);for(let t=0,i=n.length;t<i;t++){const i=n[t];Re(p,e,i,i.viewport)}}else r.length>0&&Le(i,r,e,t),G&&ce.render(e),Re(p,e,t);null!==S&&(K.updateMultisampleRenderTarget(S),K.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(y,e,t),pe.resetDefaultState(),w=-1,M=null,v.pop(),v.length>0?(m=v[v.length-1],!0===F&&se.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),p=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){Z.get(e.texture).__webglTexture=t,Z.get(e.depthTexture).__webglTexture=n;const i=Z.get(e);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===X.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=Z.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){S=e,_=t,b=n;let i=!0,r=null,a=!1,o=!1;if(e){const s=Z.get(e);void 0!==s.__useDefaultFramebuffer?($.bindFramebuffer(ge.FRAMEBUFFER,null),i=!1):void 0===s.__webglFramebuffer?K.setupRenderTarget(e):s.__hasExternalTextures&&K.rebindTextures(e,Z.get(e.texture).__webglTexture,Z.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],a=!0):r=e.samples>0&&!1===K.useMultisampledRTT(e)?Z.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,E.copy(e.viewport),T.copy(e.scissor),A=e.scissorTest}else E.copy(I).multiplyScalar(k).floor(),T.copy(O).multiplyScalar(k).floor(),A=U;if($.bindFramebuffer(ge.FRAMEBUFFER,r)&&i&&$.drawBuffers(e,r),$.viewport(E),$.scissor(T),$.setScissorTest(A),a){const i=Z.get(e.texture);ge.framebufferTexture2D(ge.FRAMEBUFFER,ge.COLOR_ATTACHMENT0,ge.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(o){const i=Z.get(e.texture),r=t||0;ge.framebufferTextureLayer(ge.FRAMEBUFFER,ge.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}w=-1},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){$.bindFramebuffer(ge.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!q.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&ge.readPixels(t,n,i,r,fe.convert(s),fe.convert(l),a)}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;$.bindFramebuffer(ge.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,i,r,a,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){$.bindFramebuffer(ge.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!q.textureFormatReadable(s))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r){const e=ge.createBuffer();ge.bindBuffer(ge.PIXEL_PACK_BUFFER,e),ge.bufferData(ge.PIXEL_PACK_BUFFER,a.byteLength,ge.STREAM_READ),ge.readPixels(t,n,i,r,fe.convert(s),fe.convert(l),0),ge.flush();const o=ge.fenceSync(ge.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t,n){return new Promise((function(i,r){setTimeout((function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}}),n)}))}(ge,o,4);try{ge.bindBuffer(ge.PIXEL_PACK_BUFFER,e),ge.getBufferSubData(ge.PIXEL_PACK_BUFFER,0,a)}finally{ge.deleteBuffer(e),ge.deleteSync(o)}return a}}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;$.bindFramebuffer(ge.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,n=0){!0!==e.isTexture&&(console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=null!==t?t.x:0,s=null!==t?t.y:0;K.setTexture2D(e,0),ge.copyTexSubImage2D(ge.TEXTURE_2D,n,0,0,o,s,r,a),$.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,i=null,r=0){let a,o,s,l,c,u;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),i=arguments[0]||null,e=arguments[1],t=arguments[2],r=arguments[3]||0,n=null),null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.min.x,l=n.min.y):(a=e.image.width,o=e.image.height,s=0,l=0),null!==i?(c=i.x,u=i.y):(c=0,u=0);const d=fe.convert(t.format),h=fe.convert(t.type);K.setTexture2D(t,0),ge.pixelStorei(ge.UNPACK_FLIP_Y_WEBGL,t.flipY),ge.pixelStorei(ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ge.pixelStorei(ge.UNPACK_ALIGNMENT,t.unpackAlignment);const f=ge.getParameter(ge.UNPACK_ROW_LENGTH),p=ge.getParameter(ge.UNPACK_IMAGE_HEIGHT),m=ge.getParameter(ge.UNPACK_SKIP_PIXELS),g=ge.getParameter(ge.UNPACK_SKIP_ROWS),v=ge.getParameter(ge.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[r]:e.image;ge.pixelStorei(ge.UNPACK_ROW_LENGTH,y.width),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,y.height),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,s),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,l),e.isDataTexture?ge.texSubImage2D(ge.TEXTURE_2D,r,c,u,a,o,d,h,y.data):e.isCompressedTexture?ge.compressedTexSubImage2D(ge.TEXTURE_2D,r,c,u,y.width,y.height,d,y.data):ge.texSubImage2D(ge.TEXTURE_2D,r,c,u,d,h,y),ge.pixelStorei(ge.UNPACK_ROW_LENGTH,f),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,p),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,m),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,g),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,v),0===r&&t.generateMipmaps&&ge.generateMipmap(ge.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,i=null,r=0){let a,o,s,l,c,u,d,h,f;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,i=arguments[1]||null,e=arguments[2],t=arguments[3],r=arguments[4]||0);const p=e.isCompressedTexture?e.mipmaps[r]:e.image;null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.max.z-n.min.z,l=n.min.x,c=n.min.y,u=n.min.z):(a=p.width,o=p.height,s=p.depth,l=0,c=0,u=0),null!==i?(d=i.x,h=i.y,f=i.z):(d=0,h=0,f=0);const m=fe.convert(t.format),g=fe.convert(t.type);let v;if(t.isData3DTexture)K.setTexture3D(t,0),v=ge.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");K.setTexture2DArray(t,0),v=ge.TEXTURE_2D_ARRAY}ge.pixelStorei(ge.UNPACK_FLIP_Y_WEBGL,t.flipY),ge.pixelStorei(ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ge.pixelStorei(ge.UNPACK_ALIGNMENT,t.unpackAlignment);const y=ge.getParameter(ge.UNPACK_ROW_LENGTH),x=ge.getParameter(ge.UNPACK_IMAGE_HEIGHT),_=ge.getParameter(ge.UNPACK_SKIP_PIXELS),b=ge.getParameter(ge.UNPACK_SKIP_ROWS),S=ge.getParameter(ge.UNPACK_SKIP_IMAGES);ge.pixelStorei(ge.UNPACK_ROW_LENGTH,p.width),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,p.height),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,l),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,c),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,u),e.isDataTexture||e.isData3DTexture?ge.texSubImage3D(v,r,d,h,f,a,o,s,m,g,p.data):t.isCompressedArrayTexture?ge.compressedTexSubImage3D(v,r,d,h,f,a,o,s,m,p.data):ge.texSubImage3D(v,r,d,h,f,a,o,s,m,g,p),ge.pixelStorei(ge.UNPACK_ROW_LENGTH,y),ge.pixelStorei(ge.UNPACK_IMAGE_HEIGHT,x),ge.pixelStorei(ge.UNPACK_SKIP_PIXELS,_),ge.pixelStorei(ge.UNPACK_SKIP_ROWS,b),ge.pixelStorei(ge.UNPACK_SKIP_IMAGES,S),0===r&&t.generateMipmaps&&ge.generateMipmap(v),$.unbindTexture()},this.initRenderTarget=function(e){void 0===Z.get(e).__webglFramebuffer&&K.setupRenderTarget(e)},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),$.unbindTexture()},this.resetState=function(){_=0,b=0,S=null,$.reset(),pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mc}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===lc?"display-p3":"srgb",t.unpackColorSpace=qc.workingColorSpace===cc?"display-p3":"srgb"}}class wm extends hd{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Yu,this.environmentIntensity=1,this.environmentRotation=new Yu,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,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}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.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Mm extends Ld{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Cd(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 Em=new cu,Tm=new cu,Am=new Fu,Cm=new zu,Pm=new Ru,Rm=new cu,Lm=new cu;class km extends hd{constructor(e=new Xd,t=new Mm){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,i=t.count;e<i;e++)Em.fromBufferAttribute(t,e-1),Tm.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Em.distanceTo(Tm);e.setAttribute("lineDistance",new zd(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Pm.copy(n.boundingSphere),Pm.applyMatrix4(i),Pm.radius+=r,!1===e.ray.intersectsSphere(Pm))return;Am.copy(i).invert(),Cm.copy(e.ray).applyMatrix4(Am);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=c.getX(r),i=c.getX(r+1),a=Nm(this,e,Cm,s,n,i);a&&t.push(a)}if(this.isLineLoop){const r=c.getX(i-1),a=c.getX(n),o=Nm(this,e,Cm,s,r,a);o&&t.push(o)}}else{const n=Math.max(0,a.start),i=Math.min(u.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=l){const n=Nm(this,e,Cm,s,r,r+1);n&&t.push(n)}if(this.isLineLoop){const r=Nm(this,e,Cm,s,i-1,n);r&&t.push(r)}}}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 Nm(e,t,n,i,r,a){const o=e.geometry.attributes.position;Em.fromBufferAttribute(o,r),Tm.fromBufferAttribute(o,a);if(n.distanceSqToSegment(Em,Tm,Rm,Lm)>i)return;Rm.applyMatrix4(e.matrixWorld);const s=t.ray.origin.distanceTo(Rm);return s<t.near||s>t.far?void 0:{distance:s,point:Lm.clone().applyMatrix4(e.matrixWorld),index:r,face:null,faceIndex:null,object:e}}const Dm=new cu,Im=new cu;class Om extends km{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,i=t.count;e<i;e+=2)Dm.fromBufferAttribute(t,e),Im.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Dm.distanceTo(Im);e.setAttribute("lineDistance",new zd(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Um extends Xd{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],u=[],d=[],h=[];let f=0;const p=[],m=n/2;let g=0;function v(n){const r=f,a=new Ic,p=new cu;let v=0;const y=!0===n?e:t,x=!0===n?1:-1;for(let e=1;e<=i;e++)u.push(0,m*x,0),d.push(0,x,0),h.push(.5,.5),f++;const _=f;for(let e=0;e<=i;e++){const t=e/i*s+o,n=Math.cos(t),r=Math.sin(t);p.x=y*r,p.y=m*x,p.z=y*n,u.push(p.x,p.y,p.z),d.push(0,x,0),a.x=.5*n+.5,a.y=.5*r*x+.5,h.push(a.x,a.y),f++}for(let e=0;e<i;e++){const t=r+e,i=_+e;!0===n?c.push(i,i+1,t):c.push(i+1,i,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new cu,v=new cu;let y=0;const x=(t-e)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=i;e++){const t=e/i,r=t*s+o,l=Math.sin(r),p=Math.cos(r);v.x=y*l,v.y=-g*n+m,v.z=y*p,u.push(v.x,v.y,v.z),a.set(l,x,p).normalize(),d.push(a.x,a.y,a.z),h.push(t,1-g),c.push(f++)}p.push(c)}for(let e=0;e<i;e++)for(let t=0;t<r;t++){const n=p[t][e],i=p[t+1][e],r=p[t+1][e+1],a=p[t][e+1];c.push(n,i,a),c.push(i,r,a),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new zd(u,3)),this.setAttribute("normal",new zd(d,3)),this.setAttribute("uv",new zd(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Um(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class zm extends Xd{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],a=[];function o(e,t,n,i){const r=i+1,a=[];for(let i=0;i<=r;i++){a[i]=[];const o=e.clone().lerp(n,i/r),s=t.clone().lerp(n,i/r),l=r-i;for(let e=0;e<=l;e++)a[i][e]=0===e&&i===r?o:o.clone().lerp(s,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){const n=Math.floor(t/2);t%2==0?(s(a[e][n+1]),s(a[e+1][n]),s(a[e][n])):(s(a[e][n+1]),s(a[e+1][n+1]),s(a[e+1][n]))}}function s(e){r.push(e.x,e.y,e.z)}function l(t,n){const i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function c(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new cu,i=new cu,r=new cu;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],i),l(t[a+2],r),o(n,i,r,e)}(i),function(e){const t=new cu;for(let n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){const e=new cu;for(let n=0;n<r.length;n+=3){e.x=r[n+0],e.y=r[n+1],e.z=r[n+2];const i=u(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(i,1-o)}var t;(function(){const e=new cu,t=new cu,n=new cu,i=new cu,o=new Ic,s=new Ic,l=new Ic;for(let d=0,h=0;d<r.length;d+=9,h+=6){e.set(r[d+0],r[d+1],r[d+2]),t.set(r[d+3],r[d+4],r[d+5]),n.set(r[d+6],r[d+7],r[d+8]),o.set(a[h+0],a[h+1]),s.set(a[h+2],a[h+3]),l.set(a[h+4],a[h+5]),i.copy(e).add(t).add(n).divideScalar(3);const f=u(i);c(o,h+0,e,f),c(s,h+2,t,f),c(l,h+4,n,f)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),o=Math.min(t,n,i);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new zd(r,3)),this.setAttribute("normal",new zd(r.slice(),3)),this.setAttribute("uv",new zd(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zm(e.vertices,e.indices,e.radius,e.details)}}class Fm extends zm{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Fm(e.radius,e.detail)}}class Bm extends Xd{constructor(e=.5,t=1,n=32,i=1,r=0,a=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},n=Math.max(3,n);const o=[],s=[],l=[],c=[];let u=e;const d=(t-e)/(i=Math.max(1,i)),h=new cu,f=new Ic;for(let e=0;e<=i;e++){for(let e=0;e<=n;e++){const i=r+e/n*a;h.x=u*Math.cos(i),h.y=u*Math.sin(i),s.push(h.x,h.y,h.z),l.push(0,0,1),f.x=(h.x/t+1)/2,f.y=(h.y/t+1)/2,c.push(f.x,f.y)}u+=d}for(let e=0;e<i;e++){const t=e*(n+1);for(let e=0;e<n;e++){const i=e+t,r=i,a=i+n+1,s=i+n+2,l=i+1;o.push(r,a,l),o.push(a,s,l)}}this.setIndex(o),this.setAttribute("position",new zd(s,3)),this.setAttribute("normal",new zd(l,3)),this.setAttribute("uv",new zd(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bm(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Hm extends Xd{constructor(e=1,t=32,n=16,i=0,r=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let l=0;const c=[],u=new cu,d=new cu,h=[],f=[],p=[],m=[];for(let h=0;h<=n;h++){const g=[],v=h/n;let y=0;0===h&&0===a?y=.5/t:h===n&&s===Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;u.x=-e*Math.cos(i+s*r)*Math.sin(a+v*o),u.y=e*Math.cos(a+v*o),u.z=e*Math.sin(i+s*r)*Math.sin(a+v*o),f.push(u.x,u.y,u.z),d.copy(u).normalize(),p.push(d.x,d.y,d.z),m.push(s+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let i=0;i<t;i++){const t=c[e][i+1],r=c[e][i],o=c[e+1][i],l=c[e+1][i+1];(0!==e||a>0)&&h.push(t,r,l),(e!==n-1||s<Math.PI)&&h.push(r,o,l)}this.setIndex(h),this.setAttribute("position",new zd(f,3)),this.setAttribute("normal",new zd(p,3)),this.setAttribute("uv",new zd(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hm(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Vm extends Xd{constructor(e=1,t=.4,n=12,i=48,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const a=[],o=[],s=[],l=[],c=new cu,u=new cu,d=new cu;for(let a=0;a<=n;a++)for(let h=0;h<=i;h++){const f=h/i*r,p=a/n*Math.PI*2;u.x=(e+t*Math.cos(p))*Math.cos(f),u.y=(e+t*Math.cos(p))*Math.sin(f),u.z=t*Math.sin(p),o.push(u.x,u.y,u.z),c.x=e*Math.cos(f),c.y=e*Math.sin(f),d.subVectors(u,c).normalize(),s.push(d.x,d.y,d.z),l.push(h/i),l.push(a/n)}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*e+t-1,r=(i+1)*(e-1)+t-1,o=(i+1)*(e-1)+t,s=(i+1)*e+t;a.push(n,r,s),a.push(r,o,s)}this.setIndex(a),this.setAttribute("position",new zd(o,3)),this.setAttribute("normal",new zd(s,3)),this.setAttribute("uv",new zd(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vm(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}const jm=new Fu;class Gm{constructor(e,t,n=0,i=1/0){this.ray=new zu(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Zu,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)}setFromXRController(e){return jm.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(jm),this}intersectObject(e,t=!0,n=[]){return Xm(e,this,n,t),n.sort(Wm),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)Xm(e[i],this,n,t);return n.sort(Wm),n}}function Wm(e,t){return e.distance-t.distance}function Xm(e,t,n,i){let r=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(r=!1)}if(!0===r&&!0===i){const i=e.children;for(let e=0,r=i.length;e<r;e++)Xm(i[e],t,n,!0)}}const qm=new cu,$m=new cu;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zs}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zs);const Ym=new Fu,Zm=new Fu,Km={x:"XYZ",y:"YXZ",z:"ZXY"};function Qm(e,t,n,i,r,a){Ym.copy(n),null!=r&&Ym.premultiply(Zm.copy(r).invert());const o=new cu,s=new lu,l=new cu;let c;Ym.decompose(o,s,l),cg(o,i.initialTargetPosition,a.translate??!0);const u=a.rotate??!0;if(!1===u)s.copy(i.initialTargetQuaternion),c=i.initialTargetRotation.clone();else if(Array.isArray(u)||!0===u||"string"!=typeof u&&!Array.isArray(u)&&!0===u.x&&!0===u.y&&!0===u.z)c=(new Yu).setFromQuaternion(s,i.initialTargetRotation.order);else if("string"==typeof u){const e=Km[u];c=(new Yu).setFromQuaternion(s,e);for(const t of e){const e=t.toLowerCase();e!==u&&(c[e]=0)}c.order=i.initialTargetRotation.order,s.setFromEuler(c)}else c=function(e,t,n){let i="",r="";for(const e of t.order)!1===n[e.toLowerCase()]?r+=e:i+=e;const a=i+r,o=(new Yu).setFromQuaternion(e,a);for(const e of a){const i=e.toLowerCase();o[i]=ug(i,o[i],t[i],n)}return e.setFromEuler(o),o}(s,i.initialTargetRotation,u);return"object"==typeof a.scale&&a.scale.uniform||cg(l,i.initialTargetScale,a.scale??!0),{pointerAmount:t,position:o,quaternion:s,rotation:c,scale:l,time:e}}const Jm=new Rh,eg=new cu,tg=new cu,ng=new cu,ig=new lu;function rg(e,t,n){return Jm.normal.copy(e),Jm.constant=0,function(e,t){if(0===t.x)return void e.set(1,0,0);if(0===t.y)return void e.set(0,1,0);if(0===t.z)return void e.set(0,0,1);e.set(-t.y,t.x,0)}(eg,Jm.normal),tg.copy(eg),tg.applyQuaternion(ig.copy(t).invert().premultiply(n)),Jm.projectPoint(eg,eg).normalize(),Jm.projectPoint(tg,tg).normalize(),(ng.crossVectors(eg,Jm.normal).dot(tg)<0?1:-1)*eg.angleTo(tg)}const ag=new cu,og=new Rh,sg=new cu,lg=new cu;function cg(e,t,n){if(Array.isArray(n))switch(n.length){case 0:return void e.copy(t);case 1:return e.sub(t),Tg(e,n[0]instanceof cu?n[0]:ag.fromArray(n[0])),void e.add(t);case 2:return ag.crossVectors(n[0]instanceof cu?n[0]:sg.fromArray(n[0]),n[1]instanceof cu?n[1]:lg.fromArray(n[1])),og.setFromNormalAndCoplanarPoint(ag,t),void og.projectPoint(e,e)}else e.x=ug("x",e.x,t.x,n),e.y=ug("y",e.y,t.y,n),e.z=ug("z",e.z,t.z,n)}function ug(e,t,n,i){if("boolean"==typeof i)return i?t:n;if("string"==typeof i)return i===e?t:n;const r=i[e];return!1===r?n:Array.isArray(r)?function(e,t,n){return Math.max(t,Math.min(n,e))}(t,...r):t}function dg(e=!0,t,n,i,r,a){if(e){switch(t.length){case 0:case 3:return;case 1:return void function(e,t,n,i,r){const a=null==r?0:1-Math.abs(t.dot(r));if(null==r||a<.001)return void Eg(i,e,t);Mg.subVectors(n,e);const o=t.dot(r),s=t.dot(Mg),l=r.dot(Mg),c=1-o*o,u=(s-o*l)/c;if((o*s-l)/c<0)return void Eg(i,e,t);Mg.copy(i),i.copy(e).addScaledVector(t,u)}(n,...t,i,r,a);case 2:return void function(e,t,n,i,r,a){wg.crossVectors(e,t).normalize(),Sg.setFromNormalAndCoplanarPoint(wg,n);const o=null==a?0:Math.abs(wg.dot(a));if(null==a||o<.01)return void Sg.projectPoint(r,r);const s=Sg.distanceToPoint(i),l=-s/a.dot(Sg.normal);if(l<0)return void Sg.projectPoint(r,r);Mg.copy(r),r.copy(i).addScaledVector(a,l)}(...t,n,i,r,a)}throw new Error(`space cannot be ${t.length}D but received (${t.map((e=>e.toArray().join("/"))).join("; ")})`)}}const hg={x:new cu(1,0,0),y:new cu(0,1,0),z:new cu(0,0,1)};function fg(e,t,n,i,r){if(!1!==i){if(!0===i)return e[0]=hg.x,e[1]=hg.y,void(e[2]=hg.z);if("string"!=typeof i)if(Array.isArray(i))for(const a of i)xg(e,t,n,a,r);else!1!==i.x&&xg(e,t,n,"x",r),!1!==i.y&&xg(e,t,n,"y",r),!1!==i.z&&xg(e,t,n,"z",r);else xg(e,t,n,i,r)}}const pg=new lu,mg=new Yu,gg=new cu,vg=new cu,yg=new cu;function xg(e,t,n,i,r){if(Array.isArray(i)?gg.set(...i):i instanceof cu?gg.copy(i):gg.copy(hg[i]),"translate"===r)return gg.applyQuaternion(t),void bg(e,gg);if("scale"===r)return Array.isArray(i)?pg.identity():pg.setFromEuler(n),pg.premultiply(t),gg.applyQuaternion(pg),void bg(e,gg);if(Array.isArray(i))mg.set(0,0,0);else{mg.copy(n);for(let e=2;e>=0;e--){const t=n.order[e].toLowerCase();if(mg[t]=0,t===i)break}}pg.setFromEuler(mg).premultiply(t),gg.normalize(),vg.set(0,1,0),gg.dot(vg)>.99&&vg.set(0,0,1),yg.crossVectors(gg,vg).normalize(),vg.copy(yg),yg.applyQuaternion(pg),bg(e,yg),yg.crossVectors(gg,vg).normalize(),yg.applyQuaternion(pg),bg(e,yg)}const _g=new cu;function bg(e,t){3!==e.length&&(0!==e.length?1!==e.length?(_g.crossVectors(e[0],e[1]),Math.abs(_g.dot(t))<.001||e.push(t.clone())):Math.abs(e[0].dot(t))<.999&&e.push(t.clone()):e.push(t.clone()))}const Sg=new Rh,wg=new cu,Mg=new cu;function Eg(e,t,n){e.sub(t),Tg(e,n),e.add(t)}function Tg(e,t){const n=e.dot(t);e.copy(t).multiplyScalar(n)}const Ag=new Fu,Cg=new Fu,Pg=new cu,Rg=new cu,Lg=new lu,kg=new cu(1,1,1),Ng=[];const Dg=new cu,Ig=new cu,Og=new cu,Ug=new cu,zg=new cu,Fg=new cu,Bg=new cu,Hg=new Fu,Vg=new Fu,jg=new Fu,Gg=new lu,Wg=new lu,Xg=[];const qg=new cu,$g=new cu,Yg=new cu,Zg=new cu,Kg=new cu,Qg=new lu,Jg=new lu,ev=new Fu,tv=new cu,nv=[];class iv{t1;t2;_position;_quaternion;_rotation;_scale;constructor(e,t){this.t1=e,this.t2=t}get time(){return this.t1.time-this.t2.time}get position(){return this._position??=this.t1.position.clone().sub(this.t2.position)}get quaternion(){return this._quaternion??=this.t2.quaternion.clone().invert().premultiply(this.t1.quaternion)}get rotation(){return this._rotation??=(new Yu).setFromQuaternion(this.quaternion)}get scale(){return this._scale??=this.t1.scale.clone().sub(this.t2.scale)}}class rv{cancel;previous;memo;event;initial;current;first;last;_delta;_offset;constructor(e){this.cancel=e}start(e,t){this.event=e,this.previous=void 0,this.current=t,this.initial=t,this.first=!0,this.last=!1,this.memo=void 0,this._delta=void 0,this._offset=void 0}update(e,t){this.event=e,this.previous=this.current,this.current=t,this.first=!1,this.last=!1,this._delta=void 0,this._offset=void 0}end(e){this.event=e,this.first=!1,this.last=!0,this._delta=void 0,this._offset=void 0}get delta(){if(null!=this.previous)return this._delta??=new iv(this.current,this.previous)}get offset(){return this._offset??=new iv(this.current,this.initial)}}function av(e,t){if("sphere"===e.details.type)return!1;if("lines"===e.details.type){const{line:n}=e.details;return t.copy(n.end).sub(n.start).normalize(),!0}return"screen-ray"===e.details.type?(t.copy(e.details.direction),!0):(t.set(0,0,-1).applyQuaternion(e.pointerQuaternion),!0)}const ov=new cu;class sv{target;getOptions;outputState;latestMoveEvent;inputState=new Map;capturedObjects=new Map;initialTargetPosition=new cu;initialTargetQuaternion=new lu;initialTargetRotation=new Yu;initialTargetScale=new cu;initialTargetParentWorldMatrix;prevTwoPointerDeltaRotation;prevTranslateAsDeltaRotation;prevAngle;handlers={onPointerDown:this.onPointerDown.bind(this),onPointerMove:this.onPointerMove.bind(this),onPointerUp:this.onPointerUp.bind(this)};constructor(e,t=()=>({})){this.target=e,this.getOptions=t,this.outputState=new rv(this.cancel.bind(this))}firstOnPointer(e){const t=this.getTarget();if(null==t)return;const n=av(e,ov)?ov.clone():void 0;e.intersection.details.type,this.inputState.set(e.pointerId,{pointerWorldDirection:n,pointerWorldPoint:e.point,pointerWorldOrigin:e.pointerPosition,pointerWorldQuaternion:e.pointerQuaternion,initialPointerWorldPoint:e.point.clone(),initialPointerWorldDirection:n?.clone(),initialPointerWorldQuaternion:e.pointerQuaternion.clone(),prevPointerWorldQuaternion:e.pointerQuaternion}),this.save(),1===this.inputState.size&&this.outputState.start(e,{pointerAmount:1,time:e.timeStamp,position:this.initialTargetPosition.clone(),quaternion:this.initialTargetQuaternion.clone(),rotation:this.initialTargetRotation.clone(),scale:this.initialTargetScale.clone()}),this.outputState.memo=this.apply(t)}onPointerDown(e){this.stopPropagation(e),this.capturePointer(e.pointerId,e.object)&&this.firstOnPointer(e)}onPointerMove(e){if(!this.capturedObjects.has(e.pointerId))return;this.stopPropagation(e);const t=this.inputState.get(e.pointerId);null!=t?(this.latestMoveEvent=e,t.pointerWorldPoint=e.point,t.prevPointerWorldQuaternion=t.pointerWorldQuaternion,t.pointerWorldQuaternion=e.pointerQuaternion,t.pointerWorldOrigin=e.pointerPosition,null!=t.pointerWorldDirection&&av(e,t.pointerWorldDirection)):this.firstOnPointer(e)}cancel(){if(0===this.capturedObjects.size)return;for(const[e,t]of this.capturedObjects)t.releasePointerCapture(e);this.capturedObjects.clear(),this.inputState.clear(),this.outputState.end(void 0);const e=this.getTarget();null!=e&&this.apply(e)}onPointerUp(e){this.capturedObjects.has(e.pointerId)&&(this.stopPropagation(e),this.releasePointer(e.pointerId,e.object,e))}update(e){const t=this.getTarget();if(null==t||0===this.inputState.size||null==this.latestMoveEvent&&!1===(this.getOptions().alwaysUpdate??!1))return;const n=this.getOptions();let i;if("as-rotate"===n.translate||"as-rotate-and-scale"===n.translate||"as-scale"===n.translate){n.translate,this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0;const[r]=this.inputState.values(),a=t.matrixWorld,o=t.parent?.matrixWorld;i=function(e,t,n,i,r,a){if(null==r?Qg.identity():r.decompose(qg,Qg,$g),nv.length=0,"as-scale"===a.translate&&fg(nv,Qg,n.initialTargetRotation,a.scale??!0,"scale"),"as-scale"!=a.translate&&fg(nv,Qg,n.initialTargetRotation,a.rotate??!0,"rotate"),ev.makeTranslation(n.initialTargetPosition),null!=n.initialTargetParentWorldMatrix&&ev.premultiply(n.initialTargetParentWorldMatrix),Zg.setFromMatrixPosition(ev),dg(a.projectRays,nv,t.initialPointerWorldPoint,t.pointerWorldOrigin,Zg,void 0),Zg.negate().add(t.initialPointerWorldPoint),Kg.setFromMatrixPosition(i),dg(a.projectRays,nv,t.initialPointerWorldPoint,t.pointerWorldOrigin,Kg,void 0),dg(a.projectRays,nv,t.initialPointerWorldPoint,t.pointerWorldOrigin,$g.copy(t.pointerWorldPoint),t.pointerWorldDirection),Kg.negate().add($g),"as-scale"===a.translate?Qg.copy(n.initialTargetQuaternion):(qg.copy(Zg),null!=n.prevTranslateAsDeltaRotation&&qg.applyQuaternion(n.prevTranslateAsDeltaRotation),qg.normalize(),$g.copy(Kg).normalize(),Qg.setFromUnitVectors(qg,$g),null==n.prevTranslateAsDeltaRotation?n.prevTranslateAsDeltaRotation=new lu:Qg.multiply(n.prevTranslateAsDeltaRotation),n.prevTranslateAsDeltaRotation.copy(Qg),null!=n.initialTargetParentWorldMatrix&&(Jg.setFromRotationMatrix(n.initialTargetParentWorldMatrix),Qg.multiply(Jg.normalize()),Qg.premultiply(Jg.invert())),Qg.multiply(n.initialTargetQuaternion)),"as-rotate"===a.translate)tv.set(1,1,1);else if("object"==typeof a.scale&&a.scale.uniform)tv.setScalar(Kg.length()/Zg.length());else if("as-rotate-and-scale"===a.translate){ev.compose(n.initialTargetPosition,n.initialTargetQuaternion,n.initialTargetScale),null!=n.initialTargetParentWorldMatrix&&ev.premultiply(n.initialTargetParentWorldMatrix),ev.decompose($g,Jg,Yg),qg.copy(Zg).applyQuaternion(Jg.invert()).divide(Yg),qg.x=Math.abs(qg.x),qg.y=Math.abs(qg.y),qg.z=Math.abs(qg.z);const e=Math.max(...qg.toArray());qg.divideScalar(e),tv.set(1,1,1),tv.addScaledVector(qg,Kg.length()/Zg.length()-1)}else null!=n.initialTargetParentWorldMatrix?(n.initialTargetParentWorldMatrix.decompose(qg,Jg,$g),Jg.multiply(n.initialTargetQuaternion)):Jg.copy(n.initialTargetQuaternion),qg.copy(Zg).applyQuaternion(Jg.invert()),null!=r?(r.decompose($g,Jg,Yg),Jg.multiply(n.initialTargetQuaternion)):Jg.copy(n.initialTargetQuaternion),$g.copy(Kg).applyQuaternion(Jg.invert()),tv.x=Math.abs(qg.x)<.001?1:Math.abs($g.x/qg.x),tv.y=Math.abs(qg.y)<.001?1:Math.abs($g.y/qg.y),tv.z=Math.abs(qg.z)<.001?1:Math.abs($g.z/qg.z);return tv.multiply(n.initialTargetScale),ev.compose(n.initialTargetPosition,Qg,tv),Qm(e,1,ev,n,void 0,a)}(e,r,this,a,o,n)}else if(1===this.inputState.size){this.prevTwoPointerDeltaRotation=void 0,this.prevAngle=void 0,this.prevTranslateAsDeltaRotation=void 0;const[r]=this.inputState.values();i=function(e,t,n,i,r){return null==i?Lg.identity():i.decompose(Pg,Lg,Rg),Ng.length=0,fg(Ng,Lg,n.initialTargetRotation,r.translate??!0,"translate"),Cg.makeRotationFromQuaternion(Lg.copy(t.initialPointerWorldQuaternion).invert()).multiply(Ag.makeTranslation(Pg.copy(t.initialPointerWorldPoint).negate())),null!=n.initialTargetParentWorldMatrix&&Cg.multiply(n.initialTargetParentWorldMatrix),dg(r.projectRays,Ng,t.initialPointerWorldPoint,t.pointerWorldOrigin,Pg.copy(t.pointerWorldPoint),t.pointerWorldDirection),Lg.copy(t.pointerWorldQuaternion),!1===(r.rotate??!0)&&Lg.copy(t.initialPointerWorldQuaternion),Ag.compose(Pg,Lg,kg).multiply(Cg).multiply(Cg.compose(n.initialTargetPosition,n.initialTargetQuaternion,n.initialTargetScale)),Qm(e,1,Ag,n,i,r)}(e,r,this,t.parent?.matrixWorld,n)}else{this.prevTranslateAsDeltaRotation=void 0;const[r,a]=this.inputState.values();i=function(e,t,n,i,r,a){null==r?Gg.identity():r.decompose(Og,Gg,Ug),Xg.length=0,fg(Xg,Gg,i.initialTargetRotation,a.translate??!0,"translate"),fg(Xg,Gg,i.initialTargetRotation,a.rotate??!0,"rotate"),fg(Xg,Gg,i.initialTargetRotation,a.scale??!0,"scale"),dg(a.projectRays,Xg,t.initialPointerWorldPoint,t.pointerWorldOrigin,Og.copy(t.pointerWorldPoint),t.pointerWorldDirection),dg(a.projectRays,Xg,n.initialPointerWorldPoint,n.pointerWorldOrigin,Ug.copy(n.pointerWorldPoint),n.pointerWorldDirection),Dg.copy(n.initialPointerWorldPoint).sub(t.initialPointerWorldPoint),Ig.copy(Ug).sub(Og),Og.copy(Dg),null!=i.prevTwoPointerDeltaRotation&&Og.applyQuaternion(i.prevTwoPointerDeltaRotation),Og.normalize(),Ug.copy(Ig).normalize(),Gg.setFromUnitVectors(Og,Ug),null==i.prevTwoPointerDeltaRotation?i.prevTwoPointerDeltaRotation=new lu:Gg.multiply(i.prevTwoPointerDeltaRotation),i.prevTwoPointerDeltaRotation.copy(Gg);const o=.5*(rg(Ug,t.prevPointerWorldQuaternion,t.pointerWorldQuaternion)+rg(Ug,n.prevPointerWorldQuaternion,n.pointerWorldQuaternion))+(i.prevAngle??0);if(i.prevAngle=o,Gg.premultiply(Wg.setFromAxisAngle(Ug,o)),jg.compose(i.initialTargetPosition,i.initialTargetQuaternion,i.initialTargetScale),null!=i.initialTargetParentWorldMatrix&&jg.premultiply(i.initialTargetParentWorldMatrix),"object"==typeof a.scale&&a.scale.uniform)Bg.setScalar(Ig.length()/Dg.length());else{jg.decompose(zg,Wg,Fg),Og.copy(Dg).applyQuaternion(Wg.invert()).divide(Fg),Og.x=Math.abs(Og.x),Og.y=Math.abs(Og.y),Og.z=Math.abs(Og.z);const e=Math.max(...Og.toArray());Og.divideScalar(e),Bg.set(1,1,1),Bg.addScaledVector(Og,Ig.length()/Dg.length()-1)}return Hg.makeTranslation(Og.copy(Ig).multiplyScalar(.5).add(t.pointerWorldPoint)).multiply(Vg.makeRotationFromQuaternion(Gg)).multiply(Vg.makeRotationFromQuaternion(Wg.invert())).multiply(Vg.makeScale(Bg.x,Bg.y,Bg.z)).multiply(Vg.makeRotationFromQuaternion(Wg.invert())).multiply(Vg.makeTranslation(Og.copy(Dg).multiplyScalar(.5).add(t.initialPointerWorldPoint).negate())).multiply(jg),Qm(e,2,Hg,i,r,a)}(e,r,a,this,t.parent?.matrixWorld,n)}this.outputState.update(this.latestMoveEvent,i),this.outputState.memo=this.apply(t),this.latestMoveEvent=void 0}getTarget(){return this.target instanceof hd?this.target:this.target?.current}capturePointer(e,t){if(this.capturedObjects.has(e))return!1;const{multitouch:n,translate:i}=this.getOptions();return(!1!==(n??!0)&&"string"!=typeof i||1!==this.capturedObjects.size)&&(this.capturedObjects.set(e,t),t.setPointerCapture(e),!0)}releasePointer(e,t,n){const i=this.getTarget();null!=i&&this.capturedObjects.delete(e)&&(this.inputState.delete(e),t.releasePointerCapture(e),this.inputState.size>0?this.save():(this.outputState.end(n),this.apply(i)))}stopPropagation(e){null!=e&&(this.getOptions()?.stopPropagation??1)&&e.stopPropagation()}apply(e){return(this.getOptions().apply??cv)(this.outputState,e)}getState(){return 0===this.inputState.size?void 0:this.outputState}save(){const e=this.getTarget();if(null!=e){e.updateWorldMatrix(!0,!1),this.prevAngle=void 0,this.prevTwoPointerDeltaRotation=void 0,this.prevTranslateAsDeltaRotation=void 0,this.initialTargetParentWorldMatrix=e.parent?.matrixWorld.clone(),e.matrixAutoUpdate?(this.initialTargetPosition.copy(e.position),this.initialTargetQuaternion.copy(e.quaternion),this.initialTargetRotation.copy(e.rotation),this.initialTargetScale.copy(e.scale)):(e.matrix.decompose(this.initialTargetPosition,this.initialTargetQuaternion,this.initialTargetScale),this.initialTargetRotation.setFromQuaternion(this.initialTargetQuaternion,e.rotation.order));for(const e of this.inputState.values())null!=e.pointerWorldDirection&&e.initialPointerWorldDirection?.copy(e.pointerWorldDirection),e.initialPointerWorldPoint.copy(e.pointerWorldPoint),e.initialPointerWorldQuaternion.copy(e.pointerWorldQuaternion)}}bind(e){const{onPointerDown:t,onPointerMove:n,onPointerUp:i}=this.handlers;return e.addEventListener("pointerdown",t),e.addEventListener("pointermove",n),e.addEventListener("pointerup",i),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("pointermove",n),e.removeEventListener("pointerup",i),this.cancel()}}capture(e,t){return this.capturePointer(e,t)?()=>this.releasePointer(e,t,void 0):lv}}function lv(){}function cv(e,t){t.position.copy(e.current.position),t.rotation.order=e.current.rotation.order,t.quaternion.copy(e.current.quaternion),t.scale.copy(e.current.scale)}class uv{target;getOptions;handles=[];hoveredTagMap=new Map;hoverSubscriptions=[];applySubscriptions=[];space;constructor(e,t){this.target=e,this.getOptions=t}getSpace(){return this.space??"world"}getTarget(){return this.target instanceof hd?this.target:this.target.current}getHandleOptions(e,t){const n=this.getOptions?.(),i=t?.();return{...n,...i,apply:(t,r)=>(this.onApply(e,t,r),(i?.apply??n?.apply??cv)?.(t,r))}}registerHandle(e,t,n){const i={object:t,store:e,tag:n};this.handles.push(i);const r=e.bind(t),a=this.onPointerEnter.bind(this,n),o=this.onPointerLeave.bind(this);return t.addEventListener("pointerenter",a),t.addEventListener("pointerleave",o),()=>{const t=this.handles.indexOf(i);-1!=t&&this.handles.splice(t,1),r(),e.cancel()}}subscribeHover(e){return this.hoverSubscriptions.push(e),e(Array.from(this.hoveredTagMap.values())),()=>{const t=this.hoverSubscriptions.indexOf(e);-1!==t&&this.hoverSubscriptions.splice(t,1)}}subscribeApply(e){return this.applySubscriptions.push(e),()=>{const t=this.applySubscriptions.indexOf(e);-1!==t&&this.applySubscriptions.splice(t,1)}}update(e){for(const{store:t}of this.handles)t.update(e)}onPointerEnter(e,t){this.hoveredTagMap.set(t.pointerId,e),this.updateHover()}onPointerLeave(e){this.hoveredTagMap.delete(e.pointerId),this.updateHover()}updateHover(){const e=Array.from(this.hoveredTagMap.values());for(const t of this.hoverSubscriptions)t(e)}onApply(e,t,n){for(const i of this.applySubscriptions)i(e,t,n)}}const dv={depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0};function hv(e,t,n,{color:i,hoverColor:r,hoverOpacity:a,opacity:o,disabled:s=!1}){return null==r&&null==a||s?(t.color.set(i),t.opacity=o??1,void(s&&(t.opacity*=.5,t.color.lerp(new Cd(1,1,1),.5)))):(r??=i,e.subscribeHover((e=>{const s=e.some((e=>e.includes(n)));t.color.set(s?r:i),t.opacity=(s?a:o)??1})))}const fv=new lu,pv=new Xd;pv.setAttribute("position",new zd([-1e3,0,0,1e3,0,0],3));class mv extends Om{context;rotationOffset;constructor(e,t){super(pv),this.context=e,this.rotationOffset=t,this.renderOrder=1/0}update(){this.quaternion.setFromEuler(this.rotationOffset);const e=this.context.getTarget();"world"===this.context.getSpace()&&null!=e&&(e.getWorldQuaternion(fv).invert(),this.quaternion.premultiply(fv))}bind(e){this.material=new Mm({...dv,color:this.material.color??"white",opacity:this.material.opacity??1});const t=this.context.subscribeHover((t=>{const n=t.some((t=>t.includes(e)));this.visible=n})),n=this.context.subscribeApply(((e,t)=>{if(t.last)return void this.position.set(0,0,0);this.position.copy(t.initial.position).sub(t.current.position);const n=this.context.getTarget();null!=n&&(fv.copy(n.quaternion).invert(),this.position.applyQuaternion(fv))}));return()=>{this.material.dispose(),t(),n()}}}class gv extends fm{context;axis;store;options;tag;constructor(e,t,n,i){super(),this.context=e,this.axis=t,this.tag=(n??"")+t,this.store=new sv(e.target,(()=>e.getHandleOptions(this.tag,i)))}}function vv(e,t=!0){if(!1===t)return{options:!1,disabled:!0};if(!0===t){const t={x:!1,y:!1,z:!1,e:!1};for(const n of e)t[n]=!0;return{options:t,disabled:!1}}if("disabled"===t)return{options:{x:!0,y:!0,z:!0,e:!0},disabled:!0};if("string"==typeof t)return{options:t===e&&{x:!1,y:!1,z:!1,e:!1,[e]:!0},disabled:!1};const n={x:!1,y:!1,z:!1,e:!1};let i=!1;for(const r of e){let e=t[r]??!0;if(!1===e)return{options:!1,disabled:!0};"disabled"===e&&(i=!0,e=!0),n[r]=e}return{options:n,disabled:i}}const yv=new cu,xv=new cu;function _v(e,t,n,i){if(!n)return i;let r;return t instanceof Yh?r=(t.top-t.bottom)/t.zoom:(t.getWorldPosition(yv),e.getWorldPosition(xv),r=yv.distanceTo(xv)*Math.min(1.9*Math.tan(Math.PI*t.fov/360)/t.zoom,7)),r*i/4}const bv=new Um(0,.04,.1,12);bv.translate(0,.05,0);const Sv=new Um(.0075,.0075,.5,3);Sv.translate(0,.25,0);const wv=new Yu(0,0,-Math.PI/2),Mv=new Yu(0,0,Math.PI/2);class Ev extends gv{invert;showArrowBody;constructor(e,t,n="",i,r=!1,a=!0){super(e,t,n,(()=>({scale:!1,rotate:!1,translate:null!=i?[i]:this.options,multitouch:!1}))),this.invert=r,this.showArrowBody=a}bind(e,t,n){const{options:i,disabled:r}=vv(this.axis,n);if(!1===i)return;this.options=i;const a=this.invert?Mv:wv,o=new kd(dv),s=hv(this.context,o,this.tag,{color:e,hoverColor:t,disabled:r}),l=new uh(bv,o);let c,u;if(l.renderOrder=1/0,l.position.x=this.invert?-.5:.5,l.rotation.copy(a),this.add(l),this.showArrowBody){const t=new kd(dv);c=hv(this.context,t,this.tag,{color:e,hoverColor:16777024,disabled:r}),u=new uh(Sv,t),u.renderOrder=1/0,u.rotation.copy(a),this.add(u)}const d=new uh(new Um(.13,0,.6,4));d.pointerEventsOrder=1/0,d.position.x=this.invert?-.3:.3,d.rotation.copy(a),d.visible=!1,this.add(d);const h=r?void 0:this.context.registerHandle(this.store,d,this.tag);return()=>{o.dispose(),h?.(),s?.(),c?.(),this.remove(l),null!=u&&this.remove(u),this.remove(d)}}}class Tv extends gv{constructor(e,t,n="",i){super(e,t,n,(()=>({translate:i??this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e,t,n){const{options:i,disabled:r}=vv(this.axis,n);if(!1===i)return;this.options=i;const a=new kd(dv),o=hv(this.context,a,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t,disabled:r}),s=new uh(new hh(.2,.2,.01),a);s.renderOrder=1/0,s.pointerEventsOrder=1/0,s.position.set(.15,.15,0);const l=r?void 0:this.context.registerHandle(this.store,s,this.tag);return this.add(s),()=>{a.dispose(),s.geometry.dispose(),l?.(),o?.(),this.remove(s)}}}new cu;const Av=new lu;class Cv extends gv{constructor(e){super(e,"xyz","",(()=>({translate:this.options,scale:!1,rotate:!1,multitouch:!1})))}bind(e){const{options:t,disabled:n}=vv(this.axis,e);if(!1===t)return;this.options=t;const i=new kd(dv),r=hv(this.context,i,this.tag,{color:16777215,hoverColor:16776960,opacity:.25,hoverOpacity:1,disabled:n}),a=new uh(new Fm(.1,0),i);a.renderOrder=1/0,this.add(a);const o=new uh(new Fm(.2,0));o.pointerEventsOrder=1/0,o.visible=!1,this.add(o);const s=n?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{i.dispose(),a.geometry.dispose(),o.geometry.dispose(),s?.(),r?.(),this.remove(a),this.remove(o)}}}const Pv=new cu,Rv=new lu,Lv=new lu,kv=(new lu).setFromEuler(new Yu(0,0,Math.PI/2)),Nv=(new lu).setFromEuler(new Yu(0,-Math.PI/2,0)),Dv=new lu,Iv=(new lu).setFromEuler(new Yu(0,-Math.PI/2,0)),Ov=(new lu).setFromEuler(new Yu(Math.PI/2,0,0));class Uv extends fm{context;size;fixed;free;translationX;translationY;translationZ;translationNegX;translationNegY;translationNegZ;translationXY;translationYZ;translationXZ;scaleGroup=new fm;xAxis=new cu;yAxis=new cu;zAxis=new cu;negXAxis=new cu;negYAxis=new cu;negZAxis=new cu;constructor(e,t,n){super(),this.context=e,this.size=t,this.fixed=n,this.add(this.scaleGroup),this.free=new Cv(this.context),this.scaleGroup.add(this.free),this.translationX=new Ev(this.context,"x",void 0,this.xAxis),this.scaleGroup.add(this.translationX),this.translationY=new Ev(this.context,"y",void 0,this.yAxis),this.scaleGroup.add(this.translationY),this.translationZ=new Ev(this.context,"z",void 0,this.zAxis),this.scaleGroup.add(this.translationZ),this.translationNegX=new Ev(this.context,"x",void 0,this.negXAxis,!0,!1),this.scaleGroup.add(this.translationNegX),this.translationNegY=new Ev(this.context,"y",void 0,this.negYAxis,!0,!1),this.scaleGroup.add(this.translationNegY),this.translationNegZ=new Ev(this.context,"z",void 0,this.negZAxis,!0,!1),this.scaleGroup.add(this.translationNegZ),this.translationXY=new Tv(this.context,"xy",void 0,[this.xAxis,this.yAxis]),this.scaleGroup.add(this.translationXY),this.translationXZ=new Tv(this.context,"xz",void 0,[this.xAxis,this.zAxis]),this.scaleGroup.add(this.translationXZ),this.translationYZ=new Tv(this.context,"yz",void 0,[this.yAxis,this.zAxis]),this.scaleGroup.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.xAxis.set(1,0,0),this.yAxis.set(0,1,0),this.zAxis.set(0,0,1),this.free.quaternion.identity(),this.translationX.quaternion.copy(Lv),this.translationY.quaternion.copy(kv),this.translationZ.quaternion.copy(Nv),this.translationNegX.quaternion.copy(Lv),this.translationNegY.quaternion.copy(kv),this.translationNegZ.quaternion.copy(Nv),this.translationXY.quaternion.copy(Dv),this.translationYZ.quaternion.copy(Iv),this.translationXZ.quaternion.copy(Ov);const t=this.context.getSpace(),n=this.context.getTarget();"world"==t&&null!=n?(n.getWorldQuaternion(Rv).invert(),this.free.quaternion.premultiply(Rv),this.translationX.quaternion.premultiply(Rv),this.translationY.quaternion.premultiply(Rv),this.translationZ.quaternion.premultiply(Rv),this.translationNegX.quaternion.premultiply(Rv),this.translationNegY.quaternion.premultiply(Rv),this.translationNegZ.quaternion.premultiply(Rv),this.translationXY.quaternion.premultiply(Rv),this.translationYZ.quaternion.premultiply(Rv),this.translationXZ.quaternion.premultiply(Rv),null!=n.parent&&(n.parent.getWorldQuaternion(Rv).invert(),this.xAxis.applyQuaternion(Rv),this.yAxis.applyQuaternion(Rv),this.zAxis.applyQuaternion(Rv))):null!=n&&(this.xAxis.applyQuaternion(n.quaternion),this.yAxis.applyQuaternion(n.quaternion),this.zAxis.applyQuaternion(n.quaternion)),this.negXAxis.copy(this.xAxis).negate(),this.negYAxis.copy(this.yAxis).negate(),this.negZAxis.copy(this.zAxis).negate(),this.scaleGroup.scale.setScalar(1),null!=n&&(n.getWorldScale(Pv),this.scaleGroup.scale.divide(Pv)),this.scaleGroup.scale.multiplyScalar(_v(this,e,this.fixed??!0,this.size??1))}bind(e){const t=function(e,t){const n=new uh(new Fm(.01,2),new kd(dv));n.renderOrder=1/0,n.visible=!1,e.add(n);const i=new uh(new Fm(.01,2),new kd(dv));i.renderOrder=1/0,i.visible=!1,e.add(i);const r=new Xd;r.setAttribute("position",new zd([0,0,0,1,1,1],3));const a=new Om(r,new Mm(dv));a.renderOrder=1/0,a.visible=!1,e.add(a);const o=t.subscribeApply(((e,r)=>{i.position.set(0,0,0),n.position.copy(r.initial.position).sub(r.current.position);const o=t.getTarget();null!=o&&(Av.copy(o.quaternion).invert(),n.position.applyQuaternion(Av)),a.position.set(0,0,0),a.scale.copy(n.position),n.visible=!r.last,a.visible=!r.last,i.visible=!r.last}));return()=>{n.geometry.dispose(),n.material.dispose(),i.geometry.dispose(),i.material.dispose(),a.geometry.dispose(),a.material.dispose(),e.remove(n),e.remove(i),e.remove(a),o()}}(this,this.context),n=this.translationX.bind(16711680,16776960,e),i=this.translationY.bind(65280,16776960,e),r=this.translationZ.bind(255,16776960,e),a=this.translationNegX.bind(16711680,16776960,e),o=this.translationNegY.bind(65280,16776960,e),s=this.translationNegZ.bind(255,16776960,e),l=this.translationXY.bind(255,16776960,e),c=this.translationYZ.bind(16711680,16776960,e),u=this.translationXZ.bind(65280,16776960,e),d=this.free.bind(e);return()=>{t(),n?.(),i?.(),r?.(),a?.(),o?.(),s?.(),l?.(),c?.(),u?.(),d?.()}}}const zv=new Yu(0,0,-Math.PI/2),Fv=new Yu(0,0,Math.PI/2);class Bv extends gv{invert;showHandleLine;constructor(e,t,n="",i=!1,r=!0){super(e,t,n,(()=>({scale:this.options,rotate:!1,translate:"as-scale",multitouch:!1}))),this.invert=i,this.showHandleLine=r}bind(e,t,n){const{options:i,disabled:r}=vv(this.axis,n);if(!1===i)return;this.options=i;const a=this.invert?Fv:zv,o=new fm;o.position.x=this.invert?-.5:.5,o.rotation.copy(a),this.add(o);const s=new kd(dv),l=hv(this.context,s,this.tag,{color:e,hoverColor:t,disabled:r}),c=new uh(new hh(.08,.08,.08),s);let u,d,h;if(c.renderOrder=1/0,c.rotation.copy(a),o.add(c),this.showHandleLine){h=new fm,h.rotation.copy(a),this.add(h);const n=new kd(dv);u=hv(this.context,n,this.tag,{color:e,hoverColor:t,disabled:r}),d=new uh(new Um(.0075,.0075,.5,3),n),d.renderOrder=1/0,d.position.y=.25,h.add(d)}const f=new fm;f.visible=!1,f.rotation.copy(a),f.position.x=this.invert?-.3:.3,this.add(f);const p=new uh(new Um(.2,0,.5,4));p.pointerEventsOrder=1/0,p.position.y=.04,f.add(p);const m=r?void 0:this.context.registerHandle(this.store,p,this.tag);return()=>{s.dispose(),p.geometry.dispose(),c.geometry.dispose(),d?.geometry.dispose(),m?.(),l?.(),u?.(),null!=h&&this.remove(h),this.remove(f),this.remove(o)}}}class Hv extends gv{constructor(e,t,n=""){super(e,t,n,(()=>({translate:"as-scale",scale:this.options,rotate:!1,multitouch:!1})))}bind(e,t,n){const{options:i,disabled:r}=vv(this.axis,n);if(!1===i)return;this.options=i;const a=new kd(dv),o=hv(this.context,a,this.tag,{opacity:.5,hoverOpacity:1,color:e,hoverColor:t,disabled:r}),s=new uh(new hh(.2,.2,.01),a);s.renderOrder=1/0,s.pointerEventsOrder=1/0,s.position.set(.15,.15,0);const l=r?void 0:this.context.registerHandle(this.store,s,this.tag);return this.add(s),()=>{a.dispose(),s.geometry.dispose(),l?.(),o?.(),this.remove(s)}}}const Vv=new Yu(0,0,-Math.PI/2),jv=new Yu(0,0,Math.PI/2);class Gv extends gv{actualAxis;invert;constructor(e,t="",n,i=!1){super(e,"xyz",t,(()=>({scale:{uniform:!0,...this.options},rotate:!1,translate:"as-scale",multitouch:!1}))),this.actualAxis=n,this.invert=i}bind(e,t,n){const{options:i,disabled:r}=vv(this.actualAxis,n);if(!1===i)return;this.options=i;const a=this.invert?jv:Vv,o=new fm;o.position.x=this.invert?-.7:.7,o.rotation.copy(a),this.add(o);const s=new kd(dv),l=hv(this.context,s,this.tag,{color:e,hoverColor:t,opacity:.5,hoverOpacity:1,disabled:r}),c=new uh(new hh(.08,.08,.08),s);c.renderOrder=1/0,c.rotation.copy(a),o.add(c);const u=new uh(new hh(.15,.15,.15),s);u.visible=!1,u.pointerEventsOrder=1/0,u.rotation.copy(a),o.add(u);const d=r?void 0:this.context.registerHandle(this.store,u,this.tag);return()=>{s.dispose(),c.geometry.dispose(),d?.(),l?.(),this.remove(o)}}}const Wv=new cu;class Xv extends fm{context;size;fixed;scaleX;scaleY;scaleZ;scaleNegX;scaleNegY;scaleNegZ;translationX;translationY;translationZ;translationNegX;translationNegY;translationNegZ;translationXY;translationYZ;translationXZ;constructor(e,t,n){super(),this.context=e,this.size=t,this.fixed=n,this.scaleX=new Gv(this.context,void 0,"x"),this.add(this.scaleX),this.scaleY=new Gv(this.context,void 0,"y"),this.scaleY.rotation.z=Math.PI/2,this.add(this.scaleY),this.scaleZ=new Gv(this.context,void 0,"z"),this.scaleZ.rotation.y=-Math.PI/2,this.add(this.scaleZ),this.scaleNegX=new Gv(this.context,void 0,"x",!0),this.add(this.scaleNegX),this.scaleNegY=new Gv(this.context,void 0,"y",!0),this.scaleNegY.rotation.z=Math.PI/2,this.add(this.scaleNegY),this.scaleNegZ=new Gv(this.context,void 0,"z",!0),this.scaleNegZ.rotation.y=-Math.PI/2,this.add(this.scaleNegZ),this.translationX=new Bv(this.context,"x"),this.add(this.translationX),this.translationY=new Bv(this.context,"y"),this.translationY.rotation.z=Math.PI/2,this.add(this.translationY),this.translationZ=new Bv(this.context,"z"),this.translationZ.rotation.y=-Math.PI/2,this.add(this.translationZ),this.translationNegX=new Bv(this.context,"x",void 0,!0,!1),this.add(this.translationNegX),this.translationNegY=new Bv(this.context,"y",void 0,!0,!1),this.translationNegY.rotation.z=Math.PI/2,this.add(this.translationNegY),this.translationNegZ=new Bv(this.context,"z",void 0,!0,!1),this.translationNegZ.rotation.y=-Math.PI/2,this.add(this.translationNegZ),this.translationXY=new Hv(this.context,"xy"),this.add(this.translationXY),this.translationXZ=new Hv(this.context,"xz"),this.translationXZ.rotation.x=Math.PI/2,this.add(this.translationXZ),this.translationYZ=new Hv(this.context,"yz"),this.translationYZ.rotation.y=-Math.PI/2,this.add(this.translationYZ)}update(e){this.updateWorldMatrix(!0,!1),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(Wv),this.scale.divide(Wv)),this.scale.multiplyScalar(_v(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.scaleX.bind(16777215,16776960,e),n=this.scaleY.bind(16777215,16776960,e),i=this.scaleZ.bind(16777215,16776960,e),r=this.scaleNegX.bind(16777215,16776960,e),a=this.scaleNegY.bind(16777215,16776960,e),o=this.scaleNegZ.bind(16777215,16776960,e),s=this.translationX.bind(16711680,16776960,e),l=this.translationY.bind(65280,16776960,e),c=this.translationZ.bind(255,16776960,e),u=this.translationNegX.bind(16711680,16776960,e),d=this.translationNegY.bind(65280,16776960,e),h=this.translationNegZ.bind(255,16776960,e),f=this.translationXY.bind(255,16776960,e),p=this.translationYZ.bind(16711680,16776960,e),m=this.translationXZ.bind(65280,16776960,e);return()=>{s?.(),l?.(),c?.(),u?.(),d?.(),h?.(),f?.(),p?.(),m?.(),t?.(),n?.(),i?.(),r?.(),a?.(),o?.()}}}const qv={x:{vector1:new cu(0,0,-1),vector2:new cu(0,-1,0),rotationOffset:new lu,axis:[1,0,0]},y:{vector1:new cu(0,0,-1),vector2:new cu(-1,0,-1),rotationOffset:(new lu).setFromEuler(new Yu(0,0,Math.PI/2)),axis:[0,1,0]},z:{vector1:new cu(-1,0,0),vector2:new cu(0,-1,0),rotationOffset:(new lu).setFromEuler(new Yu(0,Math.PI/2,0)),axis:[0,0,1]}},$v=new cu,Yv=new cu,Zv=new cu,Kv=new cu,Qv=new lu;class Jv extends gv{direction=new cu(1,0,0);constructor(e,t,n=""){super(e,t,n,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1})))}update(e){const{rotationOffset:t,vector1:n,vector2:i}=qv[this.axis];e.getWorldPosition($v),this.getWorldPosition(Yv).sub($v),Zv.copy(n),Kv.copy(i);const r=this.context.getTarget(),a=this.context.getSpace();"local"===a&&null!=r&&(r.getWorldQuaternion(Qv),Zv.applyQuaternion(Qv),Kv.applyQuaternion(Qv)),Kv.crossVectors(Zv,Kv);const o=Yv.dot(Kv);Kv.multiplyScalar(o),Yv.sub(Kv),this.quaternion.setFromUnitVectors(Zv,Yv.normalize()),"local"===a&&null!=r&&(r.getWorldQuaternion(Qv),this.quaternion.multiply(Qv)),this.quaternion.multiply(t),null!=r?.parent?(r.parent.matrixWorld.decompose($v,Qv,Yv),Qv.invert(),this.quaternion.premultiply(Qv)):Qv.identity(),null==this.store.getState()&&(this.direction.fromArray(qv[this.axis].axis),this.direction.applyQuaternion("local"===a&&null!=r?r?.quaternion:Qv)),null!=r&&this.quaternion.premultiply(Qv.copy(r.quaternion).invert())}bind(e,t){const{options:n,disabled:i}=vv(this.axis,t);if(!1===n)return;this.options=n;const r=new kd(dv),a=hv(this.context,r,this.tag,{color:e,hoverColor:16776960,disabled:i}),o=new uh(uy(.5,.5),r);o.renderOrder=1/0,this.add(o);const s=new uh(new Vm(.5,.1,4,24));s.visible=!1,s.pointerEventsOrder=1/0,s.rotation.set(0,-Math.PI/2,-Math.PI/2),this.add(s);const l=i?void 0:this.context.registerHandle(this.store,s,this.tag);return()=>{r.dispose(),s.geometry.dispose(),o.geometry.dispose(),l?.(),a?.(),this.remove(s),this.remove(o)}}}const ey=new cu,ty=new cu,ny=new cu(1,0,0),iy=new lu;class ry extends gv{constructor(e,t=""){super(e,"xyz",t,(()=>({scale:!1,translate:"as-rotate",rotate:this.options,multitouch:!1})))}update(e){e.getWorldPosition(ey),this.getWorldPosition(ty).sub(ey),this.quaternion.setFromUnitVectors(ny,ty.normalize());const t=this.context.getTarget();null!=t?.parent&&(t.parent.matrixWorld.decompose(ey,iy,ty),iy.invert(),this.quaternion.premultiply(iy)),null!=t&&(iy.copy(t.quaternion).invert(),this.quaternion.premultiply(iy))}bind(e){const{options:t,disabled:n}=vv(this.axis,e);if(!1===t)return;this.options=t;const i=new kd(dv),r=hv(this.context,i,this.tag,{color:16777215,hoverColor:16776960,opacity:.25,disabled:n}),a=new uh(uy(.5,1),i);a.renderOrder=1/0,this.add(a);const o=new uh(new Hm(.25,10,8));o.visible=!1,o.pointerEventsOrder=1/0,this.add(o);const s=n?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{this.pointerEvents="none",i.dispose(),o.geometry.dispose(),a.geometry.dispose(),s?.(),r?.(),this.remove(o),this.remove(a)}}}const ay=new cu,oy=new cu,sy=new cu(1,0,0),ly=new lu;class cy extends gv{direction=new cu(1,0,0);constructor(e,t=""){super(e,"e",t,(()=>({scale:!1,translate:"as-rotate",rotate:[this.direction],multitouch:!1})))}update(e){e.getWorldPosition(ay),this.getWorldPosition(this.direction).sub(ay).normalize(),this.quaternion.setFromUnitVectors(sy,this.direction);const t=this.context.getTarget();null!=t?.parent&&(t.parent.matrixWorld.decompose(ay,ly,oy),ly.invert(),this.quaternion.premultiply(ly),this.direction.applyQuaternion(ly)),null!=t&&(ly.copy(t.quaternion).invert(),this.quaternion.premultiply(ly)),this.direction.negate()}bind(e){const{options:t,disabled:n}=vv(this.axis,e);if(!1===t)return;this.options=t;const i=new kd(dv),r=hv(this.context,i,this.tag,{color:16776960,hoverColor:16776960,opacity:.5,disabled:n}),a=new uh(uy(.75,1),i);a.renderOrder=1/0,this.add(a);const o=new uh(new Vm(.75,.1,2,24),new kd({color:"white"}));o.visible=!1,o.rotation.y=Math.PI/2,o.pointerEventsOrder=1/0,this.add(o);const s=n?void 0:this.context.registerHandle(this.store,o,this.tag);return()=>{i.dispose(),o.geometry.dispose(),a.geometry.dispose(),s?.(),r?.(),this.remove(o),this.remove(a)}}}function uy(e,t){const n=new Vm(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}const dy=new cu;class hy extends fm{context;fixed;size;rotationX;rotationY;rotationZ;free;screen;constructor(e,t,n){super(),this.context=e,this.fixed=t,this.size=n,this.rotationX=new Jv(this.context,"x"),this.add(this.rotationX),this.rotationY=new Jv(this.context,"y"),this.add(this.rotationY),this.rotationZ=new Jv(this.context,"z"),this.add(this.rotationZ),this.free=new ry(this.context),this.add(this.free),this.screen=new cy(this.context),this.add(this.screen)}update(e){this.updateWorldMatrix(!0,!1),this.rotationX.update(e),this.rotationY.update(e),this.rotationZ.update(e),this.free.update(e),this.screen.update(e),this.scale.setScalar(1);const t=this.context.getTarget();null!=t&&(t.getWorldScale(dy),this.scale.divide(dy)),this.scale.multiplyScalar(_v(this,e,this.fixed??!0,this.size??1))}bind(e){const t=this.rotationX.bind(16711680,e),n=this.rotationY.bind(65280,e),i=this.rotationZ.bind(255,e),r=this.screen.bind(e),a=this.free.bind(e);return()=>{t?.(),n?.(),i?.(),r?.(),a?.()}}}const fy=new Yu,py=new Yu(0,0,Math.PI/2),my=new Yu(0,-Math.PI/2,0);class gy extends fm{xAxisHighlight;yAxisHighlight;zAxisHighlight;handles;context;constructor(e){super(),this.context=new uv(this,e),this.xAxisHighlight=new mv(this.context,fy),this.add(this.xAxisHighlight),this.yAxisHighlight=new mv(this.context,py),this.add(this.yAxisHighlight),this.zAxisHighlight=new mv(this.context,my),this.add(this.zAxisHighlight)}set space(e){this.context.space=e}get space(){return this.context.space}update(e,t){this.context.update(e),this.xAxisHighlight.update(),this.yAxisHighlight.update(),this.zAxisHighlight.update(),this.handles?.update(t)}bind(e,t){const n=this.xAxisHighlight.bind("x"),i=this.yAxisHighlight.bind("y"),r=this.zAxisHighlight.bind("z");switch(e){case"rotate":this.handles=new hy(this.context);break;case"scale":this.handles=new Xv(this.context);break;case"translate":this.handles=new Uv(this.context)}this.add(this.handles);const a=this.handles.bind(t);return()=>{null!=this.handles&&this.remove(this.handles),this.handles=void 0,a(),n(),i(),r()}}}new cu(0,0,1),new cu(0,1,0),new cu,new cu,new cu;class vy{nativeEvent;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;relatedTarget=null;get altKey(){return this.getFromNative("altKey",!1)}get button(){return this.getFromNative("button",0)}get buttons(){return this.getFromNative("buttons",0)}get clientX(){return this.getFromNative("clientX",0)}get clientY(){return this.getFromNative("clientY",0)}get ctrlKey(){return this.getFromNative("ctrlKey",!1)}get layerX(){return this.getFromNative("layerX",0)}get layerY(){return this.getFromNative("layerY",0)}get metaKey(){return this.getFromNative("metaKey",!1)}get movementX(){return this.getFromNative("movementX",0)}get movementY(){return this.getFromNative("movementY",0)}get offsetX(){return this.getFromNative("offsetX",0)}get offsetY(){return this.getFromNative("offsetY",0)}get pageX(){return this.getFromNative("pageX",0)}get pageY(){return this.getFromNative("pageY",0)}get screenX(){return this.getFromNative("screenX",0)}get screenY(){return this.getFromNative("screenY",0)}get shiftKey(){return this.getFromNative("shiftKey",!1)}get x(){return this.getFromNative("x",0)}get y(){return this.getFromNative("y",0)}get detail(){return this.getFromNative("detail",0)}get view(){return this.getFromNative("view",null)}get which(){return this.getFromNative("which",0)}get cancelBubble(){return this.getFromNative("cancelBubble",!1)}get composed(){return this.getFromNative("composed",!1)}get eventPhase(){return this.getFromNative("eventPhase",0)}get isTrusted(){return this.getFromNative("isTrusted",!1)}get returnValue(){return this.getFromNative("returnValue",!1)}get timeStamp(){return this.getFromNative("timeStamp",0)}get cancelable(){return this.getFromNative("cancelable",!1)}get defaultPrevented(){return this.getFromNative("defaultPrevented",!1)}constructor(e){this.nativeEvent=e}getFromNative(e,t){return e in this.nativeEvent?this.nativeEvent[e]:t}}const yy=new cu;class xy extends vy{type;bubbles;internalPointer;intersection;camera;currentObject;object;propagationState;get pointerId(){return this.internalPointer.id}get pointerType(){return this.internalPointer.type}get pointerState(){return this.internalPointer.state}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return null==this._pointer&&(yy.copy(this.intersection.point).project(this.camera),this._pointer=new Ic(yy.x,yy.y)),this._pointer}_ray;get ray(){if(null!=this._ray)return this._ray;switch(this.intersection.details.type){case"screen-ray":case"ray":case"sphere":return this._ray=new zu(this.intersection.pointerPosition,new cu(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case"lines":return this._ray=new zu(this.intersection.details.line.start,this.intersection.details.line.end.clone().sub(this.intersection.details.line.start).normalize())}}_intersections=[];get intersections(){return null==this._intersections&&(this._intersections=[{...this.intersection,eventObject:this.currentObject}]),this._intersections}_unprojectedPoint;get unprojectedPoint(){if(null==this._unprojectedPoint){const e=this.pointer;this._unprojectedPoint=new cu(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}get stopped(){return this.propagationState.stoppedImmediate||this.propagationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw new Error("not supported")}constructor(e,t,n,i,r,a,o=r.object,s=o,l={stopped:!t,stoppedImmediate:!1}){super(n),this.type=e,this.bubbles=t,this.internalPointer=i,this.intersection=r,this.camera=a,this.currentObject=o,this.object=s,this.propagationState=l}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(e){return new xy(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target,this.propagationState)}}class _y extends xy{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,i,r,a){super("wheel",!0,e,t,n,i,r,a)}retarget(e){return new _y(this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target)}}function by(e){Sy(e,e.currentObject)}function Sy(e,t){if(null==t)return;const n=function(e,t){if(null!=e._listeners&&t in e._listeners)return e._listeners[t];let n;e.isVoidObject&&"click"===t&&null!=e.parent?.__r3f&&(n=e.parent.__r3f.root.getState().onPointerMissed);null!=e.__r3f&&(n=e.__r3f.handlers[wy[t]]);if(null==n)return;return[n]}(t,e.type);if(null!=n&&n.length>0){const i=e.retarget(t),r=n.length;for(let e=0;e<r&&!i.stoppedImmediate;e++)n[e](i)}e.stopped||Sy(e,t.parent)}const wy={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"},My=Object.keys(wy);const Ey=new Hm(1e10),Ty=new Map;function Ay(e){let t=Ty.get(e);return null==t&&(t=new uh(Ey),t.isVoidObject=!0,t.parent=e,t.pointerEventsOrder=-1/0,Ty.set(e,t)),t}function Cy(e,t){return t?!e:e}function Py(e,t,n,i=!1,r,a,o){const s=i||function(e,t){if(t.ancestorsHaveListeners)return!0;if("pointer"===e&&t.ancestorsHavePointerListeners)return!0;if("wheel"===e&&t.ancestorsHaveWheelListeners)return!0;if(null!=t.__r3f&&t.__r3f?.eventCount>0){if("wheel"===e&&null!=t.__r3f.handlers.onWheel)return!0;if("pointer"===e&&Object.keys(t.__r3f.handlers).some((e=>"onWheel"!=e)))return!0}if(null==t._listeners)return!1;if("wheel"===e){const e=t._listeners.wheel;return null!=e&&e.length>0}const n=Object.entries(t._listeners),i=n.length;for(let e=0;e<i;e++){const t=n[e];if("wheel"!==t[0]&&(My.includes(t[0])&&null!=t[1]&&t[1].length>0))return!0}return!1}(e,t),l=t.pointerEvents??r,c=l??t.defaultPointerEvents??"listener",u=t.pointerEventsType??a??"all",d=t.pointerEventsOrder??o??0,h=function(e,t,n){if("none"===t)return!1;if("listener"===t&&!e)return!1;if("all"===n)return!0;if("function"==typeof n)return({id:e,type:t,state:i})=>n(e,t,i);let i,r;return"deny"in n?(r=!0,i=n.deny):(r=!1,i=n.allow),Array.isArray(i)?e=>Cy(i.includes(e.type),r):e=>Cy(i===e.type,r)}(s,c,u),f=n.length;if(1===f)(!0===h||"function"==typeof h&&h(n[0]))&&Ry(n[0],t,c,u,d);else if(!0===h)for(let e=0;e<f;e++)Ry(n[e],t,c,u,d);else if("function"==typeof h)for(let e=0;e<f;e++){const i=n[e];h(i)&&Ry(i,t,c,u,d)}if(0===t.children.length||!1===t.intersectChildren)return;const p=t.interactableDescendants??t.children,m=p.length;for(let t=0;t<m;t++)Py(e,p[t],n,s,l,u,d)}function Ry({intersector:e,options:t},n,i,r,a){!1!==t.filter?.(n,i,r,a)&&e.executeIntersection(n,a)}function Ly(e,t=0,n,i=0){return t!=i?i-t:e.distance-n.distance}const ky=1e7;const Ny=Symbol("buttonsDownTime"),Dy=Symbol("buttonsClickTime");function Iy(e){return globalThis.pointerEventspointerMap?.get(e)}globalThis.pointerEventspointerMap??=new Map,hd.prototype.setPointerCapture=function(e){Iy(e)?.setCapture(this)},hd.prototype.releasePointerCapture=function(e){const t=Iy(e);null!=t&&t.hasCaptured(this)&&t.setCapture(void 0)},hd.prototype.hasPointerCapture=function(e){return Iy(e)?.hasCaptured(this)??!1};class Oy{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,i,r,a,o,s,l={}){this.id=e,this.type=t,this.state=n,this.intersector=i,this.getCamera=r,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=s,this.options=l,globalThis.pointerEventspointerMap?.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(null!=this.pointerCapture&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),null!=e&&null!=this.intersection&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(e||null==this.pointerCapture||(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return null!=this.pointerCapture?this.intersector.intersectPointerCapture(this.pointerCapture,n):(this.intersector.startIntersection(n),Py(e,t,[this]),this.intersector.finalizeIntersection(t))}setIntersection(e){this.intersection=e}commit(e,t){const n=this.getCamera(),i=this.prevEnabled?this.prevIntersection:void 0,r=this.enabled?this.intersection:void 0;null!=i&&i.object!=r?.object&&by(new xy("pointerout",!0,e,this,i,n));const a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,Uy(r?.object,this.pointerEntered,a,this.pointerEnteredHelper);const o=a.length;for(let t=0;t<o;t++){const r=a[t];by(new xy("pointerleave",!1,e,this,i,n,r))}null!=r&&i?.object!=r.object&&by(new xy("pointerover",!0,e,this,r,n));for(let t=this.pointerEnteredHelper.length-1;t>=0;t--){const i=this.pointerEnteredHelper[t];by(new xy("pointerenter",!1,e,this,r,n,i))}if(t&&null!=r&&by(new xy("pointermove",!0,e,this,r,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;const e=this.onFirstMove.length;for(let t=0;t<e;t++)this.onFirstMove[t](n);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection("pointer",e,t),this.commit(t,!0)}emitMove(e){null!=this.intersection&&by(new xy("pointermove",!0,e,this,this.intersection,this.getCamera()))}down(e){if(this.buttonsDown.add(e.button),!this.enabled)return;if(!this.wasMoved)return void this.onFirstMove.push(this.down.bind(this,e));if(null==this.intersection)return;by(new xy("pointerdown",!0,e,this,this.intersection,this.getCamera()));const{object:t}=this.intersection;t[Ny]??=new Map,t[Ny].set(e.button,e.timeStamp),this.buttonsDownTime.set(e.button,e.timeStamp)}up(e){if(this.buttonsDown.delete(e.button),!this.enabled)return;if(!this.wasMoved)return void this.onFirstMove.push(this.up.bind(this,e));if(null==this.intersection)return;const{clickThesholdMs:t,contextMenuButton:n=2,dblClickThresholdMs:i=500,clickThresholdMs:r=t??300}=this.options;this.pointerCapture=void 0;const a=function(e,t,n,i,r){if(null==t)return!1;const a=t.get(n);if(null==a)return!1;if(i-a>r)return!1;if(a!=e.get(n))return!1;return!0}(this.buttonsDownTime,this.intersection.object[Ny],e.button,e.timeStamp,r),o=this.getCamera();if(a&&e.button===n&&by(new xy("contextmenu",!0,e,this,this.intersection,o)),by(new xy("pointerup",!0,e,this,this.intersection,o)),!a||e.button===n)return;by(new xy("click",!0,e,this,this.intersection,o));const{object:s}=this.intersection,l=s[Dy]??=new Map,c=l.get(e.button);null==c||e.timeStamp-c>i?l.set(e.button,e.timeStamp):(by(new xy("dblclick",!0,e,this,this.intersection,o)),l.delete(e.button))}cancel(e){this.enabled&&(this.wasMoved?null!=this.intersection&&by(new xy("pointercancel",!0,e,this,this.intersection,this.getCamera())):this.onFirstMove.push(this.cancel.bind(this,e)))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n)return void this.onFirstMove.push(this.wheel.bind(this,e,t,n));n||(this.wheelIntersection=this.computeIntersection("wheel",e,t));const i=n?this.intersection:this.wheelIntersection;null!=i&&by(new _y(t,this,i,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t)return void this.onFirstMove.push(this.emitWheel.bind(this,e,t));const n=t?this.intersection:this.wheelIntersection;null!=n&&by(new _y(e,this,n,this.getCamera()))}exit(e){this.wasMoved&&(null!=this.pointerCapture&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0),this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}}function Uy(e,t,n,i){if(null==e)return;const r=n.indexOf(e);-1!=r?n.splice(r,1):i.push(e),t.push(e),Uy(e.parent,t,n,i)}const zy=new wd,Fy=new wd,By=new Ic,Hy=new Ic,Vy=new Ic,jy=new cu,Gy=new Fu,Wy=new cu;function Xy(e,t,n){Wy.copy(t).applyMatrix4(Gy.copy(n.matrixWorld).invert());const i=n.geometry.attributes.uv;if(null==i||!(i instanceof Id))return!1;let r;return function(e,t){const n=e.geometry.drawRange;if(null!=e.geometry.index){const i=e.geometry.index,r=Math.max(0,n.start),a=Math.min(i.count,n.start+n.count);for(let e=r;e<a;e+=3)t(i.getX(e),i.getX(e+1),i.getX(e+2));return}const i=e.geometry.attributes.position;if(null==i)return;const r=Math.max(0,n.start),a=Math.min(i.count,n.start+n.count);for(let e=r;e<a;e+=3)t(e,e+1,e+2)}(n,((e,t,a)=>{n.getVertexPosition(e,zy.a),n.getVertexPosition(t,zy.b),n.getVertexPosition(a,zy.c);const o=zy.closestPointToPoint(Wy,jy).distanceTo(Wy);null!=r&&o>=r||(r=o,Fy.copy(zy),By.fromBufferAttribute(i,e),Hy.fromBufferAttribute(i,t),Vy.fromBufferAttribute(i,a))})),null!=r&&(Fy.closestPointToPoint(Wy,jy),Fy.getInterpolation(jy,By,Hy,Vy,e),!0)}new Fu,new class{constructor(e=new cu,t=new cu){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){qm.subVectors(e,this.start),$m.subVectors(this.end,this.start);const n=$m.dot($m);let i=$m.dot(qm)/n;return t&&(i=Lc(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},new cu,new Rh,new zu,new Ic,new cu(0,0,0),new cu(0,0,1);const qy=new Fu,$y=new cu;new cu(0,0,-1),new Rh;const Yy=new Ic,Zy=new cu;class Ky{prepareTransformation;options;raycaster=new Gm;cameraQuaternion=new lu;fromPosition=new cu;fromQuaternion=new lu;coords=new Ic;viewPlane=new Rh;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},n){const i=e.details;if("screen-ray"!=i.type)throw new Error(`unable to process a pointer capture of type "${e.details.type}" with a camera ray intersector`);if(!this.startIntersection(n))return e;this.viewPlane.constant-=i.distanceViewPlane;const r=this.raycaster.ray.intersectPlane(this.viewPlane,new cu);if(null==r)return e;e.object.updateWorldMatrix(!0,!1),function(e,t,n){const i=t.normal??t.face?.normal;null!=i&&(e.setFromNormalAndCoplanarPoint(i,t.localPoint),e.applyMatrix4(n))}(this.viewPlane,e,e.object.matrixWorld);let a=e.uv;return e.object instanceof uh&&Xy(Yy,r,e.object)&&(a=Yy.clone()),{...e,details:{...i,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:a,object:t,point:r,pointOnFace:r,pointerPosition:this.raycaster.ray.origin.clone(),pointerQuaternion:this.cameraQuaternion.clone()}}startIntersection(e){const t=this.prepareTransformation(e,this.coords);return null!=t&&(t.updateWorldMatrix(!0,!1),t.matrixWorld.decompose(this.fromPosition,this.fromQuaternion,$y),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(Zy),this.raycaster.ray.origin),!0)}executeIntersection(e,t){const n=this.intersects.length;e.raycast(this.raycaster,this.intersects),function(e,t,n){for(;n>0;)e.push(t),--n}(this.pointerEventsOrders,t,this.intersects.length-n)}finalizeIntersection(e){const t=this.fromPosition.clone(),n=this.cameraQuaternion.clone(),i=this.raycaster.ray.direction.clone(),r=function(e,t,{customSort:n=Ly}={},i){let r,a,o;const s=e.length;for(let i=0;i<s;i++){const s=e[i],l=t?.[i];(null==r||n(s,l,r,a)<0)&&(o=i,r=s,a=l)}return o}(this.intersects,this.pointerEventsOrders,this.options),a=null==r?void 0:this.intersects[r];return this.intersects.length=0,this.pointerEventsOrders.length=0,null==a?function(e,t,n,i,r,a=0){const o=t.direction.clone().multiplyScalar(ky),s=ky;return{distance:s+a,object:Ay(e),point:o,normal:t.origin.clone().sub(o).normalize(),details:n(o,s),pointerPosition:i,pointerQuaternion:r,pointOnFace:o,localPoint:o}}(e,this.raycaster.ray,((e,t)=>({type:"screen-ray",distanceViewPlane:t,screenPoint:this.coords.clone(),direction:i})),t,n):(a.object.updateWorldMatrix(!0,!1),qy.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:"screen-ray",distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:i},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(qy)}))}}new cu,new Ic,new Fu,new cu,new Rh,new Ru,new cu,new cu,new cu,new cu(1e-4,1e-4,1e-4),new Fu;let Qy=23412;function Jy(e,t,n){if(!(t instanceof globalThis.MouseEvent))return n.set(0,0);const{width:i,height:r,top:a,left:o}=e.getBoundingClientRect(),s=t.clientX-o,l=t.clientY-a;return n.set(s/i*2-1,-l/r*2+1)}function ex(e,t,n,i){return function(e,t,n,i,r,a,o={}){const s=o?.forwardPointerCapture??!0,l=new Map,c=o.pointerTypePrefix??"forward-",u=(e,u)=>{let d=l.get(e.pointerId);return null!=d||(d=new Oy(Qy++,`${c}${e.pointerType}`,e.pointerState,new Ky(((e,n)=>(i(e,n),t())),o),t,void 0,s?r.bind(null,e.pointerId):void 0,s?a.bind(null,e.pointerId):void 0,o),"move"!=u&&"wheel"!=u&&(d.setIntersection(d.computeIntersection("pointer",n,e)),d.commit(e,!1)),l.set(e.pointerId,d)),d},d=new Map,h=new Map,f=[],p=[],m=(e,t,i)=>{switch(e){case"move":return void i.move(n,t);case"wheel":return void i.wheel(n,t);case"cancel":return void i.cancel(t);case"down":if(!tx(t))return;return void i.down(t);case"up":if(!tx(t))return;return void i.up(t);case"exit":return h.delete(i),d.delete(i),void i.exit(t)}},g=(e,t)=>{const n=u(t,e);"move"===e&&h.set(n,t),"wheel"===e&&d.set(n,t),o.batchEvents??1?p.push({type:e,event:t}):m(e,t,n)},v=g.bind(null,"move"),y=g.bind(null,"cancel"),x=g.bind(null,"down"),_=g.bind(null,"up"),b=g.bind(null,"wheel"),S=g.bind(null,"exit");return e.addEventListener("pointermove",v),e.addEventListener("pointercancel",y),e.addEventListener("pointerdown",x),e.addEventListener("pointerup",_),e.addEventListener("wheel",b),e.addEventListener("pointerleave",S),{destroy(){e.removeEventListener("pointermove",v),e.removeEventListener("pointercancel",y),e.removeEventListener("pointerdown",x),e.removeEventListener("pointerup",_),e.removeEventListener("wheel",b),e.removeEventListener("pointerleave",S),h.clear(),d.clear()},update(){const e=p.length;for(let t=0;t<e;t++){const{type:e,event:n}=p[t],i=u(n,e);"move"!==e||(f.push(i),h.get(i)==n)?"wheel"!==e||d.get(i)==n?m(e,n,i):i.emitWheel(n):i.emitMove(n)}if(p.length=0,o.intersectEveryFrame)for(const[e,t]of h.entries())f.includes(e)||e.move(n,t);f.length=0}}}(e,"function"==typeof t?t:()=>t,n,Jy.bind(null,e),e.setPointerCapture.bind(e),(t=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)}),{pointerTypePrefix:"screen-",...i})}function tx(e){return null!=e.button}new Ic,new cu,new cu,new cu,new Ic,new Ic,new cu,new cu,new Ic,new Ic,new Ic,new Ic,new cu,new cu;class nx{constructor(e){this.xrDevice=e,this.combinedCameraPosition=new cu,this.isPointerLocked=!1,this.vec3=new cu,this.quat=new lu,this.quatB=new lu,this.euler=new Yu,this.keyState={ShiftLeft:!1,KeyW:!1,KeyA:!1,KeyS:!1,KeyD:!1,ArrowUp:!1,ArrowDown:!1},this.lastTime=0,this.isInProgrammaticMode=!1,this.interactionsEnabled=!0,this.scene=new wm,this.camera=new Sh(50,window.innerWidth/window.innerHeight,.1,40),this.playerRig=new fm,this.cameraRig=new fm,this.scene.add(this.playerRig),this.playerRig.add(this.cameraRig),this.cameraRig.position.fromArray(e.position.vec3),this.cameraRig.quaternion.fromArray(e.quaternion.quat),this.cameraRig.add(this.camera),this.camera.position.x-=e.ipd/2;const t=new uh(new Bm(.25,.27,32),new kd({color:16777215,side:el}));t.rotateX(-Math.PI/2),this.scene.add(t),this.renderer=new Sm({alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setClearColor(0,0),this.renderer.domElement.style.position="fixed",this.renderer.domElement.style.top="50vh",this.renderer.domElement.style.left="50vw",this.renderer.domElement.style.transform="translate(-50%, -50%)",this.transformHandles=new Map,["left","right"].forEach((t=>{const n=new gy;n.scale.setScalar(.1),n.position.fromArray(e.controllers[t].position.vec3),n.quaternion.fromArray(e.controllers[t].quaternion.quat),this.cameraRig.attach(n),n.userData={defaultPosition:n.position.toArray(),defaultQuaternion:n.quaternion.toArray()},n.userData.setMode=e=>{var t,i;null===(i=(t=n.userData).modeCleanup)||void 0===i||i.call(t),n.userData.modeCleanup=n.bind(e),n.userData.mode=e},n.userData.setMode("translate"),n.space="local",this.transformHandles.set(t,n),n.addEventListener("click",(()=>{"translate"===n.userData.mode?n.userData.setMode("rotate"):n.userData.setMode("translate")}))})),window.transformHandles=this.transformHandles,this.mouseMoveHandler=t=>{if(!this.isPointerLocked||this.isInProgrammaticMode)return;const n=t.movementX||t.mozMovementX||t.webkitMovementX||0,i=t.movementY||t.mozMovementY||t.webkitMovementY||0;this.playerRig.rotation.y-=.002*n,this.cameraRig.rotation.x-=.002*i,e.quaternion.copy(this.cameraRig.getWorldQuaternion(new lu))},this.cameraRig.getWorldPosition(this.combinedCameraPosition),this.headsetDefaultPosition=this.cameraRig.position.clone(),this.headsetDefaultQuaternion=this.cameraRig.quaternion.clone(),this.forwardHtmlEvents=ex(this.renderer.domElement,(()=>this.camera),this.scene).update,document.addEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.addEventListener("keydown",this.keyDownHandler.bind(this),!1),document.addEventListener("keyup",this.keyUpHandler.bind(this),!1)}lockPointer(){!this.isInProgrammaticMode&&this.interactionsEnabled&&(this.renderer.domElement.requestPointerLock=this.renderer.domElement.requestPointerLock||this.renderer.domElement.mozRequestPointerLock||this.renderer.domElement.webkitRequestPointerLock,this.renderer.domElement.requestPointerLock())}pointerLockChangeHandler(){this.isPointerLocked=document.pointerLockElement===this.renderer.domElement||document.mozPointerLockElement===this.renderer.domElement||document.webkitPointerLockElement===this.renderer.domElement,this.isPointerLocked?(document.addEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEach((e=>{e.visible=!1}))):(document.removeEventListener("mousemove",this.mouseMoveHandler,!1),Object.values(this.transformHandles).forEach((e=>{e.visible=!this.isInProgrammaticMode})))}keyDownHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!0),this.isInProgrammaticMode||(t.ShiftLeft&&t.ArrowUp&&(this.cameraRig.position.y+=.05),t.ShiftLeft&&t.ArrowDown&&(this.cameraRig.position.y-=.05))}keyUpHandler(e){const{keyState:t}=this;e.code in t&&(t[e.code]=!1)}movePlayerRig(e){const{playerRig:t,keyState:n,vec3:i}=this;i.set((n.KeyD?1:0)-(n.KeyA?1:0),0,(n.KeyS?1:0)-(n.KeyW?1:0)),i.lengthSq()>0&&n.ShiftLeft&&(i.normalize().multiplyScalar(2*e).applyQuaternion(t.quaternion),t.position.add(i))}resetDeviceTransforms(){const{playerRig:e,cameraRig:t,transformHandles:n}=this;t.position.copy(this.headsetDefaultPosition),t.quaternion.copy(this.headsetDefaultQuaternion),e.position.set(0,0,0),e.quaternion.set(0,0,0,1),n.forEach((e=>{e.position.fromArray(e.userData.defaultPosition),e.quaternion.fromArray(e.userData.defaultQuaternion)}))}syncDeviceTransforms(){const{xrDevice:e,cameraRig:t,transformHandles:n}=this;e.position.copy(t.getWorldPosition(this.vec3)),e.quaternion.copy(t.getWorldQuaternion(this.quat)),n.forEach(((t,n)=>{const i="controller"===e.primaryInputMode?e.controllers[n]:e.hands[n];i.position.copy(t.getWorldPosition(this.vec3)),i.quaternion.copy(t.getWorldQuaternion(this.quat))}))}syncFromDevice(){const{xrDevice:e,playerRig:t,cameraRig:n,transformHandles:i}=this,r=e.position,a=e.quaternion;this.combinedCameraPosition.set(r.x,r.y,r.z),this.quatB.set(a.x,a.y,a.z,a.w),this.euler.setFromQuaternion(this.quatB,"YXZ"),t.position.set(r.x,0,r.z),t.rotation.set(0,this.euler.y,0),n.position.set(0,r.y,0),this.quat.setFromEuler(this.euler.set(0,this.euler.y,0,"YXZ")),n.quaternion.multiplyQuaternions(this.quat.invert(),this.quatB),t.updateMatrixWorld(!0),i.forEach(((t,i)=>{const r="controller"===e.primaryInputMode?e.controllers[i]:e.hands[i],a=this.vec3.set(r.position.x,r.position.y,r.position.z);n.worldToLocal(a),t.position.copy(a),n.getWorldQuaternion(this.quat),this.quatB.set(r.quaternion.x,r.quaternion.y,r.quaternion.z,r.quaternion.w),this.quatB.premultiply(this.quat.invert()),t.quaternion.copy(this.quatB)}))}setInteractionsEnabled(e){this.interactionsEnabled=e,!e&&this.isPointerLocked&&document.exitPointerLock()}renderScene(e){const t=this.xrDevice.fovy/Math.PI*180;let n=!1;this.camera.fov!==t&&(this.camera.fov=t,n=!0);const i=this.xrDevice.canvasDimensions;if(i){const e=this.renderer.domElement;(e.width!==i.width||e.height!==i.height)&&(this.camera.aspect=i.width/i.height,this.renderer.setSize(i.width,i.height),n=!0)}n&&this.camera.updateProjectionMatrix(),this.isInProgrammaticMode||(this.isPointerLocked?this.cameraRig.getWorldPosition(this.combinedCameraPosition):(this.cameraRig.position.y=this.combinedCameraPosition.y,this.playerRig.position.x=this.combinedCameraPosition.x,this.playerRig.position.z=this.combinedCameraPosition.z)),this.forwardHtmlEvents(),this.transformHandles.forEach(((t,n)=>{var i;const r=Boolean(null===(i=this.xrDevice.controllers[n])||void 0===i?void 0:i.connected);t.visible=r&&!this.isPointerLocked&&!this.isInProgrammaticMode,r&&t.update(e,this.camera)}));const r=Math.min((e-this.lastTime)/1e3,.1);this.isInProgrammaticMode||(this.movePlayerRig(r),this.syncDeviceTransforms()),this.renderer.render(this.scene,this.camera),this.lastTime=e}get domElement(){return this.renderer.domElement}dispose(){this.renderer.dispose(),document.removeEventListener("pointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mozpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("webkitpointerlockchange",this.pointerLockChangeHandler.bind(this),!1),document.removeEventListener("mousemove",this.mouseMoveHandler,!1),document.removeEventListener("keydown",this.keyDownHandler.bind(this),!1),document.removeEventListener("keyup",this.keyUpHandler.bind(this),!1)}}const ix="2.2.0";var rx,ax,ox={exports:{}},sx={},lx={exports:{}},cx={};function ux(){return ax||(ax=1,lx.exports=(rx||(rx=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,a=e[i];if(!(0<r(a,t)))break e;e[i]=t,e[n]=a,n=i}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,a=e.length,o=a>>>1;i<o;){var s=2*(i+1)-1,l=e[s],c=s+1,u=e[c];if(0>r(l,n))c<a&&0>r(u,l)?(e[i]=u,e[c]=n,i=c):(e[i]=l,e[s]=n,i=s);else{if(!(c<a&&0>r(u,n)))break e;e[i]=u,e[c]=n,i=c}}}return t}function r(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var r=n(c);null!==r;){if(null===r.callback)i(c);else{if(!(r.startTime<=e))break;i(c),r.sortIndex=r.expirationTime,t(l,r)}r=n(c)}}function b(e){if(m=!1,_(e),!p)if(null!==n(l))p=!0,w||(w=!0,S());else{var t=n(c);null!==t&&L(b,t.startTime-e)}}var S,w=!1,M=-1,E=5,T=-1;function A(){return!(!g&&e.unstable_now()-T<E)}function C(){if(g=!1,w){var t=e.unstable_now();T=t;var r=!0;try{e:{p=!1,m&&(m=!1,y(M),M=-1),f=!0;var a=h;try{t:{for(_(t),d=n(l);null!==d&&!(d.expirationTime>t&&A());){var o=d.callback;if("function"==typeof o){d.callback=null,h=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,_(t),r=!0;break t}d===n(l)&&i(l),_(t)}else i(l);d=n(l)}if(null!==d)r=!0;else{var u=n(c);null!==u&&L(b,u.startTime-t),r=!1}}break e}finally{d=null,h=a,f=!1}r=void 0}}finally{r?S():w=!1}}}if("function"==typeof x)S=function(){x(C)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,R=P.port2;P.port1.onmessage=C,S=function(){R.postMessage(null)}}else S=function(){v(C,0)};function L(t,n){M=v((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(i,r,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,i){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(i.sortIndex=a,t(c,i),null===n(l)&&i===n(c)&&(m?(y(M),M=-1):m=!0,L(b,a-o))):(i.sortIndex=s,t(l,i),p||f||(p=!0,w||(w=!0,S()))),i},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(cx)),cx)),lx.exports}var dx,hx,fx,px,mx={exports:{}},gx={};function vx(){if(dx)return gx;dx=1;var e=u();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return gx.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,gx.createPortal=function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:r,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,n,null,i)},gx.flushSync=function(e){var t=a.T,n=i.p;try{if(a.T=null,i.p=2,e)return e()}finally{a.T=t,i.p=n,i.d.f()}},gx.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},gx.prefetchDNS=function(e){"string"==typeof e&&i.d.D(e)},gx.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:s}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},gx.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},gx.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},gx.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);i.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},gx.requestFormReset=function(e){i.d.r(e)},gx.unstable_batchedUpdates=function(e,t){return e(t)},gx.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},gx.useFormStatus=function(){return a.H.useHostTransitionStatus()},gx.version="19.1.0",gx}function yx(){if(fx)return sx;fx=1;var e=ux(),t=u(),n=(hx||(hx=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),mx.exports=vx()),mx.exports);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function o(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(a(e)!==e)throw Error(i(188))}function l(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=l(e)))return t;e=e.sibling}return null}var c=Object.assign,d=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),y=Symbol.for("react.consumer"),x=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),A=Symbol.iterator;function C(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=A&&e[A]||e["@@iterator"])?e:null}var P=Symbol.for("react.client.reference");function R(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===P?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case p:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case b:return"Suspense";case S:return"SuspenseList";case E:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case f:return"Portal";case x:return(e.displayName||"Context")+".Provider";case y:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case w:return null!==(t=e.displayName||null)?t:R(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return R(e(t))}catch(e){}}return null}var L=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},I=[],O=-1;function U(e){return{current:e}}function z(e){0>O||(e.current=I[O],I[O]=null,O--)}function F(e,t){O++,I[O]=e.current,e.current=t}var B=U(null),H=U(null),V=U(null),j=U(null);function G(e,t){switch(F(V,t),F(H,e),F(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=id(t=nd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(B),F(B,e)}function W(){z(B),z(H),z(V)}function X(e){null!==e.memoizedState&&F(j,e);var t=B.current,n=id(t,e.type);t!==n&&(F(H,e),F(B,n))}function q(e){H.current===e&&(z(B),z(H)),j.current===e&&(z(j),Xd._currentValue=D)}var $=Object.prototype.hasOwnProperty,Y=e.unstable_scheduleCallback,Z=e.unstable_cancelCallback,K=e.unstable_shouldYield,Q=e.unstable_requestPaint,J=e.unstable_now,ee=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,ne=e.unstable_UserBlockingPriority,ie=e.unstable_NormalPriority,re=e.unstable_LowPriority,ae=e.unstable_IdlePriority,oe=e.log,se=e.unstable_setDisableYieldValue,le=null,ce=null;function ue(e){if("function"==typeof oe&&se(e),ce&&"function"==typeof ce.setStrictMode)try{ce.setStrictMode(le,e)}catch(e){}}var de=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(he(e)/fe|0)|0},he=Math.log,fe=Math.LN2;var pe=256,me=4194304;function ge(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ve(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=134217727&i;return 0!==s?0!==(i=s&~a)?r=ge(i):0!==(o&=s)?r=ge(o):n||0!==(n=s&~e)&&(r=ge(n)):0!==(s=i&~a)?r=ge(s):0!==o?r=ge(o):n||0!==(n=i&~e)&&(r=ge(n)),0===r?0:0!==t&&t!==r&&!(t&a)&&((a=r&-r)>=(n=t&-t)||32===a&&4194048&n)?t:r}function ye(e,t){return!(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function _e(){var e=pe;return!(4194048&(pe<<=1))&&(pe=256),e}function be(){var e=me;return!(62914560&(me<<=1))&&(me=4194304),e}function Se(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function we(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Me(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-de(t);e.entangledLanes|=t,e.entanglements[i]=1073741824|e.entanglements[i]|4194090&n}function Ee(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-de(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function Te(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ae(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Ce(){var e=N.p;return 0!==e?e:void 0===(e=window.event)?32:sh(e.type)}var Pe=Math.random().toString(36).slice(2),Re="__reactFiber$"+Pe,Le="__reactProps$"+Pe,ke="__reactContainer$"+Pe,Ne="__reactEvents$"+Pe,De="__reactListeners$"+Pe,Ie="__reactHandles$"+Pe,Oe="__reactResources$"+Pe,Ue="__reactMarker$"+Pe;function ze(e){delete e[Re],delete e[Le],delete e[Ne],delete e[De],delete e[Ie]}function Fe(e){var t=e[Re];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ke]||n[Re]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=vd(e);null!==e;){if(n=e[Re])return n;e=vd(e)}return t}n=(e=n).parentNode}return null}function Be(e){if(e=e[Re]||e[ke]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function He(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(i(33))}function Ve(e){var t=e[Oe];return t||(t=e[Oe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function je(e){e[Ue]=!0}var Ge=new Set,We={};function Xe(e,t){qe(e,t),qe(e+"Capture",t)}function qe(e,t){for(We[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var $e,Ye,Ze=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ke={},Qe={};function Je(e,t,n){if(r=t,$.call(Qe,r)||!$.call(Ke,r)&&(Ze.test(r)?Qe[r]=!0:(Ke[r]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var r}function et(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function tt(e,t,n,i){if(null===i)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+i)}}function nt(e){if(void 0===$e)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);$e=t&&t[1]||"",Ye=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+$e+e+Ye}var it=!1;function rt(e,t){if(!e||it)return"";it=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var i=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){i=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){i=e}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(1!==i||1!==r)do{if(i--,0>--r||l[i]!==c[r]){var u="\n"+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=i&&0<=r);break}}}finally{it=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nt(n):""}function at(e){switch(e.tag){case 26:case 27:case 5:return nt(e.type);case 16:return nt("Lazy");case 13:return nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return rt(e.type,!1);case 11:return rt(e.type.render,!1);case 1:return rt(e.type,!0);case 31:return nt("Activity");default:return""}}function ot(e){try{var t="";do{t+=at(e),e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function st(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ct(e){e._valueTracker||(e._valueTracker=function(e){var t=lt(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ut(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=lt(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function dt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var ht=/[\n"\\]/g;function ft(e){return e.replace(ht,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function pt(e,t,n,i,r,a,o,s){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+st(t)):e.value!==""+st(t)&&(e.value=""+st(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?gt(e,o,st(t)):null!=n?gt(e,o,st(n)):null!=i&&e.removeAttribute("value"),null==r&&null!=a&&(e.defaultChecked=!!a),null!=r&&(e.checked=r&&"function"!=typeof r&&"symbol"!=typeof r),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+st(s):e.removeAttribute("name")}function mt(e,t,n,i,r,a,o,s){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return;n=null!=n?""+st(n):"",t=null!=t?""+st(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}i="function"!=typeof(i=null!=i?i:r)&&"symbol"!=typeof i&&!!i,e.checked=s?e.checked:!!i,e.defaultChecked=!!i,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function gt(e,t,n){"number"===t&&dt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function vt(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+st(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function yt(e,t,n){null==t||((t=""+st(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+st(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function xt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(i(92));if(L(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=st(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function _t(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var bt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function St(e,t,n){var i=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?i?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":i?e.setProperty(t,n):"number"!=typeof n||0===n||bt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function wt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&St(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&St(e,o,t[o])}function Mt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Et=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Tt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function At(e){return Tt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ct=null;function Pt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Rt=null,Lt=null;function kt(e){var t=Be(e);if(t&&(e=t.stateNode)){var n=e[Le]||null;e:switch(e=t.stateNode,t.type){case"input":if(pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Le]||null;if(!a)throw Error(i(90));pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&ut(r)}break e;case"textarea":yt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&vt(e,!!n.multiple,t,!1)}}}var Nt=!1;function Dt(e,t,n){if(Nt)return e(t,n);Nt=!0;try{return e(t)}finally{if(Nt=!1,(null!==Rt||null!==Lt)&&(Fc(),Rt&&(t=Rt,e=Lt,Lt=Rt=null,kt(t),e)))for(t=0;t<e.length;t++)kt(e[t])}}function It(e,t){var n=e.stateNode;if(null===n)return null;var r=n[Le]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(i(231,t,typeof n));return n}var Ot=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ut=!1;if(Ot)try{var zt={};Object.defineProperty(zt,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",zt,zt),window.removeEventListener("test",zt,zt)}catch(e){Ut=!1}var Ft=null,Bt=null,Ht=null;function Vt(){if(Ht)return Ht;var e,t,n=Bt,i=n.length,r="value"in Ft?Ft.value:Ft.textContent,a=r.length;for(e=0;e<i&&n[e]===r[e];e++);var o=i-e;for(t=1;t<=o&&n[i-t]===r[a-t];t++);return Ht=r.slice(e,1<t?1-t:void 0)}function jt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gt(){return!0}function Wt(){return!1}function Xt(e){function t(t,n,i,r,a){for(var o in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(r):r[o]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?Gt:Wt,this.isPropagationStopped=Wt,this}return c(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),t}var qt,$t,Yt,Zt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kt=Xt(Zt),Qt=c({},Zt,{view:0,detail:0}),Jt=Xt(Qt),en=c({},Qt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yt&&(Yt&&"mousemove"===e.type?(qt=e.screenX-Yt.screenX,$t=e.screenY-Yt.screenY):$t=qt=0,Yt=e),qt)},movementY:function(e){return"movementY"in e?e.movementY:$t}}),tn=Xt(en),nn=Xt(c({},en,{dataTransfer:0})),rn=Xt(c({},Qt,{relatedTarget:0})),an=Xt(c({},Zt,{animationName:0,elapsedTime:0,pseudoElement:0})),on=Xt(c({},Zt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),sn=Xt(c({},Zt,{data:0})),ln={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},un={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=un[e])&&!!t[e]}function hn(){return dn}var fn=Xt(c({},Qt,{key:function(e){if(e.key){var t=ln[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=jt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hn,charCode:function(e){return"keypress"===e.type?jt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?jt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),pn=Xt(c({},en,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mn=Xt(c({},Qt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hn})),gn=Xt(c({},Zt,{propertyName:0,elapsedTime:0,pseudoElement:0})),vn=Xt(c({},en,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),yn=Xt(c({},Zt,{newState:0,oldState:0})),xn=[9,13,27,32],_n=Ot&&"CompositionEvent"in window,bn=null;Ot&&"documentMode"in document&&(bn=document.documentMode);var Sn=Ot&&"TextEvent"in window&&!bn,wn=Ot&&(!_n||bn&&8<bn&&11>=bn),Mn=String.fromCharCode(32),En=!1;function Tn(e,t){switch(e){case"keyup":return-1!==xn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function An(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Cn=!1;var Pn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Pn[e.type]:"textarea"===t}function Ln(e,t,n,i){Rt?Lt?Lt.push(i):Lt=[i]:Rt=i,0<(t=Vu(t,"onChange")).length&&(n=new Kt("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var kn=null,Nn=null;function Dn(e){Du(e,0)}function In(e){if(ut(He(e)))return e}function On(e,t){if("change"===e)return t}var Un=!1;if(Ot){var zn;if(Ot){var Fn="oninput"in document;if(!Fn){var Bn=document.createElement("div");Bn.setAttribute("oninput","return;"),Fn="function"==typeof Bn.oninput}zn=Fn}else zn=!1;Un=zn&&(!document.documentMode||9<document.documentMode)}function Hn(){kn&&(kn.detachEvent("onpropertychange",Vn),Nn=kn=null)}function Vn(e){if("value"===e.propertyName&&In(Nn)){var t=[];Ln(t,Nn,e,Pt(e)),Dt(Dn,t)}}function jn(e,t,n){"focusin"===e?(Hn(),Nn=n,(kn=t).attachEvent("onpropertychange",Vn)):"focusout"===e&&Hn()}function Gn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return In(Nn)}function Wn(e,t){if("click"===e)return In(t)}function Xn(e,t){if("input"===e||"change"===e)return In(t)}var qn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function $n(e,t){if(qn(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!$.call(t,r)||!qn(e[r],t[r]))return!1}return!0}function Yn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zn(e,t){var n,i=Yn(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Yn(i)}}function Kn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Kn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Qn(e){for(var t=dt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=dt((e=t.contentWindow).document)}return t}function Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ei=Ot&&"documentMode"in document&&11>=document.documentMode,ti=null,ni=null,ii=null,ri=!1;function ai(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ri||null==ti||ti!==dt(i)||("selectionStart"in(i=ti)&&Jn(i)?i={start:i.selectionStart,end:i.selectionEnd}:i={anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},ii&&$n(ii,i)||(ii=i,0<(i=Vu(ni,"onSelect")).length&&(t=new Kt("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ti)))}function oi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var si={animationend:oi("Animation","AnimationEnd"),animationiteration:oi("Animation","AnimationIteration"),animationstart:oi("Animation","AnimationStart"),transitionrun:oi("Transition","TransitionRun"),transitionstart:oi("Transition","TransitionStart"),transitioncancel:oi("Transition","TransitionCancel"),transitionend:oi("Transition","TransitionEnd")},li={},ci={};function ui(e){if(li[e])return li[e];if(!si[e])return e;var t,n=si[e];for(t in n)if(n.hasOwnProperty(t)&&t in ci)return li[e]=n[t];return e}Ot&&(ci=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);var di=ui("animationend"),hi=ui("animationiteration"),fi=ui("animationstart"),pi=ui("transitionrun"),mi=ui("transitionstart"),gi=ui("transitioncancel"),vi=ui("transitionend"),yi=new Map,xi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _i(e,t){yi.set(e,t),Xe(t,[e])}xi.push("scrollEnd");var bi=new WeakMap;function Si(e,t){if("object"==typeof e&&null!==e){var n=bi.get(e);return void 0!==n?n:(t={value:e,source:t,stack:ot(t)},bi.set(e,t),t)}return{value:e,source:t,stack:ot(t)}}var wi=[],Mi=0,Ei=0;function Ti(){for(var e=Mi,t=Ei=Mi=0;t<e;){var n=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var a=wi[t];if(wi[t++]=null,null!==i&&null!==r){var o=i.pending;null===o?r.next=r:(r.next=o.next,o.next=r),i.pending=r}0!==a&&Ri(n,r,a)}}function Ai(e,t,n,i){wi[Mi++]=e,wi[Mi++]=t,wi[Mi++]=n,wi[Mi++]=i,Ei|=i,e.lanes|=i,null!==(e=e.alternate)&&(e.lanes|=i)}function Ci(e,t,n,i){return Ai(e,t,n,i),Li(e)}function Pi(e,t){return Ai(e,null,null,t),Li(e)}function Ri(e,t,n){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n);for(var r=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(i=a.alternate)&&(i.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(r=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,r&&null!==t&&(r=31-de(n),null===(i=(e=a.hiddenUpdates)[r])?e[r]=[t]:i.push(t),t.lane=536870912|n),a):null}function Li(e){if(50<Rc)throw Rc=0,Lc=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var ki={};function Ni(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,i){return new Ni(e,t,n,i)}function Ii(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return null===n?((n=Di(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ui(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zi(e,t,n,r,a,o){var s=0;if(r=e,"function"==typeof e)Ii(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,B.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case E:return(e=Di(31,n,t,a)).elementType=E,e.lanes=o,e;case p:return Fi(n.children,a,o,t);case m:s=8,a|=24;break;case g:return(e=Di(12,n,t,2|a)).elementType=g,e.lanes=o,e;case b:return(e=Di(13,n,t,a)).elementType=b,e.lanes=o,e;case S:return(e=Di(19,n,t,a)).elementType=S,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case v:case x:s=10;break e;case y:s=9;break e;case _:s=11;break e;case w:s=14;break e;case M:s=16,r=null;break e}s=29,n=Error(i(130,null===e?"null":typeof e,"")),r=null}return(t=Di(s,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,i){return(e=Di(7,e,i,t)).lanes=n,e}function Bi(e,t,n){return(e=Di(6,e,null,t)).lanes=n,e}function Hi(e,t,n){return(t=Di(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=[],ji=0,Gi=null,Wi=0,Xi=[],qi=0,$i=null,Yi=1,Zi="";function Ki(e,t){Vi[ji++]=Wi,Vi[ji++]=Gi,Gi=e,Wi=t}function Qi(e,t,n){Xi[qi++]=Yi,Xi[qi++]=Zi,Xi[qi++]=$i,$i=e;var i=Yi;e=Zi;var r=32-de(i)-1;i&=~(1<<r),n+=1;var a=32-de(t)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Yi=1<<32-de(t)+r|n<<r|i,Zi=a+e}else Yi=1<<a|n<<r|i,Zi=e}function Ji(e){null!==e.return&&(Ki(e,1),Qi(e,1,0))}function er(e){for(;e===Gi;)Gi=Vi[--ji],Vi[ji]=null,Wi=Vi[--ji],Vi[ji]=null;for(;e===$i;)$i=Xi[--qi],Xi[qi]=null,Zi=Xi[--qi],Xi[qi]=null,Yi=Xi[--qi],Xi[qi]=null}var tr=null,nr=null,ir=!1,rr=null,ar=!1,or=Error(i(519));function sr(e){throw fr(Si(Error(i(418,"")),e)),or}function lr(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Re]=e,t[Le]=i,n){case"dialog":Iu("cancel",t),Iu("close",t);break;case"iframe":case"object":case"embed":Iu("load",t);break;case"video":case"audio":for(n=0;n<ku.length;n++)Iu(ku[n],t);break;case"source":Iu("error",t);break;case"img":case"image":case"link":Iu("error",t),Iu("load",t);break;case"details":Iu("toggle",t);break;case"input":Iu("invalid",t),mt(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),ct(t);break;case"select":Iu("invalid",t);break;case"textarea":Iu("invalid",t),xt(t,i.value,i.defaultValue,i.children),ct(t)}"string"!=typeof(n=i.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===i.suppressHydrationWarning||$u(t.textContent,n)?(null!=i.popover&&(Iu("beforetoggle",t),Iu("toggle",t)),null!=i.onScroll&&Iu("scroll",t),null!=i.onScrollEnd&&Iu("scrollend",t),null!=i.onClick&&(t.onclick=Yu),t=!0):t=!1,t||sr(e)}function cr(e){for(tr=e.return;tr;)switch(tr.tag){case 5:case 13:return void(ar=!1);case 27:case 3:return void(ar=!0);default:tr=tr.return}}function ur(e){if(e!==tr)return!1;if(!ir)return cr(e),ir=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||rd(e.type,e.memoizedProps)),t=!t),t&&nr&&sr(e),cr(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){nr=md(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}nr=null}}else 27===n?(n=nr,dd(e.type)?(e=gd,gd=null,nr=e):nr=n):nr=tr?md(e.stateNode.nextSibling):null;return!0}function dr(){nr=tr=null,ir=!1}function hr(){var e=rr;return null!==e&&(null===vc?vc=e:vc.push.apply(vc,e),rr=null),e}function fr(e){null===rr?rr=[e]:rr.push(e)}var pr=U(null),mr=null,gr=null;function vr(e,t,n){F(pr,t._currentValue),t._currentValue=n}function yr(e){e._currentValue=pr.current,z(pr)}function xr(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function _r(e,t,n,r){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var o=a.dependencies;if(null!==o){var s=a.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),xr(o.return,n,e),r||(s=null);break e}o=l.next}}else if(18===a.tag){if(null===(s=a.return))throw Error(i(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),xr(s,n,e),s=null}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}}function br(e,t,n,r){e=null;for(var a=t,o=!1;null!==a;){if(!o)if(524288&a.flags)o=!0;else if(262144&a.flags)break;if(10===a.tag){var s=a.alternate;if(null===s)throw Error(i(387));if(null!==(s=s.memoizedProps)){var l=a.type;qn(a.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(a===j.current){if(null===(s=a.alternate))throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(Xd):e=[Xd])}a=a.return}null!==e&&_r(t,e,n,r),t.flags|=262144}function Sr(e){for(e=e.firstContext;null!==e;){if(!qn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wr(e){mr=e,gr=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Mr(e){return Tr(mr,e)}function Er(e,t){return null===mr&&wr(e),Tr(e,t)}function Tr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===gr){if(null===e)throw Error(i(308));gr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gr=gr.next=t;return n}var Ar="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},Cr=e.unstable_scheduleCallback,Pr=e.unstable_NormalPriority,Rr={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lr(){return{controller:new Ar,data:new Map,refCount:0}}function kr(e){e.refCount--,0===e.refCount&&Cr(Pr,(function(){e.controller.abort()}))}var Nr=null,Dr=0,Ir=0,Or=null;function Ur(){if(0==--Dr&&null!==Nr){null!==Or&&(Or.status="fulfilled");var e=Nr;Nr=null,Ir=0,Or=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var zr=k.S;k.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Nr){var n=Nr=[];Dr=0,Ir=Au(),Or={status:"pending",value:void 0,then:function(e){n.push(e)}}}Dr++,t.then(Ur,Ur)}(0,t),null!==zr&&zr(e,t)};var Fr=U(null);function Br(){var e=Fr.current;return null!==e?e:tc.pooledCache}function Hr(e,t){F(Fr,null===t?Fr.current:t.pool)}function Vr(){var e=Br();return null===e?null:{parent:Rr._currentValue,pool:e}}var jr=Error(i(460)),Gr=Error(i(474)),Wr=Error(i(542)),Xr={then:function(){}};function qr(e){return"fulfilled"===(e=e.status)||"rejected"===e}function $r(){}function Yr(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then($r,$r),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw Qr(e=t.reason),e;default:if("string"==typeof t.status)t.then($r,$r);else{if(null!==(e=tc)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))}switch(t.status){case"fulfilled":return t.value;case"rejected":throw Qr(e=t.reason),e}throw Zr=t,jr}}var Zr=null;function Kr(){if(null===Zr)throw Error(i(459));var e=Zr;return Zr=null,e}function Qr(e){if(e===jr||e===Wr)throw Error(i(483))}var Jr=!1;function ea(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ta(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ia(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,2&ec){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Li(e),Ri(e,null,n),t}return Ai(e,i,t,n),Li(e)}function ra(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Ee(e,n)}}function aa(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?r=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?r=a=t:a=a.next=t}else r=a=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oa=!1;function sa(){if(oa){if(null!==Or)throw Or}}function la(e,t,n,i){oa=!1;var r=e.updateQueue;Jr=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,s=r.shared.pending;if(null!==s){r.shared.pending=null;var l=s,u=l.next;l.next=null,null===o?a=u:o.next=u,o=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===s?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=l))}if(null!==a){var h=r.baseState;for(o=0,d=u=l=null,s=a;;){var f=-536870913&s.lane,p=f!==s.lane;if(p?(ic&f)===f:(i&f)===f){0!==f&&f===Ir&&(oa=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;f=t;var v=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(v,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(v,h,f):m))break e;h=c({},h,f);break e;case 2:Jr=!0}}null!==(f=s.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(u=d=p,l=h):d=d.next=p,o|=f;if(null===(s=s.next)){if(null===(s=r.shared.pending))break;s=(p=s).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===d&&(l=h),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,null===a&&(r.shared.lanes=0),dc|=o,e.lanes=o,e.memoizedState=h}}function ca(e,t){if("function"!=typeof e)throw Error(i(191,e));e.call(t)}function ua(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ca(n[e],t)}var da=U(null),ha=U(0);function fa(e,t){F(ha,e=cc),F(da,t),cc=e|t.baseLanes}function pa(){F(ha,cc),F(da,da.current)}function ma(){cc=ha.current,z(da),z(ha)}var ga=0,va=null,ya=null,xa=null,_a=!1,ba=!1,Sa=!1,wa=0,Ma=0,Ea=null,Ta=0;function Aa(){throw Error(i(321))}function Ca(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qn(e[n],t[n]))return!1;return!0}function Pa(e,t,n,i,r,a){return ga=a,va=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=null===e||null===e.memoizedState?Go:Wo,Sa=!1,a=n(i,r),Sa=!1,ba&&(a=La(t,n,i,r)),Ra(e),a}function Ra(e){k.H=jo;var t=null!==ya&&null!==ya.next;if(ga=0,xa=ya=va=null,_a=!1,Ma=0,Ea=null,t)throw Error(i(300));null===e||Es||null!==(e=e.dependencies)&&Sr(e)&&(Es=!0)}function La(e,t,n,r){va=e;var a=0;do{if(ba&&(Ea=null),Ma=0,ba=!1,25<=a)throw Error(i(301));if(a+=1,xa=ya=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}k.H=Xo,o=t(n,r)}while(ba);return o}function ka(){var e=k.H,t=e.useState()[0];return t="function"==typeof t.then?za(t):t,e=e.useState()[0],(null!==ya?ya.memoizedState:null)!==e&&(va.flags|=1024),t}function Na(){var e=0!==wa;return wa=0,e}function Da(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ia(e){if(_a){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}_a=!1}ga=0,xa=ya=va=null,ba=!1,Ma=wa=0,Ea=null}function Oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===xa?va.memoizedState=xa=e:xa=xa.next=e,xa}function Ua(){if(null===ya){var e=va.alternate;e=null!==e?e.memoizedState:null}else e=ya.next;var t=null===xa?va.memoizedState:xa.next;if(null!==t)xa=t,ya=e;else{if(null===e){if(null===va.alternate)throw Error(i(467));throw Error(i(310))}e={memoizedState:(ya=e).memoizedState,baseState:ya.baseState,baseQueue:ya.baseQueue,queue:ya.queue,next:null},null===xa?va.memoizedState=xa=e:xa=xa.next=e}return xa}function za(e){var t=Ma;return Ma+=1,null===Ea&&(Ea=[]),e=Yr(Ea,e,t),t=va,null===(null===xa?t.memoizedState:xa.next)&&(t=t.alternate,k.H=null===t||null===t.memoizedState?Go:Wo),e}function Fa(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return za(e);if(e.$$typeof===x)return Mr(e)}throw Error(i(438,String(e)))}function Ba(e){var t=null,n=va.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var i=va.alternate;null!==i&&(null!==(i=i.updateQueue)&&(null!=(i=i.memoCache)&&(t={data:i.data.map((function(e){return e.slice()})),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=T;return t.index++,n}function Ha(e,t){return"function"==typeof t?t(e):t}function Va(e){return ja(Ua(),ya,e)}function ja(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,null===a)e.memoizedState=o;else{var l=s=null,c=null,u=t=a.next,d=!1;do{var h=-536870913&u.lane;if(h!==u.lane?(ic&h)===h:(ga&h)===h){var f=u.revertLane;if(0===f)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),h===Ir&&(d=!0);else{if((ga&f)===f){u=u.next,f===Ir&&(d=!0);continue}h={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=h,s=o):c=c.next=h,va.lanes|=f,dc|=f}h=u.action,Sa&&n(o,h),o=u.hasEagerState?u.eagerState:n(o,h)}else f={lane:h,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=o):c=c.next=f,va.lanes|=h,dc|=h;u=u.next}while(null!==u&&u!==t);if(null===c?s=o:c.next=l,!qn(o,e.memoizedState)&&(Es=!0,d&&null!==(n=Or)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,r.lastRenderedState=o}return null===a&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ga(e){var t=Ua(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{o=e(o,s.action),s=s.next}while(s!==a);qn(o,t.memoizedState)||(Es=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wa(e,t,n){var r=va,a=Ua(),o=ir;if(o){if(void 0===n)throw Error(i(407));n=n()}else n=t();var s=!qn((ya||a).memoizedState,n);if(s&&(a.memoizedState=n,Es=!0),a=a.queue,mo(2048,8,$a.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||null!==xa&&1&xa.memoizedState.tag){if(r.flags|=2048,ho(9,{destroy:void 0,resource:void 0},qa.bind(null,r,a,n,t),null),null===tc)throw Error(i(349));o||124&ga||Xa(r,t,n)}return n}function Xa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=va.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function qa(e,t,n,i){t.value=n,t.getSnapshot=i,Ya(t)&&Za(e)}function $a(e,t,n){return n((function(){Ya(t)&&Za(e)}))}function Ya(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qn(e,n)}catch(e){return!0}}function Za(e){var t=Pi(e,2);null!==t&&Dc(t,e,2)}function Ka(e){var t=Oa();if("function"==typeof e){var n=e;if(e=n(),Sa){ue(!0);try{n()}finally{ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:e},t}function Qa(e,t,n,i){return e.baseState=n,ja(e,ya,"function"==typeof i?i:Ha)}function Ja(e,t,n,r,a){if(Bo(e))throw Error(i(485));if(null!==(e=t.action)){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==k.T?n(!0):o.isTransition=!1,r(o),null===(n=t.pending)?(o.next=t.pending=o,eo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function eo(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(r,i),l=k.S;null!==l&&l(o,s),to(e,t,s)}catch(n){io(e,t,n)}finally{k.T=a}}else try{to(e,t,a=n(r,i))}catch(n){io(e,t,n)}}function to(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then((function(n){no(e,t,n)}),(function(n){return io(e,t,n)})):no(e,t,n)}function no(e,t,n){t.status="fulfilled",t.value=n,ro(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,eo(e,n)))}function io(e,t,n){var i=e.pending;if(e.pending=null,null!==i){i=i.next;do{t.status="rejected",t.reason=n,ro(t),t=t.next}while(t!==i)}e.action=null}function ro(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ao(e,t){return t}function oo(e,t){if(ir){var n=tc.formState;if(null!==n){e:{var i=va;if(ir){if(nr){t:{for(var r=nr,a=ar;8!==r.nodeType;){if(!a){r=null;break t}if(null===(r=md(r.nextSibling))){r=null;break t}}r="F!"===(a=r.data)||"F"===a?r:null}if(r){nr=md(r.nextSibling),i="F!"===r.data;break e}}sr(i)}i=!1}i&&(t=n[0])}}return(n=Oa()).memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},n.queue=i,n=Uo.bind(null,va,i),i.dispatch=n,i=Ka(!1),a=Fo.bind(null,va,!1,i.queue),r={state:t,dispatch:null,action:e,pending:null},(i=Oa()).queue=r,n=Ja.bind(null,va,r,a,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function so(e){return lo(Ua(),ya,e)}function lo(e,t,n){if(t=ja(e,t,ao)[0],e=Va(Ha)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var i=za(t)}catch(e){if(e===jr)throw Wr;throw e}else i=t;var r=(t=Ua()).queue,a=r.dispatch;return n!==t.memoizedState&&(va.flags|=2048,ho(9,{destroy:void 0,resource:void 0},co.bind(null,r,n),null)),[i,a,e]}function co(e,t){e.action=t}function uo(e){var t=Ua(),n=ya;if(null!==n)return lo(t,n,e);Ua(),t=t.memoizedState;var i=(n=Ua()).queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ho(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},null===(t=va.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},va.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function fo(){return Ua().memoizedState}function po(e,t,n,i){var r=Oa();i=void 0===i?null:i,va.flags|=e,r.memoizedState=ho(1|t,{destroy:void 0,resource:void 0},n,i)}function mo(e,t,n,i){var r=Ua();i=void 0===i?null:i;var a=r.memoizedState.inst;null!==ya&&null!==i&&Ca(i,ya.memoizedState.deps)?r.memoizedState=ho(t,a,n,i):(va.flags|=e,r.memoizedState=ho(1|t,a,n,i))}function go(e,t){po(8390656,8,e,t)}function vo(e,t){mo(2048,8,e,t)}function yo(e,t){return mo(4,2,e,t)}function xo(e,t){return mo(4,4,e,t)}function _o(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function bo(e,t,n){n=null!=n?n.concat([e]):null,mo(4,4,_o.bind(null,t,e),n)}function So(){}function wo(e,t){var n=Ua();t=void 0===t?null:t;var i=n.memoizedState;return null!==t&&Ca(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Mo(e,t){var n=Ua();t=void 0===t?null:t;var i=n.memoizedState;if(null!==t&&Ca(t,i[1]))return i[0];if(i=e(),Sa){ue(!0);try{e()}finally{ue(!1)}}return n.memoizedState=[i,t],i}function Eo(e,t,n){return void 0===n||1073741824&ga?e.memoizedState=t:(e.memoizedState=n,e=Nc(),va.lanes|=e,dc|=e,n)}function To(e,t,n,i){return qn(n,t)?n:null!==da.current?(e=Eo(e,n,i),qn(e,t)||(Es=!0),e):42&ga?(e=Nc(),va.lanes|=e,dc|=e,t):(Es=!0,e.memoizedState=n)}function Ao(e,t,n,i,r){var a=N.p;N.p=0!==a&&8>a?a:8;var o,s,l,c=k.T,u={};k.T=u,Fo(e,!1,t,n);try{var d=r(),h=k.S;if(null!==h&&h(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)zo(e,t,(o=i,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then((function(){l.status="fulfilled",l.value=o;for(var e=0;e<s.length;e++)(0,s[e])(o)}),(function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)})),l),kc());else zo(e,t,i,kc())}catch(n){zo(e,t,{then:function(){},status:"rejected",reason:n},kc())}finally{N.p=a,k.T=c}}function Co(){}function Po(e,t,n,r){if(5!==e.tag)throw Error(i(476));var a=Ro(e).queue;Ao(e,a,t,D,null===n?Co:function(){return Lo(e),n(r)})}function Ro(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:D},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Lo(e){zo(e,Ro(e).next.queue,{},kc())}function ko(){return Mr(Xd)}function No(){return Ua().memoizedState}function Do(){return Ua().memoizedState}function Io(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=kc(),i=ia(t,e=na(n),n);return null!==i&&(Dc(i,t,n),ra(i,t,n)),t={cache:Lr()},void(e.payload=t)}t=t.return}}function Oo(e,t,n){var i=kc();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Bo(e)?Ho(t,n):null!==(n=Ci(e,t,n,i))&&(Dc(n,e,i),Vo(n,t,i))}function Uo(e,t,n){zo(e,t,n,kc())}function zo(e,t,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bo(e))Ho(t,r);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(r.hasEagerState=!0,r.eagerState=s,qn(s,o))return Ai(e,t,r,0),null===tc&&Ti(),!1}catch(e){}if(null!==(n=Ci(e,t,r,i)))return Dc(n,e,i),Vo(n,t,i),!0}return!1}function Fo(e,t,n,r){if(r={lane:2,revertLane:Au(),action:r,hasEagerState:!1,eagerState:null,next:null},Bo(e)){if(t)throw Error(i(479))}else null!==(t=Ci(e,n,r,2))&&Dc(t,e,2)}function Bo(e){var t=e.alternate;return e===va||null!==t&&t===va}function Ho(e,t){ba=_a=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vo(e,t,n){if(4194048&n){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Ee(e,n)}}var jo={readContext:Mr,use:Fa,useCallback:Aa,useContext:Aa,useEffect:Aa,useImperativeHandle:Aa,useLayoutEffect:Aa,useInsertionEffect:Aa,useMemo:Aa,useReducer:Aa,useRef:Aa,useState:Aa,useDebugValue:Aa,useDeferredValue:Aa,useTransition:Aa,useSyncExternalStore:Aa,useId:Aa,useHostTransitionStatus:Aa,useFormState:Aa,useActionState:Aa,useOptimistic:Aa,useMemoCache:Aa,useCacheRefresh:Aa},Go={readContext:Mr,use:Fa,useCallback:function(e,t){return Oa().memoizedState=[e,void 0===t?null:t],e},useContext:Mr,useEffect:go,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,po(4194308,4,_o.bind(null,t,e),n)},useLayoutEffect:function(e,t){return po(4194308,4,e,t)},useInsertionEffect:function(e,t){po(4,2,e,t)},useMemo:function(e,t){var n=Oa();t=void 0===t?null:t;var i=e();if(Sa){ue(!0);try{e()}finally{ue(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Oa();if(void 0!==n){var r=n(t);if(Sa){ue(!0);try{n(t)}finally{ue(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=Oo.bind(null,va,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},Oa().memoizedState=e},useState:function(e){var t=(e=Ka(e)).queue,n=Uo.bind(null,va,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:So,useDeferredValue:function(e,t){return Eo(Oa(),e,t)},useTransition:function(){var e=Ka(!1);return e=Ao.bind(null,va,e.queue,!0,!1),Oa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=va,a=Oa();if(ir){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===tc)throw Error(i(349));124&ic||Xa(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,go($a.bind(null,r,o,e),[e]),r.flags|=2048,ho(9,{destroy:void 0,resource:void 0},qa.bind(null,r,o,n,t),null),n},useId:function(){var e=Oa(),t=tc.identifierPrefix;if(ir){var n=Zi;t="«"+t+"R"+(n=(Yi&~(1<<32-de(Yi)-1)).toString(32)+n),0<(n=wa++)&&(t+="H"+n.toString(32)),t+="»"}else t="«"+t+"r"+(n=Ta++).toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:ko,useFormState:oo,useActionState:oo,useOptimistic:function(e){var t=Oa();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fo.bind(null,va,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ba,useCacheRefresh:function(){return Oa().memoizedState=Io.bind(null,va)}},Wo={readContext:Mr,use:Fa,useCallback:wo,useContext:Mr,useEffect:vo,useImperativeHandle:bo,useInsertionEffect:yo,useLayoutEffect:xo,useMemo:Mo,useReducer:Va,useRef:fo,useState:function(){return Va(Ha)},useDebugValue:So,useDeferredValue:function(e,t){return To(Ua(),ya.memoizedState,e,t)},useTransition:function(){var e=Va(Ha)[0],t=Ua().memoizedState;return["boolean"==typeof e?e:za(e),t]},useSyncExternalStore:Wa,useId:No,useHostTransitionStatus:ko,useFormState:so,useActionState:so,useOptimistic:function(e,t){return Qa(Ua(),0,e,t)},useMemoCache:Ba,useCacheRefresh:Do},Xo={readContext:Mr,use:Fa,useCallback:wo,useContext:Mr,useEffect:vo,useImperativeHandle:bo,useInsertionEffect:yo,useLayoutEffect:xo,useMemo:Mo,useReducer:Ga,useRef:fo,useState:function(){return Ga(Ha)},useDebugValue:So,useDeferredValue:function(e,t){var n=Ua();return null===ya?Eo(n,e,t):To(n,ya.memoizedState,e,t)},useTransition:function(){var e=Ga(Ha)[0],t=Ua().memoizedState;return["boolean"==typeof e?e:za(e),t]},useSyncExternalStore:Wa,useId:No,useHostTransitionStatus:ko,useFormState:uo,useActionState:uo,useOptimistic:function(e,t){var n=Ua();return null!==ya?Qa(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ba,useCacheRefresh:Do},qo=null,$o=0;function Yo(e){var t=$o;return $o+=1,null===qo&&(qo=[]),Yr(qo,e,t)}function Zo(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Ko(e,t){if(t.$$typeof===d)throw Error(i(525));throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qo(e){return(0,e._init)(e._payload)}function Jo(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=Oi(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=67108866,n):i:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=Bi(n,e.mode,i)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,i){var r=n.type;return r===p?d(e,t,n.props.children,i,n.key):null!==t&&(t.elementType===r||"object"==typeof r&&null!==r&&r.$$typeof===M&&Qo(r)===t.type)?(Zo(t=a(t,n.props),n),t.return=e,t):(Zo(t=zi(n.type,n.key,n.props,null,e.mode,i),n),t.return=e,t)}function u(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Hi(n,e.mode,i)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,i,r){return null===t||7!==t.tag?((t=Fi(n,e.mode,i,r)).return=e,t):((t=a(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Bi(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case h:return Zo(n=zi(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case f:return(t=Hi(t,e.mode,n)).return=e,t;case M:return m(e,t=(0,t._init)(t._payload),n)}if(L(t)||C(t))return(t=Fi(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,Yo(t),n);if(t.$$typeof===x)return m(e,Er(e,t),n);Ko(e,t)}return null}function g(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:l(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case h:return n.key===r?c(e,t,n,i):null;case f:return n.key===r?u(e,t,n,i):null;case M:return g(e,t,n=(r=n._init)(n._payload),i)}if(L(n)||C(n))return null!==r?null:d(e,t,n,i,null);if("function"==typeof n.then)return g(e,t,Yo(n),i);if(n.$$typeof===x)return g(e,t,Er(e,n),i);Ko(e,n)}return null}function v(e,t,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i||"bigint"==typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case h:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case f:return u(t,e=e.get(null===i.key?n:i.key)||null,i,r);case M:return v(e,t,n,i=(0,i._init)(i._payload),r)}if(L(i)||C(i))return d(t,e=e.get(n)||null,i,r,null);if("function"==typeof i.then)return v(e,t,n,Yo(i),r);if(i.$$typeof===x)return v(e,t,n,Er(t,i),r);Ko(t,i)}return null}function y(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===p&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case h:e:{for(var _=u.key;null!==c;){if(c.key===_){if((_=u.type)===p){if(7===c.tag){n(l,c.sibling),(d=a(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===_||"object"==typeof _&&null!==_&&_.$$typeof===M&&Qo(_)===c.type){n(l,c.sibling),Zo(d=a(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===p?((d=Fi(u.props.children,l.mode,d,u.key)).return=l,l=d):(Zo(d=zi(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case f:e:{for(_=u.key;null!==c;){if(c.key===_){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=a(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Hi(u,l.mode,d)).return=l,l=d}return s(l);case M:return y(l,c,u=(_=u._init)(u._payload),d)}if(L(u))return function(i,a,s,l){for(var c=null,u=null,d=a,h=a=0,f=null;null!==d&&h<s.length;h++){d.index>h?(f=d,d=null):f=d.sibling;var p=g(i,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(i,d),a=o(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(i,d),ir&&Ki(i,h),c;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(a=o(d,a,h),null===u?c=d:u.sibling=d,u=d);return ir&&Ki(i,h),c}for(d=r(d);h<s.length;h++)null!==(f=v(d,i,h,s[h],l))&&(e&&null!==f.alternate&&d.delete(null===f.key?h:f.key),a=o(f,a,h),null===u?c=f:u.sibling=f,u=f);return e&&d.forEach((function(e){return t(i,e)})),ir&&Ki(i,h),c}(l,c,u,d);if(C(u)){if("function"!=typeof(_=C(u)))throw Error(i(150));return function(a,s,l,c){if(null==l)throw Error(i(151));for(var u=null,d=null,h=s,f=s=0,p=null,y=l.next();null!==h&&!y.done;f++,y=l.next()){h.index>f?(p=h,h=null):p=h.sibling;var x=g(a,h,y.value,c);if(null===x){null===h&&(h=p);break}e&&h&&null===x.alternate&&t(a,h),s=o(x,s,f),null===d?u=x:d.sibling=x,d=x,h=p}if(y.done)return n(a,h),ir&&Ki(a,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=m(a,y.value,c))&&(s=o(y,s,f),null===d?u=y:d.sibling=y,d=y);return ir&&Ki(a,f),u}for(h=r(h);!y.done;f++,y=l.next())null!==(y=v(h,a,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=o(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(a,e)})),ir&&Ki(a,f),u}(l,c,u=_.call(u),d)}if("function"==typeof u.then)return y(l,c,Yo(u),d);if(u.$$typeof===x)return y(l,c,Er(l,u),d);Ko(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=a(c,u)).return=l,l=d):(n(l,c),(d=Bi(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,i){try{$o=0;var r=y(e,t,n,i);return qo=null,r}catch(t){if(t===jr||t===Wr)throw t;var a=Di(29,t,null,e.mode);return a.lanes=i,a.return=e,a}}}var es=Jo(!0),ts=Jo(!1),ns=U(null),is=null;function rs(e){var t=e.alternate;F(ls,1&ls.current),F(ns,e),null===is&&(null===t||null!==da.current||null!==t.memoizedState)&&(is=e)}function as(e){if(22===e.tag){if(F(ls,ls.current),F(ns,e),null===is){var t=e.alternate;null!==t&&null!==t.memoizedState&&(is=e)}}else os()}function os(){F(ls,ls.current),F(ns,ns.current)}function ss(e){z(ns),is===e&&(is=null),z(ls)}var ls=U(0);function cs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||pd(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function us(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:c({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ds={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=kc(),r=na(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=ia(e,r,i))&&(Dc(t,e,i),ra(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=kc(),r=na(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=ia(e,r,i))&&(Dc(t,e,i),ra(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kc(),i=na(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=ia(e,i,n))&&(Dc(t,e,n),ra(t,e,n))}};function hs(e,t,n,i,r,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!$n(n,i)||!$n(r,a))}function fs(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ds.enqueueReplaceState(t,t.state,null)}function ps(e,t){var n=t;if("ref"in t)for(var i in n={},t)"ref"!==i&&(n[i]=t[i]);if(e=e.defaultProps)for(var r in n===t&&(n=c({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}var ms="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function gs(e){ms(e)}function vs(e){console.error(e)}function ys(e){ms(e)}function xs(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout((function(){throw e}))}}function _s(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout((function(){throw e}))}}function bs(e,t,n){return(n=na(n)).tag=3,n.payload={element:null},n.callback=function(){xs(e,t)},n}function Ss(e){return(e=na(e)).tag=3,e}function ws(e,t,n,i){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var a=i.value;e.payload=function(){return r(a)},e.callback=function(){_s(t,n,i)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){_s(t,n,i),"function"!=typeof r&&(null===Sc?Sc=new Set([this]):Sc.add(this));var e=i.stack;this.componentDidCatch(i.value,{componentStack:null!==e?e:""})})}var Ms=Error(i(461)),Es=!1;function Ts(e,t,n,i){t.child=null===e?ts(t,null,n,i):es(t,e.child,n,i)}function As(e,t,n,i,r){n=n.render;var a=t.ref;if("ref"in i){var o={};for(var s in i)"ref"!==s&&(o[s]=i[s])}else o=i;return wr(t),i=Pa(e,t,n,o,a,r),s=Na(),null===e||Es?(ir&&s&&Ji(t),t.flags|=1,Ts(e,t,i,r),t.child):(Da(e,t,r),qs(e,t,r))}function Cs(e,t,n,i,r){if(null===e){var a=n.type;return"function"!=typeof a||Ii(a)||void 0!==a.defaultProps||null!==n.compare?((e=zi(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ps(e,t,a,i,r))}if(a=e.child,!$s(e,r)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:$n)(o,i)&&e.ref===t.ref)return qs(e,t,r)}return t.flags|=1,(e=Oi(a,i)).ref=t.ref,e.return=t,t.child=e}function Ps(e,t,n,i,r){if(null!==e){var a=e.memoizedProps;if($n(a,i)&&e.ref===t.ref){if(Es=!1,t.pendingProps=i=a,!$s(e,r))return t.lanes=e.lanes,qs(e,t,r);131072&e.flags&&(Es=!0)}}return Ns(e,t,n,i,r)}function Rs(e,t,n){var i=t.pendingProps,r=i.children,a=null!==e?e.memoizedState:null;if("hidden"===i.mode){if(128&t.flags){if(i=null!==a?a.baseLanes|n:n,null!==e){for(r=t.child=e.child,a=0;null!==r;)a=a|r.lanes|r.childLanes,r=r.sibling;t.childLanes=a&~i}else t.childLanes=0,t.child=null;return Ls(e,t,i,n)}if(!(536870912&n))return t.lanes=t.childLanes=536870912,Ls(e,t,null!==a?a.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Hr(0,null!==a?a.cachePool:null),null!==a?fa(t,a):pa(),as(t)}else null!==a?(Hr(0,a.cachePool),fa(t,a),os(),t.memoizedState=null):(null!==e&&Hr(0,null),pa(),os());return Ts(e,t,r,n),t.child}function Ls(e,t,n,i){var r=Br();return r=null===r?null:{parent:Rr._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},null!==e&&Hr(0,null),pa(),as(t),null!==e&&br(e,t,i,!0),null}function ks(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(i(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Ns(e,t,n,i,r){return wr(t),n=Pa(e,t,n,i,void 0,r),i=Na(),null===e||Es?(ir&&i&&Ji(t),t.flags|=1,Ts(e,t,n,r),t.child):(Da(e,t,r),qs(e,t,r))}function Ds(e,t,n,i,r,a){return wr(t),t.updateQueue=null,n=La(t,i,n,r),Ra(e),i=Na(),null===e||Es?(ir&&i&&Ji(t),t.flags|=1,Ts(e,t,n,a),t.child):(Da(e,t,a),qs(e,t,a))}function Is(e,t,n,i,r){if(wr(t),null===t.stateNode){var a=ki,o=n.contextType;"object"==typeof o&&null!==o&&(a=Mr(o)),a=new n(i,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=ds,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=i,a.state=t.memoizedState,a.refs={},ea(t),o=n.contextType,a.context="object"==typeof o&&null!==o?Mr(o):ki,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(us(t,n,o,i),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&ds.enqueueReplaceState(a,a.state,null),la(t,i,a,r),sa(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=ps(n,s);a.props=l;var c=a.context,u=n.contextType;o=ki,"object"==typeof u&&null!==u&&(o=Mr(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s||c!==o)&&fs(t,a,i,o),Jr=!1;var h=t.memoizedState;a.state=h,la(t,i,a,r),sa(),c=t.memoizedState,s||h!==c||Jr?("function"==typeof d&&(us(t,n,d,i),c=t.memoizedState),(l=Jr||hs(t,n,l,i,h,c,o))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),a.props=i,a.state=c,a.context=o,i=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),i=!1)}else{a=t.stateNode,ta(e,t),u=ps(n,o=t.memoizedProps),a.props=u,d=t.pendingProps,h=a.context,c=n.contextType,l=ki,"object"==typeof c&&null!==c&&(l=Mr(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||h!==l)&&fs(t,a,i,l),Jr=!1,h=t.memoizedState,a.state=h,la(t,i,a,r),sa();var f=t.memoizedState;o!==d||h!==f||Jr||null!==e&&null!==e.dependencies&&Sr(e.dependencies)?("function"==typeof s&&(us(t,n,s,i),f=t.memoizedState),(u=Jr||hs(t,n,u,i,h,f,l)||null!==e&&null!==e.dependencies&&Sr(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,f,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,f,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=f),a.props=i,a.state=f,a.context=l,i=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return a=i,ks(e,t),i=!!(128&t.flags),a||i?(a=t.stateNode,n=i&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&i?(t.child=es(t,e.child,null,r),t.child=es(t,null,n,r)):Ts(e,t,n,r),t.memoizedState=a.state,e=t.child):e=qs(e,t,r),e}function Os(e,t,n,i){return dr(),t.flags|=256,Ts(e,t,n,i),t.child}var Us={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zs(e){return{baseLanes:e,cachePool:Vr()}}function Fs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=pc),e}function Bs(e,t,n){var r,a=t.pendingProps,o=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&ls.current)),r&&(o=!0,t.flags&=-129),r=!!(32&t.flags),t.flags&=-33,null===e){if(ir){if(o?rs(t):os(),ir){var l,c=nr;if(l=c){e:{for(l=c,c=ar;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=md(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==$i?{id:Yi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},(l=Di(18,null,null,0)).stateNode=c,l.return=t,t.child=l,tr=t,nr=null,l=!0):l=!1}l||sr(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return pd(c)?t.lanes=32:t.lanes=536870912,null;ss(t)}return c=a.children,a=a.fallback,o?(os(),c=Vs({mode:"hidden",children:c},o=t.mode),a=Fi(a,o,n,null),c.return=t,a.return=t,c.sibling=a,t.child=c,(o=t.child).memoizedState=zs(n),o.childLanes=Fs(e,r,n),t.memoizedState=Us,a):(rs(t),Hs(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(s)256&t.flags?(rs(t),t.flags&=-257,t=js(e,t,n)):null!==t.memoizedState?(os(),t.child=e.child,t.flags|=128,t=null):(os(),o=a.fallback,c=t.mode,a=Vs({mode:"visible",children:a.children},c),(o=Fi(o,c,n,null)).flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,es(t,e.child,null,n),(a=t.child).memoizedState=zs(n),a.childLanes=Fs(e,r,n),t.memoizedState=Us,t=o);else if(rs(t),pd(c)){if(r=c.nextSibling&&c.nextSibling.dataset)var u=r.dgst;r=u,(a=Error(i(419))).stack="",a.digest=r,fr({value:a,source:null,stack:null}),t=js(e,t,n)}else if(Es||br(e,t,n,!1),r=!!(n&e.childLanes),Es||r){if(null!==(r=tc)&&(0!==(a=(a=42&(a=n&-n)?1:Te(a))&(r.suspendedLanes|n)?0:a)&&a!==l.retryLane))throw l.retryLane=a,Pi(e,a),Dc(r,e,a),Ms;"$?"===c.data||Wc(),t=js(e,t,n)}else"$?"===c.data?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,nr=md(c.nextSibling),tr=t,ir=!0,rr=null,ar=!1,null!==e&&(Xi[qi++]=Yi,Xi[qi++]=Zi,Xi[qi++]=$i,Yi=e.id,Zi=e.overflow,$i=t),(t=Hs(t,a.children)).flags|=4096);return t}return o?(os(),o=a.fallback,c=t.mode,u=(l=e.child).sibling,(a=Oi(l,{mode:"hidden",children:a.children})).subtreeFlags=65011712&l.subtreeFlags,null!==u?o=Oi(u,o):(o=Fi(o,c,n,null)).flags|=2,o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,null===(c=e.child.memoizedState)?c=zs(n):(null!==(l=c.cachePool)?(u=Rr._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Vr(),c={baseLanes:c.baseLanes|n,cachePool:l}),o.memoizedState=c,o.childLanes=Fs(e,r,n),t.memoizedState=Us,a):(rs(t),e=(n=e.child).sibling,(n=Oi(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function Hs(e,t){return(t=Vs({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Vs(e,t){return(e=Di(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function js(e,t,n){return es(t,e.child,null,n),(e=Hs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Gs(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),xr(e.return,t,n)}function Ws(e,t,n,i,r){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r)}function Xs(e,t,n){var i=t.pendingProps,r=i.revealOrder,a=i.tail;if(Ts(e,t,i.children,n),2&(i=ls.current))i=1&i|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Gs(e,n,t);else if(19===e.tag)Gs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(F(ls,i),r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===cs(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ws(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===cs(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ws(t,!0,n,null,a);break;case"together":Ws(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),dc|=t.lanes,!(n&t.childLanes)){if(null===e)return null;if(br(e,t,n,!1),!(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Oi(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Oi(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function $s(e,t){return!!(e.lanes&t)||!(null===(e=e.dependencies)||!Sr(e))}function Ys(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Es=!0;else{if(!($s(e,n)||128&t.flags))return Es=!1,function(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),vr(0,Rr,e.memoizedState.cache),dr();break;case 27:case 5:X(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:vr(0,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(null!==i)return null!==i.dehydrated?(rs(t),t.flags|=128,null):n&t.child.childLanes?Bs(e,t,n):(rs(t),null!==(e=qs(e,t,n))?e.sibling:null);rs(t);break;case 19:var r=!!(128&e.flags);if((i=!!(n&t.childLanes))||(br(e,t,n,!1),i=!!(n&t.childLanes)),r){if(i)return Xs(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),F(ls,ls.current),i)break;return null;case 22:case 23:return t.lanes=0,Rs(e,t,n);case 24:vr(0,Rr,e.memoizedState.cache)}return qs(e,t,n)}(e,t,n);Es=!!(131072&e.flags)}else Es=!1,ir&&1048576&t.flags&&Qi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,a=r._init;if(r=a(r._payload),t.type=r,"function"!=typeof r){if(null!=r){if((a=r.$$typeof)===_){t.tag=11,t=As(null,t,r,e,n);break e}if(a===w){t.tag=14,t=Cs(null,t,r,e,n);break e}}throw t=R(r)||r,Error(i(306,t,""))}Ii(r)?(e=ps(r,e),t.tag=1,t=Is(null,t,r,e,n)):(t.tag=0,t=Ns(null,t,r,e,n))}return t;case 0:return Ns(e,t,t.type,t.pendingProps,n);case 1:return Is(e,t,r=t.type,a=ps(r,t.pendingProps),n);case 3:e:{if(G(t,t.stateNode.containerInfo),null===e)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ta(e,t),la(t,r,null,n);var s=t.memoizedState;if(r=s.cache,vr(0,Rr,r),r!==o.cache&&_r(t,[Rr],n,!0),sa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Os(e,t,r,n);break e}if(r!==a){fr(a=Si(Error(i(424)),t)),t=Os(e,t,r,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(nr=md(e.firstChild),tr=t,ir=!0,rr=null,ar=!0,n=ts(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(dr(),r===a){t=qs(e,t,n);break e}Ts(e,t,r,n)}t=t.child}return t;case 26:return ks(e,t),null===e?(n=Td(t.type,null,t.pendingProps,null))?t.memoizedState=n:ir||(n=t.type,e=t.pendingProps,(r=td(V.current).createElement(n))[Re]=t,r[Le]=e,Qu(r,n,e),je(r),t.stateNode=r):t.memoizedState=Td(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),null===e&&ir&&(r=t.stateNode=yd(t.type,t.pendingProps,V.current),tr=t,ar=!0,a=nr,dd(t.type)?(gd=a,nr=md(r.firstChild)):nr=a),Ts(e,t,t.pendingProps.children,n),ks(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&ir&&((a=r=nr)&&(null!==(r=function(e,t,n,i){for(;1===e.nodeType;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(i){if(!e[Ue])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===a)return e}if(null===(e=md(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,ar))?(t.stateNode=r,tr=t,nr=md(r.firstChild),ar=!1,a=!0):a=!1),a||sr(t)),X(t),a=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,r=o.children,rd(a,o)?r=null:null!==s&&rd(a,s)&&(t.flags|=32),null!==t.memoizedState&&(a=Pa(e,t,ka,null,null,n),Xd._currentValue=a),ks(e,t),Ts(e,t,r,n),t.child;case 6:return null===e&&ir&&((e=n=nr)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=md(e.nextSibling)))return null}return e}(n,t.pendingProps,ar))?(t.stateNode=n,tr=t,nr=null,e=!0):e=!1),e||sr(t)),null;case 13:return Bs(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=es(t,null,r,n):Ts(e,t,r,n),t.child;case 11:return As(e,t,t.type,t.pendingProps,n);case 7:return Ts(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ts(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,vr(0,t.type,r.value),Ts(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,wr(t),r=r(a=Mr(a)),t.flags|=1,Ts(e,t,r,n),t.child;case 14:return Cs(e,t,t.type,t.pendingProps,n);case 15:return Ps(e,t,t.type,t.pendingProps,n);case 19:return Xs(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},null===e?((n=Vs(r,n)).ref=t.ref,t.child=n,n.return=t,t=n):((n=Oi(e.child,r)).ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Rs(e,t,n);case 24:return wr(t),r=Mr(Rr),null===e?(null===(a=Br())&&(a=tc,o=Lr(),a.pooledCache=o,o.refCount++,null!==o&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ea(t),vr(0,Rr,a)):(!!(e.lanes&n)&&(ta(e,t),la(t,null,null,n),sa()),a=e.memoizedState,o=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),vr(0,Rr,r)):(r=o.cache,vr(0,Rr,r),r!==a.cache&&_r(t,[Rr],n,!0))),Ts(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Zs(e){e.flags|=4}function Ks(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!Fd(t)){if(null!==(t=ns.current)&&((4194048&ic)===ic?null!==is:(62914560&ic)!==ic&&!(536870912&ic)||t!==is))throw Zr=Xr,Gr;e.flags|=8192}}function Qs(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?be():536870912,e.lanes|=t,mc|=t)}function Js(e,t){if(!ir)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function el(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=65011712&r.subtreeFlags,i|=65011712&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function tl(e,t,n){var r=t.pendingProps;switch(er(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return el(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),yr(Rr),W(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ur(t)?Zs(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,hr())),el(t),null;case 26:return n=t.memoizedState,null===e?(Zs(t),null!==n?(el(t),Ks(t,n)):(el(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Zs(t),el(t),Ks(t,n)):(el(t),t.flags&=-16777217):(e.memoizedProps!==r&&Zs(t),el(t),t.flags&=-16777217),null;case 27:q(t),n=V.current;var a=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return el(t),null}e=B.current,ur(t)?lr(t):(e=yd(a,r,n),t.stateNode=e,Zs(t))}return el(t),null;case 5:if(q(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return el(t),null}if(e=B.current,ur(t))lr(t);else{switch(a=td(V.current),e){case 1:e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?a.createElement(n,{is:r.is}):a.createElement(n)}}e[Re]=t,e[Le]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)e.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;e:switch(Qu(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Zs(t)}}return el(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Zs(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=V.current,ur(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(a=tr))switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Re]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||$u(e.nodeValue,n)))||sr(t)}else(e=td(e).createTextNode(r))[Re]=t,t.stateNode=e}return el(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ur(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[Re]=t}else dr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;el(t),a=!1}else a=hr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(ss(t),t):(ss(t),null)}if(ss(t),128&t.flags)return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){a=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(a=r.alternate.memoizedState.cachePool.pool);var o=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Qs(t,t.updateQueue),el(t),null;case 4:return W(),null===e&&zu(t.stateNode.containerInfo),el(t),null;case 10:return yr(t.type),el(t),null;case 19:if(z(ls),null===(a=t.memoizedState))return el(t),null;if(r=!!(128&t.flags),null===(o=a.rendering))if(r)Js(a,!1);else{if(0!==uc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=cs(e))){for(t.flags|=128,Js(a,!1),e=o.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ui(n,e),n=n.sibling;return F(ls,1&ls.current|2),t.child}e=e.sibling}null!==a.tail&&J()>_c&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=cs(o))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Js(a,!0),null===a.tail&&"hidden"===a.tailMode&&!o.alternate&&!ir)return el(t),null}else 2*J()-a.renderingStartTime>_c&&536870912!==n&&(t.flags|=128,r=!0,Js(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=a.last)?e.sibling=o:t.child=o,a.last=o)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=J(),t.sibling=null,e=ls.current,F(ls,r?1&e|2:1&e),t):(el(t),null);case 22:case 23:return ss(t),ma(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(el(t),6&t.subtreeFlags&&(t.flags|=8192)):el(t),null!==(n=t.updateQueue)&&Qs(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&z(Fr),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),yr(Rr),el(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function nl(e,t){switch(er(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return yr(Rr),W(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 13:if(ss(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));dr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return z(ls),null;case 4:return W(),null;case 10:return yr(t.type),null;case 22:case 23:return ss(t),ma(),null!==e&&z(Fr),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return yr(Rr),null;default:return null}}function il(e,t){switch(er(t),t.tag){case 3:yr(Rr),W();break;case 26:case 27:case 5:q(t);break;case 4:W();break;case 13:ss(t);break;case 19:z(ls);break;case 10:yr(t.type);break;case 22:case 23:ss(t),ma(),null!==e&&z(Fr);break;case 24:yr(Rr)}}function rl(e,t){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var a=n.create,o=n.inst;i=a(),o.destroy=i}n=n.next}while(n!==r)}}catch(e){lu(t,t.return,e)}}function al(e,t,n){try{var i=t.updateQueue,r=null!==i?i.lastEffect:null;if(null!==r){var a=r.next;i=a;do{if((i.tag&e)===e){var o=i.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,r=t;var l=n,c=s;try{c()}catch(e){lu(r,l,e)}}}i=i.next}while(i!==a)}}catch(e){lu(t,t.return,e)}}function ol(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ua(t,n)}catch(t){lu(e,e.return,t)}}}function sl(e,t,n){n.props=ps(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){lu(e,t,n)}}function ll(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;default:i=e.stateNode}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(n){lu(e,t,n)}}function cl(e,t){var n=e.ref,i=e.refCleanup;if(null!==n)if("function"==typeof i)try{i()}catch(n){lu(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){lu(e,t,n)}else n.current=null}function ul(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(t){lu(e,e.return,t)}}function dl(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,s=null,l=null,c=null,u=null,d=null;for(p in n){var h=n[p];if(n.hasOwnProperty(p)&&null!=h)switch(p){case"checked":case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(p)||Zu(e,t,p,null,r,h)}}for(var f in r){var p=r[f];if(h=n[f],r.hasOwnProperty(f)&&(null!=p||null!=h))switch(f){case"type":o=p;break;case"name":a=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":s=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(i(137,t));break;default:p!==h&&Zu(e,t,f,p,r,h)}}return void pt(e,s,l,c,u,d,o,a);case"select":for(o in p=s=l=f=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":p=c;default:r.hasOwnProperty(o)||Zu(e,t,o,null,r,c)}for(a in r)if(o=r[a],c=n[a],r.hasOwnProperty(a)&&(null!=o||null!=c))switch(a){case"value":f=o;break;case"defaultValue":l=o;break;case"multiple":s=o;default:o!==c&&Zu(e,t,a,o,r,c)}return t=l,n=s,r=p,void(null!=f?vt(e,!!n,f,!1):!!r!=!!n&&(null!=t?vt(e,!!n,t,!0):vt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Zu(e,t,l,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(null!=a||null!=o))switch(s){case"value":f=a;break;case"defaultValue":p=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(i(91));break;default:a!==o&&Zu(e,t,s,a,r,o)}return void yt(e,f,p);case"option":for(var m in n)if(f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m))if("selected"===m)e.selected=!1;else Zu(e,t,m,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))if("selected"===c)e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f;else Zu(e,t,c,f,r,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&Zu(e,t,g,null,r,f);for(u in r)if(f=r[u],p=n[u],r.hasOwnProperty(u)&&f!==p&&(null!=f||null!=p))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(i(137,t));break;default:Zu(e,t,u,f,r,p)}return;default:if(Mt(t)){for(var v in n)f=n[v],n.hasOwnProperty(v)&&void 0!==f&&!r.hasOwnProperty(v)&&Ku(e,t,v,void 0,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||void 0===f&&void 0===p||Ku(e,t,d,f,r,p);return}}for(var y in n)f=n[y],n.hasOwnProperty(y)&&null!=f&&!r.hasOwnProperty(y)&&Zu(e,t,y,null,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||null==f&&null==p||Zu(e,t,h,f,r,p)}(r,e.type,n,t),r[Le]=t}catch(t){lu(e,e.return,t)}}function hl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&dd(e.type)||4===e.tag}function fl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||hl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&dd(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function pl(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Yu));else if(4!==i&&(27===i&&dd(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(pl(e,t,n),e=e.sibling;null!==e;)pl(e,t,n),e=e.sibling}function ml(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&(27===i&&dd(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(ml(e,t,n),e=e.sibling;null!==e;)ml(e,t,n),e=e.sibling}function gl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Qu(t,i,n),t[Re]=e,t[Le]=n}catch(t){lu(e,e.return,t)}}var vl=!1,yl=!1,xl=!1,_l="function"==typeof WeakSet?WeakSet:Set,bl=null;function Sl(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Il(e,n),4&i&&rl(5,n);break;case 1:if(Il(e,n),4&i)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){lu(n,n.return,e)}else{var r=ps(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){lu(n,n.return,e)}}64&i&&ol(n),512&i&&ll(n,n.return);break;case 3:if(Il(e,n),64&i&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ua(e,t)}catch(e){lu(n,n.return,e)}}break;case 27:null===t&&4&i&&gl(n);case 26:case 5:Il(e,n),null===t&&4&i&&ul(n),512&i&&ll(n,n.return);break;case 12:Il(e,n);break;case 13:Il(e,n),4&i&&Cl(e,n),64&i&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$?"!==e.data||"complete"===n.readyState)t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}(e,n=hu.bind(null,n))));break;case 22:if(!(i=null!==n.memoizedState||vl)){t=null!==t&&null!==t.memoizedState||yl,r=vl;var a=yl;vl=i,(yl=t)&&!a?Ul(e,n,!!(8772&n.subtreeFlags)):Il(e,n),vl=r,yl=a}break;case 30:break;default:Il(e,n)}}function wl(e){var t=e.alternate;null!==t&&(e.alternate=null,wl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&ze(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ml=null,El=!1;function Tl(e,t,n){for(n=n.child;null!==n;)Al(e,t,n),n=n.sibling}function Al(e,t,n){if(ce&&"function"==typeof ce.onCommitFiberUnmount)try{ce.onCommitFiberUnmount(le,n)}catch(e){}switch(n.tag){case 26:yl||cl(n,t),Tl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:yl||cl(n,t);var i=Ml,r=El;dd(n.type)&&(Ml=n.stateNode,El=!1),Tl(e,t,n),xd(n.stateNode),Ml=i,El=r;break;case 5:yl||cl(n,t);case 6:if(i=Ml,r=El,Ml=null,Tl(e,t,n),El=r,null!==(Ml=i))if(El)try{(9===Ml.nodeType?Ml.body:"HTML"===Ml.nodeName?Ml.ownerDocument.body:Ml).removeChild(n.stateNode)}catch(e){lu(n,t,e)}else try{Ml.removeChild(n.stateNode)}catch(e){lu(n,t,e)}break;case 18:null!==Ml&&(El?(hd(9===(e=Ml).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Eh(e)):hd(Ml,n.stateNode));break;case 4:i=Ml,r=El,Ml=n.stateNode.containerInfo,El=!0,Tl(e,t,n),Ml=i,El=r;break;case 0:case 11:case 14:case 15:yl||al(2,n,t),yl||al(4,n,t),Tl(e,t,n);break;case 1:yl||(cl(n,t),"function"==typeof(i=n.stateNode).componentWillUnmount&&sl(n,t,i)),Tl(e,t,n);break;case 21:Tl(e,t,n);break;case 22:yl=(i=yl)||null!==n.memoizedState,Tl(e,t,n),yl=i;break;default:Tl(e,t,n)}}function Cl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Eh(e)}catch(e){lu(t,t.return,e)}}function Pl(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new _l),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new _l),t;default:throw Error(i(435,e.tag))}}(e);t.forEach((function(t){var i=fu.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}function Rl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(dd(l.type)){Ml=l.stateNode,El=!1;break e}break;case 5:Ml=l.stateNode,El=!1;break e;case 3:case 4:Ml=l.stateNode.containerInfo,El=!0;break e}l=l.return}if(null===Ml)throw Error(i(160));Al(o,s,a),Ml=null,El=!1,null!==(o=a.alternate)&&(o.return=null),a.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)kl(t,e),t=t.sibling}var Ll=null;function kl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rl(t,e),Nl(e),4&r&&(al(3,e,e.return),rl(3,e),al(5,e,e.return));break;case 1:Rl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),64&r&&vl&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var a=Ll;if(Rl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),4&r){var o=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":(!(o=a.getElementsByTagName("title")[0])||o[Ue]||o[Re]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector("head > title"))),Qu(o,r,n),o[Re]=e,je(o),r=o;break e;case"link":var s=Ud("link","href",a).get(r+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((o=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}Qu(o=a.createElement(r),r,n),a.head.appendChild(o);break;case"meta":if(s=Ud("meta","content",a).get(r+(n.content||"")))for(l=0;l<s.length;l++)if((o=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}Qu(o=a.createElement(r),r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[Re]=e,je(o),r=o}e.stateNode=r}else zd(a,e.type,e.stateNode);else e.stateNode=kd(a,r,e.memoizedProps);else o!==r?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===r?zd(a,e.type,e.stateNode):kd(a,r,e.memoizedProps)):null===r&&null!==e.stateNode&&dl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Rl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),null!==n&&4&r&&dl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Rl(t,e),Nl(e),512&r&&(yl||null===n||cl(n,n.return)),32&e.flags){a=e.stateNode;try{_t(a,"")}catch(t){lu(e,e.return,t)}}4&r&&null!=e.stateNode&&dl(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&r&&(xl=!0);break;case 6:if(Rl(t,e),Nl(e),4&r){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){lu(e,e.return,t)}}break;case 3:if(Od=null,a=Ll,Ll=Sd(t.containerInfo),Rl(t,e),Ll=a,Nl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Eh(t.containerInfo)}catch(t){lu(e,e.return,t)}xl&&(xl=!1,Dl(e));break;case 4:r=Ll,Ll=Sd(e.stateNode.containerInfo),Rl(t,e),Nl(e),Ll=r;break;case 12:default:Rl(t,e),Nl(e);break;case 13:Rl(t,e),Nl(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(xc=J()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Pl(e,r)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=vl,d=yl;if(vl=u||a,yl=d||c,Rl(t,e),yl=d,vl=u,Nl(e),8192&r)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||vl||yl||Ol(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(o=c.stateNode,a)"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,f=null!=h&&h.hasOwnProperty("display")?h.display:null;l.style.display=null==f||"boolean"==typeof f?"":(""+f).trim()}}catch(e){lu(c,c.return,e)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(e){lu(c,c.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,Pl(e,n))));break;case 19:Rl(t,e),Nl(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Pl(e,r)));case 30:case 21:}}function Nl(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(hl(r)){n=r;break}r=r.return}if(null==n)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ml(e,fl(e),a);break;case 5:var o=n.stateNode;32&n.flags&&(_t(o,""),n.flags&=-33),ml(e,fl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;pl(e,fl(e),s);break;default:throw Error(i(161))}}catch(t){lu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Dl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Dl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Il(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Sl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:al(4,t,t.return),Ol(t);break;case 1:cl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&sl(t,t.return,n),Ol(t);break;case 27:xd(t.stateNode);case 26:case 5:cl(t,t.return),Ol(t);break;case 22:null===t.memoizedState&&Ol(t);break;default:Ol(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var i=t.alternate,r=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ul(r,a,n),rl(4,a);break;case 1:if(Ul(r,a,n),"function"==typeof(r=(i=a).stateNode).componentDidMount)try{r.componentDidMount()}catch(e){lu(i,i.return,e)}if(null!==(r=(i=a).updateQueue)){var s=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(null!==l)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)ca(l[r],s)}catch(e){lu(i,i.return,e)}}n&&64&o&&ol(a),ll(a,a.return);break;case 27:gl(a);case 26:case 5:Ul(r,a,n),n&&null===i&&4&o&&ul(a),ll(a,a.return);break;case 12:Ul(r,a,n);break;case 13:Ul(r,a,n),n&&4&o&&Cl(r,a);break;case 22:null===a.memoizedState&&Ul(r,a,n),ll(a,a.return);break;case 30:break;default:Ul(r,a,n)}t=t.sibling}}function zl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&kr(n))}function Fl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&kr(e))}function Bl(e,t,n,i){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Hl(e,t,n,i),t=t.sibling}function Hl(e,t,n,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Bl(e,t,n,i),2048&r&&rl(9,t);break;case 1:case 13:default:Bl(e,t,n,i);break;case 3:Bl(e,t,n,i),2048&r&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&kr(e)));break;case 12:if(2048&r){Bl(e,t,n,i),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"==typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){lu(t,t.return,e)}}else Bl(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,null!==t.memoizedState?2&a._visibility?Bl(e,t,n,i):jl(e,t):2&a._visibility?Bl(e,t,n,i):(a._visibility|=2,Vl(e,t,n,i,!!(10256&t.subtreeFlags))),2048&r&&zl(o,t);break;case 24:Bl(e,t,n,i),2048&r&&Fl(t.alternate,t)}}function Vl(e,t,n,i,r){for(r=r&&!!(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,o=t,s=n,l=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:Vl(a,o,s,l,r),rl(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?2&u._visibility?Vl(a,o,s,l,r):jl(a,o):(u._visibility|=2,Vl(a,o,s,l,r)),r&&2048&c&&zl(o.alternate,o);break;case 24:Vl(a,o,s,l,r),r&&2048&c&&Fl(o.alternate,o);break;default:Vl(a,o,s,l,r)}t=t.sibling}}function jl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:jl(n,i),2048&r&&zl(i.alternate,i);break;case 24:jl(n,i),2048&r&&Fl(i.alternate,i);break;default:jl(n,i)}t=t.sibling}}var Gl=8192;function Wl(e){if(e.subtreeFlags&Gl)for(e=e.child;null!==e;)Xl(e),e=e.sibling}function Xl(e){switch(e.tag){case 26:Wl(e),e.flags&Gl&&null!==e.memoizedState&&function(e,t,n){if(null===Bd)throw Error(i(475));var r=Bd;if(!("stylesheet"!==t.type||"string"==typeof n.media&&!1===matchMedia(n.media).matches||4&t.state.loading)){if(null===t.instance){var a=Ad(n.href),o=e.querySelector(Cd(a));if(o)return null!==(e=o._p)&&"object"==typeof e&&"function"==typeof e.then&&(r.count++,r=Vd.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=o,void je(o);o=e.ownerDocument||e,n=Pd(n),(a=_d.get(a))&&Dd(n,a),je(o=o.createElement("link"));var s=o;s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Qu(o,"link",n),t.instance=o}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(3&t.state.loading)&&(r.count++,t=Vd.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(Ll,e.memoizedState,e.memoizedProps);break;case 5:default:Wl(e);break;case 3:case 4:var t=Ll;Ll=Sd(e.stateNode.containerInfo),Wl(e),Ll=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Gl,Gl=16777216,Wl(e),Gl=t):Wl(e))}}function ql(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function $l(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];bl=i,Kl(i,e)}ql(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Yl(e),e=e.sibling}function Yl(e){switch(e.tag){case 0:case 11:case 15:$l(e),2048&e.flags&&al(9,e,e.return);break;case 3:case 12:default:$l(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Zl(e)):$l(e)}}function Zl(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];bl=i,Kl(i,e)}ql(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:al(8,t,t.return),Zl(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Zl(t));break;default:Zl(t)}e=e.sibling}}function Kl(e,t){for(;null!==bl;){var n=bl;switch(n.tag){case 0:case 11:case 15:al(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var i=n.memoizedState.cachePool.pool;null!=i&&i.refCount++}break;case 24:kr(n.memoizedState.cache)}if(null!==(i=n.child))i.return=n,bl=i;else e:for(n=e;null!==bl;){var r=(i=bl).sibling,a=i.return;if(wl(i),i===n){bl=null;break e}if(null!==r){r.return=a,bl=r;break e}bl=a}}}var Ql={getCacheForType:function(e){var t=Mr(Rr),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},Jl="function"==typeof WeakMap?WeakMap:Map,ec=0,tc=null,nc=null,ic=0,rc=0,ac=null,oc=!1,sc=!1,lc=!1,cc=0,uc=0,dc=0,hc=0,fc=0,pc=0,mc=0,gc=null,vc=null,yc=!1,xc=0,_c=1/0,bc=null,Sc=null,wc=0,Mc=null,Ec=null,Tc=0,Ac=0,Cc=null,Pc=null,Rc=0,Lc=null;function kc(){if(2&ec&&0!==ic)return ic&-ic;if(null!==k.T){return 0!==Ir?Ir:Au()}return Ce()}function Nc(){0===pc&&(pc=536870912&ic&&!ir?536870912:_e());var e=ns.current;return null!==e&&(e.flags|=32),pc}function Dc(e,t,n){(e!==tc||2!==rc&&9!==rc)&&null===e.cancelPendingCommit||(Hc(e,0),zc(e,ic,pc,!1)),we(e,n),2&ec&&e===tc||(e===tc&&(!(2&ec)&&(hc|=n),4===uc&&zc(e,ic,pc,!1)),_u(e))}function Ic(e,t,n){if(6&ec)throw Error(i(327));for(var r=!n&&!(124&t)&&!(t&e.expiredLanes)||ye(e,t),a=r?function(e,t){var n=ec;ec|=2;var r=jc(),a=Gc();tc!==e||ic!==t?(bc=null,_c=J()+500,Hc(e,t)):sc=ye(e,t);e:for(;;)try{if(0!==rc&&null!==nc){t=nc;var o=ac;t:switch(rc){case 1:rc=0,ac=null,Kc(e,t,o,1);break;case 2:case 9:if(qr(o)){rc=0,ac=null,Zc(t);break}t=function(){2!==rc&&9!==rc||tc!==e||(rc=7),_u(e)},o.then(t,t);break e;case 3:rc=7;break e;case 4:rc=5;break e;case 7:qr(o)?(rc=0,ac=null,Zc(t)):(rc=0,ac=null,Kc(e,t,o,7));break;case 5:var s=null;switch(nc.tag){case 26:s=nc.memoizedState;case 5:case 27:var l=nc;if(!s||Fd(s)){rc=0,ac=null;var c=l.sibling;if(null!==c)nc=c;else{var u=l.return;null!==u?(nc=u,Qc(u)):nc=null}break t}}rc=0,ac=null,Kc(e,t,o,5);break;case 6:rc=0,ac=null,Kc(e,t,o,6);break;case 8:Bc(),uc=6;break e;default:throw Error(i(462))}}$c();break}catch(t){Vc(e,t)}return gr=mr=null,k.H=r,k.A=a,ec=n,null!==nc?0:(tc=null,ic=0,Ti(),uc)}(e,t):Xc(e,t,!0),o=r;;){if(0===a){sc&&!r&&zc(e,t,0,!1);break}if(n=e.current.alternate,!o||Uc(n)){if(2===a){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;a=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Hc(l,s).flags|=256),2!==(s=Xc(l,s,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=o,hc|=o,a=4;break e}o=vc,vc=a,null!==o&&(null===vc?vc=o:vc.push.apply(vc,o))}a=s}if(o=!1,2!==a)continue}}if(1===a){Hc(e,0),zc(e,t,0,!0);break}e:{switch(r=e,o=a){case 0:case 1:throw Error(i(345));case 4:if((4194048&t)!==t)break;case 6:zc(r,t,pc,!oc);break e;case 2:vc=null;break;case 3:case 5:break;default:throw Error(i(329))}if((62914560&t)===t&&10<(a=xc+300-J())){if(zc(r,t,pc,!oc),0!==ve(r,0,!0))break e;r.timeoutHandle=od(Oc.bind(null,r,n,vc,bc,yc,t,pc,hc,mc,oc,o,2,-0,0),a)}else Oc(r,n,vc,bc,yc,t,pc,hc,mc,oc,o,0,-0,0)}break}a=Xc(e,t,!1),o=!1}_u(e)}function Oc(e,t,n,r,a,o,s,l,c,u,d,h,f,p){if(e.timeoutHandle=-1,(8192&(h=t.subtreeFlags)||!(16785408&~h))&&(Bd={stylesheets:null,count:0,unsuspend:Hd},Xl(t),null!==(h=function(){if(null===Bd)throw Error(i(475));var e=Bd;return e.stylesheets&&0===e.count&&Gd(e,e.stylesheets),0<e.count?function(t){var n=setTimeout((function(){if(e.stylesheets&&Gd(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}),6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=h(eu.bind(null,e,t,o,n,r,a,s,l,c,d,1,f,p)),void zc(e,o,s,!u);eu(e,t,o,n,r,a,s,l,c)}function Uc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!qn(a(),r))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zc(e,t,n,i){t&=~fc,t&=~hc,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var a=31-de(r),o=1<<a;i[a]=-1,r&=~o}0!==n&&Me(e,n,t)}function Fc(){return!!(6&ec)||(bu(0),!1)}function Bc(){if(null!==nc){if(0===rc)var e=nc.return;else gr=mr=null,Ia(e=nc),qo=null,$o=0,e=nc;for(;null!==e;)il(e.alternate,e),e=e.return;nc=null}}function Hc(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,sd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Bc(),tc=e,nc=n=Oi(e.current,null),ic=t,rc=0,ac=null,oc=!1,sc=ye(e,t),lc=!1,mc=pc=fc=hc=dc=uc=0,vc=gc=null,yc=!1,8&t&&(t|=32&t);var i=e.entangledLanes;if(0!==i)for(e=e.entanglements,i&=t;0<i;){var r=31-de(i),a=1<<r;t|=e[r],i&=~a}return cc=t,Ti(),n}function Vc(e,t){va=null,k.H=jo,t===jr||t===Wr?(t=Kr(),rc=3):t===Gr?(t=Kr(),rc=4):rc=t===Ms?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,ac=t,null===nc&&(uc=1,xs(e,Si(t,e.current)))}function jc(){var e=k.H;return k.H=jo,null===e?jo:e}function Gc(){var e=k.A;return k.A=Ql,e}function Wc(){uc=4,oc||(4194048&ic)!==ic&&null!==ns.current||(sc=!0),!(134217727&dc)&&!(134217727&hc)||null===tc||zc(tc,ic,pc,!1)}function Xc(e,t,n){var i=ec;ec|=2;var r=jc(),a=Gc();tc===e&&ic===t||(bc=null,Hc(e,t)),t=!1;var o=uc;e:for(;;)try{if(0!==rc&&null!==nc){var s=nc,l=ac;switch(rc){case 8:Bc(),o=6;break e;case 3:case 2:case 9:case 6:null===ns.current&&(t=!0);var c=rc;if(rc=0,ac=null,Kc(e,s,l,c),n&&sc){o=0;break e}break;default:c=rc,rc=0,ac=null,Kc(e,s,l,c)}}qc(),o=uc;break}catch(t){Vc(e,t)}return t&&e.shellSuspendCounter++,gr=mr=null,ec=i,k.H=r,k.A=a,null===nc&&(tc=null,ic=0,Ti()),o}function qc(){for(;null!==nc;)Yc(nc)}function $c(){for(;null!==nc&&!K();)Yc(nc)}function Yc(e){var t=Ys(e.alternate,e,cc);e.memoizedProps=e.pendingProps,null===t?Qc(e):nc=t}function Zc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ds(n,t,t.pendingProps,t.type,void 0,ic);break;case 11:t=Ds(n,t,t.pendingProps,t.type.render,t.ref,ic);break;case 5:Ia(t);default:il(n,t),t=Ys(n,t=nc=Ui(t,cc),cc)}e.memoizedProps=e.pendingProps,null===t?Qc(e):nc=t}function Kc(e,t,n,r){gr=mr=null,Ia(t),qo=null,$o=0;var a=t.return;try{if(function(e,t,n,r,a){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&br(t,n,a,!0),null!==(n=ns.current)){switch(n.tag){case 13:return null===is?Wc():null===n.alternate&&0===uc&&(uc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Xr?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),cu(e,r,a)),!1;case 22:return n.flags|=65536,r===Xr?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),cu(e,r,a)),!1}throw Error(i(435,n.tag))}return cu(e,r,a),Wc(),!1}if(ir)return null!==(t=ns.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==or&&fr(Si(e=Error(i(422),{cause:r}),n))):(r!==or&&fr(Si(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,r=Si(r,n),aa(e,a=bs(e.stateNode,r,a)),4!==uc&&(uc=2)),!1;var o=Error(i(520),{cause:r});if(o=Si(o,n),null===gc?gc=[o]:gc.push(o),4!==uc&&(uc=2),null===t)return!0;r=Si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,aa(n,e=bs(n.stateNode,r,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Sc&&Sc.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,ws(a=Ss(a),e,n,r),aa(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,ic))return uc=1,xs(e,Si(n,e.current)),void(nc=null)}catch(t){if(null!==a)throw nc=a,t;return uc=1,xs(e,Si(n,e.current)),void(nc=null)}32768&t.flags?(ir||1===r?e=!0:sc||536870912&ic?e=!1:(oc=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=ns.current)&&13===r.tag&&(r.flags|=16384))),Jc(t,e)):Qc(t)}function Qc(e){var t=e;do{if(32768&t.flags)return void Jc(t,oc);e=t.return;var n=tl(t.alternate,t,cc);if(null!==n)return void(nc=n);if(null!==(t=t.sibling))return void(nc=t);nc=t=e}while(null!==t);0===uc&&(uc=5)}function Jc(e,t){do{var n=nl(e.alternate,e);if(null!==n)return n.flags&=32767,void(nc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(nc=e);nc=e=n}while(null!==e);uc=6,nc=null}function eu(e,t,n,r,a,o,s,l,c){e.cancelPendingCommit=null;do{au()}while(0!==wc);if(6&ec)throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,function(e,t,n,i,r,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-de(n),d=1<<u;s[u]=0,l[u]=-1;var h=c[u];if(null!==h)for(c[u]=null,u=0;u<h.length;u++){var f=h[u];null!==f&&(f.lane&=-536870913)}n&=~d}0!==i&&Me(e,i,0),0!==a&&0===r&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,o|=Ei,s,l,c),e===tc&&(nc=tc=null,ic=0),Ec=t,Mc=e,Tc=n,Ac=o,Cc=a,Pc=r,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,Y(ie,(function(){return ou(),null}))):(e.callbackNode=null,e.callbackPriority=0),r=!!(13878&t.flags),13878&t.subtreeFlags||r){r=k.T,k.T=null,a=N.p,N.p=2,s=ec,ec|=4;try{!function(e,t){if(e=e.containerInfo,Ju=eh,Jn(e=Qn(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||0!==a&&3!==h.nodeType||(l=s+a),h!==o||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(p=h.firstChild);)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===a&&(l=s),f===o&&++d===r&&(c=s),null!==(p=h.nextSibling))break;f=(h=f).parentNode}h=p}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ed={focusedElem:e,selectionRange:n},eh=!1,bl=t;null!==bl;)if(e=(t=bl).child,1024&t.subtreeFlags&&null!==e)e.return=t,bl=e;else for(;null!==bl;){switch(o=(t=bl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==o){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var m=ps(n.type,a,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(m,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){lu(n,n.return,e)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))fd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fd(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(i(163))}if(null!==(e=t.sibling)){e.return=t.return,bl=e;break}bl=t.return}}(e,t)}finally{ec=s,N.p=a,k.T=r}}wc=1,tu(),nu(),iu()}}function tu(){if(1===wc){wc=0;var e=Mc,t=Ec,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=k.T,k.T=null;var i=N.p;N.p=2;var r=ec;ec|=4;try{kl(t,e);var a=ed,o=Qn(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kn(s.ownerDocument.documentElement,s)){if(null!==l&&Jn(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var f=h.getSelection(),p=s.textContent.length,m=Math.min(l.start,p),g=void 0===l.end?m:Math.min(l.end,p);!f.extend&&m>g&&(o=g,g=m,m=o);var v=Zn(s,m),y=Zn(s,g);if(v&&y&&(1!==f.rangeCount||f.anchorNode!==v.node||f.anchorOffset!==v.offset||f.focusNode!==y.node||f.focusOffset!==y.offset)){var x=d.createRange();x.setStart(v.node,v.offset),f.removeAllRanges(),m>g?(f.addRange(x),f.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),f.addRange(x))}}}}for(d=[],f=s;f=f.parentNode;)1===f.nodeType&&d.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var _=d[s];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}eh=!!Ju,ed=Ju=null}finally{ec=r,N.p=i,k.T=n}}e.current=t,wc=2}}function nu(){if(2===wc){wc=0;var e=Mc,t=Ec,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=k.T,k.T=null;var i=N.p;N.p=2;var r=ec;ec|=4;try{Sl(e,t.alternate,t)}finally{ec=r,N.p=i,k.T=n}}wc=3}}function iu(){if(4===wc||3===wc){wc=0,Q();var e=Mc,t=Ec,n=Tc,i=Pc;10256&t.subtreeFlags||10256&t.flags?wc=5:(wc=0,Ec=Mc=null,ru(e,e.pendingLanes));var r=e.pendingLanes;if(0===r&&(Sc=null),Ae(n),t=t.stateNode,ce&&"function"==typeof ce.onCommitFiberRoot)try{ce.onCommitFiberRoot(le,t,void 0,!(128&~t.current.flags))}catch(e){}if(null!==i){t=k.T,r=N.p,N.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<i.length;o++){var s=i[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,N.p=r}}3&Tc&&au(),_u(e),r=e.pendingLanes,4194090&n&&42&r?e===Lc?Rc++:(Rc=0,Lc=e):Rc=0,bu(0)}}function ru(e,t){0==(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,kr(t)))}function au(e){return tu(),nu(),iu(),ou()}function ou(){if(5!==wc)return!1;var e=Mc,t=Ac;Ac=0;var n=Ae(Tc),r=k.T,a=N.p;try{N.p=32>n?32:n,k.T=null,n=Cc,Cc=null;var o=Mc,s=Tc;if(wc=0,Ec=Mc=null,Tc=0,6&ec)throw Error(i(331));var l=ec;if(ec|=4,Yl(o.current),Hl(o,o.current,s,n),ec=l,bu(0,!1),ce&&"function"==typeof ce.onPostCommitFiberRoot)try{ce.onPostCommitFiberRoot(le,o)}catch(e){}return!0}finally{N.p=a,k.T=r,ru(e,t)}}function su(e,t,n){t=Si(n,t),null!==(e=ia(e,t=bs(e.stateNode,t,2),2))&&(we(e,2),_u(e))}function lu(e,t,n){if(3===e.tag)su(e,e,n);else for(;null!==t;){if(3===t.tag){su(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Sc||!Sc.has(i))){e=Si(n,e),null!==(i=ia(t,n=Ss(2),2))&&(ws(n,i,t,e),we(i,2),_u(i));break}}t=t.return}}function cu(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new Jl;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(lc=!0,r.add(n),e=uu.bind(null,e,t,n),t.then(e,e))}function uu(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,tc===e&&(ic&n)===n&&(4===uc||3===uc&&(62914560&ic)===ic&&300>J()-xc?!(2&ec)&&Hc(e,0):fc|=n,mc===ic&&(mc=0)),_u(e)}function du(e,t){0===t&&(t=be()),null!==(e=Pi(e,t))&&(we(e,t),_u(e))}function hu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),du(e,n)}function fu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),du(e,n)}var pu=null,mu=null,gu=!1,vu=!1,yu=!1,xu=0;function _u(e){e!==mu&&null===e.next&&(null===mu?pu=mu=e:mu=mu.next=e),vu=!0,gu||(gu=!0,cd((function(){6&ec?Y(te,Su):wu()})))}function bu(e,t){if(!yu&&vu){yu=!0;do{for(var n=!1,i=pu;null!==i;){if(0!==e){var r=i.pendingLanes;if(0===r)var a=0;else{var o=i.suspendedLanes,s=i.pingedLanes;a=(1<<31-de(42|e)+1)-1,a=201326741&(a&=r&~(o&~s))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Tu(i,a))}else a=ic,!(3&(a=ve(i,i===tc?a:0,null!==i.cancelPendingCommit||-1!==i.timeoutHandle)))||ye(i,a)||(n=!0,Tu(i,a));i=i.next}}while(n);yu=!1}}function Su(){wu()}function wu(){vu=gu=!1;var e=0;0!==xu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==ad&&(ad=e,!0);return ad=null,!1}()&&(e=xu),xu=0);for(var t=J(),n=null,i=pu;null!==i;){var r=i.next,a=Mu(i,t);0===a?(i.next=null,null===n?pu=r:n.next=r,null===r&&(mu=n)):(n=i,(0!==e||3&a)&&(vu=!0)),i=r}bu(e)}function Mu(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-de(a),s=1<<o,l=r[o];-1===l?s&n&&!(s&i)||(r[o]=xe(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(n=ic,n=ve(e,e===(t=tc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),i=e.callbackNode,0===n||e===t&&(2===rc||9===rc)||null!==e.cancelPendingCommit)return null!==i&&null!==i&&Z(i),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||ye(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==i&&Z(i),Ae(n)){case 2:case 8:n=ne;break;case 32:default:n=ie;break;case 268435456:n=ae}return i=Eu.bind(null,e),n=Y(n,i),e.callbackPriority=t,e.callbackNode=n,t}return null!==i&&null!==i&&Z(i),e.callbackPriority=2,e.callbackNode=null,2}function Eu(e,t){if(0!==wc&&5!==wc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(au()&&e.callbackNode!==n)return null;var i=ic;return 0===(i=ve(e,e===tc?i:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Ic(e,i,t),Mu(e,J()),null!=e.callbackNode&&e.callbackNode===n?Eu.bind(null,e):null)}function Tu(e,t){if(au())return null;Ic(e,t,!0)}function Au(){return 0===xu&&(xu=_e()),xu}function Cu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:At(""+e)}function Pu(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Ru=0;Ru<xi.length;Ru++){var Lu=xi[Ru];_i(Lu.toLowerCase(),"on"+(Lu[0].toUpperCase()+Lu.slice(1)))}_i(di,"onAnimationEnd"),_i(hi,"onAnimationIteration"),_i(fi,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(pi,"onTransitionRun"),_i(mi,"onTransitionStart"),_i(gi,"onTransitionCancel"),_i(vi,"onTransitionEnd"),qe("onMouseEnter",["mouseout","mouseover"]),qe("onMouseLeave",["mouseout","mouseover"]),qe("onPointerEnter",["pointerout","pointerover"]),qe("onPointerLeave",["pointerout","pointerover"]),Xe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xe("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ku));function Du(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var a=void 0;if(t)for(var o=i.length-1;0<=o;o--){var s=i[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(e){ms(e)}r.currentTarget=null,a=l}else for(o=0;o<i.length;o++){if(l=(s=i[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&r.isPropagationStopped())break e;a=s,r.currentTarget=c;try{a(r)}catch(e){ms(e)}r.currentTarget=null,a=l}}}}function Iu(e,t){var n=t[Ne];void 0===n&&(n=t[Ne]=new Set);var i=e+"__bubble";n.has(i)||(Fu(t,e,2,!1),n.add(i))}function Ou(e,t,n){var i=0;t&&(i|=4),Fu(n,e,i,t)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function zu(e){if(!e[Uu]){e[Uu]=!0,Ge.forEach((function(t){"selectionchange"!==t&&(Nu.has(t)||Ou(t,!1,e),Ou(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Uu]||(t[Uu]=!0,Ou("selectionchange",!1,t))}}function Fu(e,t,n,i){switch(sh(t)){case 2:var r=th;break;case 8:r=nh;break;default:r=ih}n=r.bind(null,t,n,e),r=void 0,!Ut||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Bu(e,t,n,i,r){var o=i;if(!(1&t||2&t||null===i))e:for(;;){if(null===i)return;var s=i.tag;if(3===s||4===s){var l=i.stateNode.containerInfo;if(l===r)break;if(4===s)for(s=i.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===r)return;s=s.return}for(;null!==l;){if(null===(s=Fe(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){i=o=s;continue e}l=l.parentNode}}i=i.return}Dt((function(){var i=o,r=Pt(n),s=[];e:{var l=yi.get(e);if(void 0!==l){var c=Kt,u=e;switch(e){case"keypress":if(0===jt(n))break e;case"keydown":case"keyup":c=fn;break;case"focusin":u="focus",c=rn;break;case"focusout":u="blur",c=rn;break;case"beforeblur":case"afterblur":c=rn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=nn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=mn;break;case di:case hi:case fi:c=an;break;case vi:c=gn;break;case"scroll":case"scrollend":c=Jt;break;case"wheel":c=vn;break;case"copy":case"cut":case"paste":c=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=pn;break;case"toggle":case"beforetoggle":c=yn}var d=!!(4&t),h=!d&&("scroll"===e||"scrollend"===e),f=d?null!==l?l+"Capture":null:l;d=[];for(var p,m=i;null!==m;){var g=m;if(p=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===p||null===f||null!=(g=It(m,f))&&d.push(Hu(m,g,p)),h)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,r),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===Ct||!(u=n.relatedTarget||n.fromElement)||!Fe(u)&&!u[ke])&&(c||l)&&(l=r.window===r?r:(l=r.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=i,null!==(u=(u=n.relatedTarget||n.toElement)?Fe(u):null)&&(h=a(u),d=u.tag,u!==h||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=i),c!==u)){if(d=tn,g="onMouseLeave",f="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=pn,g="onPointerLeave",f="onPointerEnter",m="pointer"),h=null==c?l:He(c),p=null==u?l:He(u),(l=new d(g,m+"leave",c,n,r)).target=h,l.relatedTarget=p,g=null,Fe(r)===i&&((d=new d(f,m+"enter",u,n,r)).target=p,d.relatedTarget=h,g=d),h=g,c&&u)e:{for(f=u,m=0,p=d=c;p;p=ju(p))m++;for(p=0,g=f;g;g=ju(g))p++;for(;0<m-p;)d=ju(d),m--;for(;0<p-m;)f=ju(f),p--;for(;m--;){if(d===f||null!==f&&d===f.alternate)break e;d=ju(d),f=ju(f)}d=null}else d=null;null!==c&&Gu(s,l,c,d,!1),null!==u&&null!==h&&Gu(s,h,u,d,!0)}if("select"===(c=(l=i?He(i):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var v=On;else if(Rn(l))if(Un)v=Xn;else{v=Gn;var y=jn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?i&&Mt(i.elementType)&&(v=On):v=Wn;switch(v&&(v=v(e,i))?Ln(s,v,n,r):(y&&y(e,l,i),"focusout"===e&&i&&"number"===l.type&&null!=i.memoizedProps.value&&gt(l,"number",l.value)),y=i?He(i):window,e){case"focusin":(Rn(y)||"true"===y.contentEditable)&&(ti=y,ni=i,ii=null);break;case"focusout":ii=ni=ti=null;break;case"mousedown":ri=!0;break;case"contextmenu":case"mouseup":case"dragend":ri=!1,ai(s,n,r);break;case"selectionchange":if(ei)break;case"keydown":case"keyup":ai(s,n,r)}var x;if(_n)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Cn?Tn(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(wn&&"ko"!==n.locale&&(Cn||"onCompositionStart"!==_?"onCompositionEnd"===_&&Cn&&(x=Vt()):(Bt="value"in(Ft=r)?Ft.value:Ft.textContent,Cn=!0)),0<(y=Vu(i,_)).length&&(_=new sn(_,e,null,n,r),s.push({event:_,listeners:y}),x?_.data=x:null!==(x=An(n))&&(_.data=x))),(x=Sn?function(e,t){switch(e){case"compositionend":return An(t);case"keypress":return 32!==t.which?null:(En=!0,Mn);case"textInput":return(e=t.data)===Mn&&En?null:e;default:return null}}(e,n):function(e,t){if(Cn)return"compositionend"===e||!_n&&Tn(e,t)?(e=Vt(),Ht=Bt=Ft=null,Cn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(_=Vu(i,"onBeforeInput")).length&&(y=new sn("onBeforeInput","beforeinput",null,n,r),s.push({event:y,listeners:_}),y.data=x)),function(e,t,n,i,r){if("submit"===t&&n&&n.stateNode===r){var a=Cu((r[Le]||null).action),o=i.submitter;o&&null!==(t=(t=o[Le]||null)?Cu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new Kt("action","action",null,i,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(0!==xu){var e=o?Pu(r,o):new FormData(r);Po(n,{pending:!0,data:e,method:r.method,action:a},null,e)}}else"function"==typeof a&&(s.preventDefault(),e=o?Pu(r,o):new FormData(r),Po(n,{pending:!0,data:e,method:r.method,action:a},a,e))},currentTarget:r}]})}}(s,e,i,n,r)}Du(s,t)}))}function Hu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vu(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,a=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===a||(null!=(r=It(e,n))&&i.unshift(Hu(e,r,a)),null!=(r=It(e,t))&&i.push(Hu(e,r,a))),3===e.tag)return i;e=e.return}return[]}function ju(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Gu(e,t,n,i,r){for(var a=t._reactName,o=[];null!==n&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===i)break;5!==s&&26!==s&&27!==s||null===c||(l=c,r?null!=(c=It(n,a))&&o.unshift(Hu(n,c,l)):r||null!=(c=It(n,a))&&o.push(Hu(n,c,l))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Wu=/\r\n?/g,Xu=/\u0000|\uFFFD/g;function qu(e){return("string"==typeof e?e:""+e).replace(Wu,"\n").replace(Xu,"")}function $u(e,t){return t=qu(t),qu(e)===t}function Yu(){}function Zu(e,t,n,r,a,o){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||_t(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&_t(e,""+r);break;case"className":et(e,"class",r);break;case"tabIndex":et(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":et(e,n,r);break;case"style":wt(e,r,o);break;case"data":if("object"!==t){et(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof o&&("formAction"===n?("input"!==t&&Zu(e,t,"name",a.name,a,null),Zu(e,t,"formEncType",a.formEncType,a,null),Zu(e,t,"formMethod",a.formMethod,a,null),Zu(e,t,"formTarget",a.formTarget,a,null)):(Zu(e,t,"encType",a.encType,a,null),Zu(e,t,"method",a.method,a,null),Zu(e,t,"target",a.target,a,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Yu);break;case"onScroll":null!=r&&Iu("scroll",e);break;case"onScrollEnd":null!=r&&Iu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=At(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Iu("beforetoggle",e),Iu("toggle",e),Je(e,"popover",r);break;case"xlinkActuate":tt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":tt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":tt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":tt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":tt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":tt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":tt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":tt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":tt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Je(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&Je(e,n=Et.get(n)||n,r)}}function Ku(e,t,n,r,a,o){switch(n){case"style":wt(e,r,o);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"children":"string"==typeof r?_t(e,r):("number"==typeof r||"bigint"==typeof r)&&_t(e,""+r);break;case"onScroll":null!=r&&Iu("scroll",e);break;case"onScrollEnd":null!=r&&Iu("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Yu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:We.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(o=null!=(o=e[Le]||null)?o[n]:null)&&e.removeEventListener(t,o,a),"function"!=typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):Je(e,n,r):("function"!=typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a)))}}function Qu(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Iu("error",e),Iu("load",e);var r,a=!1,o=!1;for(r in n)if(n.hasOwnProperty(r)){var s=n[r];if(null!=s)switch(r){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Zu(e,t,r,s,n,null)}}return o&&Zu(e,t,"srcSet",n.srcSet,n,null),void(a&&Zu(e,t,"src",n.src,n,null));case"input":Iu("invalid",e);var l=r=s=o=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":o=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(i(137,t));break;default:Zu(e,t,a,d,n,null)}}return mt(e,r,l,c,u,s,o,!1),void ct(e);case"select":for(o in Iu("invalid",e),a=s=r=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":r=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:Zu(e,t,o,l,n,null)}return t=r,n=s,e.multiple=!!a,void(null!=t?vt(e,!!a,t,!1):null!=n&&vt(e,!!a,n,!0));case"textarea":for(s in Iu("invalid",e),r=o=a=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":a=l;break;case"defaultValue":o=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(i(91));break;default:Zu(e,t,s,l,n,null)}return xt(e,a,o,r),void ct(e);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else Zu(e,t,c,a,n,null);return;case"dialog":Iu("beforetoggle",e),Iu("toggle",e),Iu("cancel",e),Iu("close",e);break;case"iframe":case"object":Iu("load",e);break;case"video":case"audio":for(a=0;a<ku.length;a++)Iu(ku[a],e);break;case"image":Iu("error",e),Iu("load",e);break;case"details":Iu("toggle",e);break;case"embed":case"source":case"link":Iu("error",e),Iu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Zu(e,t,u,a,n,null)}return;default:if(Mt(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&Ku(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&Zu(e,t,l,a,n,null))}var Ju=null,ed=null;function td(e){return 9===e.nodeType?e:e.ownerDocument}function nd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function id(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function rd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ad=null;var od="function"==typeof setTimeout?setTimeout:void 0,sd="function"==typeof clearTimeout?clearTimeout:void 0,ld="function"==typeof Promise?Promise:void 0,cd="function"==typeof queueMicrotask?queueMicrotask:void 0!==ld?function(e){return ld.resolve(null).then(e).catch(ud)}:od;function ud(e){setTimeout((function(){throw e}))}function dd(e){return"head"===e}function hd(e,t){var n=t,i=0,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0<i&&8>i){n=i;var o=e.ownerDocument;if(1&n&&xd(o.documentElement),2&n&&xd(o.body),4&n)for(xd(n=o.head),o=n.firstChild;o;){var s=o.nextSibling,l=o.nodeName;o[Ue]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===o.rel.toLowerCase()||n.removeChild(o),o=s}}if(0===r)return e.removeChild(a),void Eh(t);r--}else"$"===n||"$?"===n||"$!"===n?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);Eh(t)}function fd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":fd(n),ze(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function pd(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function md(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var gd=null;function vd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function yd(e,t,n){switch(t=td(n),e){case"html":if(!(e=t.documentElement))throw Error(i(452));return e;case"head":if(!(e=t.head))throw Error(i(453));return e;case"body":if(!(e=t.body))throw Error(i(454));return e;default:throw Error(i(451))}}function xd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ze(e)}var _d=new Map,bd=new Set;function Sd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var wd=N.d;N.d={f:function(){var e=wd.f(),t=Fc();return e||t},r:function(e){var t=Be(e);null!==t&&5===t.tag&&"form"===t.type?Lo(t):wd.r(e)},D:function(e){wd.D(e),Ed("dns-prefetch",e,null)},C:function(e,t){wd.C(e,t),Ed("preconnect",e,t)},L:function(e,t,n){wd.L(e,t,n);var i=Md;if(i&&e&&t){var r='link[rel="preload"][as="'+ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ft(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+ft(n.imageSizes)+'"]')):r+='[href="'+ft(e)+'"]';var a=r;switch(t){case"style":a=Ad(e);break;case"script":a=Rd(e)}_d.has(a)||(e=c({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),_d.set(a,e),null!==i.querySelector(r)||"style"===t&&i.querySelector(Cd(a))||"script"===t&&i.querySelector(Ld(a))||(Qu(t=i.createElement("link"),"link",e),je(t),i.head.appendChild(t)))}},m:function(e,t){wd.m(e,t);var n=Md;if(n&&e){var i=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+ft(i)+'"][href="'+ft(e)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Rd(e)}if(!_d.has(a)&&(e=c({rel:"modulepreload",href:e},t),_d.set(a,e),null===n.querySelector(r))){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ld(a)))return}Qu(i=n.createElement("link"),"link",e),je(i),n.head.appendChild(i)}}},X:function(e,t){wd.X(e,t);var n=Md;if(n&&e){var i=Ve(n).hoistableScripts,r=Rd(e),a=i.get(r);a||((a=n.querySelector(Ld(r)))||(e=c({src:e,async:!0},t),(t=_d.get(r))&&Id(e,t),je(a=n.createElement("script")),Qu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}},S:function(e,t,n){wd.S(e,t,n);var i=Md;if(i&&e){var r=Ve(i).hoistableStyles,a=Ad(e);t=t||"default";var o=r.get(a);if(!o){var s={loading:0,preload:null};if(o=i.querySelector(Cd(a)))s.loading=5;else{e=c({rel:"stylesheet",href:e,"data-precedence":t},n),(n=_d.get(a))&&Dd(e,n);var l=o=i.createElement("link");je(l),Qu(l,"link",e),l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),l.addEventListener("load",(function(){s.loading|=1})),l.addEventListener("error",(function(){s.loading|=2})),s.loading|=4,Nd(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:s},r.set(a,o)}}},M:function(e,t){wd.M(e,t);var n=Md;if(n&&e){var i=Ve(n).hoistableScripts,r=Rd(e),a=i.get(r);a||((a=n.querySelector(Ld(r)))||(e=c({src:e,async:!0,type:"module"},t),(t=_d.get(r))&&Id(e,t),je(a=n.createElement("script")),Qu(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}};var Md="undefined"==typeof document?null:document;function Ed(e,t,n){var i=Md;if(i&&"string"==typeof t&&t){var r=ft(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),bd.has(r)||(bd.add(r),e={rel:e,crossOrigin:n,href:t},null===i.querySelector(r)&&(Qu(t=i.createElement("link"),"link",e),je(t),i.head.appendChild(t)))}}function Td(e,t,n,r){var a,o,s,l,c=(c=V.current)?Sd(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Ad(n.href),(r=(n=Ve(c).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Ad(n.href);var u=Ve(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Cd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),_d.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_d.set(e,n),u||(a=c,o=e,s=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=a.createElement("link"),l.preload=o,o.addEventListener("load",(function(){return l.loading|=1})),o.addEventListener("error",(function(){return l.loading|=2})),Qu(o,"link",s),je(o),a.head.appendChild(o))))),t&&null===r)throw Error(i(528,""));return d}if(t&&null!==r)throw Error(i(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Rd(n),(r=(n=Ve(c).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ad(e){return'href="'+ft(e)+'"'}function Cd(e){return'link[rel="stylesheet"]['+e+"]"}function Pd(e){return c({},e,{"data-precedence":e.precedence,precedence:null})}function Rd(e){return'[src="'+ft(e)+'"]'}function Ld(e){return"script[async]"+e}function kd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ft(n.href)+'"]');if(r)return t.instance=r,je(r),r;var a=c({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return je(r=(e.ownerDocument||e).createElement("style")),Qu(r,"style",a),Nd(r,n.precedence,e),t.instance=r;case"stylesheet":a=Ad(n.href);var o=e.querySelector(Cd(a));if(o)return t.state.loading|=4,t.instance=o,je(o),o;r=Pd(n),(a=_d.get(a))&&Dd(r,a),je(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Qu(o,"link",r),t.state.loading|=4,Nd(o,n.precedence,e),t.instance=o;case"script":return o=Rd(n.src),(a=e.querySelector(Ld(o)))?(t.instance=a,je(a),a):(r=n,(a=_d.get(o))&&Id(r=c({},n),a),je(a=(e=e.ownerDocument||e).createElement("script")),Qu(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(i(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Nd(r,n.precedence,e));return t.instance}function Nd(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var s=i[o];if(s.dataset.precedence===t)a=s;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Dd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Id(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Od=null;function Ud(e,t,n){if(null===Od){var i=new Map,r=Od=new Map;r.set(n,i)}else(i=(r=Od).get(n))||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[Ue]||a[Re]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=i.get(o);s?s.push(a):i.set(o,[a])}}return i}function zd(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function Fd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var Bd=null;function Hd(){}function Vd(){if(this.count--,0===this.count)if(this.stylesheets)Gd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var jd=null;function Gd(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,jd=new Map,t.forEach(Wd,e),jd=null,Vd.call(e))}function Wd(e,t){if(!(4&t.state.loading)){var n=jd.get(e);if(n)var i=n.get(null);else{n=new Map,jd.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}o=(r=t.instance).getAttribute("data-precedence"),(a=n.get(o)||i)===i&&n.set(null,r),n.set(o,r),this.count++,i=Vd.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var Xd={$$typeof:x,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function qd(e,t,n,i,r,a,o,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Se(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Se(0),this.hiddenUpdates=Se(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function $d(e,t,n,i,r,a,o,s,l,c,u,d){return e=new qd(e,t,n,o,s,l,c,d),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,(t=Lr()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:t},ea(a),e}function Yd(e){return e?e=ki:ki}function Zd(e,t,n,i,r,a){r=Yd(r),null===i.context?i.context=r:i.pendingContext=r,(i=na(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(i.callback=a),null!==(n=ia(e,i,t))&&(Dc(n,0,t),ra(n,e,t))}function Kd(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Qd(e,t){Kd(e,t),(e=e.alternate)&&Kd(e,t)}function Jd(e){if(13===e.tag){var t=Pi(e,67108864);null!==t&&Dc(t,0,67108864),Qd(e,67108864)}}var eh=!0;function th(e,t,n,i){var r=k.T;k.T=null;var a=N.p;try{N.p=2,ih(e,t,n,i)}finally{N.p=a,k.T=r}}function nh(e,t,n,i){var r=k.T;k.T=null;var a=N.p;try{N.p=8,ih(e,t,n,i)}finally{N.p=a,k.T=r}}function ih(e,t,n,i){if(eh){var r=rh(i);if(null===r)Bu(e,t,i,ah,n),gh(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return ch=vh(ch,e,t,n,i,r),!0;case"dragenter":return uh=vh(uh,e,t,n,i,r),!0;case"mouseover":return dh=vh(dh,e,t,n,i,r),!0;case"pointerover":var a=r.pointerId;return hh.set(a,vh(hh.get(a)||null,e,t,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,fh.set(a,vh(fh.get(a)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(gh(e,i),4&t&&-1<mh.indexOf(e)){for(;null!==r;){var a=Be(r);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=ge(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-de(o);s.entanglements[1]|=l,o&=~l}_u(a),!(6&ec)&&(_c=J()+500,bu(0))}}break;case 13:null!==(s=Pi(a,2))&&Dc(s,0,2),Fc(),Qd(a,2)}if(null===(a=rh(i))&&Bu(e,t,i,ah,n),a===r)break;r=a}null!==r&&i.stopPropagation()}else Bu(e,t,i,null,n)}}function rh(e){return oh(e=Pt(e))}var ah=null;function oh(e){if(ah=null,null!==(e=Fe(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=o(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ah=e,null}function sh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ee()){case te:return 2;case ne:return 8;case ie:case re:return 32;case ae:return 268435456;default:return 32}default:return 32}}var lh=!1,ch=null,uh=null,dh=null,hh=new Map,fh=new Map,ph=[],mh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gh(e,t){switch(e){case"focusin":case"focusout":ch=null;break;case"dragenter":case"dragleave":uh=null;break;case"mouseover":case"mouseout":dh=null;break;case"pointerover":case"pointerout":hh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fh.delete(t.pointerId)}}function vh(e,t,n,i,r,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},null!==t&&(null!==(t=Be(t))&&Jd(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function yh(e){var t=Fe(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=o(n)))return e.blockedOn=t,void function(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}(e.priority,(function(){if(13===n.tag){var e=kc();e=Te(e);var t=Pi(n,e);null!==t&&Dc(t,0,e),Qd(n,e)}}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function xh(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=rh(e.nativeEvent);if(null!==n)return null!==(t=Be(n))&&Jd(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);Ct=i,n.target.dispatchEvent(i),Ct=null,t.shift()}return!0}function _h(e,t,n){xh(e)&&n.delete(t)}function bh(){lh=!1,null!==ch&&xh(ch)&&(ch=null),null!==uh&&xh(uh)&&(uh=null),null!==dh&&xh(dh)&&(dh=null),hh.forEach(_h),fh.forEach(_h)}function Sh(t,n){t.blockedOn===n&&(t.blockedOn=null,lh||(lh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bh)))}var wh=null;function Mh(t){wh!==t&&(wh=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,(function(){wh===t&&(wh=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if("function"!=typeof i){if(null===oh(i||n))continue;break}var a=Be(n);null!==a&&(t.splice(e,3),e-=3,Po(a,{pending:!0,data:r,method:n.method,action:i},i,r))}})))}function Eh(e){function t(t){return Sh(t,e)}null!==ch&&Sh(ch,e),null!==uh&&Sh(uh,e),null!==dh&&Sh(dh,e),hh.forEach(t),fh.forEach(t);for(var n=0;n<ph.length;n++){var i=ph[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ph.length&&null===(n=ph[0]).blockedOn;)yh(n),null===n.blockedOn&&ph.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],o=r[Le]||null;if("function"==typeof a)o||Mh(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Le]||null)s=o.formAction;else if(null!==oh(r))continue}else s=o.action;"function"==typeof s?n[i+1]=s:(n.splice(i,3),i-=3),Mh(n)}}}function Th(e){this._internalRoot=e}function Ah(e){this._internalRoot=e}Ah.prototype.render=Th.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Zd(t.current,kc(),e,t,null,null)},Ah.prototype.unmount=Th.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zd(e.current,2,null,e,null,null),Fc(),t[ke]=null}},Ah.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ce();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ph.length&&0!==t&&t<ph[n].priority;n++);ph.splice(n,0,e),0===n&&yh(e)}};var Ch=t.version;if("19.1.0"!==Ch)throw Error(i(527,Ch,"19.1.0"));N.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var l=o.alternate;if(null===l){if(null!==(r=o.return)){n=r;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return s(o),e;if(l===r)return s(o),t;l=l.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=l;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,r=l;break}if(u===r){c=!0,r=o,n=l;break}u=u.sibling}if(!c){for(u=l.child;u;){if(u===n){c=!0,n=l,r=o;break}if(u===r){c=!0,r=l,n=o;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?l(e):null)?null:e.stateNode};var Ph={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Rh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rh.isDisabled&&Rh.supportsFiber)try{le=Rh.inject(Ph),ce=Rh}catch(e){}}return sx.createRoot=function(e,t){if(!r(e))throw Error(i(299));var n=!1,a="",o=gs,s=vs,l=ys;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=$d(e,1,!1,null,0,n,a,o,s,l,0,null),e[ke]=t.current,zu(e),new Th(t)},sx.hydrateRoot=function(e,t,n){if(!r(e))throw Error(i(299));var a=!1,o="",s=gs,l=vs,c=ys,u=null;return null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(u=n.formState)),(t=$d(e,1,!0,t,0,a,o,s,l,c,0,u)).context=Yd(null),n=t.current,(o=na(a=Te(a=kc()))).callback=null,ia(n,o,a),n=a,t.current.lanes=n,we(t,n),_u(t),e[ke]=t.current,zu(e),new Ah(t)},sx.version="19.1.0",sx}var xx=(px||(px=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),ox.exports=yx()),ox.exports);class _x{constructor(e){this.version=ix,e.ipd=0,Bs.getState().setInputMode(e.primaryInputMode),this.devUIContainer=document.createElement("div"),this.devUIContainer.style.position="fixed",this.devUIContainer.style.width="100vw",this.devUIContainer.style.height="100vh",this.devUIContainer.style.top="50vh",this.devUIContainer.style.left="50vw",this.devUIContainer.style.transform="translate(-50%, -50%)",this.devUIContainer.style.pointerEvents="none";const t=this.devUIContainer.attachShadow({mode:"open"});this.inputLayer=new nx(e),this.unsubscribeControlMode=e.onControlModeChange((e=>{this.inputLayer.isInProgrammaticMode="programmatic"===e,"programmatic"===e?(this.inputLayer.syncFromDevice(),this.inputLayer.setInteractionsEnabled(!1)):this.inputLayer.setInteractionsEnabled(!0)})),this.unsubscribeStateChange=e.onStateChange((()=>{this.inputLayer.isInProgrammaticMode&&this.inputLayer.syncFromDevice()}));xx.createRoot(t).render(d.jsx(bx,{xrDevice:e,inputLayer:this.inputLayer,shadowRoot:t}));const n=()=>{const t=document.createElement("div");document.body.appendChild(t);const n=t.attachShadow({mode:"open"});xx.createRoot(n).render(d.jsx(Sx,{xrDevice:e,shadowRoot:n}))};document.body?n():window.onload=n}render(e){this.inputLayer.renderScene(e)}dispose(){this.unsubscribeControlMode(),this.unsubscribeStateChange(),this.inputLayer.dispose()}get devUICanvas(){return this.inputLayer.domElement}}const bx=({xrDevice:e,inputLayer:t,shadowRoot:n})=>{const[i,r]=Bn.useState(!1),[a,o]=Bn.useState(e.controlMode);return Bn.useEffect((()=>{const t=()=>{const e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;r(!!e)};document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1);const n=e.onControlModeChange((e=>{o(e)}));return()=>{document.removeEventListener("pointerlockchange",t,!1),document.removeEventListener("mozpointerlockchange",t,!1),document.removeEventListener("webkitpointerlockchange",t,!1),n()}}),[e]),d.jsx(Ea,{target:n,disableCSSOMInjection:!0,children:d.jsxs("div",{style:{width:"100vw",height:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none"},children:["programmatic"===a&&d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:999,boxShadow:"inset 0 0 20px 5px rgba(59, 130, 246, 0.5)"}}),d.jsxs("div",{style:{position:"absolute",bottom:"8px",left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(59, 130, 246, 0.9)",color:"white",padding:"6px 16px",borderRadius:"16px",fontSize:"12px",fontFamily:"system-ui, sans-serif",fontWeight:500,zIndex:1e3,display:"flex",alignItems:"center",gap:"6px",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"},children:[d.jsx("span",{style:{fontSize:"14px"},children:"●"}),"Remote Control Active"]})]}),"programmatic"!==a&&d.jsxs(d.Fragment,{children:[d.jsx(Xs,{xrDevice:e,inputLayer:t}),d.jsx(Ys,{xrDevice:e,inputLayer:t,pointerLocked:i}),d.jsx(Hs,{xrDevice:e,inputLayer:t,pointerLocked:i})]})]})})},Sx=({xrDevice:e,shadowRoot:t})=>{const[n,i]=Hn.useState(e.sessionOffered&&!e.activeSession);return Hn.useEffect((()=>{setInterval((()=>{i(e.sessionOffered&&!e.activeSession)}),1e3)}),[]),d.jsx(Ea,{target:t,disableCSSOMInjection:!0,children:d.jsxs(ho,{style:{zIndex:899,position:"fixed",top:n?"8px":"-30px",display:"flex",flexDirection:"row",alignItems:"center",justifyItems:"space-between",left:"50vw",transform:"translateX(-50%)",transition:"all 0.2s ease-in-out",paddingLeft:"5px",gap:"3px"},children:[d.jsx(Qo,{size:24}),d.jsx(fo,{onClick:()=>{e.grantOfferedSession()},style:{fontSize:"16px"},children:"Enter XR"})]})})};export{_x as DevUI,ix as VERSION};