@perceptimagery/dita-configurator-staging 1.0.1030 → 1.0.1032
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +27 -27
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* (c) 2023, Abhishek Deb (vikz91.deb@gmail.com) */
|
|
2
2
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap";#Sprie-config-html{font-size:87.5%}#Sprie-config-html,#Sprie-config-body{width:100%;height:100%;margin:0;padding:0;font-family:Work Sans,sans-serif;box-sizing:border-box}#Sprie-config-body *{box-sizing:border-box;margin:0;padding:0}.sprie-config-sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sprie-config-loadingBox{position:fixed;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:10000;background:#f2f2f2}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__header{display:none!important}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__content.drawer__content--padded-start{padding-top:0!important}.drawer.drawer--full.hidden-phone.lens-customizer #dita-3dconfig-element{height:100%!important}.popover.hidden-lap-and-up.popover-full .popover__header{display:none!important}#sprie-config-main-container{width:100%;height:100%}#sprie-config-main-header{border-bottom:.5px solid #aeaeae;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:.5rem}.sprie-config-main-header-close{position:absolute;right:2%;width:3rem;height:3rem;background-color:transparent;border:none}#sprie-config-header-content{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#sprie-config-header-content .sprie-config-mainHeader-frameName{color:#373737;font-size:1.3rem;font-weight:400;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}#sprie-config-viewer-container{position:relative;width:100%;img {position: absolute; top: 2rem; left: 2rem;}}.sprie-config-loadingFrame{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:1000;background:#fafafa;opacity:.7}.sprie-config-loader{border:8px solid #222222;width:60px;padding:8px;aspect-ratio:1;border-radius:50%;background:#222222;--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;mask-composite:subtract;animation:spin 1s infinite linear}@keyframes spin{to{transform:rotate(1turn)}}#Sprie-config-Customisation-block{display:flex;align-items:center;background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;bottom:100%;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.5rem; font-weight: 500; color: #121212;}}.frameName{color:#4d4d4d;font-size:.875rem;font-weight:500;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}.price-tag{color:#222;font-size:1.3125rem;font-weight:400;line-height:2.275rem}@media (max-width: 576px){#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}#Sprie-config-Customisation-block{display:flex;align-items:center}.popover__content.threedConfig{height:100%;width:100%;padding:0}.popover.hidden-lap-and-up.popover-full[open]{transform:translateY(8.5%)}}.sprie-config-palette{overflow-y:hidden;display:flex;gap:1.5rem;justify-content:flex-start;overflow-x:auto}.sprie-config-palette-img-box{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center}.sprie-config-palette-img-box .sprie-config-image{width:60px;height:60px}.sprie-config-palette-img-box .sprie-config-image.mobile-view{width:45px;height:45px}.sprie-config-palette-img-box>button{background-color:transparent}.sprie-config-palette-img-text{top:80%;position:absolute;z-index:100}.sprie-config-palette-img-text .sprie-config-palette-imgName{white-space:nowrap;z-index:100}.sprie-config-palette-img-text .sprie-config-price-tag{text-align:center;font-size:small;white-space:nowrap;z-index:100}.sprie-config-engraving-block{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;gap:.8rem}.sprie-config-engraving-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.sprie-config-engraving-inputField-block{width:25rem;position:relative}.sprie-config-engraving-inputField{width:100%;font-size:.8rem;font-weight:500;background:transparent;border-width:1px}.sprie-config-engraving-inputInfo{position:absolute;white-space:nowrap;font-size:.6rem;bottom:.2rem;right:.4rem;color:#686868}.sprie-config-engraving-link{position:absolute;background-color:transparent;border:none;white-space:nowrap;font-size:.7rem;bottom:-1.7rem;right:0;color:#686868;text-decoration:underline;cursor:pointer}@media (max-width: 576px){.sprie-config-engraving-inputField-block{width:70%}}.carousel{position:relative;overflow:hidden;width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.carousel-container{width:90%;height:100%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:start;justify-content:center;min-width:100%;transition-property:transform;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.5s}.carousel-header{display:flex;align-items:center;justify-content:center;gap:2rem}.carousel-header .step-syntax{font-size:1rem;font-weight:400;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:600;line-height:1.5rem;color:#91847e}.carousel-btn{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;background-color:transparent}.arrow{border:solid #91847e;border-width:0 3px 3px 0;display:inline-block}.right-arrow{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.left-arrow{transform:rotate(135deg);-webkit-transform:rotate(135deg)}.step-tracker-block{padding:3%!important;display:flex;flex-direction:column;justify-content:center;align-items:center;border-bottom:1px solid #aeaeae;width:26.25rem}.step-tracker{display:flex;gap:1rem}.step-circle{width:10px;height:10px;border-radius:50%;border:1px solid #7d7d7d;background-color:transparent;display:flex;justify-content:center;align-items:center;margin-right:10px;font-size:14px}.step-circle.active{background-color:#000;border-color:#000}@media (max-width: 576px){.carousel-container{align-items:start;height:50%;width:100%}.step-tracker-block{width:80%}}.sprie-config-add-to-cart-block{width:14.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}.sprie-config-add-to-cart-btn{width:100%;height:2.75rem;background-color:#000;display:flex;align-items:center;justify-content:center;cursor:pointer;border:0;font-size:.875rem;letter-spacing:.1rem;font-weight:500;color:#fff}#Sprie-Config-return-policy-label{display:flex;justify-content:center;width:16rem;p {font-size: .8rem; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{align-self:center;width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:#efefef}.sprie-config-add-to-cart-btn:disabled,.sprie-config-add-to-cart-btn [disabled]{background-color:#504f4f;cursor:default}@media (max-width: 576px){.sprie-config-add-to-cart-block{width:100%}.sprie-config-add-to-cart-btn{width:100%;height:4rem}#Sprie-Config-return-policy-label{width:100%;margin-bottom:.5rem}}.sprie-3d-snap-button-block{position:absolute;top:1.5rem;right:2rem;display:flex;flex-direction:column}.sprie-3d-snap-button{cursor:pointer!important;border:none;font-size:.9rem;padding:.5rem 1.5rem!important;margin:.5rem 0rem!important;text-align:center}@media (max-width: 576px){.sprie-3d-snap-button-block{top:1rem;right:1.3rem;gap:0}.sprie-3d-snap-button{font-size:.7rem;padding:.3rem 1rem!important;margin:.2rem 0!important}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
3
|
-
var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):ja[ls]=cs;var Bt=(ja,ls,cs)=>(SQ(ja,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var jI,WI;"use strict";class ja{constructor(e){Bt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),gS="1.0.
|
|
3
|
+
var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):ja[ls]=cs;var Bt=(ja,ls,cs)=>(SQ(ja,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var jI,WI;"use strict";class ja{constructor(e){Bt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),gS="1.0.1032";function mS(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class _S{constructor(e,t){Bt(this,"isAuthenticated");Bt(this,"fetcher");Bt(this,"shopifyAPI");Bt(this,"org");Bt(this,"apiKey");Bt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e,t){const n=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,i=await this.fetcher.Get(n),s=i.data.findIndex(h=>h.sku===`${e.toLowerCase()}-default`),o=i.data[s];return!t&&s>-1&&i.data.splice(s,1),{...i,data:t&&o?mS(i.data,o):i.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var c;const o=(c=s.properties)==null?void 0:c.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});let n={items:e,sections:"mini-cart"};const i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const c=document.querySelector(".popover.hidden-lap-and-up.popover-full");c&&c.hasAttribute("open")&&c.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Cp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Cp||{});class vS{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Bt(this,"log");Bt(this,"logErr");Bt(this,"metaData");Bt(this,"loaderName");Bt(this,"apiKey");Bt(this,"scriptStreamEncoderId");Bt(this,"rawNodeList");Bt(this,"targetNodeList");Bt(this,"status");Bt(this,"isLoaded");Bt(this,"loadCount");Bt(this,"mutationObserver");Bt(this,"config");Bt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Cp.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Cp.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function yS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var B1={exports:{}},Bc={},b1={exports:{}},Et={};/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react.production.min.js
|
|
6
6
|
*
|
|
@@ -8,7 +8,7 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var R1;function ES(){if(R1)return Et;R1=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),A=Symbol.iterator;function p(Q){return Q===null||typeof Q!="object"?null:(Q=A&&Q[A]||Q["@@iterator"],typeof Q=="function"?Q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,E={};function m(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}m.prototype.isReactComponent={},m.prototype.setState=function(Q,z){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,z,"setState")},m.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function _(){}_.prototype=m.prototype;function w(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}var x=w.prototype=new _;x.constructor=w,v(x,m.prototype),x.isPureReactComponent=!0;var I=Array.isArray,R=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function D(Q,z,Z){var re,G={},de=null,pe=null;if(z!=null)for(re in z.ref!==void 0&&(pe=z.ref),z.key!==void 0&&(de=""+z.key),z)R.call(z,re)&&!T.hasOwnProperty(re)&&(G[re]=z[re]);var fe=arguments.length-2;if(fe===1)G.children=Z;else if(1<fe){for(var ye=Array(fe),Pe=0;Pe<fe;Pe++)ye[Pe]=arguments[Pe+2];G.children=ye}if(Q&&Q.defaultProps)for(re in fe=Q.defaultProps,fe)G[re]===void 0&&(G[re]=fe[re]);return{$$typeof:r,type:Q,key:de,ref:pe,props:G,_owner:M.current}}function b(Q,z){return{$$typeof:r,type:Q.type,key:z,ref:Q.ref,props:Q.props,_owner:Q._owner}}function S(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===r}function L(Q){var z={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Z){return z[Z]})}var P=/\/+/g;function N(Q,z){return typeof Q=="object"&&Q!==null&&Q.key!=null?L(""+Q.key):z.toString(36)}function W(Q,z,Z,re,G){var de=typeof Q;(de==="undefined"||de==="boolean")&&(Q=null);var pe=!1;if(Q===null)pe=!0;else switch(de){case"string":case"number":pe=!0;break;case"object":switch(Q.$$typeof){case r:case e:pe=!0}}if(pe)return pe=Q,G=G(pe),Q=re===""?"."+N(pe,0):re,I(G)?(Z="",Q!=null&&(Z=Q.replace(P,"$&/")+"/"),W(G,z,Z,"",function(Pe){return Pe})):G!=null&&(S(G)&&(G=b(G,Z+(!G.key||pe&&pe.key===G.key?"":(""+G.key).replace(P,"$&/")+"/")+Q)),z.push(G)),1;if(pe=0,re=re===""?".":re+":",I(Q))for(var fe=0;fe<Q.length;fe++){de=Q[fe];var ye=re+N(de,fe);pe+=W(de,z,Z,ye,G)}else if(ye=p(Q),typeof ye=="function")for(Q=ye.call(Q),fe=0;!(de=Q.next()).done;)de=de.value,ye=re+N(de,fe++),pe+=W(de,z,Z,ye,G);else if(de==="object")throw z=String(Q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return pe}function X(Q,z,Z){if(Q==null)return Q;var re=[],G=0;return W(Q,re,"","",function(de){return z.call(Z,de,G++)}),re}function K(Q){if(Q._status===-1){var z=Q._result;z=z(),z.then(function(Z){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Z)},function(Z){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Z)}),Q._status===-1&&(Q._status=0,Q._result=z)}if(Q._status===1)return Q._result.default;throw Q._result}var te={current:null},H={transition:null},ee={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:H,ReactCurrentOwner:M};return Et.Children={map:X,forEach:function(Q,z,Z){X(Q,function(){z.apply(this,arguments)},Z)},count:function(Q){var z=0;return X(Q,function(){z++}),z},toArray:function(Q){return X(Q,function(z){return z})||[]},only:function(Q){if(!S(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},Et.Component=m,Et.Fragment=t,Et.Profiler=i,Et.PureComponent=w,Et.StrictMode=n,Et.Suspense=h,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Et.cloneElement=function(Q,z,Z){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var re=v({},Q.props),G=Q.key,de=Q.ref,pe=Q._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,pe=M.current),z.key!==void 0&&(G=""+z.key),Q.type&&Q.type.defaultProps)var fe=Q.type.defaultProps;for(ye in z)R.call(z,ye)&&!T.hasOwnProperty(ye)&&(re[ye]=z[ye]===void 0&&fe!==void 0?fe[ye]:z[ye])}var ye=arguments.length-2;if(ye===1)re.children=Z;else if(1<ye){fe=Array(ye);for(var Pe=0;Pe<ye;Pe++)fe[Pe]=arguments[Pe+2];re.children=fe}return{$$typeof:r,type:Q.type,key:G,ref:de,props:re,_owner:pe}},Et.createContext=function(Q){return Q={$$typeof:o,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},Et.createElement=D,Et.createFactory=function(Q){var z=D.bind(null,Q);return z.type=Q,z},Et.createRef=function(){return{current:null}},Et.forwardRef=function(Q){return{$$typeof:c,render:Q}},Et.isValidElement=S,Et.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:K}},Et.memo=function(Q,z){return{$$typeof:u,type:Q,compare:z===void 0?null:z}},Et.startTransition=function(Q){var z=H.transition;H.transition={};try{Q()}finally{H.transition=z}},Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Et.useCallback=function(Q,z){return te.current.useCallback(Q,z)},Et.useContext=function(Q){return te.current.useContext(Q)},Et.useDebugValue=function(){},Et.useDeferredValue=function(Q){return te.current.useDeferredValue(Q)},Et.useEffect=function(Q,z){return te.current.useEffect(Q,z)},Et.useId=function(){return te.current.useId()},Et.useImperativeHandle=function(Q,z,Z){return te.current.useImperativeHandle(Q,z,Z)},Et.useInsertionEffect=function(Q,z){return te.current.useInsertionEffect(Q,z)},Et.useLayoutEffect=function(Q,z){return te.current.useLayoutEffect(Q,z)},Et.useMemo=function(Q,z){return te.current.useMemo(Q,z)},Et.useReducer=function(Q,z,Z){return te.current.useReducer(Q,z,Z)},Et.useRef=function(Q){return te.current.useRef(Q)},Et.useState=function(Q){return te.current.useState(Q)},Et.useSyncExternalStore=function(Q,z,Z){return te.current.useSyncExternalStore(Q,z,Z)},Et.useTransition=function(){return te.current.useTransition()},Et.version="18.2.0",Et}b1.exports=ES();var We=b1.exports;const
|
|
11
|
+
*/var R1;function ES(){if(R1)return Et;R1=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),A=Symbol.iterator;function p(Q){return Q===null||typeof Q!="object"?null:(Q=A&&Q[A]||Q["@@iterator"],typeof Q=="function"?Q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,E={};function m(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}m.prototype.isReactComponent={},m.prototype.setState=function(Q,z){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,z,"setState")},m.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function _(){}_.prototype=m.prototype;function w(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}var x=w.prototype=new _;x.constructor=w,v(x,m.prototype),x.isPureReactComponent=!0;var I=Array.isArray,R=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function D(Q,z,Z){var re,G={},de=null,pe=null;if(z!=null)for(re in z.ref!==void 0&&(pe=z.ref),z.key!==void 0&&(de=""+z.key),z)R.call(z,re)&&!T.hasOwnProperty(re)&&(G[re]=z[re]);var fe=arguments.length-2;if(fe===1)G.children=Z;else if(1<fe){for(var ye=Array(fe),Pe=0;Pe<fe;Pe++)ye[Pe]=arguments[Pe+2];G.children=ye}if(Q&&Q.defaultProps)for(re in fe=Q.defaultProps,fe)G[re]===void 0&&(G[re]=fe[re]);return{$$typeof:r,type:Q,key:de,ref:pe,props:G,_owner:M.current}}function b(Q,z){return{$$typeof:r,type:Q.type,key:z,ref:Q.ref,props:Q.props,_owner:Q._owner}}function S(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===r}function L(Q){var z={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Z){return z[Z]})}var P=/\/+/g;function N(Q,z){return typeof Q=="object"&&Q!==null&&Q.key!=null?L(""+Q.key):z.toString(36)}function W(Q,z,Z,re,G){var de=typeof Q;(de==="undefined"||de==="boolean")&&(Q=null);var pe=!1;if(Q===null)pe=!0;else switch(de){case"string":case"number":pe=!0;break;case"object":switch(Q.$$typeof){case r:case e:pe=!0}}if(pe)return pe=Q,G=G(pe),Q=re===""?"."+N(pe,0):re,I(G)?(Z="",Q!=null&&(Z=Q.replace(P,"$&/")+"/"),W(G,z,Z,"",function(Pe){return Pe})):G!=null&&(S(G)&&(G=b(G,Z+(!G.key||pe&&pe.key===G.key?"":(""+G.key).replace(P,"$&/")+"/")+Q)),z.push(G)),1;if(pe=0,re=re===""?".":re+":",I(Q))for(var fe=0;fe<Q.length;fe++){de=Q[fe];var ye=re+N(de,fe);pe+=W(de,z,Z,ye,G)}else if(ye=p(Q),typeof ye=="function")for(Q=ye.call(Q),fe=0;!(de=Q.next()).done;)de=de.value,ye=re+N(de,fe++),pe+=W(de,z,Z,ye,G);else if(de==="object")throw z=String(Q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return pe}function X(Q,z,Z){if(Q==null)return Q;var re=[],G=0;return W(Q,re,"","",function(de){return z.call(Z,de,G++)}),re}function K(Q){if(Q._status===-1){var z=Q._result;z=z(),z.then(function(Z){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Z)},function(Z){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Z)}),Q._status===-1&&(Q._status=0,Q._result=z)}if(Q._status===1)return Q._result.default;throw Q._result}var te={current:null},H={transition:null},ee={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:H,ReactCurrentOwner:M};return Et.Children={map:X,forEach:function(Q,z,Z){X(Q,function(){z.apply(this,arguments)},Z)},count:function(Q){var z=0;return X(Q,function(){z++}),z},toArray:function(Q){return X(Q,function(z){return z})||[]},only:function(Q){if(!S(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},Et.Component=m,Et.Fragment=t,Et.Profiler=i,Et.PureComponent=w,Et.StrictMode=n,Et.Suspense=h,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Et.cloneElement=function(Q,z,Z){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var re=v({},Q.props),G=Q.key,de=Q.ref,pe=Q._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,pe=M.current),z.key!==void 0&&(G=""+z.key),Q.type&&Q.type.defaultProps)var fe=Q.type.defaultProps;for(ye in z)R.call(z,ye)&&!T.hasOwnProperty(ye)&&(re[ye]=z[ye]===void 0&&fe!==void 0?fe[ye]:z[ye])}var ye=arguments.length-2;if(ye===1)re.children=Z;else if(1<ye){fe=Array(ye);for(var Pe=0;Pe<ye;Pe++)fe[Pe]=arguments[Pe+2];re.children=fe}return{$$typeof:r,type:Q.type,key:G,ref:de,props:re,_owner:pe}},Et.createContext=function(Q){return Q={$$typeof:o,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},Et.createElement=D,Et.createFactory=function(Q){var z=D.bind(null,Q);return z.type=Q,z},Et.createRef=function(){return{current:null}},Et.forwardRef=function(Q){return{$$typeof:c,render:Q}},Et.isValidElement=S,Et.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:K}},Et.memo=function(Q,z){return{$$typeof:u,type:Q,compare:z===void 0?null:z}},Et.startTransition=function(Q){var z=H.transition;H.transition={};try{Q()}finally{H.transition=z}},Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Et.useCallback=function(Q,z){return te.current.useCallback(Q,z)},Et.useContext=function(Q){return te.current.useContext(Q)},Et.useDebugValue=function(){},Et.useDeferredValue=function(Q){return te.current.useDeferredValue(Q)},Et.useEffect=function(Q,z){return te.current.useEffect(Q,z)},Et.useId=function(){return te.current.useId()},Et.useImperativeHandle=function(Q,z,Z){return te.current.useImperativeHandle(Q,z,Z)},Et.useInsertionEffect=function(Q,z){return te.current.useInsertionEffect(Q,z)},Et.useLayoutEffect=function(Q,z){return te.current.useLayoutEffect(Q,z)},Et.useMemo=function(Q,z){return te.current.useMemo(Q,z)},Et.useReducer=function(Q,z,Z){return te.current.useReducer(Q,z,Z)},Et.useRef=function(Q){return te.current.useRef(Q)},Et.useState=function(Q){return te.current.useState(Q)},Et.useSyncExternalStore=function(Q,z,Z){return te.current.useSyncExternalStore(Q,z,Z)},Et.useTransition=function(){return te.current.useTransition()},Et.version="18.2.0",Et}b1.exports=ES();var We=b1.exports;const Bh=yS(We);/**
|
|
12
12
|
* @license React
|
|
13
13
|
* react-jsx-runtime.production.min.js
|
|
14
14
|
*
|
|
@@ -16,7 +16,7 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0
|
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var D1;function xS(){if(D1)return Bc;D1=1;var r=We,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Bc.Fragment=t,Bc.jsx=o,Bc.jsxs=o,Bc}B1.exports=xS();var Me=B1.exports;const MQ="";var wS=Object.defineProperty,IS=(r,e,t)=>e in r?wS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(IS(r,typeof e!="symbol"?e+"":e,t),t);const CS={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},L1=Object.freeze(CS);class SS{constructor(e){kt(this,"baseURL"),kt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const bc=new SS({baseURL:L1.host});function MS(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class TS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await bc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MS(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await bc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Sp=new TS;class BS{constructor(e){kt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const Rc=new BS(L1.storePrefix);class bS{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Sp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(Rc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(Rc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(Rc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=Rc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=Rc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function RS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function DS(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Mp={exports:{}},Vo=typeof Reflect=="object"?Reflect:null,N1=Vo&&typeof Vo.apply=="function"?Vo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Bh;Vo&&typeof Vo.ownKeys=="function"?Bh=Vo.ownKeys:Object.getOwnPropertySymbols?Bh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Bh=function(r){return Object.getOwnPropertyNames(r)};function LS(r){console&&console.warn&&console.warn(r)}var U1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=kS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var P1=10;function bh(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return P1},set:function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");P1=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function k1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return k1(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=i[r];if(c===void 0)return!1;if(typeof c=="function")N1(c,this,e);else for(var h=c.length,u=H1(c,h),t=0;t<h;++t)N1(u[t],this,e);return!0};function Q1(r,e,t,n){var i,s,o;if(bh(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=k1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,LS(c)}return r}Qt.prototype.addListener=function(r,e){return Q1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return Q1(this,r,e,!0)};function NS(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=NS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return bh(e),this.on(r,F1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return bh(e),this.prependListener(r,F1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(bh(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():US(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function O1(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?PS(i):H1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):z1.call(r,e)},Qt.prototype.listenerCount=z1;function z1(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Bh(this._events):[]};function H1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function US(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function PS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function kS(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}G1(r,e,s,{once:!0}),e!=="error"&&QS(r,i,{once:!0})})}function QS(r,e,t){typeof r.on=="function"&&G1(r,"error",e,t)}function G1(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var FS=Mp.exports;const V1=class T1 extends FS.EventEmitter{emitEvent(e,t){Object.keys(T1.EVENTS).includes(e)&&this.emit(T1.EVENTS[e],t)}};kt(V1,"EVENTS",{onAddToCart:"add-to-cart"});let OS=V1;var j1={exports:{}};function zS(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var W1={exports:{}};const HS={},GS=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),VS=DS(GS);var Y1;function wt(){return Y1||(Y1=1,function(r,e){(function(t,n){r.exports=n()})(yt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof yt<"u"&&yt.crypto&&(s=yt.crypto),!s&&typeof zS=="function")try{s=VS}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=c(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,M=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<M;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<M;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=M,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,M=I.sigBytes,T=this.blockSize,D=T*4,b=M/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var S=b*T,L=n.min(S*4,M);if(S){for(var P=0;P<S;P+=T)this._doProcessBlock(R,P);x=R.splice(0,S),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(W1)),W1.exports}var q1={exports:{}},X1;function Rh(){return X1||(X1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return c.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(q1)),q1.exports}var K1={exports:{}},J1;function jS(){return J1||(J1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};c.prototype=s}}(),t.lib.WordArray})}(K1)),K1.exports}var Z1={exports:{}},$1;function WS(){return $1||($1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=c(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Z1)),Z1.exports}var e_={exports:{}},t_;function Wa(){return t_||(t_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,_=v<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(_>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(e_)),e_.exports}var r_={exports:{}},n_;function YS(){return n_||(n_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(r_)),r_.exports}var i_={exports:{}},s_;function Ya(){return s_||(s_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],M=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],S=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],W=E[m+9],X=E[m+10],K=E[m+11],te=E[m+12],H=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],G=I[3];z=A(z,Z,re,G,R,7,u[0]),G=A(G,z,Z,re,M,12,u[1]),re=A(re,G,z,Z,T,17,u[2]),Z=A(Z,re,G,z,D,22,u[3]),z=A(z,Z,re,G,b,7,u[4]),G=A(G,z,Z,re,S,12,u[5]),re=A(re,G,z,Z,L,17,u[6]),Z=A(Z,re,G,z,P,22,u[7]),z=A(z,Z,re,G,N,7,u[8]),G=A(G,z,Z,re,W,12,u[9]),re=A(re,G,z,Z,X,17,u[10]),Z=A(Z,re,G,z,K,22,u[11]),z=A(z,Z,re,G,te,7,u[12]),G=A(G,z,Z,re,H,12,u[13]),re=A(re,G,z,Z,ee,17,u[14]),Z=A(Z,re,G,z,Q,22,u[15]),z=p(z,Z,re,G,M,5,u[16]),G=p(G,z,Z,re,L,9,u[17]),re=p(re,G,z,Z,K,14,u[18]),Z=p(Z,re,G,z,R,20,u[19]),z=p(z,Z,re,G,S,5,u[20]),G=p(G,z,Z,re,X,9,u[21]),re=p(re,G,z,Z,Q,14,u[22]),Z=p(Z,re,G,z,b,20,u[23]),z=p(z,Z,re,G,W,5,u[24]),G=p(G,z,Z,re,ee,9,u[25]),re=p(re,G,z,Z,D,14,u[26]),Z=p(Z,re,G,z,N,20,u[27]),z=p(z,Z,re,G,H,5,u[28]),G=p(G,z,Z,re,T,9,u[29]),re=p(re,G,z,Z,P,14,u[30]),Z=p(Z,re,G,z,te,20,u[31]),z=g(z,Z,re,G,S,4,u[32]),G=g(G,z,Z,re,N,11,u[33]),re=g(re,G,z,Z,K,16,u[34]),Z=g(Z,re,G,z,ee,23,u[35]),z=g(z,Z,re,G,M,4,u[36]),G=g(G,z,Z,re,b,11,u[37]),re=g(re,G,z,Z,P,16,u[38]),Z=g(Z,re,G,z,X,23,u[39]),z=g(z,Z,re,G,H,4,u[40]),G=g(G,z,Z,re,R,11,u[41]),re=g(re,G,z,Z,D,16,u[42]),Z=g(Z,re,G,z,L,23,u[43]),z=g(z,Z,re,G,W,4,u[44]),G=g(G,z,Z,re,te,11,u[45]),re=g(re,G,z,Z,Q,16,u[46]),Z=g(Z,re,G,z,T,23,u[47]),z=v(z,Z,re,G,R,6,u[48]),G=v(G,z,Z,re,P,10,u[49]),re=v(re,G,z,Z,ee,15,u[50]),Z=v(Z,re,G,z,S,21,u[51]),z=v(z,Z,re,G,te,6,u[52]),G=v(G,z,Z,re,D,10,u[53]),re=v(re,G,z,Z,X,15,u[54]),Z=v(Z,re,G,z,M,21,u[55]),z=v(z,Z,re,G,N,6,u[56]),G=v(G,z,Z,re,Q,10,u[57]),re=v(re,G,z,Z,L,15,u[58]),Z=v(Z,re,G,z,H,21,u[59]),z=v(z,Z,re,G,b,6,u[60]),G=v(G,z,Z,re,K,10,u[61]),re=v(re,G,z,Z,T,15,u[62]),Z=v(Z,re,G,z,W,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+G|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,M=R.words,T=0;T<4;T++){var D=M[T];M[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var M=E+(m&_|~m&w)+x+R;return(M<<I|M>>>32-I)+m}function p(E,m,_,w,x,I,R){var M=E+(m&w|_&~w)+x+R;return(M<<I|M>>>32-I)+m}function g(E,m,_,w,x,I,R){var M=E+(m^_^w)+x+R;return(M<<I|M>>>32-I)+m}function v(E,m,_,w,x,I,R){var M=E+(_^(m|~w))+x+R;return(M<<I|M>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(i_)),i_.exports}var a_={exports:{}},o_;function l_(){return o_||(o_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],v=p[1],E=p[2],m=p[3],_=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(a_)),a_.exports}var c_={exports:{}},u_;function Tp(){return u_||(u_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],M=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],S=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=S+A[D-7]+P+A[D-16]}var N=I&R^~I&M,W=m&_^m&w^_&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),te=T+K+N+d[D]+A[D],H=X+W;T=M,M=R,R=I,I=x+te|0,x=w,w=_,_=m,m=te+H|0}E[0]=E[0]+m|0,E[1]=E[1]+_|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+M|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(c_)),c_.exports}var h_={exports:{}},d_;function qS(){return d_||(d_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Tp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(h_)),h_.exports}var f_={exports:{}},p_;function A_(){return p_||(p_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],M=m[5],T=m[6],D=m[7],b=_.high,S=_.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,H=R.low,ee=M.high,Q=M.low,z=T.high,Z=T.low,re=D.high,G=D.low,de=b,pe=S,fe=L,ye=P,Pe=N,at=W,se=X,et=K,ke=te,dt=H,Xe=ee,ft=Q,Y=z,k=Z,le=re,Ae=G,me=0;me<80;me++){var Ee,Oe,Ce=p[me];if(me<16)Oe=Ce.high=v[E+me*2]|0,Ee=Ce.low=v[E+me*2+1]|0;else{var Qe=p[me-15],ve=Qe.high,xe=Qe.low,Be=(ve>>>1|xe<<31)^(ve>>>8|xe<<24)^ve>>>7,Ye=(xe>>>1|ve<<31)^(xe>>>8|ve<<24)^(xe>>>7|ve<<25),Le=p[me-2],be=Le.high,nt=Le.low,pt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,ct=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],tt=ut.high,V=ut.low,F=p[me-16],ge=F.high,_e=F.low;Ee=Ye+V,Oe=Be+tt+(Ee>>>0<Ye>>>0?1:0),Ee=Ee+ct,Oe=Oe+pt+(Ee>>>0<ct>>>0?1:0),Ee=Ee+_e,Oe=Oe+ge+(Ee>>>0<_e>>>0?1:0),Ce.high=Oe,Ce.low=Ee}var ze=ke&Xe^~ke&Y,Ne=dt&ft^~dt&k,_t=de&fe^de&Pe^fe&Pe,Dt=pe&ye^pe&at^ye&at,Lt=(de>>>28|pe<<4)^(de<<30|pe>>>2)^(de<<25|pe>>>7),Mt=(pe>>>28|de<<4)^(pe<<30|de>>>2)^(pe<<25|de>>>7),vt=(ke>>>14|dt<<18)^(ke>>>18|dt<<14)^(ke<<23|dt>>>9),hr=(dt>>>14|ke<<18)^(dt>>>18|ke<<14)^(dt<<23|ke>>>9),Vt=A[me],_r=Vt.high,bn=Vt.low,qt=Ae+hr,hi=le+vt+(qt>>>0<Ae>>>0?1:0),qt=qt+Ne,hi=hi+ze+(qt>>>0<Ne>>>0?1:0),qt=qt+bn,hi=hi+_r+(qt>>>0<bn>>>0?1:0),qt=qt+Ee,hi=hi+Oe+(qt>>>0<Ee>>>0?1:0),Jn=Mt+Dt,Ns=Lt+_t+(Jn>>>0<Mt>>>0?1:0);le=Y,Ae=k,Y=Xe,k=ft,Xe=ke,ft=dt,dt=et+qt|0,ke=se+hi+(dt>>>0<et>>>0?1:0)|0,se=Pe,et=at,Pe=fe,at=ye,fe=de,ye=pe,pe=qt+Jn|0,de=hi+Ns+(pe>>>0<qt>>>0?1:0)|0}S=_.low=S+pe,_.high=b+de+(S>>>0<pe>>>0?1:0),P=w.low=P+ye,w.high=L+fe+(P>>>0<ye>>>0?1:0),W=x.low=W+at,x.high=N+Pe+(W>>>0<at>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),H=R.low=H+dt,R.high=te+ke+(H>>>0<dt>>>0?1:0),Q=M.low=Q+ft,M.high=ee+Xe+(Q>>>0<ft>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),G=D.low=G+Ae,D.high=re+le+(G>>>0<Ae>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(f_)),f_.exports}var g_={exports:{}},m_;function XS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh(),A_())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(g_)),g_.exports}var __={exports:{}},v_;function KS(){return v_||(v_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,M=0;M<24;M++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var S=(1<<b)-1;S<32?D^=1<<S:T^=1<<S-32}R&128?R=R<<1^113:R<<=1}g[M]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],M=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360;var T=w[I];T.high^=M,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var S=0,L=0,P=0;P<5;P++){var T=w[b+5*P];S^=T.high,L^=T.low}var N=v[b];N.high=S,N.low=L}for(var b=0;b<5;b++)for(var W=v[(b+4)%5],X=v[(b+1)%5],K=X.high,te=X.low,S=W.high^(K<<1|te>>>31),L=W.low^(te<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=S,T.low^=L}for(var H=1;H<25;H++){var S,L,T=w[H],ee=T.high,Q=T.low,z=A[H];z<32?(S=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(S=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=v[p[H]];Z.high=S,Z.low=L}var re=v[0],G=w[0];re.high=G.high,re.low=G.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var H=b+5*P,T=w[H],de=v[H],pe=v[(b+1)%5+5*P],fe=v[(b+2)%5+5*P];T.high=de.high^~pe.high&fe.high,T.low=de.low^~pe.low&fe.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,M=R/8,T=[],D=0;D<M;D++){var b=I[D],S=b.high,L=b.low;S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(S)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(__)),__.exports}var y_={exports:{}},E_;function JS(){return E_||(E_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){/** @preserve
|
|
19
|
+
*/var D1;function xS(){if(D1)return Bc;D1=1;var r=We,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Bc.Fragment=t,Bc.jsx=o,Bc.jsxs=o,Bc}B1.exports=xS();var Me=B1.exports;const MQ="";var wS=Object.defineProperty,IS=(r,e,t)=>e in r?wS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(IS(r,typeof e!="symbol"?e+"":e,t),t);const CS={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},L1=Object.freeze(CS);class SS{constructor(e){kt(this,"baseURL"),kt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const bc=new SS({baseURL:L1.host});function MS(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class TS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await bc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MS(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await bc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Sp=new TS;class BS{constructor(e){kt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const Rc=new BS(L1.storePrefix);class bS{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Sp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(Rc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(Rc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(Rc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=Rc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=Rc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function RS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function DS(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Mp={exports:{}},jo=typeof Reflect=="object"?Reflect:null,N1=jo&&typeof jo.apply=="function"?jo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},bh;jo&&typeof jo.ownKeys=="function"?bh=jo.ownKeys:Object.getOwnPropertySymbols?bh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:bh=function(r){return Object.getOwnPropertyNames(r)};function LS(r){console&&console.warn&&console.warn(r)}var U1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=kS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var P1=10;function Rh(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return P1},set:function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");P1=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function k1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return k1(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=i[r];if(c===void 0)return!1;if(typeof c=="function")N1(c,this,e);else for(var h=c.length,u=H1(c,h),t=0;t<h;++t)N1(u[t],this,e);return!0};function Q1(r,e,t,n){var i,s,o;if(Rh(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=k1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,LS(c)}return r}Qt.prototype.addListener=function(r,e){return Q1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return Q1(this,r,e,!0)};function NS(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function F1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=NS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return Rh(e),this.on(r,F1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return Rh(e),this.prependListener(r,F1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(Rh(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():US(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function O1(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?PS(i):H1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):z1.call(r,e)},Qt.prototype.listenerCount=z1;function z1(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?bh(this._events):[]};function H1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function US(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function PS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function kS(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}G1(r,e,s,{once:!0}),e!=="error"&&QS(r,i,{once:!0})})}function QS(r,e,t){typeof r.on=="function"&&G1(r,"error",e,t)}function G1(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var FS=Mp.exports;const V1=class T1 extends FS.EventEmitter{emitEvent(e,t){Object.keys(T1.EVENTS).includes(e)&&this.emit(T1.EVENTS[e],t)}};kt(V1,"EVENTS",{onAddToCart:"add-to-cart"});let OS=V1;var j1={exports:{}};function zS(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var W1={exports:{}};const HS={},GS=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),VS=DS(GS);var Y1;function wt(){return Y1||(Y1=1,function(r,e){(function(t,n){r.exports=n()})(yt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof yt<"u"&&yt.crypto&&(s=yt.crypto),!s&&typeof zS=="function")try{s=VS}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=c(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,M=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<M;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<M;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=M,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,M=I.sigBytes,T=this.blockSize,D=T*4,b=M/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var S=b*T,L=n.min(S*4,M);if(S){for(var P=0;P<S;P+=T)this._doProcessBlock(R,P);x=R.splice(0,S),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(W1)),W1.exports}var q1={exports:{}},X1;function Dh(){return X1||(X1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return c.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(q1)),q1.exports}var K1={exports:{}},J1;function jS(){return J1||(J1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};c.prototype=s}}(),t.lib.WordArray})}(K1)),K1.exports}var Z1={exports:{}},$1;function WS(){return $1||($1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=c(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Z1)),Z1.exports}var e_={exports:{}},t_;function Wa(){return t_||(t_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,_=v<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(_>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(e_)),e_.exports}var r_={exports:{}},n_;function YS(){return n_||(n_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(r_)),r_.exports}var i_={exports:{}},s_;function Ya(){return s_||(s_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],M=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],S=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],W=E[m+9],X=E[m+10],K=E[m+11],te=E[m+12],H=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],G=I[3];z=A(z,Z,re,G,R,7,u[0]),G=A(G,z,Z,re,M,12,u[1]),re=A(re,G,z,Z,T,17,u[2]),Z=A(Z,re,G,z,D,22,u[3]),z=A(z,Z,re,G,b,7,u[4]),G=A(G,z,Z,re,S,12,u[5]),re=A(re,G,z,Z,L,17,u[6]),Z=A(Z,re,G,z,P,22,u[7]),z=A(z,Z,re,G,N,7,u[8]),G=A(G,z,Z,re,W,12,u[9]),re=A(re,G,z,Z,X,17,u[10]),Z=A(Z,re,G,z,K,22,u[11]),z=A(z,Z,re,G,te,7,u[12]),G=A(G,z,Z,re,H,12,u[13]),re=A(re,G,z,Z,ee,17,u[14]),Z=A(Z,re,G,z,Q,22,u[15]),z=p(z,Z,re,G,M,5,u[16]),G=p(G,z,Z,re,L,9,u[17]),re=p(re,G,z,Z,K,14,u[18]),Z=p(Z,re,G,z,R,20,u[19]),z=p(z,Z,re,G,S,5,u[20]),G=p(G,z,Z,re,X,9,u[21]),re=p(re,G,z,Z,Q,14,u[22]),Z=p(Z,re,G,z,b,20,u[23]),z=p(z,Z,re,G,W,5,u[24]),G=p(G,z,Z,re,ee,9,u[25]),re=p(re,G,z,Z,D,14,u[26]),Z=p(Z,re,G,z,N,20,u[27]),z=p(z,Z,re,G,H,5,u[28]),G=p(G,z,Z,re,T,9,u[29]),re=p(re,G,z,Z,P,14,u[30]),Z=p(Z,re,G,z,te,20,u[31]),z=g(z,Z,re,G,S,4,u[32]),G=g(G,z,Z,re,N,11,u[33]),re=g(re,G,z,Z,K,16,u[34]),Z=g(Z,re,G,z,ee,23,u[35]),z=g(z,Z,re,G,M,4,u[36]),G=g(G,z,Z,re,b,11,u[37]),re=g(re,G,z,Z,P,16,u[38]),Z=g(Z,re,G,z,X,23,u[39]),z=g(z,Z,re,G,H,4,u[40]),G=g(G,z,Z,re,R,11,u[41]),re=g(re,G,z,Z,D,16,u[42]),Z=g(Z,re,G,z,L,23,u[43]),z=g(z,Z,re,G,W,4,u[44]),G=g(G,z,Z,re,te,11,u[45]),re=g(re,G,z,Z,Q,16,u[46]),Z=g(Z,re,G,z,T,23,u[47]),z=v(z,Z,re,G,R,6,u[48]),G=v(G,z,Z,re,P,10,u[49]),re=v(re,G,z,Z,ee,15,u[50]),Z=v(Z,re,G,z,S,21,u[51]),z=v(z,Z,re,G,te,6,u[52]),G=v(G,z,Z,re,D,10,u[53]),re=v(re,G,z,Z,X,15,u[54]),Z=v(Z,re,G,z,M,21,u[55]),z=v(z,Z,re,G,N,6,u[56]),G=v(G,z,Z,re,Q,10,u[57]),re=v(re,G,z,Z,L,15,u[58]),Z=v(Z,re,G,z,H,21,u[59]),z=v(z,Z,re,G,b,6,u[60]),G=v(G,z,Z,re,K,10,u[61]),re=v(re,G,z,Z,T,15,u[62]),Z=v(Z,re,G,z,W,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+G|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,M=R.words,T=0;T<4;T++){var D=M[T];M[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var M=E+(m&_|~m&w)+x+R;return(M<<I|M>>>32-I)+m}function p(E,m,_,w,x,I,R){var M=E+(m&w|_&~w)+x+R;return(M<<I|M>>>32-I)+m}function g(E,m,_,w,x,I,R){var M=E+(m^_^w)+x+R;return(M<<I|M>>>32-I)+m}function v(E,m,_,w,x,I,R){var M=E+(_^(m|~w))+x+R;return(M<<I|M>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(i_)),i_.exports}var a_={exports:{}},o_;function l_(){return o_||(o_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],v=p[1],E=p[2],m=p[3],_=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(a_)),a_.exports}var c_={exports:{}},u_;function Tp(){return u_||(u_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],M=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],S=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=S+A[D-7]+P+A[D-16]}var N=I&R^~I&M,W=m&_^m&w^_&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),te=T+K+N+d[D]+A[D],H=X+W;T=M,M=R,R=I,I=x+te|0,x=w,w=_,_=m,m=te+H|0}E[0]=E[0]+m|0,E[1]=E[1]+_|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+M|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(c_)),c_.exports}var h_={exports:{}},d_;function qS(){return d_||(d_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Tp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(h_)),h_.exports}var f_={exports:{}},p_;function A_(){return p_||(p_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Dh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],M=m[5],T=m[6],D=m[7],b=_.high,S=_.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,H=R.low,ee=M.high,Q=M.low,z=T.high,Z=T.low,re=D.high,G=D.low,de=b,pe=S,fe=L,ye=P,Pe=N,at=W,se=X,et=K,ke=te,dt=H,Xe=ee,ft=Q,Y=z,k=Z,le=re,Ae=G,me=0;me<80;me++){var Ee,Oe,Ce=p[me];if(me<16)Oe=Ce.high=v[E+me*2]|0,Ee=Ce.low=v[E+me*2+1]|0;else{var Qe=p[me-15],ve=Qe.high,xe=Qe.low,Be=(ve>>>1|xe<<31)^(ve>>>8|xe<<24)^ve>>>7,Ye=(xe>>>1|ve<<31)^(xe>>>8|ve<<24)^(xe>>>7|ve<<25),Le=p[me-2],be=Le.high,nt=Le.low,pt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,ct=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],tt=ut.high,V=ut.low,F=p[me-16],ge=F.high,_e=F.low;Ee=Ye+V,Oe=Be+tt+(Ee>>>0<Ye>>>0?1:0),Ee=Ee+ct,Oe=Oe+pt+(Ee>>>0<ct>>>0?1:0),Ee=Ee+_e,Oe=Oe+ge+(Ee>>>0<_e>>>0?1:0),Ce.high=Oe,Ce.low=Ee}var ze=ke&Xe^~ke&Y,Ne=dt&ft^~dt&k,_t=de&fe^de&Pe^fe&Pe,Dt=pe&ye^pe&at^ye&at,Lt=(de>>>28|pe<<4)^(de<<30|pe>>>2)^(de<<25|pe>>>7),Mt=(pe>>>28|de<<4)^(pe<<30|de>>>2)^(pe<<25|de>>>7),vt=(ke>>>14|dt<<18)^(ke>>>18|dt<<14)^(ke<<23|dt>>>9),hr=(dt>>>14|ke<<18)^(dt>>>18|ke<<14)^(dt<<23|ke>>>9),Vt=A[me],_r=Vt.high,bn=Vt.low,qt=Ae+hr,hi=le+vt+(qt>>>0<Ae>>>0?1:0),qt=qt+Ne,hi=hi+ze+(qt>>>0<Ne>>>0?1:0),qt=qt+bn,hi=hi+_r+(qt>>>0<bn>>>0?1:0),qt=qt+Ee,hi=hi+Oe+(qt>>>0<Ee>>>0?1:0),Jn=Mt+Dt,Ns=Lt+_t+(Jn>>>0<Mt>>>0?1:0);le=Y,Ae=k,Y=Xe,k=ft,Xe=ke,ft=dt,dt=et+qt|0,ke=se+hi+(dt>>>0<et>>>0?1:0)|0,se=Pe,et=at,Pe=fe,at=ye,fe=de,ye=pe,pe=qt+Jn|0,de=hi+Ns+(pe>>>0<qt>>>0?1:0)|0}S=_.low=S+pe,_.high=b+de+(S>>>0<pe>>>0?1:0),P=w.low=P+ye,w.high=L+fe+(P>>>0<ye>>>0?1:0),W=x.low=W+at,x.high=N+Pe+(W>>>0<at>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),H=R.low=H+dt,R.high=te+ke+(H>>>0<dt>>>0?1:0),Q=M.low=Q+ft,M.high=ee+Xe+(Q>>>0<ft>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),G=D.low=G+Ae,D.high=re+le+(G>>>0<Ae>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(f_)),f_.exports}var g_={exports:{}},m_;function XS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Dh(),A_())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(g_)),g_.exports}var __={exports:{}},v_;function KS(){return v_||(v_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Dh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,M=0;M<24;M++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var S=(1<<b)-1;S<32?D^=1<<S:T^=1<<S-32}R&128?R=R<<1^113:R<<=1}g[M]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],M=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360;var T=w[I];T.high^=M,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var S=0,L=0,P=0;P<5;P++){var T=w[b+5*P];S^=T.high,L^=T.low}var N=v[b];N.high=S,N.low=L}for(var b=0;b<5;b++)for(var W=v[(b+4)%5],X=v[(b+1)%5],K=X.high,te=X.low,S=W.high^(K<<1|te>>>31),L=W.low^(te<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=S,T.low^=L}for(var H=1;H<25;H++){var S,L,T=w[H],ee=T.high,Q=T.low,z=A[H];z<32?(S=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(S=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=v[p[H]];Z.high=S,Z.low=L}var re=v[0],G=w[0];re.high=G.high,re.low=G.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var H=b+5*P,T=w[H],de=v[H],pe=v[(b+1)%5+5*P],fe=v[(b+2)%5+5*P];T.high=de.high^~pe.high&fe.high,T.low=de.low^~pe.low&fe.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,M=R/8,T=[],D=0;D<M;D++){var b=I[D],S=b.high,L=b.low;S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(S)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(__)),__.exports}var y_={exports:{}},E_;function JS(){return E_||(E_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){/** @preserve
|
|
20
20
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
21
21
|
|
|
22
22
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -29,15 +29,15 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0
|
|
|
29
29
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
30
30
|
* derived from CryptoJS.mode.CTR
|
|
31
31
|
* Jan Hruby jhruby.web@gmail.com
|
|
32
|
-
*/return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,u=c>>8&255,d=c&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,c=0,c+=h<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function s(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var o=n.Encryptor=n.extend({processBlock:function(c,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var v=0;v<d;v++)c[h+v]^=g[v]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(N_)),N_.exports}var P_={exports:{}},k_;function rM(){return k_||(k_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var c=this._cipher,h=c.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),c.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(P_)),P_.exports}var Q_={exports:{}},F_;function nM(){return F_||(F_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(Q_)),Q_.exports}var O_={exports:{}},z_;function iM(){return z_||(z_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,c=o-s%o,h=s+c-1;n.clamp(),n.words[h>>>2]|=c<<24-h%4*8,n.sigBytes+=c},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(O_)),O_.exports}var H_={exports:{}},G_;function sM(){return G_||(G_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(H_)),H_.exports}var V_={exports:{}},j_;function aM(){return j_||(j_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(V_)),V_.exports}var W_={exports:{}},Y_;function oM(){return Y_||(Y_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(W_)),W_.exports}var q_={exports:{}},X_;function lM(){return X_||(X_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(q_)),q_.exports}var K_={exports:{}},J_;function cM(){return J_||(J_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,c=i.enc,h=c.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(K_)),K_.exports}var Z_={exports:{}},$_;function uM(){return $_||($_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,c=[],h=[],u=[],d=[],A=[],p=[],g=[],v=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,M=0,I=0;I<256;I++){var T=M^M<<1^M<<2^M<<3^M<<4;T=T>>>8^T&255^99,c[R]=T,h[T]=R;var D=x[R],b=x[D],S=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=S*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,v[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[S^D]]],M^=x[x[M]]):R=M=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,M=I.sigBytes/4,T=this._nRounds=M+6,D=(T+1)*4,b=this._keySchedule=[],S=0;S<D;S++)S<M?b[S]=R[S]:(x=b[S-1],S%M?M>6&&S%M==4&&(x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255]):(x=x<<8|x>>>24,x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255],x^=_[S/M|0]<<24),b[S]=b[S-M]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var S=D-P;if(P%4)var x=b[S];else var x=b[S-4];P<4||S<=4?L[P]=x:L[P]=g[c[x>>>24]]^v[c[x>>>16&255]]^E[c[x>>>8&255]]^m[c[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,c)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,v,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,M,T,D,b,S){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],W=x[I+2]^R[2],X=x[I+3]^R[3],K=4,te=1;te<L;te++){var H=M[P>>>24]^T[N>>>16&255]^D[W>>>8&255]^b[X&255]^R[K++],ee=M[N>>>24]^T[W>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=M[W>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=M[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[W&255]^R[K++];P=H,N=ee,W=Q,X=z}var H=(S[P>>>24]<<24|S[N>>>16&255]<<16|S[W>>>8&255]<<8|S[X&255])^R[K++],ee=(S[N>>>24]<<24|S[W>>>16&255]<<16|S[X>>>8&255]<<8|S[P&255])^R[K++],Q=(S[W>>>24]<<24|S[X>>>16&255]<<16|S[P>>>8&255]<<8|S[N&255])^R[K++],z=(S[X>>>24]<<24|S[P>>>16&255]<<16|S[N>>>8&255]<<8|S[W&255])^R[K++];x[I]=H,x[I+1]=ee,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(Z_)),Z_.exports}var ev={exports:{}},tv;function hM(){return tv||(tv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,c=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=o.extend({_doReset:function(){for(var _=this._key,w=_.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var M=this._subKeys=[],T=0;T<16;T++){for(var D=M[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var S=this._invSubKeys=[],I=0;I<16;I++)S[I]=M[15-I]},encryptBlock:function(_,w){this._doCryptBlock(_,w,this._subKeys)},decryptBlock:function(_,w){this._doCryptBlock(_,w,this._invSubKeys)},_doCryptBlock:function(_,w,x){this._lBlock=_[w],this._rBlock=_[w+1],v.call(this,4,252645135),v.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),v.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],M=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=M^D}var S=this._lBlock;this._lBlock=this._rBlock,this._rBlock=S,v.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),_[w]=this._lBlock,_[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(_,w){var x=(this._lBlock>>>_^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<_}function E(_,w){var x=(this._rBlock>>>_^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<_}n.DES=o._createHelper(g);var m=c.TripleDES=o.extend({_doReset:function(){var _=this._key,w=_.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(_,w){this._des1.encryptBlock(_,w),this._des2.decryptBlock(_,w),this._des3.encryptBlock(_,w)},decryptBlock:function(_,w){this._des3.decryptBlock(_,w),this._des2.encryptBlock(_,w),this._des1.decryptBlock(_,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}(ev)),ev.exports}var rv={exports:{}},nv;function dM(){return nv||(nv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],v=0;v<256;v++)g[v]=v;for(var v=0,E=0;v<256;v++){var m=v%p,_=A[m>>>2]>>>24-m%4*8&255;E=(E+g[v]+_)%256;var w=g[v];g[v]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,v=0;v<4;v++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-v*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(c);var u=o.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(rv)),rv.exports}var iv={exports:{}},sv;function fM(){return sv||(sv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,v=0;v<4;v++)p[v]=(p[v]<<8|p[v]>>>24)&16711935|(p[v]<<24|p[v]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var v=0;v<4;v++)A.call(this);for(var v=0;v<8;v++)m[v]^=E[v+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,M=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=M,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=M,m[6]^=R,m[7]^=T;for(var v=0;v<4;v++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(iv)),iv.exports}var av={exports:{}},ov;function pM(){return ov||(ov=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,v=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=v[m+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,M=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=M,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=M,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(av)),av.exports}var lv={exports:{}},cv;function AM(){return cv||(cv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,_){let w=_>>24&255,x=_>>16&255,I=_>>8&255,R=_&255,M=m.sbox[0][w]+m.sbox[1][x];return M=M^m.sbox[2][I],M=M+m.sbox[3][R],M}function p(m,_,w){let x=_,I=w,R;for(let M=0;M<c;++M)x=x^m.pbox[M],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[c],x=x^m.pbox[c+1],{left:x,right:I}}function g(m,_,w){let x=_,I=w,R;for(let M=c+1;M>1;--M)x=x^m.pbox[M],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function v(m,_,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<c+2;T++)m.pbox[T]=h[T]^_[x],x++,x>=w&&(x=0);let I=0,R=0,M=0;for(let T=0;T<c+2;T+=2)M=p(m,I,R),I=M.left,R=M.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)M=p(m,I,R),I=M.left,R=M.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,_=m.words,w=m.sigBytes/4;v(d,_,w)}},encryptBlock:function(m,_){var w=p(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},decryptBlock:function(m,_){var w=g(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(lv)),lv.exports}(function(r,e){(function(t,n,i){r.exports=n(wt(),Rh(),jS(),WS(),Wa(),YS(),Ya(),l_(),Tp(),qS(),A_(),XS(),KS(),JS(),Bp(),ZS(),Ws(),Ur(),$S(),eM(),tM(),rM(),nM(),iM(),sM(),aM(),oM(),lM(),cM(),uM(),hM(),dM(),fM(),pM(),AM())})(yt,function(t){return t})})(j1);var gM=j1.exports;const bp=RS(gM);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mM=4,uv=0,hv=1,_M=2;function jo(r){let e=r.length;for(;--e>=0;)r[e]=0}const vM=0,dv=1,yM=2,EM=3,xM=258,Rp=29,Dc=256,Lc=Dc+1+Rp,Wo=30,Dp=19,fv=2*Lc+1,qa=15,Lp=16,wM=7,Np=256,pv=16,Av=17,gv=18,Up=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Dh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),IM=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),CM=512,us=new Array((Lc+2)*2);jo(us);const Nc=new Array(Wo*2);jo(Nc);const Uc=new Array(CM);jo(Uc);const Pc=new Array(xM-EM+1);jo(Pc);const Pp=new Array(Rp);jo(Pp);const Lh=new Array(Wo);jo(Lh);function kp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let _v,vv,yv;function Qp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const Ev=r=>r<256?Uc[r]:Uc[256+(r>>>7)],kc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},vn=(r,e,t)=>{r.bi_valid>Lp-t?(r.bi_buf|=e<<r.bi_valid&65535,kc(r,r.bi_buf),r.bi_buf=e>>Lp-r.bi_valid,r.bi_valid+=t-Lp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},Hi=(r,e,t)=>{vn(r,t[e*2],t[e*2+1])},xv=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},SM=r=>{r.bi_valid===16?(kc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},MM=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,v,E=0;for(p=0;p<=qa;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<fv;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=c&&(g=o[d-c]),v=t[d*2],r.opt_len+=v*(p+g),s&&(r.static_len+=v*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},wv=(r,e,t)=>{const n=new Array(qa+1);let i=0,s,o;for(s=1;s<=qa;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let c=r[o*2+1];c!==0&&(r[o*2]=xv(n[c]++,c))}},TM=()=>{let r,e,t,n,i;const s=new Array(qa+1);for(t=0,n=0;n<Rp-1;n++)for(Pp[n]=t,r=0;r<1<<Up[n];r++)Pc[t++]=n;for(Pc[t-1]=n,i=0,n=0;n<16;n++)for(Lh[n]=i,r=0;r<1<<Dh[n];r++)Uc[i++]=n;for(i>>=7;n<Wo;n++)for(Lh[n]=i<<7,r=0;r<1<<Dh[n]-7;r++)Uc[256+i++]=n;for(e=0;e<=qa;e++)s[e]=0;for(r=0;r<=143;)us[r*2+1]=8,r++,s[8]++;for(;r<=255;)us[r*2+1]=9,r++,s[9]++;for(;r<=279;)us[r*2+1]=7,r++,s[7]++;for(;r<=287;)us[r*2+1]=8,r++,s[8]++;for(wv(us,Lc+1,s),r=0;r<Wo;r++)Nc[r*2+1]=5,Nc[r*2]=xv(r,5);_v=new kp(us,Up,Dc+1,Lc,qa),vv=new kp(Nc,Dh,0,Wo,qa),yv=new kp(new Array(0),IM,0,Dp,wM)},Iv=r=>{let e;for(e=0;e<Lc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<Wo;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Dp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Np*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Cv=r=>{r.bi_valid>8?kc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Sv=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Fp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&Sv(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!Sv(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},Mv=(r,e,t)=>{let n,i,s=0,o,c;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?Hi(r,i,e):(o=Pc[i],Hi(r,o+Dc+1,e),c=Up[o],c!==0&&(i-=Pp[o],vn(r,i,c)),n--,o=Ev(n),Hi(r,o,t),c=Dh[o],c!==0&&(n-=Lh[o],vn(r,n,c)));while(s<r.sym_next);Hi(r,Np,e)},Op=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,c,h=-1,u;for(r.heap_len=0,r.heap_max=fv,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Fp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Fp(r,t,1),c=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=c,t[u*2]=t[o*2]+t[c*2],r.depth[u]=(r.depth[o]>=r.depth[c]?r.depth[o]:r.depth[c])+1,t[o*2+1]=t[c*2+1]=u,r.heap[1]=u++,Fp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],MM(r,e),wv(t,h,r.bl_count)},Tv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)&&(c<u?r.bl_tree[s*2]+=c:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[pv*2]++):c<=10?r.bl_tree[Av*2]++:r.bl_tree[gv*2]++,c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Bv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)){if(c<u)do Hi(r,s,r.bl_tree);while(--c!==0);else s!==0?(s!==i&&(Hi(r,s,r.bl_tree),c--),Hi(r,pv,r.bl_tree),vn(r,c-3,2)):c<=10?(Hi(r,Av,r.bl_tree),vn(r,c-3,3)):(Hi(r,gv,r.bl_tree),vn(r,c-11,7));c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},BM=r=>{let e;for(Tv(r,r.dyn_ltree,r.l_desc.max_code),Tv(r,r.dyn_dtree,r.d_desc.max_code),Op(r,r.bl_desc),e=Dp-1;e>=3&&r.bl_tree[mv[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},bM=(r,e,t,n)=>{let i;for(vn(r,e-257,5),vn(r,t-1,5),vn(r,n-4,4),i=0;i<n;i++)vn(r,r.bl_tree[mv[i]*2+1],3);Bv(r,r.dyn_ltree,e-1),Bv(r,r.dyn_dtree,t-1)},RM=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return uv;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return hv;for(t=32;t<Dc;t++)if(r.dyn_ltree[t*2]!==0)return hv;return uv};let bv=!1;const DM=r=>{bv||(TM(),bv=!0),r.l_desc=new Qp(r.dyn_ltree,_v),r.d_desc=new Qp(r.dyn_dtree,vv),r.bl_desc=new Qp(r.bl_tree,yv),r.bi_buf=0,r.bi_valid=0,Iv(r)},Rv=(r,e,t,n)=>{vn(r,(vM<<1)+(n?1:0),3),Cv(r),kc(r,t),kc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},LM=r=>{vn(r,dv<<1,3),Hi(r,Np,us),SM(r)},NM=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===_M&&(r.strm.data_type=RM(r)),Op(r,r.l_desc),Op(r,r.d_desc),o=BM(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?Rv(r,e,t,n):r.strategy===mM||s===i?(vn(r,(dv<<1)+(n?1:0),3),Mv(r,us,Nc)):(vn(r,(yM<<1)+(n?1:0),3),bM(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),Mv(r,r.dyn_ltree,r.dyn_dtree)),Iv(r),n&&Cv(r)},UM=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Pc[t]+Dc+1)*2]++,r.dyn_dtree[Ev(e)*2]++),r.sym_next===r.sym_end);var PM=DM,kM=Rv,QM=NM,FM=UM,OM=LM,zM={_tr_init:PM,_tr_stored_block:kM,_tr_flush_block:QM,_tr_tally:FM,_tr_align:OM},Qc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const HM=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},GM=new Uint32Array(HM());var Pr=(r,e,t,n)=>{const i=GM,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},Xa={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ka={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:VM,_tr_stored_block:zp,_tr_flush_block:jM,_tr_tally:Ys,_tr_align:WM}=zM,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:YM,Z_FULL_FLUSH:qM,Z_FINISH:ri,Z_BLOCK:Dv,Z_OK:Wr,Z_STREAM_END:Lv,Z_STREAM_ERROR:Gi,Z_DATA_ERROR:XM,Z_BUF_ERROR:Hp,Z_DEFAULT_COMPRESSION:KM,Z_FILTERED:JM,Z_HUFFMAN_ONLY:Nh,Z_RLE:ZM,Z_FIXED:$M,Z_DEFAULT_STRATEGY:eT,Z_UNKNOWN:tT,Z_DEFLATED:Uh}=Ka,rT=9,nT=15,iT=8,sT=29,aT=256,Gp=aT+1+sT,oT=30,lT=19,cT=2*Gp+1,uT=15,It=3,Xs=258,Vi=Xs+It+1,hT=32,Yo=42,Vp=57,jp=69,Wp=73,Yp=91,qp=103,Ja=113,Fc=666,on=1,qo=2,Za=3,Xo=4,dT=3,$a=(r,e)=>(r.msg=Xa[e],e),Nv=r=>r*2-(r>4?9:0),Ks=r=>{let e=r.length;for(;--e>=0;)r[e]=0},fT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let pT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Js=pT;const Fn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},On=(r,e)=>{jM(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Fn(r.strm)},bt=(r,e)=>{r.pending_buf[r.pending++]=e},Oc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},Xp=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=Qc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=Pr(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},Uv=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,c=r.nice_match;const h=r.strstart>r.w_size-Vi?r.strstart-(r.w_size-Vi):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+Xs;let g=u[n+o-1],v=u[n+o];r.prev_length>=r.good_match&&(t>>=2),c>r.lookahead&&(c=r.lookahead);do if(i=e,!(u[i+o]!==v||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=Xs-(p-n),n=p-Xs,s>o){if(r.match_start=e,o=s,s>=c)break;g=u[n+o-1],v=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},Ko=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Vi)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),fT(r),n+=e),r.strm.avail_in===0)break;if(t=Xp(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=It)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Js(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Js(r,r.ins_h,r.window[i+It-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<It)););}while(r.lookahead<Vi&&r.strm.avail_in!==0)},Pv=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,c=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ri||e===qs||n!==i+r.strm.avail_in)))break;o=e===ri&&n===i+r.strm.avail_in?1:0,zp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,Fn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(Xp(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return c-=r.strm.avail_in,c&&(c>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=c&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-c,r.strm.next_in),r.strstart),r.strstart+=c,r.insert+=c>r.w_size-r.insert?r.w_size-r.insert:c),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?Xo:e!==qs&&e!==ri&&r.strm.avail_in===0&&r.strstart===r.block_start?qo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(Xp(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ri)&&e!==qs&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ri&&r.strm.avail_in===0&&n===i?1:0,zp(r,r.block_start,n,o),r.block_start+=n,Fn(r.strm)),o?Za:on)},Kp=(r,e)=>{let t,n;for(;;){if(r.lookahead<Vi){if(Ko(r),r.lookahead<Vi&&e===qs)return on;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-Vi&&(r.match_length=Uv(r,t)),r.match_length>=It)if(n=Ys(r,r.strstart-r.match_start,r.match_length-It),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=It){r.match_length--;do r.strstart++,r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Js(r,r.ins_h,r.window[r.strstart+1]);else n=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=r.strstart<It-1?r.strstart:It-1,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Xo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:qo},Jo=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<Vi){if(Ko(r),r.lookahead<Vi&&e===qs)return on;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=It-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-Vi&&(r.match_length=Uv(r,t),r.match_length<=5&&(r.strategy===JM||r.match_length===It&&r.strstart-r.match_start>4096)&&(r.match_length=It-1)),r.prev_length>=It&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-It,n=Ys(r,r.strstart-1-r.prev_match,r.prev_length-It),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=It-1,r.strstart++,n&&(On(r,!1),r.strm.avail_out===0))return on}else if(r.match_available){if(n=Ys(r,0,r.window[r.strstart-1]),n&&On(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return on}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ys(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<It-1?r.strstart:It-1,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Xo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:qo},AT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=Xs){if(Ko(r),r.lookahead<=Xs&&e===qs)return on;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=It&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+Xs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=Xs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=It?(t=Ys(r,1,r.match_length-It),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=0,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Xo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:qo},gT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(Ko(r),r.lookahead===0)){if(e===qs)return on;break}if(r.match_length=0,t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=0,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Xo):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:qo};function ji(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const zc=[new ji(0,0,0,0,Pv),new ji(4,4,8,4,Kp),new ji(4,5,16,8,Kp),new ji(4,6,32,32,Kp),new ji(4,4,16,16,Jo),new ji(8,16,32,32,Jo),new ji(8,16,128,128,Jo),new ji(8,32,128,256,Jo),new ji(32,128,258,1024,Jo),new ji(32,258,258,4096,Jo)],mT=r=>{r.window_size=2*r.w_size,Ks(r.head),r.max_lazy_match=zc[r.level].max_lazy,r.good_match=zc[r.level].good_length,r.nice_match=zc[r.level].nice_length,r.max_chain_length=zc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=It-1,r.match_available=0,r.ins_h=0};function _T(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Uh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(cT*2),this.dyn_dtree=new Uint16Array((2*oT+1)*2),this.bl_tree=new Uint16Array((2*lT+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(uT+1),this.heap=new Uint16Array(2*Gp+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Gp+1),Ks(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Hc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==Yo&&e.status!==Vp&&e.status!==jp&&e.status!==Wp&&e.status!==Yp&&e.status!==qp&&e.status!==Ja&&e.status!==Fc?1:0},kv=r=>{if(Hc(r))return $a(r,Gi);r.total_in=r.total_out=0,r.data_type=tT;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Vp:e.wrap?Yo:Ja,r.adler=e.wrap===2?0:1,e.last_flush=-2,VM(e),Wr},Qv=r=>{const e=kv(r);return e===Wr&&mT(r.state),e},vT=(r,e)=>Hc(r)||r.state.wrap!==2?Gi:(r.state.gzhead=e,Wr),Fv=(r,e,t,n,i,s)=>{if(!r)return Gi;let o=1;if(e===KM&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>rT||t!==Uh||n<8||n>15||e<0||e>9||s<0||s>$M||n===8&&o!==1)return $a(r,Gi);n===8&&(n=9);const c=new _T;return r.state=c,c.strm=r,c.status=Yo,c.wrap=o,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=i+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+It-1)/It),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=e,c.strategy=s,c.method=t,Qv(r)},yT=(r,e)=>Fv(r,e,Uh,nT,iT,eT),ET=(r,e)=>{if(Hc(r)||e>Dv||e<0)return r?$a(r,Gi):Gi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===Fc&&e!==ri)return $a(r,r.avail_out===0?Hp:Gi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Fn(r),r.avail_out===0)return t.last_flush=-1,Wr}else if(r.avail_in===0&&Nv(e)<=Nv(n)&&e!==ri)return $a(r,Hp);if(t.status===Fc&&r.avail_in!==0)return $a(r,Hp);if(t.status===Yo&&t.wrap===0&&(t.status=Ja),t.status===Yo){let i=Uh+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Nh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=hT),i+=31-i%31,Oc(t,i),t.strstart!==0&&(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),r.adler=1,t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(t.status===Vp){if(r.adler=0,bt(t,31),bt(t,139),bt(t,8),t.gzhead)bt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),bt(t,t.gzhead.time&255),bt(t,t.gzhead.time>>8&255),bt(t,t.gzhead.time>>16&255),bt(t,t.gzhead.time>>24&255),bt(t,t.level===9?2:t.strategy>=Nh||t.level<2?4:0),bt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(bt(t,t.gzhead.extra.length&255),bt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=Pr(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=jp;else if(bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,t.level===9?2:t.strategy>=Nh||t.level<2?4:0),bt(t,dT),t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(t.status===jp){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let c=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+c),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=c,Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0,s-=c}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Wp}if(t.status===Wp){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Yp}if(t.status===Yp){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i))}t.status=qp}if(t.status===qp){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Fn(r),t.pending!==0))return t.last_flush=-1,Wr;bt(t,r.adler&255),bt(t,r.adler>>8&255),r.adler=0}if(t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(r.avail_in!==0||t.lookahead!==0||e!==qs&&t.status!==Fc){let i=t.level===0?Pv(t,e):t.strategy===Nh?gT(t,e):t.strategy===ZM?AT(t,e):zc[t.level].func(t,e);if((i===Za||i===Xo)&&(t.status=Fc),i===on||i===Za)return r.avail_out===0&&(t.last_flush=-1),Wr;if(i===qo&&(e===YM?WM(t):e!==Dv&&(zp(t,0,0,!1),e===qM&&(Ks(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Fn(r),r.avail_out===0))return t.last_flush=-1,Wr}return e!==ri?Wr:t.wrap<=0?Lv:(t.wrap===2?(bt(t,r.adler&255),bt(t,r.adler>>8&255),bt(t,r.adler>>16&255),bt(t,r.adler>>24&255),bt(t,r.total_in&255),bt(t,r.total_in>>8&255),bt(t,r.total_in>>16&255),bt(t,r.total_in>>24&255)):(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),Fn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Wr:Lv)},xT=r=>{if(Hc(r))return Gi;const e=r.state.status;return r.state=null,e===Ja?$a(r,XM):Wr},wT=(r,e)=>{let t=e.length;if(Hc(r))return Gi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==Yo||n.lookahead)return Gi;if(i===1&&(r.adler=Qc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Ks(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,c=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,Ko(n);n.lookahead>=It;){let h=n.strstart,u=n.lookahead-(It-1);do n.ins_h=Js(n,n.ins_h,n.window[h+It-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=It-1,Ko(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=It-1,n.match_available=0,r.next_in=o,r.input=c,r.avail_in=s,n.wrap=i,Wr};var IT=yT,CT=Fv,ST=Qv,MT=kv,TT=vT,BT=ET,bT=xT,RT=wT,DT="pako deflate (from Nodeca project)",Gc={deflateInit:IT,deflateInit2:CT,deflateReset:ST,deflateResetKeep:MT,deflateSetHeader:TT,deflate:BT,deflateEnd:bT,deflateSetDictionary:RT,deflateInfo:DT};const LT=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var NT=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)LT(t,n)&&(r[n]=t[n])}}return r},UT=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},Ph={assign:NT,flattenChunks:UT};let Ov=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ov=!1}const Vc=new Uint8Array(256);for(let r=0;r<256;r++)Vc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Vc[254]=Vc[254]=1;var PT=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,c=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),s=0,i=0;s<c;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const kT=(r,e)=>{if(e<65534&&r.subarray&&Ov)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var QT=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let c=Vc[o];if(c>4){s[i++]=65533,n+=c-1;continue}for(o&=c===2?31:c===3?15:7;c>1&&n<t;)o=o<<6|r[n++]&63,c--;if(c>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return kT(s,i)},FT=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Vc[r[t]]>e?t:e},jc={string2buf:PT,buf2string:QT,utf8border:FT};function OT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zv=OT;const Hv=Object.prototype.toString,{Z_NO_FLUSH:zT,Z_SYNC_FLUSH:HT,Z_FULL_FLUSH:GT,Z_FINISH:VT,Z_OK:kh,Z_STREAM_END:jT,Z_DEFAULT_COMPRESSION:WT,Z_DEFAULT_STRATEGY:YT,Z_DEFLATED:qT}=Ka;function Wc(r){this.options=Ph.assign({level:WT,method:qT,chunkSize:16384,windowBits:15,memLevel:8,strategy:YT},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zv,this.strm.avail_out=0;let t=Gc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==kh)throw new Error(Xa[t]);if(e.header&&Gc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=jc.string2buf(e.dictionary):Hv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Gc.deflateSetDictionary(this.strm,n),t!==kh)throw new Error(Xa[t]);this._dict_set=!0}}Wc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?VT:zT,typeof r=="string"?t.input=jc.string2buf(r):Hv.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===HT||s===GT)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Gc.deflate(t,s),i===jT)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Gc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===kh;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Wc.prototype.onData=function(r){this.chunks.push(r)},Wc.prototype.onEnd=function(r){r===kh&&(this.result=Ph.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Jp(r,e){const t=new Wc(e);if(t.push(r,!0),t.err)throw t.msg||Xa[t.err];return t.result}function XT(r,e){return e=e||{},e.raw=!0,Jp(r,e)}function KT(r,e){return e=e||{},e.gzip=!0,Jp(r,e)}var JT=Wc,ZT=Jp,$T=XT,e4=KT,t4=Ka,r4={Deflate:JT,deflate:ZT,deflateRaw:$T,gzip:e4,constants:t4};const Qh=16209,n4=16191;var i4=function(r,e){let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m,_,w,x,I,R,M,T,D,b;const S=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),c=S.dmax,h=S.wsize,u=S.whave,d=S.wnext,A=S.window,p=S.hold,g=S.bits,v=S.lencode,E=S.distcode,m=(1<<S.lenbits)-1,_=(1<<S.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=v[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&_];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>c){r.msg="invalid distance too far back",S.mode=Qh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&S.sane){r.msg="invalid distance too far back",S.mode=Qh;break e}if(M=0,T=A,d===0){if(M+=h-x,x<I){I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}}else if(d<x){if(M+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[M++];while(--x);if(M=0,d<I){x=d,I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}}}else if(M+=d-x,x<I){I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}for(;I>2;)b[i++]=T[M++],b[i++]=T[M++],b[i++]=T[M++],I-=3;I&&(b[i++]=T[M++],I>1&&(b[i++]=T[M++]))}else{M=i-R;do b[i++]=b[M++],b[i++]=b[M++],b[i++]=b[M++],I-=3;while(I>2);I&&(b[i++]=b[M++],I>1&&(b[i++]=b[M++]))}}else if(x&64){r.msg="invalid distance code",S.mode=Qh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){S.mode=n4;break e}else{r.msg="invalid literal/length code",S.mode=Qh;break e}else{w=v[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),S.hold=p,S.bits=g};const Zo=15,Gv=852,Vv=592,jv=0,Zp=1,Wv=2,s4=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),a4=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),o4=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),l4=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Yc=(r,e,t,n,i,s,o,c)=>{const h=c.bits;let u=0,d=0,A=0,p=0,g=0,v=0,E=0,m=0,_=0,w=0,x,I,R,M,T,D=null,b;const S=new Uint16Array(Zo+1),L=new Uint16Array(Zo+1);let P=null,N,W,X;for(u=0;u<=Zo;u++)S[u]=0;for(d=0;d<n;d++)S[e[t+d]]++;for(g=h,p=Zo;p>=1&&S[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,c.bits=1,0;for(A=1;A<p&&S[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=Zo;u++)if(m<<=1,m-=S[u],m<0)return-1;if(m>0&&(r===jv||p!==1))return-1;for(L[1]=0,u=1;u<Zo;u++)L[u+1]=L[u]+S[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===jv?(D=P=o,b=20):r===Zp?(D=s4,P=a4,b=257):(D=o4,P=l4,b=0),w=0,d=0,u=A,T=s,v=g,E=0,R=-1,_=1<<g,M=_-1,r===Zp&&_>Gv||r===Wv&&_>Vv)return 1;for(;;){N=u-E,o[d]+1<b?(W=0,X=o[d]):o[d]>=b?(W=P[o[d]-b],X=D[o[d]-b]):(W=32+64,X=0),x=1<<u-E,I=1<<v,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|W<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--S[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&M)!==R){for(E===0&&(E=g),T+=A,v=u-E,m=1<<v;v+E<p&&(m-=S[v+E],!(m<=0));)v++,m<<=1;if(_+=1<<v,r===Zp&&_>Gv||r===Wv&&_>Vv)return 1;R=w&M,i[R]=g<<24|v<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),c.bits=g,0};const c4=0,Yv=1,qv=2,{Z_FINISH:Xv,Z_BLOCK:u4,Z_TREES:Fh,Z_OK:eo,Z_STREAM_END:h4,Z_NEED_DICT:d4,Z_STREAM_ERROR:vi,Z_DATA_ERROR:Kv,Z_MEM_ERROR:Jv,Z_BUF_ERROR:f4,Z_DEFLATED:Zv}=Ka,Oh=16180,$v=16181,ey=16182,ty=16183,ry=16184,ny=16185,iy=16186,sy=16187,ay=16188,oy=16189,zh=16190,hs=16191,$p=16192,ly=16193,eA=16194,cy=16195,uy=16196,hy=16197,dy=16198,Hh=16199,Gh=16200,fy=16201,py=16202,Ay=16203,gy=16204,my=16205,tA=16206,_y=16207,vy=16208,Jt=16209,yy=16210,Ey=16211,p4=852,A4=592,g4=15,m4=g4,xy=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function _4(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const to=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Oh||e.mode>Ey?1:0},wy=r=>{if(to(r))return vi;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Oh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(p4),e.distcode=e.distdyn=new Int32Array(A4),e.sane=1,e.back=-1,eo},Iy=r=>{if(to(r))return vi;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,wy(r)},Cy=(r,e)=>{let t;if(to(r))return vi;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?vi:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Iy(r))},Sy=(r,e)=>{if(!r)return vi;const t=new _4;r.state=t,t.strm=r,t.window=null,t.mode=Oh;const n=Cy(r,e);return n!==eo&&(r.state=null),n},v4=r=>Sy(r,m4);let My=!0,rA,nA;const y4=r=>{if(My){rA=new Int32Array(512),nA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Yc(Yv,r.lens,0,288,rA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Yc(qv,r.lens,0,32,nA,0,r.work,{bits:5}),My=!1}r.lencode=rA,r.lenbits=9,r.distcode=nA,r.distbits=5},Ty=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},E4=(r,e)=>{let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m=0,_,w,x,I,R,M,T,D;const b=new Uint8Array(4);let S,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(to(r)||!r.output||!r.input&&r.avail_in!==0)return vi;t=r.state,t.mode===hs&&(t.mode=$p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,A=c,p=h,D=eo;e:for(;;)switch(t.mode){case Oh:if(t.wrap===0){t.mode=$p;break}for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0),u=0,d=0,t.mode=$v;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==Zv){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?oy:hs,u=0,d=0;break;case $v:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==Zv){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0,t.mode=ey;case ey:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=Pr(t.check,b,4,0)),u=0,d=0,t.mode=ty;case ty:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0,t.mode=ry;case ry:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=ny;case ny:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=iy;case iy:if(t.flags&2048){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=sy;case sy:if(t.flags&4096){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=ay;case ay:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=hs;break;case oy:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}r.adler=t.check=xy(u),u=0,d=0,t.mode=zh;case zh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,d4;r.adler=t.check=1,t.mode=hs;case hs:if(e===u4||e===Fh)break e;case $p:if(t.last){u>>>=d&7,d-=d&7,t.mode=tA;break}for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=ly;break;case 1:if(y4(t),t.mode=Hh,e===Fh){u>>>=2,d-=2;break e}break;case 2:t.mode=uy;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case ly:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=eA,e===Fh)break e;case eA:t.mode=cy;case cy:if(g=t.length,g){if(g>c&&(g=c),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),c-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=hs;break;case uy:for(;d<14;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=hy;case hy:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,S={bits:t.lenbits},D=Yc(c4,t.lens,0,19,t.lencode,0,t.work,S),t.lenbits=S.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=dy;case dy:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=_,d-=_,t.lens[t.have++]=x;else{if(x===16){for(L=_+2;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(u>>>=_,d-=_,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=_+3;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=_+7;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,S={bits:t.lenbits},D=Yc(Yv,t.lens,0,t.nlen,t.lencode,0,t.work,S),t.lenbits=S.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,S={bits:t.distbits},D=Yc(qv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,S),t.distbits=S.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=Hh,e===Fh)break e;case Hh:t.mode=Gh;case Gh:if(c>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,i4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,t.mode===hs&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=_,R=w,M=x;m=t.lencode[M+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,t.length=x,w===0){t.mode=my;break}if(w&32){t.back=-1,t.mode=hs;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=fy;case fy:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=py;case py:for(;m=t.distcode[u&(1<<t.distbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=_,R=w,M=x;m=t.distcode[M+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=Ay;case Ay:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=gy;case gy:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,v=t.wsize-g):v=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,v=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[v++];while(--g);t.length===0&&(t.mode=Gh);break;case my:if(h===0)break e;i[o++]=t.length,h--,t.mode=Gh;break;case tA:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Pr(t.check,i,p,o-p):Qc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:xy(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=_y;case _y:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=vy;case vy:D=h4;break e;case Jt:D=Kv;break e;case yy:return Jv;case Ey:default:return vi}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<tA||e!==Xv))&&Ty(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Pr(t.check,i,p,r.next_out-p):Qc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===hs?128:0)+(t.mode===Hh||t.mode===eA?256:0),(A===0&&p===0||e===Xv)&&D===eo&&(D=f4),D},x4=r=>{if(to(r))return vi;let e=r.state;return e.window&&(e.window=null),r.state=null,eo},w4=(r,e)=>{if(to(r))return vi;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,eo):vi},I4=(r,e)=>{const t=e.length;let n,i,s;return to(r)||(n=r.state,n.wrap!==0&&n.mode!==zh)?vi:n.mode===zh&&(i=1,i=Qc(i,e,t,0),i!==n.check)?Kv:(s=Ty(r,e,t,t),s?(n.mode=yy,Jv):(n.havedict=1,eo))};var C4=Iy,S4=Cy,M4=wy,T4=v4,B4=Sy,b4=E4,R4=x4,D4=w4,L4=I4,N4="pako inflate (from Nodeca project)",ds={inflateReset:C4,inflateReset2:S4,inflateResetKeep:M4,inflateInit:T4,inflateInit2:B4,inflate:b4,inflateEnd:R4,inflateGetHeader:D4,inflateSetDictionary:L4,inflateInfo:N4};function U4(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var P4=U4;const By=Object.prototype.toString,{Z_NO_FLUSH:k4,Z_FINISH:Q4,Z_OK:qc,Z_STREAM_END:iA,Z_NEED_DICT:sA,Z_STREAM_ERROR:F4,Z_DATA_ERROR:by,Z_MEM_ERROR:O4}=Ka;function Xc(r){this.options=Ph.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zv,this.strm.avail_out=0;let t=ds.inflateInit2(this.strm,e.windowBits);if(t!==qc)throw new Error(Xa[t]);if(this.header=new P4,ds.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=jc.string2buf(e.dictionary):By.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ds.inflateSetDictionary(this.strm,e.dictionary),t!==qc)))throw new Error(Xa[t])}Xc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,c;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Q4:k4,By.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=ds.inflate(t,o),s===sA&&i&&(s=ds.inflateSetDictionary(t,i),s===qc?s=ds.inflate(t,o):s===by&&(s=sA));t.avail_in>0&&s===iA&&t.state.wrap>0&&r[t.next_in]!==0;)ds.inflateReset(t),s=ds.inflate(t,o);switch(s){case F4:case by:case sA:case O4:return this.onEnd(s),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||s===iA))if(this.options.to==="string"){let h=jc.utf8border(t.output,t.next_out),u=t.next_out-h,d=jc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===qc&&c===0)){if(s===iA)return s=ds.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Xc.prototype.onData=function(r){this.chunks.push(r)},Xc.prototype.onEnd=function(r){r===qc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ph.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function aA(r,e){const t=new Xc(e);if(t.push(r),t.err)throw t.msg||Xa[t.err];return t.result}function z4(r,e){return e=e||{},e.raw=!0,aA(r,e)}var H4=Xc,G4=aA,V4=z4,j4=aA,W4=Ka,Y4={Inflate:H4,inflate:G4,inflateRaw:V4,ungzip:j4,constants:W4};const{Deflate:q4,deflate:X4,deflateRaw:K4,gzip:J4}=r4,{Inflate:Z4,inflate:$4,inflateRaw:eB,ungzip:tB}=Y4;var rB=q4,nB=X4,iB=K4,sB=J4,aB=Z4,oB=$4,lB=eB,cB=tB,uB=Ka,hB={Deflate:rB,deflate:nB,deflateRaw:iB,gzip:sB,Inflate:aB,inflate:oB,inflateRaw:lB,ungzip:cB,constants:uB},dB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(bp.MD5(t))};async function fB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function pB(r){return hB.ungzip(r,{to:"string"})}var AB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function gB(r,e){let t=dB(e),n=bp.AES.decrypt(r,t).toString(bp.enc.Latin1);return AB(n)}async function mB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await fB(r),s=Date.now()-n;n=Date.now();let o=pB(i),c=Date.now()-n;n=Date.now();let h=await gB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:c,fileDecryptionTime:u}}}var _B=mB;/**
|
|
32
|
+
*/return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,u=c>>8&255,d=c&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,c=0,c+=h<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function s(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var o=n.Encryptor=n.extend({processBlock:function(c,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var v=0;v<d;v++)c[h+v]^=g[v]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(N_)),N_.exports}var P_={exports:{}},k_;function rM(){return k_||(k_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var c=this._cipher,h=c.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),c.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(P_)),P_.exports}var Q_={exports:{}},F_;function nM(){return F_||(F_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(Q_)),Q_.exports}var O_={exports:{}},z_;function iM(){return z_||(z_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,c=o-s%o,h=s+c-1;n.clamp(),n.words[h>>>2]|=c<<24-h%4*8,n.sigBytes+=c},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(O_)),O_.exports}var H_={exports:{}},G_;function sM(){return G_||(G_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(H_)),H_.exports}var V_={exports:{}},j_;function aM(){return j_||(j_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(V_)),V_.exports}var W_={exports:{}},Y_;function oM(){return Y_||(Y_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(W_)),W_.exports}var q_={exports:{}},X_;function lM(){return X_||(X_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(q_)),q_.exports}var K_={exports:{}},J_;function cM(){return J_||(J_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Ur())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,c=i.enc,h=c.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(K_)),K_.exports}var Z_={exports:{}},$_;function uM(){return $_||($_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,c=[],h=[],u=[],d=[],A=[],p=[],g=[],v=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,M=0,I=0;I<256;I++){var T=M^M<<1^M<<2^M<<3^M<<4;T=T>>>8^T&255^99,c[R]=T,h[T]=R;var D=x[R],b=x[D],S=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=S*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,v[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[S^D]]],M^=x[x[M]]):R=M=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,M=I.sigBytes/4,T=this._nRounds=M+6,D=(T+1)*4,b=this._keySchedule=[],S=0;S<D;S++)S<M?b[S]=R[S]:(x=b[S-1],S%M?M>6&&S%M==4&&(x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255]):(x=x<<8|x>>>24,x=c[x>>>24]<<24|c[x>>>16&255]<<16|c[x>>>8&255]<<8|c[x&255],x^=_[S/M|0]<<24),b[S]=b[S-M]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var S=D-P;if(P%4)var x=b[S];else var x=b[S-4];P<4||S<=4?L[P]=x:L[P]=g[c[x>>>24]]^v[c[x>>>16&255]]^E[c[x>>>8&255]]^m[c[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,c)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,v,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,M,T,D,b,S){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],W=x[I+2]^R[2],X=x[I+3]^R[3],K=4,te=1;te<L;te++){var H=M[P>>>24]^T[N>>>16&255]^D[W>>>8&255]^b[X&255]^R[K++],ee=M[N>>>24]^T[W>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=M[W>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=M[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[W&255]^R[K++];P=H,N=ee,W=Q,X=z}var H=(S[P>>>24]<<24|S[N>>>16&255]<<16|S[W>>>8&255]<<8|S[X&255])^R[K++],ee=(S[N>>>24]<<24|S[W>>>16&255]<<16|S[X>>>8&255]<<8|S[P&255])^R[K++],Q=(S[W>>>24]<<24|S[X>>>16&255]<<16|S[P>>>8&255]<<8|S[N&255])^R[K++],z=(S[X>>>24]<<24|S[P>>>16&255]<<16|S[N>>>8&255]<<8|S[W&255])^R[K++];x[I]=H,x[I+1]=ee,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(Z_)),Z_.exports}var ev={exports:{}},tv;function hM(){return tv||(tv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,c=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=o.extend({_doReset:function(){for(var _=this._key,w=_.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var M=this._subKeys=[],T=0;T<16;T++){for(var D=M[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var S=this._invSubKeys=[],I=0;I<16;I++)S[I]=M[15-I]},encryptBlock:function(_,w){this._doCryptBlock(_,w,this._subKeys)},decryptBlock:function(_,w){this._doCryptBlock(_,w,this._invSubKeys)},_doCryptBlock:function(_,w,x){this._lBlock=_[w],this._rBlock=_[w+1],v.call(this,4,252645135),v.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),v.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],M=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=M^D}var S=this._lBlock;this._lBlock=this._rBlock,this._rBlock=S,v.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),_[w]=this._lBlock,_[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(_,w){var x=(this._lBlock>>>_^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<_}function E(_,w){var x=(this._rBlock>>>_^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<_}n.DES=o._createHelper(g);var m=c.TripleDES=o.extend({_doReset:function(){var _=this._key,w=_.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(_,w){this._des1.encryptBlock(_,w),this._des2.decryptBlock(_,w),this._des3.encryptBlock(_,w)},decryptBlock:function(_,w){this._des3.decryptBlock(_,w),this._des2.encryptBlock(_,w),this._des1.decryptBlock(_,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}(ev)),ev.exports}var rv={exports:{}},nv;function dM(){return nv||(nv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],v=0;v<256;v++)g[v]=v;for(var v=0,E=0;v<256;v++){var m=v%p,_=A[m>>>2]>>>24-m%4*8&255;E=(E+g[v]+_)%256;var w=g[v];g[v]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,v=0;v<4;v++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-v*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(c);var u=o.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(rv)),rv.exports}var iv={exports:{}},sv;function fM(){return sv||(sv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,v=0;v<4;v++)p[v]=(p[v]<<8|p[v]>>>24)&16711935|(p[v]<<24|p[v]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var v=0;v<4;v++)A.call(this);for(var v=0;v<8;v++)m[v]^=E[v+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,M=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=M,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=M,m[6]^=R,m[7]^=T;for(var v=0;v<4;v++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(iv)),iv.exports}var av={exports:{}},ov;function pM(){return ov||(ov=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,c=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,v=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=v[m+4&7];if(g){var _=g.words,w=_[0],x=_[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,M=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=M,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=M,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var v=this._X;A.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var E=0;E<4;E++)c[E]=(c[E]<<8|c[E]>>>24)&16711935|(c[E]<<24|c[E]>>>8)&4278255360,p[g+E]^=c[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,v=0;v<8;v++)h[v]=g[v];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var v=0;v<8;v++){var E=p[v]+g[v],m=E&65535,_=E>>>16,w=((m*m>>>17)+m*_>>>15)+_*_,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[v]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(av)),av.exports}var lv={exports:{}},cv;function AM(){return cv||(cv=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Wa(),Ya(),Ws(),Ur())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,_){let w=_>>24&255,x=_>>16&255,I=_>>8&255,R=_&255,M=m.sbox[0][w]+m.sbox[1][x];return M=M^m.sbox[2][I],M=M+m.sbox[3][R],M}function p(m,_,w){let x=_,I=w,R;for(let M=0;M<c;++M)x=x^m.pbox[M],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[c],x=x^m.pbox[c+1],{left:x,right:I}}function g(m,_,w){let x=_,I=w,R;for(let M=c+1;M>1;--M)x=x^m.pbox[M],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function v(m,_,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<c+2;T++)m.pbox[T]=h[T]^_[x],x++,x>=w&&(x=0);let I=0,R=0,M=0;for(let T=0;T<c+2;T+=2)M=p(m,I,R),I=M.left,R=M.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)M=p(m,I,R),I=M.left,R=M.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,_=m.words,w=m.sigBytes/4;v(d,_,w)}},encryptBlock:function(m,_){var w=p(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},decryptBlock:function(m,_){var w=g(d,m[_],m[_+1]);m[_]=w.left,m[_+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(lv)),lv.exports}(function(r,e){(function(t,n,i){r.exports=n(wt(),Dh(),jS(),WS(),Wa(),YS(),Ya(),l_(),Tp(),qS(),A_(),XS(),KS(),JS(),Bp(),ZS(),Ws(),Ur(),$S(),eM(),tM(),rM(),nM(),iM(),sM(),aM(),oM(),lM(),cM(),uM(),hM(),dM(),fM(),pM(),AM())})(yt,function(t){return t})})(j1);var gM=j1.exports;const bp=RS(gM);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mM=4,uv=0,hv=1,_M=2;function Wo(r){let e=r.length;for(;--e>=0;)r[e]=0}const vM=0,dv=1,yM=2,EM=3,xM=258,Rp=29,Dc=256,Lc=Dc+1+Rp,Yo=30,Dp=19,fv=2*Lc+1,qa=15,Lp=16,wM=7,Np=256,pv=16,Av=17,gv=18,Up=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Lh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),IM=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),CM=512,us=new Array((Lc+2)*2);Wo(us);const Nc=new Array(Yo*2);Wo(Nc);const Uc=new Array(CM);Wo(Uc);const Pc=new Array(xM-EM+1);Wo(Pc);const Pp=new Array(Rp);Wo(Pp);const Nh=new Array(Yo);Wo(Nh);function kp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let _v,vv,yv;function Qp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const Ev=r=>r<256?Uc[r]:Uc[256+(r>>>7)],kc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},vn=(r,e,t)=>{r.bi_valid>Lp-t?(r.bi_buf|=e<<r.bi_valid&65535,kc(r,r.bi_buf),r.bi_buf=e>>Lp-r.bi_valid,r.bi_valid+=t-Lp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},Hi=(r,e,t)=>{vn(r,t[e*2],t[e*2+1])},xv=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},SM=r=>{r.bi_valid===16?(kc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},MM=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,v,E=0;for(p=0;p<=qa;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<fv;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=c&&(g=o[d-c]),v=t[d*2],r.opt_len+=v*(p+g),s&&(r.static_len+=v*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},wv=(r,e,t)=>{const n=new Array(qa+1);let i=0,s,o;for(s=1;s<=qa;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let c=r[o*2+1];c!==0&&(r[o*2]=xv(n[c]++,c))}},TM=()=>{let r,e,t,n,i;const s=new Array(qa+1);for(t=0,n=0;n<Rp-1;n++)for(Pp[n]=t,r=0;r<1<<Up[n];r++)Pc[t++]=n;for(Pc[t-1]=n,i=0,n=0;n<16;n++)for(Nh[n]=i,r=0;r<1<<Lh[n];r++)Uc[i++]=n;for(i>>=7;n<Yo;n++)for(Nh[n]=i<<7,r=0;r<1<<Lh[n]-7;r++)Uc[256+i++]=n;for(e=0;e<=qa;e++)s[e]=0;for(r=0;r<=143;)us[r*2+1]=8,r++,s[8]++;for(;r<=255;)us[r*2+1]=9,r++,s[9]++;for(;r<=279;)us[r*2+1]=7,r++,s[7]++;for(;r<=287;)us[r*2+1]=8,r++,s[8]++;for(wv(us,Lc+1,s),r=0;r<Yo;r++)Nc[r*2+1]=5,Nc[r*2]=xv(r,5);_v=new kp(us,Up,Dc+1,Lc,qa),vv=new kp(Nc,Lh,0,Yo,qa),yv=new kp(new Array(0),IM,0,Dp,wM)},Iv=r=>{let e;for(e=0;e<Lc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<Yo;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Dp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Np*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Cv=r=>{r.bi_valid>8?kc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Sv=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Fp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&Sv(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!Sv(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},Mv=(r,e,t)=>{let n,i,s=0,o,c;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?Hi(r,i,e):(o=Pc[i],Hi(r,o+Dc+1,e),c=Up[o],c!==0&&(i-=Pp[o],vn(r,i,c)),n--,o=Ev(n),Hi(r,o,t),c=Lh[o],c!==0&&(n-=Nh[o],vn(r,n,c)));while(s<r.sym_next);Hi(r,Np,e)},Op=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,c,h=-1,u;for(r.heap_len=0,r.heap_max=fv,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Fp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Fp(r,t,1),c=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=c,t[u*2]=t[o*2]+t[c*2],r.depth[u]=(r.depth[o]>=r.depth[c]?r.depth[o]:r.depth[c])+1,t[o*2+1]=t[c*2+1]=u,r.heap[1]=u++,Fp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],MM(r,e),wv(t,h,r.bl_count)},Tv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)&&(c<u?r.bl_tree[s*2]+=c:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[pv*2]++):c<=10?r.bl_tree[Av*2]++:r.bl_tree[gv*2]++,c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Bv=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],c=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++c<h&&s===o)){if(c<u)do Hi(r,s,r.bl_tree);while(--c!==0);else s!==0?(s!==i&&(Hi(r,s,r.bl_tree),c--),Hi(r,pv,r.bl_tree),vn(r,c-3,2)):c<=10?(Hi(r,Av,r.bl_tree),vn(r,c-3,3)):(Hi(r,gv,r.bl_tree),vn(r,c-11,7));c=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},BM=r=>{let e;for(Tv(r,r.dyn_ltree,r.l_desc.max_code),Tv(r,r.dyn_dtree,r.d_desc.max_code),Op(r,r.bl_desc),e=Dp-1;e>=3&&r.bl_tree[mv[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},bM=(r,e,t,n)=>{let i;for(vn(r,e-257,5),vn(r,t-1,5),vn(r,n-4,4),i=0;i<n;i++)vn(r,r.bl_tree[mv[i]*2+1],3);Bv(r,r.dyn_ltree,e-1),Bv(r,r.dyn_dtree,t-1)},RM=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return uv;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return hv;for(t=32;t<Dc;t++)if(r.dyn_ltree[t*2]!==0)return hv;return uv};let bv=!1;const DM=r=>{bv||(TM(),bv=!0),r.l_desc=new Qp(r.dyn_ltree,_v),r.d_desc=new Qp(r.dyn_dtree,vv),r.bl_desc=new Qp(r.bl_tree,yv),r.bi_buf=0,r.bi_valid=0,Iv(r)},Rv=(r,e,t,n)=>{vn(r,(vM<<1)+(n?1:0),3),Cv(r),kc(r,t),kc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},LM=r=>{vn(r,dv<<1,3),Hi(r,Np,us),SM(r)},NM=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===_M&&(r.strm.data_type=RM(r)),Op(r,r.l_desc),Op(r,r.d_desc),o=BM(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?Rv(r,e,t,n):r.strategy===mM||s===i?(vn(r,(dv<<1)+(n?1:0),3),Mv(r,us,Nc)):(vn(r,(yM<<1)+(n?1:0),3),bM(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),Mv(r,r.dyn_ltree,r.dyn_dtree)),Iv(r),n&&Cv(r)},UM=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Pc[t]+Dc+1)*2]++,r.dyn_dtree[Ev(e)*2]++),r.sym_next===r.sym_end);var PM=DM,kM=Rv,QM=NM,FM=UM,OM=LM,zM={_tr_init:PM,_tr_stored_block:kM,_tr_flush_block:QM,_tr_tally:FM,_tr_align:OM},Qc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const HM=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},GM=new Uint32Array(HM());var Pr=(r,e,t,n)=>{const i=GM,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},Xa={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ka={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:VM,_tr_stored_block:zp,_tr_flush_block:jM,_tr_tally:Ys,_tr_align:WM}=zM,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:YM,Z_FULL_FLUSH:qM,Z_FINISH:ri,Z_BLOCK:Dv,Z_OK:Wr,Z_STREAM_END:Lv,Z_STREAM_ERROR:Gi,Z_DATA_ERROR:XM,Z_BUF_ERROR:Hp,Z_DEFAULT_COMPRESSION:KM,Z_FILTERED:JM,Z_HUFFMAN_ONLY:Uh,Z_RLE:ZM,Z_FIXED:$M,Z_DEFAULT_STRATEGY:eT,Z_UNKNOWN:tT,Z_DEFLATED:Ph}=Ka,rT=9,nT=15,iT=8,sT=29,aT=256,Gp=aT+1+sT,oT=30,lT=19,cT=2*Gp+1,uT=15,It=3,Xs=258,Vi=Xs+It+1,hT=32,qo=42,Vp=57,jp=69,Wp=73,Yp=91,qp=103,Ja=113,Fc=666,on=1,Xo=2,Za=3,Ko=4,dT=3,$a=(r,e)=>(r.msg=Xa[e],e),Nv=r=>r*2-(r>4?9:0),Ks=r=>{let e=r.length;for(;--e>=0;)r[e]=0},fT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let pT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Js=pT;const Fn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},On=(r,e)=>{jM(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Fn(r.strm)},bt=(r,e)=>{r.pending_buf[r.pending++]=e},Oc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},Xp=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=Qc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=Pr(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},Uv=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,c=r.nice_match;const h=r.strstart>r.w_size-Vi?r.strstart-(r.w_size-Vi):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+Xs;let g=u[n+o-1],v=u[n+o];r.prev_length>=r.good_match&&(t>>=2),c>r.lookahead&&(c=r.lookahead);do if(i=e,!(u[i+o]!==v||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=Xs-(p-n),n=p-Xs,s>o){if(r.match_start=e,o=s,s>=c)break;g=u[n+o-1],v=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},Jo=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Vi)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),fT(r),n+=e),r.strm.avail_in===0)break;if(t=Xp(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=It)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Js(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Js(r,r.ins_h,r.window[i+It-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<It)););}while(r.lookahead<Vi&&r.strm.avail_in!==0)},Pv=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,c=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ri||e===qs||n!==i+r.strm.avail_in)))break;o=e===ri&&n===i+r.strm.avail_in?1:0,zp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,Fn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(Xp(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return c-=r.strm.avail_in,c&&(c>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=c&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-c,r.strm.next_in),r.strstart),r.strstart+=c,r.insert+=c>r.w_size-r.insert?r.w_size-r.insert:c),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?Ko:e!==qs&&e!==ri&&r.strm.avail_in===0&&r.strstart===r.block_start?Xo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(Xp(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ri)&&e!==qs&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ri&&r.strm.avail_in===0&&n===i?1:0,zp(r,r.block_start,n,o),r.block_start+=n,Fn(r.strm)),o?Za:on)},Kp=(r,e)=>{let t,n;for(;;){if(r.lookahead<Vi){if(Jo(r),r.lookahead<Vi&&e===qs)return on;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-Vi&&(r.match_length=Uv(r,t)),r.match_length>=It)if(n=Ys(r,r.strstart-r.match_start,r.match_length-It),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=It){r.match_length--;do r.strstart++,r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Js(r,r.ins_h,r.window[r.strstart+1]);else n=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=r.strstart<It-1?r.strstart:It-1,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Ko):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:Xo},Zo=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<Vi){if(Jo(r),r.lookahead<Vi&&e===qs)return on;if(r.lookahead===0)break}if(t=0,r.lookahead>=It&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=It-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-Vi&&(r.match_length=Uv(r,t),r.match_length<=5&&(r.strategy===JM||r.match_length===It&&r.strstart-r.match_start>4096)&&(r.match_length=It-1)),r.prev_length>=It&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-It,n=Ys(r,r.strstart-1-r.prev_match,r.prev_length-It),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+It-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=It-1,r.strstart++,n&&(On(r,!1),r.strm.avail_out===0))return on}else if(r.match_available){if(n=Ys(r,0,r.window[r.strstart-1]),n&&On(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return on}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ys(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<It-1?r.strstart:It-1,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Ko):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:Xo},AT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=Xs){if(Jo(r),r.lookahead<=Xs&&e===qs)return on;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=It&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+Xs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=Xs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=It?(t=Ys(r,1,r.match_length-It),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=0,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Ko):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:Xo},gT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(Jo(r),r.lookahead===0)){if(e===qs)return on;break}if(r.match_length=0,t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(On(r,!1),r.strm.avail_out===0))return on}return r.insert=0,e===ri?(On(r,!0),r.strm.avail_out===0?Za:Ko):r.sym_next&&(On(r,!1),r.strm.avail_out===0)?on:Xo};function ji(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const zc=[new ji(0,0,0,0,Pv),new ji(4,4,8,4,Kp),new ji(4,5,16,8,Kp),new ji(4,6,32,32,Kp),new ji(4,4,16,16,Zo),new ji(8,16,32,32,Zo),new ji(8,16,128,128,Zo),new ji(8,32,128,256,Zo),new ji(32,128,258,1024,Zo),new ji(32,258,258,4096,Zo)],mT=r=>{r.window_size=2*r.w_size,Ks(r.head),r.max_lazy_match=zc[r.level].max_lazy,r.good_match=zc[r.level].good_length,r.nice_match=zc[r.level].nice_length,r.max_chain_length=zc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=It-1,r.match_available=0,r.ins_h=0};function _T(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ph,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(cT*2),this.dyn_dtree=new Uint16Array((2*oT+1)*2),this.bl_tree=new Uint16Array((2*lT+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(uT+1),this.heap=new Uint16Array(2*Gp+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Gp+1),Ks(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Hc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==qo&&e.status!==Vp&&e.status!==jp&&e.status!==Wp&&e.status!==Yp&&e.status!==qp&&e.status!==Ja&&e.status!==Fc?1:0},kv=r=>{if(Hc(r))return $a(r,Gi);r.total_in=r.total_out=0,r.data_type=tT;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Vp:e.wrap?qo:Ja,r.adler=e.wrap===2?0:1,e.last_flush=-2,VM(e),Wr},Qv=r=>{const e=kv(r);return e===Wr&&mT(r.state),e},vT=(r,e)=>Hc(r)||r.state.wrap!==2?Gi:(r.state.gzhead=e,Wr),Fv=(r,e,t,n,i,s)=>{if(!r)return Gi;let o=1;if(e===KM&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>rT||t!==Ph||n<8||n>15||e<0||e>9||s<0||s>$M||n===8&&o!==1)return $a(r,Gi);n===8&&(n=9);const c=new _T;return r.state=c,c.strm=r,c.status=qo,c.wrap=o,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=i+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+It-1)/It),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=e,c.strategy=s,c.method=t,Qv(r)},yT=(r,e)=>Fv(r,e,Ph,nT,iT,eT),ET=(r,e)=>{if(Hc(r)||e>Dv||e<0)return r?$a(r,Gi):Gi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===Fc&&e!==ri)return $a(r,r.avail_out===0?Hp:Gi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Fn(r),r.avail_out===0)return t.last_flush=-1,Wr}else if(r.avail_in===0&&Nv(e)<=Nv(n)&&e!==ri)return $a(r,Hp);if(t.status===Fc&&r.avail_in!==0)return $a(r,Hp);if(t.status===qo&&t.wrap===0&&(t.status=Ja),t.status===qo){let i=Ph+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Uh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=hT),i+=31-i%31,Oc(t,i),t.strstart!==0&&(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),r.adler=1,t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(t.status===Vp){if(r.adler=0,bt(t,31),bt(t,139),bt(t,8),t.gzhead)bt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),bt(t,t.gzhead.time&255),bt(t,t.gzhead.time>>8&255),bt(t,t.gzhead.time>>16&255),bt(t,t.gzhead.time>>24&255),bt(t,t.level===9?2:t.strategy>=Uh||t.level<2?4:0),bt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(bt(t,t.gzhead.extra.length&255),bt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=Pr(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=jp;else if(bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,0),bt(t,t.level===9?2:t.strategy>=Uh||t.level<2?4:0),bt(t,dT),t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(t.status===jp){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let c=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+c),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=c,Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0,s-=c}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Wp}if(t.status===Wp){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=Yp}if(t.status===Yp){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,Wr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,bt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=Pr(r.adler,t.pending_buf,t.pending-i,i))}t.status=qp}if(t.status===qp){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Fn(r),t.pending!==0))return t.last_flush=-1,Wr;bt(t,r.adler&255),bt(t,r.adler>>8&255),r.adler=0}if(t.status=Ja,Fn(r),t.pending!==0)return t.last_flush=-1,Wr}if(r.avail_in!==0||t.lookahead!==0||e!==qs&&t.status!==Fc){let i=t.level===0?Pv(t,e):t.strategy===Uh?gT(t,e):t.strategy===ZM?AT(t,e):zc[t.level].func(t,e);if((i===Za||i===Ko)&&(t.status=Fc),i===on||i===Za)return r.avail_out===0&&(t.last_flush=-1),Wr;if(i===Xo&&(e===YM?WM(t):e!==Dv&&(zp(t,0,0,!1),e===qM&&(Ks(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Fn(r),r.avail_out===0))return t.last_flush=-1,Wr}return e!==ri?Wr:t.wrap<=0?Lv:(t.wrap===2?(bt(t,r.adler&255),bt(t,r.adler>>8&255),bt(t,r.adler>>16&255),bt(t,r.adler>>24&255),bt(t,r.total_in&255),bt(t,r.total_in>>8&255),bt(t,r.total_in>>16&255),bt(t,r.total_in>>24&255)):(Oc(t,r.adler>>>16),Oc(t,r.adler&65535)),Fn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Wr:Lv)},xT=r=>{if(Hc(r))return Gi;const e=r.state.status;return r.state=null,e===Ja?$a(r,XM):Wr},wT=(r,e)=>{let t=e.length;if(Hc(r))return Gi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==qo||n.lookahead)return Gi;if(i===1&&(r.adler=Qc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Ks(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,c=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,Jo(n);n.lookahead>=It;){let h=n.strstart,u=n.lookahead-(It-1);do n.ins_h=Js(n,n.ins_h,n.window[h+It-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=It-1,Jo(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=It-1,n.match_available=0,r.next_in=o,r.input=c,r.avail_in=s,n.wrap=i,Wr};var IT=yT,CT=Fv,ST=Qv,MT=kv,TT=vT,BT=ET,bT=xT,RT=wT,DT="pako deflate (from Nodeca project)",Gc={deflateInit:IT,deflateInit2:CT,deflateReset:ST,deflateResetKeep:MT,deflateSetHeader:TT,deflate:BT,deflateEnd:bT,deflateSetDictionary:RT,deflateInfo:DT};const LT=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var NT=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)LT(t,n)&&(r[n]=t[n])}}return r},UT=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},kh={assign:NT,flattenChunks:UT};let Ov=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ov=!1}const Vc=new Uint8Array(256);for(let r=0;r<256;r++)Vc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Vc[254]=Vc[254]=1;var PT=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,c=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),s=0,i=0;s<c;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const kT=(r,e)=>{if(e<65534&&r.subarray&&Ov)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var QT=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let c=Vc[o];if(c>4){s[i++]=65533,n+=c-1;continue}for(o&=c===2?31:c===3?15:7;c>1&&n<t;)o=o<<6|r[n++]&63,c--;if(c>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return kT(s,i)},FT=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Vc[r[t]]>e?t:e},jc={string2buf:PT,buf2string:QT,utf8border:FT};function OT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zv=OT;const Hv=Object.prototype.toString,{Z_NO_FLUSH:zT,Z_SYNC_FLUSH:HT,Z_FULL_FLUSH:GT,Z_FINISH:VT,Z_OK:Qh,Z_STREAM_END:jT,Z_DEFAULT_COMPRESSION:WT,Z_DEFAULT_STRATEGY:YT,Z_DEFLATED:qT}=Ka;function Wc(r){this.options=kh.assign({level:WT,method:qT,chunkSize:16384,windowBits:15,memLevel:8,strategy:YT},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zv,this.strm.avail_out=0;let t=Gc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Qh)throw new Error(Xa[t]);if(e.header&&Gc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=jc.string2buf(e.dictionary):Hv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Gc.deflateSetDictionary(this.strm,n),t!==Qh)throw new Error(Xa[t]);this._dict_set=!0}}Wc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?VT:zT,typeof r=="string"?t.input=jc.string2buf(r):Hv.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===HT||s===GT)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Gc.deflate(t,s),i===jT)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Gc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Qh;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Wc.prototype.onData=function(r){this.chunks.push(r)},Wc.prototype.onEnd=function(r){r===Qh&&(this.result=kh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Jp(r,e){const t=new Wc(e);if(t.push(r,!0),t.err)throw t.msg||Xa[t.err];return t.result}function XT(r,e){return e=e||{},e.raw=!0,Jp(r,e)}function KT(r,e){return e=e||{},e.gzip=!0,Jp(r,e)}var JT=Wc,ZT=Jp,$T=XT,e4=KT,t4=Ka,r4={Deflate:JT,deflate:ZT,deflateRaw:$T,gzip:e4,constants:t4};const Fh=16209,n4=16191;var i4=function(r,e){let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m,_,w,x,I,R,M,T,D,b;const S=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),c=S.dmax,h=S.wsize,u=S.whave,d=S.wnext,A=S.window,p=S.hold,g=S.bits,v=S.lencode,E=S.distcode,m=(1<<S.lenbits)-1,_=(1<<S.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=v[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&_];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>c){r.msg="invalid distance too far back",S.mode=Fh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&S.sane){r.msg="invalid distance too far back",S.mode=Fh;break e}if(M=0,T=A,d===0){if(M+=h-x,x<I){I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}}else if(d<x){if(M+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[M++];while(--x);if(M=0,d<I){x=d,I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}}}else if(M+=d-x,x<I){I-=x;do b[i++]=A[M++];while(--x);M=i-R,T=b}for(;I>2;)b[i++]=T[M++],b[i++]=T[M++],b[i++]=T[M++],I-=3;I&&(b[i++]=T[M++],I>1&&(b[i++]=T[M++]))}else{M=i-R;do b[i++]=b[M++],b[i++]=b[M++],b[i++]=b[M++],I-=3;while(I>2);I&&(b[i++]=b[M++],I>1&&(b[i++]=b[M++]))}}else if(x&64){r.msg="invalid distance code",S.mode=Fh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){S.mode=n4;break e}else{r.msg="invalid literal/length code",S.mode=Fh;break e}else{w=v[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),S.hold=p,S.bits=g};const $o=15,Gv=852,Vv=592,jv=0,Zp=1,Wv=2,s4=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),a4=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),o4=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),l4=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Yc=(r,e,t,n,i,s,o,c)=>{const h=c.bits;let u=0,d=0,A=0,p=0,g=0,v=0,E=0,m=0,_=0,w=0,x,I,R,M,T,D=null,b;const S=new Uint16Array($o+1),L=new Uint16Array($o+1);let P=null,N,W,X;for(u=0;u<=$o;u++)S[u]=0;for(d=0;d<n;d++)S[e[t+d]]++;for(g=h,p=$o;p>=1&&S[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,c.bits=1,0;for(A=1;A<p&&S[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=$o;u++)if(m<<=1,m-=S[u],m<0)return-1;if(m>0&&(r===jv||p!==1))return-1;for(L[1]=0,u=1;u<$o;u++)L[u+1]=L[u]+S[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===jv?(D=P=o,b=20):r===Zp?(D=s4,P=a4,b=257):(D=o4,P=l4,b=0),w=0,d=0,u=A,T=s,v=g,E=0,R=-1,_=1<<g,M=_-1,r===Zp&&_>Gv||r===Wv&&_>Vv)return 1;for(;;){N=u-E,o[d]+1<b?(W=0,X=o[d]):o[d]>=b?(W=P[o[d]-b],X=D[o[d]-b]):(W=32+64,X=0),x=1<<u-E,I=1<<v,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|W<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--S[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&M)!==R){for(E===0&&(E=g),T+=A,v=u-E,m=1<<v;v+E<p&&(m-=S[v+E],!(m<=0));)v++,m<<=1;if(_+=1<<v,r===Zp&&_>Gv||r===Wv&&_>Vv)return 1;R=w&M,i[R]=g<<24|v<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),c.bits=g,0};const c4=0,Yv=1,qv=2,{Z_FINISH:Xv,Z_BLOCK:u4,Z_TREES:Oh,Z_OK:eo,Z_STREAM_END:h4,Z_NEED_DICT:d4,Z_STREAM_ERROR:vi,Z_DATA_ERROR:Kv,Z_MEM_ERROR:Jv,Z_BUF_ERROR:f4,Z_DEFLATED:Zv}=Ka,zh=16180,$v=16181,ey=16182,ty=16183,ry=16184,ny=16185,iy=16186,sy=16187,ay=16188,oy=16189,Hh=16190,hs=16191,$p=16192,ly=16193,eA=16194,cy=16195,uy=16196,hy=16197,dy=16198,Gh=16199,Vh=16200,fy=16201,py=16202,Ay=16203,gy=16204,my=16205,tA=16206,_y=16207,vy=16208,Jt=16209,yy=16210,Ey=16211,p4=852,A4=592,g4=15,m4=g4,xy=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function _4(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const to=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<zh||e.mode>Ey?1:0},wy=r=>{if(to(r))return vi;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=zh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(p4),e.distcode=e.distdyn=new Int32Array(A4),e.sane=1,e.back=-1,eo},Iy=r=>{if(to(r))return vi;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,wy(r)},Cy=(r,e)=>{let t;if(to(r))return vi;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?vi:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Iy(r))},Sy=(r,e)=>{if(!r)return vi;const t=new _4;r.state=t,t.strm=r,t.window=null,t.mode=zh;const n=Cy(r,e);return n!==eo&&(r.state=null),n},v4=r=>Sy(r,m4);let My=!0,rA,nA;const y4=r=>{if(My){rA=new Int32Array(512),nA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Yc(Yv,r.lens,0,288,rA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Yc(qv,r.lens,0,32,nA,0,r.work,{bits:5}),My=!1}r.lencode=rA,r.lenbits=9,r.distcode=nA,r.distbits=5},Ty=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},E4=(r,e)=>{let t,n,i,s,o,c,h,u,d,A,p,g,v,E,m=0,_,w,x,I,R,M,T,D;const b=new Uint8Array(4);let S,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(to(r)||!r.output||!r.input&&r.avail_in!==0)return vi;t=r.state,t.mode===hs&&(t.mode=$p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,A=c,p=h,D=eo;e:for(;;)switch(t.mode){case zh:if(t.wrap===0){t.mode=$p;break}for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0),u=0,d=0,t.mode=$v;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==Zv){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?oy:hs,u=0,d=0;break;case $v:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==Zv){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0,t.mode=ey;case ey:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=Pr(t.check,b,4,0)),u=0,d=0,t.mode=ty;case ty:for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0,t.mode=ry;case ry:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=Pr(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=ny;case ny:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=iy;case iy:if(t.flags&2048){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=sy;case sy:if(t.flags&4096){if(c===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Pr(t.check,n,g,s)),c-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=ay;case ay:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=hs;break;case oy:for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}r.adler=t.check=xy(u),u=0,d=0,t.mode=Hh;case Hh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,d4;r.adler=t.check=1,t.mode=hs;case hs:if(e===u4||e===Oh)break e;case $p:if(t.last){u>>>=d&7,d-=d&7,t.mode=tA;break}for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=ly;break;case 1:if(y4(t),t.mode=Gh,e===Oh){u>>>=2,d-=2;break e}break;case 2:t.mode=uy;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case ly:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=eA,e===Oh)break e;case eA:t.mode=cy;case cy:if(g=t.length,g){if(g>c&&(g=c),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),c-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=hs;break;case uy:for(;d<14;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=hy;case hy:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,S={bits:t.lenbits},D=Yc(c4,t.lens,0,19,t.lencode,0,t.work,S),t.lenbits=S.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=dy;case dy:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=_,d-=_,t.lens[t.have++]=x;else{if(x===16){for(L=_+2;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(u>>>=_,d-=_,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=_+3;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=_+7;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=_,d-=_,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,S={bits:t.lenbits},D=Yc(Yv,t.lens,0,t.nlen,t.lencode,0,t.work,S),t.lenbits=S.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,S={bits:t.distbits},D=Yc(qv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,S),t.distbits=S.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=Gh,e===Oh)break e;case Gh:t.mode=Vh;case Vh:if(c>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,i4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,c=r.avail_in,u=t.hold,d=t.bits,t.mode===hs&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=_,R=w,M=x;m=t.lencode[M+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,t.length=x,w===0){t.mode=my;break}if(w&32){t.back=-1,t.mode=hs;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=fy;case fy:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=py;case py:for(;m=t.distcode[u&(1<<t.distbits)-1],_=m>>>24,w=m>>>16&255,x=m&65535,!(_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=_,R=w,M=x;m=t.distcode[M+((u&(1<<I+R)-1)>>I)],_=m>>>24,w=m>>>16&255,x=m&65535,!(I+_<=d);){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=_,d-=_,t.back+=_,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=Ay;case Ay:if(t.extra){for(L=t.extra;d<L;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=gy;case gy:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,v=t.wsize-g):v=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,v=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[v++];while(--g);t.length===0&&(t.mode=Vh);break;case my:if(h===0)break e;i[o++]=t.length,h--,t.mode=Vh;break;case tA:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Pr(t.check,i,p,o-p):Qc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:xy(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=_y;case _y:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=vy;case vy:D=h4;break e;case Jt:D=Kv;break e;case yy:return Jv;case Ey:default:return vi}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=c,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<tA||e!==Xv))&&Ty(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?Pr(t.check,i,p,r.next_out-p):Qc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===hs?128:0)+(t.mode===Gh||t.mode===eA?256:0),(A===0&&p===0||e===Xv)&&D===eo&&(D=f4),D},x4=r=>{if(to(r))return vi;let e=r.state;return e.window&&(e.window=null),r.state=null,eo},w4=(r,e)=>{if(to(r))return vi;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,eo):vi},I4=(r,e)=>{const t=e.length;let n,i,s;return to(r)||(n=r.state,n.wrap!==0&&n.mode!==Hh)?vi:n.mode===Hh&&(i=1,i=Qc(i,e,t,0),i!==n.check)?Kv:(s=Ty(r,e,t,t),s?(n.mode=yy,Jv):(n.havedict=1,eo))};var C4=Iy,S4=Cy,M4=wy,T4=v4,B4=Sy,b4=E4,R4=x4,D4=w4,L4=I4,N4="pako inflate (from Nodeca project)",ds={inflateReset:C4,inflateReset2:S4,inflateResetKeep:M4,inflateInit:T4,inflateInit2:B4,inflate:b4,inflateEnd:R4,inflateGetHeader:D4,inflateSetDictionary:L4,inflateInfo:N4};function U4(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var P4=U4;const By=Object.prototype.toString,{Z_NO_FLUSH:k4,Z_FINISH:Q4,Z_OK:qc,Z_STREAM_END:iA,Z_NEED_DICT:sA,Z_STREAM_ERROR:F4,Z_DATA_ERROR:by,Z_MEM_ERROR:O4}=Ka;function Xc(r){this.options=kh.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zv,this.strm.avail_out=0;let t=ds.inflateInit2(this.strm,e.windowBits);if(t!==qc)throw new Error(Xa[t]);if(this.header=new P4,ds.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=jc.string2buf(e.dictionary):By.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ds.inflateSetDictionary(this.strm,e.dictionary),t!==qc)))throw new Error(Xa[t])}Xc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,c;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Q4:k4,By.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=ds.inflate(t,o),s===sA&&i&&(s=ds.inflateSetDictionary(t,i),s===qc?s=ds.inflate(t,o):s===by&&(s=sA));t.avail_in>0&&s===iA&&t.state.wrap>0&&r[t.next_in]!==0;)ds.inflateReset(t),s=ds.inflate(t,o);switch(s){case F4:case by:case sA:case O4:return this.onEnd(s),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||s===iA))if(this.options.to==="string"){let h=jc.utf8border(t.output,t.next_out),u=t.next_out-h,d=jc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===qc&&c===0)){if(s===iA)return s=ds.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Xc.prototype.onData=function(r){this.chunks.push(r)},Xc.prototype.onEnd=function(r){r===qc&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=kh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function aA(r,e){const t=new Xc(e);if(t.push(r),t.err)throw t.msg||Xa[t.err];return t.result}function z4(r,e){return e=e||{},e.raw=!0,aA(r,e)}var H4=Xc,G4=aA,V4=z4,j4=aA,W4=Ka,Y4={Inflate:H4,inflate:G4,inflateRaw:V4,ungzip:j4,constants:W4};const{Deflate:q4,deflate:X4,deflateRaw:K4,gzip:J4}=r4,{Inflate:Z4,inflate:$4,inflateRaw:eB,ungzip:tB}=Y4;var rB=q4,nB=X4,iB=K4,sB=J4,aB=Z4,oB=$4,lB=eB,cB=tB,uB=Ka,hB={Deflate:rB,deflate:nB,deflateRaw:iB,gzip:sB,Inflate:aB,inflate:oB,inflateRaw:lB,ungzip:cB,constants:uB},dB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(bp.MD5(t))};async function fB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function pB(r){return hB.ungzip(r,{to:"string"})}var AB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function gB(r,e){let t=dB(e),n=bp.AES.decrypt(r,t).toString(bp.enc.Latin1);return AB(n)}async function mB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await fB(r),s=Date.now()-n;n=Date.now();let o=pB(i),c=Date.now()-n;n=Date.now();let h=await gB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:c,fileDecryptionTime:u}}}var _B=mB;/**
|
|
33
33
|
* @license
|
|
34
34
|
* Copyright 2010-2023 Three.js Authors
|
|
35
35
|
* SPDX-License-Identifier: MIT
|
|
36
|
-
*/const Vh="163",$o={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},el={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},vB=0,Ry=1,yB=2,Dy=1,EB=2,fs=3,yi=0,kr=1,Ei=2,ps=0,tl=1,Ly=2,Ny=3,Uy=4,xB=5,ro=100,wB=101,IB=102,CB=103,SB=104,MB=200,TB=201,BB=202,bB=203,oA=204,lA=205,RB=206,DB=207,LB=208,NB=209,UB=210,PB=211,kB=212,QB=213,FB=214,OB=0,zB=1,HB=2,jh=3,GB=4,VB=5,jB=6,WB=7,Py=0,YB=1,qB=2,Zs=0,ky=1,Qy=2,Fy=3,cA=4,XB=5,Oy=6,zy=7,Hy="attached",KB="detached",Gy=300,no=301,rl=302,Kc=303,uA=304,Wh=306,$s=1e3,xi=1001,Yh=1002,fr=1003,Vy=1004,Jc=1005,pr=1006,qh=1007,wi=1008,JB=1008,Ar=1009,hA=1010,jy=1011,dA=1012,Zc=1013,Ii=1014,lr=1015,yn=1016,Wy=1017,Yy=1018,$c=1020,ZB=35902,$B=1021,eb=1022,gr=1023,tb=1024,rb=1025,nl=1026,eu=1027,ea=1028,fA=1029,io=1030,Xh=1031,tu=1033,Kh=33776,pA=33777,AA=33778,Jh=33779,gA=35840,qy=35841,mA=35842,Xy=35843,_A=36196,vA=37492,yA=37496,EA=37808,Ky=37809,Jy=37810,Zy=37811,Zh=37812,$y=37813,eE=37814,tE=37815,rE=37816,nE=37817,iE=37818,sE=37819,aE=37820,oE=37821,$h=36492,lE=36494,cE=36495,nb=36283,uE=36284,hE=36285,dE=36286,ru=2300,il=2301,xA=2302,fE=2400,pE=2401,AE=2402,ib=2500,sb=0,gE=1,wA=2,ab=3200,ob=3201,mE=0,lb=1,As="",Qr="srgb",Sr="srgb-linear",ed="display-p3",nu="display-p3-linear",td="linear",Ht="srgb",rd="rec709",nd="p3",sl=7680,_E=519,cb=512,ub=513,hb=514,vE=515,db=516,fb=517,pb=518,Ab=519,IA=35044,yE="300 es",gs=2e3,id=2001;class so{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Kr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let EE=1234567;const iu=Math.PI/180,al=180/Math.PI;function Ci(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Kr[r&255]+Kr[r>>8&255]+Kr[r>>16&255]+Kr[r>>24&255]+"-"+Kr[e&255]+Kr[e>>8&255]+"-"+Kr[e>>16&15|64]+Kr[e>>24&255]+"-"+Kr[t&63|128]+Kr[t>>8&255]+"-"+Kr[t>>16&255]+Kr[t>>24&255]+Kr[n&255]+Kr[n>>8&255]+Kr[n>>16&255]+Kr[n>>24&255]).toLowerCase()}function Mr(r,e,t){return Math.max(e,Math.min(t,r))}function CA(r,e){return(r%e+e)%e}function gb(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function mb(r,e,t){return r!==e?(t-r)/(e-r):0}function su(r,e,t){return(1-t)*r+t*e}function _b(r,e,t,n){return su(r,e,1-Math.exp(-t*n))}function vb(r,e=1){return e-Math.abs(CA(r,e*2)-e)}function yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Eb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function xb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function wb(r,e){return r+Math.random()*(e-r)}function Ib(r){return r*(.5-Math.random())}function Cb(r){r!==void 0&&(EE=r);let e=EE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Sb(r){return r*iu}function Mb(r){return r*al}function Tb(r){return(r&r-1)===0&&r!==0}function Bb(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function bb(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function Rb(r,e,t,n,i){const s=Math.cos,o=Math.sin,c=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),v=o((n-e)/2);switch(i){case"XYX":r.set(c*d,h*A,h*p,c*u);break;case"YZY":r.set(h*p,c*d,h*A,c*u);break;case"ZXZ":r.set(h*A,h*p,c*d,c*u);break;case"XZX":r.set(c*d,h*v,h*g,c*u);break;case"YXY":r.set(h*g,c*d,h*v,c*u);break;case"ZYZ":r.set(h*v,h*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Si(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Nt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const SA={DEG2RAD:iu,RAD2DEG:al,generateUUID:Ci,clamp:Mr,euclideanModulo:CA,mapLinear:gb,inverseLerp:mb,lerp:su,damp:_b,pingpong:vb,smoothstep:yb,smootherstep:Eb,randInt:xb,randFloat:wb,randFloatSpread:Ib,seededRandom:Cb,degToRad:Sb,radToDeg:Mb,isPowerOfTwo:Tb,ceilPowerOfTwo:Bb,floorPowerOfTwo:bb,setQuaternionFromProperEuler:Rb,normalize:Nt,denormalize:Si};class Ge{constructor(e=0,t=0){Ge.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(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(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),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gt{constructor(e,t,n,i,s,o,c,h,u){gt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u)}set(e,t,n,i,s,o,c,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,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,s=this.elements,o=n[0],c=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],v=n[8],E=i[0],m=i[3],_=i[6],w=i[1],x=i[4],I=i[7],R=i[2],M=i[5],T=i[8];return s[0]=o*E+c*w+h*R,s[3]=o*m+c*x+h*M,s[6]=o*_+c*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*M,s[7]=u*_+d*I+A*T,s[2]=p*E+g*w+v*R,s[5]=p*m+g*x+v*M,s[8]=p*_+g*I+v*T,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],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*c*u-n*s*d+n*c*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=d*o-c*u,p=c*h-d*s,g=u*s-o*h,v=t*A+n*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/v;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(c*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-c*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,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,s,o,c){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*c)+o+e,-i*u,i*h,-i*(-u*o+h*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(MA.makeScale(e,t)),this}rotate(e){return this.premultiply(MA.makeRotation(-e)),this}translate(e,t){return this.premultiply(MA.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 i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){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 MA=new gt;function xE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function au(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Db(){const r=au("canvas");return r.style.display="block",r}const wE={};function IE(r){r in wE||(wE[r]=!0,console.warn(r))}const CE=new gt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),SE=new gt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),sd={[Sr]:{transfer:td,primaries:rd,toReference:r=>r,fromReference:r=>r},[Qr]:{transfer:Ht,primaries:rd,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[nu]:{transfer:td,primaries:nd,toReference:r=>r.applyMatrix3(SE),fromReference:r=>r.applyMatrix3(CE)},[ed]:{transfer:Ht,primaries:nd,toReference:r=>r.convertSRGBToLinear().applyMatrix3(SE),fromReference:r=>r.applyMatrix3(CE).convertLinearToSRGB()}},Lb=new Set([Sr,nu]),Rt={enabled:!0,_workingColorSpace:Sr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Lb.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=sd[e].toReference,i=sd[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return sd[r].primaries},getTransfer:function(r){return r===As?td:sd[r].transfer}};function ol(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function TA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let ll;class Nb{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ll===void 0&&(ll=au("canvas")),ll.width=e.width,ll.height=e.height;const n=ll.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ll}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=au("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),s=i.data;for(let o=0;o<s.length;o++)s[o]=ol(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(ol(t[n]/255)*255):t[n]=ol(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Ub=0;class ME{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ub++}),this.uuid=Ci(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,c=i.length;o<c;o++)i[o].isDataTexture?s.push(BA(i[o].image)):s.push(BA(i[o]))}else s=BA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function BA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Nb.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Pb=0;class Tr extends so{constructor(e=Tr.DEFAULT_IMAGE,t=Tr.DEFAULT_MAPPING,n=xi,i=xi,s=pr,o=wi,c=gr,h=Ar,u=Tr.DEFAULT_ANISOTROPY,d=As){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Pb++}),this.uuid=Ci(),this.name="",this.source=new ME(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=h,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,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=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Gy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $s:e.x=e.x-Math.floor(e.x);break;case xi:e.x=e.x<0?0:1;break;case Yh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case $s:e.y=e.y-Math.floor(e.y);break;case xi:e.y=e.y<0?0:1;break;case Yh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Tr.DEFAULT_IMAGE=null,Tr.DEFAULT_MAPPING=Gy,Tr.DEFAULT_ANISOTROPY=1;class Ot{constructor(e=0,t=0,n=0,i=1){Ot.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);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,s;const o=e.elements,c=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],v=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+v)<.1&&Math.abs(c+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(c+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,M=(p+v)/4;return _>w&&_>x?_<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(_),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=M/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=M/s),this.set(n,i,s,t),this}let m=Math.sqrt((v-p)*(v-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(v-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((c+A+E-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 kb extends so{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ot(0,0,e,t),this.scissorTest=!1,this.viewport=new Ot(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new Tr(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,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,s=this.textures.length;i<s;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 n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ME(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Mi extends kb{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class TE extends Tr{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=fr,this.minFilter=fr,this.wrapR=xi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class BE extends Tr{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=fr,this.minFilter=fr,this.wrapR=xi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Wi{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,c){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],v=s[o+2],E=s[o+3];if(c===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(c===1){e[t+0]=p,e[t+1]=g,e[t+2]=v,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==v){let m=1-c;const _=h*p+u*g+d*v+A*E,w=_>=0?1:-1,x=1-_*_;if(x>Number.EPSILON){const R=Math.sqrt(x),M=Math.atan2(R,_*w);m=Math.sin(m*M)/R,c=Math.sin(c*M)/R}const I=c*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+v*I,A=A*m+E*I,m===1-c){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const c=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=c*v+d*A+h*g-u*p,e[t+1]=h*v+d*p+u*A-c*g,e[t+2]=u*v+d*g+c*p-h*A,e[t+3]=d*v-c*A-h*p-u*g,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,s=e._z,o=e._order,c=Math.cos,h=Math.sin,u=c(n/2),d=c(i/2),A=c(s/2),p=h(n/2),g=h(i/2),v=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"YXZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"ZXY":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"ZYX":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"YZX":this._x=p*d*A+u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A-p*g*v;break;case"XZY":this._x=p*d*A-u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&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],s=t[8],o=t[1],c=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+c+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>c&&n>A){const g=2*Math.sqrt(1+n-c-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(c>A){const g=2*Math.sqrt(1+c-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-c);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}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(Mr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,c=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*c+i*u-s*h,this._y=i*d+o*h+s*c-n*u,this._z=s*d+o*u+n*h-i*c,this._w=o*d-n*c-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let c=o*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-c*c;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,c),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,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),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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 j{constructor(e=0,t=0,n=0){j.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(bE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(bE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,c=e.z,h=e.w,u=2*(o*i-c*n),d=2*(c*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-c*d,this.y=n+h*d+c*u-s*A,this.z=i+h*A+s*d-o*u,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,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){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,s=e.z,o=t.x,c=t.y,h=t.z;return this.x=i*h-s*c,this.y=s*o-n*h,this.z=n*c-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return bA.copy(this).projectOnVector(e),this.sub(bA)}reflect(e){return this.sub(bA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(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,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}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=Math.random()*2-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 bA=new j,bE=new Wi;class Er{constructor(e=new j(1/0,1/0,1/0),t=new j(-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(Ti.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Ti.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=Ti.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(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Ti):Ti.fromBufferAttribute(s,o),Ti.applyMatrix4(e.matrixWorld),this.expandByPoint(Ti);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ad.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),ad.copy(n.boundingBox)),ad.applyMatrix4(e.matrixWorld),this.union(ad)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,Ti),Ti.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(ou),od.subVectors(this.max,ou),cl.subVectors(e.a,ou),ul.subVectors(e.b,ou),hl.subVectors(e.c,ou),ta.subVectors(ul,cl),ra.subVectors(hl,ul),ao.subVectors(cl,hl);let t=[0,-ta.z,ta.y,0,-ra.z,ra.y,0,-ao.z,ao.y,ta.z,0,-ta.x,ra.z,0,-ra.x,ao.z,0,-ao.x,-ta.y,ta.x,0,-ra.y,ra.x,0,-ao.y,ao.x,0];return!RA(t,cl,ul,hl,od)||(t=[1,0,0,0,1,0,0,0,1],!RA(t,cl,ul,hl,od))?!1:(ld.crossVectors(ta,ra),t=[ld.x,ld.y,ld.z],RA(t,cl,ul,hl,od))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ti).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ti).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ms[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ms[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ms[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ms[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ms[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ms[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ms[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ms[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ms),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 ms=[new j,new j,new j,new j,new j,new j,new j,new j],Ti=new j,ad=new Er,cl=new j,ul=new j,hl=new j,ta=new j,ra=new j,ao=new j,ou=new j,od=new j,ld=new j,oo=new j;function RA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){oo.fromArray(r,s);const c=i.x*Math.abs(oo.x)+i.y*Math.abs(oo.y)+i.z*Math.abs(oo.z),h=e.dot(oo),u=t.dot(oo),d=n.dot(oo);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>c)return!1}return!0}const Qb=new Er,lu=new j,DA=new j;class Bi{constructor(e=new j,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;t!==void 0?n.copy(t):Qb.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));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;lu.subVectors(e,this.center);const t=lu.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(lu,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(DA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lu.copy(e.center).add(DA)),this.expandByPoint(lu.copy(e.center).sub(DA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _s=new j,LA=new j,cd=new j,na=new j,NA=new j,ud=new j,UA=new j;class cu{constructor(e=new j,t=new j(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,_s)),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=_s.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_s.copy(this.origin).addScaledVector(this.direction,t),_s.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){LA.copy(e).add(t).multiplyScalar(.5),cd.copy(t).sub(e).normalize(),na.copy(this.origin).sub(LA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(cd),c=na.dot(this.direction),h=-na.dot(cd),u=na.lengthSq(),d=Math.abs(1-o*o);let A,p,g,v;if(d>0)if(A=o*h-c,p=o*c-h,v=s*d,A>=0)if(p>=-v)if(p<=v){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*c)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p<=-v?(A=Math.max(0,-(-o*s+c)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=v?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+c)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(LA).addScaledVector(cd,p),g}intersectSphere(e,t){_s.subVectors(e.center,this.origin);const n=_s.dot(this.direction),i=_s.dot(_s)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=n-o,h=n+o;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?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 n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,c,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(c=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(c=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||c>i)||((c>n||n!==n)&&(n=c),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,_s)!==null}intersectTriangle(e,t,n,i,s){NA.subVectors(t,e),ud.subVectors(n,e),UA.crossVectors(NA,ud);let o=this.direction.dot(UA),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;na.subVectors(this.origin,e);const h=c*this.direction.dot(ud.crossVectors(na,ud));if(h<0)return null;const u=c*this.direction.dot(NA.cross(na));if(u<0||h+u>o)return null;const d=-c*na.dot(UA);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class st{constructor(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){st.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m)}set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){const _=this.elements;return _[0]=e,_[4]=t,_[8]=n,_[12]=i,_[1]=s,_[5]=o,_[9]=c,_[13]=h,_[2]=u,_[6]=d,_[10]=A,_[14]=p,_[3]=g,_[7]=v,_[11]=E,_[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 st().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/dl.setFromMatrixColumn(e,0).length(),s=1/dl.setFromMatrixColumn(e,1).length(),o=1/dl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),c=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+v*u,t[5]=p-E*u,t[9]=-c*h,t[2]=E-p*u,t[6]=v+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p+E*c,t[4]=v*c-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-c,t[2]=g*c-v,t[6]=E+p*c,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p-E*c,t[4]=-o*A,t[8]=v+g*c,t[1]=g+v*c,t[5]=o*d,t[9]=E-p*c,t[2]=-o*u,t[6]=c,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=v*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-v,t[2]=-u,t[6]=c*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=E-p*A,t[8]=v*A+g,t[1]=A,t[5]=o*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*A+v,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-v,t[2]=v*A-g,t[6]=c*d,t[10]=E*A+p}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(Fb,e,Ob)}lookAt(e,t,n){const i=this.elements;return zn.subVectors(e,t),zn.lengthSq()===0&&(zn.z=1),zn.normalize(),ia.crossVectors(n,zn),ia.lengthSq()===0&&(Math.abs(n.z)===1?zn.x+=1e-4:zn.z+=1e-4,zn.normalize(),ia.crossVectors(n,zn)),ia.normalize(),hd.crossVectors(zn,ia),i[0]=ia.x,i[4]=hd.x,i[8]=zn.x,i[1]=ia.y,i[5]=hd.y,i[9]=zn.y,i[2]=ia.z,i[6]=hd.z,i[10]=zn.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,s=this.elements,o=n[0],c=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],v=n[2],E=n[6],m=n[10],_=n[14],w=n[3],x=n[7],I=n[11],R=n[15],M=i[0],T=i[4],D=i[8],b=i[12],S=i[1],L=i[5],P=i[9],N=i[13],W=i[2],X=i[6],K=i[10],te=i[14],H=i[3],ee=i[7],Q=i[11],z=i[15];return s[0]=o*M+c*S+h*W+u*H,s[4]=o*T+c*L+h*X+u*ee,s[8]=o*D+c*P+h*K+u*Q,s[12]=o*b+c*N+h*te+u*z,s[1]=d*M+A*S+p*W+g*H,s[5]=d*T+A*L+p*X+g*ee,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*te+g*z,s[2]=v*M+E*S+m*W+_*H,s[6]=v*T+E*L+m*X+_*ee,s[10]=v*D+E*P+m*K+_*Q,s[14]=v*b+E*N+m*te+_*z,s[3]=w*M+x*S+I*W+R*H,s[7]=w*T+x*L+I*X+R*ee,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*te+R*z,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],s=e[12],o=e[1],c=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],v=e[3],E=e[7],m=e[11],_=e[15];return v*(+s*h*A-i*u*A-s*c*p+n*u*p+i*c*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*c*g-s*o*A+n*o*g+s*c*d-n*u*d)+_*(-i*c*d-t*h*A+t*c*p+i*o*A-n*o*p+n*h*d)}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],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],v=e[12],E=e[13],m=e[14],_=e[15],w=A*m*u-E*p*u+E*h*g-c*m*g-A*h*_+c*p*_,x=v*p*u-d*m*u-v*h*g+o*m*g+d*h*_-o*p*_,I=d*E*u-v*A*u+v*c*g-o*E*g-d*c*_+o*A*_,R=v*A*h-d*E*h-v*c*p+o*E*p+d*c*m-o*A*m,M=t*w+n*x+i*I+s*R;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/M;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*_-n*p*_)*T,e[2]=(c*m*s-E*h*s+E*i*u-n*m*u-c*i*_+n*h*_)*T,e[3]=(A*h*s-c*p*s-A*i*u+n*p*u+c*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-v*p*s+v*i*g-t*m*g-d*i*_+t*p*_)*T,e[6]=(v*h*s-o*m*s-v*i*u+t*m*u+o*i*_-t*h*_)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(v*A*s-d*E*s-v*n*g+t*E*g+d*n*_-t*A*_)*T,e[10]=(o*E*s-v*c*s+v*n*u-t*E*u-o*n*_+t*c*_)*T,e[11]=(d*c*s-o*A*s-d*n*u+t*A*u+o*n*g-t*c*g)*T,e[12]=R*T,e[13]=(d*E*i-v*A*i+v*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(v*c*i-o*E*i-v*n*h+t*E*h+o*n*m-t*c*m)*T,e[15]=(o*A*i-d*c*i+d*n*h-t*A*h-o*n*p+t*c*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){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),s=1-n,o=e.x,c=e.y,h=e.z,u=s*o,d=s*c;return this.set(u*o+n,u*c-i*h,u*h+i*c,0,u*c+i*h,d*c+n,d*h-i*o,0,u*h-i*c,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,c=t._z,h=t._w,u=s+s,d=o+o,A=c+c,p=s*u,g=s*d,v=s*A,E=o*d,m=o*A,_=c*A,w=h*u,x=h*d,I=h*A,R=n.x,M=n.y,T=n.z;return i[0]=(1-(E+_))*R,i[1]=(g+I)*R,i[2]=(v-x)*R,i[3]=0,i[4]=(g-I)*M,i[5]=(1-(p+_))*M,i[6]=(m+w)*M,i[7]=0,i[8]=(v+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,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 s=dl.set(i[0],i[1],i[2]).length();const o=dl.set(i[4],i[5],i[6]).length(),c=dl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],bi.copy(this);const h=1/s,u=1/o,d=1/c;return bi.elements[0]*=h,bi.elements[1]*=h,bi.elements[2]*=h,bi.elements[4]*=u,bi.elements[5]*=u,bi.elements[6]*=u,bi.elements[8]*=d,bi.elements[9]*=d,bi.elements[10]*=d,t.setFromRotationMatrix(bi),n.x=s,n.y=o,n.z=c,this}makePerspective(e,t,n,i,s,o,c=gs){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,v;if(c===gs)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(c===id)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=v,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,c=gs){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let v,E;if(c===gs)v=(o+s)*A,E=-2*A;else if(c===id)v=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-v,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){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 dl=new j,bi=new st,Fb=new j(0,0,0),Ob=new j(1,1,1),ia=new j,hd=new j,zn=new j,RE=new st,DE=new Wi;class Yi{constructor(e=0,t=0,n=0,i=Yi.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,s=i[0],o=i[4],c=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Mr(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Mr(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Mr(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Mr(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Mr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-Mr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return RE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(RE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return DE.setFromEuler(this),this.setFromQuaternion(DE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yi.DEFAULT_ORDER="XYZ";class PA{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let zb=0;const LE=new j,fl=new Wi,vs=new st,dd=new j,uu=new j,Hb=new j,Gb=new Wi,NE=new j(1,0,0),UE=new j(0,1,0),PE=new j(0,0,1),kE={type:"added"},Vb={type:"removed"},pl={type:"childadded",child:null},kA={type:"childremoved",child:null};class Zt extends so{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zb++}),this.uuid=Ci(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new j,t=new Yi,n=new Wi,i=new j(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),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 st},normalMatrix:{value:new gt}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new PA,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 fl.setFromAxisAngle(e,t),this.quaternion.multiply(fl),this}rotateOnWorldAxis(e,t){return fl.setFromAxisAngle(e,t),this.quaternion.premultiply(fl),this}rotateX(e){return this.rotateOnAxis(NE,e)}rotateY(e){return this.rotateOnAxis(UE,e)}rotateZ(e){return this.rotateOnAxis(PE,e)}translateOnAxis(e,t){return LE.copy(e).applyQuaternion(this.quaternion),this.position.add(LE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(NE,e)}translateY(e){return this.translateOnAxis(UE,e)}translateZ(e){return this.translateOnAxis(PE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(vs.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?dd.copy(e):dd.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),uu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?vs.lookAt(uu,dd,this.up):vs.lookAt(dd,uu,this.up),this.quaternion.setFromRotationMatrix(vs),i&&(vs.extractRotation(i.matrixWorld),fl.setFromRotationMatrix(vs),this.quaternion.premultiply(fl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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(kE),pl.child=e,this.dispatchEvent(pl),pl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Vb),kA.child=e,this.dispatchEvent(kA),kA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),vs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),vs.multiply(e.parent.matrixWorld)),e.applyMatrix4(vs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(kE),pl.child=e,this.dispatchEvent(pl),pl.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 s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].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(uu,e,Hb),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uu,Gb,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(this.visible===!1)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;t!==null&&(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)&&(this.parent===null?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 s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),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(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.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),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(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&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,u=this.material.length;h<u;h++)c.push(s(e.materials,this.material[h]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];i.animations.push(s(e.animations,h))}}if(t){const c=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),v=o(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),v.length>0&&(n.nodes=v)}return n.object=i,n;function o(c){const h=[];for(const u in c){const d=c[u];delete d.metadata,h.push(d)}return h}}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)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new j(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ri=new j,ys=new j,QA=new j,Es=new j,Al=new j,gl=new j,QE=new j,FA=new j,OA=new j,zA=new j;class ln{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Ri.subVectors(e,t),i.cross(Ri);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Ri.subVectors(i,t),ys.subVectors(n,t),QA.subVectors(e,t);const o=Ri.dot(Ri),c=Ri.dot(ys),h=Ri.dot(QA),u=ys.dot(ys),d=ys.dot(QA),A=o*u-c*c;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-c*d)*p,v=(o*d-c*h)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Es)===null?!1:Es.x>=0&&Es.y>=0&&Es.x+Es.y<=1}static getInterpolation(e,t,n,i,s,o,c,h){return this.getBarycoord(e,t,n,i,Es)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,Es.x),h.addScaledVector(o,Es.y),h.addScaledVector(c,Es.z),h)}static isFrontFacing(e,t,n,i){return Ri.subVectors(n,t),ys.subVectors(e,t),Ri.cross(ys).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 Ri.subVectors(this.c,this.b),ys.subVectors(this.a,this.b),Ri.cross(ys).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ln.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ln.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return ln.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return ln.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ln.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,c;Al.subVectors(i,n),gl.subVectors(s,n),FA.subVectors(e,n);const h=Al.dot(FA),u=gl.dot(FA);if(h<=0&&u<=0)return t.copy(n);OA.subVectors(e,i);const d=Al.dot(OA),A=gl.dot(OA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(Al,o);zA.subVectors(e,s);const g=Al.dot(zA),v=gl.dot(zA);if(v>=0&&g<=v)return t.copy(s);const E=g*u-h*v;if(E<=0&&u>=0&&v<=0)return c=u/(u-v),t.copy(n).addScaledVector(gl,c);const m=d*v-g*A;if(m<=0&&A-d>=0&&g-v>=0)return QE.subVectors(s,i),c=(A-d)/(A-d+(g-v)),t.copy(i).addScaledVector(QE,c);const _=1/(m+E+p);return o=E*_,c=p*_,t.copy(n).addScaledVector(Al,o).addScaledVector(gl,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const FE={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},sa={h:0,s:0,l:0},fd={h:0,s:0,l:0};function HA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ke{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(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Qr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Rt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Rt.workingColorSpace){if(e=CA(e,1),t=Mr(t,0,1),n=Mr(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=HA(o,s,e+1/3),this.g=HA(o,s,e),this.b=HA(o,s,e-1/3)}return Rt.toWorkingColorSpace(this,i),this}setStyle(e,t=Qr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,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=Qr){const n=FE[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ol(e.r),this.g=ol(e.g),this.b=ol(e.b),this}copyLinearToSRGB(e){return this.r=TA(e.r),this.g=TA(e.g),this.b=TA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Qr){return Rt.fromWorkingColorSpace(Jr.copy(this),e),Math.round(Mr(Jr.r*255,0,255))*65536+Math.round(Mr(Jr.g*255,0,255))*256+Math.round(Mr(Jr.b*255,0,255))}getHexString(e=Qr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rt.workingColorSpace){Rt.fromWorkingColorSpace(Jr.copy(this),t);const n=Jr.r,i=Jr.g,s=Jr.b,o=Math.max(n,i,s),c=Math.min(n,i,s);let h,u;const d=(c+o)/2;if(c===o)h=0,u=0;else{const A=o-c;switch(u=d<=.5?A/(o+c):A/(2-o-c),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Rt.workingColorSpace){return Rt.fromWorkingColorSpace(Jr.copy(this),t),e.r=Jr.r,e.g=Jr.g,e.b=Jr.b,e}getStyle(e=Qr){Rt.fromWorkingColorSpace(Jr.copy(this),e);const t=Jr.r,n=Jr.g,i=Jr.b;return e!==Qr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(sa),this.setHSL(sa.h+e,sa.s+t,sa.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(sa),e.getHSL(fd);const n=su(sa.h,fd.h,t),i=su(sa.s,fd.s,t),s=su(sa.l,fd.l,t);return this.setHSL(n,i,s),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,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[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 Jr=new Ke;Ke.NAMES=FE;let jb=0;class qi extends so{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:jb++}),this.uuid=Ci(),this.name="",this.type="Material",this.blending=tl,this.side=yi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=oA,this.blendDst=lA,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ke(0,0,0),this.blendAlpha=0,this.depthFunc=jh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_E,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=sl,this.stencilZFail=sl,this.stencilZPass=sl,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(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==tl&&(n.blending=this.blending),this.side!==yi&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==oA&&(n.blendSrc=this.blendSrc),this.blendDst!==lA&&(n.blendDst=this.blendDst),this.blendEquation!==ro&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==jh&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==_E&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==sl&&(n.stencilFail=this.stencilFail),this.stencilZFail!==sl&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==sl&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const c in s){const h=s[c];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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){e===!0&&this.version++}}class xs extends qi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ke(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 Yi,this.combine=Py,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 ws=Wb();function Wb(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:c}}function Yb(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Mr(r,-65504,65504),ws.floatView[0]=r;const e=ws.uint32View[0],t=e>>23&511;return ws.baseTable[t]+((e&8388607)>>ws.shiftTable[t])}function qb(r){const e=r>>10;return ws.uint32View[0]=ws.mantissaTable[ws.offsetTable[e]+(r&1023)]+ws.exponentTable[e],ws.floatView[0]}const pd={toHalfFloat:Yb,fromHalfFloat:qb},xr=new j,Ad=new Ge;class Fr{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=e!==void 0?e.length/t:0,this.normalized=n,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("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,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ad.fromBufferAttribute(this,t),Ad.applyMatrix3(e),this.setXY(t,Ad.x,Ad.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyMatrix3(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyMatrix4(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyNormalMatrix(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.transformDirection(e),this.setXYZ(t,xr.x,xr.y,xr.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=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Si(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Si(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==IA&&(e.usage=this.usage),e}}class OE extends Fr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class zE extends Fr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Di extends Fr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Xb=0;const ni=new st,GA=new Zt,ml=new j,Hn=new Er,hu=new Er,Or=new j;class Gn extends so{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Xb++}),this.uuid=Ci(),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(xE(e)?zE:OE)(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 this.attributes[e]!==void 0}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;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new gt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ni.makeRotationFromQuaternion(e),this.applyMatrix4(ni),this}rotateX(e){return ni.makeRotationX(e),this.applyMatrix4(ni),this}rotateY(e){return ni.makeRotationY(e),this.applyMatrix4(ni),this}rotateZ(e){return ni.makeRotationZ(e),this.applyMatrix4(ni),this}translate(e,t,n){return ni.makeTranslation(e,t,n),this.applyMatrix4(ni),this}scale(e,t,n){return ni.makeScale(e,t,n),this.applyMatrix4(ni),this}lookAt(e){return GA.lookAt(e),GA.updateMatrix(),this.applyMatrix4(GA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ml).negate(),this.translate(ml.x,ml.y,ml.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Di(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Er);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];Hn.setFromBufferAttribute(s),this.morphTargetsRelative?(Or.addVectors(this.boundingBox.min,Hn.min),this.boundingBox.expandByPoint(Or),Or.addVectors(this.boundingBox.max,Hn.max),this.boundingBox.expandByPoint(Or)):(this.boundingBox.expandByPoint(Hn.min),this.boundingBox.expandByPoint(Hn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Bi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(Hn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const c=t[s];hu.setFromBufferAttribute(c),this.morphTargetsRelative?(Or.addVectors(Hn.min,hu.min),Hn.expandByPoint(Or),Or.addVectors(Hn.max,hu.max),Hn.expandByPoint(Or)):(Hn.expandByPoint(hu.min),Hn.expandByPoint(hu.max))}Hn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Or.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Or));if(t)for(let s=0,o=t.length;s<o;s++){const c=t[s],h=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Or.fromBufferAttribute(c,u),h&&(ml.fromBufferAttribute(e,u),Or.add(ml)),i=Math.max(i,n.distanceToSquared(Or))}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(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Fr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),c=[],h=[];for(let D=0;D<n.count;D++)c[D]=new j,h[D]=new j;const u=new j,d=new j,A=new j,p=new Ge,g=new Ge,v=new Ge,E=new j,m=new j;function _(D,b,S){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,S),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),v.fromBufferAttribute(s,S),d.sub(u),A.sub(u),g.sub(p),v.sub(p);const L=1/(g.x*v.y-v.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(v.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-v.x).multiplyScalar(L),c[D].add(E),c[b].add(E),c[S].add(E),h[D].add(m),h[b].add(m),h[S].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const S=w[D],L=S.start,P=S.count;for(let N=L,W=L+P;N<W;N+=3)_(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new j,I=new j,R=new j,M=new j;function T(D){R.fromBufferAttribute(i,D),M.copy(R);const b=c[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(M,b);const S=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,S)}for(let D=0,b=w.length;D<b;++D){const S=w[D],L=S.start,P=S.count;for(let N=L,W=L+P;N<W;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Fr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new j,s=new j,o=new j,c=new j,h=new j,u=new j,d=new j,A=new j;if(e)for(let p=0,g=e.count;p<g;p+=3){const v=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),c.fromBufferAttribute(n,v),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),c.add(d),h.add(d),u.add(d),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Or.fromBufferAttribute(e,t),Or.normalize(),e.setXYZ(t,Or.x,Or.y,Or.z)}toNonIndexed(){function e(c,h){const u=c.array,d=c.itemSize,A=c.normalized,p=new u.constructor(h.length*d);let g=0,v=0;for(let E=0,m=h.length;E<m;E++){c.isInterleavedBufferAttribute?g=h[E]*c.data.stride+c.offset:g=h[E]*d;for(let _=0;_<d;_++)p[v++]=u[g++]}return new Fr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Gn,n=this.index.array,i=this.attributes;for(const c in i){const h=i[c],u=e(h,n);t.setAttribute(c,u)}const s=this.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];t.addGroup(u.start,u.count,u.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),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.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;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const HE=new st,lo=new cu,gd=new Bi,GE=new j,_l=new j,vl=new j,yl=new j,VA=new j,md=new j,_d=new Ge,vd=new Ge,yd=new Ge,VE=new j,jE=new j,WE=new j,Ed=new j,xd=new j;class Yr extends Zt{constructor(e=new Gn,t=new xs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(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(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){md.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=c[h],A=s[h];d!==0&&(VA.fromBufferAttribute(A,e),o?md.addScaledVector(VA,d):md.addScaledVector(VA.sub(t),d))}t.add(md)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),gd.copy(n.boundingSphere),gd.applyMatrix4(s),lo.copy(e.ray).recast(e.near),!(gd.containsPoint(lo.origin)===!1&&(lo.intersectSphere(gd,GE)===null||lo.origin.distanceToSquared(GE)>(e.far-e.near)**2))&&(HE.copy(s).invert(),lo.copy(e.ray).applyMatrix4(HE),!(n.boundingBox!==null&&lo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,lo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,c=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(c!==null)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(c.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const M=c.getX(I),T=c.getX(I+1),D=c.getX(I+2);i=wd(this,_,e,n,u,d,A,M,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(c.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=c.getX(m),x=c.getX(m+1),I=c.getX(m+2);i=wd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const M=I,T=I+1,D=I+2;i=wd(this,_,e,n,u,d,A,M,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=m,x=m+1,I=m+2;i=wd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function Kb(r,e,t,n,i,s,o,c){let h;if(e.side===kr?h=n.intersectTriangle(o,s,i,!0,c):h=n.intersectTriangle(i,s,o,e.side===yi,c),h===null)return null;xd.copy(c),xd.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(xd);return u<t.near||u>t.far?null:{distance:u,point:xd.clone(),object:r}}function wd(r,e,t,n,i,s,o,c,h,u){r.getVertexPosition(c,_l),r.getVertexPosition(h,vl),r.getVertexPosition(u,yl);const d=Kb(r,e,t,n,_l,vl,yl,Ed);if(d){i&&(_d.fromBufferAttribute(i,c),vd.fromBufferAttribute(i,h),yd.fromBufferAttribute(i,u),d.uv=ln.getInterpolation(Ed,_l,vl,yl,_d,vd,yd,new Ge)),s&&(_d.fromBufferAttribute(s,c),vd.fromBufferAttribute(s,h),yd.fromBufferAttribute(s,u),d.uv1=ln.getInterpolation(Ed,_l,vl,yl,_d,vd,yd,new Ge)),o&&(VE.fromBufferAttribute(o,c),jE.fromBufferAttribute(o,h),WE.fromBufferAttribute(o,u),d.normal=ln.getInterpolation(Ed,_l,vl,yl,VE,jE,WE,new j),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:c,b:h,c:u,normal:new j,materialIndex:0};ln.getNormal(_l,vl,yl,A.normal),d.face=A}return d}class du extends Gn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Di(u,3)),this.setAttribute("normal",new Di(d,3)),this.setAttribute("uv",new Di(A,2));function v(E,m,_,w,x,I,R,M,T,D,b){const S=I/T,L=R/D,P=I/2,N=R/2,W=M/2,X=T+1,K=D+1;let te=0,H=0;const ee=new j;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*S-P;ee[E]=re*w,ee[m]=z*x,ee[_]=W,u.push(ee.x,ee.y,ee.z),ee[E]=0,ee[m]=0,ee[_]=M>0?1:-1,d.push(ee.x,ee.y,ee.z),A.push(Z/T),A.push(1-Q/D),te+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),G=p+(z+1)+X*(Q+1),de=p+(z+1)+X*Q;h.push(Z,re,de),h.push(re,G,de),H+=6}c.addGroup(g,H,b),g+=H,p+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new du(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function El(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function cn(r){const e={};for(let t=0;t<r.length;t++){const n=El(r[t]);for(const i in n)e[i]=n[i]}return e}function Jb(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function YE(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rt.workingColorSpace}const Id={clone:El,merge:cn};var Zb=`void main() {
|
|
36
|
+
*/const jh="163",el={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},tl={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},vB=0,Ry=1,yB=2,Dy=1,EB=2,fs=3,yi=0,kr=1,Ei=2,ps=0,rl=1,Ly=2,Ny=3,Uy=4,xB=5,ro=100,wB=101,IB=102,CB=103,SB=104,MB=200,TB=201,BB=202,bB=203,oA=204,lA=205,RB=206,DB=207,LB=208,NB=209,UB=210,PB=211,kB=212,QB=213,FB=214,OB=0,zB=1,HB=2,Wh=3,GB=4,VB=5,jB=6,WB=7,Py=0,YB=1,qB=2,Zs=0,ky=1,Qy=2,Fy=3,cA=4,XB=5,Oy=6,zy=7,Hy="attached",KB="detached",Gy=300,no=301,nl=302,Kc=303,uA=304,Yh=306,$s=1e3,xi=1001,qh=1002,fr=1003,Vy=1004,Jc=1005,pr=1006,Xh=1007,wi=1008,JB=1008,Ar=1009,hA=1010,jy=1011,dA=1012,Zc=1013,Ii=1014,lr=1015,yn=1016,Wy=1017,Yy=1018,$c=1020,ZB=35902,$B=1021,eb=1022,gr=1023,tb=1024,rb=1025,il=1026,eu=1027,ea=1028,fA=1029,io=1030,Kh=1031,tu=1033,Jh=33776,pA=33777,AA=33778,Zh=33779,gA=35840,qy=35841,mA=35842,Xy=35843,_A=36196,vA=37492,yA=37496,EA=37808,Ky=37809,Jy=37810,Zy=37811,$h=37812,$y=37813,eE=37814,tE=37815,rE=37816,nE=37817,iE=37818,sE=37819,aE=37820,oE=37821,ed=36492,lE=36494,cE=36495,nb=36283,uE=36284,hE=36285,dE=36286,ru=2300,sl=2301,xA=2302,fE=2400,pE=2401,AE=2402,ib=2500,sb=0,gE=1,wA=2,ab=3200,ob=3201,mE=0,lb=1,As="",Qr="srgb",Sr="srgb-linear",td="display-p3",nu="display-p3-linear",rd="linear",Ht="srgb",nd="rec709",id="p3",al=7680,_E=519,cb=512,ub=513,hb=514,vE=515,db=516,fb=517,pb=518,Ab=519,IA=35044,yE="300 es",gs=2e3,sd=2001;class so{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Kr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let EE=1234567;const iu=Math.PI/180,ol=180/Math.PI;function Ci(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Kr[r&255]+Kr[r>>8&255]+Kr[r>>16&255]+Kr[r>>24&255]+"-"+Kr[e&255]+Kr[e>>8&255]+"-"+Kr[e>>16&15|64]+Kr[e>>24&255]+"-"+Kr[t&63|128]+Kr[t>>8&255]+"-"+Kr[t>>16&255]+Kr[t>>24&255]+Kr[n&255]+Kr[n>>8&255]+Kr[n>>16&255]+Kr[n>>24&255]).toLowerCase()}function Mr(r,e,t){return Math.max(e,Math.min(t,r))}function CA(r,e){return(r%e+e)%e}function gb(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function mb(r,e,t){return r!==e?(t-r)/(e-r):0}function su(r,e,t){return(1-t)*r+t*e}function _b(r,e,t,n){return su(r,e,1-Math.exp(-t*n))}function vb(r,e=1){return e-Math.abs(CA(r,e*2)-e)}function yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Eb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function xb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function wb(r,e){return r+Math.random()*(e-r)}function Ib(r){return r*(.5-Math.random())}function Cb(r){r!==void 0&&(EE=r);let e=EE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Sb(r){return r*iu}function Mb(r){return r*ol}function Tb(r){return(r&r-1)===0&&r!==0}function Bb(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function bb(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function Rb(r,e,t,n,i){const s=Math.cos,o=Math.sin,c=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),v=o((n-e)/2);switch(i){case"XYX":r.set(c*d,h*A,h*p,c*u);break;case"YZY":r.set(h*p,c*d,h*A,c*u);break;case"ZXZ":r.set(h*A,h*p,c*d,c*u);break;case"XZX":r.set(c*d,h*v,h*g,c*u);break;case"YXY":r.set(h*g,c*d,h*v,c*u);break;case"ZYZ":r.set(h*v,h*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Si(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Nt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const SA={DEG2RAD:iu,RAD2DEG:ol,generateUUID:Ci,clamp:Mr,euclideanModulo:CA,mapLinear:gb,inverseLerp:mb,lerp:su,damp:_b,pingpong:vb,smoothstep:yb,smootherstep:Eb,randInt:xb,randFloat:wb,randFloatSpread:Ib,seededRandom:Cb,degToRad:Sb,radToDeg:Mb,isPowerOfTwo:Tb,ceilPowerOfTwo:Bb,floorPowerOfTwo:bb,setQuaternionFromProperEuler:Rb,normalize:Nt,denormalize:Si};class Ge{constructor(e=0,t=0){Ge.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(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(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),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gt{constructor(e,t,n,i,s,o,c,h,u){gt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u)}set(e,t,n,i,s,o,c,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=c,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,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,s=this.elements,o=n[0],c=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],v=n[8],E=i[0],m=i[3],_=i[6],w=i[1],x=i[4],I=i[7],R=i[2],M=i[5],T=i[8];return s[0]=o*E+c*w+h*R,s[3]=o*m+c*x+h*M,s[6]=o*_+c*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*M,s[7]=u*_+d*I+A*T,s[2]=p*E+g*w+v*R,s[5]=p*m+g*x+v*M,s[8]=p*_+g*I+v*T,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],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*c*u-n*s*d+n*c*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=d*o-c*u,p=c*h-d*s,g=u*s-o*h,v=t*A+n*p+i*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/v;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(c*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-c*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,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,s,o,c){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*c)+o+e,-i*u,i*h,-i*(-u*o+h*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(MA.makeScale(e,t)),this}rotate(e){return this.premultiply(MA.makeRotation(-e)),this}translate(e,t){return this.premultiply(MA.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 i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){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 MA=new gt;function xE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function au(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Db(){const r=au("canvas");return r.style.display="block",r}const wE={};function IE(r){r in wE||(wE[r]=!0,console.warn(r))}const CE=new gt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),SE=new gt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ad={[Sr]:{transfer:rd,primaries:nd,toReference:r=>r,fromReference:r=>r},[Qr]:{transfer:Ht,primaries:nd,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[nu]:{transfer:rd,primaries:id,toReference:r=>r.applyMatrix3(SE),fromReference:r=>r.applyMatrix3(CE)},[td]:{transfer:Ht,primaries:id,toReference:r=>r.convertSRGBToLinear().applyMatrix3(SE),fromReference:r=>r.applyMatrix3(CE).convertLinearToSRGB()}},Lb=new Set([Sr,nu]),Rt={enabled:!0,_workingColorSpace:Sr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Lb.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=ad[e].toReference,i=ad[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return ad[r].primaries},getTransfer:function(r){return r===As?rd:ad[r].transfer}};function ll(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function TA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let cl;class Nb{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{cl===void 0&&(cl=au("canvas")),cl.width=e.width,cl.height=e.height;const n=cl.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=cl}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=au("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),s=i.data;for(let o=0;o<s.length;o++)s[o]=ll(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(ll(t[n]/255)*255):t[n]=ll(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Ub=0;class ME{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Ub++}),this.uuid=Ci(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,c=i.length;o<c;o++)i[o].isDataTexture?s.push(BA(i[o].image)):s.push(BA(i[o]))}else s=BA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function BA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Nb.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Pb=0;class Tr extends so{constructor(e=Tr.DEFAULT_IMAGE,t=Tr.DEFAULT_MAPPING,n=xi,i=xi,s=pr,o=wi,c=gr,h=Ar,u=Tr.DEFAULT_ANISOTROPY,d=As){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Pb++}),this.uuid=Ci(),this.name="",this.source=new ME(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=h,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,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=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Gy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $s:e.x=e.x-Math.floor(e.x);break;case xi:e.x=e.x<0?0:1;break;case qh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case $s:e.y=e.y-Math.floor(e.y);break;case xi:e.y=e.y<0?0:1;break;case qh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Tr.DEFAULT_IMAGE=null,Tr.DEFAULT_MAPPING=Gy,Tr.DEFAULT_ANISOTROPY=1;class Ot{constructor(e=0,t=0,n=0,i=1){Ot.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);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,s;const o=e.elements,c=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],v=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+v)<.1&&Math.abs(c+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(c+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,M=(p+v)/4;return _>w&&_>x?_<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(_),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=M/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=M/s),this.set(n,i,s,t),this}let m=Math.sqrt((v-p)*(v-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(v-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((c+A+E-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 kb extends so{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ot(0,0,e,t),this.scissorTest=!1,this.viewport=new Ot(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new Tr(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,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,s=this.textures.length;i<s;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 n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new ME(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Mi extends kb{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class TE extends Tr{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=fr,this.minFilter=fr,this.wrapR=xi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class BE extends Tr{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=fr,this.minFilter=fr,this.wrapR=xi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Wi{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,c){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],v=s[o+2],E=s[o+3];if(c===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(c===1){e[t+0]=p,e[t+1]=g,e[t+2]=v,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==v){let m=1-c;const _=h*p+u*g+d*v+A*E,w=_>=0?1:-1,x=1-_*_;if(x>Number.EPSILON){const R=Math.sqrt(x),M=Math.atan2(R,_*w);m=Math.sin(m*M)/R,c=Math.sin(c*M)/R}const I=c*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+v*I,A=A*m+E*I,m===1-c){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const c=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=c*v+d*A+h*g-u*p,e[t+1]=h*v+d*p+u*A-c*g,e[t+2]=u*v+d*g+c*p-h*A,e[t+3]=d*v-c*A-h*p-u*g,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,s=e._z,o=e._order,c=Math.cos,h=Math.sin,u=c(n/2),d=c(i/2),A=c(s/2),p=h(n/2),g=h(i/2),v=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"YXZ":this._x=p*d*A+u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"ZXY":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A-p*g*v;break;case"ZYX":this._x=p*d*A-u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A+p*g*v;break;case"YZX":this._x=p*d*A+u*g*v,this._y=u*g*A+p*d*v,this._z=u*d*v-p*g*A,this._w=u*d*A-p*g*v;break;case"XZY":this._x=p*d*A-u*g*v,this._y=u*g*A-p*d*v,this._z=u*d*v+p*g*A,this._w=u*d*A+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&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],s=t[8],o=t[1],c=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+c+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>c&&n>A){const g=2*Math.sqrt(1+n-c-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(c>A){const g=2*Math.sqrt(1+c-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-c);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}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(Mr(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,c=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*c+i*u-s*h,this._y=i*d+o*h+s*c-n*u,this._z=s*d+o*u+n*h-i*c,this._w=o*d-n*c-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let c=o*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-c*c;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,c),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,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),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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 j{constructor(e=0,t=0,n=0){j.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(bE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(bE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,c=e.z,h=e.w,u=2*(o*i-c*n),d=2*(c*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-c*d,this.y=n+h*d+c*u-s*A,this.z=i+h*A+s*d-o*u,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,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){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,s=e.z,o=t.x,c=t.y,h=t.z;return this.x=i*h-s*c,this.y=s*o-n*h,this.z=n*c-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return bA.copy(this).projectOnVector(e),this.sub(bA)}reflect(e){return this.sub(bA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Mr(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,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}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=Math.random()*2-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 bA=new j,bE=new Wi;class Er{constructor(e=new j(1/0,1/0,1/0),t=new j(-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(Ti.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Ti.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=Ti.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(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Ti):Ti.fromBufferAttribute(s,o),Ti.applyMatrix4(e.matrixWorld),this.expandByPoint(Ti);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),od.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),od.copy(n.boundingBox)),od.applyMatrix4(e.matrixWorld),this.union(od)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,Ti),Ti.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(ou),ld.subVectors(this.max,ou),ul.subVectors(e.a,ou),hl.subVectors(e.b,ou),dl.subVectors(e.c,ou),ta.subVectors(hl,ul),ra.subVectors(dl,hl),ao.subVectors(ul,dl);let t=[0,-ta.z,ta.y,0,-ra.z,ra.y,0,-ao.z,ao.y,ta.z,0,-ta.x,ra.z,0,-ra.x,ao.z,0,-ao.x,-ta.y,ta.x,0,-ra.y,ra.x,0,-ao.y,ao.x,0];return!RA(t,ul,hl,dl,ld)||(t=[1,0,0,0,1,0,0,0,1],!RA(t,ul,hl,dl,ld))?!1:(cd.crossVectors(ta,ra),t=[cd.x,cd.y,cd.z],RA(t,ul,hl,dl,ld))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ti).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ti).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ms[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ms[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ms[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ms[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ms[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ms[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ms[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ms[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ms),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 ms=[new j,new j,new j,new j,new j,new j,new j,new j],Ti=new j,od=new Er,ul=new j,hl=new j,dl=new j,ta=new j,ra=new j,ao=new j,ou=new j,ld=new j,cd=new j,oo=new j;function RA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){oo.fromArray(r,s);const c=i.x*Math.abs(oo.x)+i.y*Math.abs(oo.y)+i.z*Math.abs(oo.z),h=e.dot(oo),u=t.dot(oo),d=n.dot(oo);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>c)return!1}return!0}const Qb=new Er,lu=new j,DA=new j;class Bi{constructor(e=new j,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;t!==void 0?n.copy(t):Qb.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));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;lu.subVectors(e,this.center);const t=lu.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(lu,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(DA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lu.copy(e.center).add(DA)),this.expandByPoint(lu.copy(e.center).sub(DA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _s=new j,LA=new j,ud=new j,na=new j,NA=new j,hd=new j,UA=new j;class cu{constructor(e=new j,t=new j(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,_s)),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=_s.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_s.copy(this.origin).addScaledVector(this.direction,t),_s.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){LA.copy(e).add(t).multiplyScalar(.5),ud.copy(t).sub(e).normalize(),na.copy(this.origin).sub(LA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(ud),c=na.dot(this.direction),h=-na.dot(ud),u=na.lengthSq(),d=Math.abs(1-o*o);let A,p,g,v;if(d>0)if(A=o*h-c,p=o*c-h,v=s*d,A>=0)if(p>=-v)if(p<=v){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*c)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;else p<=-v?(A=Math.max(0,-(-o*s+c)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=v?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+c)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+c)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(LA).addScaledVector(ud,p),g}intersectSphere(e,t){_s.subVectors(e.center,this.origin);const n=_s.dot(this.direction),i=_s.dot(_s)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=n-o,h=n+o;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?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 n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,c,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(c=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(c=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||c>i)||((c>n||n!==n)&&(n=c),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,_s)!==null}intersectTriangle(e,t,n,i,s){NA.subVectors(t,e),hd.subVectors(n,e),UA.crossVectors(NA,hd);let o=this.direction.dot(UA),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;na.subVectors(this.origin,e);const h=c*this.direction.dot(hd.crossVectors(na,hd));if(h<0)return null;const u=c*this.direction.dot(NA.cross(na));if(u<0||h+u>o)return null;const d=-c*na.dot(UA);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class st{constructor(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){st.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m)}set(e,t,n,i,s,o,c,h,u,d,A,p,g,v,E,m){const _=this.elements;return _[0]=e,_[4]=t,_[8]=n,_[12]=i,_[1]=s,_[5]=o,_[9]=c,_[13]=h,_[2]=u,_[6]=d,_[10]=A,_[14]=p,_[3]=g,_[7]=v,_[11]=E,_[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 st().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/fl.setFromMatrixColumn(e,0).length(),s=1/fl.setFromMatrixColumn(e,1).length(),o=1/fl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),c=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+v*u,t[5]=p-E*u,t[9]=-c*h,t[2]=E-p*u,t[6]=v+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p+E*c,t[4]=v*c-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-c,t[2]=g*c-v,t[6]=E+p*c,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,v=u*d,E=u*A;t[0]=p-E*c,t[4]=-o*A,t[8]=v+g*c,t[1]=g+v*c,t[5]=o*d,t[9]=E-p*c,t[2]=-o*u,t[6]=c,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,v=c*d,E=c*A;t[0]=h*d,t[4]=v*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-v,t[2]=-u,t[6]=c*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=E-p*A,t[8]=v*A+g,t[1]=A,t[5]=o*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*A+v,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,v=c*h,E=c*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-v,t[2]=v*A-g,t[6]=c*d,t[10]=E*A+p}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(Fb,e,Ob)}lookAt(e,t,n){const i=this.elements;return zn.subVectors(e,t),zn.lengthSq()===0&&(zn.z=1),zn.normalize(),ia.crossVectors(n,zn),ia.lengthSq()===0&&(Math.abs(n.z)===1?zn.x+=1e-4:zn.z+=1e-4,zn.normalize(),ia.crossVectors(n,zn)),ia.normalize(),dd.crossVectors(zn,ia),i[0]=ia.x,i[4]=dd.x,i[8]=zn.x,i[1]=ia.y,i[5]=dd.y,i[9]=zn.y,i[2]=ia.z,i[6]=dd.z,i[10]=zn.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,s=this.elements,o=n[0],c=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],v=n[2],E=n[6],m=n[10],_=n[14],w=n[3],x=n[7],I=n[11],R=n[15],M=i[0],T=i[4],D=i[8],b=i[12],S=i[1],L=i[5],P=i[9],N=i[13],W=i[2],X=i[6],K=i[10],te=i[14],H=i[3],ee=i[7],Q=i[11],z=i[15];return s[0]=o*M+c*S+h*W+u*H,s[4]=o*T+c*L+h*X+u*ee,s[8]=o*D+c*P+h*K+u*Q,s[12]=o*b+c*N+h*te+u*z,s[1]=d*M+A*S+p*W+g*H,s[5]=d*T+A*L+p*X+g*ee,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*te+g*z,s[2]=v*M+E*S+m*W+_*H,s[6]=v*T+E*L+m*X+_*ee,s[10]=v*D+E*P+m*K+_*Q,s[14]=v*b+E*N+m*te+_*z,s[3]=w*M+x*S+I*W+R*H,s[7]=w*T+x*L+I*X+R*ee,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*te+R*z,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],s=e[12],o=e[1],c=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],v=e[3],E=e[7],m=e[11],_=e[15];return v*(+s*h*A-i*u*A-s*c*p+n*u*p+i*c*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*c*g-s*o*A+n*o*g+s*c*d-n*u*d)+_*(-i*c*d-t*h*A+t*c*p+i*o*A-n*o*p+n*h*d)}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],s=e[3],o=e[4],c=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],v=e[12],E=e[13],m=e[14],_=e[15],w=A*m*u-E*p*u+E*h*g-c*m*g-A*h*_+c*p*_,x=v*p*u-d*m*u-v*h*g+o*m*g+d*h*_-o*p*_,I=d*E*u-v*A*u+v*c*g-o*E*g-d*c*_+o*A*_,R=v*A*h-d*E*h-v*c*p+o*E*p+d*c*m-o*A*m,M=t*w+n*x+i*I+s*R;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/M;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*_-n*p*_)*T,e[2]=(c*m*s-E*h*s+E*i*u-n*m*u-c*i*_+n*h*_)*T,e[3]=(A*h*s-c*p*s-A*i*u+n*p*u+c*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-v*p*s+v*i*g-t*m*g-d*i*_+t*p*_)*T,e[6]=(v*h*s-o*m*s-v*i*u+t*m*u+o*i*_-t*h*_)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(v*A*s-d*E*s-v*n*g+t*E*g+d*n*_-t*A*_)*T,e[10]=(o*E*s-v*c*s+v*n*u-t*E*u-o*n*_+t*c*_)*T,e[11]=(d*c*s-o*A*s-d*n*u+t*A*u+o*n*g-t*c*g)*T,e[12]=R*T,e[13]=(d*E*i-v*A*i+v*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(v*c*i-o*E*i-v*n*h+t*E*h+o*n*m-t*c*m)*T,e[15]=(o*A*i-d*c*i+d*n*h-t*A*h-o*n*p+t*c*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){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),s=1-n,o=e.x,c=e.y,h=e.z,u=s*o,d=s*c;return this.set(u*o+n,u*c-i*h,u*h+i*c,0,u*c+i*h,d*c+n,d*h-i*o,0,u*h-i*c,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,c=t._z,h=t._w,u=s+s,d=o+o,A=c+c,p=s*u,g=s*d,v=s*A,E=o*d,m=o*A,_=c*A,w=h*u,x=h*d,I=h*A,R=n.x,M=n.y,T=n.z;return i[0]=(1-(E+_))*R,i[1]=(g+I)*R,i[2]=(v-x)*R,i[3]=0,i[4]=(g-I)*M,i[5]=(1-(p+_))*M,i[6]=(m+w)*M,i[7]=0,i[8]=(v+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,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 s=fl.set(i[0],i[1],i[2]).length();const o=fl.set(i[4],i[5],i[6]).length(),c=fl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],bi.copy(this);const h=1/s,u=1/o,d=1/c;return bi.elements[0]*=h,bi.elements[1]*=h,bi.elements[2]*=h,bi.elements[4]*=u,bi.elements[5]*=u,bi.elements[6]*=u,bi.elements[8]*=d,bi.elements[9]*=d,bi.elements[10]*=d,t.setFromRotationMatrix(bi),n.x=s,n.y=o,n.z=c,this}makePerspective(e,t,n,i,s,o,c=gs){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,v;if(c===gs)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(c===sd)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=v,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,c=gs){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let v,E;if(c===gs)v=(o+s)*A,E=-2*A;else if(c===sd)v=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-v,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){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 fl=new j,bi=new st,Fb=new j(0,0,0),Ob=new j(1,1,1),ia=new j,dd=new j,zn=new j,RE=new st,DE=new Wi;class Yi{constructor(e=0,t=0,n=0,i=Yi.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,s=i[0],o=i[4],c=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Mr(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Mr(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Mr(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Mr(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Mr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-Mr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return RE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(RE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return DE.setFromEuler(this),this.setFromQuaternion(DE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yi.DEFAULT_ORDER="XYZ";class PA{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let zb=0;const LE=new j,pl=new Wi,vs=new st,fd=new j,uu=new j,Hb=new j,Gb=new Wi,NE=new j(1,0,0),UE=new j(0,1,0),PE=new j(0,0,1),kE={type:"added"},Vb={type:"removed"},Al={type:"childadded",child:null},kA={type:"childremoved",child:null};class Zt extends so{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zb++}),this.uuid=Ci(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new j,t=new Yi,n=new Wi,i=new j(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),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 st},normalMatrix:{value:new gt}}),this.matrix=new st,this.matrixWorld=new st,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new PA,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 pl.setFromAxisAngle(e,t),this.quaternion.multiply(pl),this}rotateOnWorldAxis(e,t){return pl.setFromAxisAngle(e,t),this.quaternion.premultiply(pl),this}rotateX(e){return this.rotateOnAxis(NE,e)}rotateY(e){return this.rotateOnAxis(UE,e)}rotateZ(e){return this.rotateOnAxis(PE,e)}translateOnAxis(e,t){return LE.copy(e).applyQuaternion(this.quaternion),this.position.add(LE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(NE,e)}translateY(e){return this.translateOnAxis(UE,e)}translateZ(e){return this.translateOnAxis(PE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(vs.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?fd.copy(e):fd.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),uu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?vs.lookAt(uu,fd,this.up):vs.lookAt(fd,uu,this.up),this.quaternion.setFromRotationMatrix(vs),i&&(vs.extractRotation(i.matrixWorld),pl.setFromRotationMatrix(vs),this.quaternion.premultiply(pl.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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(kE),Al.child=e,this.dispatchEvent(Al),Al.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Vb),kA.child=e,this.dispatchEvent(kA),kA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),vs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),vs.multiply(e.parent.matrixWorld)),e.applyMatrix4(vs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(kE),Al.child=e,this.dispatchEvent(Al),Al.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 s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].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(uu,e,Hb),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uu,Gb,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(this.visible===!1)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;t!==null&&(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)&&(this.parent===null?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 s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),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(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.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),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(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&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,u=this.material.length;h<u;h++)c.push(s(e.materials,this.material[h]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];i.animations.push(s(e.animations,h))}}if(t){const c=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),v=o(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),v.length>0&&(n.nodes=v)}return n.object=i,n;function o(c){const h=[];for(const u in c){const d=c[u];delete d.metadata,h.push(d)}return h}}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)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new j(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ri=new j,ys=new j,QA=new j,Es=new j,gl=new j,ml=new j,QE=new j,FA=new j,OA=new j,zA=new j;class ln{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Ri.subVectors(e,t),i.cross(Ri);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Ri.subVectors(i,t),ys.subVectors(n,t),QA.subVectors(e,t);const o=Ri.dot(Ri),c=Ri.dot(ys),h=Ri.dot(QA),u=ys.dot(ys),d=ys.dot(QA),A=o*u-c*c;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-c*d)*p,v=(o*d-c*h)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Es)===null?!1:Es.x>=0&&Es.y>=0&&Es.x+Es.y<=1}static getInterpolation(e,t,n,i,s,o,c,h){return this.getBarycoord(e,t,n,i,Es)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,Es.x),h.addScaledVector(o,Es.y),h.addScaledVector(c,Es.z),h)}static isFrontFacing(e,t,n,i){return Ri.subVectors(n,t),ys.subVectors(e,t),Ri.cross(ys).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 Ri.subVectors(this.c,this.b),ys.subVectors(this.a,this.b),Ri.cross(ys).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ln.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ln.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return ln.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return ln.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ln.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,c;gl.subVectors(i,n),ml.subVectors(s,n),FA.subVectors(e,n);const h=gl.dot(FA),u=ml.dot(FA);if(h<=0&&u<=0)return t.copy(n);OA.subVectors(e,i);const d=gl.dot(OA),A=ml.dot(OA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(gl,o);zA.subVectors(e,s);const g=gl.dot(zA),v=ml.dot(zA);if(v>=0&&g<=v)return t.copy(s);const E=g*u-h*v;if(E<=0&&u>=0&&v<=0)return c=u/(u-v),t.copy(n).addScaledVector(ml,c);const m=d*v-g*A;if(m<=0&&A-d>=0&&g-v>=0)return QE.subVectors(s,i),c=(A-d)/(A-d+(g-v)),t.copy(i).addScaledVector(QE,c);const _=1/(m+E+p);return o=E*_,c=p*_,t.copy(n).addScaledVector(gl,o).addScaledVector(ml,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const FE={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},sa={h:0,s:0,l:0},pd={h:0,s:0,l:0};function HA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ke{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(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Qr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Rt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Rt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Rt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Rt.workingColorSpace){if(e=CA(e,1),t=Mr(t,0,1),n=Mr(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=HA(o,s,e+1/3),this.g=HA(o,s,e),this.b=HA(o,s,e-1/3)}return Rt.toWorkingColorSpace(this,i),this}setStyle(e,t=Qr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,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=Qr){const n=FE[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ll(e.r),this.g=ll(e.g),this.b=ll(e.b),this}copyLinearToSRGB(e){return this.r=TA(e.r),this.g=TA(e.g),this.b=TA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Qr){return Rt.fromWorkingColorSpace(Jr.copy(this),e),Math.round(Mr(Jr.r*255,0,255))*65536+Math.round(Mr(Jr.g*255,0,255))*256+Math.round(Mr(Jr.b*255,0,255))}getHexString(e=Qr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Rt.workingColorSpace){Rt.fromWorkingColorSpace(Jr.copy(this),t);const n=Jr.r,i=Jr.g,s=Jr.b,o=Math.max(n,i,s),c=Math.min(n,i,s);let h,u;const d=(c+o)/2;if(c===o)h=0,u=0;else{const A=o-c;switch(u=d<=.5?A/(o+c):A/(2-o-c),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Rt.workingColorSpace){return Rt.fromWorkingColorSpace(Jr.copy(this),t),e.r=Jr.r,e.g=Jr.g,e.b=Jr.b,e}getStyle(e=Qr){Rt.fromWorkingColorSpace(Jr.copy(this),e);const t=Jr.r,n=Jr.g,i=Jr.b;return e!==Qr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(sa),this.setHSL(sa.h+e,sa.s+t,sa.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(sa),e.getHSL(pd);const n=su(sa.h,pd.h,t),i=su(sa.s,pd.s,t),s=su(sa.l,pd.l,t);return this.setHSL(n,i,s),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,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[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 Jr=new Ke;Ke.NAMES=FE;let jb=0;class qi extends so{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:jb++}),this.uuid=Ci(),this.name="",this.type="Material",this.blending=rl,this.side=yi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=oA,this.blendDst=lA,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ke(0,0,0),this.blendAlpha=0,this.depthFunc=Wh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_E,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=al,this.stencilZFail=al,this.stencilZPass=al,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(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(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,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==rl&&(n.blending=this.blending),this.side!==yi&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==oA&&(n.blendSrc=this.blendSrc),this.blendDst!==lA&&(n.blendDst=this.blendDst),this.blendEquation!==ro&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Wh&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==_E&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==al&&(n.stencilFail=this.stencilFail),this.stencilZFail!==al&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==al&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const c in s){const h=s[c];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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){e===!0&&this.version++}}class xs extends qi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ke(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 Yi,this.combine=Py,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 ws=Wb();function Wb(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:c}}function Yb(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Mr(r,-65504,65504),ws.floatView[0]=r;const e=ws.uint32View[0],t=e>>23&511;return ws.baseTable[t]+((e&8388607)>>ws.shiftTable[t])}function qb(r){const e=r>>10;return ws.uint32View[0]=ws.mantissaTable[ws.offsetTable[e]+(r&1023)]+ws.exponentTable[e],ws.floatView[0]}const Ad={toHalfFloat:Yb,fromHalfFloat:qb},xr=new j,gd=new Ge;class Fr{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=e!==void 0?e.length/t:0,this.normalized=n,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("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,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)gd.fromBufferAttribute(this,t),gd.applyMatrix3(e),this.setXY(t,gd.x,gd.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyMatrix3(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyMatrix4(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.applyNormalMatrix(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)xr.fromBufferAttribute(this,t),xr.transformDirection(e),this.setXYZ(t,xr.x,xr.y,xr.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=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Si(t,this.array)),t}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Si(t,this.array)),t}setY(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==IA&&(e.usage=this.usage),e}}class OE extends Fr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class zE extends Fr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Di extends Fr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Xb=0;const ni=new st,GA=new Zt,_l=new j,Hn=new Er,hu=new Er,Or=new j;class Gn extends so{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Xb++}),this.uuid=Ci(),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(xE(e)?zE:OE)(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 this.attributes[e]!==void 0}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;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new gt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ni.makeRotationFromQuaternion(e),this.applyMatrix4(ni),this}rotateX(e){return ni.makeRotationX(e),this.applyMatrix4(ni),this}rotateY(e){return ni.makeRotationY(e),this.applyMatrix4(ni),this}rotateZ(e){return ni.makeRotationZ(e),this.applyMatrix4(ni),this}translate(e,t,n){return ni.makeTranslation(e,t,n),this.applyMatrix4(ni),this}scale(e,t,n){return ni.makeScale(e,t,n),this.applyMatrix4(ni),this}lookAt(e){return GA.lookAt(e),GA.updateMatrix(),this.applyMatrix4(GA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_l).negate(),this.translate(_l.x,_l.y,_l.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Di(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Er);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];Hn.setFromBufferAttribute(s),this.morphTargetsRelative?(Or.addVectors(this.boundingBox.min,Hn.min),this.boundingBox.expandByPoint(Or),Or.addVectors(this.boundingBox.max,Hn.max),this.boundingBox.expandByPoint(Or)):(this.boundingBox.expandByPoint(Hn.min),this.boundingBox.expandByPoint(Hn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Bi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(Hn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const c=t[s];hu.setFromBufferAttribute(c),this.morphTargetsRelative?(Or.addVectors(Hn.min,hu.min),Hn.expandByPoint(Or),Or.addVectors(Hn.max,hu.max),Hn.expandByPoint(Or)):(Hn.expandByPoint(hu.min),Hn.expandByPoint(hu.max))}Hn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Or.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Or));if(t)for(let s=0,o=t.length;s<o;s++){const c=t[s],h=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Or.fromBufferAttribute(c,u),h&&(_l.fromBufferAttribute(e,u),Or.add(_l)),i=Math.max(i,n.distanceToSquared(Or))}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(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Fr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),c=[],h=[];for(let D=0;D<n.count;D++)c[D]=new j,h[D]=new j;const u=new j,d=new j,A=new j,p=new Ge,g=new Ge,v=new Ge,E=new j,m=new j;function _(D,b,S){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,S),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),v.fromBufferAttribute(s,S),d.sub(u),A.sub(u),g.sub(p),v.sub(p);const L=1/(g.x*v.y-v.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(v.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-v.x).multiplyScalar(L),c[D].add(E),c[b].add(E),c[S].add(E),h[D].add(m),h[b].add(m),h[S].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const S=w[D],L=S.start,P=S.count;for(let N=L,W=L+P;N<W;N+=3)_(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new j,I=new j,R=new j,M=new j;function T(D){R.fromBufferAttribute(i,D),M.copy(R);const b=c[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(M,b);const S=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,S)}for(let D=0,b=w.length;D<b;++D){const S=w[D],L=S.start,P=S.count;for(let N=L,W=L+P;N<W;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Fr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new j,s=new j,o=new j,c=new j,h=new j,u=new j,d=new j,A=new j;if(e)for(let p=0,g=e.count;p<g;p+=3){const v=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),c.fromBufferAttribute(n,v),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),c.add(d),h.add(d),u.add(d),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Or.fromBufferAttribute(e,t),Or.normalize(),e.setXYZ(t,Or.x,Or.y,Or.z)}toNonIndexed(){function e(c,h){const u=c.array,d=c.itemSize,A=c.normalized,p=new u.constructor(h.length*d);let g=0,v=0;for(let E=0,m=h.length;E<m;E++){c.isInterleavedBufferAttribute?g=h[E]*c.data.stride+c.offset:g=h[E]*d;for(let _=0;_<d;_++)p[v++]=u[g++]}return new Fr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Gn,n=this.index.array,i=this.attributes;for(const c in i){const h=i[c],u=e(h,n);t.setAttribute(c,u)}const s=this.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,h=o.length;c<h;c++){const u=o[c];t.addGroup(u.start,u.count,u.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),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.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;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const HE=new st,lo=new cu,md=new Bi,GE=new j,vl=new j,yl=new j,El=new j,VA=new j,_d=new j,vd=new Ge,yd=new Ge,Ed=new Ge,VE=new j,jE=new j,WE=new j,xd=new j,wd=new j;class Yr extends Zt{constructor(e=new Gn,t=new xs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(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(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){_d.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=c[h],A=s[h];d!==0&&(VA.fromBufferAttribute(A,e),o?_d.addScaledVector(VA,d):_d.addScaledVector(VA.sub(t),d))}t.add(_d)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),md.copy(n.boundingSphere),md.applyMatrix4(s),lo.copy(e.ray).recast(e.near),!(md.containsPoint(lo.origin)===!1&&(lo.intersectSphere(md,GE)===null||lo.origin.distanceToSquared(GE)>(e.far-e.near)**2))&&(HE.copy(s).invert(),lo.copy(e.ray).applyMatrix4(HE),!(n.boundingBox!==null&&lo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,lo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,c=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(c!==null)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(c.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const M=c.getX(I),T=c.getX(I+1),D=c.getX(I+2);i=Id(this,_,e,n,u,d,A,M,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(c.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=c.getX(m),x=c.getX(m+1),I=c.getX(m+2);i=Id(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let v=0,E=p.length;v<E;v++){const m=p[v],_=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const M=I,T=I+1,D=I+2;i=Id(this,_,e,n,u,d,A,M,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const v=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=v,_=E;m<_;m+=3){const w=m,x=m+1,I=m+2;i=Id(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function Kb(r,e,t,n,i,s,o,c){let h;if(e.side===kr?h=n.intersectTriangle(o,s,i,!0,c):h=n.intersectTriangle(i,s,o,e.side===yi,c),h===null)return null;wd.copy(c),wd.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(wd);return u<t.near||u>t.far?null:{distance:u,point:wd.clone(),object:r}}function Id(r,e,t,n,i,s,o,c,h,u){r.getVertexPosition(c,vl),r.getVertexPosition(h,yl),r.getVertexPosition(u,El);const d=Kb(r,e,t,n,vl,yl,El,xd);if(d){i&&(vd.fromBufferAttribute(i,c),yd.fromBufferAttribute(i,h),Ed.fromBufferAttribute(i,u),d.uv=ln.getInterpolation(xd,vl,yl,El,vd,yd,Ed,new Ge)),s&&(vd.fromBufferAttribute(s,c),yd.fromBufferAttribute(s,h),Ed.fromBufferAttribute(s,u),d.uv1=ln.getInterpolation(xd,vl,yl,El,vd,yd,Ed,new Ge)),o&&(VE.fromBufferAttribute(o,c),jE.fromBufferAttribute(o,h),WE.fromBufferAttribute(o,u),d.normal=ln.getInterpolation(xd,vl,yl,El,VE,jE,WE,new j),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:c,b:h,c:u,normal:new j,materialIndex:0};ln.getNormal(vl,yl,El,A.normal),d.face=A}return d}class du extends Gn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Di(u,3)),this.setAttribute("normal",new Di(d,3)),this.setAttribute("uv",new Di(A,2));function v(E,m,_,w,x,I,R,M,T,D,b){const S=I/T,L=R/D,P=I/2,N=R/2,W=M/2,X=T+1,K=D+1;let te=0,H=0;const ee=new j;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*S-P;ee[E]=re*w,ee[m]=z*x,ee[_]=W,u.push(ee.x,ee.y,ee.z),ee[E]=0,ee[m]=0,ee[_]=M>0?1:-1,d.push(ee.x,ee.y,ee.z),A.push(Z/T),A.push(1-Q/D),te+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),G=p+(z+1)+X*(Q+1),de=p+(z+1)+X*Q;h.push(Z,re,de),h.push(re,G,de),H+=6}c.addGroup(g,H,b),g+=H,p+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new du(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function xl(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function cn(r){const e={};for(let t=0;t<r.length;t++){const n=xl(r[t]);for(const i in n)e[i]=n[i]}return e}function Jb(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function YE(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Rt.workingColorSpace}const Cd={clone:xl,merge:cn};var Zb=`void main() {
|
|
37
37
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
38
38
|
}`,$b=`void main() {
|
|
39
39
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
40
|
-
}`;class En extends qi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Zb,this.fragmentShader=$b,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=
|
|
40
|
+
}`;class En extends qi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Zb,this.fragmentShader=$b,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=xl(e.uniforms),this.uniformsGroups=Jb(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 i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?t.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?t.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?t.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?t.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?t.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?t.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?t.uniforms[i]={type:"m4",value:s.toArray()}:t.uniforms[i]={value:s}}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 i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class qE extends Zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new st,this.projectionMatrix=new st,this.projectionMatrixInverse=new st,this.coordinateSystem=gs}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 aa=new j,XE=new Ge,KE=new Ge;class un extends qE{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(iu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ol*2*Math.atan(Math.tan(iu*.5*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){aa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(aa.x,aa.y).multiplyScalar(-e/aa.z),aa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(aa.x,aa.y).multiplyScalar(-e/aa.z)}getViewSize(e,t){return this.getViewBounds(e,XE,KE),t.subVectors(KE,XE)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(iu*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const h=o.fullWidth,u=o.fullHeight;s+=o.offsetX*i/h,t-=o.offsetY*n/u,i*=o.width/h,n*=o.height/u}const c=this.filmOffset;c!==0&&(s+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const wl=-90,Il=1;class e5 extends Zt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new un(wl,Il,e,t);i.layers=this.layers,this.add(i);const s=new un(wl,Il,e,t);s.layers=this.layers,this.add(s);const o=new un(wl,Il,e,t);o.layers=this.layers,this.add(o);const c=new un(wl,Il,e,t);c.layers=this.layers,this.add(c);const h=new un(wl,Il,e,t);h.layers=this.layers,this.add(h);const u=new un(wl,Il,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,o,c,h]=t;for(const u of t)this.remove(u);if(e===gs)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(e===sd)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,c,h,u,d]=this.children,A=e.getRenderTarget(),p=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const E=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,o),e.setRenderTarget(n,2,i),e.render(t,c),e.setRenderTarget(n,3,i),e.render(t,h),e.setRenderTarget(n,4,i),e.render(t,u),n.texture.generateMipmaps=E,e.setRenderTarget(n,5,i),e.render(t,d),e.setRenderTarget(A,p,g),e.xr.enabled=v,n.texture.needsPMREMUpdate=!0}}class JE extends Tr{constructor(e,t,n,i,s,o,c,h,u,d){e=e!==void 0?e:[],t=t!==void 0?t:no,super(e,t,n,i,s,o,c,h,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class t5 extends Mi{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 JE(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=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:pr}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:`
|
|
41
41
|
|
|
42
42
|
varying vec3 vWorldDirection;
|
|
43
43
|
|
|
@@ -72,7 +72,7 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0
|
|
|
72
72
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
73
73
|
|
|
74
74
|
}
|
|
75
|
-
`},i=new du(5,5,5),s=new En({name:"CubemapFromEquirect",uniforms:
|
|
75
|
+
`},i=new du(5,5,5),s=new En({name:"CubemapFromEquirect",uniforms:xl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kr,blending:ps});s.uniforms.tEquirect.value=t;const o=new Yr(i,s),c=t.minFilter;return t.minFilter===wi&&(t.minFilter=pr),new e5(1,10,this).update(e,o),t.minFilter=c,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const jA=new j,r5=new j,n5=new gt;class Xi{constructor(e=new j(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=jA.subVectors(n,t).cross(r5.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(jA),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}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||n5.getNormalMatrix(e),i=this.coplanarPoint(jA).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const co=new Bi,Sd=new j;class WA{constructor(e=new Xi,t=new Xi,n=new Xi,i=new Xi,s=new Xi,o=new Xi){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(i),c[4].copy(s),c[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=gs){const n=this.planes,i=e.elements,s=i[0],o=i[1],c=i[2],h=i[3],u=i[4],d=i[5],A=i[6],p=i[7],g=i[8],v=i[9],E=i[10],m=i[11],_=i[12],w=i[13],x=i[14],I=i[15];if(n[0].setComponents(h-s,p-u,m-g,I-_).normalize(),n[1].setComponents(h+s,p+u,m+g,I+_).normalize(),n[2].setComponents(h+o,p+d,m+v,I+w).normalize(),n[3].setComponents(h-o,p-d,m-v,I-w).normalize(),n[4].setComponents(h-c,p-A,m-E,I-x).normalize(),t===gs)n[5].setComponents(h+c,p+A,m+E,I+x).normalize();else if(t===sd)n[5].setComponents(c,A,E,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),co.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),co.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(co)}intersectsSprite(e){return co.center.set(0,0,0),co.radius=.7071067811865476,co.applyMatrix4(e.matrixWorld),this.intersectsSphere(co)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].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(Sd.x=i.normal.x>0?e.max.x:e.min.x,Sd.y=i.normal.y>0?e.max.y:e.min.y,Sd.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Sd)<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 ZE(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function i5(r){const e=new WeakMap;function t(c,h){const u=c.array,d=c.usage,A=u.byteLength,p=r.createBuffer();r.bindBuffer(h,p),r.bufferData(h,u,d),c.onUploadCallback();let g;if(u instanceof Float32Array)g=r.FLOAT;else if(u instanceof Uint16Array)c.isFloat16BufferAttribute?g=r.HALF_FLOAT:g=r.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=r.SHORT;else if(u instanceof Uint32Array)g=r.UNSIGNED_INT;else if(u instanceof Int32Array)g=r.INT;else if(u instanceof Int8Array)g=r.BYTE;else if(u instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:c.version,size:A}}function n(c,h,u){const d=h.array,A=h._updateRange,p=h.updateRanges;if(r.bindBuffer(u,c),A.count===-1&&p.length===0&&r.bufferSubData(u,0,d),p.length!==0){for(let g=0,v=p.length;g<v;g++){const E=p[g];r.bufferSubData(u,E.start*d.BYTES_PER_ELEMENT,d,E.start,E.count)}h.clearUpdateRanges()}A.count!==-1&&(r.bufferSubData(u,A.offset*d.BYTES_PER_ELEMENT,d,A.offset,A.count),A.count=-1),h.onUploadCallback()}function i(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=e.get(c);h&&(r.deleteBuffer(h.buffer),e.delete(c))}function o(c,h){if(c.isGLBufferAttribute){const d=e.get(c);(!d||d.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}c.isInterleavedBufferAttribute&&(c=c.data);const u=e.get(c);if(u===void 0)e.set(c,t(c,h));else if(u.version<c.version){if(u.size!==c.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.");n(u.buffer,c,h),u.version=c.version}}return{get:i,remove:s,update:o}}class fu extends Gn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,c=Math.floor(n),h=Math.floor(i),u=c+1,d=h+1,A=e/c,p=t/h,g=[],v=[],E=[],m=[];for(let _=0;_<d;_++){const w=_*p-o;for(let x=0;x<u;x++){const I=x*A-s;v.push(I,-w,0),E.push(0,0,1),m.push(x/c),m.push(1-_/h)}}for(let _=0;_<h;_++)for(let w=0;w<c;w++){const x=w+u*_,I=w+u*(_+1),R=w+1+u*(_+1),M=w+1+u*_;g.push(x,I,M),g.push(I,R,M)}this.setIndex(g),this.setAttribute("position",new Di(v,3)),this.setAttribute("normal",new Di(E,3)),this.setAttribute("uv",new Di(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fu(e.width,e.height,e.widthSegments,e.heightSegments)}}var s5=`#ifdef USE_ALPHAHASH
|
|
76
76
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
77
77
|
#endif`,a5=`#ifdef USE_ALPHAHASH
|
|
78
78
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3574,7 +3574,7 @@ void main() {
|
|
|
3574
3574
|
#include <tonemapping_fragment>
|
|
3575
3575
|
#include <colorspace_fragment>
|
|
3576
3576
|
#include <fog_fragment>
|
|
3577
|
-
}`,mt={alphahash_fragment:s5,alphahash_pars_fragment:a5,alphamap_fragment:o5,alphamap_pars_fragment:l5,alphatest_fragment:c5,alphatest_pars_fragment:u5,aomap_fragment:h5,aomap_pars_fragment:d5,batching_pars_vertex:f5,batching_vertex:p5,begin_vertex:A5,beginnormal_vertex:g5,bsdfs:m5,iridescence_fragment:_5,bumpmap_pars_fragment:v5,clipping_planes_fragment:y5,clipping_planes_pars_fragment:E5,clipping_planes_pars_vertex:x5,clipping_planes_vertex:w5,color_fragment:I5,color_pars_fragment:C5,color_pars_vertex:S5,color_vertex:M5,common:T5,cube_uv_reflection_fragment:B5,defaultnormal_vertex:b5,displacementmap_pars_vertex:R5,displacementmap_vertex:D5,emissivemap_fragment:L5,emissivemap_pars_fragment:N5,colorspace_fragment:U5,colorspace_pars_fragment:P5,envmap_fragment:k5,envmap_common_pars_fragment:Q5,envmap_pars_fragment:F5,envmap_pars_vertex:O5,envmap_physical_pars_fragment:Z5,envmap_vertex:z5,fog_vertex:H5,fog_pars_vertex:G5,fog_fragment:V5,fog_pars_fragment:j5,gradientmap_pars_fragment:W5,lightmap_fragment:Y5,lightmap_pars_fragment:q5,lights_lambert_fragment:X5,lights_lambert_pars_fragment:K5,lights_pars_begin:J5,lights_toon_fragment:$5,lights_toon_pars_fragment:eR,lights_phong_fragment:tR,lights_phong_pars_fragment:rR,lights_physical_fragment:nR,lights_physical_pars_fragment:iR,lights_fragment_begin:sR,lights_fragment_maps:aR,lights_fragment_end:oR,logdepthbuf_fragment:lR,logdepthbuf_pars_fragment:cR,logdepthbuf_pars_vertex:uR,logdepthbuf_vertex:hR,map_fragment:dR,map_pars_fragment:fR,map_particle_fragment:pR,map_particle_pars_fragment:AR,metalnessmap_fragment:gR,metalnessmap_pars_fragment:mR,morphinstance_vertex:_R,morphcolor_vertex:vR,morphnormal_vertex:yR,morphtarget_pars_vertex:ER,morphtarget_vertex:xR,normal_fragment_begin:wR,normal_fragment_maps:IR,normal_pars_fragment:CR,normal_pars_vertex:SR,normal_vertex:MR,normalmap_pars_fragment:TR,clearcoat_normal_fragment_begin:BR,clearcoat_normal_fragment_maps:bR,clearcoat_pars_fragment:RR,iridescence_pars_fragment:DR,opaque_fragment:LR,packing:NR,premultiplied_alpha_fragment:UR,project_vertex:PR,dithering_fragment:kR,dithering_pars_fragment:QR,roughnessmap_fragment:FR,roughnessmap_pars_fragment:OR,shadowmap_pars_fragment:zR,shadowmap_pars_vertex:HR,shadowmap_vertex:GR,shadowmask_pars_fragment:VR,skinbase_vertex:jR,skinning_pars_vertex:WR,skinning_vertex:YR,skinnormal_vertex:qR,specularmap_fragment:XR,specularmap_pars_fragment:KR,tonemapping_fragment:JR,tonemapping_pars_fragment:ZR,transmission_fragment:$R,transmission_pars_fragment:e6,uv_pars_fragment:t6,uv_pars_vertex:r6,uv_vertex:n6,worldpos_vertex:i6,background_vert:s6,background_frag:a6,backgroundCube_vert:o6,backgroundCube_frag:l6,cube_vert:c6,cube_frag:u6,depth_vert:h6,depth_frag:d6,distanceRGBA_vert:f6,distanceRGBA_frag:p6,equirect_vert:A6,equirect_frag:g6,linedashed_vert:m6,linedashed_frag:_6,meshbasic_vert:v6,meshbasic_frag:y6,meshlambert_vert:E6,meshlambert_frag:x6,meshmatcap_vert:w6,meshmatcap_frag:I6,meshnormal_vert:C6,meshnormal_frag:S6,meshphong_vert:M6,meshphong_frag:T6,meshphysical_vert:B6,meshphysical_frag:b6,meshtoon_vert:R6,meshtoon_frag:D6,points_vert:L6,points_frag:N6,shadow_vert:U6,shadow_frag:P6,sprite_vert:k6,sprite_frag:Q6},De={common:{diffuse:{value:new Ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gt}},envmap:{envMap:{value:null},envMapRotation:{value:new gt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gt},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ke(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 Ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0},uvTransform:{value:new gt}},sprite:{diffuse:{value:new Ke(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}}},Ki={basic:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ke(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ke(0)},specular:{value:new Ke(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:cn([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new Ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:cn([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new Ke(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:cn([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:cn([De.points,De.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:cn([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:cn([De.common,De.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:cn([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:cn([De.sprite,De.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new gt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mt.background_vert,fragmentShader:mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gt}},vertexShader:mt.backgroundCube_vert,fragmentShader:mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mt.cube_vert,fragmentShader:mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mt.equirect_vert,fragmentShader:mt.equirect_frag},distanceRGBA:{uniforms:cn([De.common,De.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:cn([De.lights,De.fog,{color:{value:new Ke(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};Ki.physical={uniforms:cn([Ki.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gt},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gt},sheen:{value:0},sheenColor:{value:new Ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gt},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gt},attenuationDistance:{value:0},attenuationColor:{value:new Ke(0)},specularColor:{value:new Ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gt},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gt}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const Sd={r:0,b:0,g:0},uo=new Yi,F6=new st;function O6(r,e,t,n,i,s,o){const c=new Ke(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function v(m,_){let w=!1,x=_.isScene===!0?_.background:null;x&&x.isTexture&&(x=(_.backgroundBlurriness>0?t:e).get(x)),x===null?E(c,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Wh)?(d===void 0&&(d=new Yr(new du(1,1,1),new En({name:"BackgroundCubeMaterial",uniforms:El(Ki.backgroundCube.uniforms),vertexShader:Ki.backgroundCube.vertexShader,fragmentShader:Ki.backgroundCube.fragmentShader,side:kr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,M,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),uo.copy(_.backgroundRotation),uo.x*=-1,uo.y*=-1,uo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(uo.y*=-1,uo.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(F6.makeRotationFromEuler(uo)),d.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Yr(new fu(2,2),new En({name:"BackgroundMaterial",uniforms:El(Ki.background.uniforms),vertexShader:Ki.background.vertexShader,fragmentShader:Ki.background.fragmentShader,side:yi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,_){m.getRGB(Sd,YE(r)),n.buffers.color.setClear(Sd.r,Sd.g,Sd.b,_,o)}return{getClearColor:function(){return c},setClearColor:function(m,_=1){c.set(m),h=_,E(c,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(c,h)},render:v}}function z6(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function c(S,L,P,N,W){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(S,N,P,W),X&&v(S,N,P,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(S,L,P,N),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function h(){return r.createVertexArray()}function u(S){return r.bindVertexArray(S)}function d(S){return r.deleteVertexArray(S)}function A(S,L,P){const N=P.wireframe===!0;let W=n[S.id];W===void 0&&(W={},n[S.id]=W);let X=W[L.id];X===void 0&&(X={},W[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(S){const L=[],P=[],N=[];for(let W=0;W<t;W++)L[W]=0,P[W]=0,N[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:S,attributes:{},index:null}}function g(S,L,P,N){const W=s.attributes,X=L.attributes;let K=0;const te=P.getAttributes();for(const H in te)if(te[H].location>=0){const ee=W[H];let Q=X[H];if(Q===void 0&&(H==="instanceMatrix"&&S.instanceMatrix&&(Q=S.instanceMatrix),H==="instanceColor"&&S.instanceColor&&(Q=S.instanceColor)),ee===void 0||ee.attribute!==Q||Q&&ee.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function v(S,L,P,N){const W={},X=L.attributes;let K=0;const te=P.getAttributes();for(const H in te)if(te[H].location>=0){let ee=X[H];ee===void 0&&(H==="instanceMatrix"&&S.instanceMatrix&&(ee=S.instanceMatrix),H==="instanceColor"&&S.instanceColor&&(ee=S.instanceColor));const Q={};Q.attribute=ee,ee&&ee.data&&(Q.data=ee.data),W[H]=Q,K++}s.attributes=W,s.attributesNum=K,s.index=N}function E(){const S=s.newAttributes;for(let L=0,P=S.length;L<P;L++)S[L]=0}function m(S){_(S,0)}function _(S,L){const P=s.newAttributes,N=s.enabledAttributes,W=s.attributeDivisors;P[S]=1,N[S]===0&&(r.enableVertexAttribArray(S),N[S]=1),W[S]!==L&&(r.vertexAttribDivisor(S,L),W[S]=L)}function w(){const S=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==S[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(S,L,P,N,W,X,K){K===!0?r.vertexAttribIPointer(S,L,P,W,X):r.vertexAttribPointer(S,L,P,N,W,X)}function I(S,L,P,N){E();const W=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const te in X){const H=X[te];if(H.location>=0){let ee=W[te];if(ee===void 0&&(te==="instanceMatrix"&&S.instanceMatrix&&(ee=S.instanceMatrix),te==="instanceColor"&&S.instanceColor&&(ee=S.instanceColor)),ee!==void 0){const Q=ee.normalized,z=ee.itemSize,Z=e.get(ee);if(Z===void 0)continue;const re=Z.buffer,G=Z.type,de=Z.bytesPerElement,pe=G===r.INT||G===r.UNSIGNED_INT||ee.gpuType===Zc;if(ee.isInterleavedBufferAttribute){const fe=ee.data,ye=fe.stride,Pe=ee.offset;if(fe.isInstancedInterleavedBuffer){for(let at=0;at<H.locationSize;at++)_(H.location+at,fe.meshPerAttribute);S.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=fe.meshPerAttribute*fe.count)}else for(let at=0;at<H.locationSize;at++)m(H.location+at);r.bindBuffer(r.ARRAY_BUFFER,re);for(let at=0;at<H.locationSize;at++)x(H.location+at,z/H.locationSize,G,Q,ye*de,(Pe+z/H.locationSize*at)*de,pe)}else{if(ee.isInstancedBufferAttribute){for(let fe=0;fe<H.locationSize;fe++)_(H.location+fe,ee.meshPerAttribute);S.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let fe=0;fe<H.locationSize;fe++)m(H.location+fe);r.bindBuffer(r.ARRAY_BUFFER,re);for(let fe=0;fe<H.locationSize;fe++)x(H.location+fe,z/H.locationSize,G,Q,z*de,z/H.locationSize*fe*de,pe)}}else if(K!==void 0){const Q=K[te];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(H.location,Q);break;case 3:r.vertexAttrib3fv(H.location,Q);break;case 4:r.vertexAttrib4fv(H.location,Q);break;default:r.vertexAttrib1fv(H.location,Q)}}}}w()}function R(){D();for(const S in n){const L=n[S];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[S]}}function M(S){if(n[S.id]===void 0)return;const L=n[S.id];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[S.id]}function T(S){for(const L in n){const P=n[L];if(P[S.id]===void 0)continue;const N=P[S.id];for(const W in N)d(N[W].object),delete N[W];delete P[S.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:c,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:M,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function H6(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function c(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=c}function G6(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const c=s(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),v=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:_,maxSamples:w}}function V6(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Xi,c=new gt,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const v=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,_=r.get(A);if(!i||v===null||v.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=_.clippingState||null;h.value=I,I=d(v,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];_.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,v){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,v!==!0||m===null){const _=g+E*4,w=p.matrixWorldInverse;c.getNormalMatrix(w),(m===null||m.length<_)&&(m=new Float32Array(_));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,c),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function j6(r){let e=new WeakMap;function t(o,c){return c===Kc?o.mapping=no:c===uA&&(o.mapping=rl),o}function n(o){if(o&&o.isTexture){const c=o.mapping;if(c===Kc||c===uA)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new t5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const h=e.get(c);h!==void 0&&(e.delete(c),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class pu extends qE{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){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 s=n-e,o=n+e,c=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,c-=d*this.view.offsetY,h=c-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,h,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Il=4,$E=[.125,.215,.35,.446,.526,.582],ho=20,YA=new pu,e2=new Ke;let qA=null,XA=0,KA=0,JA=!1;const fo=(1+Math.sqrt(5))/2,Cl=1/fo,t2=[new j(1,1,1),new j(-1,1,1),new j(1,1,-1),new j(-1,1,-1),new j(0,fo,Cl),new j(0,fo,-Cl),new j(Cl,0,fo),new j(-Cl,0,fo),new j(fo,Cl,0),new j(-fo,Cl,0)];class r2{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){qA=this._renderer.getRenderTarget(),XA=this._renderer.getActiveCubeFace(),KA=this._renderer.getActiveMipmapLevel(),JA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=s2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=i2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(qA,XA,KA),this._renderer.xr.enabled=JA,e.scissorTest=!1,Md(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===no||e.mapping===rl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),qA=this._renderer.getRenderTarget(),XA=this._renderer.getActiveCubeFace(),KA=this._renderer.getActiveMipmapLevel(),JA=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:pr,minFilter:pr,generateMipmaps:!1,type:yn,format:gr,colorSpace:Sr,depthBuffer:!1},i=n2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=n2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=W6(s)),this._blurMaterial=Y6(s,e,t)}return i}_compileMaterial(e){const t=new Yr(this._lodPlanes[0],e);this._renderer.compile(t,YA)}_sceneToCubeUV(e,t,n,i){const s=new un(90,1,t,n),o=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor(e2),h.toneMapping=Zs,h.autoClear=!1;const A=new xs({name:"PMREM.Background",side:kr,depthWrite:!1,depthTest:!1}),p=new Yr(new du,A);let g=!1;const v=e.background;v?v.isColor&&(A.color.copy(v),e.background=null,g=!0):(A.color.copy(e2),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(c[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,c[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,c[E]));const _=this._cubeSize;Md(i,m*_,E>2?_:0,_,_),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===no||e.mapping===rl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=s2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=i2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Yr(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const h=this._cubeSize;Md(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,YA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=t2[(i-1)%t2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,c){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Yr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*ho-1),E=s/v,m=isFinite(s)?1+Math.floor(d*E):ho;m>ho&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ho}`);const _=[];let w=0;for(let T=0;T<ho;++T){const D=T/E,b=Math.exp(-D*D/2);_.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<_.length;T++)_[T]=_[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=_,p.latitudinal.value=o==="latitudinal",c&&(p.poleAxis.value=c);const{_lodMax:x}=this;p.dTheta.value=v,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-Il?i-x+Il:0),M=4*(this._cubeSize-I);Md(t,R,M,3*I,2*I),h.setRenderTarget(t),h.render(A,YA)}}function W6(r){const e=[],t=[],n=[];let i=r;const s=r-Il+1+$E.length;for(let o=0;o<s;o++){const c=Math.pow(2,i);t.push(c);let h=1/c;o>r-Il?h=$E[o-r+Il-1]:o===0&&(h=0),n.push(h);const u=1/(c-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,v=6,E=3,m=2,_=1,w=new Float32Array(E*v*g),x=new Float32Array(m*v*g),I=new Float32Array(_*v*g);for(let M=0;M<g;M++){const T=M%3*2/3-1,D=M>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*v*M),x.set(p,m*v*M);const S=[M,M,M,M,M,M];I.set(S,_*v*M)}const R=new Gn;R.setAttribute("position",new Fr(w,E)),R.setAttribute("uv",new Fr(x,m)),R.setAttribute("faceIndex",new Fr(I,_)),e.push(R),i>Il&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function n2(r,e,t){const n=new Mi(r,e,t);return n.texture.mapping=Wh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Md(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function Y6(r,e,t){const n=new Float32Array(ho),i=new j(0,1,0);return new En({name:"SphericalGaussianBlur",defines:{n:ho,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ZA(),fragmentShader:`
|
|
3577
|
+
}`,mt={alphahash_fragment:s5,alphahash_pars_fragment:a5,alphamap_fragment:o5,alphamap_pars_fragment:l5,alphatest_fragment:c5,alphatest_pars_fragment:u5,aomap_fragment:h5,aomap_pars_fragment:d5,batching_pars_vertex:f5,batching_vertex:p5,begin_vertex:A5,beginnormal_vertex:g5,bsdfs:m5,iridescence_fragment:_5,bumpmap_pars_fragment:v5,clipping_planes_fragment:y5,clipping_planes_pars_fragment:E5,clipping_planes_pars_vertex:x5,clipping_planes_vertex:w5,color_fragment:I5,color_pars_fragment:C5,color_pars_vertex:S5,color_vertex:M5,common:T5,cube_uv_reflection_fragment:B5,defaultnormal_vertex:b5,displacementmap_pars_vertex:R5,displacementmap_vertex:D5,emissivemap_fragment:L5,emissivemap_pars_fragment:N5,colorspace_fragment:U5,colorspace_pars_fragment:P5,envmap_fragment:k5,envmap_common_pars_fragment:Q5,envmap_pars_fragment:F5,envmap_pars_vertex:O5,envmap_physical_pars_fragment:Z5,envmap_vertex:z5,fog_vertex:H5,fog_pars_vertex:G5,fog_fragment:V5,fog_pars_fragment:j5,gradientmap_pars_fragment:W5,lightmap_fragment:Y5,lightmap_pars_fragment:q5,lights_lambert_fragment:X5,lights_lambert_pars_fragment:K5,lights_pars_begin:J5,lights_toon_fragment:$5,lights_toon_pars_fragment:eR,lights_phong_fragment:tR,lights_phong_pars_fragment:rR,lights_physical_fragment:nR,lights_physical_pars_fragment:iR,lights_fragment_begin:sR,lights_fragment_maps:aR,lights_fragment_end:oR,logdepthbuf_fragment:lR,logdepthbuf_pars_fragment:cR,logdepthbuf_pars_vertex:uR,logdepthbuf_vertex:hR,map_fragment:dR,map_pars_fragment:fR,map_particle_fragment:pR,map_particle_pars_fragment:AR,metalnessmap_fragment:gR,metalnessmap_pars_fragment:mR,morphinstance_vertex:_R,morphcolor_vertex:vR,morphnormal_vertex:yR,morphtarget_pars_vertex:ER,morphtarget_vertex:xR,normal_fragment_begin:wR,normal_fragment_maps:IR,normal_pars_fragment:CR,normal_pars_vertex:SR,normal_vertex:MR,normalmap_pars_fragment:TR,clearcoat_normal_fragment_begin:BR,clearcoat_normal_fragment_maps:bR,clearcoat_pars_fragment:RR,iridescence_pars_fragment:DR,opaque_fragment:LR,packing:NR,premultiplied_alpha_fragment:UR,project_vertex:PR,dithering_fragment:kR,dithering_pars_fragment:QR,roughnessmap_fragment:FR,roughnessmap_pars_fragment:OR,shadowmap_pars_fragment:zR,shadowmap_pars_vertex:HR,shadowmap_vertex:GR,shadowmask_pars_fragment:VR,skinbase_vertex:jR,skinning_pars_vertex:WR,skinning_vertex:YR,skinnormal_vertex:qR,specularmap_fragment:XR,specularmap_pars_fragment:KR,tonemapping_fragment:JR,tonemapping_pars_fragment:ZR,transmission_fragment:$R,transmission_pars_fragment:e6,uv_pars_fragment:t6,uv_pars_vertex:r6,uv_vertex:n6,worldpos_vertex:i6,background_vert:s6,background_frag:a6,backgroundCube_vert:o6,backgroundCube_frag:l6,cube_vert:c6,cube_frag:u6,depth_vert:h6,depth_frag:d6,distanceRGBA_vert:f6,distanceRGBA_frag:p6,equirect_vert:A6,equirect_frag:g6,linedashed_vert:m6,linedashed_frag:_6,meshbasic_vert:v6,meshbasic_frag:y6,meshlambert_vert:E6,meshlambert_frag:x6,meshmatcap_vert:w6,meshmatcap_frag:I6,meshnormal_vert:C6,meshnormal_frag:S6,meshphong_vert:M6,meshphong_frag:T6,meshphysical_vert:B6,meshphysical_frag:b6,meshtoon_vert:R6,meshtoon_frag:D6,points_vert:L6,points_frag:N6,shadow_vert:U6,shadow_frag:P6,sprite_vert:k6,sprite_frag:Q6},De={common:{diffuse:{value:new Ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gt}},envmap:{envMap:{value:null},envMapRotation:{value:new gt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gt},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ke(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 Ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0},uvTransform:{value:new gt}},sprite:{diffuse:{value:new Ke(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}}},Ki={basic:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ke(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:cn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new Ke(0)},specular:{value:new Ke(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:cn([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new Ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:cn([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new Ke(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:cn([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:cn([De.points,De.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:cn([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:cn([De.common,De.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:cn([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:cn([De.sprite,De.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new gt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mt.background_vert,fragmentShader:mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gt}},vertexShader:mt.backgroundCube_vert,fragmentShader:mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mt.cube_vert,fragmentShader:mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mt.equirect_vert,fragmentShader:mt.equirect_frag},distanceRGBA:{uniforms:cn([De.common,De.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:cn([De.lights,De.fog,{color:{value:new Ke(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};Ki.physical={uniforms:cn([Ki.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gt},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gt},sheen:{value:0},sheenColor:{value:new Ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gt},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gt},attenuationDistance:{value:0},attenuationColor:{value:new Ke(0)},specularColor:{value:new Ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gt},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gt}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const Md={r:0,b:0,g:0},uo=new Yi,F6=new st;function O6(r,e,t,n,i,s,o){const c=new Ke(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function v(m,_){let w=!1,x=_.isScene===!0?_.background:null;x&&x.isTexture&&(x=(_.backgroundBlurriness>0?t:e).get(x)),x===null?E(c,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Yh)?(d===void 0&&(d=new Yr(new du(1,1,1),new En({name:"BackgroundCubeMaterial",uniforms:xl(Ki.backgroundCube.uniforms),vertexShader:Ki.backgroundCube.vertexShader,fragmentShader:Ki.backgroundCube.fragmentShader,side:kr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,M,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),uo.copy(_.backgroundRotation),uo.x*=-1,uo.y*=-1,uo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(uo.y*=-1,uo.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(F6.makeRotationFromEuler(uo)),d.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Yr(new fu(2,2),new En({name:"BackgroundMaterial",uniforms:xl(Ki.background.uniforms),vertexShader:Ki.background.vertexShader,fragmentShader:Ki.background.fragmentShader,side:yi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.toneMapped=Rt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,_){m.getRGB(Md,YE(r)),n.buffers.color.setClear(Md.r,Md.g,Md.b,_,o)}return{getClearColor:function(){return c},setClearColor:function(m,_=1){c.set(m),h=_,E(c,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(c,h)},render:v}}function z6(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function c(S,L,P,N,W){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(S,N,P,W),X&&v(S,N,P,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(S,L,P,N),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function h(){return r.createVertexArray()}function u(S){return r.bindVertexArray(S)}function d(S){return r.deleteVertexArray(S)}function A(S,L,P){const N=P.wireframe===!0;let W=n[S.id];W===void 0&&(W={},n[S.id]=W);let X=W[L.id];X===void 0&&(X={},W[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(S){const L=[],P=[],N=[];for(let W=0;W<t;W++)L[W]=0,P[W]=0,N[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:S,attributes:{},index:null}}function g(S,L,P,N){const W=s.attributes,X=L.attributes;let K=0;const te=P.getAttributes();for(const H in te)if(te[H].location>=0){const ee=W[H];let Q=X[H];if(Q===void 0&&(H==="instanceMatrix"&&S.instanceMatrix&&(Q=S.instanceMatrix),H==="instanceColor"&&S.instanceColor&&(Q=S.instanceColor)),ee===void 0||ee.attribute!==Q||Q&&ee.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function v(S,L,P,N){const W={},X=L.attributes;let K=0;const te=P.getAttributes();for(const H in te)if(te[H].location>=0){let ee=X[H];ee===void 0&&(H==="instanceMatrix"&&S.instanceMatrix&&(ee=S.instanceMatrix),H==="instanceColor"&&S.instanceColor&&(ee=S.instanceColor));const Q={};Q.attribute=ee,ee&&ee.data&&(Q.data=ee.data),W[H]=Q,K++}s.attributes=W,s.attributesNum=K,s.index=N}function E(){const S=s.newAttributes;for(let L=0,P=S.length;L<P;L++)S[L]=0}function m(S){_(S,0)}function _(S,L){const P=s.newAttributes,N=s.enabledAttributes,W=s.attributeDivisors;P[S]=1,N[S]===0&&(r.enableVertexAttribArray(S),N[S]=1),W[S]!==L&&(r.vertexAttribDivisor(S,L),W[S]=L)}function w(){const S=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==S[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(S,L,P,N,W,X,K){K===!0?r.vertexAttribIPointer(S,L,P,W,X):r.vertexAttribPointer(S,L,P,N,W,X)}function I(S,L,P,N){E();const W=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const te in X){const H=X[te];if(H.location>=0){let ee=W[te];if(ee===void 0&&(te==="instanceMatrix"&&S.instanceMatrix&&(ee=S.instanceMatrix),te==="instanceColor"&&S.instanceColor&&(ee=S.instanceColor)),ee!==void 0){const Q=ee.normalized,z=ee.itemSize,Z=e.get(ee);if(Z===void 0)continue;const re=Z.buffer,G=Z.type,de=Z.bytesPerElement,pe=G===r.INT||G===r.UNSIGNED_INT||ee.gpuType===Zc;if(ee.isInterleavedBufferAttribute){const fe=ee.data,ye=fe.stride,Pe=ee.offset;if(fe.isInstancedInterleavedBuffer){for(let at=0;at<H.locationSize;at++)_(H.location+at,fe.meshPerAttribute);S.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=fe.meshPerAttribute*fe.count)}else for(let at=0;at<H.locationSize;at++)m(H.location+at);r.bindBuffer(r.ARRAY_BUFFER,re);for(let at=0;at<H.locationSize;at++)x(H.location+at,z/H.locationSize,G,Q,ye*de,(Pe+z/H.locationSize*at)*de,pe)}else{if(ee.isInstancedBufferAttribute){for(let fe=0;fe<H.locationSize;fe++)_(H.location+fe,ee.meshPerAttribute);S.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let fe=0;fe<H.locationSize;fe++)m(H.location+fe);r.bindBuffer(r.ARRAY_BUFFER,re);for(let fe=0;fe<H.locationSize;fe++)x(H.location+fe,z/H.locationSize,G,Q,z*de,z/H.locationSize*fe*de,pe)}}else if(K!==void 0){const Q=K[te];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(H.location,Q);break;case 3:r.vertexAttrib3fv(H.location,Q);break;case 4:r.vertexAttrib4fv(H.location,Q);break;default:r.vertexAttrib1fv(H.location,Q)}}}}w()}function R(){D();for(const S in n){const L=n[S];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[S]}}function M(S){if(n[S.id]===void 0)return;const L=n[S.id];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[S.id]}function T(S){for(const L in n){const P=n[L];if(P[S.id]===void 0)continue;const N=P[S.id];for(const W in N)d(N[W].object),delete N[W];delete P[S.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:c,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:M,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function H6(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function c(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=c}function G6(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const c=s(o);c!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",c,"instead."),o=c);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),v=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),_=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:_,maxSamples:w}}function V6(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Xi,c=new gt,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const v=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,_=r.get(A);if(!i||v===null||v.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=_.clippingState||null;h.value=I,I=d(v,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];_.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,v){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,v!==!0||m===null){const _=g+E*4,w=p.matrixWorldInverse;c.getNormalMatrix(w),(m===null||m.length<_)&&(m=new Float32Array(_));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,c),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function j6(r){let e=new WeakMap;function t(o,c){return c===Kc?o.mapping=no:c===uA&&(o.mapping=nl),o}function n(o){if(o&&o.isTexture){const c=o.mapping;if(c===Kc||c===uA)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new t5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const h=e.get(c);h!==void 0&&(e.delete(c),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class pu extends qE{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){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 s=n-e,o=n+e,c=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,c-=d*this.view.offsetY,h=c-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,h,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Cl=4,$E=[.125,.215,.35,.446,.526,.582],ho=20,YA=new pu,e2=new Ke;let qA=null,XA=0,KA=0,JA=!1;const fo=(1+Math.sqrt(5))/2,Sl=1/fo,t2=[new j(1,1,1),new j(-1,1,1),new j(1,1,-1),new j(-1,1,-1),new j(0,fo,Sl),new j(0,fo,-Sl),new j(Sl,0,fo),new j(-Sl,0,fo),new j(fo,Sl,0),new j(-fo,Sl,0)];class r2{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){qA=this._renderer.getRenderTarget(),XA=this._renderer.getActiveCubeFace(),KA=this._renderer.getActiveMipmapLevel(),JA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=s2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=i2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(qA,XA,KA),this._renderer.xr.enabled=JA,e.scissorTest=!1,Td(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===no||e.mapping===nl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),qA=this._renderer.getRenderTarget(),XA=this._renderer.getActiveCubeFace(),KA=this._renderer.getActiveMipmapLevel(),JA=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:pr,minFilter:pr,generateMipmaps:!1,type:yn,format:gr,colorSpace:Sr,depthBuffer:!1},i=n2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=n2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=W6(s)),this._blurMaterial=Y6(s,e,t)}return i}_compileMaterial(e){const t=new Yr(this._lodPlanes[0],e);this._renderer.compile(t,YA)}_sceneToCubeUV(e,t,n,i){const s=new un(90,1,t,n),o=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor(e2),h.toneMapping=Zs,h.autoClear=!1;const A=new xs({name:"PMREM.Background",side:kr,depthWrite:!1,depthTest:!1}),p=new Yr(new du,A);let g=!1;const v=e.background;v?v.isColor&&(A.color.copy(v),e.background=null,g=!0):(A.color.copy(e2),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(c[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,c[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,c[E]));const _=this._cubeSize;Td(i,m*_,E>2?_:0,_,_),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===no||e.mapping===nl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=s2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=i2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Yr(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const h=this._cubeSize;Td(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,YA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=t2[(i-1)%t2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,c){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Yr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,v=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*ho-1),E=s/v,m=isFinite(s)?1+Math.floor(d*E):ho;m>ho&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ho}`);const _=[];let w=0;for(let T=0;T<ho;++T){const D=T/E,b=Math.exp(-D*D/2);_.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<_.length;T++)_[T]=_[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=_,p.latitudinal.value=o==="latitudinal",c&&(p.poleAxis.value=c);const{_lodMax:x}=this;p.dTheta.value=v,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-Cl?i-x+Cl:0),M=4*(this._cubeSize-I);Td(t,R,M,3*I,2*I),h.setRenderTarget(t),h.render(A,YA)}}function W6(r){const e=[],t=[],n=[];let i=r;const s=r-Cl+1+$E.length;for(let o=0;o<s;o++){const c=Math.pow(2,i);t.push(c);let h=1/c;o>r-Cl?h=$E[o-r+Cl-1]:o===0&&(h=0),n.push(h);const u=1/(c-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,v=6,E=3,m=2,_=1,w=new Float32Array(E*v*g),x=new Float32Array(m*v*g),I=new Float32Array(_*v*g);for(let M=0;M<g;M++){const T=M%3*2/3-1,D=M>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*v*M),x.set(p,m*v*M);const S=[M,M,M,M,M,M];I.set(S,_*v*M)}const R=new Gn;R.setAttribute("position",new Fr(w,E)),R.setAttribute("uv",new Fr(x,m)),R.setAttribute("faceIndex",new Fr(I,_)),e.push(R),i>Cl&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function n2(r,e,t){const n=new Mi(r,e,t);return n.texture.mapping=Yh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Td(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function Y6(r,e,t){const n=new Float32Array(ho),i=new j(0,1,0);return new En({name:"SphericalGaussianBlur",defines:{n:ho,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ZA(),fragmentShader:`
|
|
3578
3578
|
|
|
3579
3579
|
precision mediump float;
|
|
3580
3580
|
precision mediump int;
|
|
@@ -3724,9 +3724,9 @@ void main() {
|
|
|
3724
3724
|
gl_Position = vec4( position, 1.0 );
|
|
3725
3725
|
|
|
3726
3726
|
}
|
|
3727
|
-
`}function q6(r){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const h=c.mapping,u=h===Kc||h===uA,d=h===no||h===rl;if(u||d){let A=e.get(c);const p=A!==void 0?A.texture.pmremVersion:0;if(c.isRenderTargetTexture&&c.pmremVersion!==p)return t===null&&(t=new r2(r)),A=u?t.fromEquirectangular(c,A):t.fromCubemap(c,A),A.texture.pmremVersion=c.pmremVersion,e.set(c,A),A.texture;if(A!==void 0)return A.texture;{const g=c.image;return u&&g&&g.height>0||d&&g&&i(g)?(t===null&&(t=new r2(r)),A=u?t.fromEquirectangular(c):t.fromCubemap(c),A.texture.pmremVersion=c.pmremVersion,e.set(c,A),c.addEventListener("dispose",s),A.texture):null}}}return c}function i(c){let h=0;const u=6;for(let d=0;d<u;d++)c[d]!==void 0&&h++;return h===u}function s(c){const h=c.target;h.removeEventListener("dispose",s);const u=e.get(h);u!==void 0&&(e.delete(h),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function X6(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function K6(r,e,t,n){const i={},s=new WeakMap;function o(A){const p=A.target;p.index!==null&&e.remove(p.index);for(const v in p.attributes)e.remove(p.attributes[v]);for(const v in p.morphAttributes){const E=p.morphAttributes[v];for(let m=0,_=E.length;m<_;m++)e.remove(E[m])}p.removeEventListener("dispose",o),delete i[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),n.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function c(A,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function h(A){const p=A.attributes;for(const v in p)e.update(p[v],r.ARRAY_BUFFER);const g=A.morphAttributes;for(const v in g){const E=g[v];for(let m=0,_=E.length;m<_;m++)e.update(E[m],r.ARRAY_BUFFER)}}function u(A){const p=[],g=A.index,v=A.attributes.position;let E=0;if(g!==null){const w=g.array;E=g.version;for(let x=0,I=w.length;x<I;x+=3){const R=w[x+0],M=w[x+1],T=w[x+2];p.push(R,M,M,T,T,R)}}else if(v!==void 0){const w=v.array;E=v.version;for(let x=0,I=w.length/3-1;x<I;x+=3){const R=x+0,M=x+1,T=x+2;p.push(R,M,M,T,T,R)}}else return;const m=new(xE(p)?zE:OE)(p,1);m.version=E;const _=s.get(A);_&&e.remove(_),s.set(A,m)}function d(A){const p=s.get(A);if(p){const g=A.index;g!==null&&p.version<g.version&&u(A)}else u(A);return s.get(A)}return{get:c,update:h,getWireframeAttribute:d}}function J6(r,e,t){let n;function i(A){n=A}let s,o;function c(A){s=A.type,o=A.bytesPerElement}function h(A,p){r.drawElements(n,p,s,A*o),t.update(p,n,1)}function u(A,p,g){g!==0&&(r.drawElementsInstanced(n,p,s,A*o,g),t.update(p,n,g))}function d(A,p,g){if(g===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let E=0;E<g;E++)this.render(A[E]/o,p[E]);else{v.multiDrawElementsWEBGL(n,p,0,s,A,0,g);let E=0;for(let m=0;m<g;m++)E+=p[m];t.update(E,n,1)}}this.setMode=i,this.setIndex=c,this.render=h,this.renderInstances=u,this.renderMultiDraw=d}function Z6(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,c){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=c*(s/3);break;case r.LINES:t.lines+=c*(s/2);break;case r.LINE_STRIP:t.lines+=c*(s-1);break;case r.LINE_LOOP:t.lines+=c*s;break;case r.POINTS:t.points+=c*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function $6(r,e,t){const n=new WeakMap,i=new Ot;function s(o,c,h){const u=o.morphTargetInfluences,d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,A=d!==void 0?d.length:0;let p=n.get(c);if(p===void 0||p.count!==A){let g=function(){D.dispose(),n.delete(c),c.removeEventListener("dispose",g)};p!==void 0&&p.texture.dispose();const v=c.morphAttributes.position!==void 0,E=c.morphAttributes.normal!==void 0,m=c.morphAttributes.color!==void 0,_=c.morphAttributes.position||[],w=c.morphAttributes.normal||[],x=c.morphAttributes.color||[];let I=0;v===!0&&(I=1),E===!0&&(I=2),m===!0&&(I=3);let R=c.attributes.position.count*I,M=1;R>e.maxTextureSize&&(M=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const T=new Float32Array(R*M*4*A),D=new TE(T,R,M,A);D.type=lr,D.needsUpdate=!0;const b=I*4;for(let S=0;S<A;S++){const L=_[S],P=w[S],N=x[S],W=R*M*4*S;for(let X=0;X<L.count;X++){const K=X*b;v===!0&&(i.fromBufferAttribute(L,X),T[W+K+0]=i.x,T[W+K+1]=i.y,T[W+K+2]=i.z,T[W+K+3]=0),E===!0&&(i.fromBufferAttribute(P,X),T[W+K+4]=i.x,T[W+K+5]=i.y,T[W+K+6]=i.z,T[W+K+7]=0),m===!0&&(i.fromBufferAttribute(N,X),T[W+K+8]=i.x,T[W+K+9]=i.y,T[W+K+10]=i.z,T[W+K+11]=N.itemSize===4?i.w:1)}}p={count:A,texture:D,size:new Ge(R,M)},n.set(c,p),c.addEventListener("dispose",g)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",o.morphTexture,t);else{let g=0;for(let E=0;E<u.length;E++)g+=u[E];const v=c.morphTargetsRelative?1:1-g;h.getUniforms().setValue(r,"morphTargetBaseInfluence",v),h.getUniforms().setValue(r,"morphTargetInfluences",u)}h.getUniforms().setValue(r,"morphTargetsTexture",p.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",p.size)}return{update:s}}function eD(r,e,t,n){let i=new WeakMap;function s(h){const u=n.render.frame,d=h.geometry,A=e.get(h,d);if(i.get(A)!==u&&(e.update(A),i.set(A,u)),h.isInstancedMesh&&(h.hasEventListener("dispose",c)===!1&&h.addEventListener("dispose",c),i.get(h)!==u&&(t.update(h.instanceMatrix,r.ARRAY_BUFFER),h.instanceColor!==null&&t.update(h.instanceColor,r.ARRAY_BUFFER),i.set(h,u))),h.isSkinnedMesh){const p=h.skeleton;i.get(p)!==u&&(p.update(),i.set(p,u))}return A}function o(){i=new WeakMap}function c(h){const u=h.target;u.removeEventListener("dispose",c),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}class a2 extends Tr{constructor(e,t,n,i,s,o,c,h,u,d){if(d=d!==void 0?d:nl,d!==nl&&d!==eu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===nl&&(n=Ii),n===void 0&&d===eu&&(n=$c),super(null,i,s,o,c,h,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=c!==void 0?c:fr,this.minFilter=h!==void 0?h:fr,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 this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const o2=new Tr,l2=new a2(1,1);l2.compareFunction=vE;const c2=new TE,u2=new BE,h2=new JE,d2=[],f2=[],p2=new Float32Array(16),A2=new Float32Array(9),g2=new Float32Array(4);function Sl(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=d2[i];if(s===void 0&&(s=new Float32Array(i),d2[i]=s),e!==0){n.toArray(s,0);for(let o=1,c=0;o!==e;++o)c+=t,r[o].toArray(s,c)}return s}function Br(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function br(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Td(r,e){let t=f2[e];t===void 0&&(t=new Int32Array(e),f2[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function tD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function rD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2fv(this.addr,e),br(t,e)}}function nD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Br(t,e))return;r.uniform3fv(this.addr,e),br(t,e)}}function iD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4fv(this.addr,e),br(t,e)}}function sD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;g2.set(n),r.uniformMatrix2fv(this.addr,!1,g2),br(t,n)}}function aD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;A2.set(n),r.uniformMatrix3fv(this.addr,!1,A2),br(t,n)}}function oD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;p2.set(n),r.uniformMatrix4fv(this.addr,!1,p2),br(t,n)}}function lD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function cD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2iv(this.addr,e),br(t,e)}}function uD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Br(t,e))return;r.uniform3iv(this.addr,e),br(t,e)}}function hD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4iv(this.addr,e),br(t,e)}}function dD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function fD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2uiv(this.addr,e),br(t,e)}}function pD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Br(t,e))return;r.uniform3uiv(this.addr,e),br(t,e)}}function AD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4uiv(this.addr,e),br(t,e)}}function gD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);const s=this.type===r.SAMPLER_2D_SHADOW?l2:o2;t.setTexture2D(e||s,i)}function mD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||u2,i)}function _D(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||h2,i)}function vD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||c2,i)}function yD(r){switch(r){case 5126:return tD;case 35664:return rD;case 35665:return nD;case 35666:return iD;case 35674:return sD;case 35675:return aD;case 35676:return oD;case 5124:case 35670:return lD;case 35667:case 35671:return cD;case 35668:case 35672:return uD;case 35669:case 35673:return hD;case 5125:return dD;case 36294:return fD;case 36295:return pD;case 36296:return AD;case 35678:case 36198:case 36298:case 36306:case 35682:return gD;case 35679:case 36299:case 36307:return mD;case 35680:case 36300:case 36308:case 36293:return _D;case 36289:case 36303:case 36311:case 36292:return vD}}function ED(r,e){r.uniform1fv(this.addr,e)}function xD(r,e){const t=Sl(e,this.size,2);r.uniform2fv(this.addr,t)}function wD(r,e){const t=Sl(e,this.size,3);r.uniform3fv(this.addr,t)}function ID(r,e){const t=Sl(e,this.size,4);r.uniform4fv(this.addr,t)}function CD(r,e){const t=Sl(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function SD(r,e){const t=Sl(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function MD(r,e){const t=Sl(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function TD(r,e){r.uniform1iv(this.addr,e)}function BD(r,e){r.uniform2iv(this.addr,e)}function bD(r,e){r.uniform3iv(this.addr,e)}function RD(r,e){r.uniform4iv(this.addr,e)}function DD(r,e){r.uniform1uiv(this.addr,e)}function LD(r,e){r.uniform2uiv(this.addr,e)}function ND(r,e){r.uniform3uiv(this.addr,e)}function UD(r,e){r.uniform4uiv(this.addr,e)}function PD(r,e,t){const n=this.cache,i=e.length,s=Td(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||o2,s[o])}function kD(r,e,t){const n=this.cache,i=e.length,s=Td(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||u2,s[o])}function QD(r,e,t){const n=this.cache,i=e.length,s=Td(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||h2,s[o])}function FD(r,e,t){const n=this.cache,i=e.length,s=Td(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||c2,s[o])}function OD(r){switch(r){case 5126:return ED;case 35664:return xD;case 35665:return wD;case 35666:return ID;case 35674:return CD;case 35675:return SD;case 35676:return MD;case 5124:case 35670:return TD;case 35667:case 35671:return BD;case 35668:case 35672:return bD;case 35669:case 35673:return RD;case 5125:return DD;case 36294:return LD;case 36295:return ND;case 36296:return UD;case 35678:case 36198:case 36298:case 36306:case 35682:return PD;case 35679:case 36299:case 36307:return kD;case 35680:case 36300:case 36308:case 36293:return QD;case 36289:case 36303:case 36311:case 36292:return FD}}class zD{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=yD(t.type)}}class HD{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=OD(t.type)}}class GD{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const c=i[s];c.setValue(e,t[c.id],n)}}}const $A=/(\w+)(\])?(\[|\.)?/g;function m2(r,e){r.seq.push(e),r.map[e.id]=e}function VD(r,e,t){const n=r.name,i=n.length;for($A.lastIndex=0;;){const s=$A.exec(n),o=$A.lastIndex;let c=s[1];const h=s[2]==="]",u=s[3];if(h&&(c=c|0),u===void 0||u==="["&&o+2===i){m2(t,u===void 0?new zD(c,r,e):new HD(c,r,e));break}else{let d=t.map[c];d===void 0&&(d=new GD(c),m2(t,d)),t=d}}}class Bd{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);VD(s,o,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,o=t.length;s!==o;++s){const c=t[s],h=n[c.id];h.needsUpdate!==!1&&c.setValue(e,h.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&n.push(o)}return n}}function _2(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const jD=37297;let WD=0;function YD(r,e){const t=r.split(`
|
|
3727
|
+
`}function q6(r){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const h=c.mapping,u=h===Kc||h===uA,d=h===no||h===nl;if(u||d){let A=e.get(c);const p=A!==void 0?A.texture.pmremVersion:0;if(c.isRenderTargetTexture&&c.pmremVersion!==p)return t===null&&(t=new r2(r)),A=u?t.fromEquirectangular(c,A):t.fromCubemap(c,A),A.texture.pmremVersion=c.pmremVersion,e.set(c,A),A.texture;if(A!==void 0)return A.texture;{const g=c.image;return u&&g&&g.height>0||d&&g&&i(g)?(t===null&&(t=new r2(r)),A=u?t.fromEquirectangular(c):t.fromCubemap(c),A.texture.pmremVersion=c.pmremVersion,e.set(c,A),c.addEventListener("dispose",s),A.texture):null}}}return c}function i(c){let h=0;const u=6;for(let d=0;d<u;d++)c[d]!==void 0&&h++;return h===u}function s(c){const h=c.target;h.removeEventListener("dispose",s);const u=e.get(h);u!==void 0&&(e.delete(h),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function X6(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function K6(r,e,t,n){const i={},s=new WeakMap;function o(A){const p=A.target;p.index!==null&&e.remove(p.index);for(const v in p.attributes)e.remove(p.attributes[v]);for(const v in p.morphAttributes){const E=p.morphAttributes[v];for(let m=0,_=E.length;m<_;m++)e.remove(E[m])}p.removeEventListener("dispose",o),delete i[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),n.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function c(A,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function h(A){const p=A.attributes;for(const v in p)e.update(p[v],r.ARRAY_BUFFER);const g=A.morphAttributes;for(const v in g){const E=g[v];for(let m=0,_=E.length;m<_;m++)e.update(E[m],r.ARRAY_BUFFER)}}function u(A){const p=[],g=A.index,v=A.attributes.position;let E=0;if(g!==null){const w=g.array;E=g.version;for(let x=0,I=w.length;x<I;x+=3){const R=w[x+0],M=w[x+1],T=w[x+2];p.push(R,M,M,T,T,R)}}else if(v!==void 0){const w=v.array;E=v.version;for(let x=0,I=w.length/3-1;x<I;x+=3){const R=x+0,M=x+1,T=x+2;p.push(R,M,M,T,T,R)}}else return;const m=new(xE(p)?zE:OE)(p,1);m.version=E;const _=s.get(A);_&&e.remove(_),s.set(A,m)}function d(A){const p=s.get(A);if(p){const g=A.index;g!==null&&p.version<g.version&&u(A)}else u(A);return s.get(A)}return{get:c,update:h,getWireframeAttribute:d}}function J6(r,e,t){let n;function i(A){n=A}let s,o;function c(A){s=A.type,o=A.bytesPerElement}function h(A,p){r.drawElements(n,p,s,A*o),t.update(p,n,1)}function u(A,p,g){g!==0&&(r.drawElementsInstanced(n,p,s,A*o,g),t.update(p,n,g))}function d(A,p,g){if(g===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let E=0;E<g;E++)this.render(A[E]/o,p[E]);else{v.multiDrawElementsWEBGL(n,p,0,s,A,0,g);let E=0;for(let m=0;m<g;m++)E+=p[m];t.update(E,n,1)}}this.setMode=i,this.setIndex=c,this.render=h,this.renderInstances=u,this.renderMultiDraw=d}function Z6(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,c){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=c*(s/3);break;case r.LINES:t.lines+=c*(s/2);break;case r.LINE_STRIP:t.lines+=c*(s-1);break;case r.LINE_LOOP:t.lines+=c*s;break;case r.POINTS:t.points+=c*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function $6(r,e,t){const n=new WeakMap,i=new Ot;function s(o,c,h){const u=o.morphTargetInfluences,d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,A=d!==void 0?d.length:0;let p=n.get(c);if(p===void 0||p.count!==A){let g=function(){D.dispose(),n.delete(c),c.removeEventListener("dispose",g)};p!==void 0&&p.texture.dispose();const v=c.morphAttributes.position!==void 0,E=c.morphAttributes.normal!==void 0,m=c.morphAttributes.color!==void 0,_=c.morphAttributes.position||[],w=c.morphAttributes.normal||[],x=c.morphAttributes.color||[];let I=0;v===!0&&(I=1),E===!0&&(I=2),m===!0&&(I=3);let R=c.attributes.position.count*I,M=1;R>e.maxTextureSize&&(M=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const T=new Float32Array(R*M*4*A),D=new TE(T,R,M,A);D.type=lr,D.needsUpdate=!0;const b=I*4;for(let S=0;S<A;S++){const L=_[S],P=w[S],N=x[S],W=R*M*4*S;for(let X=0;X<L.count;X++){const K=X*b;v===!0&&(i.fromBufferAttribute(L,X),T[W+K+0]=i.x,T[W+K+1]=i.y,T[W+K+2]=i.z,T[W+K+3]=0),E===!0&&(i.fromBufferAttribute(P,X),T[W+K+4]=i.x,T[W+K+5]=i.y,T[W+K+6]=i.z,T[W+K+7]=0),m===!0&&(i.fromBufferAttribute(N,X),T[W+K+8]=i.x,T[W+K+9]=i.y,T[W+K+10]=i.z,T[W+K+11]=N.itemSize===4?i.w:1)}}p={count:A,texture:D,size:new Ge(R,M)},n.set(c,p),c.addEventListener("dispose",g)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",o.morphTexture,t);else{let g=0;for(let E=0;E<u.length;E++)g+=u[E];const v=c.morphTargetsRelative?1:1-g;h.getUniforms().setValue(r,"morphTargetBaseInfluence",v),h.getUniforms().setValue(r,"morphTargetInfluences",u)}h.getUniforms().setValue(r,"morphTargetsTexture",p.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",p.size)}return{update:s}}function eD(r,e,t,n){let i=new WeakMap;function s(h){const u=n.render.frame,d=h.geometry,A=e.get(h,d);if(i.get(A)!==u&&(e.update(A),i.set(A,u)),h.isInstancedMesh&&(h.hasEventListener("dispose",c)===!1&&h.addEventListener("dispose",c),i.get(h)!==u&&(t.update(h.instanceMatrix,r.ARRAY_BUFFER),h.instanceColor!==null&&t.update(h.instanceColor,r.ARRAY_BUFFER),i.set(h,u))),h.isSkinnedMesh){const p=h.skeleton;i.get(p)!==u&&(p.update(),i.set(p,u))}return A}function o(){i=new WeakMap}function c(h){const u=h.target;u.removeEventListener("dispose",c),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}class a2 extends Tr{constructor(e,t,n,i,s,o,c,h,u,d){if(d=d!==void 0?d:il,d!==il&&d!==eu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===il&&(n=Ii),n===void 0&&d===eu&&(n=$c),super(null,i,s,o,c,h,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=c!==void 0?c:fr,this.minFilter=h!==void 0?h:fr,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 this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const o2=new Tr,l2=new a2(1,1);l2.compareFunction=vE;const c2=new TE,u2=new BE,h2=new JE,d2=[],f2=[],p2=new Float32Array(16),A2=new Float32Array(9),g2=new Float32Array(4);function Ml(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=d2[i];if(s===void 0&&(s=new Float32Array(i),d2[i]=s),e!==0){n.toArray(s,0);for(let o=1,c=0;o!==e;++o)c+=t,r[o].toArray(s,c)}return s}function Br(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function br(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Bd(r,e){let t=f2[e];t===void 0&&(t=new Int32Array(e),f2[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function tD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function rD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2fv(this.addr,e),br(t,e)}}function nD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Br(t,e))return;r.uniform3fv(this.addr,e),br(t,e)}}function iD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4fv(this.addr,e),br(t,e)}}function sD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;g2.set(n),r.uniformMatrix2fv(this.addr,!1,g2),br(t,n)}}function aD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;A2.set(n),r.uniformMatrix3fv(this.addr,!1,A2),br(t,n)}}function oD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Br(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),br(t,e)}else{if(Br(t,n))return;p2.set(n),r.uniformMatrix4fv(this.addr,!1,p2),br(t,n)}}function lD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function cD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2iv(this.addr,e),br(t,e)}}function uD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Br(t,e))return;r.uniform3iv(this.addr,e),br(t,e)}}function hD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4iv(this.addr,e),br(t,e)}}function dD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function fD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Br(t,e))return;r.uniform2uiv(this.addr,e),br(t,e)}}function pD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Br(t,e))return;r.uniform3uiv(this.addr,e),br(t,e)}}function AD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Br(t,e))return;r.uniform4uiv(this.addr,e),br(t,e)}}function gD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);const s=this.type===r.SAMPLER_2D_SHADOW?l2:o2;t.setTexture2D(e||s,i)}function mD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||u2,i)}function _D(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||h2,i)}function vD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||c2,i)}function yD(r){switch(r){case 5126:return tD;case 35664:return rD;case 35665:return nD;case 35666:return iD;case 35674:return sD;case 35675:return aD;case 35676:return oD;case 5124:case 35670:return lD;case 35667:case 35671:return cD;case 35668:case 35672:return uD;case 35669:case 35673:return hD;case 5125:return dD;case 36294:return fD;case 36295:return pD;case 36296:return AD;case 35678:case 36198:case 36298:case 36306:case 35682:return gD;case 35679:case 36299:case 36307:return mD;case 35680:case 36300:case 36308:case 36293:return _D;case 36289:case 36303:case 36311:case 36292:return vD}}function ED(r,e){r.uniform1fv(this.addr,e)}function xD(r,e){const t=Ml(e,this.size,2);r.uniform2fv(this.addr,t)}function wD(r,e){const t=Ml(e,this.size,3);r.uniform3fv(this.addr,t)}function ID(r,e){const t=Ml(e,this.size,4);r.uniform4fv(this.addr,t)}function CD(r,e){const t=Ml(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function SD(r,e){const t=Ml(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function MD(r,e){const t=Ml(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function TD(r,e){r.uniform1iv(this.addr,e)}function BD(r,e){r.uniform2iv(this.addr,e)}function bD(r,e){r.uniform3iv(this.addr,e)}function RD(r,e){r.uniform4iv(this.addr,e)}function DD(r,e){r.uniform1uiv(this.addr,e)}function LD(r,e){r.uniform2uiv(this.addr,e)}function ND(r,e){r.uniform3uiv(this.addr,e)}function UD(r,e){r.uniform4uiv(this.addr,e)}function PD(r,e,t){const n=this.cache,i=e.length,s=Bd(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||o2,s[o])}function kD(r,e,t){const n=this.cache,i=e.length,s=Bd(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||u2,s[o])}function QD(r,e,t){const n=this.cache,i=e.length,s=Bd(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||h2,s[o])}function FD(r,e,t){const n=this.cache,i=e.length,s=Bd(t,i);Br(n,s)||(r.uniform1iv(this.addr,s),br(n,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||c2,s[o])}function OD(r){switch(r){case 5126:return ED;case 35664:return xD;case 35665:return wD;case 35666:return ID;case 35674:return CD;case 35675:return SD;case 35676:return MD;case 5124:case 35670:return TD;case 35667:case 35671:return BD;case 35668:case 35672:return bD;case 35669:case 35673:return RD;case 5125:return DD;case 36294:return LD;case 36295:return ND;case 36296:return UD;case 35678:case 36198:case 36298:case 36306:case 35682:return PD;case 35679:case 36299:case 36307:return kD;case 35680:case 36300:case 36308:case 36293:return QD;case 36289:case 36303:case 36311:case 36292:return FD}}class zD{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=yD(t.type)}}class HD{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=OD(t.type)}}class GD{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const c=i[s];c.setValue(e,t[c.id],n)}}}const $A=/(\w+)(\])?(\[|\.)?/g;function m2(r,e){r.seq.push(e),r.map[e.id]=e}function VD(r,e,t){const n=r.name,i=n.length;for($A.lastIndex=0;;){const s=$A.exec(n),o=$A.lastIndex;let c=s[1];const h=s[2]==="]",u=s[3];if(h&&(c=c|0),u===void 0||u==="["&&o+2===i){m2(t,u===void 0?new zD(c,r,e):new HD(c,r,e));break}else{let d=t.map[c];d===void 0&&(d=new GD(c),m2(t,d)),t=d}}}class bd{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);VD(s,o,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,o=t.length;s!==o;++s){const c=t[s],h=n[c.id];h.needsUpdate!==!1&&c.setValue(e,h.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&n.push(o)}return n}}function _2(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const jD=37297;let WD=0;function YD(r,e){const t=r.split(`
|
|
3728
3728
|
`),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const c=o+1;n.push(`${c===e?">":" "} ${c}: ${t[o]}`)}return n.join(`
|
|
3729
|
-
`)}function qD(r){const e=Rt.getPrimaries(Rt.workingColorSpace),t=Rt.getPrimaries(r);let n;switch(e===t?n="":e===
|
|
3729
|
+
`)}function qD(r){const e=Rt.getPrimaries(Rt.workingColorSpace),t=Rt.getPrimaries(r);let n;switch(e===t?n="":e===id&&t===nd?n="LinearDisplayP3ToLinearSRGB":e===nd&&t===id&&(n="LinearSRGBToLinearDisplayP3"),r){case Sr:case nu:return[n,"LinearTransferOETF"];case Qr:case td:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function v2(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`
|
|
3730
3730
|
|
|
3731
3731
|
`+i+`
|
|
3732
3732
|
|
|
@@ -3752,7 +3752,7 @@ void main() {
|
|
|
3752
3752
|
`;return r.precision==="highp"?e+=`
|
|
3753
3753
|
#define HIGH_PRECISION`:r.precision==="mediump"?e+=`
|
|
3754
3754
|
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
|
|
3755
|
-
#define LOW_PRECISION`),e}function sL(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Dy?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===EB?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===fs&&(e="SHADOWMAP_TYPE_VSM"),e}function aL(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case no:case
|
|
3755
|
+
#define LOW_PRECISION`),e}function sL(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Dy?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===EB?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===fs&&(e="SHADOWMAP_TYPE_VSM"),e}function aL(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case no:case nl:e="ENVMAP_TYPE_CUBE";break;case Yh:e="ENVMAP_TYPE_CUBE_UV";break}return e}function oL(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case nl:e="ENVMAP_MODE_REFRACTION";break}return e}function lL(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case Py:e="ENVMAP_BLENDING_MULTIPLY";break;case YB:e="ENVMAP_BLENDING_MIX";break;case qB:e="ENVMAP_BLENDING_ADD";break}return e}function cL(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function uL(r,e,t,n){const i=r.getContext(),s=t.defines;let o=t.vertexShader,c=t.fragmentShader;const h=sL(t),u=aL(t),d=oL(t),A=lL(t),p=cL(t),g=JD(t),v=ZD(s),E=i.createProgram();let m,_,w=t.glslVersion?"#version "+t.glslVersion+`
|
|
3756
3756
|
`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Au).join(`
|
|
3757
3757
|
`),m.length>0&&(m+=`
|
|
3758
3758
|
`),_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Au).join(`
|
|
@@ -3773,7 +3773,7 @@ Material Type: `+L.type+`
|
|
|
3773
3773
|
|
|
3774
3774
|
Program Info Log: `+P+`
|
|
3775
3775
|
`+te+`
|
|
3776
|
-
`+H)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(N===""||W==="")&&(K=!1);K&&(L.diagnostics={runnable:X,programLog:P,vertexShader:{log:N,prefix:m},fragmentShader:{log:W,prefix:_}})}i.deleteShader(R),i.deleteShader(M),D=new Bd(i,E),b=$D(i,E)}let D;this.getUniforms=function(){return D===void 0&&T(this),D};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=i.getProgramParameter(E,jD)),S},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=WD++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=R,this.fragmentShader=M,this}let hL=0;class dL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}}class fL{constructor(e){this.id=hL++,this.code=e,this.usedTimes=0}}function pL(r,e,t,n,i,s,o){const c=new PA,h=new dL,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const v={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 E(b){return u.add(b),b===0?"uv":`uv${b}`}function m(b,S,L,P,N){const W=P.fog,X=N.geometry,K=b.isMeshStandardMaterial?P.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||K),H=te&&te.mapping===Wh?te.image.height:null,ee=v[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const Q=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,z=Q!==void 0?Q.length:0;let Z=0;X.morphAttributes.position!==void 0&&(Z=1),X.morphAttributes.normal!==void 0&&(Z=2),X.morphAttributes.color!==void 0&&(Z=3);let re,G,de,pe;if(ee){const Mt=Ki[ee];re=Mt.vertexShader,G=Mt.fragmentShader}else re=b.vertexShader,G=b.fragmentShader,h.update(b),de=h.getVertexShaderID(b),pe=h.getFragmentShaderID(b);const fe=r.getRenderTarget(),ye=N.isInstancedMesh===!0,Pe=N.isBatchedMesh===!0,at=!!b.map,se=!!b.matcap,et=!!te,ke=!!b.aoMap,dt=!!b.lightMap,Xe=!!b.bumpMap,ft=!!b.normalMap,Y=!!b.displacementMap,k=!!b.emissiveMap,le=!!b.metalnessMap,Ae=!!b.roughnessMap,me=b.anisotropy>0,Ee=b.clearcoat>0,Oe=b.iridescence>0,Ce=b.sheen>0,Qe=b.transmission>0,ve=me&&!!b.anisotropyMap,xe=Ee&&!!b.clearcoatMap,Be=Ee&&!!b.clearcoatNormalMap,Ye=Ee&&!!b.clearcoatRoughnessMap,Le=Oe&&!!b.iridescenceMap,be=Oe&&!!b.iridescenceThicknessMap,nt=Ce&&!!b.sheenColorMap,pt=Ce&&!!b.sheenRoughnessMap,ct=!!b.specularMap,ut=!!b.specularColorMap,tt=!!b.specularIntensityMap,V=Qe&&!!b.transmissionMap,F=Qe&&!!b.thicknessMap,ge=!!b.gradientMap,_e=!!b.alphaMap,ze=b.alphaTest>0,Ne=!!b.alphaHash,_t=!!b.extensions;let Dt=Zs;b.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(Dt=r.toneMapping);const Lt={shaderID:ee,shaderType:b.type,shaderName:b.name,vertexShader:re,fragmentShader:G,defines:b.defines,customVertexShaderID:de,customFragmentShaderID:pe,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:Pe,instancing:ye,instancingColor:ye&&N.instanceColor!==null,instancingMorph:ye&&N.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:fe===null?r.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:Sr,alphaToCoverage:!!b.alphaToCoverage,map:at,matcap:se,envMap:et,envMapMode:et&&te.mapping,envMapCubeUVHeight:H,aoMap:ke,lightMap:dt,bumpMap:Xe,normalMap:ft,displacementMap:p&&Y,emissiveMap:k,normalMapObjectSpace:ft&&b.normalMapType===lb,normalMapTangentSpace:ft&&b.normalMapType===mE,metalnessMap:le,roughnessMap:Ae,anisotropy:me,anisotropyMap:ve,clearcoat:Ee,clearcoatMap:xe,clearcoatNormalMap:Be,clearcoatRoughnessMap:Ye,iridescence:Oe,iridescenceMap:Le,iridescenceThicknessMap:be,sheen:Ce,sheenColorMap:nt,sheenRoughnessMap:pt,specularMap:ct,specularColorMap:ut,specularIntensityMap:tt,transmission:Qe,transmissionMap:V,thicknessMap:F,gradientMap:ge,opaque:b.transparent===!1&&b.blending===tl&&b.alphaToCoverage===!1,alphaMap:_e,alphaTest:ze,alphaHash:Ne,combine:b.combine,mapUv:at&&E(b.map.channel),aoMapUv:ke&&E(b.aoMap.channel),lightMapUv:dt&&E(b.lightMap.channel),bumpMapUv:Xe&&E(b.bumpMap.channel),normalMapUv:ft&&E(b.normalMap.channel),displacementMapUv:Y&&E(b.displacementMap.channel),emissiveMapUv:k&&E(b.emissiveMap.channel),metalnessMapUv:le&&E(b.metalnessMap.channel),roughnessMapUv:Ae&&E(b.roughnessMap.channel),anisotropyMapUv:ve&&E(b.anisotropyMap.channel),clearcoatMapUv:xe&&E(b.clearcoatMap.channel),clearcoatNormalMapUv:Be&&E(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ye&&E(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Le&&E(b.iridescenceMap.channel),iridescenceThicknessMapUv:be&&E(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&E(b.sheenColorMap.channel),sheenRoughnessMapUv:pt&&E(b.sheenRoughnessMap.channel),specularMapUv:ct&&E(b.specularMap.channel),specularColorMapUv:ut&&E(b.specularColorMap.channel),specularIntensityMapUv:tt&&E(b.specularIntensityMap.channel),transmissionMapUv:V&&E(b.transmissionMap.channel),thicknessMapUv:F&&E(b.thicknessMap.channel),alphaMapUv:_e&&E(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ft||me),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!X.attributes.uv&&(at||_e),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:A,skinning:N.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:Z,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:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:Dt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:at&&b.map.isVideoTexture===!0&&Rt.getTransfer(b.map.colorSpace)===Ht,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ei,flipSided:b.side===kr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:_t&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&b.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=u.has(1),Lt.vertexUv2s=u.has(2),Lt.vertexUv3s=u.has(3),u.clear(),Lt}function _(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)S.push(L),S.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(w(S,b),x(S,b),S.push(r.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function w(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){c.disableAll(),S.supportsVertexTextures&&c.enable(0),S.instancing&&c.enable(1),S.instancingColor&&c.enable(2),S.instancingMorph&&c.enable(3),S.matcap&&c.enable(4),S.envMap&&c.enable(5),S.normalMapObjectSpace&&c.enable(6),S.normalMapTangentSpace&&c.enable(7),S.clearcoat&&c.enable(8),S.iridescence&&c.enable(9),S.alphaTest&&c.enable(10),S.vertexColors&&c.enable(11),S.vertexAlphas&&c.enable(12),S.vertexUv1s&&c.enable(13),S.vertexUv2s&&c.enable(14),S.vertexUv3s&&c.enable(15),S.vertexTangents&&c.enable(16),S.anisotropy&&c.enable(17),S.alphaHash&&c.enable(18),S.batching&&c.enable(19),b.push(c.mask),c.disableAll(),S.fog&&c.enable(0),S.useFog&&c.enable(1),S.flatShading&&c.enable(2),S.logarithmicDepthBuffer&&c.enable(3),S.skinning&&c.enable(4),S.morphTargets&&c.enable(5),S.morphNormals&&c.enable(6),S.morphColors&&c.enable(7),S.premultipliedAlpha&&c.enable(8),S.shadowMapEnabled&&c.enable(9),S.useLegacyLights&&c.enable(10),S.doubleSided&&c.enable(11),S.flipSided&&c.enable(12),S.useDepthPacking&&c.enable(13),S.dithering&&c.enable(14),S.transmission&&c.enable(15),S.sheen&&c.enable(16),S.opaque&&c.enable(17),S.pointsUvs&&c.enable(18),S.decodeVideoTexture&&c.enable(19),S.alphaToCoverage&&c.enable(20),b.push(c.mask)}function I(b){const S=v[b.type];let L;if(S){const P=Ki[S];L=Id.clone(P.uniforms)}else L=b.uniforms;return L}function R(b,S){let L;for(let P=0,N=d.length;P<N;P++){const W=d[P];if(W.cacheKey===S){L=W,++L.usedTimes;break}}return L===void 0&&(L=new uL(r,S,b,s),d.push(L)),L}function M(b){if(--b.usedTimes===0){const S=d.indexOf(b);d[S]=d[d.length-1],d.pop(),b.destroy()}}function T(b){h.remove(b)}function D(){h.dispose()}return{getParameters:m,getProgramCacheKey:_,getUniforms:I,acquireProgram:R,releaseProgram:M,releaseShaderCache:T,programs:d,dispose:D}}function AL(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,c){r.get(s)[o]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function gL(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function I2(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function C2(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(A,p,g,v,E,m){let _=r[e];return _===void 0?(_={id:A.id,object:A,geometry:p,material:g,groupOrder:v,renderOrder:A.renderOrder,z:E,group:m},r[e]=_):(_.id=A.id,_.object=A,_.geometry=p,_.material=g,_.groupOrder=v,_.renderOrder=A.renderOrder,_.z=E,_.group=m),e++,_}function c(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.push(_):g.transparent===!0?i.push(_):t.push(_)}function h(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function u(A,p){t.length>1&&t.sort(A||gL),n.length>1&&n.sort(p||I2),i.length>1&&i.sort(p||I2)}function d(){for(let A=e,p=r.length;A<p;A++){const g=r[A];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:c,unshift:h,finish:d,sort:u}}function mL(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new C2,r.set(n,[o])):i>=s.length?(o=new C2,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function _L(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new Ke};break;case"SpotLight":t={position:new j,direction:new j,color:new Ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new Ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new Ke,groundColor:new Ke};break;case"RectAreaLight":t={color:new Ke,position:new j,halfWidth:new j,halfHeight:new j};break}return r[e.id]=t,t}}}function vL(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let yL=0;function EL(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function xL(r){const e=new _L,t=vL(),n={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 u=0;u<9;u++)n.probe.push(new j);const i=new j,s=new st,o=new st;function c(u,d){let A=0,p=0,g=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let v=0,E=0,m=0,_=0,w=0,x=0,I=0,R=0,M=0,T=0,D=0;u.sort(EL);const b=d===!0?Math.PI:1;for(let L=0,P=u.length;L<P;L++){const N=u[L],W=N.color,X=N.intensity,K=N.distance,te=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)A+=W.r*X*b,p+=W.g*X*b,g+=W.b*X*b;else if(N.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(N.sh.coefficients[H],X);D++}else if(N.isDirectionalLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.directionalShadow[v]=Q,n.directionalShadowMap[v]=te,n.directionalShadowMatrix[v]=N.shadow.matrix,x++}n.directional[v]=H,v++}else if(N.isSpotLight){const H=e.get(N);H.position.setFromMatrixPosition(N.matrixWorld),H.color.copy(W).multiplyScalar(X*b),H.distance=K,H.coneCos=Math.cos(N.angle),H.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),H.decay=N.decay,n.spot[m]=H;const ee=N.shadow;if(N.map&&(n.spotLightMap[M]=N.map,M++,ee.updateMatrices(N),N.castShadow&&T++),n.spotLightMatrix[m]=ee.matrix,N.castShadow){const Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.spotShadow[m]=Q,n.spotShadowMap[m]=te,R++}m++}else if(N.isRectAreaLight){const H=e.get(N);H.color.copy(W).multiplyScalar(X),H.halfWidth.set(N.width*.5,0,0),H.halfHeight.set(0,N.height*.5,0),n.rectArea[_]=H,_++}else if(N.isPointLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),H.distance=N.distance,H.decay=N.decay,N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,Q.shadowCameraNear=ee.camera.near,Q.shadowCameraFar=ee.camera.far,n.pointShadow[E]=Q,n.pointShadowMap[E]=te,n.pointShadowMatrix[E]=N.shadow.matrix,I++}n.point[E]=H,E++}else if(N.isHemisphereLight){const H=e.get(N);H.skyColor.copy(N.color).multiplyScalar(X*b),H.groundColor.copy(N.groundColor).multiplyScalar(X*b),n.hemi[w]=H,w++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=De.LTC_FLOAT_1,n.rectAreaLTC2=De.LTC_FLOAT_2):(n.rectAreaLTC1=De.LTC_HALF_1,n.rectAreaLTC2=De.LTC_HALF_2)),n.ambient[0]=A,n.ambient[1]=p,n.ambient[2]=g;const S=n.hash;(S.directionalLength!==v||S.pointLength!==E||S.spotLength!==m||S.rectAreaLength!==_||S.hemiLength!==w||S.numDirectionalShadows!==x||S.numPointShadows!==I||S.numSpotShadows!==R||S.numSpotMaps!==M||S.numLightProbes!==D)&&(n.directional.length=v,n.spot.length=m,n.rectArea.length=_,n.point.length=E,n.hemi.length=w,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=I,n.pointShadowMap.length=I,n.spotShadow.length=R,n.spotShadowMap.length=R,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=I,n.spotLightMatrix.length=R+M-T,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=D,S.directionalLength=v,S.pointLength=E,S.spotLength=m,S.rectAreaLength=_,S.hemiLength=w,S.numDirectionalShadows=x,S.numPointShadows=I,S.numSpotShadows=R,S.numSpotMaps=M,S.numLightProbes=D,n.version=yL++)}function h(u,d){let A=0,p=0,g=0,v=0,E=0;const m=d.matrixWorldInverse;for(let _=0,w=u.length;_<w;_++){const x=u[_];if(x.isDirectionalLight){const I=n.directional[A];I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),A++}else if(x.isSpotLight){const I=n.spot[g];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),g++}else if(x.isRectAreaLight){const I=n.rectArea[v];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),I.halfWidth.set(x.width*.5,0,0),I.halfHeight.set(0,x.height*.5,0),I.halfWidth.applyMatrix4(o),I.halfHeight.applyMatrix4(o),v++}else if(x.isPointLight){const I=n.point[p];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),p++}else if(x.isHemisphereLight){const I=n.hemi[E];I.direction.setFromMatrixPosition(x.matrixWorld),I.direction.transformDirection(m),E++}}}return{setup:c,setupView:h,state:n}}function S2(r){const e=new xL(r),t=[],n=[];function i(){t.length=0,n.length=0}function s(u){t.push(u)}function o(u){n.push(u)}function c(u){e.setup(t,u)}function h(u){e.setupView(t,u)}return{init:i,state:{lightsArray:t,shadowsArray:n,lights:e,transmissionRenderTarget:null},setupLights:c,setupLightsView:h,pushLight:s,pushShadow:o}}function wL(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let c;return o===void 0?(c=new S2(r),e.set(i,[c])):s>=o.length?(c=new S2(r),o.push(c)):c=o[s],c}function n(){e=new WeakMap}return{get:t,dispose:n}}class M2 extends qi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ab,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 IL extends qi{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}}const CL=`void main() {
|
|
3776
|
+
`+H)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(N===""||W==="")&&(K=!1);K&&(L.diagnostics={runnable:X,programLog:P,vertexShader:{log:N,prefix:m},fragmentShader:{log:W,prefix:_}})}i.deleteShader(R),i.deleteShader(M),D=new bd(i,E),b=$D(i,E)}let D;this.getUniforms=function(){return D===void 0&&T(this),D};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=i.getProgramParameter(E,jD)),S},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=WD++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=R,this.fragmentShader=M,this}let hL=0;class dL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}}class fL{constructor(e){this.id=hL++,this.code=e,this.usedTimes=0}}function pL(r,e,t,n,i,s,o){const c=new PA,h=new dL,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const v={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 E(b){return u.add(b),b===0?"uv":`uv${b}`}function m(b,S,L,P,N){const W=P.fog,X=N.geometry,K=b.isMeshStandardMaterial?P.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||K),H=te&&te.mapping===Yh?te.image.height:null,ee=v[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const Q=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,z=Q!==void 0?Q.length:0;let Z=0;X.morphAttributes.position!==void 0&&(Z=1),X.morphAttributes.normal!==void 0&&(Z=2),X.morphAttributes.color!==void 0&&(Z=3);let re,G,de,pe;if(ee){const Mt=Ki[ee];re=Mt.vertexShader,G=Mt.fragmentShader}else re=b.vertexShader,G=b.fragmentShader,h.update(b),de=h.getVertexShaderID(b),pe=h.getFragmentShaderID(b);const fe=r.getRenderTarget(),ye=N.isInstancedMesh===!0,Pe=N.isBatchedMesh===!0,at=!!b.map,se=!!b.matcap,et=!!te,ke=!!b.aoMap,dt=!!b.lightMap,Xe=!!b.bumpMap,ft=!!b.normalMap,Y=!!b.displacementMap,k=!!b.emissiveMap,le=!!b.metalnessMap,Ae=!!b.roughnessMap,me=b.anisotropy>0,Ee=b.clearcoat>0,Oe=b.iridescence>0,Ce=b.sheen>0,Qe=b.transmission>0,ve=me&&!!b.anisotropyMap,xe=Ee&&!!b.clearcoatMap,Be=Ee&&!!b.clearcoatNormalMap,Ye=Ee&&!!b.clearcoatRoughnessMap,Le=Oe&&!!b.iridescenceMap,be=Oe&&!!b.iridescenceThicknessMap,nt=Ce&&!!b.sheenColorMap,pt=Ce&&!!b.sheenRoughnessMap,ct=!!b.specularMap,ut=!!b.specularColorMap,tt=!!b.specularIntensityMap,V=Qe&&!!b.transmissionMap,F=Qe&&!!b.thicknessMap,ge=!!b.gradientMap,_e=!!b.alphaMap,ze=b.alphaTest>0,Ne=!!b.alphaHash,_t=!!b.extensions;let Dt=Zs;b.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(Dt=r.toneMapping);const Lt={shaderID:ee,shaderType:b.type,shaderName:b.name,vertexShader:re,fragmentShader:G,defines:b.defines,customVertexShaderID:de,customFragmentShaderID:pe,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:Pe,instancing:ye,instancingColor:ye&&N.instanceColor!==null,instancingMorph:ye&&N.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:fe===null?r.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:Sr,alphaToCoverage:!!b.alphaToCoverage,map:at,matcap:se,envMap:et,envMapMode:et&&te.mapping,envMapCubeUVHeight:H,aoMap:ke,lightMap:dt,bumpMap:Xe,normalMap:ft,displacementMap:p&&Y,emissiveMap:k,normalMapObjectSpace:ft&&b.normalMapType===lb,normalMapTangentSpace:ft&&b.normalMapType===mE,metalnessMap:le,roughnessMap:Ae,anisotropy:me,anisotropyMap:ve,clearcoat:Ee,clearcoatMap:xe,clearcoatNormalMap:Be,clearcoatRoughnessMap:Ye,iridescence:Oe,iridescenceMap:Le,iridescenceThicknessMap:be,sheen:Ce,sheenColorMap:nt,sheenRoughnessMap:pt,specularMap:ct,specularColorMap:ut,specularIntensityMap:tt,transmission:Qe,transmissionMap:V,thicknessMap:F,gradientMap:ge,opaque:b.transparent===!1&&b.blending===rl&&b.alphaToCoverage===!1,alphaMap:_e,alphaTest:ze,alphaHash:Ne,combine:b.combine,mapUv:at&&E(b.map.channel),aoMapUv:ke&&E(b.aoMap.channel),lightMapUv:dt&&E(b.lightMap.channel),bumpMapUv:Xe&&E(b.bumpMap.channel),normalMapUv:ft&&E(b.normalMap.channel),displacementMapUv:Y&&E(b.displacementMap.channel),emissiveMapUv:k&&E(b.emissiveMap.channel),metalnessMapUv:le&&E(b.metalnessMap.channel),roughnessMapUv:Ae&&E(b.roughnessMap.channel),anisotropyMapUv:ve&&E(b.anisotropyMap.channel),clearcoatMapUv:xe&&E(b.clearcoatMap.channel),clearcoatNormalMapUv:Be&&E(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ye&&E(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Le&&E(b.iridescenceMap.channel),iridescenceThicknessMapUv:be&&E(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&E(b.sheenColorMap.channel),sheenRoughnessMapUv:pt&&E(b.sheenRoughnessMap.channel),specularMapUv:ct&&E(b.specularMap.channel),specularColorMapUv:ut&&E(b.specularColorMap.channel),specularIntensityMapUv:tt&&E(b.specularIntensityMap.channel),transmissionMapUv:V&&E(b.transmissionMap.channel),thicknessMapUv:F&&E(b.thicknessMap.channel),alphaMapUv:_e&&E(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ft||me),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!X.attributes.uv&&(at||_e),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:A,skinning:N.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:Z,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:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:Dt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:at&&b.map.isVideoTexture===!0&&Rt.getTransfer(b.map.colorSpace)===Ht,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ei,flipSided:b.side===kr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:_t&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&b.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=u.has(1),Lt.vertexUv2s=u.has(2),Lt.vertexUv3s=u.has(3),u.clear(),Lt}function _(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)S.push(L),S.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(w(S,b),x(S,b),S.push(r.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function w(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){c.disableAll(),S.supportsVertexTextures&&c.enable(0),S.instancing&&c.enable(1),S.instancingColor&&c.enable(2),S.instancingMorph&&c.enable(3),S.matcap&&c.enable(4),S.envMap&&c.enable(5),S.normalMapObjectSpace&&c.enable(6),S.normalMapTangentSpace&&c.enable(7),S.clearcoat&&c.enable(8),S.iridescence&&c.enable(9),S.alphaTest&&c.enable(10),S.vertexColors&&c.enable(11),S.vertexAlphas&&c.enable(12),S.vertexUv1s&&c.enable(13),S.vertexUv2s&&c.enable(14),S.vertexUv3s&&c.enable(15),S.vertexTangents&&c.enable(16),S.anisotropy&&c.enable(17),S.alphaHash&&c.enable(18),S.batching&&c.enable(19),b.push(c.mask),c.disableAll(),S.fog&&c.enable(0),S.useFog&&c.enable(1),S.flatShading&&c.enable(2),S.logarithmicDepthBuffer&&c.enable(3),S.skinning&&c.enable(4),S.morphTargets&&c.enable(5),S.morphNormals&&c.enable(6),S.morphColors&&c.enable(7),S.premultipliedAlpha&&c.enable(8),S.shadowMapEnabled&&c.enable(9),S.useLegacyLights&&c.enable(10),S.doubleSided&&c.enable(11),S.flipSided&&c.enable(12),S.useDepthPacking&&c.enable(13),S.dithering&&c.enable(14),S.transmission&&c.enable(15),S.sheen&&c.enable(16),S.opaque&&c.enable(17),S.pointsUvs&&c.enable(18),S.decodeVideoTexture&&c.enable(19),S.alphaToCoverage&&c.enable(20),b.push(c.mask)}function I(b){const S=v[b.type];let L;if(S){const P=Ki[S];L=Cd.clone(P.uniforms)}else L=b.uniforms;return L}function R(b,S){let L;for(let P=0,N=d.length;P<N;P++){const W=d[P];if(W.cacheKey===S){L=W,++L.usedTimes;break}}return L===void 0&&(L=new uL(r,S,b,s),d.push(L)),L}function M(b){if(--b.usedTimes===0){const S=d.indexOf(b);d[S]=d[d.length-1],d.pop(),b.destroy()}}function T(b){h.remove(b)}function D(){h.dispose()}return{getParameters:m,getProgramCacheKey:_,getUniforms:I,acquireProgram:R,releaseProgram:M,releaseShaderCache:T,programs:d,dispose:D}}function AL(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,c){r.get(s)[o]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function gL(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function I2(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function C2(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(A,p,g,v,E,m){let _=r[e];return _===void 0?(_={id:A.id,object:A,geometry:p,material:g,groupOrder:v,renderOrder:A.renderOrder,z:E,group:m},r[e]=_):(_.id=A.id,_.object=A,_.geometry=p,_.material=g,_.groupOrder=v,_.renderOrder=A.renderOrder,_.z=E,_.group=m),e++,_}function c(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.push(_):g.transparent===!0?i.push(_):t.push(_)}function h(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function u(A,p){t.length>1&&t.sort(A||gL),n.length>1&&n.sort(p||I2),i.length>1&&i.sort(p||I2)}function d(){for(let A=e,p=r.length;A<p;A++){const g=r[A];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:c,unshift:h,finish:d,sort:u}}function mL(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new C2,r.set(n,[o])):i>=s.length?(o=new C2,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function _L(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new Ke};break;case"SpotLight":t={position:new j,direction:new j,color:new Ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new Ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new Ke,groundColor:new Ke};break;case"RectAreaLight":t={color:new Ke,position:new j,halfWidth:new j,halfHeight:new j};break}return r[e.id]=t,t}}}function vL(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let yL=0;function EL(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function xL(r){const e=new _L,t=vL(),n={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 u=0;u<9;u++)n.probe.push(new j);const i=new j,s=new st,o=new st;function c(u,d){let A=0,p=0,g=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let v=0,E=0,m=0,_=0,w=0,x=0,I=0,R=0,M=0,T=0,D=0;u.sort(EL);const b=d===!0?Math.PI:1;for(let L=0,P=u.length;L<P;L++){const N=u[L],W=N.color,X=N.intensity,K=N.distance,te=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)A+=W.r*X*b,p+=W.g*X*b,g+=W.b*X*b;else if(N.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(N.sh.coefficients[H],X);D++}else if(N.isDirectionalLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.directionalShadow[v]=Q,n.directionalShadowMap[v]=te,n.directionalShadowMatrix[v]=N.shadow.matrix,x++}n.directional[v]=H,v++}else if(N.isSpotLight){const H=e.get(N);H.position.setFromMatrixPosition(N.matrixWorld),H.color.copy(W).multiplyScalar(X*b),H.distance=K,H.coneCos=Math.cos(N.angle),H.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),H.decay=N.decay,n.spot[m]=H;const ee=N.shadow;if(N.map&&(n.spotLightMap[M]=N.map,M++,ee.updateMatrices(N),N.castShadow&&T++),n.spotLightMatrix[m]=ee.matrix,N.castShadow){const Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.spotShadow[m]=Q,n.spotShadowMap[m]=te,R++}m++}else if(N.isRectAreaLight){const H=e.get(N);H.color.copy(W).multiplyScalar(X),H.halfWidth.set(N.width*.5,0,0),H.halfHeight.set(0,N.height*.5,0),n.rectArea[_]=H,_++}else if(N.isPointLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),H.distance=N.distance,H.decay=N.decay,N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,Q.shadowCameraNear=ee.camera.near,Q.shadowCameraFar=ee.camera.far,n.pointShadow[E]=Q,n.pointShadowMap[E]=te,n.pointShadowMatrix[E]=N.shadow.matrix,I++}n.point[E]=H,E++}else if(N.isHemisphereLight){const H=e.get(N);H.skyColor.copy(N.color).multiplyScalar(X*b),H.groundColor.copy(N.groundColor).multiplyScalar(X*b),n.hemi[w]=H,w++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=De.LTC_FLOAT_1,n.rectAreaLTC2=De.LTC_FLOAT_2):(n.rectAreaLTC1=De.LTC_HALF_1,n.rectAreaLTC2=De.LTC_HALF_2)),n.ambient[0]=A,n.ambient[1]=p,n.ambient[2]=g;const S=n.hash;(S.directionalLength!==v||S.pointLength!==E||S.spotLength!==m||S.rectAreaLength!==_||S.hemiLength!==w||S.numDirectionalShadows!==x||S.numPointShadows!==I||S.numSpotShadows!==R||S.numSpotMaps!==M||S.numLightProbes!==D)&&(n.directional.length=v,n.spot.length=m,n.rectArea.length=_,n.point.length=E,n.hemi.length=w,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=I,n.pointShadowMap.length=I,n.spotShadow.length=R,n.spotShadowMap.length=R,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=I,n.spotLightMatrix.length=R+M-T,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=D,S.directionalLength=v,S.pointLength=E,S.spotLength=m,S.rectAreaLength=_,S.hemiLength=w,S.numDirectionalShadows=x,S.numPointShadows=I,S.numSpotShadows=R,S.numSpotMaps=M,S.numLightProbes=D,n.version=yL++)}function h(u,d){let A=0,p=0,g=0,v=0,E=0;const m=d.matrixWorldInverse;for(let _=0,w=u.length;_<w;_++){const x=u[_];if(x.isDirectionalLight){const I=n.directional[A];I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),A++}else if(x.isSpotLight){const I=n.spot[g];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),g++}else if(x.isRectAreaLight){const I=n.rectArea[v];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),I.halfWidth.set(x.width*.5,0,0),I.halfHeight.set(0,x.height*.5,0),I.halfWidth.applyMatrix4(o),I.halfHeight.applyMatrix4(o),v++}else if(x.isPointLight){const I=n.point[p];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),p++}else if(x.isHemisphereLight){const I=n.hemi[E];I.direction.setFromMatrixPosition(x.matrixWorld),I.direction.transformDirection(m),E++}}}return{setup:c,setupView:h,state:n}}function S2(r){const e=new xL(r),t=[],n=[];function i(){t.length=0,n.length=0}function s(u){t.push(u)}function o(u){n.push(u)}function c(u){e.setup(t,u)}function h(u){e.setupView(t,u)}return{init:i,state:{lightsArray:t,shadowsArray:n,lights:e,transmissionRenderTarget:null},setupLights:c,setupLightsView:h,pushLight:s,pushShadow:o}}function wL(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let c;return o===void 0?(c=new S2(r),e.set(i,[c])):s>=o.length?(c=new S2(r),o.push(c)):c=o[s],c}function n(){e=new WeakMap}return{get:t,dispose:n}}class M2 extends qi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ab,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 IL extends qi{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}}const CL=`void main() {
|
|
3777
3777
|
gl_Position = vec4( position, 1.0 );
|
|
3778
3778
|
}`,SL=`uniform sampler2D shadow_pass;
|
|
3779
3779
|
uniform vec2 resolution;
|
|
@@ -3801,7 +3801,7 @@ void main() {
|
|
|
3801
3801
|
squared_mean = squared_mean / samples;
|
|
3802
3802
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3803
3803
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3804
|
-
}`;function ML(r,e,t){let n=new WA;const i=new Ge,s=new Ge,o=new Ot,c=new M2({depthPacking:ob}),h=new IL,u={},d=t.maxTextureSize,A={[yi]:kr,[kr]:yi,[Ei]:Ei},p=new En({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:CL,fragmentShader:SL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Gn;v.setAttribute("position",new Fr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Yr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dy;let _=this.type;this.render=function(M,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||M.length===0)return;const b=r.getRenderTarget(),S=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(ps),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==fs&&this.type===fs,W=_===fs&&this.type!==fs;for(let X=0,K=M.length;X<K;X++){const te=M[X],H=te.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const ee=H.getFrameExtents();if(i.multiply(ee),s.copy(H.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,H.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,H.mapSize.y=s.y)),H.map===null||N===!0||W===!0){const z=this.type!==fs?{minFilter:fr,magFilter:fr}:{};H.map!==null&&H.map.dispose(),H.map=new Mi(i.x,i.y,z),H.map.texture.name=te.name+".shadowMap",H.camera.updateProjectionMatrix()}r.setRenderTarget(H.map),r.clear();const Q=H.getViewportCount();for(let z=0;z<Q;z++){const Z=H.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),H.updateMatrices(te,z),n=H.getFrustum(),I(T,D,H.camera,te,this.type)}H.isPointLightShadow!==!0&&this.type===fs&&w(H,D),H.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,S,L)};function w(M,T){const D=e.update(E);p.defines.VSM_SAMPLES!==M.blurSamples&&(p.defines.VSM_SAMPLES=M.blurSamples,g.defines.VSM_SAMPLES=M.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=M.mapPass.texture,g.uniforms.resolution.value=M.mapSize,g.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(M,T,D,b){let S=null;const L=D.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(L!==void 0)S=L;else if(S=D.isPointLight===!0?h:c,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=S.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=S.clone(),W[N]=X,T.addEventListener("dispose",R)),S=X}if(S.visible=T.visible,S.wireframe=T.wireframe,b===fs?S.side=T.shadowSide!==null?T.shadowSide:T.side:S.side=T.shadowSide!==null?T.shadowSide:A[T.side],S.alphaMap=T.alphaMap,S.alphaTest=T.alphaTest,S.map=T.map,S.clipShadows=T.clipShadows,S.clippingPlanes=T.clippingPlanes,S.clipIntersection=T.clipIntersection,S.displacementMap=T.displacementMap,S.displacementScale=T.displacementScale,S.displacementBias=T.displacementBias,S.wireframeLinewidth=T.wireframeLinewidth,S.linewidth=T.linewidth,D.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const P=r.properties.get(S);P.light=D}return S}function I(M,T,D,b,S){if(M.visible===!1)return;if(M.layers.test(T.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&S===fs)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,M.matrixWorld);const P=e.update(M),N=M.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],H=N[te.materialIndex];if(H&&H.visible){const ee=x(M,H,b,S);M.onBeforeShadow(r,M,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,M,te),M.onAfterShadow(r,M,T,D,P,ee,te)}}}else if(N.visible){const W=x(M,N,b,S);M.onBeforeShadow(r,M,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,M,null),M.onAfterShadow(r,M,T,D,P,W,null)}}const L=M.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,S)}function R(M){M.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=M.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function TL(r){function e(){let F=!1;const ge=new Ot;let _e=null;const ze=new Ot(0,0,0,0);return{setMask:function(Ne){_e!==Ne&&!F&&(r.colorMask(Ne,Ne,Ne,Ne),_e=Ne)},setLocked:function(Ne){F=Ne},setClear:function(Ne,_t,Dt,Lt,Mt){Mt===!0&&(Ne*=Lt,_t*=Lt,Dt*=Lt),ge.set(Ne,_t,Dt,Lt),ze.equals(ge)===!1&&(r.clearColor(Ne,_t,Dt,Lt),ze.copy(ge))},reset:function(){F=!1,_e=null,ze.set(-1,0,0,0)}}}function t(){let F=!1,ge=null,_e=null,ze=null;return{setTest:function(Ne){Ne?pe(r.DEPTH_TEST):fe(r.DEPTH_TEST)},setMask:function(Ne){ge!==Ne&&!F&&(r.depthMask(Ne),ge=Ne)},setFunc:function(Ne){if(_e!==Ne){switch(Ne){case OB:r.depthFunc(r.NEVER);break;case zB:r.depthFunc(r.ALWAYS);break;case HB:r.depthFunc(r.LESS);break;case jh:r.depthFunc(r.LEQUAL);break;case GB:r.depthFunc(r.EQUAL);break;case VB:r.depthFunc(r.GEQUAL);break;case jB:r.depthFunc(r.GREATER);break;case WB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=Ne}},setLocked:function(Ne){F=Ne},setClear:function(Ne){ze!==Ne&&(r.clearDepth(Ne),ze=Ne)},reset:function(){F=!1,ge=null,_e=null,ze=null}}}function n(){let F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null;return{setTest:function(vt){F||(vt?pe(r.STENCIL_TEST):fe(r.STENCIL_TEST))},setMask:function(vt){ge!==vt&&!F&&(r.stencilMask(vt),ge=vt)},setFunc:function(vt,hr,Vt){(_e!==vt||ze!==hr||Ne!==Vt)&&(r.stencilFunc(vt,hr,Vt),_e=vt,ze=hr,Ne=Vt)},setOp:function(vt,hr,Vt){(_t!==vt||Dt!==hr||Lt!==Vt)&&(r.stencilOp(vt,hr,Vt),_t=vt,Dt=hr,Lt=Vt)},setLocked:function(vt){F=vt},setClear:function(vt){Mt!==vt&&(r.clearStencil(vt),Mt=vt)},reset:function(){F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=null,L=null,P=null,N=null;const W=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const te=r.getParameter(r.VERSION);te.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(te)[1]),X=K>=1):te.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),X=K>=2);let H=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ot().fromArray(Q),re=new Ot().fromArray(z);function G(F,ge,_e,ze){const Ne=new Uint8Array(4),_t=r.createTexture();r.bindTexture(F,_t),r.texParameteri(F,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(F,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,ze,0,r.RGBA,r.UNSIGNED_BYTE,Ne):r.texImage2D(ge+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Ne);return _t}const de={};de[r.TEXTURE_2D]=G(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=G(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=G(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=G(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pe(r.DEPTH_TEST),s.setFunc(jh),Xe(!1),ft(Ry),pe(r.CULL_FACE),ke(ps);function pe(F){u[F]!==!0&&(r.enable(F),u[F]=!0)}function fe(F){u[F]!==!1&&(r.disable(F),u[F]=!1)}function ye(F,ge){return d[F]!==ge?(r.bindFramebuffer(F,ge),d[F]=ge,F===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),F===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Pe(F,ge){let _e=p,ze=!1;if(F){_e=A.get(ge),_e===void 0&&(_e=[],A.set(ge,_e));const Ne=F.textures;if(_e.length!==Ne.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let _t=0,Dt=Ne.length;_t<Dt;_t++)_e[_t]=r.COLOR_ATTACHMENT0+_t;_e.length=Ne.length,ze=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,ze=!0);ze&&r.drawBuffers(_e)}function at(F){return g!==F?(r.useProgram(F),g=F,!0):!1}const se={[ro]:r.FUNC_ADD,[wB]:r.FUNC_SUBTRACT,[IB]:r.FUNC_REVERSE_SUBTRACT};se[CB]=r.MIN,se[SB]=r.MAX;const et={[MB]:r.ZERO,[TB]:r.ONE,[BB]:r.SRC_COLOR,[oA]:r.SRC_ALPHA,[UB]:r.SRC_ALPHA_SATURATE,[LB]:r.DST_COLOR,[RB]:r.DST_ALPHA,[bB]:r.ONE_MINUS_SRC_COLOR,[lA]:r.ONE_MINUS_SRC_ALPHA,[NB]:r.ONE_MINUS_DST_COLOR,[DB]:r.ONE_MINUS_DST_ALPHA,[PB]:r.CONSTANT_COLOR,[kB]:r.ONE_MINUS_CONSTANT_COLOR,[QB]:r.CONSTANT_ALPHA,[FB]:r.ONE_MINUS_CONSTANT_ALPHA};function ke(F,ge,_e,ze,Ne,_t,Dt,Lt,Mt,vt){if(F===ps){v===!0&&(fe(r.BLEND),v=!1);return}if(v===!1&&(pe(r.BLEND),v=!0),F!==xB){if(F!==E||vt!==D){if((m!==ro||x!==ro)&&(r.blendEquation(r.FUNC_ADD),m=ro,x=ro),vt)switch(F){case tl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.ONE,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}else switch(F){case tl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}_=null,w=null,I=null,R=null,M.set(0,0,0),T=0,E=F,D=vt}return}Ne=Ne||ge,_t=_t||_e,Dt=Dt||ze,(ge!==m||Ne!==x)&&(r.blendEquationSeparate(se[ge],se[Ne]),m=ge,x=Ne),(_e!==_||ze!==w||_t!==I||Dt!==R)&&(r.blendFuncSeparate(et[_e],et[ze],et[_t],et[Dt]),_=_e,w=ze,I=_t,R=Dt),(Lt.equals(M)===!1||Mt!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,Mt),M.copy(Lt),T=Mt),E=F,D=!1}function dt(F,ge){F.side===Ei?fe(r.CULL_FACE):pe(r.CULL_FACE);let _e=F.side===kr;ge&&(_e=!_e),Xe(_e),F.blending===tl&&F.transparent===!1?ke(ps):ke(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.blendColor,F.blendAlpha,F.premultipliedAlpha),s.setFunc(F.depthFunc),s.setTest(F.depthTest),s.setMask(F.depthWrite),i.setMask(F.colorWrite);const ze=F.stencilWrite;o.setTest(ze),ze&&(o.setMask(F.stencilWriteMask),o.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),o.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),k(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),F.alphaToCoverage===!0?pe(r.SAMPLE_ALPHA_TO_COVERAGE):fe(r.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(F){b!==F&&(F?r.frontFace(r.CW):r.frontFace(r.CCW),b=F)}function ft(F){F!==vB?(pe(r.CULL_FACE),F!==S&&(F===Ry?r.cullFace(r.BACK):F===yB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):fe(r.CULL_FACE),S=F}function Y(F){F!==L&&(X&&r.lineWidth(F),L=F)}function k(F,ge,_e){F?(pe(r.POLYGON_OFFSET_FILL),(P!==ge||N!==_e)&&(r.polygonOffset(ge,_e),P=ge,N=_e)):fe(r.POLYGON_OFFSET_FILL)}function le(F){F?pe(r.SCISSOR_TEST):fe(r.SCISSOR_TEST)}function Ae(F){F===void 0&&(F=r.TEXTURE0+W-1),H!==F&&(r.activeTexture(F),H=F)}function me(F,ge,_e){_e===void 0&&(H===null?_e=r.TEXTURE0+W-1:_e=H);let ze=ee[_e];ze===void 0&&(ze={type:void 0,texture:void 0},ee[_e]=ze),(ze.type!==F||ze.texture!==ge)&&(H!==_e&&(r.activeTexture(_e),H=_e),r.bindTexture(F,ge||de[F]),ze.type=F,ze.texture=ge)}function Ee(){const F=ee[H];F!==void 0&&F.type!==void 0&&(r.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)}function Oe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ce(){try{r.compressedTexImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ve(){try{r.texSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function xe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Be(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ye(){try{r.texStorage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Le(){try{r.texStorage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function pt(F){Z.equals(F)===!1&&(r.scissor(F.x,F.y,F.z,F.w),Z.copy(F))}function ct(F){re.equals(F)===!1&&(r.viewport(F.x,F.y,F.z,F.w),re.copy(F))}function ut(F,ge){let _e=h.get(ge);_e===void 0&&(_e=new WeakMap,h.set(ge,_e));let ze=_e.get(F);ze===void 0&&(ze=r.getUniformBlockIndex(ge,F.name),_e.set(F,ze))}function tt(F,ge){const _e=h.get(ge).get(F);c.get(ge)!==_e&&(r.uniformBlockBinding(ge,_e,F.__bindingPointIndex),c.set(ge,_e))}function V(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},H=null,ee={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:pe,disable:fe,bindFramebuffer:ye,drawBuffers:Pe,useProgram:at,setBlending:ke,setMaterial:dt,setFlipSided:Xe,setCullFace:ft,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:Ae,bindTexture:me,unbindTexture:Ee,compressedTexImage2D:Oe,compressedTexImage3D:Ce,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:tt,texStorage2D:Ye,texStorage3D:Le,texSubImage2D:Qe,texSubImage3D:ve,compressedTexSubImage2D:xe,compressedTexSubImage3D:Be,scissor:pt,viewport:ct,reset:V}}function BL(r,e,t,n,i,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ge,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(Y,k){return g?new OffscreenCanvas(Y,k):au("canvas")}function E(Y,k,le){let Ae=1;const me=ft(Y);if((me.width>le||me.height>le)&&(Ae=le/Math.max(me.width,me.height)),Ae<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const Ee=Math.floor(Ae*me.width),Oe=Math.floor(Ae*me.height);A===void 0&&(A=v(Ee,Oe));const Ce=k?v(Ee,Oe):A;return Ce.width=Ee,Ce.height=Oe,Ce.getContext("2d").drawImage(Y,0,0,Ee,Oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+Ee+"x"+Oe+")."),Ce}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==fr&&Y.minFilter!==pr}function _(Y){r.generateMipmap(Y)}function w(Y,k,le,Ae,me=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let Ee=k;if(k===r.RED&&(le===r.FLOAT&&(Ee=r.R32F),le===r.HALF_FLOAT&&(Ee=r.R16F),le===r.UNSIGNED_BYTE&&(Ee=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.R8UI),le===r.UNSIGNED_SHORT&&(Ee=r.R16UI),le===r.UNSIGNED_INT&&(Ee=r.R32UI),le===r.BYTE&&(Ee=r.R8I),le===r.SHORT&&(Ee=r.R16I),le===r.INT&&(Ee=r.R32I)),k===r.RG&&(le===r.FLOAT&&(Ee=r.RG32F),le===r.HALF_FLOAT&&(Ee=r.RG16F),le===r.UNSIGNED_BYTE&&(Ee=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.RG8UI),le===r.UNSIGNED_SHORT&&(Ee=r.RG16UI),le===r.UNSIGNED_INT&&(Ee=r.RG32UI),le===r.BYTE&&(Ee=r.RG8I),le===r.SHORT&&(Ee=r.RG16I),le===r.INT&&(Ee=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(Ee=r.RGB9_E5),k===r.RGBA){const Oe=me?td:Rt.getTransfer(Ae);le===r.FLOAT&&(Ee=r.RGBA32F),le===r.HALF_FLOAT&&(Ee=r.RGBA16F),le===r.UNSIGNED_BYTE&&(Ee=Oe===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(Ee=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(Ee=r.RGB5_A1)}return(Ee===r.R16F||Ee===r.R32F||Ee===r.RG16F||Ee===r.RG32F||Ee===r.RGBA16F||Ee===r.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==fr&&Y.minFilter!==pr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),M(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function M(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,Ae=p.get(le);if(Ae){const me=Ae[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(Ae).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,Ae=p.get(le);delete Ae[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(k.__webglFramebuffer[Ae]))for(let me=0;me<k.__webglFramebuffer[Ae].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[Ae][me]);else r.deleteFramebuffer(k.__webglFramebuffer[Ae]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[Ae])}else{if(Array.isArray(k.__webglFramebuffer))for(let Ae=0;Ae<k.__webglFramebuffer.length;Ae++)r.deleteFramebuffer(k.__webglFramebuffer[Ae]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let Ae=0;Ae<k.__webglColorRenderbuffer.length;Ae++)k.__webglColorRenderbuffer[Ae]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[Ae]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let Ae=0,me=le.length;Ae<me;Ae++){const Ee=n.get(le[Ae]);Ee.__webglTexture&&(r.deleteTexture(Ee.__webglTexture),o.memory.textures--),n.remove(le[Ae])}n.remove(Y)}let b=0;function S(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const le=n.get(Y);if(Y.isVideoTexture&&dt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const Ae=Y.image;if(Ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(le,Y,k);return}}t.bindTexture(r.TEXTURE_2D,le.__webglTexture,r.TEXTURE0+k)}function W(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,le.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_3D,le.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){re(le,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture,r.TEXTURE0+k)}const te={[$s]:r.REPEAT,[xi]:r.CLAMP_TO_EDGE,[Yh]:r.MIRRORED_REPEAT},H={[fr]:r.NEAREST,[Vy]:r.NEAREST_MIPMAP_NEAREST,[Jc]:r.NEAREST_MIPMAP_LINEAR,[pr]:r.LINEAR,[qh]:r.LINEAR_MIPMAP_NEAREST,[wi]:r.LINEAR_MIPMAP_LINEAR},ee={[cb]:r.NEVER,[Ab]:r.ALWAYS,[ub]:r.LESS,[vE]:r.LEQUAL,[hb]:r.EQUAL,[pb]:r.GEQUAL,[db]:r.GREATER,[fb]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===pr||k.magFilter===qh||k.magFilter===Jc||k.magFilter===wi||k.minFilter===pr||k.minFilter===qh||k.minFilter===Jc||k.minFilter===wi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,te[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,H[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,H[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,ee[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===fr||k.minFilter!==Jc&&k.minFilter!==wi||k.type===lr&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let le=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const Ae=k.source;let me=p.get(Ae);me===void 0&&(me={},p.set(Ae,me));const Ee=P(k);if(Ee!==Y.__cacheKey){me[Ee]===void 0&&(me[Ee]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[Ee].usedTimes++;const Oe=me[Y.__cacheKey];Oe!==void 0&&(me[Y.__cacheKey].usedTimes--,Oe.usedTimes===0&&T(k)),Y.__cacheKey=Ee,Y.__webglTexture=me[Ee].texture}return le}function Z(Y,k,le){let Ae=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(Ae=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(Ae=r.TEXTURE_3D);const me=z(Y,k),Ee=k.source;t.bindTexture(Ae,Y.__webglTexture,r.TEXTURE0+le);const Oe=n.get(Ee);if(Ee.version!==Oe.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ce=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),ve=k.colorSpace===As||Ce===Qe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,ve);let xe=E(k.image,!1,i.maxTextureSize);xe=Xe(k,xe);const Be=s.convert(k.format,k.colorSpace),Ye=s.convert(k.type);let Le=w(k.internalFormat,Be,Ye,k.colorSpace,k.isVideoTexture);Q(Ae,k);let be;const nt=k.mipmaps,pt=k.isVideoTexture!==!0&&Le!==_A,ct=Oe.__version===void 0||me===!0,ut=Ee.dataReady,tt=x(k,xe);if(k.isDepthTexture)Le=r.DEPTH_COMPONENT16,k.type===lr?Le=r.DEPTH_COMPONENT32F:k.type===Ii?Le=r.DEPTH_COMPONENT24:k.type===$c&&(Le=r.DEPTH24_STENCIL8),ct&&(pt?t.texStorage2D(r.TEXTURE_2D,1,Le,xe.width,xe.height):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,null));else if(k.isDataTexture)if(nt.length>0){pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data);k.generateMipmaps=!1}else pt?(ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,xe.width,xe.height,Be,Ye,xe.data)):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,xe.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){pt&&ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,nt[0].width,nt[0].height,xe.depth);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,Ye,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,Be,Ye,be.data)}else{pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,be.data):t.compressedTexImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data)}else if(k.isDataArrayTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isData3DTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_3D,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_3D,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isFramebufferTexture){if(ct)if(pt)t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height);else{let V=xe.width,F=xe.height;for(let ge=0;ge<tt;ge++)t.texImage2D(r.TEXTURE_2D,ge,Le,V,F,0,Be,Ye,null),V>>=1,F>>=1}}else if(nt.length>0){if(pt&&ct){const V=ft(nt[0]);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,Be,Ye,be):t.texImage2D(r.TEXTURE_2D,V,Le,Be,Ye,be);k.generateMipmaps=!1}else if(pt){if(ct){const V=ft(xe);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Be,Ye,xe)}else t.texImage2D(r.TEXTURE_2D,0,Le,Be,Ye,xe);m(k)&&_(Ae),Oe.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const Ae=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const Ee=n.get(me);if(me.version!==Ee.__version||Ae===!0){t.activeTexture(r.TEXTURE0+le);const Oe=Rt.getPrimaries(Rt.workingColorSpace),Ce=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===As||Oe===Ce?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const ve=k.isCompressedTexture||k.image[0].isCompressedTexture,xe=k.image[0]&&k.image[0].isDataTexture,Be=[];for(let F=0;F<6;F++)!ve&&!xe?Be[F]=E(k.image[F],!0,i.maxCubemapSize):Be[F]=xe?k.image[F].image:k.image[F],Be[F]=Xe(k,Be[F]);const Ye=Be[0],Le=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Le,be,k.colorSpace),pt=k.isVideoTexture!==!0,ct=Ee.__version===void 0||Ae===!0,ut=me.dataReady;let tt=x(k,Ye);Q(r.TEXTURE_CUBE_MAP,k);let V;if(ve){pt&&ct&&t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,Ye.width,Ye.height);for(let F=0;F<6;F++){V=Be[F].mipmaps;for(let ge=0;ge<V.length;ge++){const _e=V[ge];k.format!==gr?Le!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,Le,be,_e.data)}}}else{if(V=k.mipmaps,pt&&ct){V.length>0&&tt++;const F=ft(Be[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,F.width,F.height)}for(let F=0;F<6;F++)if(xe){pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Be[F].width,Be[F].height,Le,be,Be[F].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Be[F].width,Be[F].height,0,Le,be,Be[F].data);for(let ge=0;ge<V.length;ge++){const _e=V[ge].image[F].image;pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,_e.width,_e.height,0,Le,be,_e.data)}}else{pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Le,be,Be[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Le,be,Be[F]);for(let ge=0;ge<V.length;ge++){const _e=V[ge];pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,Le,be,_e.image[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,Le,be,_e.image[F])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),Ee.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function G(Y,k,le,Ae,me,Ee){const Oe=s.convert(le.format,le.colorSpace),Ce=s.convert(le.type),Qe=w(le.internalFormat,Oe,Ce,le.colorSpace);if(!n.get(k).__hasExternalTextures){const ve=Math.max(1,k.width>>Ee),xe=Math.max(1,k.height>>Ee);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,Ee,Qe,ve,xe,k.depth,0,Oe,Ce,null):t.texImage2D(me,Ee,Qe,ve,xe,0,Oe,Ce,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Ae,me,n.get(le).__webglTexture,0,et(k)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Ae,me,n.get(le).__webglTexture,Ee),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let Ae=r.DEPTH_COMPONENT24;if(le||ke(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?Ae=r.DEPTH_COMPONENT32F:me.type===Ii&&(Ae=r.DEPTH_COMPONENT24));const Ee=et(k);ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ee,Ae,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Ee,Ae,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,Ae,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const Ae=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const Ae=k.textures;for(let me=0;me<Ae.length;me++){const Ee=Ae[me],Oe=s.convert(Ee.format,Ee.colorSpace),Ce=s.convert(Ee.type),Qe=w(Ee.internalFormat,Oe,Ce,Ee.colorSpace),ve=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ve,Qe,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ve,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pe(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const le=n.get(k.depthTexture).__webglTexture,Ae=et(k);if(k.depthTexture.format===nl)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===eu)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function fe(Y){const k=n.get(Y),le=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");pe(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[Ae]),k.__webglDepthbuffer[Ae]=r.createRenderbuffer(),de(k.__webglDepthbuffer[Ae],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,le){const Ae=n.get(Y);k!==void 0&&G(Ae.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&fe(Y)}function Pe(Y){const k=Y.texture,le=n.get(Y),Ae=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,Ee=Y.isWebGLCubeRenderTarget===!0,Oe=me.length>1;if(Oe||(Ae.__webglTexture===void 0&&(Ae.__webglTexture=r.createTexture()),Ae.__version=k.version,o.memory.textures++),Ee){le.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ce]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)le.__webglFramebuffer[Ce][Qe]=r.createFramebuffer()}else le.__webglFramebuffer[Ce]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ce=0;Ce<k.mipmaps.length;Ce++)le.__webglFramebuffer[Ce]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(Oe)for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=n.get(me[Ce]);ve.__webglTexture===void 0&&(ve.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&ke(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ce=0;Ce<me.length;Ce++){const Qe=me[Ce];le.__webglColorRenderbuffer[Ce]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce]);const ve=s.convert(Qe.format,Qe.colorSpace),xe=s.convert(Qe.type),Be=w(Qe.internalFormat,ve,xe,Qe.colorSpace,Y.isXRRenderTarget===!0),Ye=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ye,Be,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ce,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Ee){t.bindTexture(r.TEXTURE_CUBE_MAP,Ae.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Ce][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Qe);else G(le.__webglFramebuffer[Ce],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Oe){for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=me[Ce],xe=n.get(ve);t.bindTexture(r.TEXTURE_2D,xe.__webglTexture),Q(r.TEXTURE_2D,ve),G(le.__webglFramebuffer,Y,ve,r.COLOR_ATTACHMENT0+Ce,r.TEXTURE_2D,0),m(ve)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ce=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ce=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ce,Ae.__webglTexture),Q(Ce,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ce,Qe);else G(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ce,0);m(k)&&_(Ce),t.unbindTexture()}Y.depthBuffer&&fe(Y)}function at(Y){const k=Y.textures;for(let le=0,Ae=k.length;le<Ae;le++){const me=k[le];if(m(me)){const Ee=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Oe=n.get(me).__webglTexture;t.bindTexture(Ee,Oe),_(Ee),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&ke(Y)===!1){const k=Y.textures,le=Y.width,Ae=Y.height;let me=r.COLOR_BUFFER_BIT;const Ee=[],Oe=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(Y),Qe=k.length>1;if(Qe)for(let ve=0;ve<k.length;ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let ve=0;ve<k.length;ve++){Ee.push(r.COLOR_ATTACHMENT0+ve),Y.depthBuffer&&Ee.push(Oe);const xe=Ce.__ignoreDepthValues!==void 0?Ce.__ignoreDepthValues:!1;if(xe===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ce.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]),xe===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Oe]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Oe])),Qe){const Be=n.get(k[ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Be,0)}r.blitFramebuffer(0,0,le,Ae,0,0,le,Ae,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Ee)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let ve=0;ve<k.length;ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]);const xe=n.get(k[ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,xe,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function ke(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function dt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Xe(Y,k){const le=Y.colorSpace,Ae=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==Sr&&le!==As&&(Rt.getTransfer(le)===Ht?(Ae!==gr||me!==Ar)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function ft(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=S,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=at,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=G,this.useMultisampledRTT=ke}function bL(r,e){function t(n,i=As){let s;const o=Rt.getTransfer(i);if(n===Ar)return r.UNSIGNED_BYTE;if(n===Wy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Yy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===ZB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hA)return r.BYTE;if(n===jy)return r.SHORT;if(n===dA)return r.UNSIGNED_SHORT;if(n===Zc)return r.INT;if(n===Ii)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===yn)return r.HALF_FLOAT;if(n===$B)return r.ALPHA;if(n===eb)return r.RGB;if(n===gr)return r.RGBA;if(n===tb)return r.LUMINANCE;if(n===rb)return r.LUMINANCE_ALPHA;if(n===nl)return r.DEPTH_COMPONENT;if(n===eu)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===fA)return r.RED_INTEGER;if(n===io)return r.RG;if(n===Xh)return r.RG_INTEGER;if(n===tu)return r.RGBA_INTEGER;if(n===Kh||n===pA||n===AA||n===Jh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Kh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Kh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===gA||n===qy||n===mA||n===Xy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===gA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===mA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Xy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===_A)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===vA||n===yA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===EA||n===Ky||n===Jy||n===Zy||n===Zh||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE||n===oE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===EA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Zh)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===oE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$h||n===lE||n===cE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===$h)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===cE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===nb||n===uE||n===hE||n===dE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===$h)return s.COMPRESSED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===hE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===dE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===$c?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class RL extends un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DL={type:"move"};class tg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new oa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}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}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const c=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(DL)))}return c!==null&&(c.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new oa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const LL=`
|
|
3804
|
+
}`;function ML(r,e,t){let n=new WA;const i=new Ge,s=new Ge,o=new Ot,c=new M2({depthPacking:ob}),h=new IL,u={},d=t.maxTextureSize,A={[yi]:kr,[kr]:yi,[Ei]:Ei},p=new En({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:CL,fragmentShader:SL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Gn;v.setAttribute("position",new Fr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Yr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dy;let _=this.type;this.render=function(M,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||M.length===0)return;const b=r.getRenderTarget(),S=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(ps),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==fs&&this.type===fs,W=_===fs&&this.type!==fs;for(let X=0,K=M.length;X<K;X++){const te=M[X],H=te.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const ee=H.getFrameExtents();if(i.multiply(ee),s.copy(H.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,H.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,H.mapSize.y=s.y)),H.map===null||N===!0||W===!0){const z=this.type!==fs?{minFilter:fr,magFilter:fr}:{};H.map!==null&&H.map.dispose(),H.map=new Mi(i.x,i.y,z),H.map.texture.name=te.name+".shadowMap",H.camera.updateProjectionMatrix()}r.setRenderTarget(H.map),r.clear();const Q=H.getViewportCount();for(let z=0;z<Q;z++){const Z=H.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),H.updateMatrices(te,z),n=H.getFrustum(),I(T,D,H.camera,te,this.type)}H.isPointLightShadow!==!0&&this.type===fs&&w(H,D),H.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,S,L)};function w(M,T){const D=e.update(E);p.defines.VSM_SAMPLES!==M.blurSamples&&(p.defines.VSM_SAMPLES=M.blurSamples,g.defines.VSM_SAMPLES=M.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=M.mapPass.texture,g.uniforms.resolution.value=M.mapSize,g.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(M,T,D,b){let S=null;const L=D.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(L!==void 0)S=L;else if(S=D.isPointLight===!0?h:c,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=S.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=S.clone(),W[N]=X,T.addEventListener("dispose",R)),S=X}if(S.visible=T.visible,S.wireframe=T.wireframe,b===fs?S.side=T.shadowSide!==null?T.shadowSide:T.side:S.side=T.shadowSide!==null?T.shadowSide:A[T.side],S.alphaMap=T.alphaMap,S.alphaTest=T.alphaTest,S.map=T.map,S.clipShadows=T.clipShadows,S.clippingPlanes=T.clippingPlanes,S.clipIntersection=T.clipIntersection,S.displacementMap=T.displacementMap,S.displacementScale=T.displacementScale,S.displacementBias=T.displacementBias,S.wireframeLinewidth=T.wireframeLinewidth,S.linewidth=T.linewidth,D.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const P=r.properties.get(S);P.light=D}return S}function I(M,T,D,b,S){if(M.visible===!1)return;if(M.layers.test(T.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&S===fs)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,M.matrixWorld);const P=e.update(M),N=M.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],H=N[te.materialIndex];if(H&&H.visible){const ee=x(M,H,b,S);M.onBeforeShadow(r,M,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,M,te),M.onAfterShadow(r,M,T,D,P,ee,te)}}}else if(N.visible){const W=x(M,N,b,S);M.onBeforeShadow(r,M,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,M,null),M.onAfterShadow(r,M,T,D,P,W,null)}}const L=M.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,S)}function R(M){M.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=M.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function TL(r){function e(){let F=!1;const ge=new Ot;let _e=null;const ze=new Ot(0,0,0,0);return{setMask:function(Ne){_e!==Ne&&!F&&(r.colorMask(Ne,Ne,Ne,Ne),_e=Ne)},setLocked:function(Ne){F=Ne},setClear:function(Ne,_t,Dt,Lt,Mt){Mt===!0&&(Ne*=Lt,_t*=Lt,Dt*=Lt),ge.set(Ne,_t,Dt,Lt),ze.equals(ge)===!1&&(r.clearColor(Ne,_t,Dt,Lt),ze.copy(ge))},reset:function(){F=!1,_e=null,ze.set(-1,0,0,0)}}}function t(){let F=!1,ge=null,_e=null,ze=null;return{setTest:function(Ne){Ne?pe(r.DEPTH_TEST):fe(r.DEPTH_TEST)},setMask:function(Ne){ge!==Ne&&!F&&(r.depthMask(Ne),ge=Ne)},setFunc:function(Ne){if(_e!==Ne){switch(Ne){case OB:r.depthFunc(r.NEVER);break;case zB:r.depthFunc(r.ALWAYS);break;case HB:r.depthFunc(r.LESS);break;case Wh:r.depthFunc(r.LEQUAL);break;case GB:r.depthFunc(r.EQUAL);break;case VB:r.depthFunc(r.GEQUAL);break;case jB:r.depthFunc(r.GREATER);break;case WB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=Ne}},setLocked:function(Ne){F=Ne},setClear:function(Ne){ze!==Ne&&(r.clearDepth(Ne),ze=Ne)},reset:function(){F=!1,ge=null,_e=null,ze=null}}}function n(){let F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null;return{setTest:function(vt){F||(vt?pe(r.STENCIL_TEST):fe(r.STENCIL_TEST))},setMask:function(vt){ge!==vt&&!F&&(r.stencilMask(vt),ge=vt)},setFunc:function(vt,hr,Vt){(_e!==vt||ze!==hr||Ne!==Vt)&&(r.stencilFunc(vt,hr,Vt),_e=vt,ze=hr,Ne=Vt)},setOp:function(vt,hr,Vt){(_t!==vt||Dt!==hr||Lt!==Vt)&&(r.stencilOp(vt,hr,Vt),_t=vt,Dt=hr,Lt=Vt)},setLocked:function(vt){F=vt},setClear:function(vt){Mt!==vt&&(r.clearStencil(vt),Mt=vt)},reset:function(){F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=null,L=null,P=null,N=null;const W=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const te=r.getParameter(r.VERSION);te.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(te)[1]),X=K>=1):te.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),X=K>=2);let H=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ot().fromArray(Q),re=new Ot().fromArray(z);function G(F,ge,_e,ze){const Ne=new Uint8Array(4),_t=r.createTexture();r.bindTexture(F,_t),r.texParameteri(F,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(F,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,ze,0,r.RGBA,r.UNSIGNED_BYTE,Ne):r.texImage2D(ge+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Ne);return _t}const de={};de[r.TEXTURE_2D]=G(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=G(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=G(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=G(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pe(r.DEPTH_TEST),s.setFunc(Wh),Xe(!1),ft(Ry),pe(r.CULL_FACE),ke(ps);function pe(F){u[F]!==!0&&(r.enable(F),u[F]=!0)}function fe(F){u[F]!==!1&&(r.disable(F),u[F]=!1)}function ye(F,ge){return d[F]!==ge?(r.bindFramebuffer(F,ge),d[F]=ge,F===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),F===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Pe(F,ge){let _e=p,ze=!1;if(F){_e=A.get(ge),_e===void 0&&(_e=[],A.set(ge,_e));const Ne=F.textures;if(_e.length!==Ne.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let _t=0,Dt=Ne.length;_t<Dt;_t++)_e[_t]=r.COLOR_ATTACHMENT0+_t;_e.length=Ne.length,ze=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,ze=!0);ze&&r.drawBuffers(_e)}function at(F){return g!==F?(r.useProgram(F),g=F,!0):!1}const se={[ro]:r.FUNC_ADD,[wB]:r.FUNC_SUBTRACT,[IB]:r.FUNC_REVERSE_SUBTRACT};se[CB]=r.MIN,se[SB]=r.MAX;const et={[MB]:r.ZERO,[TB]:r.ONE,[BB]:r.SRC_COLOR,[oA]:r.SRC_ALPHA,[UB]:r.SRC_ALPHA_SATURATE,[LB]:r.DST_COLOR,[RB]:r.DST_ALPHA,[bB]:r.ONE_MINUS_SRC_COLOR,[lA]:r.ONE_MINUS_SRC_ALPHA,[NB]:r.ONE_MINUS_DST_COLOR,[DB]:r.ONE_MINUS_DST_ALPHA,[PB]:r.CONSTANT_COLOR,[kB]:r.ONE_MINUS_CONSTANT_COLOR,[QB]:r.CONSTANT_ALPHA,[FB]:r.ONE_MINUS_CONSTANT_ALPHA};function ke(F,ge,_e,ze,Ne,_t,Dt,Lt,Mt,vt){if(F===ps){v===!0&&(fe(r.BLEND),v=!1);return}if(v===!1&&(pe(r.BLEND),v=!0),F!==xB){if(F!==E||vt!==D){if((m!==ro||x!==ro)&&(r.blendEquation(r.FUNC_ADD),m=ro,x=ro),vt)switch(F){case rl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.ONE,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}else switch(F){case rl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}_=null,w=null,I=null,R=null,M.set(0,0,0),T=0,E=F,D=vt}return}Ne=Ne||ge,_t=_t||_e,Dt=Dt||ze,(ge!==m||Ne!==x)&&(r.blendEquationSeparate(se[ge],se[Ne]),m=ge,x=Ne),(_e!==_||ze!==w||_t!==I||Dt!==R)&&(r.blendFuncSeparate(et[_e],et[ze],et[_t],et[Dt]),_=_e,w=ze,I=_t,R=Dt),(Lt.equals(M)===!1||Mt!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,Mt),M.copy(Lt),T=Mt),E=F,D=!1}function dt(F,ge){F.side===Ei?fe(r.CULL_FACE):pe(r.CULL_FACE);let _e=F.side===kr;ge&&(_e=!_e),Xe(_e),F.blending===rl&&F.transparent===!1?ke(ps):ke(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.blendColor,F.blendAlpha,F.premultipliedAlpha),s.setFunc(F.depthFunc),s.setTest(F.depthTest),s.setMask(F.depthWrite),i.setMask(F.colorWrite);const ze=F.stencilWrite;o.setTest(ze),ze&&(o.setMask(F.stencilWriteMask),o.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),o.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),k(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),F.alphaToCoverage===!0?pe(r.SAMPLE_ALPHA_TO_COVERAGE):fe(r.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(F){b!==F&&(F?r.frontFace(r.CW):r.frontFace(r.CCW),b=F)}function ft(F){F!==vB?(pe(r.CULL_FACE),F!==S&&(F===Ry?r.cullFace(r.BACK):F===yB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):fe(r.CULL_FACE),S=F}function Y(F){F!==L&&(X&&r.lineWidth(F),L=F)}function k(F,ge,_e){F?(pe(r.POLYGON_OFFSET_FILL),(P!==ge||N!==_e)&&(r.polygonOffset(ge,_e),P=ge,N=_e)):fe(r.POLYGON_OFFSET_FILL)}function le(F){F?pe(r.SCISSOR_TEST):fe(r.SCISSOR_TEST)}function Ae(F){F===void 0&&(F=r.TEXTURE0+W-1),H!==F&&(r.activeTexture(F),H=F)}function me(F,ge,_e){_e===void 0&&(H===null?_e=r.TEXTURE0+W-1:_e=H);let ze=ee[_e];ze===void 0&&(ze={type:void 0,texture:void 0},ee[_e]=ze),(ze.type!==F||ze.texture!==ge)&&(H!==_e&&(r.activeTexture(_e),H=_e),r.bindTexture(F,ge||de[F]),ze.type=F,ze.texture=ge)}function Ee(){const F=ee[H];F!==void 0&&F.type!==void 0&&(r.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)}function Oe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ce(){try{r.compressedTexImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ve(){try{r.texSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function xe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Be(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ye(){try{r.texStorage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Le(){try{r.texStorage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function pt(F){Z.equals(F)===!1&&(r.scissor(F.x,F.y,F.z,F.w),Z.copy(F))}function ct(F){re.equals(F)===!1&&(r.viewport(F.x,F.y,F.z,F.w),re.copy(F))}function ut(F,ge){let _e=h.get(ge);_e===void 0&&(_e=new WeakMap,h.set(ge,_e));let ze=_e.get(F);ze===void 0&&(ze=r.getUniformBlockIndex(ge,F.name),_e.set(F,ze))}function tt(F,ge){const _e=h.get(ge).get(F);c.get(ge)!==_e&&(r.uniformBlockBinding(ge,_e,F.__bindingPointIndex),c.set(ge,_e))}function V(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},H=null,ee={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:pe,disable:fe,bindFramebuffer:ye,drawBuffers:Pe,useProgram:at,setBlending:ke,setMaterial:dt,setFlipSided:Xe,setCullFace:ft,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:Ae,bindTexture:me,unbindTexture:Ee,compressedTexImage2D:Oe,compressedTexImage3D:Ce,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:tt,texStorage2D:Ye,texStorage3D:Le,texSubImage2D:Qe,texSubImage3D:ve,compressedTexSubImage2D:xe,compressedTexSubImage3D:Be,scissor:pt,viewport:ct,reset:V}}function BL(r,e,t,n,i,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ge,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(Y,k){return g?new OffscreenCanvas(Y,k):au("canvas")}function E(Y,k,le){let Ae=1;const me=ft(Y);if((me.width>le||me.height>le)&&(Ae=le/Math.max(me.width,me.height)),Ae<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const Ee=Math.floor(Ae*me.width),Oe=Math.floor(Ae*me.height);A===void 0&&(A=v(Ee,Oe));const Ce=k?v(Ee,Oe):A;return Ce.width=Ee,Ce.height=Oe,Ce.getContext("2d").drawImage(Y,0,0,Ee,Oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+Ee+"x"+Oe+")."),Ce}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==fr&&Y.minFilter!==pr}function _(Y){r.generateMipmap(Y)}function w(Y,k,le,Ae,me=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let Ee=k;if(k===r.RED&&(le===r.FLOAT&&(Ee=r.R32F),le===r.HALF_FLOAT&&(Ee=r.R16F),le===r.UNSIGNED_BYTE&&(Ee=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.R8UI),le===r.UNSIGNED_SHORT&&(Ee=r.R16UI),le===r.UNSIGNED_INT&&(Ee=r.R32UI),le===r.BYTE&&(Ee=r.R8I),le===r.SHORT&&(Ee=r.R16I),le===r.INT&&(Ee=r.R32I)),k===r.RG&&(le===r.FLOAT&&(Ee=r.RG32F),le===r.HALF_FLOAT&&(Ee=r.RG16F),le===r.UNSIGNED_BYTE&&(Ee=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.RG8UI),le===r.UNSIGNED_SHORT&&(Ee=r.RG16UI),le===r.UNSIGNED_INT&&(Ee=r.RG32UI),le===r.BYTE&&(Ee=r.RG8I),le===r.SHORT&&(Ee=r.RG16I),le===r.INT&&(Ee=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(Ee=r.RGB9_E5),k===r.RGBA){const Oe=me?rd:Rt.getTransfer(Ae);le===r.FLOAT&&(Ee=r.RGBA32F),le===r.HALF_FLOAT&&(Ee=r.RGBA16F),le===r.UNSIGNED_BYTE&&(Ee=Oe===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(Ee=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(Ee=r.RGB5_A1)}return(Ee===r.R16F||Ee===r.R32F||Ee===r.RG16F||Ee===r.RG32F||Ee===r.RGBA16F||Ee===r.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==fr&&Y.minFilter!==pr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),M(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function M(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,Ae=p.get(le);if(Ae){const me=Ae[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(Ae).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,Ae=p.get(le);delete Ae[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(k.__webglFramebuffer[Ae]))for(let me=0;me<k.__webglFramebuffer[Ae].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[Ae][me]);else r.deleteFramebuffer(k.__webglFramebuffer[Ae]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[Ae])}else{if(Array.isArray(k.__webglFramebuffer))for(let Ae=0;Ae<k.__webglFramebuffer.length;Ae++)r.deleteFramebuffer(k.__webglFramebuffer[Ae]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let Ae=0;Ae<k.__webglColorRenderbuffer.length;Ae++)k.__webglColorRenderbuffer[Ae]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[Ae]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let Ae=0,me=le.length;Ae<me;Ae++){const Ee=n.get(le[Ae]);Ee.__webglTexture&&(r.deleteTexture(Ee.__webglTexture),o.memory.textures--),n.remove(le[Ae])}n.remove(Y)}let b=0;function S(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const le=n.get(Y);if(Y.isVideoTexture&&dt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const Ae=Y.image;if(Ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ae.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(le,Y,k);return}}t.bindTexture(r.TEXTURE_2D,le.__webglTexture,r.TEXTURE0+k)}function W(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,le.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_3D,le.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){re(le,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture,r.TEXTURE0+k)}const te={[$s]:r.REPEAT,[xi]:r.CLAMP_TO_EDGE,[qh]:r.MIRRORED_REPEAT},H={[fr]:r.NEAREST,[Vy]:r.NEAREST_MIPMAP_NEAREST,[Jc]:r.NEAREST_MIPMAP_LINEAR,[pr]:r.LINEAR,[Xh]:r.LINEAR_MIPMAP_NEAREST,[wi]:r.LINEAR_MIPMAP_LINEAR},ee={[cb]:r.NEVER,[Ab]:r.ALWAYS,[ub]:r.LESS,[vE]:r.LEQUAL,[hb]:r.EQUAL,[pb]:r.GEQUAL,[db]:r.GREATER,[fb]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===pr||k.magFilter===Xh||k.magFilter===Jc||k.magFilter===wi||k.minFilter===pr||k.minFilter===Xh||k.minFilter===Jc||k.minFilter===wi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,te[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,H[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,H[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,ee[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===fr||k.minFilter!==Jc&&k.minFilter!==wi||k.type===lr&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let le=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const Ae=k.source;let me=p.get(Ae);me===void 0&&(me={},p.set(Ae,me));const Ee=P(k);if(Ee!==Y.__cacheKey){me[Ee]===void 0&&(me[Ee]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[Ee].usedTimes++;const Oe=me[Y.__cacheKey];Oe!==void 0&&(me[Y.__cacheKey].usedTimes--,Oe.usedTimes===0&&T(k)),Y.__cacheKey=Ee,Y.__webglTexture=me[Ee].texture}return le}function Z(Y,k,le){let Ae=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(Ae=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(Ae=r.TEXTURE_3D);const me=z(Y,k),Ee=k.source;t.bindTexture(Ae,Y.__webglTexture,r.TEXTURE0+le);const Oe=n.get(Ee);if(Ee.version!==Oe.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ce=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),ve=k.colorSpace===As||Ce===Qe?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,ve);let xe=E(k.image,!1,i.maxTextureSize);xe=Xe(k,xe);const Be=s.convert(k.format,k.colorSpace),Ye=s.convert(k.type);let Le=w(k.internalFormat,Be,Ye,k.colorSpace,k.isVideoTexture);Q(Ae,k);let be;const nt=k.mipmaps,pt=k.isVideoTexture!==!0&&Le!==_A,ct=Oe.__version===void 0||me===!0,ut=Ee.dataReady,tt=x(k,xe);if(k.isDepthTexture)Le=r.DEPTH_COMPONENT16,k.type===lr?Le=r.DEPTH_COMPONENT32F:k.type===Ii?Le=r.DEPTH_COMPONENT24:k.type===$c&&(Le=r.DEPTH24_STENCIL8),ct&&(pt?t.texStorage2D(r.TEXTURE_2D,1,Le,xe.width,xe.height):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,null));else if(k.isDataTexture)if(nt.length>0){pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data);k.generateMipmaps=!1}else pt?(ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,xe.width,xe.height,Be,Ye,xe.data)):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,xe.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){pt&&ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,nt[0].width,nt[0].height,xe.depth);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,Ye,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,Be,Ye,be.data)}else{pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,be.data):t.compressedTexImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data)}else if(k.isDataArrayTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isData3DTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_3D,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_3D,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isFramebufferTexture){if(ct)if(pt)t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height);else{let V=xe.width,F=xe.height;for(let ge=0;ge<tt;ge++)t.texImage2D(r.TEXTURE_2D,ge,Le,V,F,0,Be,Ye,null),V>>=1,F>>=1}}else if(nt.length>0){if(pt&&ct){const V=ft(nt[0]);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,Be,Ye,be):t.texImage2D(r.TEXTURE_2D,V,Le,Be,Ye,be);k.generateMipmaps=!1}else if(pt){if(ct){const V=ft(xe);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Be,Ye,xe)}else t.texImage2D(r.TEXTURE_2D,0,Le,Be,Ye,xe);m(k)&&_(Ae),Oe.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const Ae=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const Ee=n.get(me);if(me.version!==Ee.__version||Ae===!0){t.activeTexture(r.TEXTURE0+le);const Oe=Rt.getPrimaries(Rt.workingColorSpace),Ce=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===As||Oe===Ce?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const ve=k.isCompressedTexture||k.image[0].isCompressedTexture,xe=k.image[0]&&k.image[0].isDataTexture,Be=[];for(let F=0;F<6;F++)!ve&&!xe?Be[F]=E(k.image[F],!0,i.maxCubemapSize):Be[F]=xe?k.image[F].image:k.image[F],Be[F]=Xe(k,Be[F]);const Ye=Be[0],Le=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Le,be,k.colorSpace),pt=k.isVideoTexture!==!0,ct=Ee.__version===void 0||Ae===!0,ut=me.dataReady;let tt=x(k,Ye);Q(r.TEXTURE_CUBE_MAP,k);let V;if(ve){pt&&ct&&t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,Ye.width,Ye.height);for(let F=0;F<6;F++){V=Be[F].mipmaps;for(let ge=0;ge<V.length;ge++){const _e=V[ge];k.format!==gr?Le!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,Le,be,_e.data)}}}else{if(V=k.mipmaps,pt&&ct){V.length>0&&tt++;const F=ft(Be[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,F.width,F.height)}for(let F=0;F<6;F++)if(xe){pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Be[F].width,Be[F].height,Le,be,Be[F].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Be[F].width,Be[F].height,0,Le,be,Be[F].data);for(let ge=0;ge<V.length;ge++){const _e=V[ge].image[F].image;pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,_e.width,_e.height,0,Le,be,_e.data)}}else{pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Le,be,Be[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Le,be,Be[F]);for(let ge=0;ge<V.length;ge++){const _e=V[ge];pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,Le,be,_e.image[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,Le,be,_e.image[F])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),Ee.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function G(Y,k,le,Ae,me,Ee){const Oe=s.convert(le.format,le.colorSpace),Ce=s.convert(le.type),Qe=w(le.internalFormat,Oe,Ce,le.colorSpace);if(!n.get(k).__hasExternalTextures){const ve=Math.max(1,k.width>>Ee),xe=Math.max(1,k.height>>Ee);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,Ee,Qe,ve,xe,k.depth,0,Oe,Ce,null):t.texImage2D(me,Ee,Qe,ve,xe,0,Oe,Ce,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Ae,me,n.get(le).__webglTexture,0,et(k)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Ae,me,n.get(le).__webglTexture,Ee),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let Ae=r.DEPTH_COMPONENT24;if(le||ke(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?Ae=r.DEPTH_COMPONENT32F:me.type===Ii&&(Ae=r.DEPTH_COMPONENT24));const Ee=et(k);ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ee,Ae,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Ee,Ae,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,Ae,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const Ae=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const Ae=k.textures;for(let me=0;me<Ae.length;me++){const Ee=Ae[me],Oe=s.convert(Ee.format,Ee.colorSpace),Ce=s.convert(Ee.type),Qe=w(Ee.internalFormat,Oe,Ce,Ee.colorSpace),ve=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ve,Qe,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ve,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pe(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const le=n.get(k.depthTexture).__webglTexture,Ae=et(k);if(k.depthTexture.format===il)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===eu)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function fe(Y){const k=n.get(Y),le=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");pe(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[Ae]),k.__webglDepthbuffer[Ae]=r.createRenderbuffer(),de(k.__webglDepthbuffer[Ae],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,le){const Ae=n.get(Y);k!==void 0&&G(Ae.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&fe(Y)}function Pe(Y){const k=Y.texture,le=n.get(Y),Ae=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,Ee=Y.isWebGLCubeRenderTarget===!0,Oe=me.length>1;if(Oe||(Ae.__webglTexture===void 0&&(Ae.__webglTexture=r.createTexture()),Ae.__version=k.version,o.memory.textures++),Ee){le.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ce]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)le.__webglFramebuffer[Ce][Qe]=r.createFramebuffer()}else le.__webglFramebuffer[Ce]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ce=0;Ce<k.mipmaps.length;Ce++)le.__webglFramebuffer[Ce]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(Oe)for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=n.get(me[Ce]);ve.__webglTexture===void 0&&(ve.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&ke(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ce=0;Ce<me.length;Ce++){const Qe=me[Ce];le.__webglColorRenderbuffer[Ce]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce]);const ve=s.convert(Qe.format,Qe.colorSpace),xe=s.convert(Qe.type),Be=w(Qe.internalFormat,ve,xe,Qe.colorSpace,Y.isXRRenderTarget===!0),Ye=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ye,Be,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ce,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Ee){t.bindTexture(r.TEXTURE_CUBE_MAP,Ae.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Ce][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Qe);else G(le.__webglFramebuffer[Ce],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Oe){for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=me[Ce],xe=n.get(ve);t.bindTexture(r.TEXTURE_2D,xe.__webglTexture),Q(r.TEXTURE_2D,ve),G(le.__webglFramebuffer,Y,ve,r.COLOR_ATTACHMENT0+Ce,r.TEXTURE_2D,0),m(ve)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ce=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ce=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ce,Ae.__webglTexture),Q(Ce,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ce,Qe);else G(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ce,0);m(k)&&_(Ce),t.unbindTexture()}Y.depthBuffer&&fe(Y)}function at(Y){const k=Y.textures;for(let le=0,Ae=k.length;le<Ae;le++){const me=k[le];if(m(me)){const Ee=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Oe=n.get(me).__webglTexture;t.bindTexture(Ee,Oe),_(Ee),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&ke(Y)===!1){const k=Y.textures,le=Y.width,Ae=Y.height;let me=r.COLOR_BUFFER_BIT;const Ee=[],Oe=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(Y),Qe=k.length>1;if(Qe)for(let ve=0;ve<k.length;ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let ve=0;ve<k.length;ve++){Ee.push(r.COLOR_ATTACHMENT0+ve),Y.depthBuffer&&Ee.push(Oe);const xe=Ce.__ignoreDepthValues!==void 0?Ce.__ignoreDepthValues:!1;if(xe===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ce.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]),xe===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Oe]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Oe])),Qe){const Be=n.get(k[ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Be,0)}r.blitFramebuffer(0,0,le,Ae,0,0,le,Ae,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Ee)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let ve=0;ve<k.length;ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]);const xe=n.get(k[ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,xe,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function ke(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function dt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Xe(Y,k){const le=Y.colorSpace,Ae=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==Sr&&le!==As&&(Rt.getTransfer(le)===Ht?(Ae!==gr||me!==Ar)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function ft(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=S,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=at,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=G,this.useMultisampledRTT=ke}function bL(r,e){function t(n,i=As){let s;const o=Rt.getTransfer(i);if(n===Ar)return r.UNSIGNED_BYTE;if(n===Wy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Yy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===ZB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hA)return r.BYTE;if(n===jy)return r.SHORT;if(n===dA)return r.UNSIGNED_SHORT;if(n===Zc)return r.INT;if(n===Ii)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===yn)return r.HALF_FLOAT;if(n===$B)return r.ALPHA;if(n===eb)return r.RGB;if(n===gr)return r.RGBA;if(n===tb)return r.LUMINANCE;if(n===rb)return r.LUMINANCE_ALPHA;if(n===il)return r.DEPTH_COMPONENT;if(n===eu)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===fA)return r.RED_INTEGER;if(n===io)return r.RG;if(n===Kh)return r.RG_INTEGER;if(n===tu)return r.RGBA_INTEGER;if(n===Jh||n===pA||n===AA||n===Zh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Jh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Zh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Jh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Zh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===gA||n===qy||n===mA||n===Xy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===gA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===mA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Xy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===_A)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===vA||n===yA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===EA||n===Ky||n===Jy||n===Zy||n===$h||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE||n===oE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===EA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===$h)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===oE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===ed||n===lE||n===cE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===ed)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===cE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===nb||n===uE||n===hE||n===dE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===ed)return s.COMPRESSED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===hE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===dE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===$c?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class RL extends un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DL={type:"move"};class tg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new oa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}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}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const c=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(DL)))}return c!==null&&(c.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new oa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const LL=`
|
|
3805
3805
|
void main() {
|
|
3806
3806
|
|
|
3807
3807
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3825,12 +3825,12 @@ void main() {
|
|
|
3825
3825
|
|
|
3826
3826
|
}
|
|
3827
3827
|
|
|
3828
|
-
}`;class UL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Tr,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new En({vertexShader:LL,fragmentShader:NL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Yr(new fu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class PL extends so{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new UL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let M=null;const T=new un;T.layers.enable(1),T.viewport=new Ot;const D=new un;D.layers.enable(2),D.viewport=new Ot;const b=[T,D],S=new RL;S.layers.enable(1),S.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getTargetRaySpace()},this.getControllerGrip=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getGripSpace()},this.getHand=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getHandSpace()};function N(G){const de=I.indexOf(G.inputSource);if(de===-1)return;const pe=x[de];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.inputSource}))}function W(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",X);for(let G=0;G<x.length;G++){const de=I[G];de!==null&&(I[G]=null,x[G].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){c=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(G){u=G},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(_=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",W),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const de={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,de),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new Mi(g.framebufferWidth,g.framebufferHeight,{format:gr,type:Ar,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,pe=null,fe=null;m.depth&&(fe=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?eu:nl,pe=m.stencil?$c:Ii);const ye={colorFormat:t.RGBA8,depthFormat:fe,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:gr,type:Ar,depthTexture:new a2(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Pe=e.properties.get(w);Pe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(G){for(let de=0;de<G.removed.length;de++){const pe=G.removed[de],fe=I.indexOf(pe);fe>=0&&(I[fe]=null,x[fe].disconnect(pe))}for(let de=0;de<G.added.length;de++){const pe=G.added[de];let fe=I.indexOf(pe);if(fe===-1){for(let Pe=0;Pe<x.length;Pe++)if(Pe>=I.length){I.push(pe),fe=Pe;break}else if(I[Pe]===null){I[Pe]=pe,fe=Pe;break}if(fe===-1)break}const ye=x[fe];ye&&ye.connect(pe)}}const K=new j,te=new j;function H(G,de,pe){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(pe.matrixWorld);const fe=K.distanceTo(te),ye=de.projectionMatrix.elements,Pe=pe.projectionMatrix.elements,at=ye[14]/(ye[10]-1),se=ye[14]/(ye[10]+1),et=(ye[9]+1)/ye[5],ke=(ye[9]-1)/ye[5],dt=(ye[8]-1)/ye[0],Xe=(Pe[8]+1)/Pe[0],ft=at*dt,Y=at*Xe,k=fe/(-dt+Xe),le=k*-dt;de.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(le),G.translateZ(k),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();const Ae=at+k,me=se+k,Ee=ft-le,Oe=Y+(fe-le),Ce=et*se/me*Ae,Qe=ke*se/me*Ae;G.projectionMatrix.makePerspective(Ee,Oe,Ce,Qe,Ae,me),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function ee(G,de){de===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(de.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;E.texture!==null&&(G.near=E.depthNear,G.far=E.depthFar),S.near=D.near=T.near=G.near,S.far=D.far=T.far=G.far,(L!==S.near||P!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,P=S.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),G.updateProjectionMatrix());const de=G.parent,pe=S.cameras;ee(S,de);for(let fe=0;fe<pe.length;fe++)ee(pe[fe],de);pe.length===2?H(S,T,D):S.projectionMatrix.copy(T.projectionMatrix),Q(G,S,de)};function Q(G,de,pe){pe===null?G.matrix.copy(de.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(de.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(de.projectionMatrix),G.projectionMatrixInverse.copy(de.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=al*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(G){h=G,p!==null&&(p.fixedFoveation=G),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=G)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(G,de){if(d=de.getViewerPose(u||o),v=de,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let fe=!1;pe.length!==S.cameras.length&&(S.cameras.length=0,fe=!0);for(let Pe=0;Pe<pe.length;Pe++){const at=pe[Pe];let se=null;if(g!==null)se=g.getViewport(at);else{const ke=A.getViewSubImage(p,at);se=ke.viewport,Pe===0&&(e.setRenderTargetTextures(w,ke.colorTexture,p.ignoreDepthValues?void 0:ke.depthStencilTexture),e.setRenderTarget(w))}let et=b[Pe];et===void 0&&(et=new un,et.layers.enable(Pe),et.viewport=new Ot,b[Pe]=et),et.matrix.fromArray(at.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(at.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Pe===0&&(S.matrix.copy(et.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),fe===!0&&S.cameras.push(et)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Pe=A.getDepthInformation(pe[0]);Pe&&Pe.isValid&&Pe.texture&&E.init(e,Pe,i.renderState)}}for(let pe=0;pe<x.length;pe++){const fe=I[pe],ye=x[pe];fe!==null&&ye!==void 0&&ye.update(fe,de,u||o)}E.render(e,S),z&&z(G,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),v=null}const re=new ZE;re.setAnimationLoop(Z),this.setAnimationLoop=function(G){z=G},this.dispose=function(){}}}const po=new Yi,kL=new st;function QL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,YE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===kr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===kr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,po.copy(I),po.x*=-1,po.y*=-1,po.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(po.y*=-1,po.z*=-1),m.envMapRotation.value.setFromMatrix4(kL.makeRotationFromEuler(po)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===kr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function FL(r,e,t,n){let i={},s={},o=[];const c=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const M=e.render.frame;s[w.id]!==M&&(p(w),s[w.id]=M)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,M=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let M=0,T=I.length;M<T;M++){const D=Array.isArray(I[M])?I[M]:[I[M]];for(let b=0,S=D.length;b<S;b++){const L=D[b];if(g(L,M,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let W=0;for(let X=0;X<N.length;X++){const K=N[X],te=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+W,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,W),W+=te.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const M=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof M=="number"||typeof M=="boolean"?R[T]=M:R[T]=M.clone(),!0;{const D=R[T];if(typeof M=="number"||typeof M=="boolean"){if(D!==M)return R[T]=M,!0}else if(D.equals(M)===!1)return D.copy(M),!0}return!1}function v(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let S=0,L=b.length;S<L;S++){const P=b[S],N=Array.isArray(P.value)?P.value:[P.value];for(let W=0,X=N.length;W<X;W++){const K=N[W],te=E(K),H=I%R;H!==0&&R-H<te.boundary&&(I+=R-H),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const M=I%R;return M>0&&(I+=R-M),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Db(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let E=null,m=null;const _=[],w=[];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=Qr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,M=0,T=null,D=-1,b=null;const S=new Ot,L=new Ot;let P=null;const N=new Ke(0);let W=0,X=t.width,K=t.height,te=1,H=null,ee=null;const Q=new Ot(0,0,X,K),z=new Ot(0,0,X,K);let Z=!1;const re=new WA;let G=!1,de=!1;const pe=new st,fe=new Ge,ye=new j,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function at(){return T===null?te:1}let se=n;function et(O,ne){const ue=t.getContext(O,ne);return ue!==null?ue:null}try{const O={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Vh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",ze,!1),se===null){const ne="webgl2";if(se=et(ne,O),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let ke,dt,Xe,ft,Y,k,le,Ae,me,Ee,Oe,Ce,Qe,ve,xe,Be,Ye,Le,be,nt,pt,ct,ut,tt;function V(){ke=new X6(se),ke.init(),dt=new G6(se,ke,e),ct=new bL(se,ke),Xe=new TL(se),ft=new Z6(se),Y=new AL,k=new BL(se,ke,Xe,Y,dt,ct,ft),le=new j6(x),Ae=new q6(x),me=new i5(se),ut=new z6(se,me),Ee=new K6(se,me,ft,ut),Oe=new eD(se,Ee,me,ft),be=new $6(se,dt,k),Be=new V6(Y),Ce=new pL(x,le,Ae,ke,dt,ut,Be),Qe=new QL(x,Y),ve=new mL,xe=new wL(ke),Le=new O6(x,le,Ae,Xe,Oe,p,h),Ye=new ML(x,Oe,dt),tt=new FL(se,ft,dt,Xe),nt=new H6(se,ke,ft),pt=new J6(se,ke,ft),ft.programs=Ce.programs,x.capabilities=dt,x.extensions=ke,x.properties=Y,x.renderLists=ve,x.shadowMap=Ye,x.state=Xe,x.info=ft}V();const F=new PL(x,se);this.xr=F,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const O=ke.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=ke.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(O){O!==void 0&&(te=O,this.setSize(X,K,!1))},this.getSize=function(O){return O.set(X,K)},this.setSize=function(O,ne,ue=!0){if(F.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=O,K=ne,t.width=Math.floor(O*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=O+"px",t.style.height=ne+"px"),this.setViewport(0,0,O,ne)},this.getDrawingBufferSize=function(O){return O.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(O,ne,ue){X=O,K=ne,te=ue,t.width=Math.floor(O*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,O,ne)},this.getCurrentViewport=function(O){return O.copy(S)},this.getViewport=function(O){return O.copy(Q)},this.setViewport=function(O,ne,ue,he){O.isVector4?Q.set(O.x,O.y,O.z,O.w):Q.set(O,ne,ue,he),Xe.viewport(S.copy(Q).multiplyScalar(te).round())},this.getScissor=function(O){return O.copy(z)},this.setScissor=function(O,ne,ue,he){O.isVector4?z.set(O.x,O.y,O.z,O.w):z.set(O,ne,ue,he),Xe.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){Xe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){H=O},this.setTransparentSort=function(O){ee=O},this.getClearColor=function(O){return O.copy(Le.getClearColor())},this.setClearColor=function(){Le.setClearColor.apply(Le,arguments)},this.getClearAlpha=function(){return Le.getClearAlpha()},this.setClearAlpha=function(){Le.setClearAlpha.apply(Le,arguments)},this.clear=function(O=!0,ne=!0,ue=!0){let he=0;if(O){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===tu||Re===Xh||Re===fA}if(oe){const Re=T.texture.type,Je=Re===Ar||Re===Ii||Re===dA||Re===$c||Re===Wy||Re===Yy,it=Le.getClearColor(),ot=Le.getClearAlpha(),qe=it.r,At=it.g,ht=it.b;Je?(g[0]=qe,g[1]=At,g[2]=ht,g[3]=ot,se.clearBufferuiv(se.COLOR,0,g)):(v[0]=qe,v[1]=At,v[2]=ht,v[3]=ot,se.clearBufferiv(se.COLOR,0,v))}else he|=se.COLOR_BUFFER_BIT}ne&&(he|=se.DEPTH_BUFFER_BIT),ue&&(he|=se.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),se.clear(he)},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",ge,!1),t.removeEventListener("webglcontextrestored",_e,!1),t.removeEventListener("webglcontextcreationerror",ze,!1),ve.dispose(),xe.dispose(),Y.dispose(),le.dispose(),Ae.dispose(),Oe.dispose(),ut.dispose(),tt.dispose(),Ce.dispose(),F.dispose(),F.removeEventListener("sessionstart",hr),F.removeEventListener("sessionend",Vt),_r.stop()};function ge(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const O=ft.autoReset,ne=Ye.enabled,ue=Ye.autoUpdate,he=Ye.needsUpdate,oe=Ye.type;V(),ft.autoReset=O,Ye.enabled=ne,Ye.autoUpdate=ue,Ye.needsUpdate=he,Ye.type=oe}function ze(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function Ne(O){const ne=O.target;ne.removeEventListener("dispose",Ne),_t(ne)}function _t(O){Dt(O),Y.remove(O)}function Dt(O){const ne=Y.get(O).programs;ne!==void 0&&(ne.forEach(function(ue){Ce.releaseProgram(ue)}),O.isShaderMaterial&&Ce.releaseShaderCache(O))}this.renderBufferDirect=function(O,ne,ue,he,oe,Re){ne===null&&(ne=Pe);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=qm(O,ne,ue,he,oe);Xe.setMaterial(he,Je);let ot=ue.index,qe=1;if(he.wireframe===!0){if(ot=Ee.getWireframeAttribute(ue),ot===void 0)return;qe=2}const At=ue.drawRange,ht=ue.attributes.position;let Dr=At.start*qe,er=(At.start+At.count)*qe;Re!==null&&(Dr=Math.max(Dr,Re.start*qe),er=Math.min(er,(Re.start+Re.count)*qe)),ot!==null?(Dr=Math.max(Dr,0),er=Math.min(er,ot.count)):ht!=null&&(Dr=Math.max(Dr,0),er=Math.min(er,ht.count));const Rn=er-Dr;if(Rn<0||Rn===1/0)return;ut.setup(oe,he,it,ue,ot);let di,jt=nt;if(ot!==null&&(di=me.get(ot),jt=pt,jt.setIndex(di)),oe.isMesh)he.wireframe===!0?(Xe.setLineWidth(he.wireframeLinewidth*at()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let rt=he.linewidth;rt===void 0&&(rt=1),Xe.setLineWidth(rt*at()),oe.isLineSegments?jt.setMode(se.LINES):oe.isLineLoop?jt.setMode(se.LINE_LOOP):jt.setMode(se.LINE_STRIP)}else oe.isPoints?jt.setMode(se.POINTS):oe.isSprite&&jt.setMode(se.TRIANGLES);if(oe.isBatchedMesh)jt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else if(oe.isInstancedMesh)jt.renderInstances(Dr,Rn,oe.count);else if(ue.isInstancedBufferGeometry){const rt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Wu=Math.min(ue.instanceCount,rt);jt.renderInstances(Dr,Rn,Wu)}else jt.render(Dr,Rn)};function Lt(O,ne,ue){O.transparent===!0&&O.side===Ei&&O.forceSinglePass===!1?(O.side=kr,O.needsUpdate=!0,Us(O,ne,ue),O.side=yi,O.needsUpdate=!0,Us(O,ne,ue),O.side=Ei):Us(O,ne,ue)}this.compile=function(O,ne,ue=null){ue===null&&(ue=O),m=xe.get(ue),m.init(),w.push(m),ue.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),O!==ue&&O.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),m.setupLights(x._useLegacyLights);const he=new Set;return O.traverse(function(oe){const Re=oe.material;if(Re)if(Array.isArray(Re))for(let Je=0;Je<Re.length;Je++){const it=Re[Je];Lt(it,ue,oe),he.add(it)}else Lt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(O,ne,ue=null){const he=this.compile(O,ne,ue);return new Promise(oe=>{function Re(){if(he.forEach(function(Je){Y.get(Je).currentProgram.isReady()&&he.delete(Je)}),he.size===0){oe(O);return}setTimeout(Re,10)}ke.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Mt=null;function vt(O){Mt&&Mt(O)}function hr(){_r.stop()}function Vt(){_r.start()}const _r=new ZE;_r.setAnimationLoop(vt),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){Mt=O,F.setAnimationLoop(O),O===null?_r.stop():_r.start()},F.addEventListener("sessionstart",hr),F.addEventListener("sessionend",Vt),this.render=function(O,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),F.enabled===!0&&F.isPresenting===!0&&(F.cameraAutoUpdate===!0&&F.updateCamera(ne),ne=F.getCamera()),O.isScene===!0&&O.onBeforeRender(x,O,ne,T),m=xe.get(O,w.length),m.init(),w.push(m),pe.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(pe),de=this.localClippingEnabled,G=Be.init(this.clippingPlanes,de),E=ve.get(O,_.length),E.init(),_.push(E),bn(O,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(H,ee),this.info.render.frame++,G===!0&&Be.beginShadows();const ue=m.state.shadowsArray;if(Ye.render(ue,O,ne),G===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(F.enabled===!1||F.isPresenting===!1||F.hasDepthSensing()===!1)&&Le.render(E,O),m.setupLights(x._useLegacyLights),ne.isArrayCamera){const he=ne.cameras;for(let oe=0,Re=he.length;oe<Re;oe++){const Je=he[oe];qt(E,O,Je,Je.viewport)}}else qt(E,O,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),O.isScene===!0&&O.onAfterRender(x,O,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function bn(O,ne,ue,he){if(O.visible===!1)return;if(O.layers.test(ne.layers)){if(O.isGroup)ue=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ne);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){he&&ye.setFromMatrixPosition(O.matrixWorld).applyMatrix4(pe);const Re=Oe.update(O),Je=O.material;Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Re=Oe.update(O),Je=O.material;if(he&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),ye.copy(O.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ye.copy(Re.boundingSphere.center)),ye.applyMatrix4(O.matrixWorld).applyMatrix4(pe)),Array.isArray(Je)){const it=Re.groups;for(let ot=0,qe=it.length;ot<qe;ot++){const At=it[ot],ht=Je[At.materialIndex];ht&&ht.visible&&E.push(O,Re,ht,ue,ye.z,At)}}else Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}const oe=O.children;for(let Re=0,Je=oe.length;Re<Je;Re++)bn(oe[Re],ne,ue,he)}function qt(O,ne,ue,he){const oe=O.opaque,Re=O.transmissive,Je=O.transparent;m.setupLightsView(ue),G===!0&&Be.setGlobalState(x.clippingPlanes,ue),Re.length>0&&hi(oe,Re,ne,ue),he&&Xe.viewport(S.copy(he)),oe.length>0&&Jn(oe,ne,ue),Re.length>0&&Jn(Re,ne,ue),Je.length>0&&Jn(Je,ne,ue),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function hi(O,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float")?yn:Ar,minFilter:wi,samples:4,stencilBuffer:s});const ot=Y.get(m.state.transmissionRenderTarget);ot.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(fe),oe.setSize(fe.x,fe.y);const Re=x.getRenderTarget();x.setRenderTarget(oe),x.getClearColor(N),W=x.getClearAlpha(),W<1&&x.setClearColor(16777215,.5),x.clear();const Je=x.toneMapping;x.toneMapping=Zs,Jn(O,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let ot=0,qe=ne.length;ot<qe;ot++){const At=ne[ot],ht=At.object,Dr=At.geometry,er=At.material,Rn=At.group;if(er.side===Ei&&ht.layers.test(he.layers)){const di=er.side;er.side=kr,er.needsUpdate=!0,Ns(ht,ue,he,Dr,er,Rn),er.side=di,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Jn(O,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=O.length;oe<Re;oe++){const Je=O[oe],it=Je.object,ot=Je.geometry,qe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,ot,qe,At)}}function Ns(O,ne,ue,he,oe,Re){O.onBeforeRender(x,ne,ue,he,oe,Re),O.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,O,Re),oe.transparent===!0&&oe.side===Ei&&oe.forceSinglePass===!1?(oe.side=kr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=yi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=Ei):x.renderBufferDirect(ue,ne,he,oe,O,Re),O.onAfterRender(x,ne,ue,he,oe,Re)}function Us(O,ne,ue){ne.isScene!==!0&&(ne=Pe);const he=Y.get(O),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ce.getParameters(O,oe.state,Re,ne,ue),ot=Ce.getProgramCacheKey(it);let qe=he.programs;he.environment=O.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(O.isMeshStandardMaterial?Ae:le).get(O.envMap||he.environment),he.envMapRotation=he.environment!==null&&O.envMap===null?ne.environmentRotation:O.envMapRotation,qe===void 0&&(O.addEventListener("dispose",Ne),qe=new Map,he.programs=qe);let At=qe.get(ot);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return wf(O,it),At}else it.uniforms=Ce.getUniforms(O),O.onBuild(ue,it,x),O.onBeforeCompile(it,x),At=Ce.acquireProgram(it,ot),qe.set(ot,At),he.uniforms=it.uniforms;const ht=he.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(ht.clippingPlanes=Be.uniform),wf(O,it),he.needsLights=Ps(O),he.lightsStateVersion=Je,he.needsLights&&(ht.ambientLightColor.value=oe.state.ambient,ht.lightProbe.value=oe.state.probe,ht.directionalLights.value=oe.state.directional,ht.directionalLightShadows.value=oe.state.directionalShadow,ht.spotLights.value=oe.state.spot,ht.spotLightShadows.value=oe.state.spotShadow,ht.rectAreaLights.value=oe.state.rectArea,ht.ltc_1.value=oe.state.rectAreaLTC1,ht.ltc_2.value=oe.state.rectAreaLTC2,ht.pointLights.value=oe.state.point,ht.pointLightShadows.value=oe.state.pointShadow,ht.hemisphereLights.value=oe.state.hemi,ht.directionalShadowMap.value=oe.state.directionalShadowMap,ht.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ht.spotShadowMap.value=oe.state.spotShadowMap,ht.spotLightMatrix.value=oe.state.spotLightMatrix,ht.spotLightMap.value=oe.state.spotLightMap,ht.pointShadowMap.value=oe.state.pointShadowMap,ht.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function ac(O){if(O.uniformsList===null){const ne=O.currentProgram.getUniforms();O.uniformsList=Bd.seqWithValue(ne.seq,O.uniforms)}return O.uniformsList}function wf(O,ne){const ue=Y.get(O);ue.outputColorSpace=ne.outputColorSpace,ue.batching=ne.batching,ue.instancing=ne.instancing,ue.instancingColor=ne.instancingColor,ue.instancingMorph=ne.instancingMorph,ue.skinning=ne.skinning,ue.morphTargets=ne.morphTargets,ue.morphNormals=ne.morphNormals,ue.morphColors=ne.morphColors,ue.morphTargetsCount=ne.morphTargetsCount,ue.numClippingPlanes=ne.numClippingPlanes,ue.numIntersection=ne.numClipIntersection,ue.vertexAlphas=ne.vertexAlphas,ue.vertexTangents=ne.vertexTangents,ue.toneMapping=ne.toneMapping}function qm(O,ne,ue,he,oe){ne.isScene!==!0&&(ne=Pe),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Sr,ot=(he.isMeshStandardMaterial?Ae:le).get(he.envMap||Je),qe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ht=!!ue.morphAttributes.position,Dr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Rn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Rn=x.toneMapping);const di=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=di!==void 0?di.length:0,rt=Y.get(he),Wu=m.state.lights;if(G===!0&&(de===!0||O!==b)){const Ln=O===b&&he.id===D;Be.setState(he,O,Ln)}let gn=!1;he.version===rt.__version?(rt.needsLights&&rt.lightsStateVersion!==Wu.state.version||rt.outputColorSpace!==it||oe.isBatchedMesh&&rt.batching===!1||!oe.isBatchedMesh&&rt.batching===!0||oe.isInstancedMesh&&rt.instancing===!1||!oe.isInstancedMesh&&rt.instancing===!0||oe.isSkinnedMesh&&rt.skinning===!1||!oe.isSkinnedMesh&&rt.skinning===!0||oe.isInstancedMesh&&rt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&rt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&rt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&rt.instancingMorph===!1&&oe.morphTexture!==null||rt.envMap!==ot||he.fog===!0&&rt.fog!==Re||rt.numClippingPlanes!==void 0&&(rt.numClippingPlanes!==Be.numPlanes||rt.numIntersection!==Be.numIntersection)||rt.vertexAlphas!==qe||rt.vertexTangents!==At||rt.morphTargets!==ht||rt.morphNormals!==Dr||rt.morphColors!==er||rt.toneMapping!==Rn||rt.morphTargetsCount!==jt)&&(gn=!0):(gn=!0,rt.__version=he.version);let ks=rt.currentProgram;gn===!0&&(ks=Us(he,ne,oe));let If=!1,Ro=!1,Ia=!1;const vr=ks.getUniforms(),Dn=rt.uniforms;if(Xe.useProgram(ks.program)&&(If=!0,Ro=!0,Ia=!0),he.id!==D&&(D=he.id,Ro=!0),If||b!==O){vr.setValue(se,"projectionMatrix",O.projectionMatrix),vr.setValue(se,"viewMatrix",O.matrixWorldInverse);const Ln=vr.map.cameraPosition;Ln!==void 0&&Ln.setValue(se,ye.setFromMatrixPosition(O.matrixWorld)),dt.logarithmicDepthBuffer&&vr.setValue(se,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&vr.setValue(se,"isOrthographic",O.isOrthographicCamera===!0),b!==O&&(b=O,Ro=!0,Ia=!0)}if(oe.isSkinnedMesh){vr.setOptional(se,oe,"bindMatrix"),vr.setOptional(se,oe,"bindMatrixInverse");const Ln=oe.skeleton;Ln&&(Ln.boneTexture===null&&Ln.computeBoneTexture(),vr.setValue(se,"boneTexture",Ln.boneTexture,k))}oe.isBatchedMesh&&(vr.setOptional(se,oe,"batchingTexture"),vr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ca=ue.morphAttributes;if((Ca.position!==void 0||Ca.normal!==void 0||Ca.color!==void 0)&&be.update(oe,ue,ks),(Ro||rt.receiveShadow!==oe.receiveShadow)&&(rt.receiveShadow=oe.receiveShadow,vr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Dn.envMap.value=ot,Dn.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Dn.envMapIntensity.value=ne.environmentIntensity),Ro&&(vr.setValue(se,"toneMappingExposure",x.toneMappingExposure),rt.needsLights&&Xm(Dn,Ia),Re&&he.fog===!0&&Qe.refreshFogUniforms(Dn,Re),Qe.refreshMaterialUniforms(Dn,he,te,K,m.state.transmissionRenderTarget),Bd.upload(se,ac(rt),Dn,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Bd.upload(se,ac(rt),Dn,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&vr.setValue(se,"center",oe.center),vr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),vr.setValue(se,"normalMatrix",oe.normalMatrix),vr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Ln=he.uniformsGroups;for(let Yu=0,qu=Ln.length;Yu<qu;Yu++){const Xu=Ln[Yu];tt.update(Xu,ks),tt.bind(Xu,ks)}}return ks}function Xm(O,ne){O.ambientLightColor.needsUpdate=ne,O.lightProbe.needsUpdate=ne,O.directionalLights.needsUpdate=ne,O.directionalLightShadows.needsUpdate=ne,O.pointLights.needsUpdate=ne,O.pointLightShadows.needsUpdate=ne,O.spotLights.needsUpdate=ne,O.spotLightShadows.needsUpdate=ne,O.rectAreaLights.needsUpdate=ne,O.hemisphereLights.needsUpdate=ne}function Ps(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(O,ne,ue){Y.get(O.texture).__webglTexture=ne,Y.get(O.depthTexture).__webglTexture=ue;const he=Y.get(O);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||ke.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),he.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,ne){const ue=Y.get(O);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(O,ne=0,ue=0){T=O,R=ne,M=ue;let he=!0,oe=null,Re=!1,Je=!1;if(O){const it=Y.get(O);it.__useDefaultFramebuffer!==void 0?(Xe.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(O):it.__hasExternalTextures&&k.rebindTextures(O,Y.get(O.texture).__webglTexture,Y.get(O.depthTexture).__webglTexture);const ot=O.texture;(ot.isData3DTexture||ot.isDataArrayTexture||ot.isCompressedArrayTexture)&&(Je=!0);const qe=Y.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(qe[ne])?oe=qe[ne][ue]:oe=qe[ne],Re=!0):O.samples>0&&k.useMultisampledRTT(O)===!1?oe=Y.get(O).__webglMultisampledFramebuffer:Array.isArray(qe)?oe=qe[ue]:oe=qe,S.copy(O.viewport),L.copy(O.scissor),P=O.scissorTest}else S.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Xe.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Xe.drawBuffers(O,oe),Xe.viewport(S),Xe.scissor(L),Xe.setScissorTest(P),Re){const it=Y.get(O.texture);se.framebufferTexture2D(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,se.TEXTURE_CUBE_MAP_POSITIVE_X+ne,it.__webglTexture,ue)}else if(Je){const it=Y.get(O.texture),ot=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,ot)}D=-1},this.readRenderTargetPixels=function(O,ne,ue,he,oe,Re,Je){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Xe.bindFramebuffer(se.FRAMEBUFFER,it);try{const ot=O.texture,qe=ot.format,At=ot.type;if(qe!==gr&&ct.convert(qe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=At===yn&&(ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float"));if(At!==Ar&&ct.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=O.width-he&&ue>=0&&ue<=O.height-oe&&se.readPixels(ne,ue,he,oe,ct.convert(qe),ct.convert(At),Re)}finally{const ot=T!==null?Y.get(T).__webglFramebuffer:null;Xe.bindFramebuffer(se.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(O,ne,ue=0){const he=Math.pow(2,-ue),oe=Math.floor(ne.image.width*he),Re=Math.floor(ne.image.height*he);k.setTexture2D(ne,0),se.copyTexSubImage2D(se.TEXTURE_2D,ue,0,0,O.x,O.y,oe,Re),Xe.unbindTexture()},this.copyTextureToTexture=function(O,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=ct.convert(ue.format),it=ct.convert(ue.type);k.setTexture2D(ue,0),se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,ue.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,ue.unpackAlignment),ne.isDataTexture?se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,O.x,O.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Xe.unbindTexture()},this.copyTextureToTexture3D=function(O,ne,ue,he,oe=0){const Re=Math.round(O.max.x-O.min.x),Je=Math.round(O.max.y-O.min.y),it=O.max.z-O.min.z+1,ot=ct.convert(he.format),qe=ct.convert(he.type);let At;if(he.isData3DTexture)k.setTexture3D(he,0),At=se.TEXTURE_3D;else if(he.isDataArrayTexture||he.isCompressedArrayTexture)k.setTexture2DArray(he,0),At=se.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,he.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,he.unpackAlignment);const ht=se.getParameter(se.UNPACK_ROW_LENGTH),Dr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Rn=se.getParameter(se.UNPACK_SKIP_ROWS),di=se.getParameter(se.UNPACK_SKIP_IMAGES),jt=ue.isCompressedTexture?ue.mipmaps[oe]:ue.image;se.pixelStorei(se.UNPACK_ROW_LENGTH,jt.width),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,jt.height),se.pixelStorei(se.UNPACK_SKIP_PIXELS,O.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,O.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,O.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ht),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Dr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Rn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,di),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Xe.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?k.setTextureCube(O,0):O.isData3DTexture?k.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?k.setTexture2DArray(O,0):k.setTexture2D(O,0),Xe.unbindTexture()},this.resetState=function(){R=0,M=0,T=null,Xe.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===ed?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===nu?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class zL extends Zt{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 Yi,this.environmentIntensity=1,this.environmentRotation=new Yi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(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),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class HL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ci()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("THREE.InterleavedBuffer: 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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ci()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ci()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const hn=new j;class rg{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyMatrix4(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyNormalMatrix(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.transformDirection(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Si(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Si(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Si(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Si(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Fr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new rg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const T2=new j,B2=new Ot,b2=new Ot,GL=new j,R2=new st,bd=new j,ng=new Bi,D2=new st,ig=new cu;class VL extends Yr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Hy,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Er),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,bd),this.boundingBox.expandByPoint(bd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Bi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,bd),this.boundingSphere.expandByPoint(bd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ng.copy(this.boundingSphere),ng.applyMatrix4(i),e.ray.intersectsSphere(ng)!==!1&&(D2.copy(i).invert(),ig.copy(e.ray).applyMatrix4(D2),!(this.boundingBox!==null&&ig.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ig)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ot,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Hy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===KB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;B2.fromBufferAttribute(i.attributes.skinIndex,e),b2.fromBufferAttribute(i.attributes.skinWeight,e),T2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=b2.getComponent(s);if(o!==0){const c=B2.getComponent(s);R2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(GL.copy(T2).applyMatrix4(R2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class L2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ao extends Tr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=fr,d=fr,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const N2=new st,jL=new st;class sg{constructor(e=[],t=[]){this.uuid=Ci(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const c=e[s]?e[s].matrixWorld:jL;N2.multiplyMatrices(c,t[s]),N2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new sg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Ao(t,e,e,gr,lr);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new L2),this.bones.push(o),this.boneInverses.push(new st().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const c=n[i];e.boneInverses.push(c.toArray())}return e}}class ag extends Fr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ml=new st,U2=new st,Rd=[],P2=new Er,WL=new st,gu=new Yr,mu=new Bi;class YL extends Yr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ag(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,WL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Er),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),P2.copy(e.boundingBox).applyMatrix4(Ml),this.boundingBox.union(P2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Bi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ml),mu.copy(e.boundingSphere).applyMatrix4(Ml),this.boundingSphere.union(mu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(gu.geometry=this.geometry,gu.material=this.material,gu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mu.copy(this.boundingSphere),mu.applyMatrix4(n),e.ray.intersectsSphere(mu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Ml),U2.multiplyMatrices(n,Ml),gu.matrixWorld=U2,gu.raycast(e,Rd);for(let o=0,c=Rd.length;o<c;o++){const h=Rd[o];h.instanceId=s,h.object=this,t.push(h)}Rd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new ag(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new Ao(new Float32Array(i*this.count),i,this.count,ea,lr));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class k2 extends qi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ke(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 Q2=new j,F2=new j,O2=new st,og=new cu,Dd=new Bi;class lg extends Zt{constructor(e=new Gn,t=new k2){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(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)Q2.fromBufferAttribute(t,i-1),F2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Q2.distanceTo(F2);e.setAttribute("lineDistance",new Di(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,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Dd.copy(n.boundingSphere),Dd.applyMatrix4(i),Dd.radius+=s,e.ray.intersectsSphere(Dd)===!1)return;O2.copy(i).invert(),og.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new j,d=new j,A=new j,p=new j,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const z2=new j,H2=new j;class qL extends lg{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)z2.fromBufferAttribute(t,i),H2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+z2.distanceTo(H2);e.setAttribute("lineDistance",new Di(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XL extends lg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class G2 extends qi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ke(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const V2=new st,cg=new cu,Ld=new Bi,Nd=new j;class KL extends Zt{constructor(e=new Gn,t=new G2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ld.copy(n.boundingSphere),Ld.applyMatrix4(i),Ld.radius+=s,e.ray.intersectsSphere(Ld)===!1)return;V2.copy(i).invert(),cg.copy(e.ray).applyMatrix4(V2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,v=p;g<v;g++){const E=u.getX(g);Nd.fromBufferAttribute(d,E),j2(Nd,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,v=p;g<v;g++)Nd.fromBufferAttribute(d,g),j2(Nd,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function j2(r,e,t,n,i,s,o){const c=cg.distanceSqToPoint(r);if(c<t){const h=new j;cg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(c),point:h,index:e,face:null,object:o})}}class Ud extends Tr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class JL extends Ud{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=xi}}class ZL extends Ud{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,no),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class $L extends En{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ug extends qi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ke(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mE,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Yi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Li extends ug{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ke(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ke(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ke(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Pd(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function e8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function t8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function W2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function Y2(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class _u{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const c=n+o>>>1;e<t[c]?o=c:n=c+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class r8 extends _u{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fE,endingEnd:fE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case pE:s=e,c=2*t-n;break;case AE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case pE:o=e,h=2*n-t;break;case AE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class n8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class i8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ji{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Pd(t,this.TimeBufferType),this.values=Pd(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Pd(e.times,Array),values:Pd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new i8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new r8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ru:t=this.InterpolantFactoryMethodDiscrete;break;case il:t=this.InterpolantFactoryMethodLinear;break;case xA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ru;case this.InterpolantFactoryMethodLinear:return il;case this.InterpolantFactoryMethodSmooth:return xA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&e8(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===xA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Ji.prototype.TimeBufferType=Float32Array,Ji.prototype.ValueBufferType=Float32Array,Ji.prototype.DefaultInterpolation=il;class Tl extends Ji{}Tl.prototype.ValueTypeName="bool",Tl.prototype.ValueBufferType=Array,Tl.prototype.DefaultInterpolation=ru,Tl.prototype.InterpolantFactoryMethodLinear=void 0,Tl.prototype.InterpolantFactoryMethodSmooth=void 0;class q2 extends Ji{}q2.prototype.ValueTypeName="color";class Bl extends Ji{}Bl.prototype.ValueTypeName="number";class s8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)Wi.slerpFlat(s,0,o,u-c,o,u,h);return s}}class go extends Ji{InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion",go.prototype.DefaultInterpolation=il,go.prototype.InterpolantFactoryMethodSmooth=void 0;class bl extends Ji{}bl.prototype.ValueTypeName="string",bl.prototype.ValueBufferType=Array,bl.prototype.DefaultInterpolation=ru,bl.prototype.InterpolantFactoryMethodLinear=void 0,bl.prototype.InterpolantFactoryMethodSmooth=void 0;class Rl extends Ji{}Rl.prototype.ValueTypeName="vector";class a8{constructor(e="",t=-1,n=[],i=ib){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ci(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(l8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Ji.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=t8(h);h=W2(h,1,d),u=W2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new Bl(".morphTargetInfluences["+t[c].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,v){if(p.length!==0){const E=[],m=[];Y2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new Bl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Rl,p+".position",A,"pos",i),n(go,p+".quaternion",A,"rot",i),n(Rl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function o8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Bl;case"vector":case"vector2":case"vector3":case"vector4":return Rl;case"color":return q2;case"quaternion":return go;case"bool":case"boolean":return Tl;case"string":return bl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function l8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=o8(r.type);if(r.times===void 0){const t=[],n=[];Y2(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const la={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class X2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const c8=new X2;class ca{constructor(e){this.manager=e!==void 0?e:c8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}ca.DEFAULT_MATERIAL_NAME="__DEFAULT";const Is={};class u8 extends Error{constructor(e,t){super(e),this.response=t}}class Dl extends ca{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=la.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Is[e]!==void 0){Is[e].push({onLoad:t,onProgress:n,onError:i});return}Is[e]=[],Is[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Is[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let M=0,T=d.length;M<T;M++){const D=d[M];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new u8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{la.add(e,u);const d=Is[e];delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Is[e];if(d===void 0)throw this.manager.itemError(e),u;delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class h8 extends ca{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const c=au("img");function h(){d(),la.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class d8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ao,c=new Dl(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:xi,o.wrapT=u.wrapT!==void 0?u.wrapT:xi,o.magFilter=u.magFilter!==void 0?u.magFilter:pr,o.minFilter=u.minFilter!==void 0?u.minFilter:pr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=wi),u.mipmapCount===1&&(o.minFilter=pr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class K2 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new Tr,o=new h8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class kd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ke(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class f8 extends kd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ke(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const hg=new st,J2=new j,Z2=new j;class dg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new WA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;J2.setFromMatrixPosition(e.matrixWorld),t.position.copy(J2),Z2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Z2),t.updateMatrixWorld(),hg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(hg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class p8 extends dg{constructor(){super(new un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=al*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class A8 extends kd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new p8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const $2=new st,vu=new j,fg=new j;class g8 extends dg{constructor(){super(new un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new j(1,0,0),new j(-1,0,0),new j(0,0,1),new j(0,0,-1),new j(0,1,0),new j(0,-1,0)],this._cubeUps=[new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,0,1),new j(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),vu.setFromMatrixPosition(e.matrixWorld),n.position.copy(vu),fg.copy(n.position),fg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(fg),n.updateMatrixWorld(),i.makeTranslation(-vu.x,-vu.y,-vu.z),$2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($2)}}class m8 extends kd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new g8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class _8 extends dg{constructor(){super(new pu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ex extends kd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new _8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class yu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class v8 extends ca{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return la.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),la.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});la.add(e,h),s.manager.itemStart(e)}}class y8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=tx(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=tx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function tx(){return(typeof performance>"u"?Date:performance).now()}const pg="\\[\\]\\.:\\/",E8=new RegExp("["+pg+"]","g"),Ag="[^"+pg+"]",x8="[^"+pg.replace("\\.","")+"]",w8=/((?:WC+[\/:])*)/.source.replace("WC",Ag),I8=/(WCOD+)?/.source.replace("WCOD",x8),C8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ag),S8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ag),M8=new RegExp("^"+w8+I8+C8+S8+"$"),T8=["material","materials","bones","map"];class B8{constructor(e,t,n){const i=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(e){const t=M8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);T8.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Ut.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=B8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class rx{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const nx=new j,Qd=new j;class Cs{constructor(e=new j,t=new j){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){nx.subVectors(e,this.start),Qd.subVectors(this.end,this.start);const n=Qd.dot(Qd);let i=Qd.dot(nx)/n;return t&&(i=Mr(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)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Vh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Vh);const ix={type:"change"},gg={type:"start"},sx={type:"end"},Fd=new cu,ax=new Xi,b8=Math.cos(70*SA.DEG2RAD);class R8 extends so{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new j,this.cursor=new j,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:$o.ROTATE,MIDDLE:$o.DOLLY,RIGHT:$o.PAN},this.touches={ONE:el.ROTATE,TWO:el.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",Be),this._domElementKeyEvents=V},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Be),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(ix),n.update(),s=i.NONE},this.update=function(){const V=new j,F=new Wi().setFromUnitVectors(e.up,new j(0,1,0)),ge=F.clone().invert(),_e=new j,ze=new Wi,Ne=new j,_t=2*Math.PI;return function(Dt=null){const Lt=n.object.position;V.copy(Lt).sub(n.target),V.applyQuaternion(F),c.setFromVector3(V),n.autoRotate&&s===i.NONE&&P(S(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let Mt=n.minAzimuthAngle,vt=n.maxAzimuthAngle;isFinite(Mt)&&isFinite(vt)&&(Mt<-Math.PI?Mt+=_t:Mt>Math.PI&&(Mt-=_t),vt<-Math.PI?vt+=_t:vt>Math.PI&&(vt-=_t),Mt<=vt?c.theta=Math.max(Mt,Math.min(vt,c.theta)):c.theta=c.theta>(Mt+vt)/2?Math.max(Mt,c.theta):Math.min(vt,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let hr=!1;if(n.zoomToCursor&&M||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),hr=Vt!=c.radius}if(V.setFromSpherical(c),V.applyQuaternion(ge),Lt.copy(n.target).add(V),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&M){let Vt=null;if(n.object.isPerspectiveCamera){const _r=V.length();Vt=Q(_r*u);const bn=_r-Vt;n.object.position.addScaledVector(I,bn),n.object.updateMatrixWorld(),hr=!!bn}else if(n.object.isOrthographicCamera){const _r=new j(R.x,R.y,0);_r.unproject(n.object);const bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),hr=bn!==n.object.zoom;const qt=new j(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(_r),n.object.updateMatrixWorld(),Vt=V.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(Fd.origin.copy(n.object.position),Fd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Fd.direction))<b8?e.lookAt(n.target):(ax.setFromNormalAndCoplanarPoint(n.object.up,n.target),Fd.intersectPlane(ax,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),hr=!0)}return u=1,M=!1,hr||_e.distanceToSquared(n.object.position)>o||8*(1-ze.dot(n.object.quaternion))>o||Ne.distanceToSquared(n.target)>o?(n.dispatchEvent(ix),_e.copy(n.object.position),ze.copy(n.object.quaternion),Ne.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",be),n.domElement.removeEventListener("pointerdown",le),n.domElement.removeEventListener("pointercancel",me),n.domElement.removeEventListener("wheel",Ce),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",ve,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Be),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,c=new rx,h=new rx;let u=1;const d=new j,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new j,R=new Ge;let M=!1;const T=[],D={};let b=!1;function S(V){return V!==null?2*Math.PI/60*n.autoRotateSpeed*V:2*Math.PI/60/60*n.autoRotateSpeed}function L(V){const F=Math.abs(V*.01);return Math.pow(.95,n.zoomSpeed*F)}function P(V){h.theta-=V}function N(V){h.phi-=V}const W=function(){const V=new j;return function(F,ge){V.setFromMatrixColumn(ge,0),V.multiplyScalar(-F),d.add(V)}}(),X=function(){const V=new j;return function(F,ge){n.screenSpacePanning===!0?V.setFromMatrixColumn(ge,1):(V.setFromMatrixColumn(ge,0),V.crossVectors(n.object.up,V)),V.multiplyScalar(F),d.add(V)}}(),K=function(){const V=new j;return function(F,ge){const _e=n.domElement;if(n.object.isPerspectiveCamera){const ze=n.object.position;V.copy(ze).sub(n.target);let Ne=V.length();Ne*=Math.tan(n.object.fov/2*Math.PI/180),W(2*F*Ne/_e.clientHeight,n.object.matrix),X(2*ge*Ne/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(F*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(V,F){if(!n.zoomToCursor)return;M=!0;const ge=n.domElement.getBoundingClientRect(),_e=V-ge.left,ze=F-ge.top,Ne=ge.width,_t=ge.height;R.x=_e/Ne*2-1,R.y=-(ze/_t)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(V){return Math.max(n.minDistance,Math.min(n.maxDistance,V))}function z(V){A.set(V.clientX,V.clientY)}function Z(V){ee(V.clientX,V.clientX),_.set(V.clientX,V.clientY)}function re(V){v.set(V.clientX,V.clientY)}function G(V){p.set(V.clientX,V.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p),n.update()}function de(V){w.set(V.clientX,V.clientY),x.subVectors(w,_),x.y>0?te(L(x.y)):x.y<0&&H(L(x.y)),_.copy(w),n.update()}function pe(V){E.set(V.clientX,V.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function fe(V){ee(V.clientX,V.clientY),V.deltaY<0?H(L(V.deltaY)):V.deltaY>0&&te(L(V.deltaY)),n.update()}function ye(V){let F=!1;switch(V.code){case n.keys.UP:V.ctrlKey||V.metaKey||V.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),F=!0;break;case n.keys.BOTTOM:V.ctrlKey||V.metaKey||V.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),F=!0;break;case n.keys.LEFT:V.ctrlKey||V.metaKey||V.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),F=!0;break;case n.keys.RIGHT:V.ctrlKey||V.metaKey||V.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),F=!0;break}F&&(V.preventDefault(),n.update())}function Pe(V){if(T.length===1)A.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);A.set(ge,_e)}}function at(V){if(T.length===1)v.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);v.set(ge,_e)}}function se(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);_.set(0,ze)}function et(V){n.enableZoom&&se(V),n.enablePan&&at(V)}function ke(V){n.enableZoom&&se(V),n.enableRotate&&Pe(V)}function dt(V){if(T.length==1)p.set(V.pageX,V.pageY);else{const ge=tt(V),_e=.5*(V.pageX+ge.x),ze=.5*(V.pageY+ge.y);p.set(_e,ze)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p)}function Xe(V){if(T.length===1)E.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);E.set(ge,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ft(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);w.set(0,ze),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),te(x.y),_.copy(w);const Ne=(V.pageX+F.x)*.5,_t=(V.pageY+F.y)*.5;ee(Ne,_t)}function Y(V){n.enableZoom&&ft(V),n.enablePan&&Xe(V)}function k(V){n.enableZoom&&ft(V),n.enableRotate&&dt(V)}function le(V){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(V.pointerId),n.domElement.addEventListener("pointermove",Ae),n.domElement.addEventListener("pointerup",me)),!ct(V)&&(nt(V),V.pointerType==="touch"?Ye(V):Ee(V)))}function Ae(V){n.enabled!==!1&&(V.pointerType==="touch"?Le(V):Oe(V))}function me(V){switch(pt(V),T.length){case 0:n.domElement.releasePointerCapture(V.pointerId),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(sx),s=i.NONE;break;case 1:const F=T[0],ge=D[F];Ye({pointerId:F,pageX:ge.x,pageY:ge.y});break}}function Ee(V){let F;switch(V.button){case 0:F=n.mouseButtons.LEFT;break;case 1:F=n.mouseButtons.MIDDLE;break;case 2:F=n.mouseButtons.RIGHT;break;default:F=-1}switch(F){case $o.DOLLY:if(n.enableZoom===!1)return;Z(V),s=i.DOLLY;break;case $o.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enablePan===!1)return;re(V),s=i.PAN}else{if(n.enableRotate===!1)return;z(V),s=i.ROTATE}break;case $o.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enableRotate===!1)return;z(V),s=i.ROTATE}else{if(n.enablePan===!1)return;re(V),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Oe(V){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;G(V);break;case i.DOLLY:if(n.enableZoom===!1)return;de(V);break;case i.PAN:if(n.enablePan===!1)return;pe(V);break}}function Ce(V){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(V.preventDefault(),n.dispatchEvent(gg),fe(Qe(V)),n.dispatchEvent(sx))}function Qe(V){const F=V.deltaMode,ge={clientX:V.clientX,clientY:V.clientY,deltaY:V.deltaY};switch(F){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return V.ctrlKey&&!b&&(ge.deltaY*=10),ge}function ve(V){V.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(V){V.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function Be(V){n.enabled===!1||n.enablePan===!1||ye(V)}function Ye(V){switch(ut(V),T.length){case 1:switch(n.touches.ONE){case el.ROTATE:if(n.enableRotate===!1)return;Pe(V),s=i.TOUCH_ROTATE;break;case el.PAN:if(n.enablePan===!1)return;at(V),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case el.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(V),s=i.TOUCH_DOLLY_PAN;break;case el.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(V),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Le(V){switch(ut(V),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;dt(V),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Xe(V),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(V),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(V),n.update();break;default:s=i.NONE}}function be(V){n.enabled!==!1&&V.preventDefault()}function nt(V){T.push(V.pointerId)}function pt(V){delete D[V.pointerId];for(let F=0;F<T.length;F++)if(T[F]==V.pointerId){T.splice(F,1);return}}function ct(V){for(let F=0;F<T.length;F++)if(T[F]==V.pointerId)return!0;return!1}function ut(V){let F=D[V.pointerId];F===void 0&&(F=new Ge,D[V.pointerId]=F),F.set(V.pageX,V.pageY)}function tt(V){const F=V.pointerId===T[0]?T[1]:T[0];return D[F]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ce,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",ve,{passive:!0,capture:!0}),this.update()}}function ox(r,e){if(e===sb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===wA||e===gE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===wA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class D8 extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new k8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new P8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new N8(t)}),this.register(function(t){return new X8(t)}),this.register(function(t){return new K8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=yu.extractUrlBase(e);o=yu.resolveURL(u,this.path)}else o=yu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Dl(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===lx){try{o[xt.KHR_BINARY_GLTF]=new J8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new uN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case xt.KHR_MATERIALS_UNLIT:o[A]=new U8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new Z8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new $8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new eN;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function L8(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const xt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class N8{constructor(e){this.parser=e,this.name=xt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const h=new Ke(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Sr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new ex(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new m8(h),c.distance=u;break;case"spot":c=new A8(h),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ha(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class U8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return xs}extendParams(e,t,n){const i=[];e.color=new Ke(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Sr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Qr))}return Promise.all(i)}}class P8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Ke(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Sr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Qr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ke().setRGB(c[0],c[1],c[2],Sr),Promise.all(s)}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class G8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new Ke().setRGB(c[0],c[1],c[2],Sr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Qr)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class j8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class W8{constructor(e){this.parser=e,this.name=xt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Y8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class q8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class X8{constructor(e){this.name=xt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class K8{constructor(e){this.name=xt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==ii.TRIANGLES&&h.mode!==ii.TRIANGLE_STRIP&&h.mode!==ii.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const v=new st,E=new j,m=new Wi,_=new j(1,1,1),w=new YL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new ag(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const lx="glTF",Eu=12,cx={JSON:1313821514,BIN:5130562};class J8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Eu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==lx)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Eu,s=new DataView(e,Eu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===cx.JSON){const u=new Uint8Array(e,Eu+o,c);this.content=n.decode(u)}else if(h===cx.BIN){const u=Eu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Z8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},h={},u={};for(const d in o){const A=_g[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=_g[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Ll[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Sr,p)})})}}class $8{constructor(){this.name=xt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class eN{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class ux extends _u{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],M=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*M+m*T+_*D}return s}}const tN=new Wi;class rN extends ux{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return tN.fromArray(s).normalize().toArray(s),s}}const ii={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Ll={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:fr,9729:pr,9984:Vy,9985:qh,9986:Jc,9987:wi},dx={33071:xi,33648:Yh,10497:$s},mg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_g={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ua={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},nN={CUBICSPLINE:void 0,LINEAR:il,STEP:ru},vg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function iN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new ug({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:yi})),r.DefaultMaterial}function mo(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ha(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function sN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],c=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;c.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function aN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function oN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+yg(t.attributes):e=r.indices+":"+yg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+yg(r.targets[n]);return e}function yg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function Eg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function lN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const cN=new st;class uN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new L8,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new K2(this.options.manager):this.textureLoader=new v8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Dl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return mo(s,c,i),ha(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let c=0,h=o.length;c<h;c++)e[o[c]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(yu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=mg[i.type],c=Ll[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Fr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],h=mg[i.type],u=Ll[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new HL(E,g/d),t.cache.add(w,x)),m=new rg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Fr(E,h,v);if(i.sparse!==void 0){const _=mg.SCALAR,w=Ll[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*_),M=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Fr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,M[T*h]),h>=2&&m.setY(b,M[T*h+1]),h>=3&&m.setZ(b,M[T*h+2]),h>=4&&m.setW(b,M[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=hx[A.magFilter]||pr,d.minFilter=hx[A.minFilter]||wi,d.wrapS=dx[A.wrapS]||$s,d.wrapT=dx[A.wrapT]||$s,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],c=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=c.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Tr(E);m.needsUpdate=!0,p(m)}),t.load(yu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||lN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new G2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new k2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return ug}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new Ke(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Sr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,Qr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,c)})))}s.doubleSided===!0&&(c.side=Ei);const d=s.alphaMode||vg.OPAQUE;if(d===vg.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===vg.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==xs){const A=s.emissiveFactor;c.emissive=new Ke().setRGB(A[0],A[1],A[2],Sr)}return s.emissiveTexture!==void 0&&o!==xs&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,Qr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&mo(i,A,s),A})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return fx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=oN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=fx(new Gn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?iN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ii.TRIANGLES||m.mode===ii.TRIANGLE_STRIP||m.mode===ii.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new VL(E,w):new Yr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ii.TRIANGLE_STRIP?_.geometry=ox(_.geometry,gE):m.mode===ii.TRIANGLE_FAN&&(_.geometry=ox(_.geometry,wA));else if(m.mode===ii.LINES)_=new qL(E,w);else if(m.mode===ii.LINE_STRIP)_=new lg(E,w);else if(m.mode===ii.LINE_LOOP)_=new XL(E,w);else if(m.mode===ii.POINTS)_=new KL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&aN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ha(_,s),m.extensions&&mo(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&mo(i,A[0],s),A[0];const p=new oa;s.extensions&&mo(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new un(SA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new pu(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ha(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new st;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new sg(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],M=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,M,T,D);if(b)for(let S=0;S<b.length;S++)_.push(b[S])}return new a8(s,void 0,_)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,cN)});for(let g=0,v=A.length;g<v;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new L2:u.length>1?d=new oa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ha(d,s),s.extensions&&mo(n,d,s),s.matrix!==void 0){const A=new st;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new oa;n.name&&(s.name=i.createUniqueName(n.name)),ha(s,n),n.extensions&&mo(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof qi||p instanceof Tr)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],c=e.name?e.name:e.uuid,h=[];ua[s.path]===ua.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(c);let u;switch(ua[s.path]){case ua.weights:u=Bl;break;case ua.rotation:u=go;break;case ua.position:case ua.scale:u=Rl;break;default:switch(n.itemSize){case 1:u=Bl;break;case 2:case 3:default:u=Rl;break}break}const d=i.interpolation!==void 0?nN[i.interpolation]:il,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Eg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof go?rN:ux;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function hN(r,e,t){const n=e.attributes,i=new Er;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new j(h[0],h[1],h[2]),new j(u[0],u[1],u[2])),c.normalized){const d=Eg(Ll[c.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new j,h=new j;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=Eg(Ll[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function fx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=_g[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Sr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ha(r,e),hN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?sN(r,e.targets,t):r})}class dN{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const fN=0,px=2,pN=1,Ax=2,AN=0,gN=1,mN=10,_N=0,gx=9,mx=15,_x=16,vx=22,yx=37,Ex=43,xx=76,wx=83,Ix=97,Cx=100,Sx=103,Mx=109,Tx=165,Bx=166;class vN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class xu{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const dn=[171,75,84,88,32,50,48,187,13,10,26,10];function bx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function yN(r){const e=new Uint8Array(r.buffer,r.byteOffset,dn.length);if(e[0]!==dn[0]||e[1]!==dn[1]||e[2]!==dn[2]||e[3]!==dn[3]||e[4]!==dn[4]||e[5]!==dn[5]||e[6]!==dn[6]||e[7]!==dn[7]||e[8]!==dn[8]||e[9]!==dn[9]||e[10]!==dn[10]||e[11]!==dn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new vN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new xu(r,dn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new xu(r,dn.length+n,3*s*8,!0);for(let te=0;te<s;te++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new xu(r,o,c,!0),v={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(v.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const H={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&H.channelType?(H.sampleLower=g._nextInt32(),H.sampleUpper=g._nextInt32()):(H.sampleLower=g._nextUint32(),H.sampleUpper=g._nextUint32()),v.samples[te]=H}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new xu(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),H=m._scan(te),ee=bx(H),Q=m._scan(te-H.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new xu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),M=_._nextUint32(),T=_._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,S=b+I,L=S+R,P=L+M,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+S,R),X=new Uint8Array(r.buffer,r.byteOffset+L,M),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:W,tablesData:X,extendedData:K},t}let xg,Ss,wg;const Ig={env:{emscripten_notify_memory_growth:function(r){wg=new Uint8Array(Ss.exports.memory.buffer)}}};class EN{init(){return xg||(xg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ig)).then(this._init):WebAssembly.instantiate(Buffer.from(Rx,"base64"),Ig).then(this._init),xg)}_init(e){Ss=e.instance,Ig.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ss)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Ss.exports.malloc(n);wg.set(e,i),t=t||Number(Ss.exports.ZSTD_findDecompressedSize(i,n));const s=Ss.exports.malloc(t),o=Ss.exports.ZSTD_decompress(s,t,i,n),c=wg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),c}}const Rx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Cg=new WeakMap;let Sg=0,Mg;class Zi extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new dN,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new Dl(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Dl(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const c=Zi.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Zi.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Zi.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Zi.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3829
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([h])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const u=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return u.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),u})}),Sg>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Sg++}return this.transcoderPending}load(e,t,n,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new
|
|
3828
|
+
}`;class UL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Tr,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new En({vertexShader:LL,fragmentShader:NL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Yr(new fu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class PL extends so{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new UL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let M=null;const T=new un;T.layers.enable(1),T.viewport=new Ot;const D=new un;D.layers.enable(2),D.viewport=new Ot;const b=[T,D],S=new RL;S.layers.enable(1),S.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getTargetRaySpace()},this.getControllerGrip=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getGripSpace()},this.getHand=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getHandSpace()};function N(G){const de=I.indexOf(G.inputSource);if(de===-1)return;const pe=x[de];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.inputSource}))}function W(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",X);for(let G=0;G<x.length;G++){const de=I[G];de!==null&&(I[G]=null,x[G].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){c=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(G){u=G},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(_=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",W),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const de={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,de),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new Mi(g.framebufferWidth,g.framebufferHeight,{format:gr,type:Ar,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,pe=null,fe=null;m.depth&&(fe=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?eu:il,pe=m.stencil?$c:Ii);const ye={colorFormat:t.RGBA8,depthFormat:fe,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:gr,type:Ar,depthTexture:new a2(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Pe=e.properties.get(w);Pe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(G){for(let de=0;de<G.removed.length;de++){const pe=G.removed[de],fe=I.indexOf(pe);fe>=0&&(I[fe]=null,x[fe].disconnect(pe))}for(let de=0;de<G.added.length;de++){const pe=G.added[de];let fe=I.indexOf(pe);if(fe===-1){for(let Pe=0;Pe<x.length;Pe++)if(Pe>=I.length){I.push(pe),fe=Pe;break}else if(I[Pe]===null){I[Pe]=pe,fe=Pe;break}if(fe===-1)break}const ye=x[fe];ye&&ye.connect(pe)}}const K=new j,te=new j;function H(G,de,pe){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(pe.matrixWorld);const fe=K.distanceTo(te),ye=de.projectionMatrix.elements,Pe=pe.projectionMatrix.elements,at=ye[14]/(ye[10]-1),se=ye[14]/(ye[10]+1),et=(ye[9]+1)/ye[5],ke=(ye[9]-1)/ye[5],dt=(ye[8]-1)/ye[0],Xe=(Pe[8]+1)/Pe[0],ft=at*dt,Y=at*Xe,k=fe/(-dt+Xe),le=k*-dt;de.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(le),G.translateZ(k),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();const Ae=at+k,me=se+k,Ee=ft-le,Oe=Y+(fe-le),Ce=et*se/me*Ae,Qe=ke*se/me*Ae;G.projectionMatrix.makePerspective(Ee,Oe,Ce,Qe,Ae,me),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function ee(G,de){de===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(de.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;E.texture!==null&&(G.near=E.depthNear,G.far=E.depthFar),S.near=D.near=T.near=G.near,S.far=D.far=T.far=G.far,(L!==S.near||P!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,P=S.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),G.updateProjectionMatrix());const de=G.parent,pe=S.cameras;ee(S,de);for(let fe=0;fe<pe.length;fe++)ee(pe[fe],de);pe.length===2?H(S,T,D):S.projectionMatrix.copy(T.projectionMatrix),Q(G,S,de)};function Q(G,de,pe){pe===null?G.matrix.copy(de.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(de.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(de.projectionMatrix),G.projectionMatrixInverse.copy(de.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=ol*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(G){h=G,p!==null&&(p.fixedFoveation=G),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=G)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(G,de){if(d=de.getViewerPose(u||o),v=de,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let fe=!1;pe.length!==S.cameras.length&&(S.cameras.length=0,fe=!0);for(let Pe=0;Pe<pe.length;Pe++){const at=pe[Pe];let se=null;if(g!==null)se=g.getViewport(at);else{const ke=A.getViewSubImage(p,at);se=ke.viewport,Pe===0&&(e.setRenderTargetTextures(w,ke.colorTexture,p.ignoreDepthValues?void 0:ke.depthStencilTexture),e.setRenderTarget(w))}let et=b[Pe];et===void 0&&(et=new un,et.layers.enable(Pe),et.viewport=new Ot,b[Pe]=et),et.matrix.fromArray(at.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(at.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Pe===0&&(S.matrix.copy(et.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),fe===!0&&S.cameras.push(et)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Pe=A.getDepthInformation(pe[0]);Pe&&Pe.isValid&&Pe.texture&&E.init(e,Pe,i.renderState)}}for(let pe=0;pe<x.length;pe++){const fe=I[pe],ye=x[pe];fe!==null&&ye!==void 0&&ye.update(fe,de,u||o)}E.render(e,S),z&&z(G,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),v=null}const re=new ZE;re.setAnimationLoop(Z),this.setAnimationLoop=function(G){z=G},this.dispose=function(){}}}const po=new Yi,kL=new st;function QL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,YE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===kr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===kr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,po.copy(I),po.x*=-1,po.y*=-1,po.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(po.y*=-1,po.z*=-1),m.envMapRotation.value.setFromMatrix4(kL.makeRotationFromEuler(po)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===kr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function FL(r,e,t,n){let i={},s={},o=[];const c=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const M=e.render.frame;s[w.id]!==M&&(p(w),s[w.id]=M)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,M=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let M=0,T=I.length;M<T;M++){const D=Array.isArray(I[M])?I[M]:[I[M]];for(let b=0,S=D.length;b<S;b++){const L=D[b];if(g(L,M,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let W=0;for(let X=0;X<N.length;X++){const K=N[X],te=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+W,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,W),W+=te.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const M=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof M=="number"||typeof M=="boolean"?R[T]=M:R[T]=M.clone(),!0;{const D=R[T];if(typeof M=="number"||typeof M=="boolean"){if(D!==M)return R[T]=M,!0}else if(D.equals(M)===!1)return D.copy(M),!0}return!1}function v(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let S=0,L=b.length;S<L;S++){const P=b[S],N=Array.isArray(P.value)?P.value:[P.value];for(let W=0,X=N.length;W<X;W++){const K=N[W],te=E(K),H=I%R;H!==0&&R-H<te.boundary&&(I+=R-H),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const M=I%R;return M>0&&(I+=R-M),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Db(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let E=null,m=null;const _=[],w=[];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=Qr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,M=0,T=null,D=-1,b=null;const S=new Ot,L=new Ot;let P=null;const N=new Ke(0);let W=0,X=t.width,K=t.height,te=1,H=null,ee=null;const Q=new Ot(0,0,X,K),z=new Ot(0,0,X,K);let Z=!1;const re=new WA;let G=!1,de=!1;const pe=new st,fe=new Ge,ye=new j,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function at(){return T===null?te:1}let se=n;function et(O,ne){const ue=t.getContext(O,ne);return ue!==null?ue:null}try{const O={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${jh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",ze,!1),se===null){const ne="webgl2";if(se=et(ne,O),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let ke,dt,Xe,ft,Y,k,le,Ae,me,Ee,Oe,Ce,Qe,ve,xe,Be,Ye,Le,be,nt,pt,ct,ut,tt;function V(){ke=new X6(se),ke.init(),dt=new G6(se,ke,e),ct=new bL(se,ke),Xe=new TL(se),ft=new Z6(se),Y=new AL,k=new BL(se,ke,Xe,Y,dt,ct,ft),le=new j6(x),Ae=new q6(x),me=new i5(se),ut=new z6(se,me),Ee=new K6(se,me,ft,ut),Oe=new eD(se,Ee,me,ft),be=new $6(se,dt,k),Be=new V6(Y),Ce=new pL(x,le,Ae,ke,dt,ut,Be),Qe=new QL(x,Y),ve=new mL,xe=new wL(ke),Le=new O6(x,le,Ae,Xe,Oe,p,h),Ye=new ML(x,Oe,dt),tt=new FL(se,ft,dt,Xe),nt=new H6(se,ke,ft),pt=new J6(se,ke,ft),ft.programs=Ce.programs,x.capabilities=dt,x.extensions=ke,x.properties=Y,x.renderLists=ve,x.shadowMap=Ye,x.state=Xe,x.info=ft}V();const F=new PL(x,se);this.xr=F,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const O=ke.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=ke.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(O){O!==void 0&&(te=O,this.setSize(X,K,!1))},this.getSize=function(O){return O.set(X,K)},this.setSize=function(O,ne,ue=!0){if(F.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=O,K=ne,t.width=Math.floor(O*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=O+"px",t.style.height=ne+"px"),this.setViewport(0,0,O,ne)},this.getDrawingBufferSize=function(O){return O.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(O,ne,ue){X=O,K=ne,te=ue,t.width=Math.floor(O*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,O,ne)},this.getCurrentViewport=function(O){return O.copy(S)},this.getViewport=function(O){return O.copy(Q)},this.setViewport=function(O,ne,ue,he){O.isVector4?Q.set(O.x,O.y,O.z,O.w):Q.set(O,ne,ue,he),Xe.viewport(S.copy(Q).multiplyScalar(te).round())},this.getScissor=function(O){return O.copy(z)},this.setScissor=function(O,ne,ue,he){O.isVector4?z.set(O.x,O.y,O.z,O.w):z.set(O,ne,ue,he),Xe.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){Xe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){H=O},this.setTransparentSort=function(O){ee=O},this.getClearColor=function(O){return O.copy(Le.getClearColor())},this.setClearColor=function(){Le.setClearColor.apply(Le,arguments)},this.getClearAlpha=function(){return Le.getClearAlpha()},this.setClearAlpha=function(){Le.setClearAlpha.apply(Le,arguments)},this.clear=function(O=!0,ne=!0,ue=!0){let he=0;if(O){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===tu||Re===Kh||Re===fA}if(oe){const Re=T.texture.type,Je=Re===Ar||Re===Ii||Re===dA||Re===$c||Re===Wy||Re===Yy,it=Le.getClearColor(),ot=Le.getClearAlpha(),qe=it.r,At=it.g,ht=it.b;Je?(g[0]=qe,g[1]=At,g[2]=ht,g[3]=ot,se.clearBufferuiv(se.COLOR,0,g)):(v[0]=qe,v[1]=At,v[2]=ht,v[3]=ot,se.clearBufferiv(se.COLOR,0,v))}else he|=se.COLOR_BUFFER_BIT}ne&&(he|=se.DEPTH_BUFFER_BIT),ue&&(he|=se.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),se.clear(he)},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",ge,!1),t.removeEventListener("webglcontextrestored",_e,!1),t.removeEventListener("webglcontextcreationerror",ze,!1),ve.dispose(),xe.dispose(),Y.dispose(),le.dispose(),Ae.dispose(),Oe.dispose(),ut.dispose(),tt.dispose(),Ce.dispose(),F.dispose(),F.removeEventListener("sessionstart",hr),F.removeEventListener("sessionend",Vt),_r.stop()};function ge(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const O=ft.autoReset,ne=Ye.enabled,ue=Ye.autoUpdate,he=Ye.needsUpdate,oe=Ye.type;V(),ft.autoReset=O,Ye.enabled=ne,Ye.autoUpdate=ue,Ye.needsUpdate=he,Ye.type=oe}function ze(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function Ne(O){const ne=O.target;ne.removeEventListener("dispose",Ne),_t(ne)}function _t(O){Dt(O),Y.remove(O)}function Dt(O){const ne=Y.get(O).programs;ne!==void 0&&(ne.forEach(function(ue){Ce.releaseProgram(ue)}),O.isShaderMaterial&&Ce.releaseShaderCache(O))}this.renderBufferDirect=function(O,ne,ue,he,oe,Re){ne===null&&(ne=Pe);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=qm(O,ne,ue,he,oe);Xe.setMaterial(he,Je);let ot=ue.index,qe=1;if(he.wireframe===!0){if(ot=Ee.getWireframeAttribute(ue),ot===void 0)return;qe=2}const At=ue.drawRange,ht=ue.attributes.position;let Dr=At.start*qe,er=(At.start+At.count)*qe;Re!==null&&(Dr=Math.max(Dr,Re.start*qe),er=Math.min(er,(Re.start+Re.count)*qe)),ot!==null?(Dr=Math.max(Dr,0),er=Math.min(er,ot.count)):ht!=null&&(Dr=Math.max(Dr,0),er=Math.min(er,ht.count));const Rn=er-Dr;if(Rn<0||Rn===1/0)return;ut.setup(oe,he,it,ue,ot);let di,jt=nt;if(ot!==null&&(di=me.get(ot),jt=pt,jt.setIndex(di)),oe.isMesh)he.wireframe===!0?(Xe.setLineWidth(he.wireframeLinewidth*at()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let rt=he.linewidth;rt===void 0&&(rt=1),Xe.setLineWidth(rt*at()),oe.isLineSegments?jt.setMode(se.LINES):oe.isLineLoop?jt.setMode(se.LINE_LOOP):jt.setMode(se.LINE_STRIP)}else oe.isPoints?jt.setMode(se.POINTS):oe.isSprite&&jt.setMode(se.TRIANGLES);if(oe.isBatchedMesh)jt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else if(oe.isInstancedMesh)jt.renderInstances(Dr,Rn,oe.count);else if(ue.isInstancedBufferGeometry){const rt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Yu=Math.min(ue.instanceCount,rt);jt.renderInstances(Dr,Rn,Yu)}else jt.render(Dr,Rn)};function Lt(O,ne,ue){O.transparent===!0&&O.side===Ei&&O.forceSinglePass===!1?(O.side=kr,O.needsUpdate=!0,Us(O,ne,ue),O.side=yi,O.needsUpdate=!0,Us(O,ne,ue),O.side=Ei):Us(O,ne,ue)}this.compile=function(O,ne,ue=null){ue===null&&(ue=O),m=xe.get(ue),m.init(),w.push(m),ue.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),O!==ue&&O.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),m.setupLights(x._useLegacyLights);const he=new Set;return O.traverse(function(oe){const Re=oe.material;if(Re)if(Array.isArray(Re))for(let Je=0;Je<Re.length;Je++){const it=Re[Je];Lt(it,ue,oe),he.add(it)}else Lt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(O,ne,ue=null){const he=this.compile(O,ne,ue);return new Promise(oe=>{function Re(){if(he.forEach(function(Je){Y.get(Je).currentProgram.isReady()&&he.delete(Je)}),he.size===0){oe(O);return}setTimeout(Re,10)}ke.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Mt=null;function vt(O){Mt&&Mt(O)}function hr(){_r.stop()}function Vt(){_r.start()}const _r=new ZE;_r.setAnimationLoop(vt),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){Mt=O,F.setAnimationLoop(O),O===null?_r.stop():_r.start()},F.addEventListener("sessionstart",hr),F.addEventListener("sessionend",Vt),this.render=function(O,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),F.enabled===!0&&F.isPresenting===!0&&(F.cameraAutoUpdate===!0&&F.updateCamera(ne),ne=F.getCamera()),O.isScene===!0&&O.onBeforeRender(x,O,ne,T),m=xe.get(O,w.length),m.init(),w.push(m),pe.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(pe),de=this.localClippingEnabled,G=Be.init(this.clippingPlanes,de),E=ve.get(O,_.length),E.init(),_.push(E),bn(O,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(H,ee),this.info.render.frame++,G===!0&&Be.beginShadows();const ue=m.state.shadowsArray;if(Ye.render(ue,O,ne),G===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(F.enabled===!1||F.isPresenting===!1||F.hasDepthSensing()===!1)&&Le.render(E,O),m.setupLights(x._useLegacyLights),ne.isArrayCamera){const he=ne.cameras;for(let oe=0,Re=he.length;oe<Re;oe++){const Je=he[oe];qt(E,O,Je,Je.viewport)}}else qt(E,O,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),O.isScene===!0&&O.onAfterRender(x,O,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function bn(O,ne,ue,he){if(O.visible===!1)return;if(O.layers.test(ne.layers)){if(O.isGroup)ue=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ne);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){he&&ye.setFromMatrixPosition(O.matrixWorld).applyMatrix4(pe);const Re=Oe.update(O),Je=O.material;Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Re=Oe.update(O),Je=O.material;if(he&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),ye.copy(O.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ye.copy(Re.boundingSphere.center)),ye.applyMatrix4(O.matrixWorld).applyMatrix4(pe)),Array.isArray(Je)){const it=Re.groups;for(let ot=0,qe=it.length;ot<qe;ot++){const At=it[ot],ht=Je[At.materialIndex];ht&&ht.visible&&E.push(O,Re,ht,ue,ye.z,At)}}else Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}const oe=O.children;for(let Re=0,Je=oe.length;Re<Je;Re++)bn(oe[Re],ne,ue,he)}function qt(O,ne,ue,he){const oe=O.opaque,Re=O.transmissive,Je=O.transparent;m.setupLightsView(ue),G===!0&&Be.setGlobalState(x.clippingPlanes,ue),Re.length>0&&hi(oe,Re,ne,ue),he&&Xe.viewport(S.copy(he)),oe.length>0&&Jn(oe,ne,ue),Re.length>0&&Jn(Re,ne,ue),Je.length>0&&Jn(Je,ne,ue),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function hi(O,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float")?yn:Ar,minFilter:wi,samples:4,stencilBuffer:s});const ot=Y.get(m.state.transmissionRenderTarget);ot.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(fe),oe.setSize(fe.x,fe.y);const Re=x.getRenderTarget();x.setRenderTarget(oe),x.getClearColor(N),W=x.getClearAlpha(),W<1&&x.setClearColor(16777215,.5),x.clear();const Je=x.toneMapping;x.toneMapping=Zs,Jn(O,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let ot=0,qe=ne.length;ot<qe;ot++){const At=ne[ot],ht=At.object,Dr=At.geometry,er=At.material,Rn=At.group;if(er.side===Ei&&ht.layers.test(he.layers)){const di=er.side;er.side=kr,er.needsUpdate=!0,Ns(ht,ue,he,Dr,er,Rn),er.side=di,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Jn(O,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=O.length;oe<Re;oe++){const Je=O[oe],it=Je.object,ot=Je.geometry,qe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,ot,qe,At)}}function Ns(O,ne,ue,he,oe,Re){O.onBeforeRender(x,ne,ue,he,oe,Re),O.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,O,Re),oe.transparent===!0&&oe.side===Ei&&oe.forceSinglePass===!1?(oe.side=kr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=yi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=Ei):x.renderBufferDirect(ue,ne,he,oe,O,Re),O.onAfterRender(x,ne,ue,he,oe,Re)}function Us(O,ne,ue){ne.isScene!==!0&&(ne=Pe);const he=Y.get(O),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ce.getParameters(O,oe.state,Re,ne,ue),ot=Ce.getProgramCacheKey(it);let qe=he.programs;he.environment=O.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(O.isMeshStandardMaterial?Ae:le).get(O.envMap||he.environment),he.envMapRotation=he.environment!==null&&O.envMap===null?ne.environmentRotation:O.envMapRotation,qe===void 0&&(O.addEventListener("dispose",Ne),qe=new Map,he.programs=qe);let At=qe.get(ot);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return wf(O,it),At}else it.uniforms=Ce.getUniforms(O),O.onBuild(ue,it,x),O.onBeforeCompile(it,x),At=Ce.acquireProgram(it,ot),qe.set(ot,At),he.uniforms=it.uniforms;const ht=he.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(ht.clippingPlanes=Be.uniform),wf(O,it),he.needsLights=Ps(O),he.lightsStateVersion=Je,he.needsLights&&(ht.ambientLightColor.value=oe.state.ambient,ht.lightProbe.value=oe.state.probe,ht.directionalLights.value=oe.state.directional,ht.directionalLightShadows.value=oe.state.directionalShadow,ht.spotLights.value=oe.state.spot,ht.spotLightShadows.value=oe.state.spotShadow,ht.rectAreaLights.value=oe.state.rectArea,ht.ltc_1.value=oe.state.rectAreaLTC1,ht.ltc_2.value=oe.state.rectAreaLTC2,ht.pointLights.value=oe.state.point,ht.pointLightShadows.value=oe.state.pointShadow,ht.hemisphereLights.value=oe.state.hemi,ht.directionalShadowMap.value=oe.state.directionalShadowMap,ht.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ht.spotShadowMap.value=oe.state.spotShadowMap,ht.spotLightMatrix.value=oe.state.spotLightMatrix,ht.spotLightMap.value=oe.state.spotLightMap,ht.pointShadowMap.value=oe.state.pointShadowMap,ht.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function ac(O){if(O.uniformsList===null){const ne=O.currentProgram.getUniforms();O.uniformsList=bd.seqWithValue(ne.seq,O.uniforms)}return O.uniformsList}function wf(O,ne){const ue=Y.get(O);ue.outputColorSpace=ne.outputColorSpace,ue.batching=ne.batching,ue.instancing=ne.instancing,ue.instancingColor=ne.instancingColor,ue.instancingMorph=ne.instancingMorph,ue.skinning=ne.skinning,ue.morphTargets=ne.morphTargets,ue.morphNormals=ne.morphNormals,ue.morphColors=ne.morphColors,ue.morphTargetsCount=ne.morphTargetsCount,ue.numClippingPlanes=ne.numClippingPlanes,ue.numIntersection=ne.numClipIntersection,ue.vertexAlphas=ne.vertexAlphas,ue.vertexTangents=ne.vertexTangents,ue.toneMapping=ne.toneMapping}function qm(O,ne,ue,he,oe){ne.isScene!==!0&&(ne=Pe),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Sr,ot=(he.isMeshStandardMaterial?Ae:le).get(he.envMap||Je),qe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ht=!!ue.morphAttributes.position,Dr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Rn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Rn=x.toneMapping);const di=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=di!==void 0?di.length:0,rt=Y.get(he),Yu=m.state.lights;if(G===!0&&(de===!0||O!==b)){const Ln=O===b&&he.id===D;Be.setState(he,O,Ln)}let gn=!1;he.version===rt.__version?(rt.needsLights&&rt.lightsStateVersion!==Yu.state.version||rt.outputColorSpace!==it||oe.isBatchedMesh&&rt.batching===!1||!oe.isBatchedMesh&&rt.batching===!0||oe.isInstancedMesh&&rt.instancing===!1||!oe.isInstancedMesh&&rt.instancing===!0||oe.isSkinnedMesh&&rt.skinning===!1||!oe.isSkinnedMesh&&rt.skinning===!0||oe.isInstancedMesh&&rt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&rt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&rt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&rt.instancingMorph===!1&&oe.morphTexture!==null||rt.envMap!==ot||he.fog===!0&&rt.fog!==Re||rt.numClippingPlanes!==void 0&&(rt.numClippingPlanes!==Be.numPlanes||rt.numIntersection!==Be.numIntersection)||rt.vertexAlphas!==qe||rt.vertexTangents!==At||rt.morphTargets!==ht||rt.morphNormals!==Dr||rt.morphColors!==er||rt.toneMapping!==Rn||rt.morphTargetsCount!==jt)&&(gn=!0):(gn=!0,rt.__version=he.version);let ks=rt.currentProgram;gn===!0&&(ks=Us(he,ne,oe));let If=!1,Do=!1,Ia=!1;const vr=ks.getUniforms(),Dn=rt.uniforms;if(Xe.useProgram(ks.program)&&(If=!0,Do=!0,Ia=!0),he.id!==D&&(D=he.id,Do=!0),If||b!==O){vr.setValue(se,"projectionMatrix",O.projectionMatrix),vr.setValue(se,"viewMatrix",O.matrixWorldInverse);const Ln=vr.map.cameraPosition;Ln!==void 0&&Ln.setValue(se,ye.setFromMatrixPosition(O.matrixWorld)),dt.logarithmicDepthBuffer&&vr.setValue(se,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&vr.setValue(se,"isOrthographic",O.isOrthographicCamera===!0),b!==O&&(b=O,Do=!0,Ia=!0)}if(oe.isSkinnedMesh){vr.setOptional(se,oe,"bindMatrix"),vr.setOptional(se,oe,"bindMatrixInverse");const Ln=oe.skeleton;Ln&&(Ln.boneTexture===null&&Ln.computeBoneTexture(),vr.setValue(se,"boneTexture",Ln.boneTexture,k))}oe.isBatchedMesh&&(vr.setOptional(se,oe,"batchingTexture"),vr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ca=ue.morphAttributes;if((Ca.position!==void 0||Ca.normal!==void 0||Ca.color!==void 0)&&be.update(oe,ue,ks),(Do||rt.receiveShadow!==oe.receiveShadow)&&(rt.receiveShadow=oe.receiveShadow,vr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Dn.envMap.value=ot,Dn.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Dn.envMapIntensity.value=ne.environmentIntensity),Do&&(vr.setValue(se,"toneMappingExposure",x.toneMappingExposure),rt.needsLights&&Xm(Dn,Ia),Re&&he.fog===!0&&Qe.refreshFogUniforms(Dn,Re),Qe.refreshMaterialUniforms(Dn,he,te,K,m.state.transmissionRenderTarget),bd.upload(se,ac(rt),Dn,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(bd.upload(se,ac(rt),Dn,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&vr.setValue(se,"center",oe.center),vr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),vr.setValue(se,"normalMatrix",oe.normalMatrix),vr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Ln=he.uniformsGroups;for(let qu=0,Xu=Ln.length;qu<Xu;qu++){const Ku=Ln[qu];tt.update(Ku,ks),tt.bind(Ku,ks)}}return ks}function Xm(O,ne){O.ambientLightColor.needsUpdate=ne,O.lightProbe.needsUpdate=ne,O.directionalLights.needsUpdate=ne,O.directionalLightShadows.needsUpdate=ne,O.pointLights.needsUpdate=ne,O.pointLightShadows.needsUpdate=ne,O.spotLights.needsUpdate=ne,O.spotLightShadows.needsUpdate=ne,O.rectAreaLights.needsUpdate=ne,O.hemisphereLights.needsUpdate=ne}function Ps(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(O,ne,ue){Y.get(O.texture).__webglTexture=ne,Y.get(O.depthTexture).__webglTexture=ue;const he=Y.get(O);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||ke.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),he.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,ne){const ue=Y.get(O);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(O,ne=0,ue=0){T=O,R=ne,M=ue;let he=!0,oe=null,Re=!1,Je=!1;if(O){const it=Y.get(O);it.__useDefaultFramebuffer!==void 0?(Xe.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(O):it.__hasExternalTextures&&k.rebindTextures(O,Y.get(O.texture).__webglTexture,Y.get(O.depthTexture).__webglTexture);const ot=O.texture;(ot.isData3DTexture||ot.isDataArrayTexture||ot.isCompressedArrayTexture)&&(Je=!0);const qe=Y.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(qe[ne])?oe=qe[ne][ue]:oe=qe[ne],Re=!0):O.samples>0&&k.useMultisampledRTT(O)===!1?oe=Y.get(O).__webglMultisampledFramebuffer:Array.isArray(qe)?oe=qe[ue]:oe=qe,S.copy(O.viewport),L.copy(O.scissor),P=O.scissorTest}else S.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Xe.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Xe.drawBuffers(O,oe),Xe.viewport(S),Xe.scissor(L),Xe.setScissorTest(P),Re){const it=Y.get(O.texture);se.framebufferTexture2D(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,se.TEXTURE_CUBE_MAP_POSITIVE_X+ne,it.__webglTexture,ue)}else if(Je){const it=Y.get(O.texture),ot=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,ot)}D=-1},this.readRenderTargetPixels=function(O,ne,ue,he,oe,Re,Je){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Xe.bindFramebuffer(se.FRAMEBUFFER,it);try{const ot=O.texture,qe=ot.format,At=ot.type;if(qe!==gr&&ct.convert(qe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=At===yn&&(ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float"));if(At!==Ar&&ct.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=O.width-he&&ue>=0&&ue<=O.height-oe&&se.readPixels(ne,ue,he,oe,ct.convert(qe),ct.convert(At),Re)}finally{const ot=T!==null?Y.get(T).__webglFramebuffer:null;Xe.bindFramebuffer(se.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(O,ne,ue=0){const he=Math.pow(2,-ue),oe=Math.floor(ne.image.width*he),Re=Math.floor(ne.image.height*he);k.setTexture2D(ne,0),se.copyTexSubImage2D(se.TEXTURE_2D,ue,0,0,O.x,O.y,oe,Re),Xe.unbindTexture()},this.copyTextureToTexture=function(O,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=ct.convert(ue.format),it=ct.convert(ue.type);k.setTexture2D(ue,0),se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,ue.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,ue.unpackAlignment),ne.isDataTexture?se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,O.x,O.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Xe.unbindTexture()},this.copyTextureToTexture3D=function(O,ne,ue,he,oe=0){const Re=Math.round(O.max.x-O.min.x),Je=Math.round(O.max.y-O.min.y),it=O.max.z-O.min.z+1,ot=ct.convert(he.format),qe=ct.convert(he.type);let At;if(he.isData3DTexture)k.setTexture3D(he,0),At=se.TEXTURE_3D;else if(he.isDataArrayTexture||he.isCompressedArrayTexture)k.setTexture2DArray(he,0),At=se.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,he.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,he.unpackAlignment);const ht=se.getParameter(se.UNPACK_ROW_LENGTH),Dr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Rn=se.getParameter(se.UNPACK_SKIP_ROWS),di=se.getParameter(se.UNPACK_SKIP_IMAGES),jt=ue.isCompressedTexture?ue.mipmaps[oe]:ue.image;se.pixelStorei(se.UNPACK_ROW_LENGTH,jt.width),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,jt.height),se.pixelStorei(se.UNPACK_SKIP_PIXELS,O.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,O.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,O.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ht),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Dr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Rn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,di),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Xe.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?k.setTextureCube(O,0):O.isData3DTexture?k.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?k.setTexture2DArray(O,0):k.setTexture2D(O,0),Xe.unbindTexture()},this.resetState=function(){R=0,M=0,T=null,Xe.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===td?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===nu?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class zL extends Zt{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 Yi,this.environmentIntensity=1,this.environmentRotation=new Yi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(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),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class HL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ci()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("THREE.InterleavedBuffer: 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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ci()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ci()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const hn=new j;class rg{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyMatrix4(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyNormalMatrix(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.transformDirection(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Si(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Si(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Si(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Si(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Fr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new rg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const T2=new j,B2=new Ot,b2=new Ot,GL=new j,R2=new st,Rd=new j,ng=new Bi,D2=new st,ig=new cu;class VL extends Yr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Hy,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Er),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Rd),this.boundingBox.expandByPoint(Rd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Bi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Rd),this.boundingSphere.expandByPoint(Rd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ng.copy(this.boundingSphere),ng.applyMatrix4(i),e.ray.intersectsSphere(ng)!==!1&&(D2.copy(i).invert(),ig.copy(e.ray).applyMatrix4(D2),!(this.boundingBox!==null&&ig.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ig)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ot,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Hy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===KB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;B2.fromBufferAttribute(i.attributes.skinIndex,e),b2.fromBufferAttribute(i.attributes.skinWeight,e),T2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=b2.getComponent(s);if(o!==0){const c=B2.getComponent(s);R2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(GL.copy(T2).applyMatrix4(R2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class L2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ao extends Tr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=fr,d=fr,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const N2=new st,jL=new st;class sg{constructor(e=[],t=[]){this.uuid=Ci(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const c=e[s]?e[s].matrixWorld:jL;N2.multiplyMatrices(c,t[s]),N2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new sg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Ao(t,e,e,gr,lr);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new L2),this.bones.push(o),this.boneInverses.push(new st().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const c=n[i];e.boneInverses.push(c.toArray())}return e}}class ag extends Fr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Tl=new st,U2=new st,Dd=[],P2=new Er,WL=new st,gu=new Yr,mu=new Bi;class YL extends Yr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ag(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,WL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Er),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Tl),P2.copy(e.boundingBox).applyMatrix4(Tl),this.boundingBox.union(P2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Bi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Tl),mu.copy(e.boundingSphere).applyMatrix4(Tl),this.boundingSphere.union(mu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(gu.geometry=this.geometry,gu.material=this.material,gu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mu.copy(this.boundingSphere),mu.applyMatrix4(n),e.ray.intersectsSphere(mu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Tl),U2.multiplyMatrices(n,Tl),gu.matrixWorld=U2,gu.raycast(e,Dd);for(let o=0,c=Dd.length;o<c;o++){const h=Dd[o];h.instanceId=s,h.object=this,t.push(h)}Dd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new ag(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new Ao(new Float32Array(i*this.count),i,this.count,ea,lr));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class k2 extends qi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ke(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 Q2=new j,F2=new j,O2=new st,og=new cu,Ld=new Bi;class lg extends Zt{constructor(e=new Gn,t=new k2){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(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)Q2.fromBufferAttribute(t,i-1),F2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Q2.distanceTo(F2);e.setAttribute("lineDistance",new Di(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,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ld.copy(n.boundingSphere),Ld.applyMatrix4(i),Ld.radius+=s,e.ray.intersectsSphere(Ld)===!1)return;O2.copy(i).invert(),og.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new j,d=new j,A=new j,p=new j,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const z2=new j,H2=new j;class qL extends lg{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)z2.fromBufferAttribute(t,i),H2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+z2.distanceTo(H2);e.setAttribute("lineDistance",new Di(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XL extends lg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class G2 extends qi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ke(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const V2=new st,cg=new cu,Nd=new Bi,Ud=new j;class KL extends Zt{constructor(e=new Gn,t=new G2){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Nd.copy(n.boundingSphere),Nd.applyMatrix4(i),Nd.radius+=s,e.ray.intersectsSphere(Nd)===!1)return;V2.copy(i).invert(),cg.copy(e.ray).applyMatrix4(V2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,v=p;g<v;g++){const E=u.getX(g);Ud.fromBufferAttribute(d,E),j2(Ud,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,v=p;g<v;g++)Ud.fromBufferAttribute(d,g),j2(Ud,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function j2(r,e,t,n,i,s,o){const c=cg.distanceSqToPoint(r);if(c<t){const h=new j;cg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(c),point:h,index:e,face:null,object:o})}}class Pd extends Tr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class JL extends Pd{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=xi}}class ZL extends Pd{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,no),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class $L extends En{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ug extends qi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ke(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mE,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Yi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Li extends ug{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ke(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ke(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ke(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function kd(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function e8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function t8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function W2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function Y2(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class _u{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const c=n+o>>>1;e<t[c]?o=c:n=c+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class r8 extends _u{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fE,endingEnd:fE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case pE:s=e,c=2*t-n;break;case AE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case pE:o=e,h=2*n-t;break;case AE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class n8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class i8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ji{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=kd(t,this.TimeBufferType),this.values=kd(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:kd(e.times,Array),values:kd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new i8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new r8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ru:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case xA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ru;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return xA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&e8(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===xA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Ji.prototype.TimeBufferType=Float32Array,Ji.prototype.ValueBufferType=Float32Array,Ji.prototype.DefaultInterpolation=sl;class Bl extends Ji{}Bl.prototype.ValueTypeName="bool",Bl.prototype.ValueBufferType=Array,Bl.prototype.DefaultInterpolation=ru,Bl.prototype.InterpolantFactoryMethodLinear=void 0,Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class q2 extends Ji{}q2.prototype.ValueTypeName="color";class bl extends Ji{}bl.prototype.ValueTypeName="number";class s8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)Wi.slerpFlat(s,0,o,u-c,o,u,h);return s}}class go extends Ji{InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion",go.prototype.DefaultInterpolation=sl,go.prototype.InterpolantFactoryMethodSmooth=void 0;class Rl extends Ji{}Rl.prototype.ValueTypeName="string",Rl.prototype.ValueBufferType=Array,Rl.prototype.DefaultInterpolation=ru,Rl.prototype.InterpolantFactoryMethodLinear=void 0,Rl.prototype.InterpolantFactoryMethodSmooth=void 0;class Dl extends Ji{}Dl.prototype.ValueTypeName="vector";class a8{constructor(e="",t=-1,n=[],i=ib){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ci(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(l8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Ji.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=t8(h);h=W2(h,1,d),u=W2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new bl(".morphTargetInfluences["+t[c].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,v){if(p.length!==0){const E=[],m=[];Y2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new bl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Dl,p+".position",A,"pos",i),n(go,p+".quaternion",A,"rot",i),n(Dl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function o8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return bl;case"vector":case"vector2":case"vector3":case"vector4":return Dl;case"color":return q2;case"quaternion":return go;case"bool":case"boolean":return Bl;case"string":return Rl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function l8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=o8(r.type);if(r.times===void 0){const t=[],n=[];Y2(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const la={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class X2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const c8=new X2;class ca{constructor(e){this.manager=e!==void 0?e:c8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}ca.DEFAULT_MATERIAL_NAME="__DEFAULT";const Is={};class u8 extends Error{constructor(e,t){super(e),this.response=t}}class Ll extends ca{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=la.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Is[e]!==void 0){Is[e].push({onLoad:t,onProgress:n,onError:i});return}Is[e]=[],Is[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Is[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let M=0,T=d.length;M<T;M++){const D=d[M];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new u8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{la.add(e,u);const d=Is[e];delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Is[e];if(d===void 0)throw this.manager.itemError(e),u;delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class h8 extends ca{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const c=au("img");function h(){d(),la.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class d8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ao,c=new Ll(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:xi,o.wrapT=u.wrapT!==void 0?u.wrapT:xi,o.magFilter=u.magFilter!==void 0?u.magFilter:pr,o.minFilter=u.minFilter!==void 0?u.minFilter:pr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=wi),u.mipmapCount===1&&(o.minFilter=pr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class K2 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new Tr,o=new h8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Qd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ke(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class f8 extends Qd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ke(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const hg=new st,J2=new j,Z2=new j;class dg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new WA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;J2.setFromMatrixPosition(e.matrixWorld),t.position.copy(J2),Z2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Z2),t.updateMatrixWorld(),hg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(hg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class p8 extends dg{constructor(){super(new un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=ol*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class A8 extends Qd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new p8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const $2=new st,vu=new j,fg=new j;class g8 extends dg{constructor(){super(new un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new j(1,0,0),new j(-1,0,0),new j(0,0,1),new j(0,0,-1),new j(0,1,0),new j(0,-1,0)],this._cubeUps=[new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,0,1),new j(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),vu.setFromMatrixPosition(e.matrixWorld),n.position.copy(vu),fg.copy(n.position),fg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(fg),n.updateMatrixWorld(),i.makeTranslation(-vu.x,-vu.y,-vu.z),$2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($2)}}class m8 extends Qd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new g8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class _8 extends dg{constructor(){super(new pu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ex extends Qd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new _8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class yu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class v8 extends ca{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return la.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),la.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});la.add(e,h),s.manager.itemStart(e)}}class y8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=tx(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=tx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function tx(){return(typeof performance>"u"?Date:performance).now()}const pg="\\[\\]\\.:\\/",E8=new RegExp("["+pg+"]","g"),Ag="[^"+pg+"]",x8="[^"+pg.replace("\\.","")+"]",w8=/((?:WC+[\/:])*)/.source.replace("WC",Ag),I8=/(WCOD+)?/.source.replace("WCOD",x8),C8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ag),S8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ag),M8=new RegExp("^"+w8+I8+C8+S8+"$"),T8=["material","materials","bones","map"];class B8{constructor(e,t,n){const i=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(e){const t=M8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);T8.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Ut.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=B8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class rx{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const nx=new j,Fd=new j;class Cs{constructor(e=new j,t=new j){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){nx.subVectors(e,this.start),Fd.subVectors(this.end,this.start);const n=Fd.dot(Fd);let i=Fd.dot(nx)/n;return t&&(i=Mr(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)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:jh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=jh);const ix={type:"change"},gg={type:"start"},sx={type:"end"},Od=new cu,ax=new Xi,b8=Math.cos(70*SA.DEG2RAD);class R8 extends so{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new j,this.cursor=new j,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:el.ROTATE,MIDDLE:el.DOLLY,RIGHT:el.PAN},this.touches={ONE:tl.ROTATE,TWO:tl.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",Be),this._domElementKeyEvents=V},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Be),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(ix),n.update(),s=i.NONE},this.update=function(){const V=new j,F=new Wi().setFromUnitVectors(e.up,new j(0,1,0)),ge=F.clone().invert(),_e=new j,ze=new Wi,Ne=new j,_t=2*Math.PI;return function(Dt=null){const Lt=n.object.position;V.copy(Lt).sub(n.target),V.applyQuaternion(F),c.setFromVector3(V),n.autoRotate&&s===i.NONE&&P(S(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let Mt=n.minAzimuthAngle,vt=n.maxAzimuthAngle;isFinite(Mt)&&isFinite(vt)&&(Mt<-Math.PI?Mt+=_t:Mt>Math.PI&&(Mt-=_t),vt<-Math.PI?vt+=_t:vt>Math.PI&&(vt-=_t),Mt<=vt?c.theta=Math.max(Mt,Math.min(vt,c.theta)):c.theta=c.theta>(Mt+vt)/2?Math.max(Mt,c.theta):Math.min(vt,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let hr=!1;if(n.zoomToCursor&&M||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),hr=Vt!=c.radius}if(V.setFromSpherical(c),V.applyQuaternion(ge),Lt.copy(n.target).add(V),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&M){let Vt=null;if(n.object.isPerspectiveCamera){const _r=V.length();Vt=Q(_r*u);const bn=_r-Vt;n.object.position.addScaledVector(I,bn),n.object.updateMatrixWorld(),hr=!!bn}else if(n.object.isOrthographicCamera){const _r=new j(R.x,R.y,0);_r.unproject(n.object);const bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),hr=bn!==n.object.zoom;const qt=new j(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(_r),n.object.updateMatrixWorld(),Vt=V.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(Od.origin.copy(n.object.position),Od.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Od.direction))<b8?e.lookAt(n.target):(ax.setFromNormalAndCoplanarPoint(n.object.up,n.target),Od.intersectPlane(ax,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),hr=!0)}return u=1,M=!1,hr||_e.distanceToSquared(n.object.position)>o||8*(1-ze.dot(n.object.quaternion))>o||Ne.distanceToSquared(n.target)>o?(n.dispatchEvent(ix),_e.copy(n.object.position),ze.copy(n.object.quaternion),Ne.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",be),n.domElement.removeEventListener("pointerdown",le),n.domElement.removeEventListener("pointercancel",me),n.domElement.removeEventListener("wheel",Ce),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",ve,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Be),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,c=new rx,h=new rx;let u=1;const d=new j,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new j,R=new Ge;let M=!1;const T=[],D={};let b=!1;function S(V){return V!==null?2*Math.PI/60*n.autoRotateSpeed*V:2*Math.PI/60/60*n.autoRotateSpeed}function L(V){const F=Math.abs(V*.01);return Math.pow(.95,n.zoomSpeed*F)}function P(V){h.theta-=V}function N(V){h.phi-=V}const W=function(){const V=new j;return function(F,ge){V.setFromMatrixColumn(ge,0),V.multiplyScalar(-F),d.add(V)}}(),X=function(){const V=new j;return function(F,ge){n.screenSpacePanning===!0?V.setFromMatrixColumn(ge,1):(V.setFromMatrixColumn(ge,0),V.crossVectors(n.object.up,V)),V.multiplyScalar(F),d.add(V)}}(),K=function(){const V=new j;return function(F,ge){const _e=n.domElement;if(n.object.isPerspectiveCamera){const ze=n.object.position;V.copy(ze).sub(n.target);let Ne=V.length();Ne*=Math.tan(n.object.fov/2*Math.PI/180),W(2*F*Ne/_e.clientHeight,n.object.matrix),X(2*ge*Ne/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(F*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(V,F){if(!n.zoomToCursor)return;M=!0;const ge=n.domElement.getBoundingClientRect(),_e=V-ge.left,ze=F-ge.top,Ne=ge.width,_t=ge.height;R.x=_e/Ne*2-1,R.y=-(ze/_t)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(V){return Math.max(n.minDistance,Math.min(n.maxDistance,V))}function z(V){A.set(V.clientX,V.clientY)}function Z(V){ee(V.clientX,V.clientX),_.set(V.clientX,V.clientY)}function re(V){v.set(V.clientX,V.clientY)}function G(V){p.set(V.clientX,V.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p),n.update()}function de(V){w.set(V.clientX,V.clientY),x.subVectors(w,_),x.y>0?te(L(x.y)):x.y<0&&H(L(x.y)),_.copy(w),n.update()}function pe(V){E.set(V.clientX,V.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function fe(V){ee(V.clientX,V.clientY),V.deltaY<0?H(L(V.deltaY)):V.deltaY>0&&te(L(V.deltaY)),n.update()}function ye(V){let F=!1;switch(V.code){case n.keys.UP:V.ctrlKey||V.metaKey||V.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),F=!0;break;case n.keys.BOTTOM:V.ctrlKey||V.metaKey||V.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),F=!0;break;case n.keys.LEFT:V.ctrlKey||V.metaKey||V.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),F=!0;break;case n.keys.RIGHT:V.ctrlKey||V.metaKey||V.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),F=!0;break}F&&(V.preventDefault(),n.update())}function Pe(V){if(T.length===1)A.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);A.set(ge,_e)}}function at(V){if(T.length===1)v.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);v.set(ge,_e)}}function se(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);_.set(0,ze)}function et(V){n.enableZoom&&se(V),n.enablePan&&at(V)}function ke(V){n.enableZoom&&se(V),n.enableRotate&&Pe(V)}function dt(V){if(T.length==1)p.set(V.pageX,V.pageY);else{const ge=tt(V),_e=.5*(V.pageX+ge.x),ze=.5*(V.pageY+ge.y);p.set(_e,ze)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p)}function Xe(V){if(T.length===1)E.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);E.set(ge,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ft(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);w.set(0,ze),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),te(x.y),_.copy(w);const Ne=(V.pageX+F.x)*.5,_t=(V.pageY+F.y)*.5;ee(Ne,_t)}function Y(V){n.enableZoom&&ft(V),n.enablePan&&Xe(V)}function k(V){n.enableZoom&&ft(V),n.enableRotate&&dt(V)}function le(V){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(V.pointerId),n.domElement.addEventListener("pointermove",Ae),n.domElement.addEventListener("pointerup",me)),!ct(V)&&(nt(V),V.pointerType==="touch"?Ye(V):Ee(V)))}function Ae(V){n.enabled!==!1&&(V.pointerType==="touch"?Le(V):Oe(V))}function me(V){switch(pt(V),T.length){case 0:n.domElement.releasePointerCapture(V.pointerId),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(sx),s=i.NONE;break;case 1:const F=T[0],ge=D[F];Ye({pointerId:F,pageX:ge.x,pageY:ge.y});break}}function Ee(V){let F;switch(V.button){case 0:F=n.mouseButtons.LEFT;break;case 1:F=n.mouseButtons.MIDDLE;break;case 2:F=n.mouseButtons.RIGHT;break;default:F=-1}switch(F){case el.DOLLY:if(n.enableZoom===!1)return;Z(V),s=i.DOLLY;break;case el.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enablePan===!1)return;re(V),s=i.PAN}else{if(n.enableRotate===!1)return;z(V),s=i.ROTATE}break;case el.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enableRotate===!1)return;z(V),s=i.ROTATE}else{if(n.enablePan===!1)return;re(V),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Oe(V){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;G(V);break;case i.DOLLY:if(n.enableZoom===!1)return;de(V);break;case i.PAN:if(n.enablePan===!1)return;pe(V);break}}function Ce(V){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(V.preventDefault(),n.dispatchEvent(gg),fe(Qe(V)),n.dispatchEvent(sx))}function Qe(V){const F=V.deltaMode,ge={clientX:V.clientX,clientY:V.clientY,deltaY:V.deltaY};switch(F){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return V.ctrlKey&&!b&&(ge.deltaY*=10),ge}function ve(V){V.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(V){V.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function Be(V){n.enabled===!1||n.enablePan===!1||ye(V)}function Ye(V){switch(ut(V),T.length){case 1:switch(n.touches.ONE){case tl.ROTATE:if(n.enableRotate===!1)return;Pe(V),s=i.TOUCH_ROTATE;break;case tl.PAN:if(n.enablePan===!1)return;at(V),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case tl.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(V),s=i.TOUCH_DOLLY_PAN;break;case tl.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(V),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Le(V){switch(ut(V),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;dt(V),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Xe(V),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(V),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(V),n.update();break;default:s=i.NONE}}function be(V){n.enabled!==!1&&V.preventDefault()}function nt(V){T.push(V.pointerId)}function pt(V){delete D[V.pointerId];for(let F=0;F<T.length;F++)if(T[F]==V.pointerId){T.splice(F,1);return}}function ct(V){for(let F=0;F<T.length;F++)if(T[F]==V.pointerId)return!0;return!1}function ut(V){let F=D[V.pointerId];F===void 0&&(F=new Ge,D[V.pointerId]=F),F.set(V.pageX,V.pageY)}function tt(V){const F=V.pointerId===T[0]?T[1]:T[0];return D[F]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ce,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",ve,{passive:!0,capture:!0}),this.update()}}function ox(r,e){if(e===sb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===wA||e===gE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===wA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class D8 extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new k8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new P8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new N8(t)}),this.register(function(t){return new X8(t)}),this.register(function(t){return new K8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=yu.extractUrlBase(e);o=yu.resolveURL(u,this.path)}else o=yu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Ll(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},c)}catch(d){c(d)}},n,c)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===lx){try{o[xt.KHR_BINARY_GLTF]=new J8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new uN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case xt.KHR_MATERIALS_UNLIT:o[A]=new U8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new Z8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new $8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new eN;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function L8(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const xt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class N8{constructor(e){this.parser=e,this.name=xt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let c;const h=new Ke(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Sr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new ex(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new m8(h),c.distance=u;break;case"spot":c=new A8(h),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ha(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class U8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return xs}extendParams(e,t,n){const i=[];e.color=new Ke(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Sr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Qr))}return Promise.all(i)}}class P8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Ke(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Sr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Qr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const c=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ke().setRGB(c[0],c[1],c[2],Sr),Promise.all(s)}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class G8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const c=o.specularColorFactor||[1,1,1];return t.specularColor=new Ke().setRGB(c[0],c[1],c[2],Sr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Qr)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class j8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class W8{constructor(e){this.parser=e,this.name=xt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class Y8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class q8{constructor(e){this.parser=e,this.name=xt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class X8{constructor(e){this.name=xt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class K8{constructor(e){this.name=xt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==ii.TRIANGLES&&h.mode!==ii.TRIANGLE_STRIP&&h.mode!==ii.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const v=new st,E=new j,m=new Wi,_=new j(1,1,1),w=new YL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new ag(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const lx="glTF",Eu=12,cx={JSON:1313821514,BIN:5130562};class J8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Eu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==lx)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Eu,s=new DataView(e,Eu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===cx.JSON){const u=new Uint8Array(e,Eu+o,c);this.content=n.decode(u)}else if(h===cx.BIN){const u=Eu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Z8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,c={},h={},u={};for(const d in o){const A=_g[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=_g[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Nl[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Sr,p)})})}}class $8{constructor(){this.name=xt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class eN{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class ux extends _u{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],M=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*M+m*T+_*D}return s}}const tN=new Wi;class rN extends ux{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return tN.fromArray(s).normalize().toArray(s),s}}const ii={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Nl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:fr,9729:pr,9984:Vy,9985:Xh,9986:Jc,9987:wi},dx={33071:xi,33648:qh,10497:$s},mg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_g={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ua={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},nN={CUBICSPLINE:void 0,LINEAR:sl,STEP:ru},vg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function iN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new ug({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:yi})),r.DefaultMaterial}function mo(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ha(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function sN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],c=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;c.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function aN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function oN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+yg(t.attributes):e=r.indices+":"+yg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+yg(r.targets[n]);return e}function yg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function Eg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function lN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const cN=new st;class uN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new L8,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new K2(this.options.manager):this.textureLoader=new v8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ll(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return mo(s,c,i),ha(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let c=0,h=o.length;c<h;c++)e[o[c]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(yu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=mg[i.type],c=Nl[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Fr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const c=o[0],h=mg[i.type],u=Nl[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new HL(E,g/d),t.cache.add(w,x)),m=new rg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Fr(E,h,v);if(i.sparse!==void 0){const _=mg.SCALAR,w=Nl[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*_),M=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Fr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,M[T*h]),h>=2&&m.setY(b,M[T*h+1]),h>=3&&m.setZ(b,M[T*h+2]),h>=4&&m.setW(b,M[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=hx[A.magFilter]||pr,d.minFilter=hx[A.minFilter]||wi,d.wrapS=dx[A.wrapS]||$s,d.wrapT=dx[A.wrapT]||$s,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],c=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=c.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Tr(E);m.needsUpdate=!0,p(m)}),t.load(yu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||lN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new G2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new k2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return ug}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new Ke(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Sr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,Qr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,c)})))}s.doubleSided===!0&&(c.side=Ei);const d=s.alphaMode||vg.OPAQUE;if(d===vg.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===vg.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==xs){const A=s.emissiveFactor;c.emissive=new Ke().setRGB(A[0],A[1],A[2],Sr)}return s.emissiveTexture!==void 0&&o!==xs&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,Qr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&mo(i,A,s),A})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return fx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=oN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=fx(new Gn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?iN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ii.TRIANGLES||m.mode===ii.TRIANGLE_STRIP||m.mode===ii.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new VL(E,w):new Yr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ii.TRIANGLE_STRIP?_.geometry=ox(_.geometry,gE):m.mode===ii.TRIANGLE_FAN&&(_.geometry=ox(_.geometry,wA));else if(m.mode===ii.LINES)_=new qL(E,w);else if(m.mode===ii.LINE_STRIP)_=new lg(E,w);else if(m.mode===ii.LINE_LOOP)_=new XL(E,w);else if(m.mode===ii.POINTS)_=new KL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&aN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ha(_,s),m.extensions&&mo(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&mo(i,A[0],s),A[0];const p=new oa;s.extensions&&mo(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new un(SA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new pu(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ha(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new st;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new sg(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],M=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,M,T,D);if(b)for(let S=0;S<b.length;S++)_.push(b[S])}return new a8(s,void 0,_)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,cN)});for(let g=0,v=A.length;g<v;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new L2:u.length>1?d=new oa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ha(d,s),s.extensions&&mo(n,d,s),s.matrix!==void 0){const A=new st;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new oa;n.name&&(s.name=i.createUniqueName(n.name)),ha(s,n),n.extensions&&mo(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof qi||p instanceof Tr)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],c=e.name?e.name:e.uuid,h=[];ua[s.path]===ua.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(c);let u;switch(ua[s.path]){case ua.weights:u=bl;break;case ua.rotation:u=go;break;case ua.position:case ua.scale:u=Dl;break;default:switch(n.itemSize){case 1:u=bl;break;case 2:case 3:default:u=Dl;break}break}const d=i.interpolation!==void 0?nN[i.interpolation]:sl,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Eg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof go?rN:ux;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function hN(r,e,t){const n=e.attributes,i=new Er;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new j(h[0],h[1],h[2]),new j(u[0],u[1],u[2])),c.normalized){const d=Eg(Nl[c.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const c=new j,h=new j;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=Eg(Nl[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function fx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=_g[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Sr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ha(r,e),hN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?sN(r,e.targets,t):r})}class dN{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const fN=0,px=2,pN=1,Ax=2,AN=0,gN=1,mN=10,_N=0,gx=9,mx=15,_x=16,vx=22,yx=37,Ex=43,xx=76,wx=83,Ix=97,Cx=100,Sx=103,Mx=109,Tx=165,Bx=166;class vN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class xu{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const dn=[171,75,84,88,32,50,48,187,13,10,26,10];function bx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function yN(r){const e=new Uint8Array(r.buffer,r.byteOffset,dn.length);if(e[0]!==dn[0]||e[1]!==dn[1]||e[2]!==dn[2]||e[3]!==dn[3]||e[4]!==dn[4]||e[5]!==dn[5]||e[6]!==dn[6]||e[7]!==dn[7]||e[8]!==dn[8]||e[9]!==dn[9]||e[10]!==dn[10]||e[11]!==dn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new vN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new xu(r,dn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new xu(r,dn.length+n,3*s*8,!0);for(let te=0;te<s;te++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new xu(r,o,c,!0),v={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(v.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const H={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&H.channelType?(H.sampleLower=g._nextInt32(),H.sampleUpper=g._nextInt32()):(H.sampleLower=g._nextUint32(),H.sampleUpper=g._nextUint32()),v.samples[te]=H}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new xu(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),H=m._scan(te),ee=bx(H),Q=m._scan(te-H.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new xu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),M=_._nextUint32(),T=_._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,S=b+I,L=S+R,P=L+M,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+S,R),X=new Uint8Array(r.buffer,r.byteOffset+L,M),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:W,tablesData:X,extendedData:K},t}let xg,Ss,wg;const Ig={env:{emscripten_notify_memory_growth:function(r){wg=new Uint8Array(Ss.exports.memory.buffer)}}};class EN{init(){return xg||(xg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ig)).then(this._init):WebAssembly.instantiate(Buffer.from(Rx,"base64"),Ig).then(this._init),xg)}_init(e){Ss=e.instance,Ig.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ss)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Ss.exports.malloc(n);wg.set(e,i),t=t||Number(Ss.exports.ZSTD_findDecompressedSize(i,n));const s=Ss.exports.malloc(t),o=Ss.exports.ZSTD_decompress(s,t,i,n),c=wg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),c}}const Rx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Cg=new WeakMap;let Sg=0,Mg;class Zi extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new dN,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new Ll(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Ll(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const c=Zi.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Zi.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Zi.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Zi.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
|
|
3829
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([h])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const u=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return u.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),u})}),Sg>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Sg++}return this.transcoderPending}load(e,t,n,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new Ll(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,o=>{if(Cg.has(o))return Cg.get(o).promise.then(t).catch(i);this._createTexture(o).then(c=>t?t(c):null).catch(i)},n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:o,type:c,error:h,dfdFlags:u}=e;if(c==="error")return Promise.reject(h);let d;if(t.faceCount===6)d=new ZL(n,o,Ar);else{const A=n[0].mipmaps;d=t.layerCount>1?new JL(A,i,s,t.layerCount,o,Ar):new Pd(A,i,s,o,Ar)}return d.minFilter=n[0].mipmaps.length===1?pr:wi,d.magFilter=pr,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Dx(t),d.premultiplyAlpha=!!(u&pN),d}async _createTexture(e,t={}){const n=yN(new Uint8Array(e));if(n.vkFormat!==_N)return wN(n);const i=t,s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e])).then(o=>this._createTextureFrom(o.data,n));return Cg.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Sg--,this}}Zi.BasisFormat={ETC1S:0,UASTC_4x4:1},Zi.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Zi.EngineFormat={RGBAFormat:gr,RGBA_ASTC_4x4_Format:EA,RGBA_BPTC_Format:ed,RGBA_ETC2_EAC_Format:yA,RGBA_PVRTC_4BPPV1_Format:mA,RGBA_S3TC_DXT5_Format:Zh,RGB_ETC1_Format:_A,RGB_ETC2_Format:vA,RGB_PVRTC_4BPPV1_Format:gA,RGB_S3TC_DXT1_Format:Jh},Zi.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(v){const E=v.data;switch(E.type){case"init":r=E.config,o(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:_,width:w,height:x,hasAlpha:I,format:R,dfdFlags:M}=c(E.buffer);self.postMessage({type:"transcode",id:E.id,faces:m,width:w,height:x,hasAlpha:I,format:R,dfdFlags:M},_)}catch(m){console.error(m),self.postMessage({type:"error",id:E.id,error:m.message})}});break}});function o(v){e=new Promise(E=>{t={wasmBinary:v,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(v){const E=new t.KTX2File(new Uint8Array(v));function m(){E.close(),E.delete()}if(!E.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const _=E.isUASTC()?s.UASTC_4x4:s.ETC1S,w=E.getWidth(),x=E.getHeight(),I=E.getLayers()||1,R=E.getLevels(),M=E.getFaces(),T=E.getHasAlpha(),D=E.getDFDFlags(),{transcoderFormat:b,engineFormat:S}=A(_,w,x,T);if(!w||!x||!R)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const L=[],P=[];for(let N=0;N<M;N++){const W=[];for(let X=0;X<R;X++){const K=[];let te,H;for(let Q=0;Q<I;Q++){const z=E.getImageLevelInfo(X,Q,N);N===0&&X===0&&Q===0&&(z.origWidth%4!==0||z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),R>1?(te=z.origWidth,H=z.origHeight):(te=z.width,H=z.height);const Z=new Uint8Array(E.getImageTranscodedSizeInBytes(X,Q,0,b));if(!E.transcodeImage(Z,X,Q,N,b,0,-1,-1))throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Z)}const ee=g(K);W.push({data:ee,width:te,height:H}),P.push(ee.buffer)}L.push({mipmaps:W,width:w,height:x,format:S})}return m(),{faces:L,buffers:P,width:w,height:x,hasAlpha:T,format:S,dfdFlags:D}}const h=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=h.sort(function(v,E){return v.priorityETC1S-E.priorityETC1S}),d=h.sort(function(v,E){return v.priorityUASTC-E.priorityUASTC});function A(v,E,m,_){let w,x;const I=v===s.ETC1S?u:d;for(let R=0;R<I.length;R++){const M=I[R];if(r[M.if]&&M.basisFormat.includes(v)&&!(_&&M.transcoderFormat.length<2)&&!(M.needsPowerOfTwo&&!(p(E)&&p(m))))return w=M.transcoderFormat[_?1:0],x=M.engineFormat[_?1:0],{transcoderFormat:w,engineFormat:x}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),w=i.RGBA32,x=n.RGBAFormat,{transcoderFormat:w,engineFormat:x}}function p(v){return v<=2?!0:(v&v-1)===0&&v!==0}function g(v){if(v.length===1)return v[0];let E=0;for(let w=0;w<v.length;w++){const x=v[w];E+=x.byteLength}const m=new Uint8Array(E);let _=0;for(let w=0;w<v.length;w++){const x=v[w];m.set(x,_),_+=x.byteLength}return m}};const xN=new Set([gr,io,ea]),Tg={[Mx]:gr,[Ix]:gr,[yx]:gr,[Ex]:gr,[Sx]:io,[wx]:io,[_x]:io,[vx]:io,[Cx]:ea,[xx]:ea,[mx]:ea,[gx]:ea,[Bx]:$h,[Tx]:$h},Bg={[Mx]:lr,[Ix]:yn,[yx]:Ar,[Ex]:Ar,[Sx]:lr,[wx]:yn,[_x]:Ar,[vx]:Ar,[Cx]:lr,[xx]:yn,[mx]:Ar,[gx]:Ar,[Bx]:Ar,[Tx]:Ar};async function wN(r){const{vkFormat:e}=r;if(Tg[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;r.supercompressionScheme===px&&(Mg||(Mg=new Promise(async s=>{const o=new EN;await o.init(),s(o)})),t=await Mg);const n=[];for(let s=0;s<r.levels.length;s++){const o=Math.max(1,r.pixelWidth>>s),c=Math.max(1,r.pixelHeight>>s),h=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,u=r.levels[s];let d;if(r.supercompressionScheme===fN)d=u.levelData;else if(r.supercompressionScheme===px)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let A;Bg[e]===lr?A=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):Bg[e]===yn?A=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):A=d,n.push({data:A,width:o,height:c,depth:h})}let i;if(xN.has(Tg[e]))i=r.pixelDepth===0?new Ao(n[0].data,r.pixelWidth,r.pixelHeight):new BE(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth);else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new Pd(n,r.pixelWidth,r.pixelHeight)}return i.mipmaps=n,i.type=Bg[e],i.format=Tg[e],i.colorSpace=Dx(r),i.needsUpdate=!0,Promise.resolve(i)}function Dx(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===gN?e.transferFunction===Ax?Qr:Sr:e.colorPrimaries===mN?e.transferFunction===Ax?td:nu:(e.colorPrimaries===AN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),As)}class IN extends d8{constructor(e){super(e),this.type=yn}parse(e){const t=function(_,w){switch(_){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(w||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(w||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(w||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(w||""))}},n=`
|
|
3830
3830
|
`,i=function(_,w,x){w=w||1024;let I=_.pos,R=-1,M=0,T="",D=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));for(;0>(R=D.indexOf(n))&&M<w&&I<_.byteLength;)T+=D,M+=D.length,I+=128,D+=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));return-1<R?(x!==!1&&(_.pos+=M+R+1),T+D.slice(0,R)):!1},s=function(_){const w=/^#\?(\S+)/,x=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,I=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*FORMAT=(\S+)\s*$/,M=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,T={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,b;for((_.pos>=_.byteLength||!(D=i(_)))&&t(1,"no header found"),(b=D.match(w))||t(3,"bad initial token"),T.valid|=1,T.programtype=b[1],T.string+=D+`
|
|
3831
3831
|
`;D=i(_),D!==!1;){if(T.string+=D+`
|
|
3832
3832
|
`,D.charAt(0)==="#"){T.comments+=D+`
|
|
3833
|
-
`;continue}if((b=D.match(x))&&(T.gamma=parseFloat(b[1])),(b=D.match(I))&&(T.exposure=parseFloat(b[1])),(b=D.match(R))&&(T.valid|=2,T.format=b[1]),(b=D.match(M))&&(T.valid|=4,T.height=parseInt(b[1],10),T.width=parseInt(b[2],10)),T.valid&2&&T.valid&4)break}return T.valid&2||t(3,"missing format specifier"),T.valid&4||t(3,"missing image size specifier"),T},o=function(_,w,x){const I=w;if(I<8||I>32767||_[0]!==2||_[1]!==2||_[2]&128)return new Uint8Array(_);I!==(_[2]<<8|_[3])&&t(3,"wrong scanline width");const R=new Uint8Array(4*w*x);R.length||t(4,"unable to allocate buffer space");let M=0,T=0;const D=4*I,b=new Uint8Array(4),S=new Uint8Array(D);let L=x;for(;L>0&&T<_.byteLength;){T+4>_.byteLength&&t(1),b[0]=_[T++],b[1]=_[T++],b[2]=_[T++],b[3]=_[T++],(b[0]!=2||b[1]!=2||(b[2]<<8|b[3])!=I)&&t(3,"bad rgbe scanline format");let P=0,N;for(;P<D&&T<_.byteLength;){N=_[T++];const X=N>128;if(X&&(N-=128),(N===0||P+N>D)&&t(3,"bad scanline data"),X){const K=_[T++];for(let te=0;te<N;te++)S[P++]=K}else S.set(_.subarray(T,T+N),P),P+=N,T+=N}const W=I;for(let X=0;X<W;X++){let K=0;R[M]=S[X+K],K+=I,R[M+1]=S[X+K],K+=I,R[M+2]=S[X+K],K+=I,R[M+3]=S[X+K],M+=4}L--}return R},c=function(_,w,x,I){const R=_[w+3],M=Math.pow(2,R-128)/255;x[I+0]=_[w+0]*M,x[I+1]=_[w+1]*M,x[I+2]=_[w+2]*M,x[I+3]=1},h=function(_,w,x,I){const R=_[w+3],M=Math.pow(2,R-128)/255;x[I+0]=
|
|
3833
|
+
`;continue}if((b=D.match(x))&&(T.gamma=parseFloat(b[1])),(b=D.match(I))&&(T.exposure=parseFloat(b[1])),(b=D.match(R))&&(T.valid|=2,T.format=b[1]),(b=D.match(M))&&(T.valid|=4,T.height=parseInt(b[1],10),T.width=parseInt(b[2],10)),T.valid&2&&T.valid&4)break}return T.valid&2||t(3,"missing format specifier"),T.valid&4||t(3,"missing image size specifier"),T},o=function(_,w,x){const I=w;if(I<8||I>32767||_[0]!==2||_[1]!==2||_[2]&128)return new Uint8Array(_);I!==(_[2]<<8|_[3])&&t(3,"wrong scanline width");const R=new Uint8Array(4*w*x);R.length||t(4,"unable to allocate buffer space");let M=0,T=0;const D=4*I,b=new Uint8Array(4),S=new Uint8Array(D);let L=x;for(;L>0&&T<_.byteLength;){T+4>_.byteLength&&t(1),b[0]=_[T++],b[1]=_[T++],b[2]=_[T++],b[3]=_[T++],(b[0]!=2||b[1]!=2||(b[2]<<8|b[3])!=I)&&t(3,"bad rgbe scanline format");let P=0,N;for(;P<D&&T<_.byteLength;){N=_[T++];const X=N>128;if(X&&(N-=128),(N===0||P+N>D)&&t(3,"bad scanline data"),X){const K=_[T++];for(let te=0;te<N;te++)S[P++]=K}else S.set(_.subarray(T,T+N),P),P+=N,T+=N}const W=I;for(let X=0;X<W;X++){let K=0;R[M]=S[X+K],K+=I,R[M+1]=S[X+K],K+=I,R[M+2]=S[X+K],K+=I,R[M+3]=S[X+K],M+=4}L--}return R},c=function(_,w,x,I){const R=_[w+3],M=Math.pow(2,R-128)/255;x[I+0]=_[w+0]*M,x[I+1]=_[w+1]*M,x[I+2]=_[w+2]*M,x[I+3]=1},h=function(_,w,x,I){const R=_[w+3],M=Math.pow(2,R-128)/255;x[I+0]=Ad.toHalfFloat(Math.min(_[w+0]*M,65504)),x[I+1]=Ad.toHalfFloat(Math.min(_[w+1]*M,65504)),x[I+2]=Ad.toHalfFloat(Math.min(_[w+2]*M,65504)),x[I+3]=Ad.toHalfFloat(1)},u=new Uint8Array(e);u.pos=0;const d=s(u),A=d.width,p=d.height,g=o(u.subarray(u.pos),A,p);let v,E,m;switch(this.type){case lr:m=g.length/4;const _=new Float32Array(m*4);for(let x=0;x<m;x++)c(g,x*4,_,x*4);v=_,E=lr;break;case yn:m=g.length/4;const w=new Uint16Array(m*4);for(let x=0;x<m;x++)h(g,x*4,w,x*4);v=w,E=yn;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:A,height:p,data:v,header:d.string,gamma:d.gamma,exposure:d.exposure,type:E}}setDataType(e){return this.type=e,this}load(e,t,n,i){function s(o,c){switch(o.type){case lr:case yn:o.colorSpace=Sr,o.minFilter=pr,o.magFilter=pr,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,c)}return super.load(e,s,n,i)}}const CN={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
|
|
3834
3834
|
|
|
3835
3835
|
varying vec2 vUv;
|
|
3836
3836
|
|
|
@@ -3853,7 +3853,7 @@ void main() {
|
|
|
3853
3853
|
gl_FragColor = opacity * texel;
|
|
3854
3854
|
|
|
3855
3855
|
|
|
3856
|
-
}`};class wu{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const SN=new pu(-1,1,1,-1,0,1);class MN extends Gn{constructor(){super(),this.setAttribute("position",new Di([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Di([0,2,0,0,2,0],2))}}const TN=new MN;class Lx{constructor(e){this._mesh=new Yr(TN,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,SN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class BN extends wu{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof En?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=
|
|
3856
|
+
}`};class wu{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const SN=new pu(-1,1,1,-1,0,1);class MN extends Gn{constructor(){super(),this.setAttribute("position",new Di([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Di([0,2,0,0,2,0],2))}}const TN=new MN;class Lx{constructor(e){this._mesh=new Yr(TN,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,SN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class BN extends wu{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof En?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Cd.clone(e.uniforms),this.material=new En({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Lx(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Nx extends wu{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,c;this.inverse?(o=0,c=1):(o=1,c=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,o,4294967295),s.buffers.stencil.setClear(c),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class bN extends wu{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class RN{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new Ge);this._width=n.width,this._height=n.height,t=new Mi(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:yn}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new BN(CN),this.copyPass.material.blending=ps,this.clock=new y8}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,s=this.passes.length;i<s;i++){const o=this.passes[i];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const c=this.renderer.getContext(),h=this.renderer.state.buffers.stencil;h.setFunc(c.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),h.setFunc(c.EQUAL,1,4294967295)}this.swapBuffers()}Nx!==void 0&&(o instanceof Nx?n=!0:o instanceof bN&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Ge);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}const DN={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
|
|
3857
3857
|
precision highp float;
|
|
3858
3858
|
|
|
3859
3859
|
uniform mat4 modelViewMatrix;
|
|
@@ -3920,7 +3920,7 @@ void main() {
|
|
|
3920
3920
|
|
|
3921
3921
|
#endif
|
|
3922
3922
|
|
|
3923
|
-
}`};class LN extends wu{constructor(){super();const e=DN;this.uniforms=
|
|
3923
|
+
}`};class LN extends wu{constructor(){super();const e=DN;this.uniforms=Cd.clone(e.uniforms),this.material=new $L({name:e.name,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new Lx(this.material),this._outputColorSpace=null,this._toneMapping=null}render(e,t,n){this.uniforms.tDiffuse.value=n.texture,this.uniforms.toneMappingExposure.value=e.toneMappingExposure,(this._outputColorSpace!==e.outputColorSpace||this._toneMapping!==e.toneMapping)&&(this._outputColorSpace=e.outputColorSpace,this._toneMapping=e.toneMapping,this.material.defines={},Rt.getTransfer(this._outputColorSpace)===Ht&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===ky?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===Qy?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===Fy?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===cA?this.material.defines.ACES_FILMIC_TONE_MAPPING="":this._toneMapping===Oy?this.material.defines.AGX_TONE_MAPPING="":this._toneMapping===zy&&(this.material.defines.NEUTRAL_TONE_MAPPING=""),this.material.needsUpdate=!0),this.renderToScreen===!0?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class NN extends wu{constructor(e,t,n=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ke}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=i}}const UN={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
3924
3924
|
|
|
3925
3925
|
varying vec2 vUv;
|
|
3926
3926
|
|
|
@@ -3984,7 +3984,7 @@ void main() {
|
|
|
3984
3984
|
|
|
3985
3985
|
gl_FragColor = sum;
|
|
3986
3986
|
|
|
3987
|
-
}`},Ux=0,kN=1,Px=2,kx=2,bg=1.25,Qx=1,_o=6*4+4+4,Od=65535,QN=Math.pow(2,-24),Rg=Symbol("SKIP_GENERATION");function Fx(r){return r.index?r.index.count:r.attributes.position.count}function Nl(r){return Fx(r)/3}function Ox(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function FN(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Ox(t,n);r.setIndex(new Fr(i,1));for(let s=0;s<t;s++)i[s]=s}}function zx(r){const e=Nl(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function Hx(r){if(!r.groups||!r.groups.length)return zx(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const c of r.groups){const h=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((c,h)=>c-h);for(let c=0;c<o.length-1;c++){const h=o[c],u=o[c+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function ON(r){if(r.groups.length===0)return!1;const e=Nl(r),t=Hx(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function zN(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function Gx(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Vx(r,e){e.set(r)}function jx(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function zd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,c=i+s;o<t[n]&&(t[n]=o),c>t[n+3]&&(t[n+3]=c)}}function Iu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Dg(r,e,t,n,i=null){let s=1/0,o=1/0,c=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,v=-1/0,E=-1/0,m=-1/0;const _=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],M=I-R,T=I+R;M<s&&(s=M),T>h&&(h=T),_&&I<A&&(A=I),_&&I>v&&(v=I);const D=r[w+2],b=r[w+3],S=D-b,L=D+b;S<o&&(o=S),L>u&&(u=L),_&&D<p&&(p=D),_&&D>E&&(E=D);const P=r[w+4],N=r[w+5],W=P-N,X=P+N;W<c&&(c=W),X>d&&(d=X),_&&P<g&&(g=P),_&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=c,n[3]=h,n[4]=u,n[5]=d,_&&(i[0]=A,i[1]=p,i[2]=g,i[3]=v,i[4]=E,i[5]=m)}function HN(r,e,t,n){let i=1/0,s=1/0,o=1/0,c=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>c&&(c=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const v=r[d+4];v<o&&(o=v),v>u&&(u=v)}n[0]=i,n[1]=s,n[2]=o,n[3]=c,n[4]=h,n[5]=u}function GN(r,e){zN(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Nl(r),s=new Float32Array(i*6),o=t.normalized,c=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let v=p+0,E=p+1,m=p+2;n&&(v=n[v],E=n[E],m=n[m]),o||(v=v*u+h,E=E*u+h,m=m*u+h);for(let _=0;_<3;_++){let w,x,I;o?(w=t[d[_]](v),x=t[d[_]](E),I=t[d[_]](m)):(w=c[v+_],x=c[E+_],I=c[m+_]);let R=w;x<R&&(R=x),I<R&&(R=I);let M=w;x>M&&(M=x),I>M&&(M=I);const T=(M-R)/2,D=_*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*QN,R<e[_]&&(e[_]=R),M>e[_+3]&&(e[_+3]=M)}}return s}const Ms=32,VN=(r,e)=>r.candidate-e.candidate,da=new Array(Ms).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Hd=new Float32Array(6);function jN(r,e,t,n,i,s){let o=-1,c=0;if(s===Ux)o=Gx(e),o!==-1&&(c=(e[o]+e[o+3])/2);else if(s===kN)o=Gx(r),o!==-1&&(c=WN(t,n,i,o));else if(s===Px){const h=Iu(r);let u=bg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],v=(e[p+3]-g)/Ms;if(i<Ms/4){const E=[...da];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:M}=x;for(let T=0;T<3;T++)M[T]=1/0,M[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;zd(w,t,I)}E.sort(VN);let _=i;for(let w=0;w<_;w++){const x=E[w];for(;w+1<_&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),_--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<_;I++){const R=E[I];x>=R.candidate?zd(w,t,R.rightCacheBounds):(zd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<_;w++){const x=E[w],I=x.count,R=i-x.count,M=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=Iu(M)/h);let b=0;R!==0&&(b=Iu(T)/h);const S=Qx+bg*(D*I+b*R);S<u&&(o=p,u=S,c=x.candidate)}}else{for(let _=0;_<Ms;_++){const w=da[_];w.count=0,w.candidate=g+v+_*v;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let _=d;_<A;_+=6){let w=~~((t[_+2*p]-g)/v);w>=Ms&&(w=Ms-1);const x=da[w];x.count++,zd(_,t,x.bounds)}const E=da[Ms-1];Vx(E.bounds,E.rightCacheBounds);for(let _=Ms-2;_>=0;_--){const w=da[_],x=da[_+1];jx(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let _=0;_<Ms-1;_++){const w=da[_],x=w.count,I=w.bounds,R=da[_+1].rightCacheBounds;x!==0&&(m===0?Vx(I,Hd):jx(I,Hd,Hd)),m+=x;let M=0,T=0;m!==0&&(M=Iu(Hd)/h);const D=i-m;D!==0&&(T=Iu(R)/h);const b=Qx+bg*(M*m+T*D);b<u&&(o=p,u=b,c=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:c}}function WN(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Gd{constructor(){}}function YN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[c*3+d],e[c*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[c*6+d],t[c*6+d]=A}o++,c--}else return o}}function qN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){let d=r[o];r[o]=r[c],r[c]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[c*6+A],t[c*6+A]=p}o++,c--}else return o}}function XN(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let c=0,h=o.length;c<h;c++)o[c]=c;return o}function KN(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,c=e.strategy,h=e.onProgress,u=Nl(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),v=GN(t,p),E=e.indirect?qN:YN,m=[],_=e.indirect?zx(t):Hx(t);if(_.length===1){const I=_[0],R=new Gd;R.boundingData=p,HN(v,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of _){const R=new Gd;R.boundingData=new Float32Array(6),Dg(v,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,M,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),M<=o||D>=i)return w(R+M),I.offset=R,I.count=M,I;const b=jN(I.boundingData,T,v,R,M,c);if(b.axis===-1)return w(R+M),I.offset=R,I.count=M,I;const S=E(d,n,v,R,M,b);if(S===R||S===R+M)w(R+M),I.offset=R,I.count=M;else{I.splitAxis=b.axis;const L=new Gd,P=R,N=S-R;I.left=L,L.boundingData=new Float32Array(6),Dg(v,P,N,L.boundingData,g),x(L,P,N,g,D+1);const W=new Gd,X=S,K=M-N;I.right=W,W.boundingData=new Float32Array(6),Dg(v,X,K,W.boundingData,g),x(W,X,K,g,D+1)}return I}}function JN(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=XN(t,e.useSharedArrayBuffer),ON(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||FN(t,e);const n=KN(r,e);let i,s,o;const c=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const v=new h(_o*g);i=new Float32Array(v),s=new Uint32Array(v),o=new Uint16Array(v),d(0,p),c.push(v)}r._roots=c;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,v=A/2,E=!!p.count,m=p.boundingData;for(let _=0;_<6;_++)i[g+_]=m[_];if(E){const _=p.offset,w=p.count;return s[g+6]=_,o[v+14]=w,o[v+15]=Od,A+_o}else{const _=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+_o,_),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Ts{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const c=e[s][t];n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const c=t[s],h=e.dot(c);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Ts.prototype.setFromBox=function(){const r=new j;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let c=0;c<=1;c++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*c+i.x*(1-c),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const ZN=function(){const r=new j,e=new j,t=new j;return function(n,i,s){const o=n.start,c=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(c),p=u.dot(u),g=t.dot(c),v=c.dot(c)*p-A*A;let E,m;v!==0?E=(d*A-g*p)/v:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),Lg=function(){const r=new Ge,e=new j,t=new j;return function(n,i,s,o){ZN(n,i,r);let c=r.x,h=r.y;if(c>=0&&c<=1&&h>=0&&h<=1){n.at(c,s),i.at(h,o);return}else if(c>=0&&c<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){c<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;c<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),$N=function(){const r=new j,e=new j,t=new Xi,n=new Cs;return function(i,s){const{radius:o,center:c}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o||(n.start=h,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(c))<=o){const p=A.projectPoint(c,e);if(s.containsPoint(p))return!0}return!1}}(),eU=1e-15;function Ng(r){return Math.abs(r)<eU}class Ni extends ln{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new j),this.satBounds=new Array(4).fill().map(()=>new Ts),this.points=[this.a,this.b,this.c],this.sphere=new Bi,this.plane=new Xi,this.needsUpdate=!0}intersectsSphere(e){return $N(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,c=s[0],h=o[0];this.getNormal(c),h.setFromPoints(c,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],v=o[3];g.subVectors(n,e),v.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}Ni.prototype.closestPointToSegment=function(){const r=new j,e=new j,t=new Cs;return function(n,i=null,s=null){const{start:o,end:c}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Lg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(c,r),u=c.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(c)),Math.sqrt(d)}}(),Ni.prototype.intersectsTriangle=function(){const r=new Ni,e=new Array(3),t=new Array(3),n=new Ts,i=new Ts,s=new j,o=new j,c=new j,h=new j,u=new j,d=new Cs,A=new Cs,p=new Cs,g=new j;function v(E,m,_){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:M,end:T}=d;M.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=Ng(m.distanceToPoint(M));if(Ng(m.normal.dot(o))&&D){_.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(M),(b||D)&&!Ng(g.distanceTo(T))){if(x<=1)(x===1?_.start:_.end).copy(g),D&&(I=x);else if(x>=2){(I===1?_.start:_.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,_=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],S=R[D];if(n.setFromPoints(S,t),b.isSeparated(n))return!1}const M=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=M[D],S=T[D];if(n.setFromPoints(S,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let S=0;S<4;S++){const L=T[S];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=v(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=v(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(c),p.delta(h),c.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const M=A.start.dot(c),T=A.end.dot(c),D=p.start.dot(c),b=p.end.dot(c),S=T<D,L=M<b;return M!==b&&D!==T&&S===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(c)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(c)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Ni.prototype.distanceToPoint=function(){const r=new j;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Ni.prototype.distanceToTriangle=function(){const r=new j,e=new j,t=["a","b","c"],n=new Cs,i=new Cs;return function(s,o=null,c=null){const h=o||c?n:null;if(this.intersectsTriangle(s,h))return(o||c)&&(o&&h.getCenter(o),c&&h.getCenter(c)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),c&&c.copy(g));const v=this[p];s.closestPointToPoint(v,r),A=v.distanceToSquared(r),A<u&&(u=A,o&&o.copy(v),c&&c.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const v=t[g],E=t[(g+1)%3];i.set(s[v],s[E]),Lg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),c&&c.copy(e))}}return Math.sqrt(u)}}();class fn{constructor(e,t,n){this.isOrientedBox=!0,this.min=new j,this.max=new j,this.matrix=new st,this.invMatrix=new st,this.points=new Array(8).fill().map(()=>new j),this.satAxes=new Array(3).fill().map(()=>new j),this.satBounds=new Array(3).fill().map(()=>new Ts),this.alignedSatBounds=new Array(3).fill().map(()=>new Ts),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}fn.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const c=this.alignedSatBounds;c[0].setFromPointsField(n,"x"),c[1].setFromPointsField(n,"y"),c[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),fn.prototype.intersectsBox=function(){const r=new Ts;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let c=0;c<3;c++){const h=s[c],u=i[c];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),fn.prototype.intersectsTriangle=function(){const r=new Ni,e=new Array(3),t=new Ts,n=new Ts,i=new j;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,c=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=c[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=c[A];for(let g=0;g<4;g++){const v=u[g];if(i.crossVectors(p,v),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),fn.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),fn.prototype.distanceToPoint=function(){const r=new j;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),fn.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Cs),t=new Array(12).fill().map(()=>new Cs),n=new j,i=new j;return function(s,o=0,c=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(c||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),c&&c.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const _=m.distanceToSquared(i);if(_<g&&(g=_,c&&c.copy(m),h&&h.copy(i),_<u))return Math.sqrt(_)}let v=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|_<<x,R=1<<E|m<<w|_<<x,M=p[I],T=p[R];e[v].set(M,T);const D=r[E],b=r[w],S=r[x],L=t[v],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[S]=_?d[S]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[S]=_?d[S]:A[b],v++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=_?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,c&&c.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let _=0;_<12;_++){const w=t[_];Lg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,c&&c.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Ug{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class tU extends Ug{constructor(){super(()=>new Ni)}}const si=new tU;function xn(r,e){return e[r+15]===65535}function wn(r,e){return e[r+6]}function Vn(r,e){return e[r+14]}function ai(r){return r+8}function jn(r,e){return e[r+6]}function Pg(r,e){return e[r+7]}class rU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new rU;let fa,Ul;const Pl=[],Vd=new Ug(()=>new Er);function nU(r,e,t,n,i,s){fa=Vd.getPrimitive(),Ul=Vd.getPrimitive(),Pl.push(fa,Ul),Yt.setBuffer(r._roots[e]);const o=kg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),Vd.releasePrimitive(fa),Vd.releasePrimitive(Ul),Pl.pop(),Pl.pop();const c=Pl.length;return c>0&&(Ul=Pl[c-1],fa=Pl[c-2]),o}function kg(r,e,t,n,i=null,s=0,o=0){const{float32Array:c,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(xn(d,h)){const A=wn(r,u),p=Vn(d,h);return rr(r,c,fa),n(A,p,!1,o,s+r,fa)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=ai(L),W=L*2;return wn(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=jn(L,N),W=L*2;return wn(L,N)+Vn(W,P)};const g=ai(r),v=jn(r,u);let E=g,m=v,_,w,x,I;if(i&&(x=fa,I=Ul,rr(E,c,x),rr(m,c,I),_=i(x),w=i(I),w<_)){E=v,m=g;const L=_;_=w,w=L,x=I}x||(x=fa,rr(E,c,x));const R=xn(E*2,h),M=t(x,R,_,o+1,s+E);let T;if(M===kx){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=M&&kg(E,e,t,n,i,s,o+1);if(T)return!0;I=Ul,rr(m,c,I);const D=xn(m*2,h),b=t(I,D,w,o+1,s+m);let S;if(b===kx){const L=A(m),P=p(m)-L;S=n(L,P,!0,o+1,s+m,I)}else S=b&&kg(m,e,t,n,i,s,o+1);return!!S}}const Cu=new j,Qg=new j;function iU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let c=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Cu.copy(e).clamp(d.min,d.max),Cu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<c&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Cu);const p=e.distanceToSquared(Cu);return p<c&&(Qg.copy(Cu),c=p,h=A),p<s}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(Qg):t.point=Qg.clone(),t.distance=u,t.faceIndex=h,t}const kl=new j,Ql=new j,Fl=new j,jd=new Ge,Wd=new Ge,Yd=new Ge,Wx=new j,Yx=new j,qx=new j,qd=new j;function sU(r,e,t,n,i,s){let o;return s===kr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==Ei,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function aU(r,e,t,n,i,s,o,c,h){kl.fromBufferAttribute(e,s),Ql.fromBufferAttribute(e,o),Fl.fromBufferAttribute(e,c);const u=sU(r,kl,Ql,Fl,qd,h);if(u){n&&(jd.fromBufferAttribute(n,s),Wd.fromBufferAttribute(n,o),Yd.fromBufferAttribute(n,c),u.uv=ln.getInterpolation(qd,kl,Ql,Fl,jd,Wd,Yd,new Ge)),i&&(jd.fromBufferAttribute(i,s),Wd.fromBufferAttribute(i,o),Yd.fromBufferAttribute(i,c),u.uv1=ln.getInterpolation(qd,kl,Ql,Fl,jd,Wd,Yd,new Ge)),t&&(Wx.fromBufferAttribute(t,s),Yx.fromBufferAttribute(t,o),qx.fromBufferAttribute(t,c),u.normal=ln.getInterpolation(qd,kl,Ql,Fl,Wx,Yx,qx,new j),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c,normal:new j,materialIndex:0};ln.getNormal(kl,Ql,Fl,d.normal),u.face=d,u.faceIndex=s}return u}function Xd(r,e,t,n,i){const s=n*3;let o=s+0,c=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),c=u.getX(c),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,v=aU(t,d,A,p,g,o,c,h,e);return v?(v.faceIndex=n,i&&i.push(v),v):null}function wr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let c=e,h=e+1,u=e+2;t&&(c=t.getX(c),h=t.getX(h),u=t.getX(u)),i.x=n.getX(c),i.y=n.getY(c),i.z=n.getZ(c),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function oU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++)Xd(o,e,t,h,s)}function lU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=Xd(s,e,t,u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function cU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,wr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function uU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,M=-1/0,T=-1/0;for(let D=3*m,b=3*(m+_);D<b;D++){let S=n[D];const L=i.getX(S),P=i.getY(S),N=i.getZ(S);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>M&&(M=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==M||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=M,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,M=!1;e?I||(R=e.has(w),M=e.has(x),I=!R&&!M):(R=!0,M=!0);const T=I||R,D=I||M;let b=!1;T&&(b=A(m,g,I));let S=!1;D&&(S=A(_,g,I));const L=b||S;if(L)for(let P=0;P<3;P++){const N=m+P,W=_+P,X=h[N],K=h[N+3],te=h[W],H=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>H?K:H}return L}}}const Xx=new Er;function pa(r,e,t,n){return rr(r,e,Xx),t.intersectBox(Xx,n)}function hU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++){let d=c?c[h]:h;Xd(o,e,t,d,s)}}function dU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=Xd(s,e,t,o?o[u]:u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function fU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),wr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const Kx=new j;function pU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Fg(0,r,t,n,i),Yt.clearBuffer()}function Fg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,c),d=Vn(h,o);oU(e,t,n,u,d,i)}else{const u=ai(r);pa(u,s,n,Kx)&&Fg(u,e,t,n,i);const d=jn(r,c);pa(d,s,n,Kx)&&Fg(d,e,t,n,i)}}const Jx=new j,AU=["x","y","z"];function gU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Og(0,r,t,n);return Yt.clearBuffer(),i}function Og(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(xn(c,s)){const h=wn(r,o),u=Vn(c,s);return lU(e,t,n,h,u)}else{const h=Pg(r,o),u=AU[h],d=n.direction[u]>=0;let A,p;d?(A=ai(r),p=jn(r,o)):(A=jn(r,o),p=ai(r));const g=pa(A,i,n,Jx)?Og(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=pa(p,i,n,Jx)?Og(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Kd=new Er,Ol=new Ni,zl=new Ni,Su=new st,Zx=new fn,Jd=new fn;function mU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=zg(0,r,t,n);return Yt.clearBuffer(),i}function zg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Zx.set(t.boundingBox.min,t.boundingBox.max,n),i=Zx),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=wn(r,c),E=Vn(h,o);if(Su.copy(n).invert(),t.boundsTree)return rr(r,s,Jd),Jd.matrix.copy(Su),Jd.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Jd.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v*3,w=(E+v)*3;_<w;_+=3)if(wr(zl,_,d,A),zl.needsUpdate=!0,m.intersectsTriangle(zl))return!0;return!1}});for(let m=v*3,_=(E+v)*3;m<_;m+=3){wr(Ol,m,d,A),Ol.a.applyMatrix4(Su),Ol.b.applyMatrix4(Su),Ol.c.applyMatrix4(Su),Ol.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(wr(zl,w,p,g),zl.needsUpdate=!0,Ol.intersectsTriangle(zl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Kd),!!(i.intersectsBox(Kd)&&zg(u,e,t,n,i)||(rr(d,s,Kd),i.intersectsBox(Kd)&&zg(d,e,t,n,i)))}}const Zd=new st,Hg=new fn,Mu=new fn,_U=new j,vU=new j,yU=new j,EU=new j;function xU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Hg.set(e.boundingBox.min,e.boundingBox.max,t),Hg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=si.getPrimitive(),g=si.getPrimitive();let v=_U,E=vU,m=null,_=null;i&&(m=yU,_=EU);let w=1/0,x=null,I=null;return Zd.copy(t).invert(),Mu.matrix.copy(Zd),r.shapecast({boundsTraverseOrder:R=>Hg.distanceToBox(R),intersectsBounds:(R,M,T)=>T<w&&T<o?(M&&(Mu.min.copy(R.min),Mu.max.copy(R.max),Mu.needsUpdate=!0),!0):!1,intersectsRange:(R,M)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Mu.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,S=T+D;b<S;b++){wr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+M;L<P;L++){wr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Nl(e);for(let D=0,b=T;D<b;D++){wr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let S=R,L=R+M;S<L;S++){wr(p,3*S,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,v,m);if(P<w&&(E.copy(v),_&&_.copy(m),w=P,x=S,I=D),P<s)return!0}}}}}),si.releasePrimitive(p),si.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(Zd),E.applyMatrix4(Zd),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function wU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===Od){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,M=-1/0,T=-1/0;for(let D=m,b=m+_;D<b;D++){const S=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=S+L;P=n?n[P]:P;const N=i.getX(P),W=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),W<x&&(x=W),W>M&&(M=W),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==M||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=M,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,M=!1;e?I||(R=e.has(w),M=e.has(x),I=!R&&!M):(R=!0,M=!0);const T=I||R,D=I||M;let b=!1;T&&(b=A(m,g,I));let S=!1;D&&(S=A(_,g,I));const L=b||S;if(L)for(let P=0;P<3;P++){const N=m+P,W=_+P,X=h[N],K=h[N+3],te=h[W],H=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>H?K:H}return L}}}const $x=new j;function IU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Gg(0,r,t,n,i),Yt.clearBuffer()}function Gg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,c),d=Vn(h,o);hU(e,t,n,u,d,i)}else{const u=ai(r);pa(u,s,n,$x)&&Gg(u,e,t,n,i);const d=jn(r,c);pa(d,s,n,$x)&&Gg(d,e,t,n,i)}}const ew=new j,CU=["x","y","z"];function SU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Vg(0,r,t,n);return Yt.clearBuffer(),i}function Vg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(xn(c,s)){const h=wn(r,o),u=Vn(c,s);return dU(e,t,n,h,u)}else{const h=Pg(r,o),u=CU[h],d=n.direction[u]>=0;let A,p;d?(A=ai(r),p=jn(r,o)):(A=jn(r,o),p=ai(r));const g=pa(A,i,n,ew)?Vg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=pa(p,i,n,ew)?Vg(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const $d=new Er,Hl=new Ni,Gl=new Ni,Tu=new st,tw=new fn,ef=new fn;function MU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=jg(0,r,t,n);return Yt.clearBuffer(),i}function jg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),tw.set(t.boundingBox.min,t.boundingBox.max,n),i=tw),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=wn(r,c),E=Vn(h,o);if(Tu.copy(n).invert(),t.boundsTree)return rr(r,s,ef),ef.matrix.copy(Tu),ef.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>ef.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v,w=E+v;_<w;_++)if(wr(Gl,3*e.resolveTriangleIndex(_),d,A),Gl.needsUpdate=!0,m.intersectsTriangle(Gl))return!0;return!1}});for(let m=v,_=E+v;m<_;m++){const w=e.resolveTriangleIndex(m);wr(Hl,3*w,d,A),Hl.a.applyMatrix4(Tu),Hl.b.applyMatrix4(Tu),Hl.c.applyMatrix4(Tu),Hl.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(wr(Gl,x,p,g),Gl.needsUpdate=!0,Hl.intersectsTriangle(Gl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,$d),!!(i.intersectsBox($d)&&jg(u,e,t,n,i)||(rr(d,s,$d),i.intersectsBox($d)&&jg(d,e,t,n,i)))}}const tf=new st,Wg=new fn,Bu=new fn,TU=new j,BU=new j,bU=new j,RU=new j;function DU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Wg.set(e.boundingBox.min,e.boundingBox.max,t),Wg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=si.getPrimitive(),g=si.getPrimitive();let v=TU,E=BU,m=null,_=null;i&&(m=bU,_=RU);let w=1/0,x=null,I=null;return tf.copy(t).invert(),Bu.matrix.copy(tf),r.shapecast({boundsTraverseOrder:R=>Wg.distanceToBox(R),intersectsBounds:(R,M,T)=>T<w&&T<o?(M&&(Bu.min.copy(R.min),Bu.max.copy(R.max),Bu.needsUpdate=!0),!0):!1,intersectsRange:(R,M)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Bu.distanceToBox(D),intersectsBounds:(D,b,S)=>S<w&&S<o,intersectsRange:(D,b)=>{for(let S=D,L=D+b;S<L;S++){const P=T.resolveTriangleIndex(S);wr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,W=R+M;N<W;N++){const X=r.resolveTriangleIndex(N);wr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,v,m);if(K<w&&(E.copy(v),_&&_.copy(m),w=K,x=N,I=S),K<s)return!0}}}})}else{const T=Nl(e);for(let D=0,b=T;D<b;D++){wr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let S=R,L=R+M;S<L;S++){const P=r.resolveTriangleIndex(S);wr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=S,I=D),N<s)return!0}}}}}),si.releasePrimitive(p),si.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(tf),E.applyMatrix4(tf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function LU(){return typeof SharedArrayBuffer<"u"}const bu=new Yt.constructor,rf=new Yt.constructor,Aa=new Ug(()=>new Er),Vl=new Er,jl=new Er,Yg=new Er,qg=new Er;let Xg=!1;function NU(r,e,t,n){if(Xg)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Xg=!0;const i=r._roots,s=e._roots;let o,c=0,h=0;const u=new st().copy(t).invert();for(let d=0,A=i.length;d<A;d++){bu.setBuffer(i[d]),h=0;const p=Aa.getPrimitive();rr(0,bu.float32Array,p),p.applyMatrix4(u);for(let g=0,v=s.length;g<v&&(rf.setBuffer(s[d]),o=Ui(0,0,t,u,n,c,h,0,0,p),rf.clearBuffer(),h+=s[g].length,!o);g++);if(Aa.releasePrimitive(p),bu.clearBuffer(),c+=i[d].length,o)break}return Xg=!1,o}function Ui(r,e,t,n,i,s=0,o=0,c=0,h=0,u=null,d=!1){let A,p;d?(A=rf,p=bu):(A=bu,p=rf);const g=A.float32Array,v=A.uint32Array,E=A.uint16Array,m=p.float32Array,_=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=xn(x,E),M=xn(I,w);let T=!1;if(M&&R)d?T=i(wn(e,_),Vn(e*2,w),wn(r,v),Vn(r*2,E),h,o+e,c,s+r):T=i(wn(r,v),Vn(r*2,E),wn(e,_),Vn(e*2,w),c,s+r,h,o+e);else if(M){const D=Aa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=ai(r),S=jn(r,v);rr(b,g,Vl),rr(S,g,jl);const L=D.intersectsBox(Vl),P=D.intersectsBox(jl);T=L&&Ui(e,b,n,t,i,o,s,h,c+1,D,!d)||P&&Ui(e,S,n,t,i,o,s,h,c+1,D,!d),Aa.releasePrimitive(D)}else{const D=ai(e),b=jn(e,_);rr(D,m,Yg),rr(b,m,qg);const S=u.intersectsBox(Yg),L=u.intersectsBox(qg);if(S&&L)T=Ui(r,D,t,n,i,s,o,c,h+1,u,d)||Ui(r,b,t,n,i,s,o,c,h+1,u,d);else if(S)if(R)T=Ui(r,D,t,n,i,s,o,c,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(Yg).applyMatrix4(t);const N=ai(r),W=jn(r,v);rr(N,g,Vl),rr(W,g,jl);const X=P.intersectsBox(Vl),K=P.intersectsBox(jl);T=X&&Ui(D,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ui(D,W,n,t,i,o,s,h,c+1,P,!d),Aa.releasePrimitive(P)}else if(L)if(R)T=Ui(r,b,t,n,i,s,o,c,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(qg).applyMatrix4(t);const N=ai(r),W=jn(r,v);rr(N,g,Vl),rr(W,g,jl);const X=P.intersectsBox(Vl),K=P.intersectsBox(jl);T=X&&Ui(b,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ui(b,W,n,t,i,o,s,h,c+1,P,!d),Aa.releasePrimitive(P)}}return T}const nf=new fn,rw=new Er;class Kg{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let c;return t.cloneBuffers?c={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:c={roots:i,index:o.array,indirectBuffer:s},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,c=new Kg(t,{...n,[Rg]:!0});if(c._roots=s,c._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new Fr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return c}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Ux,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Rg]:!1},t),t.useSharedArrayBuffer&&!LU())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Rg]||(JN(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Er)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?wU:uU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(c,h=0){const u=c*2,d=s[u+15]===Od;if(d){const A=i[c+6],p=s[u+14];e(h,d,new Float32Array(n,c*4,6),A,p)}else{const A=c+_o/4,p=i[c+6],g=i[c+7];e(h,d,new Float32Array(n,c*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=yi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,c=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?IU:pU;for(let A=0,p=n.length;A<p;A++){const g=c?t[h[A].materialIndex].side:u,v=s.length;if(d(this,A,g,e,s),c){const E=h[A].materialIndex;for(let m=v,_=s.length;m<_;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=yi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let c=null;const h=i.groups,u=s?t.side:t,d=this.indirect?SU:gU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,v=d(this,A,g,e);v!=null&&(c==null||v.distance<c.distance)&&(c=v,o&&(v.face.materialIndex=h[A].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?MU:mU;for(let o=0,c=i.length;o<c&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=si.getPrimitive(),n=this.indirect?fU:cU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:c}=e;if(o&&c){const A=o;o=(p,g,v,E,m)=>A(p,g,v,E,m)?!0:n(p,g,this,c,v,E,t)}else o||(c?o=(A,p,g,v)=>n(A,p,this,c,g,v,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=nU(this,A,s,o,i,u),h)break;u+=g.byteLength}return si.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=si.getPrimitive(),c=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?v=>{const E=this.resolveTriangleIndex(v);wr(o,E*3,c,h)}:v=>{wr(o,v*3,c,h)},d=si.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?v=>{const E=e.resolveTriangleIndex(v);wr(d,E*3,A,p)}:v=>{wr(d,v*3,A,p)};if(s){const v=(E,m,_,w,x,I,R,M)=>{for(let T=_,D=_+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,S=E+m;b<S;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,M))return!0}return!1};if(i){const E=i;i=function(m,_,w,x,I,R,M,T){return E(m,_,w,x,I,R,M,T)?!0:v(m,_,w,x,I,R,M,T)}}else i=v}return NU(this,e,t,i)}intersectsBox(e,t){return nf.set(e.min,e.max,t),nf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>nf.intersectsBox(n),intersectsTriangle:n=>nf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?DU:xU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return iU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),rw),e.union(rw)}),e}}function UU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function PU(r){switch(r){case 1:return ea;case 2:return io;case 3:return gr;case 4:return gr}}function nw(r){switch(r){case 1:return fA;case 2:return Xh;case 3:return tu;case 4:return tu}}class iw extends Ao{constructor(){super(),this.minFilter=fr,this.magFilter=fr,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,c=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=lr;break;case Uint8Array:case Uint16Array:case Uint32Array:d=Ii;break;case Int8Array:case Int16Array:case Int32Array:d=Zc;break}let p,g,v,E,m=UU(s);switch(d){case lr:v=1,g=PU(s),c&&u===1?(E=h,m+="8",h===Uint8Array?p=Ar:(p=hA,m+="_SNORM")):(E=Float32Array,m+="32F",p=lr);break;case Zc:m+=u*8+"I",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=nw(s),u===1?(E=Int8Array,p=hA):u===2?(E=Int16Array,p=jy):(E=Int32Array,p=Zc);break;case Ii:m+=u*8+"UI",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=nw(s),u===1?(E=Uint8Array,p=Ar):u===2?(E=Uint16Array,p=dA):(E=Uint32Array,p=Ii);break}A===3&&(g===gr||g===tu)&&(A=4);const _=Math.ceil(Math.sqrt(o)),w=A*_*_,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const M=A*R;x[M]=e.getX(R)/v,s>=2&&(x[M+1]=e.getY(R)/v),s>=3&&(x[M+2]=e.getZ(R)/v,A===4&&(x[M+3]=1)),s>=4&&(x[M+3]=e.getW(R)/v)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=_,this.image.height=_,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class kU extends iw{constructor(){super(),this._forcedType=Ii}}class QU extends iw{constructor(){super(),this._forcedType=lr}}class sw{constructor(){this.index=new kU,this.position=new QU,this.bvhBounds=new Ao,this.bvhContents=new Ao,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(OU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Ox(Fx(t));this._cachedIndexAttr=new Fr(i,1,!1)}FU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function FU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const c=3*s,h=3*e[s];for(let u=0;u<3;u++)n[c+u]=i?i[h+u]:h+u}}function OU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),c=new Float32Array(i),h=i.byteLength/_o,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const v=g*_o/4,E=v*2,m=v;for(let _=0;_<3;_++)d[8*g+0+_]=c[m+0+_],d[8*g+4+_]=c[m+3+_];if(xn(E,s)){const _=Vn(E,s),w=wn(v,o),x=4294901760|_;p[g*2+0]=x,p[g*2+1]=w}else{const _=4*jn(v,o)/_o,w=Pg(v,o);p[g*2+0]=w,p[g*2+1]=_}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=gr,e.type=lr,e.internalFormat="RGBA32F",e.minFilter=fr,e.magFilter=fr,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=Xh,t.type=Ii,t.internalFormat="RG32UI",t.minFilter=fr,t.magFilter=fr,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const zU=`
|
|
3987
|
+
}`},Ux=0,kN=1,Px=2,kx=2,bg=1.25,Qx=1,_o=6*4+4+4,zd=65535,QN=Math.pow(2,-24),Rg=Symbol("SKIP_GENERATION");function Fx(r){return r.index?r.index.count:r.attributes.position.count}function Ul(r){return Fx(r)/3}function Ox(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function FN(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Ox(t,n);r.setIndex(new Fr(i,1));for(let s=0;s<t;s++)i[s]=s}}function zx(r){const e=Ul(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function Hx(r){if(!r.groups||!r.groups.length)return zx(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const c of r.groups){const h=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((c,h)=>c-h);for(let c=0;c<o.length-1;c++){const h=o[c],u=o[c+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function ON(r){if(r.groups.length===0)return!1;const e=Ul(r),t=Hx(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function zN(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function Gx(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Vx(r,e){e.set(r)}function jx(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function Hd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,c=i+s;o<t[n]&&(t[n]=o),c>t[n+3]&&(t[n+3]=c)}}function Iu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Dg(r,e,t,n,i=null){let s=1/0,o=1/0,c=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,v=-1/0,E=-1/0,m=-1/0;const _=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],M=I-R,T=I+R;M<s&&(s=M),T>h&&(h=T),_&&I<A&&(A=I),_&&I>v&&(v=I);const D=r[w+2],b=r[w+3],S=D-b,L=D+b;S<o&&(o=S),L>u&&(u=L),_&&D<p&&(p=D),_&&D>E&&(E=D);const P=r[w+4],N=r[w+5],W=P-N,X=P+N;W<c&&(c=W),X>d&&(d=X),_&&P<g&&(g=P),_&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=c,n[3]=h,n[4]=u,n[5]=d,_&&(i[0]=A,i[1]=p,i[2]=g,i[3]=v,i[4]=E,i[5]=m)}function HN(r,e,t,n){let i=1/0,s=1/0,o=1/0,c=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>c&&(c=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const v=r[d+4];v<o&&(o=v),v>u&&(u=v)}n[0]=i,n[1]=s,n[2]=o,n[3]=c,n[4]=h,n[5]=u}function GN(r,e){zN(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Ul(r),s=new Float32Array(i*6),o=t.normalized,c=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let v=p+0,E=p+1,m=p+2;n&&(v=n[v],E=n[E],m=n[m]),o||(v=v*u+h,E=E*u+h,m=m*u+h);for(let _=0;_<3;_++){let w,x,I;o?(w=t[d[_]](v),x=t[d[_]](E),I=t[d[_]](m)):(w=c[v+_],x=c[E+_],I=c[m+_]);let R=w;x<R&&(R=x),I<R&&(R=I);let M=w;x>M&&(M=x),I>M&&(M=I);const T=(M-R)/2,D=_*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*QN,R<e[_]&&(e[_]=R),M>e[_+3]&&(e[_+3]=M)}}return s}const Ms=32,VN=(r,e)=>r.candidate-e.candidate,da=new Array(Ms).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Gd=new Float32Array(6);function jN(r,e,t,n,i,s){let o=-1,c=0;if(s===Ux)o=Gx(e),o!==-1&&(c=(e[o]+e[o+3])/2);else if(s===kN)o=Gx(r),o!==-1&&(c=WN(t,n,i,o));else if(s===Px){const h=Iu(r);let u=bg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],v=(e[p+3]-g)/Ms;if(i<Ms/4){const E=[...da];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:M}=x;for(let T=0;T<3;T++)M[T]=1/0,M[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;Hd(w,t,I)}E.sort(VN);let _=i;for(let w=0;w<_;w++){const x=E[w];for(;w+1<_&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),_--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<_;I++){const R=E[I];x>=R.candidate?Hd(w,t,R.rightCacheBounds):(Hd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<_;w++){const x=E[w],I=x.count,R=i-x.count,M=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=Iu(M)/h);let b=0;R!==0&&(b=Iu(T)/h);const S=Qx+bg*(D*I+b*R);S<u&&(o=p,u=S,c=x.candidate)}}else{for(let _=0;_<Ms;_++){const w=da[_];w.count=0,w.candidate=g+v+_*v;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let _=d;_<A;_+=6){let w=~~((t[_+2*p]-g)/v);w>=Ms&&(w=Ms-1);const x=da[w];x.count++,Hd(_,t,x.bounds)}const E=da[Ms-1];Vx(E.bounds,E.rightCacheBounds);for(let _=Ms-2;_>=0;_--){const w=da[_],x=da[_+1];jx(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let _=0;_<Ms-1;_++){const w=da[_],x=w.count,I=w.bounds,R=da[_+1].rightCacheBounds;x!==0&&(m===0?Vx(I,Gd):jx(I,Gd,Gd)),m+=x;let M=0,T=0;m!==0&&(M=Iu(Gd)/h);const D=i-m;D!==0&&(T=Iu(R)/h);const b=Qx+bg*(M*m+T*D);b<u&&(o=p,u=b,c=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:c}}function WN(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Vd{constructor(){}}function YN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[c*3+d],e[c*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[c*6+d],t[c*6+d]=A}o++,c--}else return o}}function qN(r,e,t,n,i,s){let o=n,c=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=c&&t[o*6+u]<h;)o++;for(;o<=c&&t[c*6+u]>=h;)c--;if(o<c){let d=r[o];r[o]=r[c],r[c]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[c*6+A],t[c*6+A]=p}o++,c--}else return o}}function XN(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let c=0,h=o.length;c<h;c++)o[c]=c;return o}function KN(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,c=e.strategy,h=e.onProgress,u=Ul(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),v=GN(t,p),E=e.indirect?qN:YN,m=[],_=e.indirect?zx(t):Hx(t);if(_.length===1){const I=_[0],R=new Vd;R.boundingData=p,HN(v,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of _){const R=new Vd;R.boundingData=new Float32Array(6),Dg(v,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,M,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),M<=o||D>=i)return w(R+M),I.offset=R,I.count=M,I;const b=jN(I.boundingData,T,v,R,M,c);if(b.axis===-1)return w(R+M),I.offset=R,I.count=M,I;const S=E(d,n,v,R,M,b);if(S===R||S===R+M)w(R+M),I.offset=R,I.count=M;else{I.splitAxis=b.axis;const L=new Vd,P=R,N=S-R;I.left=L,L.boundingData=new Float32Array(6),Dg(v,P,N,L.boundingData,g),x(L,P,N,g,D+1);const W=new Vd,X=S,K=M-N;I.right=W,W.boundingData=new Float32Array(6),Dg(v,X,K,W.boundingData,g),x(W,X,K,g,D+1)}return I}}function JN(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=XN(t,e.useSharedArrayBuffer),ON(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||FN(t,e);const n=KN(r,e);let i,s,o;const c=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const v=new h(_o*g);i=new Float32Array(v),s=new Uint32Array(v),o=new Uint16Array(v),d(0,p),c.push(v)}r._roots=c;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,v=A/2,E=!!p.count,m=p.boundingData;for(let _=0;_<6;_++)i[g+_]=m[_];if(E){const _=p.offset,w=p.count;return s[g+6]=_,o[v+14]=w,o[v+15]=zd,A+_o}else{const _=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+_o,_),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Ts{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const c=e[s][t];n=c<n?c:n,i=c>i?c:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const c=t[s],h=e.dot(c);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Ts.prototype.setFromBox=function(){const r=new j;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let c=0;c<=1;c++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*c+i.x*(1-c),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const ZN=function(){const r=new j,e=new j,t=new j;return function(n,i,s){const o=n.start,c=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(c),p=u.dot(u),g=t.dot(c),v=c.dot(c)*p-A*A;let E,m;v!==0?E=(d*A-g*p)/v:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),Lg=function(){const r=new Ge,e=new j,t=new j;return function(n,i,s,o){ZN(n,i,r);let c=r.x,h=r.y;if(c>=0&&c<=1&&h>=0&&h<=1){n.at(c,s),i.at(h,o);return}else if(c>=0&&c<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){c<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;c<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),$N=function(){const r=new j,e=new j,t=new Xi,n=new Cs;return function(i,s){const{radius:o,center:c}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o||(n.start=h,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(c,!0,r).distanceTo(c)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(c))<=o){const p=A.projectPoint(c,e);if(s.containsPoint(p))return!0}return!1}}(),eU=1e-15;function Ng(r){return Math.abs(r)<eU}class Ni extends ln{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new j),this.satBounds=new Array(4).fill().map(()=>new Ts),this.points=[this.a,this.b,this.c],this.sphere=new Bi,this.plane=new Xi,this.needsUpdate=!0}intersectsSphere(e){return $N(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,c=s[0],h=o[0];this.getNormal(c),h.setFromPoints(c,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],v=o[3];g.subVectors(n,e),v.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}Ni.prototype.closestPointToSegment=function(){const r=new j,e=new j,t=new Cs;return function(n,i=null,s=null){const{start:o,end:c}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Lg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(c,r),u=c.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(c)),Math.sqrt(d)}}(),Ni.prototype.intersectsTriangle=function(){const r=new Ni,e=new Array(3),t=new Array(3),n=new Ts,i=new Ts,s=new j,o=new j,c=new j,h=new j,u=new j,d=new Cs,A=new Cs,p=new Cs,g=new j;function v(E,m,_){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:M,end:T}=d;M.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=Ng(m.distanceToPoint(M));if(Ng(m.normal.dot(o))&&D){_.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(M),(b||D)&&!Ng(g.distanceTo(T))){if(x<=1)(x===1?_.start:_.end).copy(g),D&&(I=x);else if(x>=2){(I===1?_.start:_.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,_=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],S=R[D];if(n.setFromPoints(S,t),b.isSeparated(n))return!1}const M=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=M[D],S=T[D];if(n.setFromPoints(S,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let S=0;S<4;S++){const L=T[S];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=v(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=v(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(c),p.delta(h),c.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const M=A.start.dot(c),T=A.end.dot(c),D=p.start.dot(c),b=p.end.dot(c),S=T<D,L=M<b;return M!==b&&D!==T&&S===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(c)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(c)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Ni.prototype.distanceToPoint=function(){const r=new j;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Ni.prototype.distanceToTriangle=function(){const r=new j,e=new j,t=["a","b","c"],n=new Cs,i=new Cs;return function(s,o=null,c=null){const h=o||c?n:null;if(this.intersectsTriangle(s,h))return(o||c)&&(o&&h.getCenter(o),c&&h.getCenter(c)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),c&&c.copy(g));const v=this[p];s.closestPointToPoint(v,r),A=v.distanceToSquared(r),A<u&&(u=A,o&&o.copy(v),c&&c.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const v=t[g],E=t[(g+1)%3];i.set(s[v],s[E]),Lg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),c&&c.copy(e))}}return Math.sqrt(u)}}();class fn{constructor(e,t,n){this.isOrientedBox=!0,this.min=new j,this.max=new j,this.matrix=new st,this.invMatrix=new st,this.points=new Array(8).fill().map(()=>new j),this.satAxes=new Array(3).fill().map(()=>new j),this.satBounds=new Array(3).fill().map(()=>new Ts),this.alignedSatBounds=new Array(3).fill().map(()=>new Ts),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}fn.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const c=this.alignedSatBounds;c[0].setFromPointsField(n,"x"),c[1].setFromPointsField(n,"y"),c[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),fn.prototype.intersectsBox=function(){const r=new Ts;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let c=0;c<3;c++){const h=s[c],u=i[c];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),fn.prototype.intersectsTriangle=function(){const r=new Ni,e=new Array(3),t=new Ts,n=new Ts,i=new j;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,c=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=c[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=c[A];for(let g=0;g<4;g++){const v=u[g];if(i.crossVectors(p,v),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),fn.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),fn.prototype.distanceToPoint=function(){const r=new j;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),fn.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Cs),t=new Array(12).fill().map(()=>new Cs),n=new j,i=new j;return function(s,o=0,c=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(c||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),c&&c.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const _=m.distanceToSquared(i);if(_<g&&(g=_,c&&c.copy(m),h&&h.copy(i),_<u))return Math.sqrt(_)}let v=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|_<<x,R=1<<E|m<<w|_<<x,M=p[I],T=p[R];e[v].set(M,T);const D=r[E],b=r[w],S=r[x],L=t[v],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[S]=_?d[S]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[S]=_?d[S]:A[b],v++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let _=0;_<=1;_++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=_?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,c&&c.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let _=0;_<12;_++){const w=t[_];Lg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,c&&c.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Ug{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class tU extends Ug{constructor(){super(()=>new Ni)}}const si=new tU;function xn(r,e){return e[r+15]===65535}function wn(r,e){return e[r+6]}function Vn(r,e){return e[r+14]}function ai(r){return r+8}function jn(r,e){return e[r+6]}function Pg(r,e){return e[r+7]}class rU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new rU;let fa,Pl;const kl=[],jd=new Ug(()=>new Er);function nU(r,e,t,n,i,s){fa=jd.getPrimitive(),Pl=jd.getPrimitive(),kl.push(fa,Pl),Yt.setBuffer(r._roots[e]);const o=kg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),jd.releasePrimitive(fa),jd.releasePrimitive(Pl),kl.pop(),kl.pop();const c=kl.length;return c>0&&(Pl=kl[c-1],fa=kl[c-2]),o}function kg(r,e,t,n,i=null,s=0,o=0){const{float32Array:c,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(xn(d,h)){const A=wn(r,u),p=Vn(d,h);return rr(r,c,fa),n(A,p,!1,o,s+r,fa)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=ai(L),W=L*2;return wn(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=jn(L,N),W=L*2;return wn(L,N)+Vn(W,P)};const g=ai(r),v=jn(r,u);let E=g,m=v,_,w,x,I;if(i&&(x=fa,I=Pl,rr(E,c,x),rr(m,c,I),_=i(x),w=i(I),w<_)){E=v,m=g;const L=_;_=w,w=L,x=I}x||(x=fa,rr(E,c,x));const R=xn(E*2,h),M=t(x,R,_,o+1,s+E);let T;if(M===kx){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=M&&kg(E,e,t,n,i,s,o+1);if(T)return!0;I=Pl,rr(m,c,I);const D=xn(m*2,h),b=t(I,D,w,o+1,s+m);let S;if(b===kx){const L=A(m),P=p(m)-L;S=n(L,P,!0,o+1,s+m,I)}else S=b&&kg(m,e,t,n,i,s,o+1);return!!S}}const Cu=new j,Qg=new j;function iU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let c=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Cu.copy(e).clamp(d.min,d.max),Cu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<c&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Cu);const p=e.distanceToSquared(Cu);return p<c&&(Qg.copy(Cu),c=p,h=A),p<s}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(Qg):t.point=Qg.clone(),t.distance=u,t.faceIndex=h,t}const Ql=new j,Fl=new j,Ol=new j,Wd=new Ge,Yd=new Ge,qd=new Ge,Wx=new j,Yx=new j,qx=new j,Xd=new j;function sU(r,e,t,n,i,s){let o;return s===kr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==Ei,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function aU(r,e,t,n,i,s,o,c,h){Ql.fromBufferAttribute(e,s),Fl.fromBufferAttribute(e,o),Ol.fromBufferAttribute(e,c);const u=sU(r,Ql,Fl,Ol,Xd,h);if(u){n&&(Wd.fromBufferAttribute(n,s),Yd.fromBufferAttribute(n,o),qd.fromBufferAttribute(n,c),u.uv=ln.getInterpolation(Xd,Ql,Fl,Ol,Wd,Yd,qd,new Ge)),i&&(Wd.fromBufferAttribute(i,s),Yd.fromBufferAttribute(i,o),qd.fromBufferAttribute(i,c),u.uv1=ln.getInterpolation(Xd,Ql,Fl,Ol,Wd,Yd,qd,new Ge)),t&&(Wx.fromBufferAttribute(t,s),Yx.fromBufferAttribute(t,o),qx.fromBufferAttribute(t,c),u.normal=ln.getInterpolation(Xd,Ql,Fl,Ol,Wx,Yx,qx,new j),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c,normal:new j,materialIndex:0};ln.getNormal(Ql,Fl,Ol,d.normal),u.face=d,u.faceIndex=s}return u}function Kd(r,e,t,n,i){const s=n*3;let o=s+0,c=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),c=u.getX(c),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,v=aU(t,d,A,p,g,o,c,h,e);return v?(v.faceIndex=n,i&&i.push(v),v):null}function wr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let c=e,h=e+1,u=e+2;t&&(c=t.getX(c),h=t.getX(h),u=t.getX(u)),i.x=n.getX(c),i.y=n.getY(c),i.z=n.getZ(c),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function oU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++)Kd(o,e,t,h,s)}function lU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=Kd(s,e,t,u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function cU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,wr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function uU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===zd){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,M=-1/0,T=-1/0;for(let D=3*m,b=3*(m+_);D<b;D++){let S=n[D];const L=i.getX(S),P=i.getY(S),N=i.getZ(S);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>M&&(M=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==M||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=M,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,M=!1;e?I||(R=e.has(w),M=e.has(x),I=!R&&!M):(R=!0,M=!0);const T=I||R,D=I||M;let b=!1;T&&(b=A(m,g,I));let S=!1;D&&(S=A(_,g,I));const L=b||S;if(L)for(let P=0;P<3;P++){const N=m+P,W=_+P,X=h[N],K=h[N+3],te=h[W],H=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>H?K:H}return L}}}const Xx=new Er;function pa(r,e,t,n){return rr(r,e,Xx),t.intersectBox(Xx,n)}function hU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:c}=r;for(let h=n,u=n+i;h<u;h++){let d=c?c[h]:h;Kd(o,e,t,d,s)}}function dU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let c=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=Kd(s,e,t,o?o[u]:u),A&&A.distance<c&&(h=A,c=A.distance)}return h}function fU(r,e,t,n,i,s,o){const{geometry:c}=t,{index:h}=c,u=c.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),wr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const Kx=new j;function pU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Fg(0,r,t,n,i),Yt.clearBuffer()}function Fg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,c),d=Vn(h,o);oU(e,t,n,u,d,i)}else{const u=ai(r);pa(u,s,n,Kx)&&Fg(u,e,t,n,i);const d=jn(r,c);pa(d,s,n,Kx)&&Fg(d,e,t,n,i)}}const Jx=new j,AU=["x","y","z"];function gU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Og(0,r,t,n);return Yt.clearBuffer(),i}function Og(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(xn(c,s)){const h=wn(r,o),u=Vn(c,s);return lU(e,t,n,h,u)}else{const h=Pg(r,o),u=AU[h],d=n.direction[u]>=0;let A,p;d?(A=ai(r),p=jn(r,o)):(A=jn(r,o),p=ai(r));const g=pa(A,i,n,Jx)?Og(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=pa(p,i,n,Jx)?Og(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const Jd=new Er,zl=new Ni,Hl=new Ni,Su=new st,Zx=new fn,Zd=new fn;function mU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=zg(0,r,t,n);return Yt.clearBuffer(),i}function zg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Zx.set(t.boundingBox.min,t.boundingBox.max,n),i=Zx),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=wn(r,c),E=Vn(h,o);if(Su.copy(n).invert(),t.boundsTree)return rr(r,s,Zd),Zd.matrix.copy(Su),Zd.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>Zd.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v*3,w=(E+v)*3;_<w;_+=3)if(wr(Hl,_,d,A),Hl.needsUpdate=!0,m.intersectsTriangle(Hl))return!0;return!1}});for(let m=v*3,_=(E+v)*3;m<_;m+=3){wr(zl,m,d,A),zl.a.applyMatrix4(Su),zl.b.applyMatrix4(Su),zl.c.applyMatrix4(Su),zl.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(wr(Hl,w,p,g),Hl.needsUpdate=!0,zl.intersectsTriangle(Hl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,Jd),!!(i.intersectsBox(Jd)&&zg(u,e,t,n,i)||(rr(d,s,Jd),i.intersectsBox(Jd)&&zg(d,e,t,n,i)))}}const $d=new st,Hg=new fn,Mu=new fn,_U=new j,vU=new j,yU=new j,EU=new j;function xU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Hg.set(e.boundingBox.min,e.boundingBox.max,t),Hg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=si.getPrimitive(),g=si.getPrimitive();let v=_U,E=vU,m=null,_=null;i&&(m=yU,_=EU);let w=1/0,x=null,I=null;return $d.copy(t).invert(),Mu.matrix.copy($d),r.shapecast({boundsTraverseOrder:R=>Hg.distanceToBox(R),intersectsBounds:(R,M,T)=>T<w&&T<o?(M&&(Mu.min.copy(R.min),Mu.max.copy(R.max),Mu.needsUpdate=!0),!0):!1,intersectsRange:(R,M)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Mu.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,S=T+D;b<S;b++){wr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+M;L<P;L++){wr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Ul(e);for(let D=0,b=T;D<b;D++){wr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let S=R,L=R+M;S<L;S++){wr(p,3*S,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,v,m);if(P<w&&(E.copy(v),_&&_.copy(m),w=P,x=S,I=D),P<s)return!0}}}}}),si.releasePrimitive(p),si.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4($d),E.applyMatrix4($d),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function wU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,c,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),c=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,v=!1){const E=p*2;if(c[E+15]===zd){const m=o[p+6],_=c[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,M=-1/0,T=-1/0;for(let D=m,b=m+_;D<b;D++){const S=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=S+L;P=n?n[P]:P;const N=i.getX(P),W=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),W<x&&(x=W),W>M&&(M=W),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==M||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=M,h[p+5]=T,!0):!1}else{const m=p+8,_=o[p+6],w=m+g,x=_+g;let I=v,R=!1,M=!1;e?I||(R=e.has(w),M=e.has(x),I=!R&&!M):(R=!0,M=!0);const T=I||R,D=I||M;let b=!1;T&&(b=A(m,g,I));let S=!1;D&&(S=A(_,g,I));const L=b||S;if(L)for(let P=0;P<3;P++){const N=m+P,W=_+P,X=h[N],K=h[N+3],te=h[W],H=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>H?K:H}return L}}}const $x=new j;function IU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Gg(0,r,t,n,i),Yt.clearBuffer()}function Gg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,c),d=Vn(h,o);hU(e,t,n,u,d,i)}else{const u=ai(r);pa(u,s,n,$x)&&Gg(u,e,t,n,i);const d=jn(r,c);pa(d,s,n,$x)&&Gg(d,e,t,n,i)}}const ew=new j,CU=["x","y","z"];function SU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Vg(0,r,t,n);return Yt.clearBuffer(),i}function Vg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let c=r*2;if(xn(c,s)){const h=wn(r,o),u=Vn(c,s);return dU(e,t,n,h,u)}else{const h=Pg(r,o),u=CU[h],d=n.direction[u]>=0;let A,p;d?(A=ai(r),p=jn(r,o)):(A=jn(r,o),p=ai(r));const g=pa(A,i,n,ew)?Vg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const v=pa(p,i,n,ew)?Vg(p,e,t,n):null;return g&&v?g.distance<=v.distance?g:v:g||v||null}}const ef=new Er,Gl=new Ni,Vl=new Ni,Tu=new st,tw=new fn,tf=new fn;function MU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=jg(0,r,t,n);return Yt.clearBuffer(),i}function jg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:c}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),tw.set(t.boundingBox.min,t.boundingBox.max,n),i=tw),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,v=wn(r,c),E=Vn(h,o);if(Tu.copy(n).invert(),t.boundsTree)return rr(r,s,tf),tf.matrix.copy(Tu),tf.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>tf.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let _=v,w=E+v;_<w;_++)if(wr(Vl,3*e.resolveTriangleIndex(_),d,A),Vl.needsUpdate=!0,m.intersectsTriangle(Vl))return!0;return!1}});for(let m=v,_=E+v;m<_;m++){const w=e.resolveTriangleIndex(m);wr(Gl,3*w,d,A),Gl.a.applyMatrix4(Tu),Gl.b.applyMatrix4(Tu),Gl.c.applyMatrix4(Tu),Gl.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(wr(Vl,x,p,g),Vl.needsUpdate=!0,Gl.intersectsTriangle(Vl))return!0}}else{const u=r+8,d=c[r+6];return rr(u,s,ef),!!(i.intersectsBox(ef)&&jg(u,e,t,n,i)||(rr(d,s,ef),i.intersectsBox(ef)&&jg(d,e,t,n,i)))}}const rf=new st,Wg=new fn,Bu=new fn,TU=new j,BU=new j,bU=new j,RU=new j;function DU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Wg.set(e.boundingBox.min,e.boundingBox.max,t),Wg.needsUpdate=!0;const c=r.geometry,h=c.attributes.position,u=c.index,d=e.attributes.position,A=e.index,p=si.getPrimitive(),g=si.getPrimitive();let v=TU,E=BU,m=null,_=null;i&&(m=bU,_=RU);let w=1/0,x=null,I=null;return rf.copy(t).invert(),Bu.matrix.copy(rf),r.shapecast({boundsTraverseOrder:R=>Wg.distanceToBox(R),intersectsBounds:(R,M,T)=>T<w&&T<o?(M&&(Bu.min.copy(R.min),Bu.max.copy(R.max),Bu.needsUpdate=!0),!0):!1,intersectsRange:(R,M)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Bu.distanceToBox(D),intersectsBounds:(D,b,S)=>S<w&&S<o,intersectsRange:(D,b)=>{for(let S=D,L=D+b;S<L;S++){const P=T.resolveTriangleIndex(S);wr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,W=R+M;N<W;N++){const X=r.resolveTriangleIndex(N);wr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,v,m);if(K<w&&(E.copy(v),_&&_.copy(m),w=K,x=N,I=S),K<s)return!0}}}})}else{const T=Ul(e);for(let D=0,b=T;D<b;D++){wr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let S=R,L=R+M;S<L;S++){const P=r.resolveTriangleIndex(S);wr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,v,m);if(N<w&&(E.copy(v),_&&_.copy(m),w=N,x=S,I=D),N<s)return!0}}}}}),si.releasePrimitive(p),si.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(_):i.point=_.clone(),i.point.applyMatrix4(rf),E.applyMatrix4(rf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function LU(){return typeof SharedArrayBuffer<"u"}const bu=new Yt.constructor,nf=new Yt.constructor,Aa=new Ug(()=>new Er),jl=new Er,Wl=new Er,Yg=new Er,qg=new Er;let Xg=!1;function NU(r,e,t,n){if(Xg)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Xg=!0;const i=r._roots,s=e._roots;let o,c=0,h=0;const u=new st().copy(t).invert();for(let d=0,A=i.length;d<A;d++){bu.setBuffer(i[d]),h=0;const p=Aa.getPrimitive();rr(0,bu.float32Array,p),p.applyMatrix4(u);for(let g=0,v=s.length;g<v&&(nf.setBuffer(s[d]),o=Ui(0,0,t,u,n,c,h,0,0,p),nf.clearBuffer(),h+=s[g].length,!o);g++);if(Aa.releasePrimitive(p),bu.clearBuffer(),c+=i[d].length,o)break}return Xg=!1,o}function Ui(r,e,t,n,i,s=0,o=0,c=0,h=0,u=null,d=!1){let A,p;d?(A=nf,p=bu):(A=bu,p=nf);const g=A.float32Array,v=A.uint32Array,E=A.uint16Array,m=p.float32Array,_=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=xn(x,E),M=xn(I,w);let T=!1;if(M&&R)d?T=i(wn(e,_),Vn(e*2,w),wn(r,v),Vn(r*2,E),h,o+e,c,s+r):T=i(wn(r,v),Vn(r*2,E),wn(e,_),Vn(e*2,w),c,s+r,h,o+e);else if(M){const D=Aa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=ai(r),S=jn(r,v);rr(b,g,jl),rr(S,g,Wl);const L=D.intersectsBox(jl),P=D.intersectsBox(Wl);T=L&&Ui(e,b,n,t,i,o,s,h,c+1,D,!d)||P&&Ui(e,S,n,t,i,o,s,h,c+1,D,!d),Aa.releasePrimitive(D)}else{const D=ai(e),b=jn(e,_);rr(D,m,Yg),rr(b,m,qg);const S=u.intersectsBox(Yg),L=u.intersectsBox(qg);if(S&&L)T=Ui(r,D,t,n,i,s,o,c,h+1,u,d)||Ui(r,b,t,n,i,s,o,c,h+1,u,d);else if(S)if(R)T=Ui(r,D,t,n,i,s,o,c,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(Yg).applyMatrix4(t);const N=ai(r),W=jn(r,v);rr(N,g,jl),rr(W,g,Wl);const X=P.intersectsBox(jl),K=P.intersectsBox(Wl);T=X&&Ui(D,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ui(D,W,n,t,i,o,s,h,c+1,P,!d),Aa.releasePrimitive(P)}else if(L)if(R)T=Ui(r,b,t,n,i,s,o,c,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(qg).applyMatrix4(t);const N=ai(r),W=jn(r,v);rr(N,g,jl),rr(W,g,Wl);const X=P.intersectsBox(jl),K=P.intersectsBox(Wl);T=X&&Ui(b,N,n,t,i,o,s,h,c+1,P,!d)||K&&Ui(b,W,n,t,i,o,s,h,c+1,P,!d),Aa.releasePrimitive(P)}}return T}const sf=new fn,rw=new Er;class Kg{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let c;return t.cloneBuffers?c={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:c={roots:i,index:o.array,indirectBuffer:s},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,c=new Kg(t,{...n,[Rg]:!0});if(c._roots=s,c._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new Fr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return c}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:Ux,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Rg]:!1},t),t.useSharedArrayBuffer&&!LU())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Rg]||(JN(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Er)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?wU:uU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(c,h=0){const u=c*2,d=s[u+15]===zd;if(d){const A=i[c+6],p=s[u+14];e(h,d,new Float32Array(n,c*4,6),A,p)}else{const A=c+_o/4,p=i[c+6],g=i[c+7];e(h,d,new Float32Array(n,c*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=yi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,c=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?IU:pU;for(let A=0,p=n.length;A<p;A++){const g=c?t[h[A].materialIndex].side:u,v=s.length;if(d(this,A,g,e,s),c){const E=h[A].materialIndex;for(let m=v,_=s.length;m<_;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=yi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let c=null;const h=i.groups,u=s?t.side:t,d=this.indirect?SU:gU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,v=d(this,A,g,e);v!=null&&(c==null||v.distance<c.distance)&&(c=v,o&&(v.face.materialIndex=h[A].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?MU:mU;for(let o=0,c=i.length;o<c&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=si.getPrimitive(),n=this.indirect?fU:cU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:c}=e;if(o&&c){const A=o;o=(p,g,v,E,m)=>A(p,g,v,E,m)?!0:n(p,g,this,c,v,E,t)}else o||(c?o=(A,p,g,v)=>n(A,p,this,c,g,v,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=nU(this,A,s,o,i,u),h)break;u+=g.byteLength}return si.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=si.getPrimitive(),c=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?v=>{const E=this.resolveTriangleIndex(v);wr(o,E*3,c,h)}:v=>{wr(o,v*3,c,h)},d=si.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?v=>{const E=e.resolveTriangleIndex(v);wr(d,E*3,A,p)}:v=>{wr(d,v*3,A,p)};if(s){const v=(E,m,_,w,x,I,R,M)=>{for(let T=_,D=_+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,S=E+m;b<S;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,M))return!0}return!1};if(i){const E=i;i=function(m,_,w,x,I,R,M,T){return E(m,_,w,x,I,R,M,T)?!0:v(m,_,w,x,I,R,M,T)}}else i=v}return NU(this,e,t,i)}intersectsBox(e,t){return sf.set(e.min,e.max,t),sf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>sf.intersectsBox(n),intersectsTriangle:n=>sf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?DU:xU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return iU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),rw),e.union(rw)}),e}}function UU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function PU(r){switch(r){case 1:return ea;case 2:return io;case 3:return gr;case 4:return gr}}function nw(r){switch(r){case 1:return fA;case 2:return Kh;case 3:return tu;case 4:return tu}}class iw extends Ao{constructor(){super(),this.minFilter=fr,this.magFilter=fr,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,c=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=lr;break;case Uint8Array:case Uint16Array:case Uint32Array:d=Ii;break;case Int8Array:case Int16Array:case Int32Array:d=Zc;break}let p,g,v,E,m=UU(s);switch(d){case lr:v=1,g=PU(s),c&&u===1?(E=h,m+="8",h===Uint8Array?p=Ar:(p=hA,m+="_SNORM")):(E=Float32Array,m+="32F",p=lr);break;case Zc:m+=u*8+"I",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=nw(s),u===1?(E=Int8Array,p=hA):u===2?(E=Int16Array,p=jy):(E=Int32Array,p=Zc);break;case Ii:m+=u*8+"UI",v=c?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=nw(s),u===1?(E=Uint8Array,p=Ar):u===2?(E=Uint16Array,p=dA):(E=Uint32Array,p=Ii);break}A===3&&(g===gr||g===tu)&&(A=4);const _=Math.ceil(Math.sqrt(o)),w=A*_*_,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const M=A*R;x[M]=e.getX(R)/v,s>=2&&(x[M+1]=e.getY(R)/v),s>=3&&(x[M+2]=e.getZ(R)/v,A===4&&(x[M+3]=1)),s>=4&&(x[M+3]=e.getW(R)/v)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=_,this.image.height=_,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class kU extends iw{constructor(){super(),this._forcedType=Ii}}class QU extends iw{constructor(){super(),this._forcedType=lr}}class sw{constructor(){this.index=new kU,this.position=new QU,this.bvhBounds=new Ao,this.bvhContents=new Ao,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(OU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Ox(Fx(t));this._cachedIndexAttr=new Fr(i,1,!1)}FU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function FU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const c=3*s,h=3*e[s];for(let u=0;u<3;u++)n[c+u]=i?i[h+u]:h+u}}function OU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),c=new Float32Array(i),h=i.byteLength/_o,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const v=g*_o/4,E=v*2,m=v;for(let _=0;_<3;_++)d[8*g+0+_]=c[m+0+_],d[8*g+4+_]=c[m+3+_];if(xn(E,s)){const _=Vn(E,s),w=wn(v,o),x=4294901760|_;p[g*2+0]=x,p[g*2+1]=w}else{const _=4*jn(v,o)/_o,w=Pg(v,o);p[g*2+0]=w,p[g*2+1]=_}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=gr,e.type=lr,e.internalFormat="RGBA32F",e.minFilter=fr,e.magFilter=fr,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=Kh,t.type=Ii,t.internalFormat="RG32UI",t.minFilter=fr,t.magFilter=fr,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const zU=`
|
|
3988
3988
|
#ifndef TRI_INTERSECT_EPSILON
|
|
3989
3989
|
#define TRI_INTERSECT_EPSILON 1e-5
|
|
3990
3990
|
#endif
|
|
@@ -4251,7 +4251,7 @@ bool bvhIntersectFirstHit(
|
|
|
4251
4251
|
return found;
|
|
4252
4252
|
|
|
4253
4253
|
}
|
|
4254
|
-
`;function GU(r,e,t,n){const i=class extends En{constructor(s={}){const o=Object.entries(r);super({uniforms:o.reduce((c,[h,u])=>{const d=
|
|
4254
|
+
`;function GU(r,e,t,n){const i=class extends En{constructor(s={}){const o=Object.entries(r);super({uniforms:o.reduce((c,[h,u])=>{const d=Cd.clone({[h]:{value:u}});return{...c,...d}},{}),vertexShader:e,fragmentShader:t}),this.key="",o.forEach(([c])=>Object.defineProperty(this,c,{get:()=>this.uniforms[c].value,set:h=>this.uniforms[c].value=h})),Object.assign(this,s),n&&n(this)}};return i.key=SA.generateUUID(),i}const VU=()=>parseInt(jh.replace(/\D+/g,"")),jU=VU(),WU=GU({envMap:null,bounces:2,ior:2.5,correctMips:!0,aberrationStrength:.01,fresnel:.4,bvh:new sw,color:new Ke("white"),resolution:new Ge,viewMatrixInverse:new st,projectionMatrixInverse:new st},`
|
|
4255
4255
|
uniform mat4 viewMatrixInverse;
|
|
4256
4256
|
|
|
4257
4257
|
varying vec3 vWorldPosition;
|
|
@@ -4406,7 +4406,7 @@ bool bvhIntersectFirstHit(
|
|
|
4406
4406
|
* Subject to the terms at https://gsap.com/standard-license or for
|
|
4407
4407
|
* Club GSAP members, the agreement issued with that membership.
|
|
4408
4408
|
* @author: Jack Doyle, jack@greensock.com
|
|
4409
|
-
*/var Wn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Wl={duration:.5,overwrite:!1,delay:0},Jg,Zr,$t,oi=1e8,Gt=1/oi,Zg=Math.PI*2,YU=Zg/4,qU=0,ow=Math.sqrt,XU=Math.cos,KU=Math.sin,zr=function(r){return typeof r=="string"},cr=function(r){return typeof r=="function"},bs=function(r){return typeof r=="number"},$g=function(r){return typeof r>"u"},$i=function(r){return typeof r=="object"},In=function(r){return r!==!1},em=function(){return typeof window<"u"},sf=function(r){return cr(r)||zr(r)},lw=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},$r=Array.isArray,tm=/(?:-?\.?\d|\.)+/gi,cw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Yl=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,rm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,uw=/[+-]=-?[.\d]+/,hw=/[^,'"\[\]\s]+/gi,JU=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,es,nm,im,Yn={},af={},dw,fw=function(r){return(af=yo(r,Yn))&&Mn},sm=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},Ru=function(r,e){return!e&&console.warn(r)},pw=function(r,e){return r&&(Yn[r]=e)&&af&&(af[r]=e)||Yn},Du=function(){return 0},ZU={suppressEvents:!0,isStart:!0,kill:!1},of={suppressEvents:!0,kill:!1},$U={suppressEvents:!0},am={},ga=[],om={},Aw,qn={},lm={},gw=30,lf=[],cm="",um=function(r){var e=r[0],t,n;if($i(e)||cr(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=lf.length;n--&&!lf[n].targetTest(e););t=lf[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new jw(r[n],t)))||r.splice(n,1);return r},vo=function(r){return r._gsap||um(ui(r))[0]._gsap},mw=function(r,e,t){return(t=r[e])&&cr(t)?r[e]():$g(t)&&r.getAttribute&&r.getAttribute(e)||t},Cn=function(r,e){return(r=r.split(",")).forEach(e)||r},mr=function(r){return Math.round(r*1e5)/1e5||0},Hr=function(r){return Math.round(r*1e7)/1e7||0},ql=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},eP=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},cf=function(){var r=ga.length,e=ga.slice(0),t,n;for(om={},ga.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},_w=function(r,e,t,n){ga.length&&!Zr&&cf(),r.render(e,t,n||Zr&&e<0&&(r._initted||r._startAt)),ga.length&&!Zr&&cf()},vw=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(hw).length<2?e:zr(r)?r.trim():r},yw=function(r){return r},li=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},tP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},yo=function(r,e){for(var t in e)r[t]=e[t];return r},Ew=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=$i(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},uf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},Lu=function(r){var e=r.parent||nr,t=r.keyframes?tP($r(r.keyframes)):li;if(In(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},rP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},xw=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},hf=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ma=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},Eo=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},nP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},hm=function(r,e,t,n){return r._startAt&&(Zr?r._startAt.revert(of):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},iP=function r(e){return!e||e._ts&&r(e.parent)},ww=function(r){return r._repeat?Xl(r._tTime,r=r.duration()+r._rDelay)*r:0},Xl=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},df=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},ff=function(r){return r._end=Hr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},pf=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=Hr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),ff(r),t._dirty||Eo(t,r)),r},Iw=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=df(r.rawTime(),e),(!e._dur||Uu(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),Eo(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},ts=function(r,e,t,n){return e.parent&&ma(e),e._start=Hr((bs(t)?t:t||r!==nr?ci(r,t,e):r._time)+e._delay),e._end=Hr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),xw(r,e,"_first","_last",r._sort?"_start":0),dm(e)||(r._recent=e),n||Iw(r,e),r._ts<0&&pf(r,r._tTime),r},Cw=function(r,e){return(Yn.ScrollTrigger||sm("scrollTrigger",e))&&Yn.ScrollTrigger.create(e,r)},Sw=function(r,e,t,n,i){if(Em(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!Zr&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&Aw!==Kn.frame)return ga.push(r),r._lazy=[i,n],1},sP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},dm=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},aP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&sP(r)&&!(!r._initted&&dm(r))||(r._ts<0||r._dp._ts<0)&&!dm(r))?0:1,o=r._rDelay,c=0,h,u,d;if(o&&r._repeat&&(c=Uu(0,r._tDur,e),u=Xl(c,o),r._yoyo&&u&1&&(s=1-s),u!==Xl(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||Zr||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Sw(r,e,n,t,c))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=c,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&hm(r,e,t,!0),r._onUpdate&&!t&&Xn(r,"onUpdate"),c&&r._repeat&&!t&&r.parent&&Xn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ma(r,1),!t&&!Zr&&(Xn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},oP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Kl=function(r,e,t,n){var i=r._repeat,s=Hr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:Hr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&pf(r,r._tTime=r._tDur*o),r.parent&&ff(r),t||Eo(r.parent,r),r},Mw=function(r){return r instanceof pn?Eo(r):Kl(r,r._dur)},lP={_start:0,endTime:Du,totalDuration:Du},ci=function r(e,t,n){var i=e.labels,s=e._recent||lP,o=e.duration()>=oi?s.endTime(!1):e._dur,c,h,u;return zr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",c=t.indexOf("="),h==="<"||h===">"?(c>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(c<0?s:n).totalDuration()/100:1)):c<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(c-1)+t.substr(c+1)),u&&n&&(h=h/100*($r(n)?n[0]:n).totalDuration()),c>1?r(e,t.substr(0,c-1),n)+h:o+h)):t==null?o:+t},Nu=function(r,e,t){var n=bs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,c;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,c=t;c&&!("immediateRender"in o);)o=c.vars.defaults||{},c=In(c.vars.inherit)&&c.parent;s.immediateRender=In(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new Ir(e[0],s,e[i+1])},_a=function(r,e){return r||r===0?e(r):e},Uu=function(r,e,t){return t<r?r:t>e?e:t},en=function(r,e){return!zr(r)||!(e=JU.exec(r))?"":e[1]},cP=function(r,e,t){return _a(t,function(n){return Uu(r,e,n)})},fm=[].slice,Tw=function(r,e){return r&&$i(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&$i(r[0]))&&!r.nodeType&&r!==es},uP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return zr(n)&&!e||Tw(n,1)?(i=t).push.apply(i,ui(n)):t.push(n)})||t},ui=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):zr(r)&&!t&&(nm||!Zl())?fm.call((e||im).querySelectorAll(r),0):$r(r)?uP(r,t):Tw(r)?fm.call(r,0):r?[r]:[]},pm=function(r){return r=ui(r)[0]||Ru("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return ui(e,t.querySelectorAll?t:t===r?Ru("Invalid scope")||im.createElement("div"):r)}},Bw=function(r){return r.sort(function(){return .5-Math.random()})},bw=function(r){if(cr(r))return r;var e=$i(r)?r:{each:r},t=xo(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,c=isNaN(n)||o,h=e.axis,u=n,d=n;return zr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&c&&(u=n[0],d=n[1]),function(A,p,g){var v=(g||e).length,E=s[v],m,_,w,x,I,R,M,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,oi])[1],!D){for(M=-oi;M<(M=g[D++].getBoundingClientRect().left)&&D<v;);D<v&&D--}for(E=s[v]=[],m=c?Math.min(D,v)*u-.5:n%D,_=D===oi?0:c?v*d/D-.5:n/D|0,M=0,T=oi,R=0;R<v;R++)w=R%D-m,x=_-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):ow(w*w+x*x),I>M&&(M=I),I<T&&(T=I);n==="random"&&Bw(E),E.max=M-T,E.min=T,E.v=v=(parseFloat(e.amount)||parseFloat(e.each)*(D>v?v-1:h?h==="y"?v/D:D:Math.max(D,v/D))||0)*(n==="edges"?-1:1),E.b=v<0?i-v:i,E.u=en(e.amount||e.each)||0,t=t&&v<0?Hw(t):t}return v=(E[A]-E.min)/E.max||0,Hr(E.b+(t?t(v):v)*E.v)+E.u}},Am=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=Hr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(bs(t)?0:en(t))}},Rw=function(r,e){var t=$r(r),n,i;return!t&&$i(r)&&(n=t=r.radius||oi,r.values?(r=ui(r.values),(i=!bs(r[0]))&&(n*=n)):r=Am(r.increment)),_a(e,t?cr(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),c=parseFloat(i?s.y:0),h=oi,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-c,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||bs(s)?u:u+en(s)}:Am(r))},Dw=function(r,e,t,n){return _a($r(r)?!e:t===!0?!!(t=0):!n,function(){return $r(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},hP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},dP=function(r,e){return function(t){return r(parseFloat(t))+(e||en(t))}},fP=function(r,e,t){return Nw(r,e,0,1,t)},Lw=function(r,e,t){return _a(t,function(n){return r[~~e(n)]})},pP=function r(e,t,n){var i=t-e;return $r(e)?Lw(e,r(0,e.length),t):_a(n,function(s){return(i+(s-e)%i)%i+e})},AP=function r(e,t,n){var i=t-e,s=i*2;return $r(e)?Lw(e,r(0,e.length-1),t):_a(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Pu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?hw:tm),t+=r.substr(e,n-e)+Dw(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},Nw=function(r,e,t,n,i){var s=e-r,o=n-t;return _a(i,function(c){return t+((c-r)/s*o||0)})},gP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=zr(e),c={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if($r(e)&&!$r(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var v=Math.min(p,~~g);return d[v](g-v)},n=t}else i||(e=yo($r(e)?[]:{},e));if(!d){for(h in t)vm.call(c,e,h,"get",t[h]);s=function(g){return Im(g,c)||(o?e.p:e)}}}return _a(n,s)},Uw=function(r,e,t){var n=r.labels,i=oi,s,o,c;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(c=s,i=o);return c},Xn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,c,h,u;if(i)return c=n[e+"Params"],h=n.callbackScope||r,t&&ga.length&&cf(),o&&($t=o),u=c?i.apply(h,c):i.call(h),$t=s,u},ku=function(r){return ma(r),r.scrollTrigger&&r.scrollTrigger.kill(!!Zr),r.progress()<1&&Xn(r,"onInterrupt"),r},Jl,Pw=[],kw=function(r){if(r)if(r=!r.name&&r.default||r,em()||r.headless){var e=r.name,t=cr(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Du,render:Im,add:vm,kill:DP,modifier:RP,rawVars:0},s={targetTest:0,get:0,getSetter:wm,aliases:{},register:0};if(Zl(),r!==n){if(qn[e])return;li(n,li(uf(r,i),s)),yo(n.prototype,yo(i,uf(r,s))),qn[n.prop=e]=n,r.targetTest&&(lf.push(n),am[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}pw(e,n),r.register&&r.register(Mn,n,Sn)}else Pw.push(r)},zt=255,Qu={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},gm=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},Qw=function(r,e,t){var n=r?bs(r)?[r>>16,r>>8&zt,r&zt]:0:Qu.black,i,s,o,c,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),Qu[r])n=Qu[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(tm),!e)c=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=gm(c+1/3,i,s),n[1]=gm(c,i,s),n[2]=gm(c-1/3,i,s);else if(~r.indexOf("="))return n=r.match(cw),t&&n.length<4&&(n[3]=1),n}else n=r.match(tm)||Qu.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?c=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),c=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,c*=60),n[0]=~~(c+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},Fw=function(r){var e=[],t=[],n=-1;return r.split(va).forEach(function(i){var s=i.match(Yl)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},Ow=function(r,e,t){var n="",i=(r+n).match(va),s=e?"hsla(":"rgba(",o=0,c,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=Qw(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=Fw(r),c=t.c,c.join(n)!==u.c.join(n)))for(h=r.replace(va,"1").split(Yl),d=h.length-1;o<d;o++)n+=h[o]+(~c.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(va),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},va=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Qu)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),mP=/hsl[a]?\(/,zw=function(r){var e=r.join(" "),t;if(va.lastIndex=0,va.test(e))return t=mP.test(e),r[1]=Ow(r[1],t),r[0]=Ow(r[0],t,Fw(r[1])),!0},Fu,Kn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,c=[],h,u,d,A,p,g,v=function E(m){var _=r()-i,w=m===!0,x,I,R,M;if((_>e||_<0)&&(n+=_-t),i+=_,R=i-n,x=R-o,(x>0||w)&&(M=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<c.length;g++)c[g](R,p,M,m)};return A={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){dw&&(!nm&&em()&&(es=nm=window,im=es.document||{},Yn.gsap=Mn,(es.gsapVersions||(es.gsapVersions=[])).push(Mn.version),fw(af||es.GreenSockGlobals||!es.gsap&&es||{}),Pw.forEach(kw)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Fu=1,v(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Fu=0,u=Du},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,_){var w=m?function(x,I,R,M){E(x,I,R,M),A.remove(w)}:E;return A.remove(E),c[_?"unshift":"push"](w),Zl(),w},remove:function(E,m){~(m=c.indexOf(E))&&c.splice(m,1)&&g>=m&&g--},_listeners:c},A}(),Zl=function(){return!Fu&&Kn.wake()},Ct={},_P=/^[\d.\-M][\d.\-,\s]/,vP=/["']/g,yP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,c,h;i<s;i++)c=t[i],o=i!==s-1?c.lastIndexOf(","):c.length,h=c.substr(0,o),e[n]=isNaN(h)?h.replace(vP,"").trim():+h,n=c.substr(o+1).trim();return e},EP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},xP=function(r){var e=(r+"").split("("),t=Ct[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[yP(e[1])]:EP(r).split(",").map(vw)):Ct._CE&&_P.test(r)?Ct._CE("",r):t},Hw=function(r){return function(e){return 1-r(1-e)}},Gw=function r(e,t){for(var n=e._first,i;n;)n instanceof pn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},xo=function(r,e){return r&&(cr(r)?r:Ct[r]||xP(r))||e},wo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return Cn(r,function(o){Ct[o]=Yn[o]=i,Ct[s=o.toLowerCase()]=t;for(var c in i)Ct[s+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ct[o+"."+c]=i[c]}),i},Vw=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},mm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/Zg*(Math.asin(1/i)||0),c=function(u){return u===1?1:i*Math.pow(2,-10*u)*KU((u-o)*s)+1},h=e==="out"?c:e==="in"?function(u){return 1-c(1-u)}:Vw(c);return s=Zg/s,h.config=function(u,d){return r(e,u,d)},h},_m=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:Vw(n);return i.config=function(s){return r(e,s)},i};Cn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;wo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Ct.Linear.easeNone=Ct.none=Ct.Linear.easeIn,wo("Elastic",mm("in"),mm("out"),mm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};wo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),wo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),wo("Circ",function(r){return-(ow(1-r*r)-1)}),wo("Sine",function(r){return r===1?1:-XU(r*YU)+1}),wo("Back",_m("in"),_m("out"),_m()),Ct.SteppedEase=Ct.steps=Yn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Uu(0,s,o)|0)+i)*t}}},Wl.ease=Ct["quad.out"],Cn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return cm+=r+","+r+"Params,"});var jw=function(r,e){this.id=qU++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:mw,this.set=e?e.getSetter:wm},Ou=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Kl(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Fu||Kn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Kl(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(Zl(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(pf(this,t),!i._dp||i.parent||Iw(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&ts(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),_w(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+ww(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+ww(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?Xl(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?df(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Uu(-Math.abs(this._delay),this._tDur,i),n!==!1),ff(this),nP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Zl(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&ts(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(In(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?df(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=$U);var n=Zr;return Zr=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),Zr=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Mw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,Mw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(ci(this,t),In(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,In(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=cr(t)?t:yw,o=function(){var c=n.then;n.then=null,cr(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=c),i(s),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){ku(this)},r}();li(Ou.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var pn=function(r){aw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=In(n.sortChildren),nr&&ts(n.parent||nr,Bs(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Cw(Bs(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Nu(0,arguments,this),this},t.from=function(n,i,s){return Nu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Nu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,Lu(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ir(n,i,ci(this,s),1),this},t.call=function(n,i,s){return ts(this,Ir.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,c,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new Ir(n,s,ci(this,c)),this},t.staggerFrom=function(n,i,s,o,c,h,u){return s.runBackwards=1,Lu(s).immediateRender=In(s.immediateRender),this.staggerTo(n,i,s,o,c,h,u)},t.staggerFromTo=function(n,i,s,o,c,h,u,d){return o.startAt=s,Lu(o).immediateRender=In(o.immediateRender),this.staggerTo(n,i,o,c,h,u,d)},t.render=function(n,i,s){var o=this._time,c=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:Hr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,v,E,m,_,w,x,I,R,M;if(this!==nr&&u>c&&n>=0&&(u=c),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=Hr(u%E),u===c?(v=this._repeat,A=h):(v=~~(u/E),v&&v===u/E&&(A=h,v--),A>h&&(A=h)),I=Xl(this._tTime,E),!o&&this._tTime&&I!==v&&this._tTime-I*E-this._dur<=0&&(I=v),R&&v&1&&(A=h-A,M=1),v!==I&&!this._lock){var T=R&&I&1,D=T===(R&&v&1);if(v<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(M?0:Hr(v*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&Xn(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,c=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;Gw(this,M)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=oP(this,Hr(o),Hr(A)),_&&(u-=A-(A=_._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!v&&(Xn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||Zr&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(_&&!i&&(this.pause(),_.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,ff(this),this.render(n,i,s);this._onUpdate&&!i&&Xn(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===c&&this._ts>0||!u&&this._ts<0)&&ma(this,1),!i&&!(n<0&&!o)&&(u||o||!c)&&(Xn(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(bs(i)||(i=ci(this,i,n)),!(n instanceof Ou)){if($r(n))return n.forEach(function(o){return s.add(o,i)}),this;if(zr(n))return this.addLabel(n,i);if(cr(n))n=Ir.delayedCall(0,n);else return this}return this!==n?ts(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-oi);for(var c=[],h=this._first;h;)h._start>=o&&(h instanceof Ir?i&&c.push(h):(s&&c.push(h),n&&c.push.apply(c,h.getChildren(!0,i,s)))),h=h._next;return c},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return zr(n)?this.removeLabel(n):cr(n)?this.killTweensOf(n):(hf(this,n),n===this._recent&&(this._recent=this._last),Eo(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Hr(Kn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=ci(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=Ir.delayedCall(0,i||Du,s);return o.data="isPause",this._hasPause=1,ts(this,o,ci(this,n))},t.removePause=function(n){var i=this._first;for(n=ci(this,n);i;)i._start===n&&i.data==="isPause"&&ma(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),c=o.length;c--;)ya!==o[c]&&o[c].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=ui(n),c=this._first,h=bs(i),u;c;)c instanceof Ir?eP(c._targets,o)&&(h?(!ya||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&s.push(c):(u=c.getTweensOf(o,i)).length&&s.push.apply(s,u),c=c._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=ci(s,n),c=i,h=c.startAt,u=c.onStart,d=c.onStartParams,A=c.immediateRender,p,g=Ir.to(s,li({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var v=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==v&&Kl(g,v,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,li({startAt:{time:ci(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Uw(this,ci(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Uw(this,ci(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,c=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in c)c[h]>=s&&(c[h]+=n);return Eo(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Eo(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,c=oi,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>c&&s._sort&&o._ts&&!s._lock?(s._lock=1,ts(s,o,u-o._delay,1)._lock=0):c=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),c=0),o._end>i&&o._ts&&(i=o._end),o=h;Kl(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(_w(nr,df(n,nr)),Aw=Kn.frame),Kn.frame>=gw){gw+=Wn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&Wn.autoSleep&&Kn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Kn.sleep()}}},e}(Ou);li(pn.prototype,{_lock:0,_hasPause:0,_forcing:0});var wP=function(r,e,t,n,i,s,o){var c=new Sn(this._pt,r,e,0,1,Jw,null,i),h=0,u=0,d,A,p,g,v,E,m,_;for(c.b=t,c.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Pu(n)),s&&(_=[t,n],s(_,r,e),t=_[0],n=_[1]),A=t.match(rm)||[];d=rm.exec(n);)g=d[0],v=n.substring(h,d.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,c._pt={_next:c._pt,p:v||u===1?v:",",s:E,c:g.charAt(1)==="="?ql(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=rm.lastIndex);return c.c=h<n.length?n.substring(h,n.length):"",c.fp=o,(uw.test(n)||m)&&(c.e=0),this._pt=c,c},vm=function(r,e,t,n,i,s,o,c,h,u){cr(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:cr(d)?h?r[e.indexOf("set")||!cr(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=cr(d)?h?TP:Xw:xm,g;if(zr(n)&&(~n.indexOf("random(")&&(n=Pu(n)),n.charAt(1)==="="&&(g=ql(A,n)+(en(A)||0),(g||g===0)&&(n=g))),!u||A!==n||ym)return!isNaN(A*n)&&n!==""?(g=new Sn(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?bP:Kw,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&sm(e,n),wP.call(this,r,e,A,n,p,c||Wn.stringFilter,h))},IP=function(r,e,t,n,i){if(cr(r)&&(r=zu(r,i,e,t,n)),!$i(r)||r.style&&r.nodeType||$r(r)||lw(r))return zr(r)?zu(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=zu(r[o],i,e,t,n);return s},Ww=function(r,e,t,n,i,s){var o,c,h,u;if(qn[r]&&(o=new qn[r]).init(i,o.rawVars?e[r]:IP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=c=new Sn(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==Jl))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=c;return o},ya,ym,Em=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,c=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,v=e._dur,E=e._startAt,m=e._targets,_=e.parent,w=_&&_.data==="nested"?_.vars.targets:m,x=e._overwrite==="auto"&&!Jg,I=e.timeline,R,M,T,D,b,S,L,P,N,W,X,K,te;if(I&&(!p||!s)&&(s="none"),e._ease=xo(s,Wl.ease),e._yEase=A?Hw(xo(A===!0?s:A,Wl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?vo(m[0]).harness:0,K=P&&i[P.prop],R=uf(i,am),E&&(E._zTime<0&&E.progress(1),t<0&&d&&c&&!g?E.render(-1,!0):E.revert(d&&v?of:ZU),E._lazy=0),o){if(ma(e._startAt=Ir.set(m,li({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!E&&In(h),startAt:null,delay:0,onUpdate:u&&function(){return Xn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Zr||!c&&!g)&&e._startAt.revert(of),c&&v&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&v&&!E){if(t&&(c=!1),T=li({overwrite:!1,data:"isFromStart",lazy:c&&!E&&In(h),immediateRender:c,stagger:0,parent:_},R),K&&(T[P.prop]=K),ma(e._startAt=Ir.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Zr?e._startAt.revert(of):e._startAt.render(-1,!0)),e._zTime=t,!c)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=v&&In(h)||h&&!v,M=0;M<m.length;M++){if(b=m[M],L=b._gsap||um(m)[M]._gsap,e._ptLookup[M]=W={},om[L.id]&&ga.length&&cf(),X=w===m?M:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new Sn(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(H){W[H]=D}),N.priority&&(S=1)),!P||K)for(T in R)qn[T]&&(N=Ww(T,R,e,X,b,w))?N.priority&&(S=1):W[T]=D=vm.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[M]&&e.kill(b,e._op[M]),x&&e._pt&&(ya=e,nr.killTweensOf(b,W,e.globalTime(t)),te=!e.parent,ya=0),e._pt&&h&&(om[L.id]=1)}S&&Zw(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!te,p&&t<=0&&I.render(oi,!0,!0)},CP=function(r,e,t,n,i,s,o,c){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return ym=1,r.vars[e]="+=0",Em(r,o),ym=0,c?Ru(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=mr(t)+en(d.e)),d.b&&(d.b=u.s+en(d.b))},SP=function(r,e){var t=r[0]?vo(r[0]).harness:0,n=t&&t.aliases,i,s,o,c;if(!n)return e;i=yo({},e);for(s in n)if(s in i)for(c=n[s].split(","),o=c.length;o--;)i[c[o]]=i[s];return i},MP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if($r(e))o=t[r]||(t[r]=[]),e.forEach(function(c,h){return o.push({t:h/(e.length-1)*100,v:c,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},zu=function(r,e,t,n,i){return cr(r)?r.call(e,t,n,i):zr(r)&&~r.indexOf("random(")?Pu(r):r},Yw=cm+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",qw={};Cn(Yw+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return qw[r]=1});var Ir=function(r){aw(e,r);function e(n,i,s,o){var c;typeof i=="number"&&(s.duration=i,i=s,s=null),c=r.call(this,o?i:Lu(i))||this;var h=c.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,v=h.keyframes,E=h.defaults,m=h.scrollTrigger,_=h.yoyoEase,w=i.parent||nr,x=($r(n)||lw(n)?bs(n[0]):"length"in i)?[n]:ui(n),I,R,M,T,D,b,S,L;if(c._targets=x.length?um(x):Ru("GSAP target "+n+" not found. https://gsap.com",!Wn.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=g,v||p||sf(u)||sf(d)){if(i=c.vars,I=c.timeline=new pn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=Bs(c),I._start=0,p||sf(u)||sf(d)){if(T=x.length,S=p&&bw(p),$i(p))for(D in p)~Yw.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)M=uf(i,qw),M.stagger=0,_&&(M.yoyoEase=_),L&&yo(M,L),b=x[R],M.duration=+zu(u,Bs(c),R,b,x),M.delay=(+zu(d,Bs(c),R,b,x)||0)-c._delay,!p&&T===1&&M.delay&&(c._delay=d=M.delay,c._start+=d,M.delay=0),I.to(b,M,S?S(R,b,x):0),I._ease=Ct.none;I.duration()?u=d=0:c.timeline=0}else if(v){Lu(li(I.vars.defaults,{ease:"none"})),I._ease=xo(v.ease||i.ease||"none");var P=0,N,W,X;if($r(v))v.forEach(function(K){return I.to(x,K,">")}),I.duration();else{M={};for(D in v)D==="ease"||D==="easeEach"||MP(D,v[D],M,v.easeEach);for(D in M)for(N=M[D].sort(function(K,te){return K.t-te.t}),P=0,R=0;R<N.length;R++)W=N[R],X={ease:W.e,duration:(W.t-(R?N[R-1].t:0))/100*u},X[D]=W.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||c.duration(u=I.duration())}else c.timeline=0;return g===!0&&!Jg&&(ya=Bs(c),nr.killTweensOf(x),ya=0),ts(w,Bs(c),s),i.reversed&&c.reverse(),i.paused&&c.paused(!0),(A||!u&&!v&&c._start===Hr(w._time)&&In(A)&&iP(Bs(c))&&w.data!=="nested")&&(c._tTime=-Gt,c.render(Math.max(0,-d)||0)),m&&Cw(Bs(c),m),c}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,c=this._tDur,h=this._dur,u=n<0,d=n>c-Gt&&!u?c:n<Gt?0:n,A,p,g,v,E,m,_,w,x;if(!h)aP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(v=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(v*100+n,i,s);if(A=Hr(d%v),d===c?(g=this._repeat,A=h):(g=~~(d/v),g&&g===Hr(d/v)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=Xl(this._tTime,v),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&Gw(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==v&&this._initted&&(this._lock=s=1,this.render(Hr(v*g),!0).invalidate()._lock=0))}if(!this._initted){if(Sw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(x||this._ease)(A/h),this._from&&(this.ratio=_=1-_),A&&!o&&!i&&!g&&(Xn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(_,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&hm(this,n,i,s),Xn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&Xn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&hm(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ma(this,1),!i&&!(u&&!o)&&(d||o||m)&&(Xn(this,d===c?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,c){Fu||Kn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Em(this,h),u=this._ease(h/this._dur),CP(this,n,i,s,o,u,h,c)?this.resetTo(n,i,s,o,1):(pf(this,0),this.parent||xw(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?ku(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,ya&&ya.vars.overwrite!==!0)._first||ku(this),this.parent&&s!==this.timeline.totalDuration()&&Kl(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,c=n?ui(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,v,E,m;if((!i||i==="all")&&rP(o,c))return i==="all"&&(this._pt=0),ku(this);for(d=this._op=this._op||[],i!=="all"&&(zr(i)&&(v={},Cn(i,function(_){return v[_]=1}),i=v),i=SP(o,i)),m=o.length;m--;)if(~c.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(v in g)E=A&&A[v],E&&((!("kill"in E.d)||E.d.kill(v)===!0)&&hf(this,E,"_pt"),delete A[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&u&&ku(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Nu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Nu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Ou);li(Ir.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Cn("staggerTo,staggerFrom,staggerFromTo",function(r){Ir[r]=function(){var e=new pn,t=fm.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var xm=function(r,e,t){return r[e]=t},Xw=function(r,e,t){return r[e](t)},TP=function(r,e,t,n){return r[e](n.fp,t)},BP=function(r,e,t){return r.setAttribute(e,t)},wm=function(r,e){return cr(r[e])?Xw:$g(r[e])&&r.setAttribute?BP:xm},Kw=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},bP=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},Jw=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},Im=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},RP=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},DP=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?hf(this,e,"_pt"):e.dep||(t=1),e=n;return!t},LP=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},Zw=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},Sn=function(){function r(t,n,i,s,o,c,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=c||Kw,this.d=h||this,this.set=u||xm,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=LP,this.m=t,this.mt=i,this.tween=n},r}();Cn(cm+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return am[r]=1}),Yn.TweenMax=Yn.TweenLite=Ir,Yn.TimelineLite=Yn.TimelineMax=pn,nr=new pn({sortChildren:!1,defaults:Wl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Wn.stringFilter=zw;var Io=[],Af={},NP=[],$w=0,UP=0,Cm=function(r){return(Af[r]||NP).map(function(e){return e()})},Sm=function(){var r=Date.now(),e=[];r-$w>2&&(Cm("matchMediaInit"),Io.forEach(function(t){var n=t.queries,i=t.conditions,s,o,c,h;for(o in n)s=es.matchMedia(n[o]).matches,s&&(c=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),c&&e.push(t))}),Cm("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),$w=r,Cm("matchMedia"))},eI=function(){function r(t,n){this.selector=n&&pm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=UP++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){cr(t)&&(i=n,n=t,t=cr);var s=this,o=function(){var c=$t,h=s.selector,u;return c&&c!==s&&c.data.push(s),i&&(s.selector=pm(i)),$t=s,u=n.apply(s,arguments),cr(u)&&s._r.push(u),$t=c,s.selector=h,s.isReverted=!1,u};return s.last=o,t===cr?o(s,function(c){return s.add(null,c)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof Ir&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),c=i.data.length,h;c--;)h=i.data[c],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),c=i.data.length;c--;)h=i.data[c],h instanceof pn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Ir)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=Io.length;s--;)Io[s].id===this.id&&Io.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),PP=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){$i(t)||(t={matches:t});var s=new eI(0,i||this.scope),o=s.conditions={},c,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(c=es.matchMedia(t[h]),c&&(Io.indexOf(s)<0&&Io.push(s),(o[h]=c.matches)&&(u=1),c.addListener?c.addListener(Sm):c.addEventListener("change",Sm)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),gf={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return kw(n)})},timeline:function(r){return new pn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){zr(r)&&(r=ui(r)[0]);var i=vo(r||{}).get,s=t?yw:vw;return t==="native"&&(t=""),r&&(e?s((qn[e]&&qn[e].get||i)(r,e,t,n)):function(o,c,h){return s((qn[o]&&qn[o].get||i)(r,o,c,h))})},quickSetter:function(r,e,t){if(r=ui(r),r.length>1){var n=r.map(function(u){return Mn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=qn[e],o=vo(r),c=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;Jl._pt=0,d.init(r,t?u+t:u,Jl,0,[r]),d.render(1,d),Jl._pt&&Im(1,Jl)}:o.set(r,c);return s?h:function(u){return h(r,c,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Mn.to(r,yo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,c,h){return i.resetTo(e,o,c,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=xo(r.ease,Wl.ease)),Ew(Wl,r||{})},config:function(r){return Ew(Wn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!qn[o]&&!Yn[o]&&Ru(e+" effect requires "+o+" plugin.")}),lm[e]=function(o,c,h){return t(ui(o),li(c||{},i),h)},s&&(pn.prototype[e]=function(o,c,h){return this.add(lm[e](o,$i(c)?c:(h=c)&&{},this),h)})},registerEase:function(r,e){Ct[r]=xo(e)},parseEase:function(r,e){return arguments.length?xo(r,e):Ct},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new pn(r),n,i;for(t.smoothChildTiming=In(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof Ir&&n.vars.onComplete===n._targets[0]))&&ts(t,n,n._start-n._delay),n=i;return ts(nr,t,0),t},context:function(r,e){return r?new eI(r,e):$t},matchMedia:function(r){return new PP(r)},matchMediaRefresh:function(){return Io.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||Sm()},addEventListener:function(r,e){var t=Af[r]||(Af[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=Af[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:pP,wrapYoyo:AP,distribute:bw,random:Dw,snap:Rw,normalize:fP,getUnit:en,clamp:cP,splitColor:Qw,toArray:ui,selector:pm,mapRange:Nw,pipe:hP,unitize:dP,interpolate:gP,shuffle:Bw},install:fw,effects:lm,ticker:Kn,updateRoot:pn.updateRoot,plugins:qn,globalTimeline:nr,core:{PropTween:Sn,globals:pw,Tween:Ir,Timeline:pn,Animation:Ou,getCache:vo,_removeLinkedListItem:hf,reverting:function(){return Zr},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return Jg=r}}};Cn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return gf[r]=Ir[r]}),Kn.add(pn.updateRoot),Jl=gf.to({},{duration:0});var kP=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},QP=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=kP(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Mm=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,c;if(zr(n)&&(o={},Cn(n,function(h){return o[h]=1}),n=o),e){o={};for(c in n)o[c]=e(n[c]);n=o}QP(s,n)}}}},Mn=gf.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,c;this.tween=t;for(s in e)c=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(c||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=c,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)Zr?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Mm("roundProps",Am),Mm("modifiers"),Mm("snap",Rw))||gf;Ir.version=pn.version=Mn.version="3.12.5",dw=1,em()&&Zl(),Ct.Power0,Ct.Power1,Ct.Power2,Ct.Power3,Ct.Power4,Ct.Linear,Ct.Quad,Ct.Cubic,Ct.Quart,Ct.Quint,Ct.Strong,Ct.Elastic,Ct.Back,Ct.SteppedEase,Ct.Bounce,Ct.Sine,Ct.Expo,Ct.Circ;/*!
|
|
4409
|
+
*/var Wn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Yl={duration:.5,overwrite:!1,delay:0},Jg,Zr,$t,oi=1e8,Gt=1/oi,Zg=Math.PI*2,YU=Zg/4,qU=0,ow=Math.sqrt,XU=Math.cos,KU=Math.sin,zr=function(r){return typeof r=="string"},cr=function(r){return typeof r=="function"},bs=function(r){return typeof r=="number"},$g=function(r){return typeof r>"u"},$i=function(r){return typeof r=="object"},In=function(r){return r!==!1},em=function(){return typeof window<"u"},af=function(r){return cr(r)||zr(r)},lw=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},$r=Array.isArray,tm=/(?:-?\.?\d|\.)+/gi,cw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ql=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,rm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,uw=/[+-]=-?[.\d]+/,hw=/[^,'"\[\]\s]+/gi,JU=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,es,nm,im,Yn={},of={},dw,fw=function(r){return(of=yo(r,Yn))&&Mn},sm=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},Ru=function(r,e){return!e&&console.warn(r)},pw=function(r,e){return r&&(Yn[r]=e)&&of&&(of[r]=e)||Yn},Du=function(){return 0},ZU={suppressEvents:!0,isStart:!0,kill:!1},lf={suppressEvents:!0,kill:!1},$U={suppressEvents:!0},am={},ga=[],om={},Aw,qn={},lm={},gw=30,cf=[],cm="",um=function(r){var e=r[0],t,n;if($i(e)||cr(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=cf.length;n--&&!cf[n].targetTest(e););t=cf[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new jw(r[n],t)))||r.splice(n,1);return r},vo=function(r){return r._gsap||um(ui(r))[0]._gsap},mw=function(r,e,t){return(t=r[e])&&cr(t)?r[e]():$g(t)&&r.getAttribute&&r.getAttribute(e)||t},Cn=function(r,e){return(r=r.split(",")).forEach(e)||r},mr=function(r){return Math.round(r*1e5)/1e5||0},Hr=function(r){return Math.round(r*1e7)/1e7||0},Xl=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},eP=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},uf=function(){var r=ga.length,e=ga.slice(0),t,n;for(om={},ga.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},_w=function(r,e,t,n){ga.length&&!Zr&&uf(),r.render(e,t,n||Zr&&e<0&&(r._initted||r._startAt)),ga.length&&!Zr&&uf()},vw=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(hw).length<2?e:zr(r)?r.trim():r},yw=function(r){return r},li=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},tP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},yo=function(r,e){for(var t in e)r[t]=e[t];return r},Ew=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=$i(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},hf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},Lu=function(r){var e=r.parent||nr,t=r.keyframes?tP($r(r.keyframes)):li;if(In(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},rP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},xw=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},df=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ma=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},Eo=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},nP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},hm=function(r,e,t,n){return r._startAt&&(Zr?r._startAt.revert(lf):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},iP=function r(e){return!e||e._ts&&r(e.parent)},ww=function(r){return r._repeat?Kl(r._tTime,r=r.duration()+r._rDelay)*r:0},Kl=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},ff=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},pf=function(r){return r._end=Hr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},Af=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=Hr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),pf(r),t._dirty||Eo(t,r)),r},Iw=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=ff(r.rawTime(),e),(!e._dur||Uu(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),Eo(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},ts=function(r,e,t,n){return e.parent&&ma(e),e._start=Hr((bs(t)?t:t||r!==nr?ci(r,t,e):r._time)+e._delay),e._end=Hr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),xw(r,e,"_first","_last",r._sort?"_start":0),dm(e)||(r._recent=e),n||Iw(r,e),r._ts<0&&Af(r,r._tTime),r},Cw=function(r,e){return(Yn.ScrollTrigger||sm("scrollTrigger",e))&&Yn.ScrollTrigger.create(e,r)},Sw=function(r,e,t,n,i){if(Em(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!Zr&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&Aw!==Kn.frame)return ga.push(r),r._lazy=[i,n],1},sP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},dm=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},aP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&sP(r)&&!(!r._initted&&dm(r))||(r._ts<0||r._dp._ts<0)&&!dm(r))?0:1,o=r._rDelay,c=0,h,u,d;if(o&&r._repeat&&(c=Uu(0,r._tDur,e),u=Kl(c,o),r._yoyo&&u&1&&(s=1-s),u!==Kl(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||Zr||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Sw(r,e,n,t,c))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=c,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&hm(r,e,t,!0),r._onUpdate&&!t&&Xn(r,"onUpdate"),c&&r._repeat&&!t&&r.parent&&Xn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ma(r,1),!t&&!Zr&&(Xn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},oP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},Jl=function(r,e,t,n){var i=r._repeat,s=Hr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:Hr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&Af(r,r._tTime=r._tDur*o),r.parent&&pf(r),t||Eo(r.parent,r),r},Mw=function(r){return r instanceof pn?Eo(r):Jl(r,r._dur)},lP={_start:0,endTime:Du,totalDuration:Du},ci=function r(e,t,n){var i=e.labels,s=e._recent||lP,o=e.duration()>=oi?s.endTime(!1):e._dur,c,h,u;return zr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",c=t.indexOf("="),h==="<"||h===">"?(c>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(c<0?s:n).totalDuration()/100:1)):c<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(c-1)+t.substr(c+1)),u&&n&&(h=h/100*($r(n)?n[0]:n).totalDuration()),c>1?r(e,t.substr(0,c-1),n)+h:o+h)):t==null?o:+t},Nu=function(r,e,t){var n=bs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,c;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,c=t;c&&!("immediateRender"in o);)o=c.vars.defaults||{},c=In(c.vars.inherit)&&c.parent;s.immediateRender=In(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new Ir(e[0],s,e[i+1])},_a=function(r,e){return r||r===0?e(r):e},Uu=function(r,e,t){return t<r?r:t>e?e:t},en=function(r,e){return!zr(r)||!(e=JU.exec(r))?"":e[1]},cP=function(r,e,t){return _a(t,function(n){return Uu(r,e,n)})},fm=[].slice,Tw=function(r,e){return r&&$i(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&$i(r[0]))&&!r.nodeType&&r!==es},uP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return zr(n)&&!e||Tw(n,1)?(i=t).push.apply(i,ui(n)):t.push(n)})||t},ui=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):zr(r)&&!t&&(nm||!$l())?fm.call((e||im).querySelectorAll(r),0):$r(r)?uP(r,t):Tw(r)?fm.call(r,0):r?[r]:[]},pm=function(r){return r=ui(r)[0]||Ru("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return ui(e,t.querySelectorAll?t:t===r?Ru("Invalid scope")||im.createElement("div"):r)}},Bw=function(r){return r.sort(function(){return .5-Math.random()})},bw=function(r){if(cr(r))return r;var e=$i(r)?r:{each:r},t=xo(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,c=isNaN(n)||o,h=e.axis,u=n,d=n;return zr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&c&&(u=n[0],d=n[1]),function(A,p,g){var v=(g||e).length,E=s[v],m,_,w,x,I,R,M,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,oi])[1],!D){for(M=-oi;M<(M=g[D++].getBoundingClientRect().left)&&D<v;);D<v&&D--}for(E=s[v]=[],m=c?Math.min(D,v)*u-.5:n%D,_=D===oi?0:c?v*d/D-.5:n/D|0,M=0,T=oi,R=0;R<v;R++)w=R%D-m,x=_-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):ow(w*w+x*x),I>M&&(M=I),I<T&&(T=I);n==="random"&&Bw(E),E.max=M-T,E.min=T,E.v=v=(parseFloat(e.amount)||parseFloat(e.each)*(D>v?v-1:h?h==="y"?v/D:D:Math.max(D,v/D))||0)*(n==="edges"?-1:1),E.b=v<0?i-v:i,E.u=en(e.amount||e.each)||0,t=t&&v<0?Hw(t):t}return v=(E[A]-E.min)/E.max||0,Hr(E.b+(t?t(v):v)*E.v)+E.u}},Am=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=Hr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(bs(t)?0:en(t))}},Rw=function(r,e){var t=$r(r),n,i;return!t&&$i(r)&&(n=t=r.radius||oi,r.values?(r=ui(r.values),(i=!bs(r[0]))&&(n*=n)):r=Am(r.increment)),_a(e,t?cr(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),c=parseFloat(i?s.y:0),h=oi,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-c,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||bs(s)?u:u+en(s)}:Am(r))},Dw=function(r,e,t,n){return _a($r(r)?!e:t===!0?!!(t=0):!n,function(){return $r(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},hP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},dP=function(r,e){return function(t){return r(parseFloat(t))+(e||en(t))}},fP=function(r,e,t){return Nw(r,e,0,1,t)},Lw=function(r,e,t){return _a(t,function(n){return r[~~e(n)]})},pP=function r(e,t,n){var i=t-e;return $r(e)?Lw(e,r(0,e.length),t):_a(n,function(s){return(i+(s-e)%i)%i+e})},AP=function r(e,t,n){var i=t-e,s=i*2;return $r(e)?Lw(e,r(0,e.length-1),t):_a(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Pu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?hw:tm),t+=r.substr(e,n-e)+Dw(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},Nw=function(r,e,t,n,i){var s=e-r,o=n-t;return _a(i,function(c){return t+((c-r)/s*o||0)})},gP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=zr(e),c={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if($r(e)&&!$r(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var v=Math.min(p,~~g);return d[v](g-v)},n=t}else i||(e=yo($r(e)?[]:{},e));if(!d){for(h in t)vm.call(c,e,h,"get",t[h]);s=function(g){return Im(g,c)||(o?e.p:e)}}}return _a(n,s)},Uw=function(r,e,t){var n=r.labels,i=oi,s,o,c;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(c=s,i=o);return c},Xn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,c,h,u;if(i)return c=n[e+"Params"],h=n.callbackScope||r,t&&ga.length&&uf(),o&&($t=o),u=c?i.apply(h,c):i.call(h),$t=s,u},ku=function(r){return ma(r),r.scrollTrigger&&r.scrollTrigger.kill(!!Zr),r.progress()<1&&Xn(r,"onInterrupt"),r},Zl,Pw=[],kw=function(r){if(r)if(r=!r.name&&r.default||r,em()||r.headless){var e=r.name,t=cr(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Du,render:Im,add:vm,kill:DP,modifier:RP,rawVars:0},s={targetTest:0,get:0,getSetter:wm,aliases:{},register:0};if($l(),r!==n){if(qn[e])return;li(n,li(hf(r,i),s)),yo(n.prototype,yo(i,hf(r,s))),qn[n.prop=e]=n,r.targetTest&&(cf.push(n),am[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}pw(e,n),r.register&&r.register(Mn,n,Sn)}else Pw.push(r)},zt=255,Qu={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},gm=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},Qw=function(r,e,t){var n=r?bs(r)?[r>>16,r>>8&zt,r&zt]:0:Qu.black,i,s,o,c,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),Qu[r])n=Qu[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(tm),!e)c=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=gm(c+1/3,i,s),n[1]=gm(c,i,s),n[2]=gm(c-1/3,i,s);else if(~r.indexOf("="))return n=r.match(cw),t&&n.length<4&&(n[3]=1),n}else n=r.match(tm)||Qu.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?c=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),c=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,c*=60),n[0]=~~(c+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},Fw=function(r){var e=[],t=[],n=-1;return r.split(va).forEach(function(i){var s=i.match(ql)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},Ow=function(r,e,t){var n="",i=(r+n).match(va),s=e?"hsla(":"rgba(",o=0,c,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=Qw(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=Fw(r),c=t.c,c.join(n)!==u.c.join(n)))for(h=r.replace(va,"1").split(ql),d=h.length-1;o<d;o++)n+=h[o]+(~c.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(va),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},va=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Qu)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),mP=/hsl[a]?\(/,zw=function(r){var e=r.join(" "),t;if(va.lastIndex=0,va.test(e))return t=mP.test(e),r[1]=Ow(r[1],t),r[0]=Ow(r[0],t,Fw(r[1])),!0},Fu,Kn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,c=[],h,u,d,A,p,g,v=function E(m){var _=r()-i,w=m===!0,x,I,R,M;if((_>e||_<0)&&(n+=_-t),i+=_,R=i-n,x=R-o,(x>0||w)&&(M=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<c.length;g++)c[g](R,p,M,m)};return A={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){dw&&(!nm&&em()&&(es=nm=window,im=es.document||{},Yn.gsap=Mn,(es.gsapVersions||(es.gsapVersions=[])).push(Mn.version),fw(of||es.GreenSockGlobals||!es.gsap&&es||{}),Pw.forEach(kw)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Fu=1,v(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Fu=0,u=Du},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,_){var w=m?function(x,I,R,M){E(x,I,R,M),A.remove(w)}:E;return A.remove(E),c[_?"unshift":"push"](w),$l(),w},remove:function(E,m){~(m=c.indexOf(E))&&c.splice(m,1)&&g>=m&&g--},_listeners:c},A}(),$l=function(){return!Fu&&Kn.wake()},Ct={},_P=/^[\d.\-M][\d.\-,\s]/,vP=/["']/g,yP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,c,h;i<s;i++)c=t[i],o=i!==s-1?c.lastIndexOf(","):c.length,h=c.substr(0,o),e[n]=isNaN(h)?h.replace(vP,"").trim():+h,n=c.substr(o+1).trim();return e},EP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},xP=function(r){var e=(r+"").split("("),t=Ct[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[yP(e[1])]:EP(r).split(",").map(vw)):Ct._CE&&_P.test(r)?Ct._CE("",r):t},Hw=function(r){return function(e){return 1-r(1-e)}},Gw=function r(e,t){for(var n=e._first,i;n;)n instanceof pn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},xo=function(r,e){return r&&(cr(r)?r:Ct[r]||xP(r))||e},wo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return Cn(r,function(o){Ct[o]=Yn[o]=i,Ct[s=o.toLowerCase()]=t;for(var c in i)Ct[s+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ct[o+"."+c]=i[c]}),i},Vw=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},mm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/Zg*(Math.asin(1/i)||0),c=function(u){return u===1?1:i*Math.pow(2,-10*u)*KU((u-o)*s)+1},h=e==="out"?c:e==="in"?function(u){return 1-c(1-u)}:Vw(c);return s=Zg/s,h.config=function(u,d){return r(e,u,d)},h},_m=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:Vw(n);return i.config=function(s){return r(e,s)},i};Cn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;wo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Ct.Linear.easeNone=Ct.none=Ct.Linear.easeIn,wo("Elastic",mm("in"),mm("out"),mm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};wo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),wo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),wo("Circ",function(r){return-(ow(1-r*r)-1)}),wo("Sine",function(r){return r===1?1:-XU(r*YU)+1}),wo("Back",_m("in"),_m("out"),_m()),Ct.SteppedEase=Ct.steps=Yn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Uu(0,s,o)|0)+i)*t}}},Yl.ease=Ct["quad.out"],Cn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return cm+=r+","+r+"Params,"});var jw=function(r,e){this.id=qU++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:mw,this.set=e?e.getSetter:wm},Ou=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Jl(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Fu||Kn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Jl(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if($l(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Af(this,t),!i._dp||i.parent||Iw(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&ts(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),_w(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+ww(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+ww(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?Kl(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?ff(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Uu(-Math.abs(this._delay),this._tDur,i),n!==!1),pf(this),nP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):($l(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&ts(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(In(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ff(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=$U);var n=Zr;return Zr=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),Zr=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Mw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,Mw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(ci(this,t),In(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,In(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=cr(t)?t:yw,o=function(){var c=n.then;n.then=null,cr(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=c),i(s),n.then=c};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){ku(this)},r}();li(Ou.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var pn=function(r){aw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=In(n.sortChildren),nr&&ts(n.parent||nr,Bs(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Cw(Bs(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Nu(0,arguments,this),this},t.from=function(n,i,s){return Nu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Nu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,Lu(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ir(n,i,ci(this,s),1),this},t.call=function(n,i,s){return ts(this,Ir.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,c,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new Ir(n,s,ci(this,c)),this},t.staggerFrom=function(n,i,s,o,c,h,u){return s.runBackwards=1,Lu(s).immediateRender=In(s.immediateRender),this.staggerTo(n,i,s,o,c,h,u)},t.staggerFromTo=function(n,i,s,o,c,h,u,d){return o.startAt=s,Lu(o).immediateRender=In(o.immediateRender),this.staggerTo(n,i,o,c,h,u,d)},t.render=function(n,i,s){var o=this._time,c=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:Hr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,v,E,m,_,w,x,I,R,M;if(this!==nr&&u>c&&n>=0&&(u=c),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=Hr(u%E),u===c?(v=this._repeat,A=h):(v=~~(u/E),v&&v===u/E&&(A=h,v--),A>h&&(A=h)),I=Kl(this._tTime,E),!o&&this._tTime&&I!==v&&this._tTime-I*E-this._dur<=0&&(I=v),R&&v&1&&(A=h-A,M=1),v!==I&&!this._lock){var T=R&&I&1,D=T===(R&&v&1);if(v<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(M?0:Hr(v*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&Xn(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,c=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;Gw(this,M)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(_=oP(this,Hr(o),Hr(A)),_&&(u-=A-(A=_._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!v&&(Xn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&_!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||Zr&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){_=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(_&&!i&&(this.pause(),_.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,pf(this),this.render(n,i,s);this._onUpdate&&!i&&Xn(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===c&&this._ts>0||!u&&this._ts<0)&&ma(this,1),!i&&!(n<0&&!o)&&(u||o||!c)&&(Xn(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(bs(i)||(i=ci(this,i,n)),!(n instanceof Ou)){if($r(n))return n.forEach(function(o){return s.add(o,i)}),this;if(zr(n))return this.addLabel(n,i);if(cr(n))n=Ir.delayedCall(0,n);else return this}return this!==n?ts(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-oi);for(var c=[],h=this._first;h;)h._start>=o&&(h instanceof Ir?i&&c.push(h):(s&&c.push(h),n&&c.push.apply(c,h.getChildren(!0,i,s)))),h=h._next;return c},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return zr(n)?this.removeLabel(n):cr(n)?this.killTweensOf(n):(df(this,n),n===this._recent&&(this._recent=this._last),Eo(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Hr(Kn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=ci(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=Ir.delayedCall(0,i||Du,s);return o.data="isPause",this._hasPause=1,ts(this,o,ci(this,n))},t.removePause=function(n){var i=this._first;for(n=ci(this,n);i;)i._start===n&&i.data==="isPause"&&ma(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),c=o.length;c--;)ya!==o[c]&&o[c].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=ui(n),c=this._first,h=bs(i),u;c;)c instanceof Ir?eP(c._targets,o)&&(h?(!ya||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&s.push(c):(u=c.getTweensOf(o,i)).length&&s.push.apply(s,u),c=c._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=ci(s,n),c=i,h=c.startAt,u=c.onStart,d=c.onStartParams,A=c.immediateRender,p,g=Ir.to(s,li({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var v=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==v&&Jl(g,v,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,li({startAt:{time:ci(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Uw(this,ci(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Uw(this,ci(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,c=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in c)c[h]>=s&&(c[h]+=n);return Eo(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Eo(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,c=oi,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>c&&s._sort&&o._ts&&!s._lock?(s._lock=1,ts(s,o,u-o._delay,1)._lock=0):c=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),c=0),o._end>i&&o._ts&&(i=o._end),o=h;Jl(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(_w(nr,ff(n,nr)),Aw=Kn.frame),Kn.frame>=gw){gw+=Wn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&Wn.autoSleep&&Kn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Kn.sleep()}}},e}(Ou);li(pn.prototype,{_lock:0,_hasPause:0,_forcing:0});var wP=function(r,e,t,n,i,s,o){var c=new Sn(this._pt,r,e,0,1,Jw,null,i),h=0,u=0,d,A,p,g,v,E,m,_;for(c.b=t,c.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Pu(n)),s&&(_=[t,n],s(_,r,e),t=_[0],n=_[1]),A=t.match(rm)||[];d=rm.exec(n);)g=d[0],v=n.substring(h,d.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,c._pt={_next:c._pt,p:v||u===1?v:",",s:E,c:g.charAt(1)==="="?Xl(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=rm.lastIndex);return c.c=h<n.length?n.substring(h,n.length):"",c.fp=o,(uw.test(n)||m)&&(c.e=0),this._pt=c,c},vm=function(r,e,t,n,i,s,o,c,h,u){cr(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:cr(d)?h?r[e.indexOf("set")||!cr(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=cr(d)?h?TP:Xw:xm,g;if(zr(n)&&(~n.indexOf("random(")&&(n=Pu(n)),n.charAt(1)==="="&&(g=Xl(A,n)+(en(A)||0),(g||g===0)&&(n=g))),!u||A!==n||ym)return!isNaN(A*n)&&n!==""?(g=new Sn(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?bP:Kw,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&sm(e,n),wP.call(this,r,e,A,n,p,c||Wn.stringFilter,h))},IP=function(r,e,t,n,i){if(cr(r)&&(r=zu(r,i,e,t,n)),!$i(r)||r.style&&r.nodeType||$r(r)||lw(r))return zr(r)?zu(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=zu(r[o],i,e,t,n);return s},Ww=function(r,e,t,n,i,s){var o,c,h,u;if(qn[r]&&(o=new qn[r]).init(i,o.rawVars?e[r]:IP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=c=new Sn(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==Zl))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=c;return o},ya,ym,Em=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,c=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,v=e._dur,E=e._startAt,m=e._targets,_=e.parent,w=_&&_.data==="nested"?_.vars.targets:m,x=e._overwrite==="auto"&&!Jg,I=e.timeline,R,M,T,D,b,S,L,P,N,W,X,K,te;if(I&&(!p||!s)&&(s="none"),e._ease=xo(s,Yl.ease),e._yEase=A?Hw(xo(A===!0?s:A,Yl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?vo(m[0]).harness:0,K=P&&i[P.prop],R=hf(i,am),E&&(E._zTime<0&&E.progress(1),t<0&&d&&c&&!g?E.render(-1,!0):E.revert(d&&v?lf:ZU),E._lazy=0),o){if(ma(e._startAt=Ir.set(m,li({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!E&&In(h),startAt:null,delay:0,onUpdate:u&&function(){return Xn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Zr||!c&&!g)&&e._startAt.revert(lf),c&&v&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&v&&!E){if(t&&(c=!1),T=li({overwrite:!1,data:"isFromStart",lazy:c&&!E&&In(h),immediateRender:c,stagger:0,parent:_},R),K&&(T[P.prop]=K),ma(e._startAt=Ir.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Zr?e._startAt.revert(lf):e._startAt.render(-1,!0)),e._zTime=t,!c)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=v&&In(h)||h&&!v,M=0;M<m.length;M++){if(b=m[M],L=b._gsap||um(m)[M]._gsap,e._ptLookup[M]=W={},om[L.id]&&ga.length&&uf(),X=w===m?M:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new Sn(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(H){W[H]=D}),N.priority&&(S=1)),!P||K)for(T in R)qn[T]&&(N=Ww(T,R,e,X,b,w))?N.priority&&(S=1):W[T]=D=vm.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[M]&&e.kill(b,e._op[M]),x&&e._pt&&(ya=e,nr.killTweensOf(b,W,e.globalTime(t)),te=!e.parent,ya=0),e._pt&&h&&(om[L.id]=1)}S&&Zw(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!te,p&&t<=0&&I.render(oi,!0,!0)},CP=function(r,e,t,n,i,s,o,c){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return ym=1,r.vars[e]="+=0",Em(r,o),ym=0,c?Ru(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=mr(t)+en(d.e)),d.b&&(d.b=u.s+en(d.b))},SP=function(r,e){var t=r[0]?vo(r[0]).harness:0,n=t&&t.aliases,i,s,o,c;if(!n)return e;i=yo({},e);for(s in n)if(s in i)for(c=n[s].split(","),o=c.length;o--;)i[c[o]]=i[s];return i},MP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if($r(e))o=t[r]||(t[r]=[]),e.forEach(function(c,h){return o.push({t:h/(e.length-1)*100,v:c,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},zu=function(r,e,t,n,i){return cr(r)?r.call(e,t,n,i):zr(r)&&~r.indexOf("random(")?Pu(r):r},Yw=cm+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",qw={};Cn(Yw+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return qw[r]=1});var Ir=function(r){aw(e,r);function e(n,i,s,o){var c;typeof i=="number"&&(s.duration=i,i=s,s=null),c=r.call(this,o?i:Lu(i))||this;var h=c.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,v=h.keyframes,E=h.defaults,m=h.scrollTrigger,_=h.yoyoEase,w=i.parent||nr,x=($r(n)||lw(n)?bs(n[0]):"length"in i)?[n]:ui(n),I,R,M,T,D,b,S,L;if(c._targets=x.length?um(x):Ru("GSAP target "+n+" not found. https://gsap.com",!Wn.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=g,v||p||af(u)||af(d)){if(i=c.vars,I=c.timeline=new pn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=Bs(c),I._start=0,p||af(u)||af(d)){if(T=x.length,S=p&&bw(p),$i(p))for(D in p)~Yw.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)M=hf(i,qw),M.stagger=0,_&&(M.yoyoEase=_),L&&yo(M,L),b=x[R],M.duration=+zu(u,Bs(c),R,b,x),M.delay=(+zu(d,Bs(c),R,b,x)||0)-c._delay,!p&&T===1&&M.delay&&(c._delay=d=M.delay,c._start+=d,M.delay=0),I.to(b,M,S?S(R,b,x):0),I._ease=Ct.none;I.duration()?u=d=0:c.timeline=0}else if(v){Lu(li(I.vars.defaults,{ease:"none"})),I._ease=xo(v.ease||i.ease||"none");var P=0,N,W,X;if($r(v))v.forEach(function(K){return I.to(x,K,">")}),I.duration();else{M={};for(D in v)D==="ease"||D==="easeEach"||MP(D,v[D],M,v.easeEach);for(D in M)for(N=M[D].sort(function(K,te){return K.t-te.t}),P=0,R=0;R<N.length;R++)W=N[R],X={ease:W.e,duration:(W.t-(R?N[R-1].t:0))/100*u},X[D]=W.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||c.duration(u=I.duration())}else c.timeline=0;return g===!0&&!Jg&&(ya=Bs(c),nr.killTweensOf(x),ya=0),ts(w,Bs(c),s),i.reversed&&c.reverse(),i.paused&&c.paused(!0),(A||!u&&!v&&c._start===Hr(w._time)&&In(A)&&iP(Bs(c))&&w.data!=="nested")&&(c._tTime=-Gt,c.render(Math.max(0,-d)||0)),m&&Cw(Bs(c),m),c}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,c=this._tDur,h=this._dur,u=n<0,d=n>c-Gt&&!u?c:n<Gt?0:n,A,p,g,v,E,m,_,w,x;if(!h)aP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(v=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(v*100+n,i,s);if(A=Hr(d%v),d===c?(g=this._repeat,A=h):(g=~~(d/v),g&&g===Hr(d/v)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=Kl(this._tTime,v),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&Gw(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==v&&this._initted&&(this._lock=s=1,this.render(Hr(v*g),!0).invalidate()._lock=0))}if(!this._initted){if(Sw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=_=(x||this._ease)(A/h),this._from&&(this.ratio=_=1-_),A&&!o&&!i&&!g&&(Xn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(_,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&hm(this,n,i,s),Xn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&Xn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&hm(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ma(this,1),!i&&!(u&&!o)&&(d||o||m)&&(Xn(this,d===c?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,c){Fu||Kn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Em(this,h),u=this._ease(h/this._dur),CP(this,n,i,s,o,u,h,c)?this.resetTo(n,i,s,o,1):(Af(this,0),this.parent||xw(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?ku(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,ya&&ya.vars.overwrite!==!0)._first||ku(this),this.parent&&s!==this.timeline.totalDuration()&&Jl(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,c=n?ui(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,v,E,m;if((!i||i==="all")&&rP(o,c))return i==="all"&&(this._pt=0),ku(this);for(d=this._op=this._op||[],i!=="all"&&(zr(i)&&(v={},Cn(i,function(_){return v[_]=1}),i=v),i=SP(o,i)),m=o.length;m--;)if(~c.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(v in g)E=A&&A[v],E&&((!("kill"in E.d)||E.d.kill(v)===!0)&&df(this,E,"_pt"),delete A[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&u&&ku(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Nu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Nu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Ou);li(Ir.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Cn("staggerTo,staggerFrom,staggerFromTo",function(r){Ir[r]=function(){var e=new pn,t=fm.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var xm=function(r,e,t){return r[e]=t},Xw=function(r,e,t){return r[e](t)},TP=function(r,e,t,n){return r[e](n.fp,t)},BP=function(r,e,t){return r.setAttribute(e,t)},wm=function(r,e){return cr(r[e])?Xw:$g(r[e])&&r.setAttribute?BP:xm},Kw=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},bP=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},Jw=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},Im=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},RP=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},DP=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?df(this,e,"_pt"):e.dep||(t=1),e=n;return!t},LP=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},Zw=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},Sn=function(){function r(t,n,i,s,o,c,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=c||Kw,this.d=h||this,this.set=u||xm,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=LP,this.m=t,this.mt=i,this.tween=n},r}();Cn(cm+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return am[r]=1}),Yn.TweenMax=Yn.TweenLite=Ir,Yn.TimelineLite=Yn.TimelineMax=pn,nr=new pn({sortChildren:!1,defaults:Yl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Wn.stringFilter=zw;var Io=[],gf={},NP=[],$w=0,UP=0,Cm=function(r){return(gf[r]||NP).map(function(e){return e()})},Sm=function(){var r=Date.now(),e=[];r-$w>2&&(Cm("matchMediaInit"),Io.forEach(function(t){var n=t.queries,i=t.conditions,s,o,c,h;for(o in n)s=es.matchMedia(n[o]).matches,s&&(c=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),c&&e.push(t))}),Cm("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),$w=r,Cm("matchMedia"))},eI=function(){function r(t,n){this.selector=n&&pm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=UP++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){cr(t)&&(i=n,n=t,t=cr);var s=this,o=function(){var c=$t,h=s.selector,u;return c&&c!==s&&c.data.push(s),i&&(s.selector=pm(i)),$t=s,u=n.apply(s,arguments),cr(u)&&s._r.push(u),$t=c,s.selector=h,s.isReverted=!1,u};return s.last=o,t===cr?o(s,function(c){return s.add(null,c)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof Ir&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),c=i.data.length,h;c--;)h=i.data[c],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),c=i.data.length;c--;)h=i.data[c],h instanceof pn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Ir)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=Io.length;s--;)Io[s].id===this.id&&Io.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),PP=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){$i(t)||(t={matches:t});var s=new eI(0,i||this.scope),o=s.conditions={},c,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(c=es.matchMedia(t[h]),c&&(Io.indexOf(s)<0&&Io.push(s),(o[h]=c.matches)&&(u=1),c.addListener?c.addListener(Sm):c.addEventListener("change",Sm)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),mf={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return kw(n)})},timeline:function(r){return new pn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){zr(r)&&(r=ui(r)[0]);var i=vo(r||{}).get,s=t?yw:vw;return t==="native"&&(t=""),r&&(e?s((qn[e]&&qn[e].get||i)(r,e,t,n)):function(o,c,h){return s((qn[o]&&qn[o].get||i)(r,o,c,h))})},quickSetter:function(r,e,t){if(r=ui(r),r.length>1){var n=r.map(function(u){return Mn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=qn[e],o=vo(r),c=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;Zl._pt=0,d.init(r,t?u+t:u,Zl,0,[r]),d.render(1,d),Zl._pt&&Im(1,Zl)}:o.set(r,c);return s?h:function(u){return h(r,c,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Mn.to(r,yo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,c,h){return i.resetTo(e,o,c,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=xo(r.ease,Yl.ease)),Ew(Yl,r||{})},config:function(r){return Ew(Wn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!qn[o]&&!Yn[o]&&Ru(e+" effect requires "+o+" plugin.")}),lm[e]=function(o,c,h){return t(ui(o),li(c||{},i),h)},s&&(pn.prototype[e]=function(o,c,h){return this.add(lm[e](o,$i(c)?c:(h=c)&&{},this),h)})},registerEase:function(r,e){Ct[r]=xo(e)},parseEase:function(r,e){return arguments.length?xo(r,e):Ct},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new pn(r),n,i;for(t.smoothChildTiming=In(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof Ir&&n.vars.onComplete===n._targets[0]))&&ts(t,n,n._start-n._delay),n=i;return ts(nr,t,0),t},context:function(r,e){return r?new eI(r,e):$t},matchMedia:function(r){return new PP(r)},matchMediaRefresh:function(){return Io.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||Sm()},addEventListener:function(r,e){var t=gf[r]||(gf[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=gf[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:pP,wrapYoyo:AP,distribute:bw,random:Dw,snap:Rw,normalize:fP,getUnit:en,clamp:cP,splitColor:Qw,toArray:ui,selector:pm,mapRange:Nw,pipe:hP,unitize:dP,interpolate:gP,shuffle:Bw},install:fw,effects:lm,ticker:Kn,updateRoot:pn.updateRoot,plugins:qn,globalTimeline:nr,core:{PropTween:Sn,globals:pw,Tween:Ir,Timeline:pn,Animation:Ou,getCache:vo,_removeLinkedListItem:df,reverting:function(){return Zr},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return Jg=r}}};Cn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return mf[r]=Ir[r]}),Kn.add(pn.updateRoot),Zl=mf.to({},{duration:0});var kP=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},QP=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=kP(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Mm=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,c;if(zr(n)&&(o={},Cn(n,function(h){return o[h]=1}),n=o),e){o={};for(c in n)o[c]=e(n[c]);n=o}QP(s,n)}}}},Mn=mf.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,c;this.tween=t;for(s in e)c=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(c||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=c,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)Zr?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Mm("roundProps",Am),Mm("modifiers"),Mm("snap",Rw))||mf;Ir.version=pn.version=Mn.version="3.12.5",dw=1,em()&&$l(),Ct.Power0,Ct.Power1,Ct.Power2,Ct.Power3,Ct.Power4,Ct.Linear,Ct.Quad,Ct.Cubic,Ct.Quart,Ct.Quint,Ct.Strong,Ct.Elastic,Ct.Back,Ct.SteppedEase,Ct.Bounce,Ct.Sine,Ct.Expo,Ct.Circ;/*!
|
|
4410
4410
|
* CSSPlugin 3.12.5
|
|
4411
4411
|
* https://gsap.com
|
|
4412
4412
|
*
|
|
@@ -4414,7 +4414,7 @@ bool bvhIntersectFirstHit(
|
|
|
4414
4414
|
* Subject to the terms at https://gsap.com/standard-license or for
|
|
4415
4415
|
* Club GSAP members, the agreement issued with that membership.
|
|
4416
4416
|
* @author: Jack Doyle, jack@greensock.com
|
|
4417
|
-
*/var tI,Ea,$l,Tm,Co,rI,Bm,FP=function(){return typeof window<"u"},Rs={},So=180/Math.PI,ec=Math.PI/180,tc=Math.atan2,nI=1e8,bm=/([A-Z])/g,OP=/(left|right|width|margin|padding|x)/i,zP=/[\s,\(]\S/,rs={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Rm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},HP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},GP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},VP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},iI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},sI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},jP=function(r,e,t){return r.style[e]=t},WP=function(r,e,t){return r.style.setProperty(e,t)},YP=function(r,e,t){return r._gsap[e]=t},qP=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},XP=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},KP=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",JP=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=rs[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Ds(i,c)}):this.tfm[e]=o.x?o[e]:Ds(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return rs.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},aI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},ZP=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(bm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=Bm(),(!i||!i.isStart)&&!t[ir]&&(aI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},oI=function(r,e){var t={target:r,props:[],revert:ZP,save:JP};return r._gsap||Mn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},lI,Dm=function(r,e){var t=Ea.createElementNS?Ea.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):Ea.createElement(r);return t&&t.style?t:Ea.createElement(r)},ns=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(bm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,rc(t)||t,1)||""},cI="O,Moz,ms,Ms,Webkit".split(","),rc=function(r,e,t){var n=e||Co,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(cI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?cI[s]:"")+r},Lm=function(){FP()&&window.document&&(tI=window,Ea=tI.document,$l=Ea.documentElement,Co=Dm("div")||{style:{}},Dm("div"),ir=rc(ir),Tn=ir+"Origin",Co.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",lI=!!rc("perspective"),Bm=Mn.core.reverting,Tm=1)},Nm=function r(e){var t=Dm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if($l.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),$l.removeChild(t),this.style.cssText=s,o},uI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},hI=function(r){var e;try{e=r.getBBox()}catch{e=Nm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Nm||(e=Nm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+uI(r,["x","cx","x1"])||0,y:+uI(r,["y","cy","y1"])||0,width:0,height:0}:e},dI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&hI(r))},Mo=function(r,e){if(e){var t=r.style,n;e in Rs&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(bm,"-$1").toLowerCase())):t.removeAttribute(e)}},xa=function(r,e,t,n,i,s){var o=new Sn(r._pt,e,t,0,1,s?sI:iI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},fI={deg:1,rad:1,turn:1},$P={grid:1,flex:1},wa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=Co.style,h=OP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||fI[i]||fI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&dI(e),(g||o==="%")&&(Rs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],mr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===Ea||!E.appendChild)&&(E=Ea.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Kn.time&&!m.uncache)return mr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Mo(e,t)}else(g||o==="%")&&!$P[ns(E,"display")]&&(c.position=ns(e,"position")),E===e&&(c.position="static"),E.appendChild(Co),v=Co[d],E.removeChild(Co),c.position="absolute";return h&&g&&(m=vo(E),m.time=Kn.time,m.width=E[d]),mr(p?v*s/A:v&&s?A/v*s:0)},Ds=function(r,e,t,n){var i;return Tm||Lm(),e in rs&&e!=="transform"&&(e=rs[e],~e.indexOf(",")&&(e=e.split(",")[0])),Rs[e]&&e!=="transform"?(i=Gu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:_f(ns(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=mf[e]&&mf[e](r,e,t)||ns(r,e)||mw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?wa(r,e,i,t)+t:i},ek=function(r,e,t,n){if(!t||t==="none"){var i=rc(e,r,1),s=i&&ns(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ns(r,"borderTopColor"))}var o=new Sn(this._pt,r.style,e,0,1,Jw),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=ns(r,e)||n,v?r.style[e]=v:Mo(r,e)),u=[t,n],zw(u),t=u[0],n=u[1],A=t.match(Yl)||[],I=n.match(Yl)||[],I.length){for(;d=Yl.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=ql(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=Yl.lastIndex-w.length,w||(w=w||Wn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=wa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?sI:iI;return uw.test(n)&&(o.e=0),this._pt=o,o},pI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},tk=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=pI[t]||t,e[1]=pI[n]||n,e.join(" ")},rk=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Rs[o]&&(c=1,o=o==="transformOrigin"?Tn:ir),Mo(t,o);c&&(Mo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Gu(t,1),s.uncache=1,aI(n)))}},mf={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Sn(r._pt,e,t,0,0,rk);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Hu=[1,0,0,1,0,0],AI={},gI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},mI=function(r){var e=ns(r,ir);return gI(e)?Hu:e.substr(7).match(cw).map(mr)},Um=function(r,e){var t=r._gsap||vo(r),n=r.style,i=mI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?Hu:i):(i===Hu&&!r.offsetParent&&r!==$l&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,$l.appendChild(r)),i=mI(r),c?n.display=c:Mo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):$l.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Pm=function(r,e,t,n,i,s){var o=r._gsap,c=i||Um(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,M,T,D;t?c!==Hu&&(M=p*E-g*v)&&(T=x*(E/M)+I*(-v/M)+(v*_-E*m)/M,D=x*(-g/M)+I*(p/M)-(p*_-g*m)/M,x=T,I=D):(R=hI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(xa(s,o,"xOrigin",h,x),xa(s,o,"yOrigin",u,I),xa(s,o,"xOffset",d,o.xOffset),xa(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Gu=function(r,e){var t=r._gsap||new jw(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=ns(r,Tn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,M,T,D,b,S,L,P,N,W,X,K,te,H,ee,Q,z,Z,re,G;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&dI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),M=Um(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),Pm(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,M)),I=t.xOrigin||0,R=t.yOrigin||0,M!==Hu&&(S=M[0],L=M[1],P=M[2],N=M[3],u=W=M[4],d=X=M[5],M.length===6?(p=Math.sqrt(S*S+L*L),g=Math.sqrt(N*N+P*P),v=S||L?tc(L,S)*So:0,_=P||N?tc(P,N)*So+v:0,_&&(g*=Math.abs(Math.cos(_*ec))),t.svg&&(u-=I-(I*S+R*P),d-=R-(I*L+R*N))):(G=M[6],Z=M[7],ee=M[8],Q=M[9],z=M[10],re=M[11],u=M[12],d=M[13],A=M[14],T=tc(G,z),E=T*So,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,H=G*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=G*-b+z*D,re=Z*-b+re*D,W=K,X=te,G=H),T=tc(-P,z),m=T*So,T&&(D=Math.cos(-T),b=Math.sin(-T),K=S*D-ee*b,te=L*D-Q*b,H=P*D-z*b,re=N*b+re*D,S=K,L=te,P=H),T=tc(L,S),v=T*So,T&&(D=Math.cos(T),b=Math.sin(T),K=S*D+L*b,te=W*D+X*b,L=L*D-S*b,X=X*D-W*b,S=K,W=te),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=mr(Math.sqrt(S*S+L*L+P*P)),g=mr(Math.sqrt(X*X+G*G)),T=tc(W,X),_=Math.abs(T)>2e-4?T*So:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!gI(ns(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=mr(p),t.scaleY=mr(g),t.rotation=mr(v)+o,t.rotationX=mr(E)+o,t.rotationY=mr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=_f(h)),t.xOffset=t.yOffset=0,t.force3D=Wn.force3D,t.renderTransform=t.svg?ik:lI?_I:nk,t.uncache=0,t},_f=function(r){return(r=r.split(" "))[0]+" "+r[1]},km=function(r,e,t){var n=en(e);return mr(parseFloat(e)+parseFloat(wa(r,"x",t+"px",n)))+n},nk=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,_I(r,e)},To="0deg",Vu="0px",Bo=") ",_I=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==To||u!==To)){var R=parseFloat(u)*ec,M=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*ec,D=Math.cos(R),s=km(_,s,M*D*-w),o=km(_,o,-Math.sin(R)*-w),c=km(_,c,T*D*-w+w)}E!==Vu&&(x+="perspective("+E+Bo),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Vu||o!==Vu||c!==Vu)&&(x+=c!==Vu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+Bo),h!==To&&(x+="rotate("+h+Bo),u!==To&&(x+="rotateY("+u+Bo),d!==To&&(x+="rotateX("+d+Bo),(A!==To||p!==To)&&(x+="skew("+A+", "+p+Bo),(g!==1||v!==1)&&(x+="scale("+g+", "+v+Bo),_.style[ir]=x||"translate(0, 0)"},ik=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,M,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=ec,h*=ec,I=Math.cos(c)*d,R=Math.sin(c)*d,M=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=ec,D=Math.tan(h-u),D=Math.sqrt(1+D*D),M*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=mr(I),R=mr(R),M=mr(M),T=mr(T)):(I=d,T=A,R=M=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=wa(p,"x",s,"px"),x=wa(p,"y",o,"px")),(g||v||E||m)&&(w=mr(w+g-(g*I+v*M)+E),x=mr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=mr(w+n/100*D.width),x=mr(x+i/100*D.height)),D="matrix("+I+","+R+","+M+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},sk=function(r,e,t,n,i){var s=360,o=zr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?So:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*nI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*nI)%s-~~(h/s)*s)),r._pt=A=new Sn(r._pt,e,t,n,h,HP),A.e=u,A.u="deg",r._props.push(t),A},vI=function(r,e){for(var t in e)r[t]=e[t];return r},ak=function(r,e,t){var n=vI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Gu(t,1),Mo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Gu(t,1),s[ir]=h);for(c in Rs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=en(h),g=en(u),d=p!==g?wa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Sn(r._pt,o,c,d,A-d,Rm),r._pt.u=g||0,r._props.push(c));vI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});mf[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Ds(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var yI={name:"css",register:Lm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,M,T;Tm||Lm(),this.styles=this.styles||oI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(qn[v]&&Ww(v,e,t,n,r,i)))){if(p=typeof u,g=mf[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Pu(u)),g)g(this,r,v,u,t)&&(M=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",va.lastIndex=0,va.test(h)||(E=en(h),m=en(u)),m?E!==m&&(h=wa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],zr(h)&&~h.indexOf("random(")&&(h=Pu(h)),en(h+"")||h==="auto"||(h+=Wn.units[v]||en(Ds(r,v))||""),(h+"").charAt(1)==="="&&(h=Ds(r,v))):h=Ds(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in rs&&(v==="autoAlpha"&&(A===1&&Ds(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),xa(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=rs[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in Rs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Gu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Sn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new Sn(this._pt,I,"scaleY",I.scaleY,(_?ql(I.scaleY,_+d):d)-I.scaleY||0,Rm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Tn,0,o[Tn]),u=tk(u),I.svg?Pm(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&xa(this,I,"zOrigin",I.zOrigin,m),xa(this,o,v,_f(h),_f(u)));continue}else if(v==="svgOrigin"){Pm(r,u,1,R,0,this);continue}else if(v in AI){sk(this,I,v,A,_?ql(A,_+u):u);continue}else if(v==="smoothOrigin"){xa(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){ak(this,u,r);continue}}else v in o||(v=rc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!zP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=en(u)||(v in Wn.units?Wn.units[v]:E),E!==m&&(A=wa(r,v,h,m)),this._pt=new Sn(this._pt,w?I:o,v,A,(_?ql(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?VP:Rm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=GP);else if(v in o)ek.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){sm(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}M&&Zw(this)},render:function(r,e){if(e.tween._time||!Bm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ds,aliases:rs,getSetter:function(r,e,t){var n=rs[e];return n&&n.indexOf(",")<0&&(e=n),e in Rs&&e!==Tn&&(r._gsap.x||Ds(r,"x"))?t&&rI===t?e==="scale"?qP:YP:(rI=t||{})&&(e==="scale"?XP:KP):r.style&&!$g(r.style[e])?jP:~e.indexOf("-")?WP:wm(r,e)},core:{_removeProperty:Mo,_getMatrix:Um}};Mn.utils.checkPrefix=rc,Mn.core.getStyleSaver=oI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Rs[s]=1});Cn(e,function(s){Wn.units[s]="deg",AI[s]=1}),rs[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");rs[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Wn.units[r]="px"}),Mn.registerPlugin(yI);var EI=Mn.registerPlugin(yI)||Mn;EI.core.Tween;const bo=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),ok={Front:{value:bo?new j(4.7,1.9,7.5):new j(1.8,.65,2.5)},Back:{value:bo?new j(0,1.9,-7.5):new j(0,.65,-4)},Left:{value:bo?new j(-9.14,1.17,3):new j(-3.5,.4,1)},Right:{value:bo?new j(9.14,1.17,3):new j(3.5,.4,1)},Top:{value:bo?new j(0,9.23,3):new j(0,3.5,1)},Bottom:{value:bo?new j(.6,-9.23,3):new j(.1,-3.5,1)}};let tn,ur,nc=!1,vf=!1,Qm=!1,Fm=!1,Om,zm;const lk=new Li({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new Ke(16777215),transparent:!1,shadowSide:kr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let ic;const Hm=[0,.4,.7,1],xI=[.85,.62,.3,0],wI=[new Ke(16777215),new Ke(16777215),new Ke(16777215),new Ke(16777215)],Rr={resolution:{value:new Ge(0,0)},color:{value:new Ke(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:wI},positions:{value:Hm},opacities:{value:xI}},II=new IN;document.getElementById("gui-container");const Ls=new WU,ck=1;new PA().set(ck),new xs({color:"black"});class uk{constructor(){kt(this,"scene"),kt(this,"camera"),kt(this,"renderer"),kt(this,"canvas"),kt(this,"canvasSize"),kt(this,"isInitialised"),kt(this,"orgId"),kt(this,"textureLoader"),this.scene=new zL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new K2,this.orgId=""}async intialize(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new un(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new OL({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),II.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Kc,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.width!==n||this.canvas.height!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}initGemstoneDependencies(){var e;II.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Kc,Ls.uniforms.envMap.value=A,ic=A});const t=.01,n=A=>A&&A.isCubeTexture;Ls.uniforms.aberrationStrength.value=t,Ls.uniforms.resolution.value=this.canvasSize;const i={},s=n(ic),o=((s?(e=ic==null?void 0:ic.image[0])==null?void 0:e.width:ic==null?void 0:ic.image.width)??1024)/4,c=Math.floor(Math.log2(o)),h=Math.pow(2,c),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${c}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",Ls.defines=i}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const i=await _B(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}async downloadModel(e,t){return await Sp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,c]=this.getCustomisations(s);vf=!!o,nc=!!c,nc||(Qm=!0,Fm=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),c?await this.updateOrbitalMaterial(c).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){vf=!1,nc=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[c,h]=this.getCustomisations(t.customisation);vf=!!(c||s&&(s==null?void 0:s.sku)!=="lens-default"),nc=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{(s==null?void 0:s.sku)=="lens-default"?(c&&this.updateLensMaterial(c),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Om&&(Om.visible=!0);const c=e.find(h=>(h==null?void 0:h.type)=="Lens");this.updateLensMaterial(c),Qm=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{zm&&(zm.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{Fm=!0,t()})})}async renderModel(e,t){const n=new D8;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Gn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new j(i[s],i[s+1],i[s+2]),c=e.localToWorld(o.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,Rr.minY.value+=n,Rr.maxY.value+=n}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Gn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const c=new j(s[o],s[o+1],s[o+2]),h=e.localToWorld(c.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}Rr.minY.value=t,Rr.maxY.value=n}setupLensMaterial(e,t){vf&&t.material&&t.material.name=="Lenses"&&(this.calculateLensExtents(t),Om=t,tn=new Li({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new Ke(16777215),transparent:!0,shadowSide:kr,depthWrite:!1}),t.material=tn,tn&&(tn.onBeforeCompile=function(n){n.uniforms.resolution=Rr.resolution,n.uniforms.color=Rr.color,n.uniforms.uAlpha=Rr.uAlpha,n.uniforms.colors=Rr.colors,n.uniforms.positions=Rr.positions,n.uniforms.opacities=Rr.opacities,n.uniforms.minX=Rr.minX,n.uniforms.maxX=Rr.maxX,n.uniforms.minY=Rr.minY,n.uniforms.maxY=Rr.maxY,n.vertexShader=`
|
|
4417
|
+
*/var tI,Ea,ec,Tm,Co,rI,Bm,FP=function(){return typeof window<"u"},Rs={},So=180/Math.PI,tc=Math.PI/180,rc=Math.atan2,nI=1e8,bm=/([A-Z])/g,OP=/(left|right|width|margin|padding|x)/i,zP=/[\s,\(]\S/,rs={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Rm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},HP=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},GP=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},VP=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},iI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},sI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},jP=function(r,e,t){return r.style[e]=t},WP=function(r,e,t){return r.style.setProperty(e,t)},YP=function(r,e,t){return r._gsap[e]=t},qP=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},XP=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},KP=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",JP=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rs&&s){if(this.tfm=this.tfm||{},e!=="transform")e=rs[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return n.tfm[c]=Ds(i,c)}):this.tfm[e]=o.x?o[e]:Ds(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return rs.transform.split(",").forEach(function(c){return r.call(n,c,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},aI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},ZP=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(bm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=Bm(),(!i||!i.isStart)&&!t[ir]&&(aI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},oI=function(r,e){var t={target:r,props:[],revert:ZP,save:JP};return r._gsap||Mn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},lI,Dm=function(r,e){var t=Ea.createElementNS?Ea.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):Ea.createElement(r);return t&&t.style?t:Ea.createElement(r)},ns=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(bm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,nc(t)||t,1)||""},cI="O,Moz,ms,Ms,Webkit".split(","),nc=function(r,e,t){var n=e||Co,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(cI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?cI[s]:"")+r},Lm=function(){FP()&&window.document&&(tI=window,Ea=tI.document,ec=Ea.documentElement,Co=Dm("div")||{style:{}},Dm("div"),ir=nc(ir),Tn=ir+"Origin",Co.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",lI=!!nc("perspective"),Bm=Mn.core.reverting,Tm=1)},Nm=function r(e){var t=Dm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(ec.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),ec.removeChild(t),this.style.cssText=s,o},uI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},hI=function(r){var e;try{e=r.getBBox()}catch{e=Nm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Nm||(e=Nm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+uI(r,["x","cx","x1"])||0,y:+uI(r,["y","cy","y1"])||0,width:0,height:0}:e},dI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&hI(r))},Mo=function(r,e){if(e){var t=r.style,n;e in Rs&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(bm,"-$1").toLowerCase())):t.removeAttribute(e)}},xa=function(r,e,t,n,i,s){var o=new Sn(r._pt,e,t,0,1,s?sI:iI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},fI={deg:1,rad:1,turn:1},$P={grid:1,flex:1},wa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",c=Co.style,h=OP.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",v,E,m,_;if(i===o||!s||fI[i]||fI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),_=e.getCTM&&dI(e),(g||o==="%")&&(Rs[t]||~t.indexOf("adius")))return v=_?e.getBBox()[h?"width":"height"]:e[d],mr(g?s/v*A:s/100*v);if(c[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===Ea||!E.appendChild)&&(E=Ea.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Kn.time&&!m.uncache)return mr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,v=e[d],w?e.style[t]=w:Mo(e,t)}else(g||o==="%")&&!$P[ns(E,"display")]&&(c.position=ns(e,"position")),E===e&&(c.position="static"),E.appendChild(Co),v=Co[d],E.removeChild(Co),c.position="absolute";return h&&g&&(m=vo(E),m.time=Kn.time,m.width=E[d]),mr(p?v*s/A:v&&s?A/v*s:0)},Ds=function(r,e,t,n){var i;return Tm||Lm(),e in rs&&e!=="transform"&&(e=rs[e],~e.indexOf(",")&&(e=e.split(",")[0])),Rs[e]&&e!=="transform"?(i=Gu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:vf(ns(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=_f[e]&&_f[e](r,e,t)||ns(r,e)||mw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?wa(r,e,i,t)+t:i},ek=function(r,e,t,n){if(!t||t==="none"){var i=nc(e,r,1),s=i&&ns(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ns(r,"borderTopColor"))}var o=new Sn(this._pt,r.style,e,0,1,Jw),c=0,h=0,u,d,A,p,g,v,E,m,_,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(v=r.style[e],r.style[e]=n,n=ns(r,e)||n,v?r.style[e]=v:Mo(r,e)),u=[t,n],zw(u),t=u[0],n=u[1],A=t.match(ql)||[],I=n.match(ql)||[],I.length){for(;d=ql.exec(n);)E=d[0],_=n.substring(c,d.index),g?g=(g+1)%5:(_.substr(-5)==="rgba("||_.substr(-5)==="hsla(")&&(g=1),E!==(v=A[h++]||"")&&(p=parseFloat(v)||0,x=v.substr((p+"").length),E.charAt(1)==="="&&(E=Xl(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),c=ql.lastIndex-w.length,w||(w=w||Wn.units[e]||x,c===n.length&&(n+=w,o.e+=w)),x!==w&&(p=wa(r,e,v,w)||0),o._pt={_next:o._pt,p:_||h===1?_:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=c<n.length?n.substring(c,n.length):""}else o.r=e==="display"&&n==="none"?sI:iI;return uw.test(n)&&(o.e=0),this._pt=o,o},pI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},tk=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=pI[t]||t,e[1]=pI[n]||n,e.join(" ")},rk=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,c,h;if(i==="all"||i===!0)n.cssText="",c=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Rs[o]&&(c=1,o=o==="transformOrigin"?Tn:ir),Mo(t,o);c&&(Mo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Gu(t,1),s.uncache=1,aI(n)))}},_f={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Sn(r._pt,e,t,0,0,rk);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Hu=[1,0,0,1,0,0],AI={},gI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},mI=function(r){var e=ns(r,ir);return gI(e)?Hu:e.substr(7).match(cw).map(mr)},Um=function(r,e){var t=r._gsap||vo(r),n=r.style,i=mI(r),s,o,c,h;return t.svg&&r.getAttribute("transform")?(c=r.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?Hu:i):(i===Hu&&!r.offsetParent&&r!==ec&&!t.svg&&(c=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,ec.appendChild(r)),i=mI(r),c?n.display=c:Mo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):ec.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Pm=function(r,e,t,n,i,s){var o=r._gsap,c=i||Um(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=c[0],g=c[1],v=c[2],E=c[3],m=c[4],_=c[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,M,T,D;t?c!==Hu&&(M=p*E-g*v)&&(T=x*(E/M)+I*(-v/M)+(v*_-E*m)/M,D=x*(-g/M)+I*(p/M)-(p*_-g*m)/M,x=T,I=D):(R=hI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,_=I-u,o.xOffset=d+(m*p+_*v)-m,o.yOffset=A+(m*g+_*E)-_):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(xa(s,o,"xOrigin",h,x),xa(s,o,"yOrigin",u,I),xa(s,o,"xOffset",d,o.xOffset),xa(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Gu=function(r,e){var t=r._gsap||new jw(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",c=getComputedStyle(r),h=ns(r,Tn)||"0",u,d,A,p,g,v,E,m,_,w,x,I,R,M,T,D,b,S,L,P,N,W,X,K,te,H,ee,Q,z,Z,re,G;return u=d=A=v=E=m=_=w=x=0,p=g=1,t.svg=!!(r.getCTM&&dI(r)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[ir]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[ir]!=="none"?c[ir]:"")),n.scale=n.rotate=n.translate="none"),M=Um(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),Pm(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,M)),I=t.xOrigin||0,R=t.yOrigin||0,M!==Hu&&(S=M[0],L=M[1],P=M[2],N=M[3],u=W=M[4],d=X=M[5],M.length===6?(p=Math.sqrt(S*S+L*L),g=Math.sqrt(N*N+P*P),v=S||L?rc(L,S)*So:0,_=P||N?rc(P,N)*So+v:0,_&&(g*=Math.abs(Math.cos(_*tc))),t.svg&&(u-=I-(I*S+R*P),d-=R-(I*L+R*N))):(G=M[6],Z=M[7],ee=M[8],Q=M[9],z=M[10],re=M[11],u=M[12],d=M[13],A=M[14],T=rc(G,z),E=T*So,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,H=G*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=G*-b+z*D,re=Z*-b+re*D,W=K,X=te,G=H),T=rc(-P,z),m=T*So,T&&(D=Math.cos(-T),b=Math.sin(-T),K=S*D-ee*b,te=L*D-Q*b,H=P*D-z*b,re=N*b+re*D,S=K,L=te,P=H),T=rc(L,S),v=T*So,T&&(D=Math.cos(T),b=Math.sin(T),K=S*D+L*b,te=W*D+X*b,L=L*D-S*b,X=X*D-W*b,S=K,W=te),E&&Math.abs(E)+Math.abs(v)>359.9&&(E=v=0,m=180-m),p=mr(Math.sqrt(S*S+L*L+P*P)),g=mr(Math.sqrt(X*X+G*G)),T=rc(W,X),_=Math.abs(T)>2e-4?T*So:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!gI(ns(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(p*=-1,_+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,_+=_<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=mr(p),t.scaleY=mr(g),t.rotation=mr(v)+o,t.rotationX=mr(E)+o,t.rotationY=mr(m)+o,t.skewX=_+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=vf(h)),t.xOffset=t.yOffset=0,t.force3D=Wn.force3D,t.renderTransform=t.svg?ik:lI?_I:nk,t.uncache=0,t},vf=function(r){return(r=r.split(" "))[0]+" "+r[1]},km=function(r,e,t){var n=en(e);return mr(parseFloat(e)+parseFloat(wa(r,"x",t+"px",n)))+n},nk=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,_I(r,e)},To="0deg",Vu="0px",Bo=") ",_I=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,v=t.scaleY,E=t.transformPerspective,m=t.force3D,_=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==To||u!==To)){var R=parseFloat(u)*tc,M=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*tc,D=Math.cos(R),s=km(_,s,M*D*-w),o=km(_,o,-Math.sin(R)*-w),c=km(_,c,T*D*-w+w)}E!==Vu&&(x+="perspective("+E+Bo),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==Vu||o!==Vu||c!==Vu)&&(x+=c!==Vu||I?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+Bo),h!==To&&(x+="rotate("+h+Bo),u!==To&&(x+="rotateY("+u+Bo),d!==To&&(x+="rotateX("+d+Bo),(A!==To||p!==To)&&(x+="skew("+A+", "+p+Bo),(g!==1||v!==1)&&(x+="scale("+g+", "+v+Bo),_.style[ir]=x||"translate(0, 0)"},ik=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,c=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,v=t.yOrigin,E=t.xOffset,m=t.yOffset,_=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,M,T,D;c=parseFloat(c),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,c+=u),c||h?(c*=tc,h*=tc,I=Math.cos(c)*d,R=Math.sin(c)*d,M=Math.sin(c-h)*-A,T=Math.cos(c-h)*A,h&&(u*=tc,D=Math.tan(h-u),D=Math.sqrt(1+D*D),M*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=mr(I),R=mr(R),M=mr(M),T=mr(T)):(I=d,T=A,R=M=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=wa(p,"x",s,"px"),x=wa(p,"y",o,"px")),(g||v||E||m)&&(w=mr(w+g-(g*I+v*M)+E),x=mr(x+v-(g*R+v*T)+m)),(n||i)&&(D=p.getBBox(),w=mr(w+n/100*D.width),x=mr(x+i/100*D.height)),D="matrix("+I+","+R+","+M+","+T+","+w+","+x+")",p.setAttribute("transform",D),_&&(p.style[ir]=D)},sk=function(r,e,t,n,i){var s=360,o=zr(i),c=parseFloat(i)*(o&&~i.indexOf("rad")?So:1),h=c-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*nI)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*nI)%s-~~(h/s)*s)),r._pt=A=new Sn(r._pt,e,t,n,h,HP),A.e=u,A.u="deg",r._props.push(t),A},vI=function(r,e){for(var t in e)r[t]=e[t];return r},ak=function(r,e,t){var n=vI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,c,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Gu(t,1),Mo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Gu(t,1),s[ir]=h);for(c in Rs)h=n[c],u=o[c],h!==u&&i.indexOf(c)<0&&(p=en(h),g=en(u),d=p!==g?wa(t,c,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Sn(r._pt,o,c,d,A-d,Rm),r._pt.u=g||0,r._props.push(c));vI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(c){return e<2?r+c:"border"+c+r});_f[e>1?"border"+r:r]=function(c,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(v){return Ds(c,v,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(v,E){return g[v]=p[E]=p[E]||p[(E-1)/2|0]}),c.init(h,g,A)}});var yI={name:"css",register:Lm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,c=t.vars.startAt,h,u,d,A,p,g,v,E,m,_,w,x,I,R,M,T;Tm||Lm(),this.styles=this.styles||oI(r),T=this.styles.props,this.tween=t;for(v in e)if(v!=="autoRound"&&(u=e[v],!(qn[v]&&Ww(v,e,t,n,r,i)))){if(p=typeof u,g=_f[v],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Pu(u)),g)g(this,r,v,u,t)&&(M=1);else if(v.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(v)+"").trim(),u+="",va.lastIndex=0,va.test(h)||(E=en(h),m=en(u)),m?E!==m&&(h=wa(r,v,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,v),s.push(v),T.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(h=typeof c[v]=="function"?c[v].call(t,n,r,i):c[v],zr(h)&&~h.indexOf("random(")&&(h=Pu(h)),en(h+"")||h==="auto"||(h+=Wn.units[v]||en(Ds(r,v))||""),(h+"").charAt(1)==="="&&(h=Ds(r,v))):h=Ds(r,v),A=parseFloat(h),_=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),_&&(u=u.substr(2)),d=parseFloat(u),v in rs&&(v==="autoAlpha"&&(A===1&&Ds(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),xa(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=rs[v],~v.indexOf(",")&&(v=v.split(",")[0]))),w=v in Rs,w){if(this.styles.save(v),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Gu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Sn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),v==="scale")this._pt=new Sn(this._pt,I,"scaleY",I.scaleY,(_?Xl(I.scaleY,_+d):d)-I.scaleY||0,Rm),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){T.push(Tn,0,o[Tn]),u=tk(u),I.svg?Pm(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&xa(this,I,"zOrigin",I.zOrigin,m),xa(this,o,v,vf(h),vf(u)));continue}else if(v==="svgOrigin"){Pm(r,u,1,R,0,this);continue}else if(v in AI){sk(this,I,v,A,_?Xl(A,_+u):u);continue}else if(v==="smoothOrigin"){xa(this,I,"smooth",I.smooth,u);continue}else if(v==="force3D"){I[v]=u;continue}else if(v==="transform"){ak(this,u,r);continue}}else v in o||(v=nc(v)||v);if(w||(d||d===0)&&(A||A===0)&&!zP.test(u)&&v in o)E=(h+"").substr((A+"").length),d||(d=0),m=en(u)||(v in Wn.units?Wn.units[v]:E),E!==m&&(A=wa(r,v,h,m)),this._pt=new Sn(this._pt,w?I:o,v,A,(_?Xl(A,_+d):d)-A,!w&&(m==="px"||v==="zIndex")&&e.autoRound!==!1?VP:Rm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=GP);else if(v in o)ek.call(this,r,v,h,_?_+u:u);else if(v in r)this.add(r,v,h||r[v],_?_+u:u,n,i);else if(v!=="parseTransform"){sm(v,u);continue}w||(v in o?T.push(v,0,o[v]):T.push(v,1,h||r[v])),s.push(v)}}M&&Zw(this)},render:function(r,e){if(e.tween._time||!Bm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ds,aliases:rs,getSetter:function(r,e,t){var n=rs[e];return n&&n.indexOf(",")<0&&(e=n),e in Rs&&e!==Tn&&(r._gsap.x||Ds(r,"x"))?t&&rI===t?e==="scale"?qP:YP:(rI=t||{})&&(e==="scale"?XP:KP):r.style&&!$g(r.style[e])?jP:~e.indexOf("-")?WP:wm(r,e)},core:{_removeProperty:Mo,_getMatrix:Um}};Mn.utils.checkPrefix=nc,Mn.core.getStyleSaver=oI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Rs[s]=1});Cn(e,function(s){Wn.units[s]="deg",AI[s]=1}),rs[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");rs[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Wn.units[r]="px"}),Mn.registerPlugin(yI);var EI=Mn.registerPlugin(yI)||Mn;EI.core.Tween;const bo=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),ok={Front:{value:bo?new j(4.7,1.9,7.5):new j(1.8,.65,2.5)},Back:{value:bo?new j(0,1.9,-7.5):new j(0,.65,-4)},Left:{value:bo?new j(-9.14,1.17,3):new j(-3.5,.4,1)},Right:{value:bo?new j(9.14,1.17,3):new j(3.5,.4,1)},Top:{value:bo?new j(0,9.23,3):new j(0,3.5,1)},Bottom:{value:bo?new j(.6,-9.23,3):new j(.1,-3.5,1)}};let tn,ur,Ro=!1,ju=!1,Qm=!1,Fm=!1,Om,zm;const lk=new Li({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new Ke(16777215),transparent:!1,shadowSide:kr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let ic;const Hm=[0,.4,.7,1],xI=[.85,.62,.3,0],wI=[new Ke(16777215),new Ke(16777215),new Ke(16777215),new Ke(16777215)],Rr={resolution:{value:new Ge(0,0)},color:{value:new Ke(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:wI},positions:{value:Hm},opacities:{value:xI}},II=new IN;document.getElementById("gui-container");const Ls=new WU,ck=1;new PA().set(ck),new xs({color:"black"});class uk{constructor(){kt(this,"scene"),kt(this,"camera"),kt(this,"renderer"),kt(this,"canvas"),kt(this,"canvasSize"),kt(this,"isInitialised"),kt(this,"orgId"),kt(this,"textureLoader"),this.scene=new zL,this.canvasSize=new Ge,this.isInitialised=!1,this.textureLoader=new K2,this.orgId=""}async intialize(){this.canvas=document.querySelector("canvas.sprie-config-webgl");const e=this.canvas.clientWidth,t=this.canvas.clientHeight;this.canvasSize.set(e,t),this.camera=new un(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new OL({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),II.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Kc,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.width!==n||this.canvas.height!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}initGemstoneDependencies(){var e;II.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Kc,Ls.uniforms.envMap.value=A,ic=A});const t=.01,n=A=>A&&A.isCubeTexture;Ls.uniforms.aberrationStrength.value=t,Ls.uniforms.resolution.value=this.canvasSize;const i={},s=n(ic),o=((s?(e=ic==null?void 0:ic.image[0])==null?void 0:e.width:ic==null?void 0:ic.image.width)??1024)/4,c=Math.floor(Math.log2(o)),h=Math.pow(2,c),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${c}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",Ls.defines=i}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const i=await _B(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}async downloadModel(e,t){return await Sp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,c]=this.getCustomisations(s);ju=!!o,Ro=!!c,Ro||(Qm=!0,Fm=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),c?await this.updateOrbitalMaterial(c).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){ju=!1,Ro=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[c,h]=this.getCustomisations(t.customisation);ju=!!(c||s&&(s==null?void 0:s.sku)!=="lens-default"),Ro=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{(s==null?void 0:s.sku)=="lens-default"?(c&&this.updateLensMaterial(c),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Om&&(Om.visible=!0);const c=e.find(h=>(h==null?void 0:h.type)=="Lens");this.updateLensMaterial(c),Qm=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{zm&&(zm.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{Fm=!0,t()})})}async renderModel(e,t){const n=new D8;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Gn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new j(i[s],i[s+1],i[s+2]),c=e.localToWorld(o.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,Rr.minY.value+=n,Rr.maxY.value+=n}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Gn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const c=new j(s[o],s[o+1],s[o+2]),h=e.localToWorld(c.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}Rr.minY.value=t,Rr.maxY.value=n}setupLensMaterial(e,t){ju&&t.material&&t.material.name=="Lenses"&&(this.calculateLensExtents(t),Om=t,tn=new Li({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new Ke(16777215),transparent:!0,shadowSide:kr,depthWrite:!1}),t.material=tn,tn&&(tn.onBeforeCompile=function(n){n.uniforms.resolution=Rr.resolution,n.uniforms.color=Rr.color,n.uniforms.uAlpha=Rr.uAlpha,n.uniforms.colors=Rr.colors,n.uniforms.positions=Rr.positions,n.uniforms.opacities=Rr.opacities,n.uniforms.minX=Rr.minX,n.uniforms.maxX=Rr.maxX,n.uniforms.minY=Rr.minY,n.uniforms.maxY=Rr.maxY,n.vertexShader=`
|
|
4418
4418
|
varying vec3 vPosition;
|
|
4419
4419
|
varying vec3 localPosition;
|
|
4420
4420
|
varying vec2 vUv;
|
|
@@ -4459,10 +4459,10 @@ bool bvhIntersectFirstHit(
|
|
|
4459
4459
|
diffuseColor.a = alpha;
|
|
4460
4460
|
}
|
|
4461
4461
|
|
|
4462
|
-
`)},tn.needsUpdate=!0,
|
|
4462
|
+
`)},tn.needsUpdate=!0,Ro&&(t.visible=Qm)))}setupOrbitalMaterial(e){Ro&&e.material&&e.material.name.toLowerCase()=="frame-stems"&&(zm=e,ur=lk,ur.envMap=this.scene.environment,e.material=ur,ur.needsUpdate=!0,e.visible=Fm)}setupGemstoneMaterial(e){e.material&&e.name.toLowerCase().includes("diamond")&&(this.initGemstoneDependencies(),Ls.uniforms.bvh.value=new sw,Ls.uniforms.bvh.value.updateFrom(new Kg(e.geometry.clone().toNonIndexed(),{strategy:Px})),e.material=Ls)}async loadEyewearFromGLTF(e,t,n,i){const s=new X2,o=new Zi(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n));const c=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,c).then(d=>{let A=d.result;this.updateScene(A);let p=Number.POSITIVE_INFINITY;A.scene.traverse(g=>{g.isMesh&&(p=Math.min(p,this.getMinY(g)),this.setupLensMaterial(A,g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene)}),u==null?void 0:u.scene}updateLensMaterial(e){if(ju&&tn){if(e.direction=="u")tn.color=new Ke(e.color),tn.opacity=e.opacity,Rr.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;Rr.uAlpha.value=!0;let n=0;t.forEach(()=>{Rr.colors.value[n]=new Ke(t[n].color),Rr.positions.value[n]=t[n].position,Rr.opacities.value[n]=t[n].alpha,n++})}e.finish=="MIRBLKHMC"?(tn.clearcoat=1,tn.clearcoatRoughness=0):e.finish=="HMCCR"?(tn.clearcoat=0,tn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(tn.clearcoat=1,tn.clearcoatRoughness=0),tn.roughness=e.roughness,tn.metalness=e.metalness}}async downloadTexture(e){return await this.textureLoader.loadAsync(e).then(t=>(t.colorSpace=Qr,t.flipY=!1,t.magFilter=pr,t.minFilter=JB,t.wrapS=$s,t.wrapT=$s,t))}async updateOrbitalMaterial(e){Ro&&ur&&e&&(e.texture&&(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{ur.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{ur.transmissionMap=t}),e.texture.orm&&await this.downloadTexture(e.texture.orm).then(t=>{ur.aoMap=t,ur.roughnessMap=t,ur.metalnessMap=t})),e.ior>1?(ur.ior=1.45,ur.thickness=.0035):(ur.ior=1,ur.thickness=0),ur.opacity=1,ur.transmission=1,ur.transparent=!1,ur.clearcoat=0,ur.roughness=1,ur.metalness=e.metalness,ur.shadowSide=kr,ur.depthWrite=!0)}snapCamToPos(e){var t;if(!this.camera||!this.renderer)return;const n=(t=ok[e])==null?void 0:t.value;EI.to(this.camera.position,{duration:1,ease:"sine.inOut",x:n.x,y:n.y,z:n.z})}setupAndRenderScene(){if(!this.camera||!this.renderer)return;this.scene.add(this.camera);const e=new f8(16777215,16777215,2);e.color.setHSL(.6,1,.6),e.groundColor.setHSL(.095,1,.75),e.position.set(0,50,0),this.scene.add(e);const t=new ex(16777215,1.5);t.color.setHSL(.1,1,.95),t.position.set(-1,1.75,1),t.position.multiplyScalar(30),this.scene.add(t);const n=new R8(this.camera,this.canvas);n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),this.renderer.getSize(new Ge),bo?(this.camera.position.set(4.7,1.9,7.5),n.minDistance=2.5,n.maxDistance=11,n.rotateSpeed=.8):(this.camera.position.set(1.8,.65,2.5),n.minDistance=1.5,n.maxDistance=5,n.rotateSpeed=.5),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!0,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),this.renderer.toneMapping=cA,this.renderer.toneMappingExposure=1.2,this.renderer.setClearColor(15724527),this.renderer.outputColorSpace=Qr;const i=2.5,s=2.5,o=.4,c={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},h=new oa;h.position.y=-.315,this.scene.add(h);const u=new Mi(256,256);u.texture.generateMipmaps=!1;const d=new Mi(256,256);d.texture.generateMipmaps=!1;const A=new fu(i,s).rotateX(Math.PI/2),p=new xs({map:u.texture,opacity:c.shadow.opacity,transparent:!0,depthWrite:!1}),g=new Yr(A,p);g.renderOrder=1,h.add(g),g.scale.y=-1;const v=new Yr(A);v.visible=!1,h.add(v);const E=new pu(-i/2,i/2,s/2,-s/2,0,o);E.rotation.x=Math.PI/2,h.add(E);const m=new M2;m.userData.darkness={value:c.shadow.darkness},m.onBeforeCompile=L=>{const P=L;P.uniforms.darkness=m.userData.darkness,P.fragmentShader=`
|
|
4463
4463
|
uniform float darkness;
|
|
4464
4464
|
${L.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
|
|
4465
|
-
`},m.depthTest=!1,m.depthWrite=!1;const _=new En(UN);_.depthTest=!1;const w=new En(PN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new LN,M=new NN(this.scene,this.camera);M.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:yn}),b=new RN(this.renderer,D);b.addPass(M),b.addPass(R);const S=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ls.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ls.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(S),b.render()};S()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class hk{constructor(){kt(this,"customRenderer"),this.customRenderer=new uk}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class CI{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new hk,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class SI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new bS,this.events=new OS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Sp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=SI;const DQ="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),LQ="";var yf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(yf||{}),An=(r=>(r.LoadedCustomiser="Frame customiser loaded.",r.EnteredViewer="3d view of a frame with view orientation buttons",r.EnteredFramesListSection="Select a frame from the list of available frames.",r.EnteredOrbitalsListSection="Select a frame from the list of available frames.",r.EnteredLensListSection="Select a lens from the list of available lenses.",r.EnteredEngravingSection="Choose custom engraving for your frame.",r.ChangedViewFront="Changed orientation to front view",r.ChangedViewBack="Changed orientation to back view",r.ChangedViewLeft="Changed orientation to left view",r.ChangedViewRight="Changed orientation to right view",r.ChangedViewTop="Changed orientation to top view",r.ChangedViewBottom="Changed orientation to bottom view",r.ChangedFrame="Changed current 3d frame to ",r.ChangedLens="Changed current lens to ",r.ChangedOrbital="Changed current orbital to ",r.AddedEngravingText="Added the engraving text ",r.EnteredEngravingTextInput="Enter upto 15 characters for engraving. Press enter to submit.",r.EngravingInputAvailable="Input text box for engraving text is available on tab",r.EngravingInputHidden="Input text box for engraving text is disabled",r))(An||{});function dk({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=We.useRef(null),c=We.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredFramesListSection)};return We.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{display:n?"flex":"none",padding:"0 4rem 1.6rem 4rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:()=>h(),disabled:t,children:Me.jsx("img",{"aria-label":`Select frame ${u.name}`,src:u.variantImage,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===u._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===u._id&&Me.jsxs("p",{className:"sprie-config-palette-img-text",children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function fk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const c=We.useRef(null),h=We.useRef(null),u=()=>{c.current&&(c.current.textContent=An.EnteredLensListSection)};return We.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Me.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 1.2rem 1.6rem 1.2rem",gap:sr?".3rem":"1rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:c}),r==null?void 0:r.map(d=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Me.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===d._id&&Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Me.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":` (+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`}),Me.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const NQ="";function pk({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,c]=We.useState(""),[h,u]=We.useState(!1),[d,A]=We.useState(!1),[p,g]=We.useState(!1),v=We.useRef(null),E=We.useRef(null),m=We.useRef(null);We.useEffect(()=>{n(h),h&&v.current?(v.current.style.backgroundColor="#ffffff",m.current&&(m.current.textContent=An.EngravingInputAvailable)):!h&&v.current&&(v.current.style.backgroundColor="transparent",m.current&&(m.current.textContent=An.EngravingInputHidden),c(""))}),We.useEffect(()=>{d&&o!=""&&(g(!1),i(o))},[d]),We.useEffect(()=>{p&&A(!1)},[p]),We.useEffect(()=>{var x;s&&((x=E.current)==null||x.focus())},[s]);const _=()=>{m.current&&(m.current.textContent=An.EnteredEngravingSection)},w=x=>{var I;x.key==="Enter"&&(i(o),(I=v.current)==null||I.blur(),m.current&&(m.current.textContent=An.AddedEngravingText+o))};return Me.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:m}),Me.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Me.jsx("input",{type:"checkbox",ref:E,className:"sprie-config-engraving-checkbox",onChange:x=>{u(x.target.checked)},onFocus:_,checked:h}),Me.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Me.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Me.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Me.jsx("input",{"aria-label":An.EnteredEngravingTextInput,type:"text",ref:v,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:x=>c(x.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onKeyDown:x=>w(x)}),Me.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const UQ="";function Ak({totalSteps:r,currentStep:e}){return Me.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function gk({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Me.jsxs("div",{className:"carousel-header",children:[Me.jsx("button",{className:"carousel-btn prev","aria-label":`return to the step number ${t} : ${n[t-1]}`,"aria-hidden":t==0,onClick:s,style:{visibility:t!==0?"visible":"hidden"},children:Me.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Me.jsxs("p",{children:[Me.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Me.jsx("span",{className:"select-syntax",children:n[t]})]}),Me.jsx("button",{className:"carousel-btn next","aria-label":`advance to step number ${t+2} : ${n[t+1]}`,"aria-hidden":!!i,onClick:o,style:{visibility:i?"hidden":"visible"},children:Me.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function mk({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=We.useState(0),o=Th.Children.toArray(n),c=i===o.length-1,h=We.useRef(null),u=(g=o.map(v=>v))==null?void 0:g.map(v=>v.props.heading),d=()=>{s(v=>v===0?Th.Children.count(n)-1:v-1),h.current&&h.current.focus()},A=()=>{s(v=>v===Th.Children.count(n)-1?0:v+1),h.current&&h.current.focus()};We.useEffect(()=>{r(!!c)},[c]),We.useEffect(()=>{e(i)},[i]);const p=v=>{(v.key==="Enter"||v.key===" ")&&v.target===h.current&&t(i)};return Me.jsxs("div",{className:"carousel",style:{top:c&&sr?"-10%":""},children:[Me.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${c?"This is an optional":""} Step ${i+1} -
|
|
4465
|
+
`},m.depthTest=!1,m.depthWrite=!1;const _=new En(UN);_.depthTest=!1;const w=new En(PN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new LN,M=new NN(this.scene,this.camera);M.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:yn}),b=new RN(this.renderer,D);b.addPass(M),b.addPass(R);const S=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ls.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ls.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(S),b.render()};S()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class hk{constructor(){kt(this,"customRenderer"),this.customRenderer=new uk}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class CI{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new hk,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class SI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new bS,this.events=new OS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Sp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=SI;const DQ="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),LQ="";var yf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(yf||{}),An=(r=>(r.LoadedCustomiser="Frame customiser loaded.",r.EnteredViewer="3d view of a frame with view orientation buttons",r.EnteredFramesListSection="Select a frame from the list of available frames.",r.EnteredOrbitalsListSection="Select a frame from the list of available frames.",r.EnteredLensListSection="Select a lens from the list of available lenses.",r.EnteredEngravingSection="Choose custom engraving for your frame.",r.ChangedViewFront="Changed orientation to front view",r.ChangedViewBack="Changed orientation to back view",r.ChangedViewLeft="Changed orientation to left view",r.ChangedViewRight="Changed orientation to right view",r.ChangedViewTop="Changed orientation to top view",r.ChangedViewBottom="Changed orientation to bottom view",r.ChangedFrame="Changed current 3d frame to ",r.ChangedLens="Changed current lens to ",r.ChangedOrbital="Changed current orbital to ",r.AddedEngravingText="Added the engraving text ",r.EnteredEngravingTextInput="Enter upto 15 characters for engraving. Press enter to submit.",r.EngravingInputAvailable="Input text box for engraving text is available on tab",r.EngravingInputHidden="Input text box for engraving text is disabled",r))(An||{});function dk({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=We.useRef(null),c=We.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredFramesListSection)};return We.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{display:n?"flex":"none",padding:"0 4rem 1.6rem 4rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:()=>h(),disabled:t,children:Me.jsx("img",{"aria-label":`Select frame ${u.name}`,src:u.variantImage,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===u._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===u._id&&Me.jsxs("p",{className:"sprie-config-palette-img-text",children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function fk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const c=We.useRef(null),h=We.useRef(null),u=()=>{c.current&&(c.current.textContent=An.EnteredLensListSection)};return We.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Me.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 1.2rem 1.6rem 1.2rem",gap:sr?".3rem":"1rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:c}),r==null?void 0:r.map(d=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Me.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===d._id&&Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Me.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":` (+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`}),Me.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const NQ="";function pk({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,c]=We.useState(""),[h,u]=We.useState(!1),[d,A]=We.useState(!1),[p,g]=We.useState(!1),v=We.useRef(null),E=We.useRef(null),m=We.useRef(null);We.useEffect(()=>{n(h),h&&v.current?(v.current.style.backgroundColor="#ffffff",m.current&&(m.current.textContent=An.EngravingInputAvailable)):!h&&v.current&&(v.current.style.backgroundColor="transparent",m.current&&(m.current.textContent=An.EngravingInputHidden),c(""))}),We.useEffect(()=>{d&&o!=""&&(g(!1),i(o))},[d]),We.useEffect(()=>{p&&A(!1)},[p]),We.useEffect(()=>{var x;s&&((x=E.current)==null||x.focus())},[s]);const _=()=>{m.current&&(m.current.textContent=An.EnteredEngravingSection)},w=x=>{var I;x.key==="Enter"&&(i(o),(I=v.current)==null||I.blur(),m.current&&(m.current.textContent=An.AddedEngravingText+o))};return Me.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:m}),Me.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Me.jsx("input",{type:"checkbox",ref:E,className:"sprie-config-engraving-checkbox",onChange:x=>{u(x.target.checked)},onFocus:_,checked:h}),Me.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Me.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Me.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Me.jsx("input",{"aria-label":An.EnteredEngravingTextInput,type:"text",ref:v,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:x=>c(x.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onKeyDown:x=>w(x)}),Me.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const UQ="";function Ak({totalSteps:r,currentStep:e}){return Me.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function gk({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Me.jsxs("div",{className:"carousel-header",children:[Me.jsx("button",{className:"carousel-btn prev","aria-label":`return to the step number ${t} : ${n[t-1]}`,"aria-hidden":t==0,onClick:s,style:{visibility:t!==0?"visible":"hidden"},children:Me.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Me.jsxs("p",{children:[Me.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Me.jsx("span",{className:"select-syntax",children:n[t]})]}),Me.jsx("button",{className:"carousel-btn next","aria-label":`advance to step number ${t+2} : ${n[t+1]}`,"aria-hidden":!!i,onClick:o,style:{visibility:i?"hidden":"visible"},children:Me.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function mk({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=We.useState(0),o=Bh.Children.toArray(n),c=i===o.length-1,h=We.useRef(null),u=(g=o.map(v=>v))==null?void 0:g.map(v=>v.props.heading),d=()=>{s(v=>v===0?Bh.Children.count(n)-1:v-1),h.current&&h.current.focus()},A=()=>{s(v=>v===Bh.Children.count(n)-1?0:v+1),h.current&&h.current.focus()};We.useEffect(()=>{r(!!c)},[c]),We.useEffect(()=>{e(i)},[i]);const p=v=>{(v.key==="Enter"||v.key===" ")&&v.target===h.current&&t(i)};return Me.jsxs("div",{className:"carousel",style:{top:c&&sr?"-10%":""},children:[Me.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${c?"This is an optional":""} Step ${i+1} -
|
|
4466
4466
|
${o[i].props.heading}.
|
|
4467
4467
|
Press enter to `+(c?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Me.jsxs("div",{tabIndex:0,style:{height:"50%",alignContent:"end"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Me.jsx(gk,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:c}),Me.jsx(Ak,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Me.jsx("div",{className:"carousel-container",style:{paddingTop:sr?"":"1rem"},children:o.map((v,E)=>Me.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:v},E))})]})}const PQ="";function MI({conditionRequired:r,onButtonClick:e}){const[t,n]=We.useState(!1),i=We.useRef(null),s=We.useRef(null);return We.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),We.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Me.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Me.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Me.jsx("input",{type:"checkbox","aria-label":"return policy checkbox","aria-describedby":"sprie-config-return-policy-desc",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:o=>n(o.target.checked),checked:t}),Me.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Me.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function _k({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=We.useRef(null),c=We.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredOrbitalsListSection)};return We.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{display:n?"flex":"none",padding:"0 1.2rem 1.6rem 1.2rem",gap:sr?".3rem":"1rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-orbitalName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:h,disabled:t,children:Me.jsx("img",{"aria-label":`Select orbital ${u.name}`,src:u.thumbnail,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===u._id&&Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const vk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",yk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",Ek="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",kQ="";function xk({snapCameraTo:r}){const e=Object.keys(yf).map(s=>({label:yf[s],isDisabled:!0})),[t,n]=We.useState(),i=s=>{n(s),r(s)};return Me.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Me.jsx("button",{className:"sprie-3d-snap-button","aria-label":`orient 3d frame to ${s.label} view`,style:{backgroundColor:t!==s.label?"#ccc":"#000",color:t!==s.label?"#f3f3f3":"#fff"},onClick:()=>{i(yf[s.label])},children:s.label},o))})}function wk({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:c,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){const[v,E]=We.useState(0),[m,_]=We.useState(),[w,x]=We.useState(),[I,R]=We.useState(),[M,T]=We.useState(),[D,b]=We.useState(!1),[S,L]=We.useState(!1);We.useState(!1),We.useState(!1);const[P,N]=We.useState(sr?S?35:30:S?28:25),[W,X]=We.useState(sr?10:8),[K,te]=We.useState(),[H,ee]=We.useState(),[Q,z]=We.useState(),[Z,re]=We.useState(!1),[G,de]=We.useState("placeholder"),pe=We.useRef(null),fe=We.useRef(),ye=We.useRef(null);fe.current=h;const Pe={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"};let at,se,et;const ke=ve=>{fe.current&&(fe.current.snapCameraToPos(ve),Qe(An[`ChangedView${ve}`]))},dt=async(ve,xe)=>{ve._id===(w==null?void 0:w._id)&&!xe||fe.current&&(b(!0),fe.current.changeFrame(ve,[I,M]).then(()=>{b(!1)}),x(ve),te(d==null?void 0:d.find(Be=>Be.varinatSku==ve.sku)),Qe(`${An.ChangedFrame}${ve.name}`))},Xe=ve=>ve==null?void 0:ve.customisation.find(Be=>Be.type=="Lens"),ft=async ve=>{if(!fe.current||ve==I)return;const xe=ve.sku=="lens-default",Be=Xe(w),Ye=le();!Be&&xe?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):!Be&&!xe?(I==null?void 0:I.sku)=="lens-default"?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):fe.current.changeLens([ve,M],!1,w):Be&&xe?fe.current.changeLens([Be,M],!1,w):fe.current.changeLens([ve,M],!1,w),ve.sku=="lens-default"?(ee(Pe),Qe(`${An.ChangedLens}${Pe.variantName}`)):(ee(A==null?void 0:A.find(Le=>{var be;return Le.variantId==Number((be=ve.metadata.find(nt=>nt.key==Ye))==null?void 0:be.value)?Le:null})),Qe(`${An.ChangedLens}${ve.name}. Price will increase by ${H==null?void 0:H.variantPrice} ${H==null?void 0:H.priceCurrency}`)),R(ve)},Y=async ve=>{fe.current&&ve!=M&&(b(!0),await fe.current.changeOrbital(ve).then(()=>{z(p==null?void 0:p.find(xe=>xe.variantId==Number(ve.sku))),b(!1)}),T(ve),Qe(`${An.ChangedOrbital}${ve.name}`))},k=()=>(K==null?void 0:K.variantPrice)+((H==null?void 0:H.varinatSku)!=="lens-default"?H==null?void 0:H.variantPrice:0),le=()=>{var Be;if(!w)return;const ve=(Be=w.metadata.find(Ye=>Ye.key=="baseCurve"))==null?void 0:Be.value;let xe="variantId";return ve=="2B"?xe="2bVariantId":ve=="6B"&&(xe="6bVariantId"),xe},Ae=ve=>{re(ve)},me=ve=>{de(ve)},Ee=()=>{var ve,xe;console.log("about engraving link opened"),sr?(ve=document.querySelector('[id$="main-laser-etch-popover"]'))==null||ve.setAttribute("open",""):(xe=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||xe.setAttribute("open","")},Oe=()=>{if(o&&!Q||!(w&&I)||w.name.toLowerCase().includes("default")||I.name.toLowerCase().includes("default"))return;const ve=w.metadata.find(tt=>tt.key=="variantId"),xe=w.metadata.find(tt=>tt.key=="baseCurve");let Be="variantId";xe&&xe.value=="2B"?Be="2bVariantId":xe&&xe.value=="6B"&&(Be="6bVariantId");const Ye=I.metadata.find(tt=>tt.key==Be),Le=ve?Number(ve.value):null,be=Ye?Number(Ye.value):null,nt=Q!=null&&Q.variantId?Number(Q.variantId):null,pt={frameIdentifier:Le,lensIdentifier:be,orbitalIdentifier:nt};e.emitEvent("onAddToCart",pt);const ct=new Date().getTime(),ut=[];if(be&&Ye){const tt={id:be,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(nt&&(Q!=null&&Q.variantId)){const tt={id:nt,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(Z){const tt={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(ve){const tt={id:Le,quantity:1,properties:Z?{_uniqueTimestamp:ct,customText:G}:{_uniqueTimestamp:ct}};ut.push(tt)}t.HandleShopifyAddToCart(ut,ct)},Ce=()=>{var ve,xe;sr?(ve=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||ve.removeAttribute("open"):(xe=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||xe.removeAttribute("open")};We.useEffect(()=>{N(sr?S?35:30:S?28:25)},[S]),We.useEffect(()=>{o?(n&&!at&&(at=n.find(ve=>ve._id=="660c23a0d1d8f617271918f3"),x(at)),i&&!se&&(se=i.find(ve=>ve._id=="65111d718d4c652ece493034"),ft(se)),s&&!et&&(et=s.find(ve=>ve._id=="660c1c0231c23bd36b188fd4"),Y(et))):n&&x(n[0])},[n]),We.useEffect(()=>{te(g),ee(Pe)},[g]),We.useEffect(()=>{},[Z,G]);const Qe=ve=>{ye.current&&(ye.current.textContent=ve)};return Me.jsxs("section",{id:"sprie-config-main-container",ref:pe,children:[!c&&Me.jsxs("header",{id:"sprie-config-main-header",style:{height:`${W}%`},children:[Me.jsxs("div",{id:"sprie-config-header-content",children:[Me.jsx("img",{src:vk,alt:"dita-logo",width:97,height:20}),Me.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Me.jsx("button",{className:"sprie-config-main-header-close",onClick:Ce,"aria-label":"close frame customizer",children:Me.jsx("img",{src:Ek,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Me.jsx("span",{className:"sprie-config-sr-only",ref:ye,"aria-live":"assertive"}),Me.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>Qe(An.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${c?100:100-(P+W+(sr?8.5:0))}%`},children:[!c&&Me.jsx("img",{src:yk,alt:"360deg-logo",width:44,height:34}),!c&&Me.jsx(xk,{snapCameraTo:ke}),D&&Me.jsx("div",{className:"sprie-config-loadingFrame",children:Me.jsx("div",{className:"sprie-config-loader"})}),Me.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),!c&&Me.jsxs("section",{id:"Sprie-config-Customisation-block",style:{height:`${P}%`},children:[Me.jsxs(mk,{setShowAddToCart:L,setSelectedChild:E,setSectionEntered:_,children:[Me.jsx(dk,{modelLoading:D,frameList:n,selectedFrame:w,isSelected:v===0,onChangeFrame:dt,heading:"SELECT FRAME",paletteEntered:m===0}),o&&Me.jsx(_k,{orbitalList:s,selectedOrbital:M,modelLoading:D,isSelected:v===1,onChangeOrbital:Y,heading:"SELECT ORBITAL",paletteEntered:m===1}),Me.jsx(fk,{modelLoading:D,lensList:i,selectedLens:I,selectedDitaLens:H,isSelected:v===(o?2:1),paletteEntered:m===(o?2:1),onChangeLens:ft,heading:"SELECT LENS COLOR"}),Me.jsx(pk,{heading:"LASER ENGRAVING",isSelected:v===(o?3:2),paletteEntered:m===(o?3:2),onEngravingLinkClicked:Ee,onChecked:Ae,onTextAdded:me})]}),Me.jsxs("div",{className:"sprie-config-price-block",children:[Me.jsx("p",{id:"sprie-config-price-text",style:{bottom:sr?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${k()}.00 ${K==null?void 0:K.priceCurrency} `}),!sr&&S&&Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe}),S&&Me.jsx("p",{id:"sprie-config-process-time-text",style:{fontSize:".9rem",textAlign:"right",marginTop:"0",marginBottom:"0.5rem"},children:"Please Allow 7-10 Days for Customization Process."})]}),sr&&S&&Me.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe})})]})]})}function Ik({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=We.useRef(),[s,o]=We.useState(null),c=(s==null?void 0:s.frameName)||"",h=(s==null?void 0:s.frameList)||null,u=(s==null?void 0:s.lensList)||null,d=(s==null?void 0:s.orbitalList)||null;return s!=null&&s.dataVariants,s!=null&&s.dataLenses,s!=null&&s.dataOrbitals,We.useEffect(()=>((async()=>{var _,w;i.current=new SI,await((_=i.current)==null?void 0:_.Init(r.apiKey));const p=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=((w=p==null?void 0:p.customisation)==null?void 0:w.filter(x=>x.type==="Orbital").length)>0,v=await r.FetchCustomisationList("Lens",!g),E=await r.FetchCustomisationList("Orbital",!g),m=await i.current.getInstance({containerId:"holder-canvas"});await m.loadFrame({containerId:"holder-canvas",data:{assetDetails:p,customisation:p==null?void 0:p.customisation}}),o({frameList:p==null?void 0:p.variants,lensList:v==null?void 0:v.data,orbitalList:E==null?void 0:E.data,frameName:p==null?void 0:p.group.name,showOrbitals:g,domService:m,dataVariants:await r.PopulateDataList("data-variants"),dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})})(),()=>{i.current=void 0}),[r,e]),Me.jsxs(Me.Fragment,{children:[(!h||!u)&&Me.jsxs("div",{children:[Me.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Me.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Me.jsx(wk,{customEvent:t,frameName:c,apiService:r,frameList:h,lensList:u,orbitalList:d,showOrbitalList:(s==null?void 0:s.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:i.current,domService:s==null?void 0:s.domService,dataVariants:s==null?void 0:s.dataVariants,dataLenses:s==null?void 0:s.dataLenses,dataOrbitals:s==null?void 0:s.dataOrbitals,firstDitaVariant:(A=s==null?void 0:s.dataVariants)==null?void 0:A.find(p=>p.varinatSku==e)})]})}var Gm={},TI={exports:{}},Bn={},Vm={exports:{}},jm={};/**
|
|
4468
4468
|
* @license React
|
|
@@ -4484,7 +4484,7 @@ bool bvhIntersectFirstHit(
|
|
|
4484
4484
|
`+z+a}var re=!1;function G(a,l){if(!a||re)return"";re=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ce){var y=ce}Reflect.construct(a,[],l)}else{try{l.call()}catch(ce){y=ce}a.call(l.prototype)}else{try{throw Error()}catch(ce){y=ce}a()}}catch(ce){if(ce&&y&&typeof ce.stack=="string"){for(var C=ce.stack.split(`
|
|
4485
4485
|
`),B=y.stack.split(`
|
|
4486
4486
|
`),U=C.length-1,q=B.length-1;1<=U&&0<=q&&C[U]!==B[q];)q--;for(;1<=U&&0<=q;U--,q--)if(C[U]!==B[q]){if(U!==1||q!==1)do if(U--,q--,0>q||C[U]!==B[q]){var J=`
|
|
4487
|
-
`+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function de(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=G(a.type,!1),a;case 11:return a=G(a.type.render,!1),a;case 1:return a=G(a.type,!0),a;default:return""}}function pe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case M:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case S:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:pe(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return pe(a(l))}catch{}}return null}function fe(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(l);case 8:return l===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function at(a){var l=Pe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function se(a){a._valueTracker||(a._valueTracker=at(a))}function et(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Pe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function ke(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function dt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Xe(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ft(a,l);var f=ye(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?le(a,l.type,f):l.hasOwnProperty("defaultValue")&&le(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,l,f){(l!=="number"||ke(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ae=Array.isArray;function me(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function Ee(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Oe(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(Ae(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ce(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function ve(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xe(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?ve(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Be,Ye=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Be.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Le(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}var be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(be).forEach(function(a){nt.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),be[l]=be[a]})});function pt(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||be.hasOwnProperty(a)&&be[a]?(""+l).trim():l+"px"}function ct(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=pt(f,l[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var ut=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tt(a,l){if(l){if(ut[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function V(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 F=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,ze=null,Ne=null;function _t(a){if(a=fh(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){ze?Ne?Ne.push(a):Ne=[a]:ze=a}function Lt(){if(ze){var a=ze,l=Ne;if(Ne=ze=null,_t(a),l)for(a=0;a<l.length;a++)_t(l[a])}}function Mt(a,l){return a(l)}function vt(){}var hr=!1;function Vt(a,l,f){if(hr)return a(l,f);hr=!0;try{return Mt(a,l,f)}finally{hr=!1,(ze!==null||Ne!==null)&&(vt(),Lt())}}function _r(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,l,typeof f));return f}var bn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){bn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{bn=!1}function hi(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(Ie){this.onError(Ie)}}var Jn=!1,Ns=null,Us=!1,ac=null,wf={onError:function(a){Jn=!0,Ns=a}};function qm(a,l,f,y,C,B,U,q,J){Jn=!1,Ns=null,hi.apply(wf,arguments)}function Xm(a,l,f,y,C,B,U,q,J){if(qm.apply(this,arguments),Jn){if(Jn){var ce=Ns;Jn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,ac=ce)}}function Ps(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function O(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var l=a.alternate;if(!l){if(l=Ps(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ne(C),a;if(B===y)return ne(C),l;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:l}function he(a){return a=ue(a),a!==null?oe(a):null}function oe(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=oe(a);if(l!==null)return l;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,ot=e.unstable_requestPaint,qe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,Dr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Rn=e.unstable_LowPriority,di=e.unstable_IdlePriority,jt=null,rt=null;function Wu(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Ro,ks=Math.log,If=Math.LN2;function Ro(a){return a>>>=0,a===0?32:31-(ks(a)/If|0)|0}var Ia=64,vr=4194304;function Dn(a){switch(a&-a){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: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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ca(a,l){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=Dn(q):(B&=U,B!==0&&(y=Dn(B)))}else U=f&~C,U!==0?y=Dn(U):B!==0&&(y=Dn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-gn(l),C=1<<f,y|=a[f],l&=~C;return y}function Ln(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-gn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Ln(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function qu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Xu(){var a=Ia;return Ia<<=1,!(Ia&4194240)&&(Ia=64),a}function Km(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Ku(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-gn(l),a[l]=f}function Wk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-gn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Jm(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-gn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function YI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var qI,Zm,XI,KI,JI,$m=!1,Cf=[],Sa=null,Ma=null,Ta=null,Ju=new Map,Zu=new Map,Ba=[],Yk="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 submit".split(" ");function ZI(a,l){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":Ju.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zu.delete(l.pointerId)}}function $u(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=fh(l),l!==null&&Zm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function qk(a,l,f,y,C){switch(l){case"focusin":return Sa=$u(Sa,a,l,f,y,C),!0;case"dragenter":return Ma=$u(Ma,a,l,f,y,C),!0;case"mouseover":return Ta=$u(Ta,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Ju.set(B,$u(Ju.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,Zu.set(B,$u(Zu.get(B)||null,a,l,f,y,C)),!0}return!1}function $I(a){var l=Do(a.target);if(l!==null){var f=Ps(l);if(f!==null){if(l=f.tag,l===13){if(l=O(f),l!==null){a.blockedOn=l,JI(a.priority,function(){XI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Sf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=t0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);F=y,f.target.dispatchEvent(y),F=null}else return l=fh(f),l!==null&&Zm(l),a.blockedOn=f,!1;l.shift()}return!0}function eC(a,l,f){Sf(a)&&f.delete(l)}function Xk(){$m=!1,Sa!==null&&Sf(Sa)&&(Sa=null),Ma!==null&&Sf(Ma)&&(Ma=null),Ta!==null&&Sf(Ta)&&(Ta=null),Ju.forEach(eC),Zu.forEach(eC)}function eh(a,l){a.blockedOn===l&&(a.blockedOn=null,$m||($m=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Xk)))}function th(a){function l(C){return eh(C,a)}if(0<Cf.length){eh(Cf[0],a);for(var f=1;f<Cf.length;f++){var y=Cf[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&eh(Sa,a),Ma!==null&&eh(Ma,a),Ta!==null&&eh(Ta,a),Ju.forEach(l),Zu.forEach(l),f=0;f<Ba.length;f++)y=Ba[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ba.length&&(f=Ba[0],f.blockedOn===null);)$I(f),f.blockedOn===null&&Ba.shift()}var oc=I.ReactCurrentBatchConfig,Mf=!0;function Kk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=1,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function Jk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=4,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function e0(a,l,f,y){if(Mf){var C=t0(a,l,f,y);if(C===null)_0(a,l,y,Tf,f),ZI(a,y);else if(qk(C,a,l,f,y))y.stopPropagation();else if(ZI(a,y),l&4&&-1<Yk.indexOf(a)){for(;C!==null;){var B=fh(C);if(B!==null&&qI(B),B=t0(a,l,f,y),B===null&&_0(a,l,y,Tf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else _0(a,l,y,null,f)}}var Tf=null;function t0(a,l,f,y){if(Tf=null,a=ge(y),a=Do(a),a!==null)if(l=Ps(a),l===null)a=null;else if(f=l.tag,f===13){if(a=O(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Tf=a,null}function tC(a){switch(a){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(At()){case ht:return 1;case Dr:return 4;case er:case Rn:return 16;case di:return 536870912;default:return 16}default:return 16}}var ba=null,r0=null,Bf=null;function rC(){if(Bf)return Bf;var a,l=r0,f=l.length,y,C="value"in ba?ba.value:ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Bf=C.slice(a,1<y?1-y:void 0)}function bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Rf(){return!0}function nC(){return!1}function Zn(a){function l(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?Rf:nC,this.isPropagationStopped=nC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Rf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),l}var lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},n0=Zn(lc),rh=Q({},lc,{view:0,detail:0}),Zk=Zn(rh),i0,s0,nh,Df=Q({},rh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==nh&&(nh&&a.type==="mousemove"?(i0=a.screenX-nh.screenX,s0=a.screenY-nh.screenY):s0=i0=0,nh=a),i0)},movementY:function(a){return"movementY"in a?a.movementY:s0}}),iC=Zn(Df),$k=Q({},Df,{dataTransfer:0}),e7=Zn($k),t7=Q({},rh,{relatedTarget:0}),a0=Zn(t7),r7=Q({},lc,{animationName:0,elapsedTime:0,pseudoElement:0}),n7=Zn(r7),i7=Q({},lc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),s7=Zn(i7),a7=Q({},lc,{data:0}),sC=Zn(a7),o7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l7={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"},c7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=c7[a])?!!l[a]:!1}function o0(){return u7}var h7=Q({},rh,{key:function(a){if(a.key){var l=o7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?l7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(a){return a.type==="keypress"?bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d7=Zn(h7),f7=Q({},Df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aC=Zn(f7),p7=Q({},rh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),A7=Zn(p7),g7=Q({},lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),m7=Zn(g7),_7=Q({},Df,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),v7=Zn(_7),y7=[9,13,27,32],l0=c&&"CompositionEvent"in window,ih=null;c&&"documentMode"in document&&(ih=document.documentMode);var E7=c&&"TextEvent"in window&&!ih,oC=c&&(!l0||ih&&8<ih&&11>=ih),lC=String.fromCharCode(32),cC=!1;function uC(a,l){switch(a){case"keyup":return y7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var cc=!1;function x7(a,l){switch(a){case"compositionend":return hC(l);case"keypress":return l.which!==32?null:(cC=!0,lC);case"textInput":return a=l.data,a===lC&&cC?null:a;default:return null}}function w7(a,l){if(cc)return a==="compositionend"||!l0&&uC(a,l)?(a=rC(),Bf=r0=ba=null,cc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return oC&&l.locale!=="ko"?null:l.data;default:return null}}var I7={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 dC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!I7[a.type]:l==="textarea"}function fC(a,l,f,y){Dt(y),l=kf(l,"onChange"),0<l.length&&(f=new n0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var sh=null,ah=null;function C7(a){RC(a,0)}function Lf(a){var l=pc(a);if(et(l))return a}function S7(a,l){if(a==="change")return l}var pC=!1;if(c){var c0;if(c){var u0="oninput"in document;if(!u0){var AC=document.createElement("div");AC.setAttribute("oninput","return;"),u0=typeof AC.oninput=="function"}c0=u0}else c0=!1;pC=c0&&(!document.documentMode||9<document.documentMode)}function gC(){sh&&(sh.detachEvent("onpropertychange",mC),ah=sh=null)}function mC(a){if(a.propertyName==="value"&&Lf(ah)){var l=[];fC(l,ah,a,ge(a)),Vt(C7,l)}}function M7(a,l,f){a==="focusin"?(gC(),sh=l,ah=f,sh.attachEvent("onpropertychange",mC)):a==="focusout"&&gC()}function T7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Lf(ah)}function B7(a,l){if(a==="click")return Lf(l)}function b7(a,l){if(a==="input"||a==="change")return Lf(l)}function R7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Pi=typeof Object.is=="function"?Object.is:R7;function oh(a,l){if(Pi(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Pi(a[C],l[C]))return!1}return!0}function _C(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vC(a,l){var f=_C(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=_C(f)}}function yC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?yC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function EC(){for(var a=window,l=ke();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=ke(a.document)}return l}function h0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function D7(a){var l=EC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&yC(f.ownerDocument.documentElement,f)){if(y!==null&&h0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=vC(f,B);var U=vC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var L7=c&&"documentMode"in document&&11>=document.documentMode,uc=null,d0=null,lh=null,f0=!1;function xC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;f0||uc==null||uc!==ke(y)||(y=uc,"selectionStart"in y&&h0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),lh&&oh(lh,y)||(lh=y,y=kf(d0,"onSelect"),0<y.length&&(l=new n0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=uc)))}function Nf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var hc={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},p0={},wC={};c&&(wC=document.createElement("div").style,"AnimationEvent"in window||(delete hc.animationend.animation,delete hc.animationiteration.animation,delete hc.animationstart.animation),"TransitionEvent"in window||delete hc.transitionend.transition);function Uf(a){if(p0[a])return p0[a];if(!hc[a])return a;var l=hc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in wC)return p0[a]=l[f];return a}var IC=Uf("animationend"),CC=Uf("animationiteration"),SC=Uf("animationstart"),MC=Uf("transitionend"),TC=new Map,BC="abort auxClick 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 Ra(a,l){TC.set(a,l),s(l,[a])}for(var A0=0;A0<BC.length;A0++){var g0=BC[A0],N7=g0.toLowerCase(),U7=g0[0].toUpperCase()+g0.slice(1);Ra(N7,"on"+U7)}Ra(IC,"onAnimationEnd"),Ra(CC,"onAnimationIteration"),Ra(SC,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(MC,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ch="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(" "),P7=new Set("cancel close invalid load scroll toggle".split(" ").concat(ch));function bC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,Xm(y,l,void 0,a),a.currentTarget=null}function RC(a,l){l=(l&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(l)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;bC(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;bC(C,q,ce),B=J}}}if(Us)throw a=ac,Us=!1,ac=null,a}function Xt(a,l){var f=l[I0];f===void 0&&(f=l[I0]=new Set);var y=a+"__bubble";f.has(y)||(DC(l,a,2,!1),f.add(y))}function m0(a,l,f){var y=0;l&&(y|=4),DC(f,a,y,l)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function uh(a){if(!a[Pf]){a[Pf]=!0,n.forEach(function(f){f!=="selectionchange"&&(P7.has(f)||m0(f,!1,a),m0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Pf]||(l[Pf]=!0,m0("selectionchange",!1,l))}}function DC(a,l,f,y){switch(tC(l)){case 1:var C=Kk;break;case 4:C=Jk;break;default:C=e0}f=C.bind(null,l,f,a),C=void 0,!bn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function _0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Do(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,Ie=ge(f),Se=[];e:{var we=TC.get(a);if(we!==void 0){var Ue=n0,He=a;switch(a){case"keypress":if(bf(f)===0)break e;case"keydown":case"keyup":Ue=d7;break;case"focusin":He="focus",Ue=a0;break;case"focusout":He="blur",Ue=a0;break;case"beforeblur":case"afterblur":Ue=a0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ue=iC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=e7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=A7;break;case IC:case CC:case SC:Ue=n7;break;case MC:Ue=m7;break;case"scroll":Ue=Zk;break;case"wheel":Ue=v7;break;case"copy":case"cut":case"paste":Ue=s7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=aC}var Ve=(l&4)!==0,yr=!Ve&&a==="scroll",ie=Ve?we!==null?we+"Capture":null:we;Ve=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=_r($,ie),Te!=null&&Ve.push(hh($,Te,ae)))),yr)break;$=$.return}0<Ve.length&&(we=new Ue(we,He,null,f,Ie),Se.push({event:we,listeners:Ve}))}}if(!(l&7)){e:{if(we=a==="mouseover"||a==="pointerover",Ue=a==="mouseout"||a==="pointerout",we&&f!==F&&(He=f.relatedTarget||f.fromElement)&&(Do(He)||He[Qs]))break e;if((Ue||we)&&(we=Ie.window===Ie?Ie:(we=Ie.ownerDocument)?we.defaultView||we.parentWindow:window,Ue?(He=f.relatedTarget||f.toElement,Ue=ce,He=He?Do(He):null,He!==null&&(yr=Ps(He),He!==yr||He.tag!==5&&He.tag!==6)&&(He=null)):(Ue=null,He=ce),Ue!==He)){if(Ve=iC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=aC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),yr=Ue==null?we:pc(Ue),ae=He==null?we:pc(He),we=new Ve(Te,$+"leave",Ue,f,Ie),we.target=yr,we.relatedTarget=ae,Te=null,Do(Ie)===ce&&(Ve=new Ve(ie,$+"enter",He,f,Ie),Ve.target=ae,Ve.relatedTarget=yr,Te=Ve),yr=Te,Ue&&He)t:{for(Ve=Ue,ie=He,$=0,ae=Ve;ae;ae=dc(ae))$++;for(ae=0,Te=ie;Te;Te=dc(Te))ae++;for(;0<$-ae;)Ve=dc(Ve),$--;for(;0<ae-$;)ie=dc(ie),ae--;for(;$--;){if(Ve===ie||ie!==null&&Ve===ie.alternate)break t;Ve=dc(Ve),ie=dc(ie)}Ve=null}else Ve=null;Ue!==null&&LC(Se,we,Ue,Ve,!1),He!==null&&yr!==null&&LC(Se,yr,He,Ve,!0)}}e:{if(we=ce?pc(ce):window,Ue=we.nodeName&&we.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&we.type==="file")var je=S7;else if(dC(we))if(pC)je=b7;else{je=T7;var Ze=M7}else(Ue=we.nodeName)&&Ue.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(je=B7);if(je&&(je=je(a,ce))){fC(Se,je,f,Ie);break e}Ze&&Ze(a,we,ce),a==="focusout"&&(Ze=we._wrapperState)&&Ze.controlled&&we.type==="number"&&le(we,"number",we.value)}switch(Ze=ce?pc(ce):window,a){case"focusin":(dC(Ze)||Ze.contentEditable==="true")&&(uc=Ze,d0=ce,lh=null);break;case"focusout":lh=d0=uc=null;break;case"mousedown":f0=!0;break;case"contextmenu":case"mouseup":case"dragend":f0=!1,xC(Se,f,Ie);break;case"selectionchange":if(L7)break;case"keydown":case"keyup":xC(Se,f,Ie)}var $e;if(l0)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else cc?uC(a,f)&&(lt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(lt="onCompositionStart");lt&&(oC&&f.locale!=="ko"&&(cc||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&cc&&($e=rC()):(ba=Ie,r0="value"in ba?ba.value:ba.textContent,cc=!0)),Ze=kf(ce,lt),0<Ze.length&&(lt=new sC(lt,a,null,f,Ie),Se.push({event:lt,listeners:Ze}),$e?lt.data=$e:($e=hC(f),$e!==null&&(lt.data=$e)))),($e=E7?x7(a,f):w7(a,f))&&(ce=kf(ce,"onBeforeInput"),0<ce.length&&(Ie=new sC("onBeforeInput","beforeinput",null,f,Ie),Se.push({event:Ie,listeners:ce}),Ie.data=$e))}RC(Se,l)})}function hh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function kf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=_r(a,f),B!=null&&y.unshift(hh(a,B,C)),B=_r(a,l),B!=null&&y.push(hh(a,B,C))),a=a.return}return y}function dc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function LC(a,l,f,y,C){for(var B=l._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=_r(f,B),J!=null&&U.unshift(hh(f,J,q))):C||(J=_r(f,B),J!=null&&U.push(hh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var k7=/\r\n?/g,Q7=/\u0000|\uFFFD/g;function NC(a){return(typeof a=="string"?a:""+a).replace(k7,`
|
|
4488
|
-
`).replace(Q7,"")}function Qf(a,l,f){if(l=NC(l),NC(a)!==l&&f)throw Error(t(425))}function Ff(){}var v0=null,y0=null;function E0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var x0=typeof setTimeout=="function"?setTimeout:void 0,F7=typeof clearTimeout=="function"?clearTimeout:void 0,UC=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof UC<"u"?function(a){return UC.resolve(null).then(a).catch(z7)}:x0;function z7(a){setTimeout(function(){throw a})}function w0(a,l){var f=l,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),th(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);th(l)}function Da(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function PC(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return a;l--}else f==="/$"&&l++}a=a.previousSibling}return null}var fc=Math.random().toString(36).slice(2),is="__reactFiber$"+fc,dh="__reactProps$"+fc,Qs="__reactContainer$"+fc,I0="__reactEvents$"+fc,H7="__reactListeners$"+fc,G7="__reactHandles$"+fc;function Do(a){var l=a[is];if(l)return l;for(var f=a.parentNode;f;){if(l=f[Qs]||f[is]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(a=PC(a);a!==null;){if(f=a[is])return f;a=PC(a)}return l}a=f,f=a.parentNode}return null}function fh(a){return a=a[is]||a[Qs],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function pc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Of(a){return a[dh]||null}var C0=[],Ac=-1;function La(a){return{current:a}}function Kt(a){0>Ac||(a.current=C0[Ac],C0[Ac]=null,Ac--)}function Wt(a,l){Ac++,C0[Ac]=a.current,a.current=l}var Na={},rn=La(Na),Nn=La(!1),Lo=Na;function gc(a,l){var f=a.type.contextTypes;if(!f)return Na;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=l[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=C),C}function Un(a){return a=a.childContextTypes,a!=null}function zf(){Kt(Nn),Kt(rn)}function kC(a,l,f){if(rn.current!==Na)throw Error(t(168));Wt(rn,l),Wt(Nn,f)}function QC(a,l,f){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in l))throw Error(t(108,fe(a)||"Unknown",C));return Q({},f,y)}function Hf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Na,Lo=rn.current,Wt(rn,a),Wt(Nn,Nn.current),!0}function FC(a,l,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=QC(a,l,Lo),y.__reactInternalMemoizedMergedChildContext=a,Kt(Nn),Kt(rn),Wt(rn,a)):Kt(Nn),Wt(Nn,f)}var Fs=null,Gf=!1,S0=!1;function OC(a){Fs===null?Fs=[a]:Fs.push(a)}function V7(a){Gf=!0,OC(a)}function Ua(){if(!S0&&Fs!==null){S0=!0;var a=0,l=Pt;try{var f=Fs;for(Pt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Fs=null,Gf=!1}catch(C){throw Fs!==null&&(Fs=Fs.slice(a+1)),Re(ht,Ua),C}finally{Pt=l,S0=!1}}return null}var mc=[],_c=0,Vf=null,jf=0,fi=[],pi=0,No=null,Os=1,zs="";function Uo(a,l){mc[_c++]=jf,mc[_c++]=Vf,Vf=a,jf=l}function zC(a,l,f){fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=No,No=a;var y=Os;a=zs;var C=32-gn(y)-1;y&=~(1<<C),f+=1;var B=32-gn(l)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Os=1<<32-gn(l)+C|f<<C|y,zs=B+a}else Os=1<<B|f<<C|y,zs=a}function M0(a){a.return!==null&&(Uo(a,1),zC(a,1,0))}function T0(a){for(;a===Vf;)Vf=mc[--_c],mc[_c]=null,jf=mc[--_c],mc[_c]=null;for(;a===No;)No=fi[--pi],fi[pi]=null,zs=fi[--pi],fi[pi]=null,Os=fi[--pi],fi[pi]=null}var $n=null,ei=null,tr=!1,ki=null;function HC(a,l){var f=_i(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=a,l=a.deletions,l===null?(a.deletions=[f],a.flags|=16):l.push(f)}function GC(a,l){switch(a.tag){case 5:var f=a.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,$n=a,ei=Da(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,$n=a,ei=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=No!==null?{id:Os,overflow:zs}:null,a.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=_i(18,null,null,0),f.stateNode=l,f.return=a,a.child=f,$n=a,ei=null,!0):!1;default:return!1}}function B0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function b0(a){if(tr){var l=ei;if(l){var f=l;if(!GC(a,l)){if(B0(a))throw Error(t(418));l=Da(f.nextSibling);var y=$n;l&&GC(a,l)?HC(y,f):(a.flags=a.flags&-4097|2,tr=!1,$n=a)}}else{if(B0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,$n=a}}}function VC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;$n=a}function Wf(a){if(a!==$n)return!1;if(!tr)return VC(a),tr=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!E0(a.type,a.memoizedProps)),l&&(l=ei)){if(B0(a))throw jC(),Error(t(418));for(;l;)HC(a,l),l=Da(l.nextSibling)}if(VC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(l===0){ei=Da(a.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}a=a.nextSibling}ei=null}}else ei=$n?Da(a.stateNode.nextSibling):null;return!0}function jC(){for(var a=ei;a;)a=Da(a.nextSibling)}function vc(){ei=$n=null,tr=!1}function R0(a){ki===null?ki=[a]:ki.push(a)}var j7=I.ReactCurrentBatchConfig;function Qi(a,l){if(a&&a.defaultProps){l=Q({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Yf=La(null),qf=null,yc=null,D0=null;function L0(){D0=yc=qf=null}function N0(a){var l=Yf.current;Kt(Yf),a._currentValue=l}function U0(a,l,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===f)break;a=a.return}}function Ec(a,l){qf=a,D0=yc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Pn=!0),a.firstContext=null)}function Ai(a){var l=a._currentValue;if(D0!==a)if(a={context:a,memoizedValue:l,next:null},yc===null){if(qf===null)throw Error(t(308));yc=a,qf.dependencies={lanes:0,firstContext:a}}else yc=yc.next=a;return l}var Po=null;function P0(a){Po===null?Po=[a]:Po.push(a)}function WC(a,l,f,y){var C=l.interleaved;return C===null?(f.next=f,P0(l)):(f.next=C.next,C.next=f),l.interleaved=f,Hs(a,y)}function Hs(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Pa=!1;function k0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YC(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Gs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function ka(a,l,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,St&2){var C=y.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),y.pending=l,Hs(a,f)}return C=y.interleaved,C===null?(l.next=l,P0(y)):(l.next=C.next,C.next=l),y.interleaved=l,Hs(a,f)}function Xf(a,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}function qC(a,l){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=l:B=B.next=l}else C=B=l;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=l}function Kf(a,l,f,y){var C=a.updateQueue;Pa=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var Ie=a.alternate;Ie!==null&&(Ie=Ie.updateQueue,q=Ie.lastBaseUpdate,q!==U&&(q===null?Ie.firstBaseUpdate=ce:q.next=ce,Ie.lastBaseUpdate=J))}if(B!==null){var Se=C.baseState;U=0,Ie=ce=J=null,q=B;do{var we=q.lane,Ue=q.eventTime;if((y&we)===we){Ie!==null&&(Ie=Ie.next={eventTime:Ue,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var He=a,Ve=q;switch(we=l,Ue=f,Ve.tag){case 1:if(He=Ve.payload,typeof He=="function"){Se=He.call(Ue,Se,we);break e}Se=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ve.payload,we=typeof He=="function"?He.call(Ue,Se,we):He,we==null)break e;Se=Q({},Se,we);break e;case 2:Pa=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,we=C.effects,we===null?C.effects=[q]:we.push(q))}else Ue={eventTime:Ue,lane:we,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Ie===null?(ce=Ie=Ue,J=Se):Ie=Ie.next=Ue,U|=we;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;we=q,q=we.next,we.next=null,C.lastBaseUpdate=we,C.shared.pending=null}}while(1);if(Ie===null&&(J=Se),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=Ie,l=C.shared.interleaved,l!==null){C=l;do U|=C.lane,C=C.next;while(C!==l)}else B===null&&(C.shared.lanes=0);Fo|=U,a.lanes=U,a.memoizedState=Se}}function XC(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var KC=new r.Component().refs;function Q0(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:Q({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Jf={isMounted:function(a){return(a=a._reactInternals)?Ps(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.tag=1,B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=_n(),y=za(a),C=Gs(f,y);C.tag=2,l!=null&&(C.callback=l),l=ka(a,C,y),l!==null&&(zi(l,a,y,f),Xf(l,a,y))}};function JC(a,l,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):l.prototype&&l.prototype.isPureReactComponent?!oh(f,y)||!oh(C,B):!0}function ZC(a,l,f){var y=!1,C=Na,B=l.contextType;return typeof B=="object"&&B!==null?B=Ai(B):(C=Un(l)?Lo:rn.current,y=l.contextTypes,B=(y=y!=null)?gc(a,C):Na),l=new l(f,B),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Jf,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),l}function $C(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Jf.enqueueReplaceState(l,l.state,null)}function F0(a,l,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=KC,k0(a);var B=l.contextType;typeof B=="object"&&B!==null?C.context=Ai(B):(B=Un(l)?Lo:rn.current,C.context=gc(a,B)),C.state=a.memoizedState,B=l.getDerivedStateFromProps,typeof B=="function"&&(Q0(a,l,B,f),C.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&Jf.enqueueReplaceState(C,C.state,null),Kf(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function ph(a,l,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===B?l.ref:(l=function(U){var q=C.refs;q===KC&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},l._stringRef=B,l)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Zf(a,l){throw a=Object.prototype.toString.call(l),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function e3(a){var l=a._init;return l(a._payload)}function t3(a){function l(ie,$){if(a){var ae=ie.deletions;ae===null?(ie.deletions=[$],ie.flags|=16):ae.push($)}}function f(ie,$){if(!a)return null;for(;$!==null;)l(ie,$),$=$.sibling;return null}function y(ie,$){for(ie=new Map;$!==null;)$.key!==null?ie.set($.key,$):ie.set($.index,$),$=$.sibling;return ie}function C(ie,$){return ie=Ga(ie,$),ie.index=0,ie.sibling=null,ie}function B(ie,$,ae){return ie.index=ae,a?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<$?(ie.flags|=2,$):ae):(ie.flags|=2,$)):(ie.flags|=1048576,$)}function U(ie){return a&&ie.alternate===null&&(ie.flags|=2),ie}function q(ie,$,ae,Te){return $===null||$.tag!==6?($=x1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae),$.return=ie,$)}function J(ie,$,ae,Te){var je=ae.type;return je===T?Ie(ie,$,ae.props.children,Te,ae.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===$.type)?(Te=C($,ae.props),Te.ref=ph(ie,$,ae),Te.return=ie,Te):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=ph(ie,$,ae),Te.return=ie,Te)}function ce(ie,$,ae,Te){return $===null||$.tag!==4||$.stateNode.containerInfo!==ae.containerInfo||$.stateNode.implementation!==ae.implementation?($=w1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae.children||[]),$.return=ie,$)}function Ie(ie,$,ae,Te,je){return $===null||$.tag!==7?($=Go(ae,ie.mode,Te,je),$.return=ie,$):($=C($,ae),$.return=ie,$)}function Se(ie,$,ae){if(typeof $=="string"&&$!==""||typeof $=="number")return $=x1(""+$,ie.mode,ae),$.return=ie,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ae=mp($.type,$.key,$.props,null,ie.mode,ae),ae.ref=ph(ie,null,$),ae.return=ie,ae;case M:return $=w1($,ie.mode,ae),$.return=ie,$;case K:var Te=$._init;return Se(ie,Te($._payload),ae)}if(Ae($)||ee($))return $=Go($,ie.mode,ae,null),$.return=ie,$;Zf(ie,$)}return null}function we(ie,$,ae,Te){var je=$!==null?$.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return je!==null?null:q(ie,$,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===je?J(ie,$,ae,Te):null;case M:return ae.key===je?ce(ie,$,ae,Te):null;case K:return je=ae._init,we(ie,$,je(ae._payload),Te)}if(Ae(ae)||ee(ae))return je!==null?null:Ie(ie,$,ae,Te,null);Zf(ie,ae)}return null}function Ue(ie,$,ae,Te,je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ie=ie.get(ae)||null,q($,ie,""+Te,je);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case R:return ie=ie.get(Te.key===null?ae:Te.key)||null,J($,ie,Te,je);case M:return ie=ie.get(Te.key===null?ae:Te.key)||null,ce($,ie,Te,je);case K:var Ze=Te._init;return Ue(ie,$,ae,Ze(Te._payload),je)}if(Ae(Te)||ee(Te))return ie=ie.get(ae)||null,Ie($,ie,Te,je,null);Zf($,Te)}return null}function He(ie,$,ae,Te){for(var je=null,Ze=null,$e=$,lt=$=0,jr=null;$e!==null&<<ae.length;lt++){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Tt=we(ie,$e,ae[lt],Te);if(Tt===null){$e===null&&($e=jr);break}a&&$e&&Tt.alternate===null&&l(ie,$e),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt,$e=jr}if(lt===ae.length)return f(ie,$e),tr&&Uo(ie,lt),je;if($e===null){for(;lt<ae.length;lt++)$e=Se(ie,ae[lt],Te),$e!==null&&($=B($e,$,lt),Ze===null?je=$e:Ze.sibling=$e,Ze=$e);return tr&&Uo(ie,lt),je}for($e=y(ie,$e);lt<ae.length;lt++)jr=Ue($e,ie,lt,ae[lt],Te),jr!==null&&(a&&jr.alternate!==null&&$e.delete(jr.key===null?lt:jr.key),$=B(jr,$,lt),Ze===null?je=jr:Ze.sibling=jr,Ze=jr);return a&&$e.forEach(function(Va){return l(ie,Va)}),tr&&Uo(ie,lt),je}function Ve(ie,$,ae,Te){var je=ee(ae);if(typeof je!="function")throw Error(t(150));if(ae=je.call(ae),ae==null)throw Error(t(151));for(var Ze=je=null,$e=$,lt=$=0,jr=null,Tt=ae.next();$e!==null&&!Tt.done;lt++,Tt=ae.next()){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Va=we(ie,$e,Tt.value,Te);if(Va===null){$e===null&&($e=jr);break}a&&$e&&Va.alternate===null&&l(ie,$e),$=B(Va,$,lt),Ze===null?je=Va:Ze.sibling=Va,Ze=Va,$e=jr}if(Tt.done)return f(ie,$e),tr&&Uo(ie,lt),je;if($e===null){for(;!Tt.done;lt++,Tt=ae.next())Tt=Se(ie,Tt.value,Te),Tt!==null&&($=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return tr&&Uo(ie,lt),je}for($e=y(ie,$e);!Tt.done;lt++,Tt=ae.next())Tt=Ue($e,ie,lt,Tt.value,Te),Tt!==null&&(a&&Tt.alternate!==null&&$e.delete(Tt.key===null?lt:Tt.key),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return a&&$e.forEach(function(IQ){return l(ie,IQ)}),tr&&Uo(ie,lt),je}function yr(ie,$,ae,Te){if(typeof ae=="object"&&ae!==null&&ae.type===T&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:e:{for(var je=ae.key,Ze=$;Ze!==null;){if(Ze.key===je){if(je=ae.type,je===T){if(Ze.tag===7){f(ie,Ze.sibling),$=C(Ze,ae.props.children),$.return=ie,ie=$;break e}}else if(Ze.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===Ze.type){f(ie,Ze.sibling),$=C(Ze,ae.props),$.ref=ph(ie,Ze,ae),$.return=ie,ie=$;break e}f(ie,Ze);break}else l(ie,Ze);Ze=Ze.sibling}ae.type===T?($=Go(ae.props.children,ie.mode,Te,ae.key),$.return=ie,ie=$):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=ph(ie,$,ae),Te.return=ie,ie=Te)}return U(ie);case M:e:{for(Ze=ae.key;$!==null;){if($.key===Ze)if($.tag===4&&$.stateNode.containerInfo===ae.containerInfo&&$.stateNode.implementation===ae.implementation){f(ie,$.sibling),$=C($,ae.children||[]),$.return=ie,ie=$;break e}else{f(ie,$);break}else l(ie,$);$=$.sibling}$=w1(ae,ie.mode,Te),$.return=ie,ie=$}return U(ie);case K:return Ze=ae._init,yr(ie,$,Ze(ae._payload),Te)}if(Ae(ae))return He(ie,$,ae,Te);if(ee(ae))return Ve(ie,$,ae,Te);Zf(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,$!==null&&$.tag===6?(f(ie,$.sibling),$=C($,ae),$.return=ie,ie=$):(f(ie,$),$=x1(ae,ie.mode,Te),$.return=ie,ie=$),U(ie)):f(ie,$)}return yr}var xc=t3(!0),r3=t3(!1),Ah={},ss=La(Ah),gh=La(Ah),mh=La(Ah);function ko(a){if(a===Ah)throw Error(t(174));return a}function O0(a,l){switch(Wt(mh,l),Wt(gh,a),Wt(ss,Ah),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:xe(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=xe(l,a)}Kt(ss),Wt(ss,l)}function wc(){Kt(ss),Kt(gh),Kt(mh)}function n3(a){ko(mh.current);var l=ko(ss.current),f=xe(l,a.type);l!==f&&(Wt(gh,a),Wt(ss,f))}function z0(a){gh.current===a&&(Kt(ss),Kt(gh))}var ar=La(0);function $f(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var H0=[];function G0(){for(var a=0;a<H0.length;a++)H0[a]._workInProgressVersionPrimary=null;H0.length=0}var ep=I.ReactCurrentDispatcher,V0=I.ReactCurrentBatchConfig,Qo=0,or=null,Lr=null,Gr=null,tp=!1,_h=!1,vh=0,W7=0;function nn(){throw Error(t(321))}function j0(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Pi(a[f],l[f]))return!1;return!0}function W0(a,l,f,y,C,B){if(Qo=B,or=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,ep.current=a===null||a.memoizedState===null?K7:J7,a=f(y,C),_h){B=0;do{if(_h=!1,vh=0,25<=B)throw Error(t(301));B+=1,Gr=Lr=null,l.updateQueue=null,ep.current=Z7,a=f(y,C)}while(_h)}if(ep.current=ip,l=Lr!==null&&Lr.next!==null,Qo=0,Gr=Lr=or=null,tp=!1,l)throw Error(t(300));return a}function Y0(){var a=vh!==0;return vh=0,a}function as(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a,Gr}function gi(){if(Lr===null){var a=or.alternate;a=a!==null?a.memoizedState:null}else a=Lr.next;var l=Gr===null?or.memoizedState:Gr.next;if(l!==null)Gr=l,Lr=a;else{if(a===null)throw Error(t(310));Lr=a,a={memoizedState:Lr.memoizedState,baseState:Lr.baseState,baseQueue:Lr.baseQueue,queue:Lr.queue,next:null},Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a}return Gr}function yh(a,l){return typeof l=="function"?l(a):l}function q0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Lr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var Ie=ce.lane;if((Qo&Ie)===Ie)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Se={lane:Ie,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Se,U=y):J=J.next=Se,or.lanes|=Ie,Fo|=Ie}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,Pi(y,l.memoizedState)||(Pn=!0),l.memoizedState=y,l.baseState=U,l.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,or.lanes|=B,Fo|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function X0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=l.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);Pi(B,l.memoizedState)||(Pn=!0),l.memoizedState=B,l.baseQueue===null&&(l.baseState=B),f.lastRenderedState=B}return[B,y]}function i3(){}function s3(a,l){var f=or,y=gi(),C=l(),B=!Pi(y.memoizedState,C);if(B&&(y.memoizedState=C,Pn=!0),y=y.queue,K0(l3.bind(null,f,y,a),[a]),y.getSnapshot!==l||B||Gr!==null&&Gr.memoizedState.tag&1){if(f.flags|=2048,Eh(9,o3.bind(null,f,y,C,l),void 0,null),Vr===null)throw Error(t(349));Qo&30||a3(f,l,C)}return C}function a3(a,l,f){a.flags|=16384,a={getSnapshot:l,value:f},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.stores=[a]):(f=l.stores,f===null?l.stores=[a]:f.push(a))}function o3(a,l,f,y){l.value=f,l.getSnapshot=y,c3(l)&&u3(a)}function l3(a,l,f){return f(function(){c3(l)&&u3(a)})}function c3(a){var l=a.getSnapshot;a=a.value;try{var f=l();return!Pi(a,f)}catch{return!0}}function u3(a){var l=Hs(a,1);l!==null&&zi(l,a,1,-1)}function h3(a){var l=as();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yh,lastRenderedState:a},l.queue=a,a=a.dispatch=X7.bind(null,or,a),[l.memoizedState,a]}function Eh(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function d3(){return gi().memoizedState}function rp(a,l,f,y){var C=as();or.flags|=a,C.memoizedState=Eh(1|l,f,void 0,y===void 0?null:y)}function np(a,l,f,y){var C=gi();y=y===void 0?null:y;var B=void 0;if(Lr!==null){var U=Lr.memoizedState;if(B=U.destroy,y!==null&&j0(y,U.deps)){C.memoizedState=Eh(l,f,B,y);return}}or.flags|=a,C.memoizedState=Eh(1|l,f,B,y)}function f3(a,l){return rp(8390656,8,a,l)}function K0(a,l){return np(2048,8,a,l)}function p3(a,l){return np(4,2,a,l)}function A3(a,l){return np(4,4,a,l)}function g3(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function m3(a,l,f){return f=f!=null?f.concat([a]):null,np(4,4,g3.bind(null,l,a),f)}function J0(){}function _3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function v3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function y3(a,l,f){return Qo&21?(Pi(f,l)||(f=Xu(),or.lanes|=f,Fo|=f,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,Pn=!0),a.memoizedState=f)}function Y7(a,l){var f=Pt;Pt=f!==0&&4>f?f:4,a(!0);var y=V0.transition;V0.transition={};try{a(!1),l()}finally{Pt=f,V0.transition=y}}function E3(){return gi().memoizedState}function q7(a,l,f){var y=za(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},x3(a))w3(l,f);else if(f=WC(a,l,f,y),f!==null){var C=_n();zi(f,a,y,C),I3(f,l,y)}}function X7(a,l,f){var y=za(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(x3(a))w3(l,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=l.lastRenderedReducer,B!==null))try{var U=l.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,Pi(q,U)){var J=l.interleaved;J===null?(C.next=C,P0(l)):(C.next=J.next,J.next=C),l.interleaved=C;return}}catch{}finally{}f=WC(a,l,C,y),f!==null&&(C=_n(),zi(f,a,y,C),I3(f,l,y))}}function x3(a){var l=a.alternate;return a===or||l!==null&&l===or}function w3(a,l){_h=tp=!0;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}function I3(a,l,f){if(f&4194240){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}var ip={readContext:Ai,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},K7={readContext:Ai,useCallback:function(a,l){return as().memoizedState=[a,l===void 0?null:l],a},useContext:Ai,useEffect:f3,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,rp(4194308,4,g3.bind(null,l,a),f)},useLayoutEffect:function(a,l){return rp(4194308,4,a,l)},useInsertionEffect:function(a,l){return rp(4,2,a,l)},useMemo:function(a,l){var f=as();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=as();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=q7.bind(null,or,a),[y.memoizedState,a]},useRef:function(a){var l=as();return a={current:a},l.memoizedState=a},useState:h3,useDebugValue:J0,useDeferredValue:function(a){return as().memoizedState=a},useTransition:function(){var a=h3(!1),l=a[0];return a=Y7.bind(null,a[1]),as().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,f){var y=or,C=as();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=l(),Vr===null)throw Error(t(349));Qo&30||a3(y,l,f)}C.memoizedState=f;var B={value:f,getSnapshot:l};return C.queue=B,f3(l3.bind(null,y,B,a),[a]),y.flags|=2048,Eh(9,o3.bind(null,y,B,f,l),void 0,null),f},useId:function(){var a=as(),l=Vr.identifierPrefix;if(tr){var f=zs,y=Os;f=(y&~(1<<32-gn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=vh++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=W7++,l=":"+l+"r"+f.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},J7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:q0,useRef:d3,useState:function(){return q0(yh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return y3(l,Lr.memoizedState,a)},useTransition:function(){var a=q0(yh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1},Z7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:X0,useRef:d3,useState:function(){return X0(yh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return Lr===null?l.memoizedState=a:y3(l,Lr.memoizedState,a)},useTransition:function(){var a=X0(yh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1};function Ic(a,l){try{var f="",y=l;do f+=de(y),y=y.return;while(y);var C=f}catch(B){C=`
|
|
4487
|
+
`+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function de(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=G(a.type,!1),a;case 11:return a=G(a.type.render,!1),a;case 1:return a=G(a.type,!0),a;default:return""}}function pe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case M:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case S:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:pe(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return pe(a(l))}catch{}}return null}function fe(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(l);case 8:return l===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function at(a){var l=Pe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function se(a){a._valueTracker||(a._valueTracker=at(a))}function et(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Pe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function ke(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function dt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Xe(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ft(a,l);var f=ye(l.value),y=l.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?le(a,l.type,f):l.hasOwnProperty("defaultValue")&&le(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,l,f){(l!=="number"||ke(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ae=Array.isArray;function me(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function Ee(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Oe(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(Ae(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ce(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function ve(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xe(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?ve(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Be,Ye=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Be.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Le(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}var be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(be).forEach(function(a){nt.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),be[l]=be[a]})});function pt(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||be.hasOwnProperty(a)&&be[a]?(""+l).trim():l+"px"}function ct(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=pt(f,l[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var ut=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tt(a,l){if(l){if(ut[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function V(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 F=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,ze=null,Ne=null;function _t(a){if(a=ph(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){ze?Ne?Ne.push(a):Ne=[a]:ze=a}function Lt(){if(ze){var a=ze,l=Ne;if(Ne=ze=null,_t(a),l)for(a=0;a<l.length;a++)_t(l[a])}}function Mt(a,l){return a(l)}function vt(){}var hr=!1;function Vt(a,l,f){if(hr)return a(l,f);hr=!0;try{return Mt(a,l,f)}finally{hr=!1,(ze!==null||Ne!==null)&&(vt(),Lt())}}function _r(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,l,typeof f));return f}var bn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){bn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{bn=!1}function hi(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(Ie){this.onError(Ie)}}var Jn=!1,Ns=null,Us=!1,ac=null,wf={onError:function(a){Jn=!0,Ns=a}};function qm(a,l,f,y,C,B,U,q,J){Jn=!1,Ns=null,hi.apply(wf,arguments)}function Xm(a,l,f,y,C,B,U,q,J){if(qm.apply(this,arguments),Jn){if(Jn){var ce=Ns;Jn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,ac=ce)}}function Ps(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function O(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var l=a.alternate;if(!l){if(l=Ps(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ne(C),a;if(B===y)return ne(C),l;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:l}function he(a){return a=ue(a),a!==null?oe(a):null}function oe(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=oe(a);if(l!==null)return l;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,ot=e.unstable_requestPaint,qe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,Dr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Rn=e.unstable_LowPriority,di=e.unstable_IdlePriority,jt=null,rt=null;function Yu(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Do,ks=Math.log,If=Math.LN2;function Do(a){return a>>>=0,a===0?32:31-(ks(a)/If|0)|0}var Ia=64,vr=4194304;function Dn(a){switch(a&-a){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: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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ca(a,l){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=Dn(q):(B&=U,B!==0&&(y=Dn(B)))}else U=f&~C,U!==0?y=Dn(U):B!==0&&(y=Dn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-gn(l),C=1<<f,y|=a[f],l&=~C;return y}function Ln(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-gn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Ln(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function Xu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ku(){var a=Ia;return Ia<<=1,!(Ia&4194240)&&(Ia=64),a}function Km(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Ju(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-gn(l),a[l]=f}function Wk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-gn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Jm(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-gn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function YI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var qI,Zm,XI,KI,JI,$m=!1,Cf=[],Sa=null,Ma=null,Ta=null,Zu=new Map,$u=new Map,Ba=[],Yk="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 submit".split(" ");function ZI(a,l){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":Zu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":$u.delete(l.pointerId)}}function eh(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=ph(l),l!==null&&Zm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function qk(a,l,f,y,C){switch(l){case"focusin":return Sa=eh(Sa,a,l,f,y,C),!0;case"dragenter":return Ma=eh(Ma,a,l,f,y,C),!0;case"mouseover":return Ta=eh(Ta,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Zu.set(B,eh(Zu.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,$u.set(B,eh($u.get(B)||null,a,l,f,y,C)),!0}return!1}function $I(a){var l=Lo(a.target);if(l!==null){var f=Ps(l);if(f!==null){if(l=f.tag,l===13){if(l=O(f),l!==null){a.blockedOn=l,JI(a.priority,function(){XI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Sf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=t0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);F=y,f.target.dispatchEvent(y),F=null}else return l=ph(f),l!==null&&Zm(l),a.blockedOn=f,!1;l.shift()}return!0}function eC(a,l,f){Sf(a)&&f.delete(l)}function Xk(){$m=!1,Sa!==null&&Sf(Sa)&&(Sa=null),Ma!==null&&Sf(Ma)&&(Ma=null),Ta!==null&&Sf(Ta)&&(Ta=null),Zu.forEach(eC),$u.forEach(eC)}function th(a,l){a.blockedOn===l&&(a.blockedOn=null,$m||($m=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Xk)))}function rh(a){function l(C){return th(C,a)}if(0<Cf.length){th(Cf[0],a);for(var f=1;f<Cf.length;f++){var y=Cf[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&th(Sa,a),Ma!==null&&th(Ma,a),Ta!==null&&th(Ta,a),Zu.forEach(l),$u.forEach(l),f=0;f<Ba.length;f++)y=Ba[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ba.length&&(f=Ba[0],f.blockedOn===null);)$I(f),f.blockedOn===null&&Ba.shift()}var oc=I.ReactCurrentBatchConfig,Mf=!0;function Kk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=1,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function Jk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=4,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function e0(a,l,f,y){if(Mf){var C=t0(a,l,f,y);if(C===null)_0(a,l,y,Tf,f),ZI(a,y);else if(qk(C,a,l,f,y))y.stopPropagation();else if(ZI(a,y),l&4&&-1<Yk.indexOf(a)){for(;C!==null;){var B=ph(C);if(B!==null&&qI(B),B=t0(a,l,f,y),B===null&&_0(a,l,y,Tf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else _0(a,l,y,null,f)}}var Tf=null;function t0(a,l,f,y){if(Tf=null,a=ge(y),a=Lo(a),a!==null)if(l=Ps(a),l===null)a=null;else if(f=l.tag,f===13){if(a=O(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Tf=a,null}function tC(a){switch(a){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(At()){case ht:return 1;case Dr:return 4;case er:case Rn:return 16;case di:return 536870912;default:return 16}default:return 16}}var ba=null,r0=null,Bf=null;function rC(){if(Bf)return Bf;var a,l=r0,f=l.length,y,C="value"in ba?ba.value:ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Bf=C.slice(a,1<y?1-y:void 0)}function bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Rf(){return!0}function nC(){return!1}function Zn(a){function l(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?Rf:nC,this.isPropagationStopped=nC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Rf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),l}var lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},n0=Zn(lc),nh=Q({},lc,{view:0,detail:0}),Zk=Zn(nh),i0,s0,ih,Df=Q({},nh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ih&&(ih&&a.type==="mousemove"?(i0=a.screenX-ih.screenX,s0=a.screenY-ih.screenY):s0=i0=0,ih=a),i0)},movementY:function(a){return"movementY"in a?a.movementY:s0}}),iC=Zn(Df),$k=Q({},Df,{dataTransfer:0}),e7=Zn($k),t7=Q({},nh,{relatedTarget:0}),a0=Zn(t7),r7=Q({},lc,{animationName:0,elapsedTime:0,pseudoElement:0}),n7=Zn(r7),i7=Q({},lc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),s7=Zn(i7),a7=Q({},lc,{data:0}),sC=Zn(a7),o7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l7={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"},c7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=c7[a])?!!l[a]:!1}function o0(){return u7}var h7=Q({},nh,{key:function(a){if(a.key){var l=o7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?l7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(a){return a.type==="keypress"?bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d7=Zn(h7),f7=Q({},Df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aC=Zn(f7),p7=Q({},nh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),A7=Zn(p7),g7=Q({},lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),m7=Zn(g7),_7=Q({},Df,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),v7=Zn(_7),y7=[9,13,27,32],l0=c&&"CompositionEvent"in window,sh=null;c&&"documentMode"in document&&(sh=document.documentMode);var E7=c&&"TextEvent"in window&&!sh,oC=c&&(!l0||sh&&8<sh&&11>=sh),lC=String.fromCharCode(32),cC=!1;function uC(a,l){switch(a){case"keyup":return y7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var cc=!1;function x7(a,l){switch(a){case"compositionend":return hC(l);case"keypress":return l.which!==32?null:(cC=!0,lC);case"textInput":return a=l.data,a===lC&&cC?null:a;default:return null}}function w7(a,l){if(cc)return a==="compositionend"||!l0&&uC(a,l)?(a=rC(),Bf=r0=ba=null,cc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return oC&&l.locale!=="ko"?null:l.data;default:return null}}var I7={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 dC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!I7[a.type]:l==="textarea"}function fC(a,l,f,y){Dt(y),l=kf(l,"onChange"),0<l.length&&(f=new n0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var ah=null,oh=null;function C7(a){RC(a,0)}function Lf(a){var l=pc(a);if(et(l))return a}function S7(a,l){if(a==="change")return l}var pC=!1;if(c){var c0;if(c){var u0="oninput"in document;if(!u0){var AC=document.createElement("div");AC.setAttribute("oninput","return;"),u0=typeof AC.oninput=="function"}c0=u0}else c0=!1;pC=c0&&(!document.documentMode||9<document.documentMode)}function gC(){ah&&(ah.detachEvent("onpropertychange",mC),oh=ah=null)}function mC(a){if(a.propertyName==="value"&&Lf(oh)){var l=[];fC(l,oh,a,ge(a)),Vt(C7,l)}}function M7(a,l,f){a==="focusin"?(gC(),ah=l,oh=f,ah.attachEvent("onpropertychange",mC)):a==="focusout"&&gC()}function T7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Lf(oh)}function B7(a,l){if(a==="click")return Lf(l)}function b7(a,l){if(a==="input"||a==="change")return Lf(l)}function R7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Pi=typeof Object.is=="function"?Object.is:R7;function lh(a,l){if(Pi(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Pi(a[C],l[C]))return!1}return!0}function _C(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vC(a,l){var f=_C(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=_C(f)}}function yC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?yC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function EC(){for(var a=window,l=ke();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=ke(a.document)}return l}function h0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function D7(a){var l=EC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&yC(f.ownerDocument.documentElement,f)){if(y!==null&&h0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=vC(f,B);var U=vC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var L7=c&&"documentMode"in document&&11>=document.documentMode,uc=null,d0=null,ch=null,f0=!1;function xC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;f0||uc==null||uc!==ke(y)||(y=uc,"selectionStart"in y&&h0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ch&&lh(ch,y)||(ch=y,y=kf(d0,"onSelect"),0<y.length&&(l=new n0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=uc)))}function Nf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var hc={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},p0={},wC={};c&&(wC=document.createElement("div").style,"AnimationEvent"in window||(delete hc.animationend.animation,delete hc.animationiteration.animation,delete hc.animationstart.animation),"TransitionEvent"in window||delete hc.transitionend.transition);function Uf(a){if(p0[a])return p0[a];if(!hc[a])return a;var l=hc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in wC)return p0[a]=l[f];return a}var IC=Uf("animationend"),CC=Uf("animationiteration"),SC=Uf("animationstart"),MC=Uf("transitionend"),TC=new Map,BC="abort auxClick 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 Ra(a,l){TC.set(a,l),s(l,[a])}for(var A0=0;A0<BC.length;A0++){var g0=BC[A0],N7=g0.toLowerCase(),U7=g0[0].toUpperCase()+g0.slice(1);Ra(N7,"on"+U7)}Ra(IC,"onAnimationEnd"),Ra(CC,"onAnimationIteration"),Ra(SC,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(MC,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uh="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(" "),P7=new Set("cancel close invalid load scroll toggle".split(" ").concat(uh));function bC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,Xm(y,l,void 0,a),a.currentTarget=null}function RC(a,l){l=(l&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(l)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;bC(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;bC(C,q,ce),B=J}}}if(Us)throw a=ac,Us=!1,ac=null,a}function Xt(a,l){var f=l[I0];f===void 0&&(f=l[I0]=new Set);var y=a+"__bubble";f.has(y)||(DC(l,a,2,!1),f.add(y))}function m0(a,l,f){var y=0;l&&(y|=4),DC(f,a,y,l)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function hh(a){if(!a[Pf]){a[Pf]=!0,n.forEach(function(f){f!=="selectionchange"&&(P7.has(f)||m0(f,!1,a),m0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Pf]||(l[Pf]=!0,m0("selectionchange",!1,l))}}function DC(a,l,f,y){switch(tC(l)){case 1:var C=Kk;break;case 4:C=Jk;break;default:C=e0}f=C.bind(null,l,f,a),C=void 0,!bn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function _0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Lo(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,Ie=ge(f),Se=[];e:{var we=TC.get(a);if(we!==void 0){var Ue=n0,He=a;switch(a){case"keypress":if(bf(f)===0)break e;case"keydown":case"keyup":Ue=d7;break;case"focusin":He="focus",Ue=a0;break;case"focusout":He="blur",Ue=a0;break;case"beforeblur":case"afterblur":Ue=a0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ue=iC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=e7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=A7;break;case IC:case CC:case SC:Ue=n7;break;case MC:Ue=m7;break;case"scroll":Ue=Zk;break;case"wheel":Ue=v7;break;case"copy":case"cut":case"paste":Ue=s7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=aC}var Ve=(l&4)!==0,yr=!Ve&&a==="scroll",ie=Ve?we!==null?we+"Capture":null:we;Ve=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=_r($,ie),Te!=null&&Ve.push(dh($,Te,ae)))),yr)break;$=$.return}0<Ve.length&&(we=new Ue(we,He,null,f,Ie),Se.push({event:we,listeners:Ve}))}}if(!(l&7)){e:{if(we=a==="mouseover"||a==="pointerover",Ue=a==="mouseout"||a==="pointerout",we&&f!==F&&(He=f.relatedTarget||f.fromElement)&&(Lo(He)||He[Qs]))break e;if((Ue||we)&&(we=Ie.window===Ie?Ie:(we=Ie.ownerDocument)?we.defaultView||we.parentWindow:window,Ue?(He=f.relatedTarget||f.toElement,Ue=ce,He=He?Lo(He):null,He!==null&&(yr=Ps(He),He!==yr||He.tag!==5&&He.tag!==6)&&(He=null)):(Ue=null,He=ce),Ue!==He)){if(Ve=iC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=aC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),yr=Ue==null?we:pc(Ue),ae=He==null?we:pc(He),we=new Ve(Te,$+"leave",Ue,f,Ie),we.target=yr,we.relatedTarget=ae,Te=null,Lo(Ie)===ce&&(Ve=new Ve(ie,$+"enter",He,f,Ie),Ve.target=ae,Ve.relatedTarget=yr,Te=Ve),yr=Te,Ue&&He)t:{for(Ve=Ue,ie=He,$=0,ae=Ve;ae;ae=dc(ae))$++;for(ae=0,Te=ie;Te;Te=dc(Te))ae++;for(;0<$-ae;)Ve=dc(Ve),$--;for(;0<ae-$;)ie=dc(ie),ae--;for(;$--;){if(Ve===ie||ie!==null&&Ve===ie.alternate)break t;Ve=dc(Ve),ie=dc(ie)}Ve=null}else Ve=null;Ue!==null&&LC(Se,we,Ue,Ve,!1),He!==null&&yr!==null&&LC(Se,yr,He,Ve,!0)}}e:{if(we=ce?pc(ce):window,Ue=we.nodeName&&we.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&we.type==="file")var je=S7;else if(dC(we))if(pC)je=b7;else{je=T7;var Ze=M7}else(Ue=we.nodeName)&&Ue.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(je=B7);if(je&&(je=je(a,ce))){fC(Se,je,f,Ie);break e}Ze&&Ze(a,we,ce),a==="focusout"&&(Ze=we._wrapperState)&&Ze.controlled&&we.type==="number"&&le(we,"number",we.value)}switch(Ze=ce?pc(ce):window,a){case"focusin":(dC(Ze)||Ze.contentEditable==="true")&&(uc=Ze,d0=ce,ch=null);break;case"focusout":ch=d0=uc=null;break;case"mousedown":f0=!0;break;case"contextmenu":case"mouseup":case"dragend":f0=!1,xC(Se,f,Ie);break;case"selectionchange":if(L7)break;case"keydown":case"keyup":xC(Se,f,Ie)}var $e;if(l0)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else cc?uC(a,f)&&(lt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(lt="onCompositionStart");lt&&(oC&&f.locale!=="ko"&&(cc||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&cc&&($e=rC()):(ba=Ie,r0="value"in ba?ba.value:ba.textContent,cc=!0)),Ze=kf(ce,lt),0<Ze.length&&(lt=new sC(lt,a,null,f,Ie),Se.push({event:lt,listeners:Ze}),$e?lt.data=$e:($e=hC(f),$e!==null&&(lt.data=$e)))),($e=E7?x7(a,f):w7(a,f))&&(ce=kf(ce,"onBeforeInput"),0<ce.length&&(Ie=new sC("onBeforeInput","beforeinput",null,f,Ie),Se.push({event:Ie,listeners:ce}),Ie.data=$e))}RC(Se,l)})}function dh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function kf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=_r(a,f),B!=null&&y.unshift(dh(a,B,C)),B=_r(a,l),B!=null&&y.push(dh(a,B,C))),a=a.return}return y}function dc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function LC(a,l,f,y,C){for(var B=l._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=_r(f,B),J!=null&&U.unshift(dh(f,J,q))):C||(J=_r(f,B),J!=null&&U.push(dh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var k7=/\r\n?/g,Q7=/\u0000|\uFFFD/g;function NC(a){return(typeof a=="string"?a:""+a).replace(k7,`
|
|
4488
|
+
`).replace(Q7,"")}function Qf(a,l,f){if(l=NC(l),NC(a)!==l&&f)throw Error(t(425))}function Ff(){}var v0=null,y0=null;function E0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var x0=typeof setTimeout=="function"?setTimeout:void 0,F7=typeof clearTimeout=="function"?clearTimeout:void 0,UC=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof UC<"u"?function(a){return UC.resolve(null).then(a).catch(z7)}:x0;function z7(a){setTimeout(function(){throw a})}function w0(a,l){var f=l,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),rh(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);rh(l)}function Da(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function PC(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return a;l--}else f==="/$"&&l++}a=a.previousSibling}return null}var fc=Math.random().toString(36).slice(2),is="__reactFiber$"+fc,fh="__reactProps$"+fc,Qs="__reactContainer$"+fc,I0="__reactEvents$"+fc,H7="__reactListeners$"+fc,G7="__reactHandles$"+fc;function Lo(a){var l=a[is];if(l)return l;for(var f=a.parentNode;f;){if(l=f[Qs]||f[is]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(a=PC(a);a!==null;){if(f=a[is])return f;a=PC(a)}return l}a=f,f=a.parentNode}return null}function ph(a){return a=a[is]||a[Qs],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function pc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Of(a){return a[fh]||null}var C0=[],Ac=-1;function La(a){return{current:a}}function Kt(a){0>Ac||(a.current=C0[Ac],C0[Ac]=null,Ac--)}function Wt(a,l){Ac++,C0[Ac]=a.current,a.current=l}var Na={},rn=La(Na),Nn=La(!1),No=Na;function gc(a,l){var f=a.type.contextTypes;if(!f)return Na;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=l[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=C),C}function Un(a){return a=a.childContextTypes,a!=null}function zf(){Kt(Nn),Kt(rn)}function kC(a,l,f){if(rn.current!==Na)throw Error(t(168));Wt(rn,l),Wt(Nn,f)}function QC(a,l,f){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in l))throw Error(t(108,fe(a)||"Unknown",C));return Q({},f,y)}function Hf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Na,No=rn.current,Wt(rn,a),Wt(Nn,Nn.current),!0}function FC(a,l,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=QC(a,l,No),y.__reactInternalMemoizedMergedChildContext=a,Kt(Nn),Kt(rn),Wt(rn,a)):Kt(Nn),Wt(Nn,f)}var Fs=null,Gf=!1,S0=!1;function OC(a){Fs===null?Fs=[a]:Fs.push(a)}function V7(a){Gf=!0,OC(a)}function Ua(){if(!S0&&Fs!==null){S0=!0;var a=0,l=Pt;try{var f=Fs;for(Pt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Fs=null,Gf=!1}catch(C){throw Fs!==null&&(Fs=Fs.slice(a+1)),Re(ht,Ua),C}finally{Pt=l,S0=!1}}return null}var mc=[],_c=0,Vf=null,jf=0,fi=[],pi=0,Uo=null,Os=1,zs="";function Po(a,l){mc[_c++]=jf,mc[_c++]=Vf,Vf=a,jf=l}function zC(a,l,f){fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=Uo,Uo=a;var y=Os;a=zs;var C=32-gn(y)-1;y&=~(1<<C),f+=1;var B=32-gn(l)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Os=1<<32-gn(l)+C|f<<C|y,zs=B+a}else Os=1<<B|f<<C|y,zs=a}function M0(a){a.return!==null&&(Po(a,1),zC(a,1,0))}function T0(a){for(;a===Vf;)Vf=mc[--_c],mc[_c]=null,jf=mc[--_c],mc[_c]=null;for(;a===Uo;)Uo=fi[--pi],fi[pi]=null,zs=fi[--pi],fi[pi]=null,Os=fi[--pi],fi[pi]=null}var $n=null,ei=null,tr=!1,ki=null;function HC(a,l){var f=_i(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=a,l=a.deletions,l===null?(a.deletions=[f],a.flags|=16):l.push(f)}function GC(a,l){switch(a.tag){case 5:var f=a.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,$n=a,ei=Da(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,$n=a,ei=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Uo!==null?{id:Os,overflow:zs}:null,a.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=_i(18,null,null,0),f.stateNode=l,f.return=a,a.child=f,$n=a,ei=null,!0):!1;default:return!1}}function B0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function b0(a){if(tr){var l=ei;if(l){var f=l;if(!GC(a,l)){if(B0(a))throw Error(t(418));l=Da(f.nextSibling);var y=$n;l&&GC(a,l)?HC(y,f):(a.flags=a.flags&-4097|2,tr=!1,$n=a)}}else{if(B0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,$n=a}}}function VC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;$n=a}function Wf(a){if(a!==$n)return!1;if(!tr)return VC(a),tr=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!E0(a.type,a.memoizedProps)),l&&(l=ei)){if(B0(a))throw jC(),Error(t(418));for(;l;)HC(a,l),l=Da(l.nextSibling)}if(VC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(l===0){ei=Da(a.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}a=a.nextSibling}ei=null}}else ei=$n?Da(a.stateNode.nextSibling):null;return!0}function jC(){for(var a=ei;a;)a=Da(a.nextSibling)}function vc(){ei=$n=null,tr=!1}function R0(a){ki===null?ki=[a]:ki.push(a)}var j7=I.ReactCurrentBatchConfig;function Qi(a,l){if(a&&a.defaultProps){l=Q({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Yf=La(null),qf=null,yc=null,D0=null;function L0(){D0=yc=qf=null}function N0(a){var l=Yf.current;Kt(Yf),a._currentValue=l}function U0(a,l,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===f)break;a=a.return}}function Ec(a,l){qf=a,D0=yc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Pn=!0),a.firstContext=null)}function Ai(a){var l=a._currentValue;if(D0!==a)if(a={context:a,memoizedValue:l,next:null},yc===null){if(qf===null)throw Error(t(308));yc=a,qf.dependencies={lanes:0,firstContext:a}}else yc=yc.next=a;return l}var ko=null;function P0(a){ko===null?ko=[a]:ko.push(a)}function WC(a,l,f,y){var C=l.interleaved;return C===null?(f.next=f,P0(l)):(f.next=C.next,C.next=f),l.interleaved=f,Hs(a,y)}function Hs(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Pa=!1;function k0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YC(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Gs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function ka(a,l,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,St&2){var C=y.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),y.pending=l,Hs(a,f)}return C=y.interleaved,C===null?(l.next=l,P0(y)):(l.next=C.next,C.next=l),y.interleaved=l,Hs(a,f)}function Xf(a,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}function qC(a,l){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=l:B=B.next=l}else C=B=l;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=l:a.next=l,f.lastBaseUpdate=l}function Kf(a,l,f,y){var C=a.updateQueue;Pa=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var Ie=a.alternate;Ie!==null&&(Ie=Ie.updateQueue,q=Ie.lastBaseUpdate,q!==U&&(q===null?Ie.firstBaseUpdate=ce:q.next=ce,Ie.lastBaseUpdate=J))}if(B!==null){var Se=C.baseState;U=0,Ie=ce=J=null,q=B;do{var we=q.lane,Ue=q.eventTime;if((y&we)===we){Ie!==null&&(Ie=Ie.next={eventTime:Ue,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var He=a,Ve=q;switch(we=l,Ue=f,Ve.tag){case 1:if(He=Ve.payload,typeof He=="function"){Se=He.call(Ue,Se,we);break e}Se=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ve.payload,we=typeof He=="function"?He.call(Ue,Se,we):He,we==null)break e;Se=Q({},Se,we);break e;case 2:Pa=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,we=C.effects,we===null?C.effects=[q]:we.push(q))}else Ue={eventTime:Ue,lane:we,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Ie===null?(ce=Ie=Ue,J=Se):Ie=Ie.next=Ue,U|=we;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;we=q,q=we.next,we.next=null,C.lastBaseUpdate=we,C.shared.pending=null}}while(1);if(Ie===null&&(J=Se),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=Ie,l=C.shared.interleaved,l!==null){C=l;do U|=C.lane,C=C.next;while(C!==l)}else B===null&&(C.shared.lanes=0);Oo|=U,a.lanes=U,a.memoizedState=Se}}function XC(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var KC=new r.Component().refs;function Q0(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:Q({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Jf={isMounted:function(a){return(a=a._reactInternals)?Ps(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.tag=1,B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=_n(),y=za(a),C=Gs(f,y);C.tag=2,l!=null&&(C.callback=l),l=ka(a,C,y),l!==null&&(zi(l,a,y,f),Xf(l,a,y))}};function JC(a,l,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):l.prototype&&l.prototype.isPureReactComponent?!lh(f,y)||!lh(C,B):!0}function ZC(a,l,f){var y=!1,C=Na,B=l.contextType;return typeof B=="object"&&B!==null?B=Ai(B):(C=Un(l)?No:rn.current,y=l.contextTypes,B=(y=y!=null)?gc(a,C):Na),l=new l(f,B),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Jf,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),l}function $C(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Jf.enqueueReplaceState(l,l.state,null)}function F0(a,l,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=KC,k0(a);var B=l.contextType;typeof B=="object"&&B!==null?C.context=Ai(B):(B=Un(l)?No:rn.current,C.context=gc(a,B)),C.state=a.memoizedState,B=l.getDerivedStateFromProps,typeof B=="function"&&(Q0(a,l,B,f),C.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&Jf.enqueueReplaceState(C,C.state,null),Kf(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function Ah(a,l,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===B?l.ref:(l=function(U){var q=C.refs;q===KC&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},l._stringRef=B,l)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Zf(a,l){throw a=Object.prototype.toString.call(l),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function e3(a){var l=a._init;return l(a._payload)}function t3(a){function l(ie,$){if(a){var ae=ie.deletions;ae===null?(ie.deletions=[$],ie.flags|=16):ae.push($)}}function f(ie,$){if(!a)return null;for(;$!==null;)l(ie,$),$=$.sibling;return null}function y(ie,$){for(ie=new Map;$!==null;)$.key!==null?ie.set($.key,$):ie.set($.index,$),$=$.sibling;return ie}function C(ie,$){return ie=Ga(ie,$),ie.index=0,ie.sibling=null,ie}function B(ie,$,ae){return ie.index=ae,a?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<$?(ie.flags|=2,$):ae):(ie.flags|=2,$)):(ie.flags|=1048576,$)}function U(ie){return a&&ie.alternate===null&&(ie.flags|=2),ie}function q(ie,$,ae,Te){return $===null||$.tag!==6?($=x1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae),$.return=ie,$)}function J(ie,$,ae,Te){var je=ae.type;return je===T?Ie(ie,$,ae.props.children,Te,ae.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===$.type)?(Te=C($,ae.props),Te.ref=Ah(ie,$,ae),Te.return=ie,Te):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=Ah(ie,$,ae),Te.return=ie,Te)}function ce(ie,$,ae,Te){return $===null||$.tag!==4||$.stateNode.containerInfo!==ae.containerInfo||$.stateNode.implementation!==ae.implementation?($=w1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae.children||[]),$.return=ie,$)}function Ie(ie,$,ae,Te,je){return $===null||$.tag!==7?($=Vo(ae,ie.mode,Te,je),$.return=ie,$):($=C($,ae),$.return=ie,$)}function Se(ie,$,ae){if(typeof $=="string"&&$!==""||typeof $=="number")return $=x1(""+$,ie.mode,ae),$.return=ie,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ae=mp($.type,$.key,$.props,null,ie.mode,ae),ae.ref=Ah(ie,null,$),ae.return=ie,ae;case M:return $=w1($,ie.mode,ae),$.return=ie,$;case K:var Te=$._init;return Se(ie,Te($._payload),ae)}if(Ae($)||ee($))return $=Vo($,ie.mode,ae,null),$.return=ie,$;Zf(ie,$)}return null}function we(ie,$,ae,Te){var je=$!==null?$.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return je!==null?null:q(ie,$,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===je?J(ie,$,ae,Te):null;case M:return ae.key===je?ce(ie,$,ae,Te):null;case K:return je=ae._init,we(ie,$,je(ae._payload),Te)}if(Ae(ae)||ee(ae))return je!==null?null:Ie(ie,$,ae,Te,null);Zf(ie,ae)}return null}function Ue(ie,$,ae,Te,je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ie=ie.get(ae)||null,q($,ie,""+Te,je);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case R:return ie=ie.get(Te.key===null?ae:Te.key)||null,J($,ie,Te,je);case M:return ie=ie.get(Te.key===null?ae:Te.key)||null,ce($,ie,Te,je);case K:var Ze=Te._init;return Ue(ie,$,ae,Ze(Te._payload),je)}if(Ae(Te)||ee(Te))return ie=ie.get(ae)||null,Ie($,ie,Te,je,null);Zf($,Te)}return null}function He(ie,$,ae,Te){for(var je=null,Ze=null,$e=$,lt=$=0,jr=null;$e!==null&<<ae.length;lt++){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Tt=we(ie,$e,ae[lt],Te);if(Tt===null){$e===null&&($e=jr);break}a&&$e&&Tt.alternate===null&&l(ie,$e),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt,$e=jr}if(lt===ae.length)return f(ie,$e),tr&&Po(ie,lt),je;if($e===null){for(;lt<ae.length;lt++)$e=Se(ie,ae[lt],Te),$e!==null&&($=B($e,$,lt),Ze===null?je=$e:Ze.sibling=$e,Ze=$e);return tr&&Po(ie,lt),je}for($e=y(ie,$e);lt<ae.length;lt++)jr=Ue($e,ie,lt,ae[lt],Te),jr!==null&&(a&&jr.alternate!==null&&$e.delete(jr.key===null?lt:jr.key),$=B(jr,$,lt),Ze===null?je=jr:Ze.sibling=jr,Ze=jr);return a&&$e.forEach(function(Va){return l(ie,Va)}),tr&&Po(ie,lt),je}function Ve(ie,$,ae,Te){var je=ee(ae);if(typeof je!="function")throw Error(t(150));if(ae=je.call(ae),ae==null)throw Error(t(151));for(var Ze=je=null,$e=$,lt=$=0,jr=null,Tt=ae.next();$e!==null&&!Tt.done;lt++,Tt=ae.next()){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Va=we(ie,$e,Tt.value,Te);if(Va===null){$e===null&&($e=jr);break}a&&$e&&Va.alternate===null&&l(ie,$e),$=B(Va,$,lt),Ze===null?je=Va:Ze.sibling=Va,Ze=Va,$e=jr}if(Tt.done)return f(ie,$e),tr&&Po(ie,lt),je;if($e===null){for(;!Tt.done;lt++,Tt=ae.next())Tt=Se(ie,Tt.value,Te),Tt!==null&&($=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return tr&&Po(ie,lt),je}for($e=y(ie,$e);!Tt.done;lt++,Tt=ae.next())Tt=Ue($e,ie,lt,Tt.value,Te),Tt!==null&&(a&&Tt.alternate!==null&&$e.delete(Tt.key===null?lt:Tt.key),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return a&&$e.forEach(function(IQ){return l(ie,IQ)}),tr&&Po(ie,lt),je}function yr(ie,$,ae,Te){if(typeof ae=="object"&&ae!==null&&ae.type===T&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:e:{for(var je=ae.key,Ze=$;Ze!==null;){if(Ze.key===je){if(je=ae.type,je===T){if(Ze.tag===7){f(ie,Ze.sibling),$=C(Ze,ae.props.children),$.return=ie,ie=$;break e}}else if(Ze.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===Ze.type){f(ie,Ze.sibling),$=C(Ze,ae.props),$.ref=Ah(ie,Ze,ae),$.return=ie,ie=$;break e}f(ie,Ze);break}else l(ie,Ze);Ze=Ze.sibling}ae.type===T?($=Vo(ae.props.children,ie.mode,Te,ae.key),$.return=ie,ie=$):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=Ah(ie,$,ae),Te.return=ie,ie=Te)}return U(ie);case M:e:{for(Ze=ae.key;$!==null;){if($.key===Ze)if($.tag===4&&$.stateNode.containerInfo===ae.containerInfo&&$.stateNode.implementation===ae.implementation){f(ie,$.sibling),$=C($,ae.children||[]),$.return=ie,ie=$;break e}else{f(ie,$);break}else l(ie,$);$=$.sibling}$=w1(ae,ie.mode,Te),$.return=ie,ie=$}return U(ie);case K:return Ze=ae._init,yr(ie,$,Ze(ae._payload),Te)}if(Ae(ae))return He(ie,$,ae,Te);if(ee(ae))return Ve(ie,$,ae,Te);Zf(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,$!==null&&$.tag===6?(f(ie,$.sibling),$=C($,ae),$.return=ie,ie=$):(f(ie,$),$=x1(ae,ie.mode,Te),$.return=ie,ie=$),U(ie)):f(ie,$)}return yr}var xc=t3(!0),r3=t3(!1),gh={},ss=La(gh),mh=La(gh),_h=La(gh);function Qo(a){if(a===gh)throw Error(t(174));return a}function O0(a,l){switch(Wt(_h,l),Wt(mh,a),Wt(ss,gh),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:xe(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=xe(l,a)}Kt(ss),Wt(ss,l)}function wc(){Kt(ss),Kt(mh),Kt(_h)}function n3(a){Qo(_h.current);var l=Qo(ss.current),f=xe(l,a.type);l!==f&&(Wt(mh,a),Wt(ss,f))}function z0(a){mh.current===a&&(Kt(ss),Kt(mh))}var ar=La(0);function $f(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var H0=[];function G0(){for(var a=0;a<H0.length;a++)H0[a]._workInProgressVersionPrimary=null;H0.length=0}var ep=I.ReactCurrentDispatcher,V0=I.ReactCurrentBatchConfig,Fo=0,or=null,Lr=null,Gr=null,tp=!1,vh=!1,yh=0,W7=0;function nn(){throw Error(t(321))}function j0(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Pi(a[f],l[f]))return!1;return!0}function W0(a,l,f,y,C,B){if(Fo=B,or=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,ep.current=a===null||a.memoizedState===null?K7:J7,a=f(y,C),vh){B=0;do{if(vh=!1,yh=0,25<=B)throw Error(t(301));B+=1,Gr=Lr=null,l.updateQueue=null,ep.current=Z7,a=f(y,C)}while(vh)}if(ep.current=ip,l=Lr!==null&&Lr.next!==null,Fo=0,Gr=Lr=or=null,tp=!1,l)throw Error(t(300));return a}function Y0(){var a=yh!==0;return yh=0,a}function as(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a,Gr}function gi(){if(Lr===null){var a=or.alternate;a=a!==null?a.memoizedState:null}else a=Lr.next;var l=Gr===null?or.memoizedState:Gr.next;if(l!==null)Gr=l,Lr=a;else{if(a===null)throw Error(t(310));Lr=a,a={memoizedState:Lr.memoizedState,baseState:Lr.baseState,baseQueue:Lr.baseQueue,queue:Lr.queue,next:null},Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a}return Gr}function Eh(a,l){return typeof l=="function"?l(a):l}function q0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Lr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var Ie=ce.lane;if((Fo&Ie)===Ie)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Se={lane:Ie,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Se,U=y):J=J.next=Se,or.lanes|=Ie,Oo|=Ie}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,Pi(y,l.memoizedState)||(Pn=!0),l.memoizedState=y,l.baseState=U,l.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,or.lanes|=B,Oo|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function X0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=l.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);Pi(B,l.memoizedState)||(Pn=!0),l.memoizedState=B,l.baseQueue===null&&(l.baseState=B),f.lastRenderedState=B}return[B,y]}function i3(){}function s3(a,l){var f=or,y=gi(),C=l(),B=!Pi(y.memoizedState,C);if(B&&(y.memoizedState=C,Pn=!0),y=y.queue,K0(l3.bind(null,f,y,a),[a]),y.getSnapshot!==l||B||Gr!==null&&Gr.memoizedState.tag&1){if(f.flags|=2048,xh(9,o3.bind(null,f,y,C,l),void 0,null),Vr===null)throw Error(t(349));Fo&30||a3(f,l,C)}return C}function a3(a,l,f){a.flags|=16384,a={getSnapshot:l,value:f},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.stores=[a]):(f=l.stores,f===null?l.stores=[a]:f.push(a))}function o3(a,l,f,y){l.value=f,l.getSnapshot=y,c3(l)&&u3(a)}function l3(a,l,f){return f(function(){c3(l)&&u3(a)})}function c3(a){var l=a.getSnapshot;a=a.value;try{var f=l();return!Pi(a,f)}catch{return!0}}function u3(a){var l=Hs(a,1);l!==null&&zi(l,a,1,-1)}function h3(a){var l=as();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eh,lastRenderedState:a},l.queue=a,a=a.dispatch=X7.bind(null,or,a),[l.memoizedState,a]}function xh(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function d3(){return gi().memoizedState}function rp(a,l,f,y){var C=as();or.flags|=a,C.memoizedState=xh(1|l,f,void 0,y===void 0?null:y)}function np(a,l,f,y){var C=gi();y=y===void 0?null:y;var B=void 0;if(Lr!==null){var U=Lr.memoizedState;if(B=U.destroy,y!==null&&j0(y,U.deps)){C.memoizedState=xh(l,f,B,y);return}}or.flags|=a,C.memoizedState=xh(1|l,f,B,y)}function f3(a,l){return rp(8390656,8,a,l)}function K0(a,l){return np(2048,8,a,l)}function p3(a,l){return np(4,2,a,l)}function A3(a,l){return np(4,4,a,l)}function g3(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function m3(a,l,f){return f=f!=null?f.concat([a]):null,np(4,4,g3.bind(null,l,a),f)}function J0(){}function _3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function v3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function y3(a,l,f){return Fo&21?(Pi(f,l)||(f=Ku(),or.lanes|=f,Oo|=f,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,Pn=!0),a.memoizedState=f)}function Y7(a,l){var f=Pt;Pt=f!==0&&4>f?f:4,a(!0);var y=V0.transition;V0.transition={};try{a(!1),l()}finally{Pt=f,V0.transition=y}}function E3(){return gi().memoizedState}function q7(a,l,f){var y=za(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},x3(a))w3(l,f);else if(f=WC(a,l,f,y),f!==null){var C=_n();zi(f,a,y,C),I3(f,l,y)}}function X7(a,l,f){var y=za(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(x3(a))w3(l,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=l.lastRenderedReducer,B!==null))try{var U=l.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,Pi(q,U)){var J=l.interleaved;J===null?(C.next=C,P0(l)):(C.next=J.next,J.next=C),l.interleaved=C;return}}catch{}finally{}f=WC(a,l,C,y),f!==null&&(C=_n(),zi(f,a,y,C),I3(f,l,y))}}function x3(a){var l=a.alternate;return a===or||l!==null&&l===or}function w3(a,l){vh=tp=!0;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}function I3(a,l,f){if(f&4194240){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}var ip={readContext:Ai,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},K7={readContext:Ai,useCallback:function(a,l){return as().memoizedState=[a,l===void 0?null:l],a},useContext:Ai,useEffect:f3,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,rp(4194308,4,g3.bind(null,l,a),f)},useLayoutEffect:function(a,l){return rp(4194308,4,a,l)},useInsertionEffect:function(a,l){return rp(4,2,a,l)},useMemo:function(a,l){var f=as();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=as();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=q7.bind(null,or,a),[y.memoizedState,a]},useRef:function(a){var l=as();return a={current:a},l.memoizedState=a},useState:h3,useDebugValue:J0,useDeferredValue:function(a){return as().memoizedState=a},useTransition:function(){var a=h3(!1),l=a[0];return a=Y7.bind(null,a[1]),as().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,f){var y=or,C=as();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=l(),Vr===null)throw Error(t(349));Fo&30||a3(y,l,f)}C.memoizedState=f;var B={value:f,getSnapshot:l};return C.queue=B,f3(l3.bind(null,y,B,a),[a]),y.flags|=2048,xh(9,o3.bind(null,y,B,f,l),void 0,null),f},useId:function(){var a=as(),l=Vr.identifierPrefix;if(tr){var f=zs,y=Os;f=(y&~(1<<32-gn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=yh++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=W7++,l=":"+l+"r"+f.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},J7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:q0,useRef:d3,useState:function(){return q0(Eh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return y3(l,Lr.memoizedState,a)},useTransition:function(){var a=q0(Eh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1},Z7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:X0,useRef:d3,useState:function(){return X0(Eh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return Lr===null?l.memoizedState=a:y3(l,Lr.memoizedState,a)},useTransition:function(){var a=X0(Eh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1};function Ic(a,l){try{var f="",y=l;do f+=de(y),y=y.return;while(y);var C=f}catch(B){C=`
|
|
4489
4489
|
Error generating stack: `+B.message+`
|
|
4490
|
-
`+B.stack}return{value:a,source:l,stack:C,digest:null}}function Z0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function $0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var $7=typeof WeakMap=="function"?WeakMap:Map;function C3(a,l,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){hp||(hp=!0,p1=y),$0(a,l)},f}function S3(a,l,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){$0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){$0(a,l),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new $7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=fQ.bind(null,a,l,f),l.then(a,a))}function T3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function B3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Gs(-1,1),l.tag=2,ka(f,l,1))),f.lanes|=1),a)}var eQ=I.ReactCurrentOwner,Pn=!1;function mn(a,l,f,y){l.child=a===null?r3(l,null,f,y):xc(l,a.child,f,y)}function b3(a,l,f,y,C){f=f.render;var B=l.ref;return Ec(l,C),y=W0(a,l,f,y,B,C),f=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,mn(a,l,y,C),l.child)}function R3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!E1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,D3(a,l,B,y,C)):(a=mp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:oh,f(U,y)&&a.ref===l.ref)return Vs(a,l,C)}return l.flags|=1,a=Ga(B,y),a.ref=l.ref,a.return=l,l.child=a}function D3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(oh(B,y)&&a.ref===l.ref)if(Pn=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Pn=!0);else return l.lanes=a.lanes,Vs(a,l,C)}return e1(a,l,f,y,C)}function L3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Sc,ti),ti|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Sc,ti),ti|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Sc,ti),ti|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Sc,ti),ti|=y;return mn(a,l,C,f),l.child}function N3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function e1(a,l,f,y,C){var B=Un(f)?Lo:rn.current;return B=gc(l,B),Ec(l,C),f=W0(a,l,f,y,B,C),y=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,mn(a,l,f,C),l.child)}function U3(a,l,f,y,C){if(Un(f)){var B=!0;Hf(l)}else B=!1;if(Ec(l,C),l.stateNode===null)ap(a,l),ZC(l,f,y),F0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=Ai(ce):(ce=Un(f)?Lo:rn.current,ce=gc(l,ce));var Ie=f.getDerivedStateFromProps,Se=typeof Ie=="function"||typeof U.getSnapshotBeforeUpdate=="function";Se||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&$C(l,U,y,ce),Pa=!1;var we=l.memoizedState;U.state=we,Kf(l,y,U,C),J=l.memoizedState,q!==y||we!==J||Nn.current||Pa?(typeof Ie=="function"&&(Q0(l,f,Ie,y),J=l.memoizedState),(q=Pa||JC(l,f,q,y,we,J,ce))?(Se||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,YC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:Qi(l.type,q),U.props=ce,Se=l.pendingProps,we=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=Ai(J):(J=Un(f)?Lo:rn.current,J=gc(l,J));var Ue=f.getDerivedStateFromProps;(Ie=typeof Ue=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Se||we!==J)&&$C(l,U,y,J),Pa=!1,we=l.memoizedState,U.state=we,Kf(l,y,U,C);var He=l.memoizedState;q!==Se||we!==He||Nn.current||Pa?(typeof Ue=="function"&&(Q0(l,f,Ue,y),He=l.memoizedState),(ce=Pa||JC(l,f,ce,y,we,He,J)||!1)?(Ie||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,He,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,He,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=He),U.props=y,U.state=He,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),y=!1)}return t1(a,l,f,y,B,C)}function t1(a,l,f,y,C,B){N3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&FC(l,f,!1),Vs(a,l,B);y=l.stateNode,eQ.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=xc(l,a.child,null,B),l.child=xc(l,null,q,B)):mn(a,l,q,B),l.memoizedState=y.state,C&&FC(l,f,!0),l.child}function P3(a){var l=a.stateNode;l.pendingContext?kC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&kC(a,l.context,!1),O0(a,l.containerInfo)}function k3(a,l,f,y,C){return vc(),R0(C),l.flags|=256,mn(a,l,f,y),l.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Q3(a,l,f){var y=l.pendingProps,C=ar.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return b0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=_p(U,y,0,null),a=Go(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=n1(f),l.memoizedState=r1,a):i1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return tQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ga(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ga(q,B):(B=Go(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?n1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=r1,y}return B=a.child,a=B.sibling,y=Ga(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function i1(a,l){return l=_p({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function sp(a,l,f,y){return y!==null&&R0(y),xc(l,a.child,null,f),a=i1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function tQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=Z0(Error(t(422))),sp(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=_p({mode:"visible",children:y.children},C,0,null),B=Go(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&xc(l,a.child,null,U),l.child.memoizedState=n1(U),l.memoizedState=r1,B);if(!(l.mode&1))return sp(a,l,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=Z0(B,y,void 0),sp(a,l,U,y)}if(q=(U&a.childLanes)!==0,Pn||q){if(y=Vr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,Hs(a,C),zi(y,a,C,-1))}return y1(),y=Z0(Error(t(421))),sp(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=pQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,ei=Da(C.nextSibling),$n=l,tr=!0,ki=null,a!==null&&(fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=No,Os=a.id,zs=a.overflow,No=l),l=i1(l,y.children),l.flags|=4096,l)}function F3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),U0(a.return,l,f)}function s1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(mn(a,l,y.children,f),y=ar.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&F3(a,f,l);else if(a.tag===19)F3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&$f(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),s1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&$f(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}s1(l,!0,f,null,B);break;case"together":s1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ap(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Vs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Fo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ga(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ga(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function rQ(a,l,f){switch(l.tag){case 3:P3(l),vc();break;case 5:n3(l);break;case 1:Un(l.type)&&Hf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Yf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),l.flags|=128,null):f&l.child.childLanes?Q3(a,l,f):(Wt(ar,ar.current&1),a=Vs(a,l,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(ar,ar.current),y)break;return null;case 22:case 23:return l.lanes=0,L3(a,l,f)}return Vs(a,l,f)}var z3,a1,H3,G3;z3=function(a,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},a1=function(){},H3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,ko(ss.current);var B=null;switch(f){case"input":C=dt(a,C),y=dt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=Ee(a,C),y=Ee(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Ff)}tt(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(l.updateQueue=ce)&&(l.flags|=4)}},G3=function(a,l,f,y){f!==y&&(l.flags|=4)};function xh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function sn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,l}function nQ(a,l,f){var y=l.pendingProps;switch(T0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(l),null;case 1:return Un(l.type)&&zf(),sn(l),null;case 3:return y=l.stateNode,wc(),Kt(Nn),Kt(rn),G0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Wf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,ki!==null&&(m1(ki),ki=null))),a1(a,l),sn(l),null;case 5:z0(l);var C=ko(mh.current);if(f=l.type,a!==null&&l.stateNode!=null)H3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return sn(l),null}if(a=ko(ss.current),Wf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[is]=l,y[dh]=B,a=(l.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<ch.length;C++)Xt(ch[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Xe(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Oe(y,B),Xt("invalid",y)}tt(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&Qf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&Qf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":se(y),k(y,B,!0);break;case"textarea":se(y),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Ff)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ve(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[is]=l,a[dh]=y,z3(a,l,!1,!1),l.stateNode=a;e:{switch(U=V(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<ch.length;C++)Xt(ch[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Xe(a,y),C=dt(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":Oe(a,y),C=Ee(a,y),Xt("invalid",a);break;default:C=y}tt(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?ct(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ye(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Le(a,J):typeof J=="number"&&Le(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":se(a),k(a,y,!1);break;case"textarea":se(a),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?me(a,!!y.multiple,B,!1):y.defaultValue!=null&&me(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Ff)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return sn(l),null;case 6:if(a&&l.stateNode!=null)G3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=ko(mh.current),ko(ss.current),Wf(l)){if(y=l.stateNode,f=l.memoizedProps,y[is]=l,(B=y.nodeValue!==f)&&(a=$n,a!==null))switch(a.tag){case 3:Qf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Qf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[is]=l,l.stateNode=y}return sn(l),null;case 13:if(Kt(ar),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ei!==null&&l.mode&1&&!(l.flags&128))jC(),vc(),l.flags|=98560,B=!1;else if(B=Wf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[is]=l}else vc(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;sn(l),B=!1}else ki!==null&&(m1(ki),ki=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||ar.current&1?Nr===0&&(Nr=3):y1())),l.updateQueue!==null&&(l.flags|=4),sn(l),null);case 4:return wc(),a1(a,l),a===null&&uh(l.stateNode.containerInfo),sn(l),null;case 10:return N0(l.type._context),sn(l),null;case 17:return Un(l.type)&&zf(),sn(l),null;case 19:if(Kt(ar),B=l.memoizedState,B===null)return sn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)xh(B,!1);else{if(Nr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=$f(a),U!==null){for(l.flags|=128,xh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(ar,ar.current&1|2),l.child}a=a.sibling}B.tail!==null&&qe()>Mc&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304)}else{if(!y)if(a=$f(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),xh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return sn(l),null}else 2*qe()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=qe(),l.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),l):(sn(l),null);case 22:case 23:return v1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ti&1073741824&&(sn(l),l.subtreeFlags&6&&(l.flags|=8192)):sn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function iQ(a,l){switch(T0(l),l.tag){case 1:return Un(l.type)&&zf(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return wc(),Kt(Nn),Kt(rn),G0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return z0(l),null;case 13:if(Kt(ar),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));vc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(ar),null;case 4:return wc(),null;case 10:return N0(l.type._context),null;case 22:case 23:return v1(),null;case 24:return null;default:return null}}var op=!1,an=!1,sQ=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Cc(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){dr(a,l,y)}else f.current=null}function o1(a,l,f){try{f()}catch(y){dr(a,l,y)}}var V3=!1;function aQ(a,l){if(v0=Mf,a=EC(),h0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,Ie=0,Se=a,we=null;t:for(;;){for(var Ue;Se!==f||C!==0&&Se.nodeType!==3||(q=U+C),Se!==B||y!==0&&Se.nodeType!==3||(J=U+y),Se.nodeType===3&&(U+=Se.nodeValue.length),(Ue=Se.firstChild)!==null;)we=Se,Se=Ue;for(;;){if(Se===a)break t;if(we===f&&++ce===C&&(q=U),we===B&&++Ie===y&&(J=U),(Ue=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Ue}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(y0={focusedElem:a,selectionRange:f},Mf=!1,Fe=l;Fe!==null;)if(l=Fe,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Fe=a;else for(;Fe!==null;){l=Fe;try{var He=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var Ve=He.memoizedProps,yr=He.memoizedState,ie=l.stateNode,$=ie.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:Qi(l.type,Ve),yr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=l.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Te){dr(l,l.return,Te)}if(a=l.sibling,a!==null){a.return=l.return,Fe=a;break}Fe=l.return}return He=V3,V3=!1,He}function wh(a,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&o1(l,f,B)}C=C.next}while(C!==y)}}function lp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function l1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function j3(a){var l=a.alternate;l!==null&&(a.alternate=null,j3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[is],delete l[dh],delete l[I0],delete l[H7],delete l[G7])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function W3(a){return a.tag===5||a.tag===3||a.tag===4}function Y3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||W3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Ff));else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}function u1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(u1(a,l,f),a=a.sibling;a!==null;)u1(a,l,f),a=a.sibling}var qr=null,Fi=!1;function Qa(a,l,f){for(f=f.child;f!==null;)q3(a,l,f),f=f.sibling}function q3(a,l,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:an||Cc(f,l);case 6:var y=qr,C=Fi;qr=null,Qa(a,l,f),qr=y,Fi=C,qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):qr.removeChild(f.stateNode));break;case 18:qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?w0(a.parentNode,f):a.nodeType===1&&w0(a,f),th(a)):w0(qr,f.stateNode));break;case 4:y=qr,C=Fi,qr=f.stateNode.containerInfo,Fi=!0,Qa(a,l,f),qr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!an&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&o1(f,l,U),C=C.next}while(C!==y)}Qa(a,l,f);break;case 1:if(!an&&(Cc(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){dr(f,l,q)}Qa(a,l,f);break;case 21:Qa(a,l,f);break;case 22:f.mode&1?(an=(y=an)||f.memoizedState!==null,Qa(a,l,f),an=y):Qa(a,l,f);break;default:Qa(a,l,f)}}function X3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new sQ),l.forEach(function(y){var C=AQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:qr=q.stateNode,Fi=!1;break e;case 3:qr=q.stateNode.containerInfo,Fi=!0;break e;case 4:qr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(qr===null)throw Error(t(160));q3(B,U,C),qr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){dr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)K3(l,a),l=l.sibling}function K3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),os(a),y&4){try{wh(3,a,a.return),lp(3,a)}catch(Ve){dr(a,a.return,Ve)}try{wh(5,a,a.return)}catch(Ve){dr(a,a.return,Ve)}}break;case 1:Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return);break;case 5:if(Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return),a.flags&32){var C=a.stateNode;try{Le(C,"")}catch(Ve){dr(a,a.return,Ve)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&ft(C,B),V(q,U);var ce=V(q,B);for(U=0;U<J.length;U+=2){var Ie=J[U],Se=J[U+1];Ie==="style"?ct(C,Se):Ie==="dangerouslySetInnerHTML"?Ye(C,Se):Ie==="children"?Le(C,Se):x(C,Ie,Se,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ce(C,B);break;case"select":var we=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Ue=B.value;Ue!=null?me(C,!!B.multiple,Ue,!1):we!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[dh]=B}catch(Ve){dr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),os(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){dr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),os(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{th(l.containerInfo)}catch(Ve){dr(a,a.return,Ve)}break;case 4:Oi(l,a),os(a);break;case 13:Oi(l,a),os(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(f1=qe())),y&4&&X3(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(an=(ce=an)||Ie,Oi(l,a),an=ce):Oi(l,a),os(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!Ie&&a.mode&1)for(Fe=a,Ie=a.child;Ie!==null;){for(Se=Fe=Ie;Fe!==null;){switch(we=Fe,Ue=we.child,we.tag){case 0:case 11:case 14:case 15:wh(4,we,we.return);break;case 1:Cc(we,we.return);var He=we.stateNode;if(typeof He.componentWillUnmount=="function"){y=we,f=we.return;try{l=y,He.props=l.memoizedProps,He.state=l.memoizedState,He.componentWillUnmount()}catch(Ve){dr(y,f,Ve)}}break;case 5:Cc(we,we.return);break;case 22:if(we.memoizedState!==null){$3(Se);continue}}Ue!==null?(Ue.return=we,Fe=Ue):$3(Se)}Ie=Ie.sibling}e:for(Ie=null,Se=a;;){if(Se.tag===5){if(Ie===null){Ie=Se;try{C=Se.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Se.stateNode,J=Se.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=pt("display",U))}catch(Ve){dr(a,a.return,Ve)}}}else if(Se.tag===6){if(Ie===null)try{Se.stateNode.nodeValue=ce?"":Se.memoizedProps}catch(Ve){dr(a,a.return,Ve)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===a)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===a)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===a)break e;Ie===Se&&(Ie=null),Se=Se.return}Ie===Se&&(Ie=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Oi(l,a),os(a),y&4&&X3(a);break;case 21:break;default:Oi(l,a),os(a)}}function os(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(W3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Le(C,""),y.flags&=-33);var B=Y3(a);u1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=Y3(a);c1(a,q,U);break;default:throw Error(t(161))}}catch(J){dr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function oQ(a,l,f){Fe=a,J3(a)}function J3(a,l,f){for(var y=(a.mode&1)!==0;Fe!==null;){var C=Fe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||op;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||an;q=op;var ce=an;if(op=U,(an=J)&&!ce)for(Fe=C;Fe!==null;)U=Fe,J=U.child,U.tag===22&&U.memoizedState!==null?eS(C):J!==null?(J.return=U,Fe=J):eS(C);for(;B!==null;)Fe=B,J3(B),B=B.sibling;Fe=C,op=q,an=ce}Z3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Fe=B):Z3(a)}}function Z3(a){for(;Fe!==null;){var l=Fe;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:an||lp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!an)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:Qi(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&XC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}XC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var Ie=ce.memoizedState;if(Ie!==null){var Se=Ie.dehydrated;Se!==null&&th(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}an||l.flags&512&&l1(l)}catch(we){dr(l,l.return,we)}}if(l===a){Fe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function $3(a){for(;Fe!==null;){var l=Fe;if(l===a){Fe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function eS(a){for(;Fe!==null;){var l=Fe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{lp(4,l)}catch(J){dr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){dr(l,C,J)}}var B=l.return;try{l1(l)}catch(J){dr(l,B,J)}break;case 5:var U=l.return;try{l1(l)}catch(J){dr(l,U,J)}}}catch(J){dr(l,l.return,J)}if(l===a){Fe=null;break}var q=l.sibling;if(q!==null){q.return=l.return,Fe=q;break}Fe=l.return}}var lQ=Math.ceil,cp=I.ReactCurrentDispatcher,h1=I.ReactCurrentOwner,mi=I.ReactCurrentBatchConfig,St=0,Vr=null,Cr=null,Xr=0,ti=0,Sc=La(0),Nr=0,Ih=null,Fo=0,up=0,d1=0,Ch=null,kn=null,f1=0,Mc=1/0,js=null,hp=!1,p1=null,Fa=null,dp=!1,Oa=null,fp=0,Sh=0,A1=null,pp=-1,Ap=0;function _n(){return St&6?qe():pp!==-1?pp:pp=qe()}function za(a){return a.mode&1?St&2&&Xr!==0?Xr&-Xr:j7.transition!==null?(Ap===0&&(Ap=Xu()),Ap):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:tC(a.type)),a):1}function zi(a,l,f,y){if(50<Sh)throw Sh=0,A1=null,Error(t(185));Ku(a,f,y),(!(St&2)||a!==Vr)&&(a===Vr&&(!(St&2)&&(up|=f),Nr===4&&Ha(a,Xr)),Qn(a,y),f===1&&St===0&&!(l.mode&1)&&(Mc=qe()+500,Gf&&Ua()))}function Qn(a,l){var f=a.callbackNode;Yu(a,l);var y=Ca(a,a===Vr?Xr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Je(f),l===1)a.tag===0?V7(rS.bind(null,a)):OC(rS.bind(null,a)),O7(function(){!(St&6)&&Ua()}),f=null;else{switch(YI(y)){case 1:f=ht;break;case 4:f=Dr;break;case 16:f=er;break;case 536870912:f=di;break;default:f=er}f=uS(f,tS.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function tS(a,l){if(pp=-1,Ap=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Tc()&&a.callbackNode!==f)return null;var y=Ca(a,a===Vr?Xr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=gp(a,y);else{l=y;var C=St;St|=2;var B=iS();(Vr!==a||Xr!==l)&&(js=null,Mc=qe()+500,zo(a,l));do try{hQ();break}catch(q){nS(a,q)}while(1);L0(),cp.current=B,St=C,Cr!==null?l=0:(Vr=null,Xr=0,l=Nr)}if(l!==0){if(l===2&&(C=qu(a),C!==0&&(y=C,l=g1(a,C))),l===1)throw f=Ih,zo(a,0),Ha(a,y),Qn(a,qe()),f;if(l===6)Ha(a,y);else{if(C=a.current.alternate,!(y&30)&&!cQ(C)&&(l=gp(a,y),l===2&&(B=qu(a),B!==0&&(y=B,l=g1(a,B))),l===1))throw f=Ih,zo(a,0),Ha(a,y),Qn(a,qe()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:Ho(a,kn,js);break;case 3:if(Ha(a,y),(y&130023424)===y&&(l=f1+500-qe(),10<l)){if(Ca(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){_n(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=x0(Ho.bind(null,a,kn,js),l);break}Ho(a,kn,js);break;case 4:if(Ha(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-gn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=qe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*lQ(y/1960))-y,10<y){a.timeoutHandle=x0(Ho.bind(null,a,kn,js),y);break}Ho(a,kn,js);break;case 5:Ho(a,kn,js);break;default:throw Error(t(329))}}}return Qn(a,qe()),a.callbackNode===f?tS.bind(null,a):null}function g1(a,l){var f=Ch;return a.current.memoizedState.isDehydrated&&(zo(a,l).flags|=256),a=gp(a,l),a!==2&&(l=kn,kn=f,l!==null&&m1(l)),a}function m1(a){kn===null?kn=a:kn.push.apply(kn,a)}function cQ(a){for(var l=a;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!Pi(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ha(a,l){for(l&=~d1,l&=~up,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-gn(l),y=1<<f;a[f]=-1,l&=~y}}function rS(a){if(St&6)throw Error(t(327));Tc();var l=Ca(a,0);if(!(l&1))return Qn(a,qe()),null;var f=gp(a,l);if(a.tag!==0&&f===2){var y=qu(a);y!==0&&(l=y,f=g1(a,y))}if(f===1)throw f=Ih,zo(a,0),Ha(a,l),Qn(a,qe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Ho(a,kn,js),Qn(a,qe()),null}function _1(a,l){var f=St;St|=1;try{return a(l)}finally{St=f,St===0&&(Mc=qe()+500,Gf&&Ua())}}function Oo(a){Oa!==null&&Oa.tag===0&&!(St&6)&&Tc();var l=St;St|=1;var f=mi.transition,y=Pt;try{if(mi.transition=null,Pt=1,a)return a()}finally{Pt=y,mi.transition=f,St=l,!(St&6)&&Ua()}}function v1(){ti=Sc.current,Kt(Sc)}function zo(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,F7(f)),Cr!==null)for(f=Cr.return;f!==null;){var y=f;switch(T0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&zf();break;case 3:wc(),Kt(Nn),Kt(rn),G0();break;case 5:z0(y);break;case 4:wc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:N0(y.type._context);break;case 22:case 23:v1()}f=f.return}if(Vr=a,Cr=a=Ga(a.current,null),Xr=ti=l,Nr=0,Ih=null,d1=up=Fo=0,kn=Ch=null,Po!==null){for(l=0;l<Po.length;l++)if(f=Po[l],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}Po=null}return a}function nS(a,l){do{var f=Cr;try{if(L0(),ep.current=ip,tp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}tp=!1}if(Qo=0,Gr=Lr=or=null,_h=!1,vh=0,h1.current=null,f===null||f.return===null){Nr=1,Ih=l,Cr=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=Xr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,Ie=q,Se=Ie.tag;if(!(Ie.mode&1)&&(Se===0||Se===11||Se===15)){var we=Ie.alternate;we?(Ie.updateQueue=we.updateQueue,Ie.memoizedState=we.memoizedState,Ie.lanes=we.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var Ue=T3(U);if(Ue!==null){Ue.flags&=-257,B3(Ue,U,q,B,l),Ue.mode&1&&M3(B,ce,l),l=Ue,J=ce;var He=l.updateQueue;if(He===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else He.add(J);break e}else{if(!(l&1)){M3(B,ce,l),y1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var yr=T3(U);if(yr!==null){!(yr.flags&65536)&&(yr.flags|=256),B3(yr,U,q,B,l),R0(Ic(J,q));break e}}B=J=Ic(J,q),Nr!==4&&(Nr=2),Ch===null?Ch=[B]:Ch.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var ie=C3(B,J,l);qC(B,ie);break e;case 1:q=J;var $=B.type,ae=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(Fa===null||!Fa.has(ae)))){B.flags|=65536,l&=-l,B.lanes|=l;var Te=S3(B,q,l);qC(B,Te);break e}}B=B.return}while(B!==null)}aS(f)}catch(je){l=je,Cr===f&&f!==null&&(Cr=f=f.return);continue}break}while(1)}function iS(){var a=cp.current;return cp.current=ip,a===null?ip:a}function y1(){(Nr===0||Nr===3||Nr===2)&&(Nr=4),Vr===null||!(Fo&268435455)&&!(up&268435455)||Ha(Vr,Xr)}function gp(a,l){var f=St;St|=2;var y=iS();(Vr!==a||Xr!==l)&&(js=null,zo(a,l));do try{uQ();break}catch(C){nS(a,C)}while(1);if(L0(),St=f,cp.current=y,Cr!==null)throw Error(t(261));return Vr=null,Xr=0,Nr}function uQ(){for(;Cr!==null;)sS(Cr)}function hQ(){for(;Cr!==null&&!it();)sS(Cr)}function sS(a){var l=cS(a.alternate,a,ti);a.memoizedProps=a.pendingProps,l===null?aS(a):Cr=l,h1.current=null}function aS(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=iQ(f,l),f!==null){f.flags&=32767,Cr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Nr=6,Cr=null;return}}else if(f=nQ(f,l,ti),f!==null){Cr=f;return}if(l=l.sibling,l!==null){Cr=l;return}Cr=l=a}while(l!==null);Nr===0&&(Nr=5)}function Ho(a,l,f){var y=Pt,C=mi.transition;try{mi.transition=null,Pt=1,dQ(a,l,f,y)}finally{mi.transition=C,Pt=y}return null}function dQ(a,l,f,y){do Tc();while(Oa!==null);if(St&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(Wk(a,B),a===Vr&&(Cr=Vr=null,Xr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||dp||(dp=!0,uS(er,function(){return Tc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=mi.transition,mi.transition=null;var U=Pt;Pt=1;var q=St;St|=4,h1.current=null,aQ(a,f),K3(f,a),D7(y0),Mf=!!v0,y0=v0=null,a.current=f,oQ(f),ot(),St=q,Pt=U,mi.transition=B}else a.current=f;if(dp&&(dp=!1,Oa=a,fp=C),B=a.pendingLanes,B===0&&(Fa=null),Wu(f.stateNode),Qn(a,qe()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(hp)throw hp=!1,a=p1,p1=null,a;return fp&1&&a.tag!==0&&Tc(),B=a.pendingLanes,B&1?a===A1?Sh++:(Sh=0,A1=a):Sh=0,Ua(),null}function Tc(){if(Oa!==null){var a=YI(fp),l=mi.transition,f=Pt;try{if(mi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,fp=0,St&6)throw Error(t(331));var C=St;for(St|=4,Fe=a.current;Fe!==null;){var B=Fe,U=B.child;if(Fe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Fe=ce;Fe!==null;){var Ie=Fe;switch(Ie.tag){case 0:case 11:case 15:wh(8,Ie,B)}var Se=Ie.child;if(Se!==null)Se.return=Ie,Fe=Se;else for(;Fe!==null;){Ie=Fe;var we=Ie.sibling,Ue=Ie.return;if(j3(Ie),Ie===ce){Fe=null;break}if(we!==null){we.return=Ue,Fe=we;break}Fe=Ue}}}var He=B.alternate;if(He!==null){var Ve=He.child;if(Ve!==null){He.child=null;do{var yr=Ve.sibling;Ve.sibling=null,Ve=yr}while(Ve!==null)}}Fe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Fe=U;else e:for(;Fe!==null;){if(B=Fe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:wh(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Fe=ie;break e}Fe=B.return}}var $=a.current;for(Fe=$;Fe!==null;){U=Fe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Fe=ae;else e:for(U=$;Fe!==null;){if(q=Fe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:lp(9,q)}}catch(je){dr(q,q.return,je)}if(q===U){Fe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Fe=Te;break e}Fe=q.return}}if(St=C,Ua(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,mi.transition=l}}return!1}function oS(a,l,f){l=Ic(f,l),l=C3(a,l,1),a=ka(a,l,1),l=_n(),a!==null&&(Ku(a,1,l),Qn(a,l))}function dr(a,l,f){if(a.tag===3)oS(a,a,f);else for(;l!==null;){if(l.tag===3){oS(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=Ic(f,a),a=S3(l,a,1),l=ka(l,a,1),a=_n(),l!==null&&(Ku(l,1,a),Qn(l,a));break}}l=l.return}}function fQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=_n(),a.pingedLanes|=a.suspendedLanes&f,Vr===a&&(Xr&f)===f&&(Nr===4||Nr===3&&(Xr&130023424)===Xr&&500>qe()-f1?zo(a,0):d1|=f),Qn(a,l)}function lS(a,l){l===0&&(a.mode&1?(l=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):l=1);var f=_n();a=Hs(a,l),a!==null&&(Ku(a,l,f),Qn(a,f))}function pQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),lS(a,f)}function AQ(a,l){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(l),lS(a,f)}var cS;cS=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Nn.current)Pn=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Pn=!1,rQ(a,l,f);Pn=!!(a.flags&131072)}else Pn=!1,tr&&l.flags&1048576&&zC(l,jf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;ap(a,l),a=l.pendingProps;var C=gc(l,rn.current);Ec(l,f),C=W0(null,l,y,a,C,f);var B=Y0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Un(y)?(B=!0,Hf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,k0(l),C.updater=Jf,l.stateNode=C,C._reactInternals=l,F0(l,y,a,f),l=t1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),mn(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(ap(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=mQ(y),a=Qi(y,a),C){case 0:l=e1(null,l,y,a,f);break e;case 1:l=U3(null,l,y,a,f);break e;case 11:l=b3(null,l,y,a,f);break e;case 14:l=R3(null,l,y,Qi(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),e1(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),U3(a,l,y,C,f);case 3:e:{if(P3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,YC(a,l),Kf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=Ic(Error(t(423)),l),l=k3(a,l,y,f,C);break e}else if(y!==C){C=Ic(Error(t(424)),l),l=k3(a,l,y,f,C);break e}else for(ei=Da(l.stateNode.containerInfo.firstChild),$n=l,tr=!0,ki=null,f=r3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(vc(),y===C){l=Vs(a,l,f);break e}mn(a,l,y,f)}l=l.child}return l;case 5:return n3(l),a===null&&b0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,E0(y,C)?U=null:B!==null&&E0(y,B)&&(l.flags|=32),N3(a,l),mn(a,l,U,f),l.child;case 6:return a===null&&b0(l),null;case 13:return Q3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=xc(l,null,y,f):mn(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),b3(a,l,y,C,f);case 7:return mn(a,l,l.pendingProps,f),l.child;case 8:return mn(a,l,l.pendingProps.children,f),l.child;case 12:return mn(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Yf,y._currentValue),y._currentValue=U,B!==null)if(Pi(B.value,U)){if(B.children===C.children&&!Nn.current){l=Vs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Gs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var Ie=ce.pending;Ie===null?J.next=J:(J.next=Ie.next,Ie.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),U0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),U0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}mn(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,Ec(l,f),C=Ai(C),y=y(C),l.flags|=1,mn(a,l,y,f),l.child;case 14:return y=l.type,C=Qi(y,l.pendingProps),C=Qi(y.type,C),R3(a,l,y,C,f);case 15:return D3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),ap(a,l),l.tag=1,Un(y)?(a=!0,Hf(l)):a=!1,Ec(l,f),ZC(l,y,C),F0(l,y,C,f),t1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return L3(a,l,f)}throw Error(t(156,l.tag))};function uS(a,l){return Re(a,l)}function gQ(a,l,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(a,l,f,y){return new gQ(a,l,f,y)}function E1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function mQ(a){if(typeof a=="function")return E1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ga(a,l){var f=a.alternate;return f===null?(f=_i(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function mp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")E1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Go(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=_i(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=_i(13,f,l,C),a.elementType=N,a.lanes=B,a;case W:return a=_i(19,f,l,C),a.elementType=W,a.lanes=B,a;case te:return _p(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case S:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return l=_i(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Go(a,l,f,y){return a=_i(7,a,y,l),a.lanes=f,a}function _p(a,l,f,y){return a=_i(22,a,y,l),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function x1(a,l,f){return a=_i(6,a,null,l),a.lanes=f,a}function w1(a,l,f){return l=_i(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function _Q(a,l,f,y,C){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Km(0),this.expirationTimes=Km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Km(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function I1(a,l,f,y,C,B,U,q,J){return a=new _Q(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=_i(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},k0(B),a}function vQ(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function hS(a){if(!a)return Na;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Un(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Un(f))return QC(a,f,l)}return l}function dS(a,l,f,y,C,B,U,q,J){return a=I1(f,y,!0,a,C,B,U,q,J),a.context=hS(null),f=a.current,y=_n(),C=za(f),B=Gs(y,C),B.callback=l??null,ka(f,B,C),a.current.lanes=C,Ku(a,C,y),Qn(a,y),a}function vp(a,l,f,y){var C=l.current,B=_n(),U=za(C);return f=hS(f),l.context===null?l.context=f:l.pendingContext=f,l=Gs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ka(C,l,U),a!==null&&(zi(a,C,U,B),Xf(a,C,U)),U}function yp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function fS(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function C1(a,l){fS(a,l),(a=a.alternate)&&fS(a,l)}function yQ(){return null}var pS=typeof reportError=="function"?reportError:function(a){console.error(a)};function S1(a){this._internalRoot=a}Ep.prototype.render=S1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));vp(a,l,null,null)},Ep.prototype.unmount=S1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Oo(function(){vp(null,a,null,null)}),l[Qs]=null}};function Ep(a){this._internalRoot=a}Ep.prototype.unstable_scheduleHydration=function(a){if(a){var l=KI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ba.length&&l!==0&&l<Ba[f].priority;f++);Ba.splice(f,0,a),f===0&&$I(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function xp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function AS(){}function EQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=yp(U);B.call(ce)}}var U=dS(l,y,a,0,null,!1,!1,"",AS);return a._reactRootContainer=U,a[Qs]=U.current,uh(a.nodeType===8?a.parentNode:a),Oo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=yp(J);q.call(ce)}}var J=I1(a,0,!1,null,null,!1,!1,"",AS);return a._reactRootContainer=J,a[Qs]=J.current,uh(a.nodeType===8?a.parentNode:a),Oo(function(){vp(l,J,f,y)}),J}function wp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=yp(U);q.call(J)}}vp(l,U,a,C)}else U=EQ(f,l,a,C,y);return yp(U)}qI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=Dn(l.pendingLanes);f!==0&&(Jm(l,f|1),Qn(l,qe()),!(St&6)&&(Mc=qe()+500,Ua()))}break;case 13:Oo(function(){var y=Hs(a,1);if(y!==null){var C=_n();zi(y,a,1,C)}}),C1(a,1)}},Zm=function(a){if(a.tag===13){var l=Hs(a,134217728);if(l!==null){var f=_n();zi(l,a,134217728,f)}C1(a,134217728)}},XI=function(a){if(a.tag===13){var l=za(a),f=Hs(a,l);if(f!==null){var y=_n();zi(f,a,l,y)}C1(a,l)}},KI=function(){return Pt},JI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ce(a,f);break;case"select":l=f.value,l!=null&&me(a,!!f.multiple,l,!1)}},Mt=_1,vt=Oo;var xQ={usingClientEntryPoint:!1,Events:[fh,pc,Of,Dt,Lt,_1]},Mh={findFiberByHostInstance:Do,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wQ={bundleType:Mh.bundleType,version:Mh.version,rendererPackageName:Mh.rendererPackageName,rendererConfig:Mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=he(a),a===null?null:a.stateNode},findFiberByHostInstance:Mh.findFiberByHostInstance||yQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ip.isDisabled&&Ip.supportsFiber)try{jt=Ip.inject(wQ),rt=Ip}catch{}}return Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xQ,Bn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return vQ(a,l,null,f)},Bn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=pS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=I1(a,1,!1,null,null,f,!1,y,C),a[Qs]=l.current,uh(a.nodeType===8?a.parentNode:a),new S1(l)},Bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(l),a=a===null?null:a.stateNode,a},Bn.flushSync=function(a){return Oo(a)},Bn.hydrate=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!0,f)},Bn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=pS;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=dS(l,null,a,1,f??null,C,!1,B,U),a[Qs]=l.current,uh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new Ep(l)},Bn.render=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!1,f)},Bn.unmountComponentAtNode=function(a){if(!xp(a))throw Error(t(40));return a._reactRootContainer?(Oo(function(){wp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},Bn.unstable_batchedUpdates=_1,Bn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!xp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return wp(a,l,f,!1,y)},Bn.version="18.2.0-next-9e3b772b8-20220608",Bn}function DI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DI)}catch(r){console.error(r)}}DI(),TI.exports=Mk();var Tk=TI.exports,LI=Tk;Gm.createRoot=LI.createRoot,Gm.hydrateRoot=LI.hydrateRoot;class Bk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Gm.createRoot(document.getElementById(n))}this.targetElement.render(Th.createElement(Ik,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var Wm={exports:{}},sc=typeof Reflect=="object"?Reflect:null,NI=sc&&typeof sc.apply=="function"?sc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ef;sc&&typeof sc.ownKeys=="function"?Ef=sc.ownKeys:Object.getOwnPropertySymbols?Ef=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ef=function(e){return Object.getOwnPropertyNames(e)};function bk(r){console&&console.warn&&console.warn(r)}var UI=Number.isNaN||function(e){return e!==e};function Ft(){Ft.init.call(this)}Wm.exports=Ft,Wm.exports.once=Nk,Ft.EventEmitter=Ft,Ft.prototype._events=void 0,Ft.prototype._eventsCount=0,Ft.prototype._maxListeners=void 0;var PI=10;function xf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ft,"defaultMaxListeners",{enumerable:!0,get:function(){return PI},set:function(r){if(typeof r!="number"||r<0||UI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");PI=r}}),Ft.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ft.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||UI(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function kI(r){return r._maxListeners===void 0?Ft.defaultMaxListeners:r._maxListeners}Ft.prototype.getMaxListeners=function(){return kI(this)},Ft.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")NI(h,this,t);else for(var u=h.length,d=HI(h,u),n=0;n<u;++n)NI(d[n],this,t);return!0};function QI(r,e,t,n){var i,s,o;if(xf(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=kI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,bk(c)}return r}Ft.prototype.addListener=function(e,t){return QI(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return QI(this,e,t,!0)};function Rk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function FI(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Rk.bind(n);return i.listener=t,n.wrapFn=i,i}Ft.prototype.once=function(e,t){return xf(t),this.on(e,FI(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){return xf(t),this.prependListener(e,FI(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var n,i,s,o,c;if(xf(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Dk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ft.prototype.off=Ft.prototype.removeListener,Ft.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function OI(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Lk(i):HI(i,i.length)}Ft.prototype.listeners=function(e){return OI(this,e,!0)},Ft.prototype.rawListeners=function(e){return OI(this,e,!1)},Ft.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):zI.call(r,e)},Ft.prototype.listenerCount=zI;function zI(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ft.prototype.eventNames=function(){return this._eventsCount>0?Ef(this._events):[]};function HI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Dk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Lk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Nk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}GI(r,e,s,{once:!0}),e!=="error"&&Uk(r,i,{once:!0})})}function Uk(r,e,t){typeof r.on=="function"&&GI(r,"error",e,t)}function GI(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Pk=Wm.exports;const ju=class ju extends Pk.EventEmitter{emitEvent(e,t){Object.keys(ju.EVENTS).includes(e)&&this.emit(ju.EVENTS[e],t)}};Bt(ju,"EVENTS",{onAddToCart:"add-to-cart"});let Ym=ju;const kk={getCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart.js",addToCartUrl:((WI=window.Shopify)==null?void 0:WI.routes.root)+"cart/add.js"},VI=Object.freeze(kk);class Qk{constructor(e){Bt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:Fk,error:Ok}=console,zk=(...r)=>{Ok("❌ Sprie Error:",...r)},Hk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",Gk={HOST:cs.host,STORE_PREFIX:cs.storePrefix},Vk={addToCartUrl:VI.addToCartUrl,getCartUrl:VI.getCartUrl};class jk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Ym,this.apiService=new _S(new ja(Gk),new Qk(Vk)),this.uiService=new Bk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:cs,log:Fk,logErr:zk,metaData:{appVersion:gS,previewUrlPrams:Hk,targetClassName:"sprie-embed-element"}};this.sdkService=new vS(e),this.sdkService.Init()}load(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}}window.ditaConfigurator=new jk})();
|
|
4490
|
+
`+B.stack}return{value:a,source:l,stack:C,digest:null}}function Z0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function $0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var $7=typeof WeakMap=="function"?WeakMap:Map;function C3(a,l,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){hp||(hp=!0,p1=y),$0(a,l)},f}function S3(a,l,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){$0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){$0(a,l),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new $7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=fQ.bind(null,a,l,f),l.then(a,a))}function T3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function B3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Gs(-1,1),l.tag=2,ka(f,l,1))),f.lanes|=1),a)}var eQ=I.ReactCurrentOwner,Pn=!1;function mn(a,l,f,y){l.child=a===null?r3(l,null,f,y):xc(l,a.child,f,y)}function b3(a,l,f,y,C){f=f.render;var B=l.ref;return Ec(l,C),y=W0(a,l,f,y,B,C),f=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,mn(a,l,y,C),l.child)}function R3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!E1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,D3(a,l,B,y,C)):(a=mp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:lh,f(U,y)&&a.ref===l.ref)return Vs(a,l,C)}return l.flags|=1,a=Ga(B,y),a.ref=l.ref,a.return=l,l.child=a}function D3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(lh(B,y)&&a.ref===l.ref)if(Pn=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Pn=!0);else return l.lanes=a.lanes,Vs(a,l,C)}return e1(a,l,f,y,C)}function L3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Sc,ti),ti|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Sc,ti),ti|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Sc,ti),ti|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Sc,ti),ti|=y;return mn(a,l,C,f),l.child}function N3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function e1(a,l,f,y,C){var B=Un(f)?No:rn.current;return B=gc(l,B),Ec(l,C),f=W0(a,l,f,y,B,C),y=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,mn(a,l,f,C),l.child)}function U3(a,l,f,y,C){if(Un(f)){var B=!0;Hf(l)}else B=!1;if(Ec(l,C),l.stateNode===null)ap(a,l),ZC(l,f,y),F0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=Ai(ce):(ce=Un(f)?No:rn.current,ce=gc(l,ce));var Ie=f.getDerivedStateFromProps,Se=typeof Ie=="function"||typeof U.getSnapshotBeforeUpdate=="function";Se||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&$C(l,U,y,ce),Pa=!1;var we=l.memoizedState;U.state=we,Kf(l,y,U,C),J=l.memoizedState,q!==y||we!==J||Nn.current||Pa?(typeof Ie=="function"&&(Q0(l,f,Ie,y),J=l.memoizedState),(q=Pa||JC(l,f,q,y,we,J,ce))?(Se||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,YC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:Qi(l.type,q),U.props=ce,Se=l.pendingProps,we=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=Ai(J):(J=Un(f)?No:rn.current,J=gc(l,J));var Ue=f.getDerivedStateFromProps;(Ie=typeof Ue=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Se||we!==J)&&$C(l,U,y,J),Pa=!1,we=l.memoizedState,U.state=we,Kf(l,y,U,C);var He=l.memoizedState;q!==Se||we!==He||Nn.current||Pa?(typeof Ue=="function"&&(Q0(l,f,Ue,y),He=l.memoizedState),(ce=Pa||JC(l,f,ce,y,we,He,J)||!1)?(Ie||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,He,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,He,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=He),U.props=y,U.state=He,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),y=!1)}return t1(a,l,f,y,B,C)}function t1(a,l,f,y,C,B){N3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&FC(l,f,!1),Vs(a,l,B);y=l.stateNode,eQ.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=xc(l,a.child,null,B),l.child=xc(l,null,q,B)):mn(a,l,q,B),l.memoizedState=y.state,C&&FC(l,f,!0),l.child}function P3(a){var l=a.stateNode;l.pendingContext?kC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&kC(a,l.context,!1),O0(a,l.containerInfo)}function k3(a,l,f,y,C){return vc(),R0(C),l.flags|=256,mn(a,l,f,y),l.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Q3(a,l,f){var y=l.pendingProps,C=ar.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return b0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=_p(U,y,0,null),a=Vo(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=n1(f),l.memoizedState=r1,a):i1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return tQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ga(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ga(q,B):(B=Vo(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?n1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=r1,y}return B=a.child,a=B.sibling,y=Ga(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function i1(a,l){return l=_p({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function sp(a,l,f,y){return y!==null&&R0(y),xc(l,a.child,null,f),a=i1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function tQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=Z0(Error(t(422))),sp(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=_p({mode:"visible",children:y.children},C,0,null),B=Vo(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&xc(l,a.child,null,U),l.child.memoizedState=n1(U),l.memoizedState=r1,B);if(!(l.mode&1))return sp(a,l,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=Z0(B,y,void 0),sp(a,l,U,y)}if(q=(U&a.childLanes)!==0,Pn||q){if(y=Vr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,Hs(a,C),zi(y,a,C,-1))}return y1(),y=Z0(Error(t(421))),sp(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=pQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,ei=Da(C.nextSibling),$n=l,tr=!0,ki=null,a!==null&&(fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=Uo,Os=a.id,zs=a.overflow,Uo=l),l=i1(l,y.children),l.flags|=4096,l)}function F3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),U0(a.return,l,f)}function s1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(mn(a,l,y.children,f),y=ar.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&F3(a,f,l);else if(a.tag===19)F3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&$f(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),s1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&$f(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}s1(l,!0,f,null,B);break;case"together":s1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ap(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Vs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Oo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ga(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ga(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function rQ(a,l,f){switch(l.tag){case 3:P3(l),vc();break;case 5:n3(l);break;case 1:Un(l.type)&&Hf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Yf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),l.flags|=128,null):f&l.child.childLanes?Q3(a,l,f):(Wt(ar,ar.current&1),a=Vs(a,l,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(ar,ar.current),y)break;return null;case 22:case 23:return l.lanes=0,L3(a,l,f)}return Vs(a,l,f)}var z3,a1,H3,G3;z3=function(a,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},a1=function(){},H3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,Qo(ss.current);var B=null;switch(f){case"input":C=dt(a,C),y=dt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=Ee(a,C),y=Ee(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Ff)}tt(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(l.updateQueue=ce)&&(l.flags|=4)}},G3=function(a,l,f,y){f!==y&&(l.flags|=4)};function wh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function sn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,l}function nQ(a,l,f){var y=l.pendingProps;switch(T0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(l),null;case 1:return Un(l.type)&&zf(),sn(l),null;case 3:return y=l.stateNode,wc(),Kt(Nn),Kt(rn),G0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Wf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,ki!==null&&(m1(ki),ki=null))),a1(a,l),sn(l),null;case 5:z0(l);var C=Qo(_h.current);if(f=l.type,a!==null&&l.stateNode!=null)H3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return sn(l),null}if(a=Qo(ss.current),Wf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[is]=l,y[fh]=B,a=(l.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<uh.length;C++)Xt(uh[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Xe(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Oe(y,B),Xt("invalid",y)}tt(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&Qf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&Qf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":se(y),k(y,B,!0);break;case"textarea":se(y),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Ff)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ve(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[is]=l,a[fh]=y,z3(a,l,!1,!1),l.stateNode=a;e:{switch(U=V(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<uh.length;C++)Xt(uh[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Xe(a,y),C=dt(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":Oe(a,y),C=Ee(a,y),Xt("invalid",a);break;default:C=y}tt(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?ct(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ye(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Le(a,J):typeof J=="number"&&Le(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":se(a),k(a,y,!1);break;case"textarea":se(a),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?me(a,!!y.multiple,B,!1):y.defaultValue!=null&&me(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Ff)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return sn(l),null;case 6:if(a&&l.stateNode!=null)G3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=Qo(_h.current),Qo(ss.current),Wf(l)){if(y=l.stateNode,f=l.memoizedProps,y[is]=l,(B=y.nodeValue!==f)&&(a=$n,a!==null))switch(a.tag){case 3:Qf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Qf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[is]=l,l.stateNode=y}return sn(l),null;case 13:if(Kt(ar),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ei!==null&&l.mode&1&&!(l.flags&128))jC(),vc(),l.flags|=98560,B=!1;else if(B=Wf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[is]=l}else vc(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;sn(l),B=!1}else ki!==null&&(m1(ki),ki=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||ar.current&1?Nr===0&&(Nr=3):y1())),l.updateQueue!==null&&(l.flags|=4),sn(l),null);case 4:return wc(),a1(a,l),a===null&&hh(l.stateNode.containerInfo),sn(l),null;case 10:return N0(l.type._context),sn(l),null;case 17:return Un(l.type)&&zf(),sn(l),null;case 19:if(Kt(ar),B=l.memoizedState,B===null)return sn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)wh(B,!1);else{if(Nr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=$f(a),U!==null){for(l.flags|=128,wh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(ar,ar.current&1|2),l.child}a=a.sibling}B.tail!==null&&qe()>Mc&&(l.flags|=128,y=!0,wh(B,!1),l.lanes=4194304)}else{if(!y)if(a=$f(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),wh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return sn(l),null}else 2*qe()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,wh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=qe(),l.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),l):(sn(l),null);case 22:case 23:return v1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ti&1073741824&&(sn(l),l.subtreeFlags&6&&(l.flags|=8192)):sn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function iQ(a,l){switch(T0(l),l.tag){case 1:return Un(l.type)&&zf(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return wc(),Kt(Nn),Kt(rn),G0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return z0(l),null;case 13:if(Kt(ar),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));vc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(ar),null;case 4:return wc(),null;case 10:return N0(l.type._context),null;case 22:case 23:return v1(),null;case 24:return null;default:return null}}var op=!1,an=!1,sQ=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Cc(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){dr(a,l,y)}else f.current=null}function o1(a,l,f){try{f()}catch(y){dr(a,l,y)}}var V3=!1;function aQ(a,l){if(v0=Mf,a=EC(),h0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,Ie=0,Se=a,we=null;t:for(;;){for(var Ue;Se!==f||C!==0&&Se.nodeType!==3||(q=U+C),Se!==B||y!==0&&Se.nodeType!==3||(J=U+y),Se.nodeType===3&&(U+=Se.nodeValue.length),(Ue=Se.firstChild)!==null;)we=Se,Se=Ue;for(;;){if(Se===a)break t;if(we===f&&++ce===C&&(q=U),we===B&&++Ie===y&&(J=U),(Ue=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Ue}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(y0={focusedElem:a,selectionRange:f},Mf=!1,Fe=l;Fe!==null;)if(l=Fe,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Fe=a;else for(;Fe!==null;){l=Fe;try{var He=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var Ve=He.memoizedProps,yr=He.memoizedState,ie=l.stateNode,$=ie.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:Qi(l.type,Ve),yr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=l.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Te){dr(l,l.return,Te)}if(a=l.sibling,a!==null){a.return=l.return,Fe=a;break}Fe=l.return}return He=V3,V3=!1,He}function Ih(a,l,f){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&o1(l,f,B)}C=C.next}while(C!==y)}}function lp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function l1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function j3(a){var l=a.alternate;l!==null&&(a.alternate=null,j3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[is],delete l[fh],delete l[I0],delete l[H7],delete l[G7])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function W3(a){return a.tag===5||a.tag===3||a.tag===4}function Y3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||W3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Ff));else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}function u1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(u1(a,l,f),a=a.sibling;a!==null;)u1(a,l,f),a=a.sibling}var qr=null,Fi=!1;function Qa(a,l,f){for(f=f.child;f!==null;)q3(a,l,f),f=f.sibling}function q3(a,l,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:an||Cc(f,l);case 6:var y=qr,C=Fi;qr=null,Qa(a,l,f),qr=y,Fi=C,qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):qr.removeChild(f.stateNode));break;case 18:qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?w0(a.parentNode,f):a.nodeType===1&&w0(a,f),rh(a)):w0(qr,f.stateNode));break;case 4:y=qr,C=Fi,qr=f.stateNode.containerInfo,Fi=!0,Qa(a,l,f),qr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!an&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&o1(f,l,U),C=C.next}while(C!==y)}Qa(a,l,f);break;case 1:if(!an&&(Cc(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){dr(f,l,q)}Qa(a,l,f);break;case 21:Qa(a,l,f);break;case 22:f.mode&1?(an=(y=an)||f.memoizedState!==null,Qa(a,l,f),an=y):Qa(a,l,f);break;default:Qa(a,l,f)}}function X3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new sQ),l.forEach(function(y){var C=AQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:qr=q.stateNode,Fi=!1;break e;case 3:qr=q.stateNode.containerInfo,Fi=!0;break e;case 4:qr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(qr===null)throw Error(t(160));q3(B,U,C),qr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){dr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)K3(l,a),l=l.sibling}function K3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),os(a),y&4){try{Ih(3,a,a.return),lp(3,a)}catch(Ve){dr(a,a.return,Ve)}try{Ih(5,a,a.return)}catch(Ve){dr(a,a.return,Ve)}}break;case 1:Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return);break;case 5:if(Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return),a.flags&32){var C=a.stateNode;try{Le(C,"")}catch(Ve){dr(a,a.return,Ve)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&ft(C,B),V(q,U);var ce=V(q,B);for(U=0;U<J.length;U+=2){var Ie=J[U],Se=J[U+1];Ie==="style"?ct(C,Se):Ie==="dangerouslySetInnerHTML"?Ye(C,Se):Ie==="children"?Le(C,Se):x(C,Ie,Se,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ce(C,B);break;case"select":var we=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Ue=B.value;Ue!=null?me(C,!!B.multiple,Ue,!1):we!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[fh]=B}catch(Ve){dr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),os(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){dr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),os(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{rh(l.containerInfo)}catch(Ve){dr(a,a.return,Ve)}break;case 4:Oi(l,a),os(a);break;case 13:Oi(l,a),os(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(f1=qe())),y&4&&X3(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(an=(ce=an)||Ie,Oi(l,a),an=ce):Oi(l,a),os(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!Ie&&a.mode&1)for(Fe=a,Ie=a.child;Ie!==null;){for(Se=Fe=Ie;Fe!==null;){switch(we=Fe,Ue=we.child,we.tag){case 0:case 11:case 14:case 15:Ih(4,we,we.return);break;case 1:Cc(we,we.return);var He=we.stateNode;if(typeof He.componentWillUnmount=="function"){y=we,f=we.return;try{l=y,He.props=l.memoizedProps,He.state=l.memoizedState,He.componentWillUnmount()}catch(Ve){dr(y,f,Ve)}}break;case 5:Cc(we,we.return);break;case 22:if(we.memoizedState!==null){$3(Se);continue}}Ue!==null?(Ue.return=we,Fe=Ue):$3(Se)}Ie=Ie.sibling}e:for(Ie=null,Se=a;;){if(Se.tag===5){if(Ie===null){Ie=Se;try{C=Se.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Se.stateNode,J=Se.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=pt("display",U))}catch(Ve){dr(a,a.return,Ve)}}}else if(Se.tag===6){if(Ie===null)try{Se.stateNode.nodeValue=ce?"":Se.memoizedProps}catch(Ve){dr(a,a.return,Ve)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===a)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===a)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===a)break e;Ie===Se&&(Ie=null),Se=Se.return}Ie===Se&&(Ie=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Oi(l,a),os(a),y&4&&X3(a);break;case 21:break;default:Oi(l,a),os(a)}}function os(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(W3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Le(C,""),y.flags&=-33);var B=Y3(a);u1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=Y3(a);c1(a,q,U);break;default:throw Error(t(161))}}catch(J){dr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function oQ(a,l,f){Fe=a,J3(a)}function J3(a,l,f){for(var y=(a.mode&1)!==0;Fe!==null;){var C=Fe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||op;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||an;q=op;var ce=an;if(op=U,(an=J)&&!ce)for(Fe=C;Fe!==null;)U=Fe,J=U.child,U.tag===22&&U.memoizedState!==null?eS(C):J!==null?(J.return=U,Fe=J):eS(C);for(;B!==null;)Fe=B,J3(B),B=B.sibling;Fe=C,op=q,an=ce}Z3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Fe=B):Z3(a)}}function Z3(a){for(;Fe!==null;){var l=Fe;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:an||lp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!an)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:Qi(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&XC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}XC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var Ie=ce.memoizedState;if(Ie!==null){var Se=Ie.dehydrated;Se!==null&&rh(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}an||l.flags&512&&l1(l)}catch(we){dr(l,l.return,we)}}if(l===a){Fe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function $3(a){for(;Fe!==null;){var l=Fe;if(l===a){Fe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function eS(a){for(;Fe!==null;){var l=Fe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{lp(4,l)}catch(J){dr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){dr(l,C,J)}}var B=l.return;try{l1(l)}catch(J){dr(l,B,J)}break;case 5:var U=l.return;try{l1(l)}catch(J){dr(l,U,J)}}}catch(J){dr(l,l.return,J)}if(l===a){Fe=null;break}var q=l.sibling;if(q!==null){q.return=l.return,Fe=q;break}Fe=l.return}}var lQ=Math.ceil,cp=I.ReactCurrentDispatcher,h1=I.ReactCurrentOwner,mi=I.ReactCurrentBatchConfig,St=0,Vr=null,Cr=null,Xr=0,ti=0,Sc=La(0),Nr=0,Ch=null,Oo=0,up=0,d1=0,Sh=null,kn=null,f1=0,Mc=1/0,js=null,hp=!1,p1=null,Fa=null,dp=!1,Oa=null,fp=0,Mh=0,A1=null,pp=-1,Ap=0;function _n(){return St&6?qe():pp!==-1?pp:pp=qe()}function za(a){return a.mode&1?St&2&&Xr!==0?Xr&-Xr:j7.transition!==null?(Ap===0&&(Ap=Ku()),Ap):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:tC(a.type)),a):1}function zi(a,l,f,y){if(50<Mh)throw Mh=0,A1=null,Error(t(185));Ju(a,f,y),(!(St&2)||a!==Vr)&&(a===Vr&&(!(St&2)&&(up|=f),Nr===4&&Ha(a,Xr)),Qn(a,y),f===1&&St===0&&!(l.mode&1)&&(Mc=qe()+500,Gf&&Ua()))}function Qn(a,l){var f=a.callbackNode;qu(a,l);var y=Ca(a,a===Vr?Xr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Je(f),l===1)a.tag===0?V7(rS.bind(null,a)):OC(rS.bind(null,a)),O7(function(){!(St&6)&&Ua()}),f=null;else{switch(YI(y)){case 1:f=ht;break;case 4:f=Dr;break;case 16:f=er;break;case 536870912:f=di;break;default:f=er}f=uS(f,tS.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function tS(a,l){if(pp=-1,Ap=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Tc()&&a.callbackNode!==f)return null;var y=Ca(a,a===Vr?Xr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=gp(a,y);else{l=y;var C=St;St|=2;var B=iS();(Vr!==a||Xr!==l)&&(js=null,Mc=qe()+500,Ho(a,l));do try{hQ();break}catch(q){nS(a,q)}while(1);L0(),cp.current=B,St=C,Cr!==null?l=0:(Vr=null,Xr=0,l=Nr)}if(l!==0){if(l===2&&(C=Xu(a),C!==0&&(y=C,l=g1(a,C))),l===1)throw f=Ch,Ho(a,0),Ha(a,y),Qn(a,qe()),f;if(l===6)Ha(a,y);else{if(C=a.current.alternate,!(y&30)&&!cQ(C)&&(l=gp(a,y),l===2&&(B=Xu(a),B!==0&&(y=B,l=g1(a,B))),l===1))throw f=Ch,Ho(a,0),Ha(a,y),Qn(a,qe()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:Go(a,kn,js);break;case 3:if(Ha(a,y),(y&130023424)===y&&(l=f1+500-qe(),10<l)){if(Ca(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){_n(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=x0(Go.bind(null,a,kn,js),l);break}Go(a,kn,js);break;case 4:if(Ha(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-gn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=qe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*lQ(y/1960))-y,10<y){a.timeoutHandle=x0(Go.bind(null,a,kn,js),y);break}Go(a,kn,js);break;case 5:Go(a,kn,js);break;default:throw Error(t(329))}}}return Qn(a,qe()),a.callbackNode===f?tS.bind(null,a):null}function g1(a,l){var f=Sh;return a.current.memoizedState.isDehydrated&&(Ho(a,l).flags|=256),a=gp(a,l),a!==2&&(l=kn,kn=f,l!==null&&m1(l)),a}function m1(a){kn===null?kn=a:kn.push.apply(kn,a)}function cQ(a){for(var l=a;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!Pi(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ha(a,l){for(l&=~d1,l&=~up,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-gn(l),y=1<<f;a[f]=-1,l&=~y}}function rS(a){if(St&6)throw Error(t(327));Tc();var l=Ca(a,0);if(!(l&1))return Qn(a,qe()),null;var f=gp(a,l);if(a.tag!==0&&f===2){var y=Xu(a);y!==0&&(l=y,f=g1(a,y))}if(f===1)throw f=Ch,Ho(a,0),Ha(a,l),Qn(a,qe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Go(a,kn,js),Qn(a,qe()),null}function _1(a,l){var f=St;St|=1;try{return a(l)}finally{St=f,St===0&&(Mc=qe()+500,Gf&&Ua())}}function zo(a){Oa!==null&&Oa.tag===0&&!(St&6)&&Tc();var l=St;St|=1;var f=mi.transition,y=Pt;try{if(mi.transition=null,Pt=1,a)return a()}finally{Pt=y,mi.transition=f,St=l,!(St&6)&&Ua()}}function v1(){ti=Sc.current,Kt(Sc)}function Ho(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,F7(f)),Cr!==null)for(f=Cr.return;f!==null;){var y=f;switch(T0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&zf();break;case 3:wc(),Kt(Nn),Kt(rn),G0();break;case 5:z0(y);break;case 4:wc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:N0(y.type._context);break;case 22:case 23:v1()}f=f.return}if(Vr=a,Cr=a=Ga(a.current,null),Xr=ti=l,Nr=0,Ch=null,d1=up=Oo=0,kn=Sh=null,ko!==null){for(l=0;l<ko.length;l++)if(f=ko[l],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}ko=null}return a}function nS(a,l){do{var f=Cr;try{if(L0(),ep.current=ip,tp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}tp=!1}if(Fo=0,Gr=Lr=or=null,vh=!1,yh=0,h1.current=null,f===null||f.return===null){Nr=1,Ch=l,Cr=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=Xr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,Ie=q,Se=Ie.tag;if(!(Ie.mode&1)&&(Se===0||Se===11||Se===15)){var we=Ie.alternate;we?(Ie.updateQueue=we.updateQueue,Ie.memoizedState=we.memoizedState,Ie.lanes=we.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var Ue=T3(U);if(Ue!==null){Ue.flags&=-257,B3(Ue,U,q,B,l),Ue.mode&1&&M3(B,ce,l),l=Ue,J=ce;var He=l.updateQueue;if(He===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else He.add(J);break e}else{if(!(l&1)){M3(B,ce,l),y1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var yr=T3(U);if(yr!==null){!(yr.flags&65536)&&(yr.flags|=256),B3(yr,U,q,B,l),R0(Ic(J,q));break e}}B=J=Ic(J,q),Nr!==4&&(Nr=2),Sh===null?Sh=[B]:Sh.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var ie=C3(B,J,l);qC(B,ie);break e;case 1:q=J;var $=B.type,ae=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(Fa===null||!Fa.has(ae)))){B.flags|=65536,l&=-l,B.lanes|=l;var Te=S3(B,q,l);qC(B,Te);break e}}B=B.return}while(B!==null)}aS(f)}catch(je){l=je,Cr===f&&f!==null&&(Cr=f=f.return);continue}break}while(1)}function iS(){var a=cp.current;return cp.current=ip,a===null?ip:a}function y1(){(Nr===0||Nr===3||Nr===2)&&(Nr=4),Vr===null||!(Oo&268435455)&&!(up&268435455)||Ha(Vr,Xr)}function gp(a,l){var f=St;St|=2;var y=iS();(Vr!==a||Xr!==l)&&(js=null,Ho(a,l));do try{uQ();break}catch(C){nS(a,C)}while(1);if(L0(),St=f,cp.current=y,Cr!==null)throw Error(t(261));return Vr=null,Xr=0,Nr}function uQ(){for(;Cr!==null;)sS(Cr)}function hQ(){for(;Cr!==null&&!it();)sS(Cr)}function sS(a){var l=cS(a.alternate,a,ti);a.memoizedProps=a.pendingProps,l===null?aS(a):Cr=l,h1.current=null}function aS(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=iQ(f,l),f!==null){f.flags&=32767,Cr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Nr=6,Cr=null;return}}else if(f=nQ(f,l,ti),f!==null){Cr=f;return}if(l=l.sibling,l!==null){Cr=l;return}Cr=l=a}while(l!==null);Nr===0&&(Nr=5)}function Go(a,l,f){var y=Pt,C=mi.transition;try{mi.transition=null,Pt=1,dQ(a,l,f,y)}finally{mi.transition=C,Pt=y}return null}function dQ(a,l,f,y){do Tc();while(Oa!==null);if(St&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(Wk(a,B),a===Vr&&(Cr=Vr=null,Xr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||dp||(dp=!0,uS(er,function(){return Tc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=mi.transition,mi.transition=null;var U=Pt;Pt=1;var q=St;St|=4,h1.current=null,aQ(a,f),K3(f,a),D7(y0),Mf=!!v0,y0=v0=null,a.current=f,oQ(f),ot(),St=q,Pt=U,mi.transition=B}else a.current=f;if(dp&&(dp=!1,Oa=a,fp=C),B=a.pendingLanes,B===0&&(Fa=null),Yu(f.stateNode),Qn(a,qe()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(hp)throw hp=!1,a=p1,p1=null,a;return fp&1&&a.tag!==0&&Tc(),B=a.pendingLanes,B&1?a===A1?Mh++:(Mh=0,A1=a):Mh=0,Ua(),null}function Tc(){if(Oa!==null){var a=YI(fp),l=mi.transition,f=Pt;try{if(mi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,fp=0,St&6)throw Error(t(331));var C=St;for(St|=4,Fe=a.current;Fe!==null;){var B=Fe,U=B.child;if(Fe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Fe=ce;Fe!==null;){var Ie=Fe;switch(Ie.tag){case 0:case 11:case 15:Ih(8,Ie,B)}var Se=Ie.child;if(Se!==null)Se.return=Ie,Fe=Se;else for(;Fe!==null;){Ie=Fe;var we=Ie.sibling,Ue=Ie.return;if(j3(Ie),Ie===ce){Fe=null;break}if(we!==null){we.return=Ue,Fe=we;break}Fe=Ue}}}var He=B.alternate;if(He!==null){var Ve=He.child;if(Ve!==null){He.child=null;do{var yr=Ve.sibling;Ve.sibling=null,Ve=yr}while(Ve!==null)}}Fe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Fe=U;else e:for(;Fe!==null;){if(B=Fe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:Ih(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Fe=ie;break e}Fe=B.return}}var $=a.current;for(Fe=$;Fe!==null;){U=Fe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Fe=ae;else e:for(U=$;Fe!==null;){if(q=Fe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:lp(9,q)}}catch(je){dr(q,q.return,je)}if(q===U){Fe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Fe=Te;break e}Fe=q.return}}if(St=C,Ua(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,mi.transition=l}}return!1}function oS(a,l,f){l=Ic(f,l),l=C3(a,l,1),a=ka(a,l,1),l=_n(),a!==null&&(Ju(a,1,l),Qn(a,l))}function dr(a,l,f){if(a.tag===3)oS(a,a,f);else for(;l!==null;){if(l.tag===3){oS(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=Ic(f,a),a=S3(l,a,1),l=ka(l,a,1),a=_n(),l!==null&&(Ju(l,1,a),Qn(l,a));break}}l=l.return}}function fQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=_n(),a.pingedLanes|=a.suspendedLanes&f,Vr===a&&(Xr&f)===f&&(Nr===4||Nr===3&&(Xr&130023424)===Xr&&500>qe()-f1?Ho(a,0):d1|=f),Qn(a,l)}function lS(a,l){l===0&&(a.mode&1?(l=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):l=1);var f=_n();a=Hs(a,l),a!==null&&(Ju(a,l,f),Qn(a,f))}function pQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),lS(a,f)}function AQ(a,l){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(l),lS(a,f)}var cS;cS=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Nn.current)Pn=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Pn=!1,rQ(a,l,f);Pn=!!(a.flags&131072)}else Pn=!1,tr&&l.flags&1048576&&zC(l,jf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;ap(a,l),a=l.pendingProps;var C=gc(l,rn.current);Ec(l,f),C=W0(null,l,y,a,C,f);var B=Y0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Un(y)?(B=!0,Hf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,k0(l),C.updater=Jf,l.stateNode=C,C._reactInternals=l,F0(l,y,a,f),l=t1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),mn(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(ap(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=mQ(y),a=Qi(y,a),C){case 0:l=e1(null,l,y,a,f);break e;case 1:l=U3(null,l,y,a,f);break e;case 11:l=b3(null,l,y,a,f);break e;case 14:l=R3(null,l,y,Qi(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),e1(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),U3(a,l,y,C,f);case 3:e:{if(P3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,YC(a,l),Kf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=Ic(Error(t(423)),l),l=k3(a,l,y,f,C);break e}else if(y!==C){C=Ic(Error(t(424)),l),l=k3(a,l,y,f,C);break e}else for(ei=Da(l.stateNode.containerInfo.firstChild),$n=l,tr=!0,ki=null,f=r3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(vc(),y===C){l=Vs(a,l,f);break e}mn(a,l,y,f)}l=l.child}return l;case 5:return n3(l),a===null&&b0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,E0(y,C)?U=null:B!==null&&E0(y,B)&&(l.flags|=32),N3(a,l),mn(a,l,U,f),l.child;case 6:return a===null&&b0(l),null;case 13:return Q3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=xc(l,null,y,f):mn(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),b3(a,l,y,C,f);case 7:return mn(a,l,l.pendingProps,f),l.child;case 8:return mn(a,l,l.pendingProps.children,f),l.child;case 12:return mn(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Yf,y._currentValue),y._currentValue=U,B!==null)if(Pi(B.value,U)){if(B.children===C.children&&!Nn.current){l=Vs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Gs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var Ie=ce.pending;Ie===null?J.next=J:(J.next=Ie.next,Ie.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),U0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),U0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}mn(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,Ec(l,f),C=Ai(C),y=y(C),l.flags|=1,mn(a,l,y,f),l.child;case 14:return y=l.type,C=Qi(y,l.pendingProps),C=Qi(y.type,C),R3(a,l,y,C,f);case 15:return D3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),ap(a,l),l.tag=1,Un(y)?(a=!0,Hf(l)):a=!1,Ec(l,f),ZC(l,y,C),F0(l,y,C,f),t1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return L3(a,l,f)}throw Error(t(156,l.tag))};function uS(a,l){return Re(a,l)}function gQ(a,l,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(a,l,f,y){return new gQ(a,l,f,y)}function E1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function mQ(a){if(typeof a=="function")return E1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ga(a,l){var f=a.alternate;return f===null?(f=_i(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function mp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")E1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Vo(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=_i(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=_i(13,f,l,C),a.elementType=N,a.lanes=B,a;case W:return a=_i(19,f,l,C),a.elementType=W,a.lanes=B,a;case te:return _p(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case S:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return l=_i(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Vo(a,l,f,y){return a=_i(7,a,y,l),a.lanes=f,a}function _p(a,l,f,y){return a=_i(22,a,y,l),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function x1(a,l,f){return a=_i(6,a,null,l),a.lanes=f,a}function w1(a,l,f){return l=_i(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function _Q(a,l,f,y,C){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Km(0),this.expirationTimes=Km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Km(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function I1(a,l,f,y,C,B,U,q,J){return a=new _Q(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=_i(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},k0(B),a}function vQ(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function hS(a){if(!a)return Na;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Un(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Un(f))return QC(a,f,l)}return l}function dS(a,l,f,y,C,B,U,q,J){return a=I1(f,y,!0,a,C,B,U,q,J),a.context=hS(null),f=a.current,y=_n(),C=za(f),B=Gs(y,C),B.callback=l??null,ka(f,B,C),a.current.lanes=C,Ju(a,C,y),Qn(a,y),a}function vp(a,l,f,y){var C=l.current,B=_n(),U=za(C);return f=hS(f),l.context===null?l.context=f:l.pendingContext=f,l=Gs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ka(C,l,U),a!==null&&(zi(a,C,U,B),Xf(a,C,U)),U}function yp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function fS(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function C1(a,l){fS(a,l),(a=a.alternate)&&fS(a,l)}function yQ(){return null}var pS=typeof reportError=="function"?reportError:function(a){console.error(a)};function S1(a){this._internalRoot=a}Ep.prototype.render=S1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));vp(a,l,null,null)},Ep.prototype.unmount=S1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;zo(function(){vp(null,a,null,null)}),l[Qs]=null}};function Ep(a){this._internalRoot=a}Ep.prototype.unstable_scheduleHydration=function(a){if(a){var l=KI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ba.length&&l!==0&&l<Ba[f].priority;f++);Ba.splice(f,0,a),f===0&&$I(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function xp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function AS(){}function EQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=yp(U);B.call(ce)}}var U=dS(l,y,a,0,null,!1,!1,"",AS);return a._reactRootContainer=U,a[Qs]=U.current,hh(a.nodeType===8?a.parentNode:a),zo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=yp(J);q.call(ce)}}var J=I1(a,0,!1,null,null,!1,!1,"",AS);return a._reactRootContainer=J,a[Qs]=J.current,hh(a.nodeType===8?a.parentNode:a),zo(function(){vp(l,J,f,y)}),J}function wp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=yp(U);q.call(J)}}vp(l,U,a,C)}else U=EQ(f,l,a,C,y);return yp(U)}qI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=Dn(l.pendingLanes);f!==0&&(Jm(l,f|1),Qn(l,qe()),!(St&6)&&(Mc=qe()+500,Ua()))}break;case 13:zo(function(){var y=Hs(a,1);if(y!==null){var C=_n();zi(y,a,1,C)}}),C1(a,1)}},Zm=function(a){if(a.tag===13){var l=Hs(a,134217728);if(l!==null){var f=_n();zi(l,a,134217728,f)}C1(a,134217728)}},XI=function(a){if(a.tag===13){var l=za(a),f=Hs(a,l);if(f!==null){var y=_n();zi(f,a,l,y)}C1(a,l)}},KI=function(){return Pt},JI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ce(a,f);break;case"select":l=f.value,l!=null&&me(a,!!f.multiple,l,!1)}},Mt=_1,vt=zo;var xQ={usingClientEntryPoint:!1,Events:[ph,pc,Of,Dt,Lt,_1]},Th={findFiberByHostInstance:Lo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wQ={bundleType:Th.bundleType,version:Th.version,rendererPackageName:Th.rendererPackageName,rendererConfig:Th.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=he(a),a===null?null:a.stateNode},findFiberByHostInstance:Th.findFiberByHostInstance||yQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ip.isDisabled&&Ip.supportsFiber)try{jt=Ip.inject(wQ),rt=Ip}catch{}}return Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xQ,Bn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return vQ(a,l,null,f)},Bn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=pS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=I1(a,1,!1,null,null,f,!1,y,C),a[Qs]=l.current,hh(a.nodeType===8?a.parentNode:a),new S1(l)},Bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(l),a=a===null?null:a.stateNode,a},Bn.flushSync=function(a){return zo(a)},Bn.hydrate=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!0,f)},Bn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=pS;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=dS(l,null,a,1,f??null,C,!1,B,U),a[Qs]=l.current,hh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new Ep(l)},Bn.render=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!1,f)},Bn.unmountComponentAtNode=function(a){if(!xp(a))throw Error(t(40));return a._reactRootContainer?(zo(function(){wp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},Bn.unstable_batchedUpdates=_1,Bn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!xp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return wp(a,l,f,!1,y)},Bn.version="18.2.0-next-9e3b772b8-20220608",Bn}function DI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DI)}catch(r){console.error(r)}}DI(),TI.exports=Mk();var Tk=TI.exports,LI=Tk;Gm.createRoot=LI.createRoot,Gm.hydrateRoot=LI.hydrateRoot;class Bk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Gm.createRoot(document.getElementById(n))}this.targetElement.render(Bh.createElement(Ik,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var Wm={exports:{}},sc=typeof Reflect=="object"?Reflect:null,NI=sc&&typeof sc.apply=="function"?sc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ef;sc&&typeof sc.ownKeys=="function"?Ef=sc.ownKeys:Object.getOwnPropertySymbols?Ef=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ef=function(e){return Object.getOwnPropertyNames(e)};function bk(r){console&&console.warn&&console.warn(r)}var UI=Number.isNaN||function(e){return e!==e};function Ft(){Ft.init.call(this)}Wm.exports=Ft,Wm.exports.once=Nk,Ft.EventEmitter=Ft,Ft.prototype._events=void 0,Ft.prototype._eventsCount=0,Ft.prototype._maxListeners=void 0;var PI=10;function xf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ft,"defaultMaxListeners",{enumerable:!0,get:function(){return PI},set:function(r){if(typeof r!="number"||r<0||UI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");PI=r}}),Ft.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ft.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||UI(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function kI(r){return r._maxListeners===void 0?Ft.defaultMaxListeners:r._maxListeners}Ft.prototype.getMaxListeners=function(){return kI(this)},Ft.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")NI(h,this,t);else for(var u=h.length,d=HI(h,u),n=0;n<u;++n)NI(d[n],this,t);return!0};function QI(r,e,t,n){var i,s,o;if(xf(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=kI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,bk(c)}return r}Ft.prototype.addListener=function(e,t){return QI(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return QI(this,e,t,!0)};function Rk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function FI(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Rk.bind(n);return i.listener=t,n.wrapFn=i,i}Ft.prototype.once=function(e,t){return xf(t),this.on(e,FI(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){return xf(t),this.prependListener(e,FI(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var n,i,s,o,c;if(xf(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Dk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ft.prototype.off=Ft.prototype.removeListener,Ft.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function OI(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Lk(i):HI(i,i.length)}Ft.prototype.listeners=function(e){return OI(this,e,!0)},Ft.prototype.rawListeners=function(e){return OI(this,e,!1)},Ft.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):zI.call(r,e)},Ft.prototype.listenerCount=zI;function zI(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ft.prototype.eventNames=function(){return this._eventsCount>0?Ef(this._events):[]};function HI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Dk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Lk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Nk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}GI(r,e,s,{once:!0}),e!=="error"&&Uk(r,i,{once:!0})})}function Uk(r,e,t){typeof r.on=="function"&&GI(r,"error",e,t)}function GI(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var Pk=Wm.exports;const Wu=class Wu extends Pk.EventEmitter{emitEvent(e,t){Object.keys(Wu.EVENTS).includes(e)&&this.emit(Wu.EVENTS[e],t)}};Bt(Wu,"EVENTS",{onAddToCart:"add-to-cart"});let Ym=Wu;const kk={getCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart.js",addToCartUrl:((WI=window.Shopify)==null?void 0:WI.routes.root)+"cart/add.js"},VI=Object.freeze(kk);class Qk{constructor(e){Bt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:Fk,error:Ok}=console,zk=(...r)=>{Ok("❌ Sprie Error:",...r)},Hk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",Gk={HOST:cs.host,STORE_PREFIX:cs.storePrefix},Vk={addToCartUrl:VI.addToCartUrl,getCartUrl:VI.getCartUrl};class jk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Ym,this.apiService=new _S(new ja(Gk),new Qk(Vk)),this.uiService=new Bk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:cs,log:Fk,logErr:zk,metaData:{appVersion:gS,previewUrlPrams:Hk,targetClassName:"sprie-embed-element"}};this.sdkService=new vS(e),this.sdkService.Init()}load(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}}window.ditaConfigurator=new jk})();
|