@perceptimagery/dita-configurator-staging 0.3.3001 → 0.3.3005

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -39
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* (c) 2023, Abhishek Deb (vikz91.deb@gmail.com) */
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-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}#Sprie-config-Main-Container{width:100%;height:100%}#Sprie-config-Header{height:5rem;border-bottom:1.5px solid #aeaeae;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#Sprie-config-Header .sprie-config-Header-groupName{color:#373737;font-size:1rem;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{height:15.42rem;background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.25rem; 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-Header{height:5.25rem}#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}}.sprie-config-palette{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{position:absolute;z-index:100;bottom:-1rem}.sprie-config-palette-img-text .sprie-config-palette-imgName{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;white-space:nowrap;font-size:.7rem;bottom:-1.2rem;right:0;color:#686868;text-decoration:underline}@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:80%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:center;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:600;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:400;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{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{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:14rem;p {font-size: .7rem; text-align: left; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.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%;gap:.5rem}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
3
- var iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{enumerable:!0,configurable:!0,writable:!0,value:Br}):Ys[Tr]=Br;var Lt=(Ys,Tr,Br)=>(rN(Ys,typeof Tr!="symbol"?Tr+"":Tr,Br),Br);(function(){var Qy,Oy;"use strict";class Ys{constructor(e){Lt(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(),r=new Date(e).getTime()-t;return e===""||r<=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 Tr={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},Br=Object.freeze(Tr),ux="0.3.3001";function fx(i,e){const t=i.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...i.slice(0,t),...i.slice(t+1)]:i}class hx{constructor(e,t){Lt(this,"isAuthenticated");Lt(this,"fetcher");Lt(this,"shopifyAPI");Lt(this,"org");Lt(this,"apiKey");Lt(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){const t=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,n=await this.fetcher.Get(t),r=n.data.find(l=>l.sku===`${e.toLowerCase()}-default`);return{...n,data:fx(n.data,r)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),r=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:r}}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 r=await JSON.parse(t);return Object.values(r)[0]}return null}async HandleShopifyAddToCart(e){e.forEach(r=>{var l;const o=(l=r.properties)==null?void 0:l.customText;o&&(delete r.properties.customText,Object.assign(r.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(r.properties,{"custom-text":o}),Object.assign(r.properties,{"This customized item cannot be returned or exchanged":"I agree"}))});let t={items:e,sections:"mini-cart"};const n=await this.shopifyAPI.Post(t);if(n){const r=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=n.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=r.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var bh=(i=>(i.Init="init",i.Preparing="preparing",i.Authenticating="authenticating",i.Fetching="fetching",i.Loading="loading",i.Done="done",i))(bh||{});class dx{constructor({log:e,logErr:t,apiService:n,metaData:r,config:o}){Lt(this,"log");Lt(this,"logErr");Lt(this,"metaData");Lt(this,"loaderName");Lt(this,"apiKey");Lt(this,"scriptStreamEncoderId");Lt(this,"rawNodeList");Lt(this,"targetNodeList");Lt(this,"status");Lt(this,"isLoaded");Lt(this,"loadCount");Lt(this,"mutationObserver");Lt(this,"config");Lt(this,"apiService");this.config=o,this.apiService=n,this.metaData=r,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=bh.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=bh.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 Ax(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var xm={exports:{}},fl={},Sm={exports:{}},yt={};/**
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-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}#Sprie-config-Main-Container{width:100%;height:100%}#Sprie-config-Header{height:5rem;border-bottom:1.5px solid #aeaeae;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#Sprie-config-Header .sprie-config-Header-groupName{color:#373737;font-size:1rem;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{height:15.42rem;background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.25rem; 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-Header{height:5.25rem}#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}}.sprie-config-palette{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{position:absolute;z-index:100;bottom:-1rem}.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;white-space:nowrap;font-size:.7rem;bottom:-1.2rem;right:0;color:#686868;text-decoration:underline}@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:80%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:center;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:600;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:400;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{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{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:14rem;p {font-size: .7rem; text-align: left; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.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%;gap:.5rem}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
3
+ var iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{enumerable:!0,configurable:!0,writable:!0,value:Br}):Ys[Tr]=Br;var Lt=(Ys,Tr,Br)=>(rN(Ys,typeof Tr!="symbol"?Tr+"":Tr,Br),Br);(function(){var Qy,Oy;"use strict";class Ys{constructor(e){Lt(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(),r=new Date(e).getTime()-t;return e===""||r<=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 Tr={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},Br=Object.freeze(Tr),ux="0.3.3005";function fx(i,e){const t=i.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...i.slice(0,t),...i.slice(t+1)]:i}class hx{constructor(e,t){Lt(this,"isAuthenticated");Lt(this,"fetcher");Lt(this,"shopifyAPI");Lt(this,"org");Lt(this,"apiKey");Lt(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){const t=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,n=await this.fetcher.Get(t),r=n.data.find(l=>l.sku===`${e.toLowerCase()}-default`);return{...n,data:fx(n.data,r)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),r=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:r}}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 r=await JSON.parse(t);return Object.values(r)[0]}return null}async HandleShopifyAddToCart(e){e.forEach(r=>{var l;const o=(l=r.properties)==null?void 0:l.customText;o&&(delete r.properties.customText,Object.assign(r.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(r.properties,{"custom-text":o}),Object.assign(r.properties,{"This customized item cannot be returned or exchanged":"I agree"}))});let t={items:e,sections:"mini-cart"};console.log(t);const n=await this.shopifyAPI.Post(t);if(n){const r=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=n.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=r.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var bh=(i=>(i.Init="init",i.Preparing="preparing",i.Authenticating="authenticating",i.Fetching="fetching",i.Loading="loading",i.Done="done",i))(bh||{});class dx{constructor({log:e,logErr:t,apiService:n,metaData:r,config:o}){Lt(this,"log");Lt(this,"logErr");Lt(this,"metaData");Lt(this,"loaderName");Lt(this,"apiKey");Lt(this,"scriptStreamEncoderId");Lt(this,"rawNodeList");Lt(this,"targetNodeList");Lt(this,"status");Lt(this,"isLoaded");Lt(this,"loadCount");Lt(this,"mutationObserver");Lt(this,"config");Lt(this,"apiService");this.config=o,this.apiService=n,this.metaData=r,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=bh.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=bh.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 Ax(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var xm={exports:{}},fl={},Sm={exports:{}},yt={};/**
4
4
  * @license React
5
5
  * react.production.min.js
6
6
  *
@@ -8,7 +8,7 @@ var iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{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 wm;function px(){if(wm)return yt;wm=1;var i=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function A(U){return U===null||typeof U!="object"?null:(U=p&&U[p]||U["@@iterator"],typeof U=="function"?U:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function _(U,D,G){this.props=U,this.context=D,this.refs=C,this.updater=G||g}_.prototype.isReactComponent={},_.prototype.setState=function(U,D){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,D,"setState")},_.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=_.prototype;function S(U,D,G){this.props=U,this.context=D,this.refs=C,this.updater=G||g}var y=S.prototype=new v;y.constructor=S,E(y,_.prototype),y.isPureReactComponent=!0;var x=Array.isArray,w=Object.prototype.hasOwnProperty,b={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function L(U,D,G){var K,J={},Ae=null,ge=null;if(D!=null)for(K in D.ref!==void 0&&(ge=D.ref),D.key!==void 0&&(Ae=""+D.key),D)w.call(D,K)&&!B.hasOwnProperty(K)&&(J[K]=D[K]);var be=arguments.length-2;if(be===1)J.children=G;else if(1<be){for(var de=Array(be),Oe=0;Oe<be;Oe++)de[Oe]=arguments[Oe+2];J.children=de}if(U&&U.defaultProps)for(K in be=U.defaultProps,be)J[K]===void 0&&(J[K]=be[K]);return{$$typeof:i,type:U,key:Ae,ref:ge,props:J,_owner:b.current}}function R(U,D){return{$$typeof:i,type:U.type,key:D,ref:U.ref,props:U.props,_owner:U._owner}}function T(U){return typeof U=="object"&&U!==null&&U.$$typeof===i}function N(U){var D={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(G){return D[G]})}var k=/\/+/g;function O(U,D){return typeof U=="object"&&U!==null&&U.key!=null?N(""+U.key):D.toString(36)}function F(U,D,G,K,J){var Ae=typeof U;(Ae==="undefined"||Ae==="boolean")&&(U=null);var ge=!1;if(U===null)ge=!0;else switch(Ae){case"string":case"number":ge=!0;break;case"object":switch(U.$$typeof){case i:case e:ge=!0}}if(ge)return ge=U,J=J(ge),U=K===""?"."+O(ge,0):K,x(J)?(G="",U!=null&&(G=U.replace(k,"$&/")+"/"),F(J,D,G,"",function(Oe){return Oe})):J!=null&&(T(J)&&(J=R(J,G+(!J.key||ge&&ge.key===J.key?"":(""+J.key).replace(k,"$&/")+"/")+U)),D.push(J)),1;if(ge=0,K=K===""?".":K+":",x(U))for(var be=0;be<U.length;be++){Ae=U[be];var de=K+O(Ae,be);ge+=F(Ae,D,G,de,J)}else if(de=A(U),typeof de=="function")for(U=de.call(U),be=0;!(Ae=U.next()).done;)Ae=Ae.value,de=K+O(Ae,be++),ge+=F(Ae,D,G,de,J);else if(Ae==="object")throw D=String(U),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return ge}function V(U,D,G){if(U==null)return U;var K=[],J=0;return F(U,K,"","",function(Ae){return D.call(G,Ae,J++)}),K}function X(U){if(U._status===-1){var D=U._result;D=D(),D.then(function(G){(U._status===0||U._status===-1)&&(U._status=1,U._result=G)},function(G){(U._status===0||U._status===-1)&&(U._status=2,U._result=G)}),U._status===-1&&(U._status=0,U._result=D)}if(U._status===1)return U._result.default;throw U._result}var te={current:null},Y={transition:null},$={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:Y,ReactCurrentOwner:b};return yt.Children={map:V,forEach:function(U,D,G){V(U,function(){D.apply(this,arguments)},G)},count:function(U){var D=0;return V(U,function(){D++}),D},toArray:function(U){return V(U,function(D){return D})||[]},only:function(U){if(!T(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},yt.Component=_,yt.Fragment=t,yt.Profiler=r,yt.PureComponent=S,yt.StrictMode=n,yt.Suspense=f,yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,yt.cloneElement=function(U,D,G){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var K=E({},U.props),J=U.key,Ae=U.ref,ge=U._owner;if(D!=null){if(D.ref!==void 0&&(Ae=D.ref,ge=b.current),D.key!==void 0&&(J=""+D.key),U.type&&U.type.defaultProps)var be=U.type.defaultProps;for(de in D)w.call(D,de)&&!B.hasOwnProperty(de)&&(K[de]=D[de]===void 0&&be!==void 0?be[de]:D[de])}var de=arguments.length-2;if(de===1)K.children=G;else if(1<de){be=Array(de);for(var Oe=0;Oe<de;Oe++)be[Oe]=arguments[Oe+2];K.children=be}return{$$typeof:i,type:U.type,key:J,ref:Ae,props:K,_owner:ge}},yt.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:o,_context:U},U.Consumer=U},yt.createElement=L,yt.createFactory=function(U){var D=L.bind(null,U);return D.type=U,D},yt.createRef=function(){return{current:null}},yt.forwardRef=function(U){return{$$typeof:c,render:U}},yt.isValidElement=T,yt.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:X}},yt.memo=function(U,D){return{$$typeof:u,type:U,compare:D===void 0?null:D}},yt.startTransition=function(U){var D=Y.transition;Y.transition={};try{U()}finally{Y.transition=D}},yt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},yt.useCallback=function(U,D){return te.current.useCallback(U,D)},yt.useContext=function(U){return te.current.useContext(U)},yt.useDebugValue=function(){},yt.useDeferredValue=function(U){return te.current.useDeferredValue(U)},yt.useEffect=function(U,D){return te.current.useEffect(U,D)},yt.useId=function(){return te.current.useId()},yt.useImperativeHandle=function(U,D,G){return te.current.useImperativeHandle(U,D,G)},yt.useInsertionEffect=function(U,D){return te.current.useInsertionEffect(U,D)},yt.useLayoutEffect=function(U,D){return te.current.useLayoutEffect(U,D)},yt.useMemo=function(U,D){return te.current.useMemo(U,D)},yt.useReducer=function(U,D,G){return te.current.useReducer(U,D,G)},yt.useRef=function(U){return te.current.useRef(U)},yt.useState=function(U){return te.current.useState(U)},yt.useSyncExternalStore=function(U,D,G){return te.current.useSyncExternalStore(U,D,G)},yt.useTransition=function(){return te.current.useTransition()},yt.version="18.2.0",yt}Sm.exports=px();var Ct=Sm.exports;const Hc=Ax(Ct);/**
11
+ */var wm;function px(){if(wm)return yt;wm=1;var i=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function A(U){return U===null||typeof U!="object"?null:(U=p&&U[p]||U["@@iterator"],typeof U=="function"?U:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function _(U,D,G){this.props=U,this.context=D,this.refs=C,this.updater=G||g}_.prototype.isReactComponent={},_.prototype.setState=function(U,D){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,D,"setState")},_.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=_.prototype;function x(U,D,G){this.props=U,this.context=D,this.refs=C,this.updater=G||g}var y=x.prototype=new v;y.constructor=x,E(y,_.prototype),y.isPureReactComponent=!0;var S=Array.isArray,w=Object.prototype.hasOwnProperty,b={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function L(U,D,G){var K,J={},Ae=null,ge=null;if(D!=null)for(K in D.ref!==void 0&&(ge=D.ref),D.key!==void 0&&(Ae=""+D.key),D)w.call(D,K)&&!B.hasOwnProperty(K)&&(J[K]=D[K]);var be=arguments.length-2;if(be===1)J.children=G;else if(1<be){for(var de=Array(be),Oe=0;Oe<be;Oe++)de[Oe]=arguments[Oe+2];J.children=de}if(U&&U.defaultProps)for(K in be=U.defaultProps,be)J[K]===void 0&&(J[K]=be[K]);return{$$typeof:i,type:U,key:Ae,ref:ge,props:J,_owner:b.current}}function R(U,D){return{$$typeof:i,type:U.type,key:D,ref:U.ref,props:U.props,_owner:U._owner}}function T(U){return typeof U=="object"&&U!==null&&U.$$typeof===i}function N(U){var D={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(G){return D[G]})}var k=/\/+/g;function O(U,D){return typeof U=="object"&&U!==null&&U.key!=null?N(""+U.key):D.toString(36)}function F(U,D,G,K,J){var Ae=typeof U;(Ae==="undefined"||Ae==="boolean")&&(U=null);var ge=!1;if(U===null)ge=!0;else switch(Ae){case"string":case"number":ge=!0;break;case"object":switch(U.$$typeof){case i:case e:ge=!0}}if(ge)return ge=U,J=J(ge),U=K===""?"."+O(ge,0):K,S(J)?(G="",U!=null&&(G=U.replace(k,"$&/")+"/"),F(J,D,G,"",function(Oe){return Oe})):J!=null&&(T(J)&&(J=R(J,G+(!J.key||ge&&ge.key===J.key?"":(""+J.key).replace(k,"$&/")+"/")+U)),D.push(J)),1;if(ge=0,K=K===""?".":K+":",S(U))for(var be=0;be<U.length;be++){Ae=U[be];var de=K+O(Ae,be);ge+=F(Ae,D,G,de,J)}else if(de=A(U),typeof de=="function")for(U=de.call(U),be=0;!(Ae=U.next()).done;)Ae=Ae.value,de=K+O(Ae,be++),ge+=F(Ae,D,G,de,J);else if(Ae==="object")throw D=String(U),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return ge}function V(U,D,G){if(U==null)return U;var K=[],J=0;return F(U,K,"","",function(Ae){return D.call(G,Ae,J++)}),K}function X(U){if(U._status===-1){var D=U._result;D=D(),D.then(function(G){(U._status===0||U._status===-1)&&(U._status=1,U._result=G)},function(G){(U._status===0||U._status===-1)&&(U._status=2,U._result=G)}),U._status===-1&&(U._status=0,U._result=D)}if(U._status===1)return U._result.default;throw U._result}var te={current:null},q={transition:null},Z={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:q,ReactCurrentOwner:b};return yt.Children={map:V,forEach:function(U,D,G){V(U,function(){D.apply(this,arguments)},G)},count:function(U){var D=0;return V(U,function(){D++}),D},toArray:function(U){return V(U,function(D){return D})||[]},only:function(U){if(!T(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},yt.Component=_,yt.Fragment=t,yt.Profiler=r,yt.PureComponent=x,yt.StrictMode=n,yt.Suspense=f,yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,yt.cloneElement=function(U,D,G){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var K=E({},U.props),J=U.key,Ae=U.ref,ge=U._owner;if(D!=null){if(D.ref!==void 0&&(Ae=D.ref,ge=b.current),D.key!==void 0&&(J=""+D.key),U.type&&U.type.defaultProps)var be=U.type.defaultProps;for(de in D)w.call(D,de)&&!B.hasOwnProperty(de)&&(K[de]=D[de]===void 0&&be!==void 0?be[de]:D[de])}var de=arguments.length-2;if(de===1)K.children=G;else if(1<de){be=Array(de);for(var Oe=0;Oe<de;Oe++)be[Oe]=arguments[Oe+2];K.children=be}return{$$typeof:i,type:U.type,key:J,ref:Ae,props:K,_owner:ge}},yt.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:o,_context:U},U.Consumer=U},yt.createElement=L,yt.createFactory=function(U){var D=L.bind(null,U);return D.type=U,D},yt.createRef=function(){return{current:null}},yt.forwardRef=function(U){return{$$typeof:c,render:U}},yt.isValidElement=T,yt.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:X}},yt.memo=function(U,D){return{$$typeof:u,type:U,compare:D===void 0?null:D}},yt.startTransition=function(U){var D=q.transition;q.transition={};try{U()}finally{q.transition=D}},yt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},yt.useCallback=function(U,D){return te.current.useCallback(U,D)},yt.useContext=function(U){return te.current.useContext(U)},yt.useDebugValue=function(){},yt.useDeferredValue=function(U){return te.current.useDeferredValue(U)},yt.useEffect=function(U,D){return te.current.useEffect(U,D)},yt.useId=function(){return te.current.useId()},yt.useImperativeHandle=function(U,D,G){return te.current.useImperativeHandle(U,D,G)},yt.useInsertionEffect=function(U,D){return te.current.useInsertionEffect(U,D)},yt.useLayoutEffect=function(U,D){return te.current.useLayoutEffect(U,D)},yt.useMemo=function(U,D){return te.current.useMemo(U,D)},yt.useReducer=function(U,D,G){return te.current.useReducer(U,D,G)},yt.useRef=function(U){return te.current.useRef(U)},yt.useState=function(U){return te.current.useState(U)},yt.useSyncExternalStore=function(U,D,G){return te.current.useSyncExternalStore(U,D,G)},yt.useTransition=function(){return te.current.useTransition()},yt.version="18.2.0",yt}Sm.exports=px();var Ct=Sm.exports;const Hc=Ax(Ct);/**
12
12
  * @license React
13
13
  * react-jsx-runtime.production.min.js
14
14
  *
@@ -16,7 +16,7 @@ var iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{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 Mm;function gx(){if(Mm)return fl;Mm=1;var i=Ct,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,u){var d,p={},A=null,g=null;u!==void 0&&(A=""+u),f.key!==void 0&&(A=""+f.key),f.ref!==void 0&&(g=f.ref);for(d in f)n.call(f,d)&&!o.hasOwnProperty(d)&&(p[d]=f[d]);if(c&&c.defaultProps)for(d in f=c.defaultProps,f)p[d]===void 0&&(p[d]=f[d]);return{$$typeof:e,type:c,key:A,ref:g,props:p,_owner:r.current}}return fl.Fragment=t,fl.jsx=l,fl.jsxs=l,fl}xm.exports=gx();var De=xm.exports;const sN="";var mx=Object.defineProperty,vx=(i,e,t)=>e in i?mx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ft=(i,e,t)=>(vx(i,typeof e!="symbol"?e+"":e,t),t);const _x={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},Tm=Object.freeze(_x);class Ex{constructor(e){Ft(this,"baseURL"),Ft(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 hl=new Ex({baseURL:Tm.host});function yx(i,e){const t=i.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...i.slice(0,t),...i.slice(t+1)]:i}class Cx{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await hl.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 hl.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await hl.Get(e),n=t.data.find(o=>o.sku==="lens-default");return{...t,data:yx(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await hl.Get(t),r=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:r}}catch{throw new Error("Failed to download model asset.")}}}const Lh=new Cx;class Ix{constructor(e){Ft(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 dl=new Ix(Tm.storePrefix);class xx{constructor(){Ft(this,"authPayload"),Ft(this,"apiKey"),Ft(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 Lh.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(dl.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(dl.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(dl.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=dl.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=dl.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wx(i){if(i.__esModule)return i;var e=i.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(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Dh={exports:{}},Uo=typeof Reflect=="object"?Reflect:null,Bm=Uo&&typeof Uo.apply=="function"?Uo.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Vc;Uo&&typeof Uo.ownKeys=="function"?Vc=Uo.ownKeys:Object.getOwnPropertySymbols?Vc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Vc=function(e){return Object.getOwnPropertyNames(e)};function Mx(i){console&&console.warn&&console.warn(i)}var Rm=Number.isNaN||function(e){return e!==e};function Qt(){Qt.init.call(this)}Dh.exports=Qt,Dh.exports.once=bx,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var bm=10;function Wc(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return bm},set:function(i){if(typeof i!="number"||i<0||Rm(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");bm=i}}),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(e){if(typeof e!="number"||e<0||Rm(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 Lm(i){return i._maxListeners===void 0?Qt.defaultMaxListeners:i._maxListeners}Qt.prototype.getMaxListeners=function(){return Lm(this)},Qt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var c=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw c.context=l,c}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Bm(f,this,t);else for(var u=f.length,d=km(f,u),n=0;n<u;++n)Bm(d[n],this,t);return!0};function Dm(i,e,t,n){var r,o,l;if(Wc(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=n?[t,l]:[l,t]:n?l.unshift(t):l.push(t),r=Lm(i),r>0&&l.length>r&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=i,c.type=e,c.count=l.length,Mx(c)}return i}Qt.prototype.addListener=function(e,t){return Dm(this,e,t,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(e,t){return Dm(this,e,t,!0)};function Tx(){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 Nm(i,e,t){var n={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},r=Tx.bind(n);return r.listener=t,n.wrapFn=r,r}Qt.prototype.once=function(e,t){return Wc(t),this.on(e,Nm(this,e,t)),this},Qt.prototype.prependOnceListener=function(e,t){return Wc(t),this.prependListener(e,Nm(this,e,t)),this},Qt.prototype.removeListener=function(e,t){var n,r,o,l,c;if(Wc(t),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===t||n[l].listener===t){c=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():Bx(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(e){var t,n,r;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 o=Object.keys(n),l;for(r=0;r<o.length;++r)l=o[r],l!=="removeListener"&&this.removeAllListeners(l);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(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function Pm(i,e,t){var n=i._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?Rx(r):km(r,r.length)}Qt.prototype.listeners=function(e){return Pm(this,e,!0)},Qt.prototype.rawListeners=function(e){return Pm(this,e,!1)},Qt.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):Um.call(i,e)},Qt.prototype.listenerCount=Um;function Um(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Vc(this._events):[]};function km(i,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=i[n];return t}function Bx(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function Rx(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function bx(i,e){return new Promise(function(t,n){function r(l){i.removeListener(e,o),n(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",r),t([].slice.call(arguments))}Fm(i,e,o,{once:!0}),e!=="error"&&Lx(i,r,{once:!0})})}function Lx(i,e,t){typeof i.on=="function"&&Fm(i,"error",e,t)}function Fm(i,e,t,n){if(typeof i.on=="function")n.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function r(o){n.once&&i.removeEventListener(e,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var Dx=Dh.exports;const Qm=class Im extends Dx.EventEmitter{emitEvent(e,t){Object.keys(Im.EVENTS).includes(e)&&this.emit(Im.EVENTS[e],t)}};Ft(Qm,"EVENTS",{onAddToCart:"add-to-cart"});let Nx=Qm;var Om={exports:{}};function Px(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Nh={exports:{}};const Ux=wx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zm;function xt(){return zm||(zm=1,function(i,e){(function(t,n){i.exports=n()})(vt,function(){var t=t||function(n,r){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof vt<"u"&&vt.crypto&&(o=vt.crypto),!o&&typeof Px=="function")try{o=Ux}catch{}var l=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function S(){}return function(y){var x;return S.prototype=y,x=new S,S.prototype=null,x}}(),f={},u=f.lib={},d=u.Base=function(){return{extend:function(S){var y=c(this);return S&&y.mixIn(S),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var S=this.extend();return S.init.apply(S,arguments),S},init:function(){},mixIn:function(S){for(var y in S)S.hasOwnProperty(y)&&(this[y]=S[y]);S.hasOwnProperty("toString")&&(this.toString=S.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=u.WordArray=d.extend({init:function(S,y){S=this.words=S||[],y!=r?this.sigBytes=y:this.sigBytes=S.length*4},toString:function(S){return(S||g).stringify(this)},concat:function(S){var y=this.words,x=S.words,w=this.sigBytes,b=S.sigBytes;if(this.clamp(),w%4)for(var B=0;B<b;B++){var L=x[B>>>2]>>>24-B%4*8&255;y[w+B>>>2]|=L<<24-(w+B)%4*8}else for(var R=0;R<b;R+=4)y[w+R>>>2]=x[R>>>2];return this.sigBytes+=b,this},clamp:function(){var S=this.words,y=this.sigBytes;S[y>>>2]&=4294967295<<32-y%4*8,S.length=n.ceil(y/4)},clone:function(){var S=d.clone.call(this);return S.words=this.words.slice(0),S},random:function(S){for(var y=[],x=0;x<S;x+=4)y.push(l());return new p.init(y,S)}}),A=f.enc={},g=A.Hex={stringify:function(S){for(var y=S.words,x=S.sigBytes,w=[],b=0;b<x;b++){var B=y[b>>>2]>>>24-b%4*8&255;w.push((B>>>4).toString(16)),w.push((B&15).toString(16))}return w.join("")},parse:function(S){for(var y=S.length,x=[],w=0;w<y;w+=2)x[w>>>3]|=parseInt(S.substr(w,2),16)<<24-w%8*4;return new p.init(x,y/2)}},E=A.Latin1={stringify:function(S){for(var y=S.words,x=S.sigBytes,w=[],b=0;b<x;b++){var B=y[b>>>2]>>>24-b%4*8&255;w.push(String.fromCharCode(B))}return w.join("")},parse:function(S){for(var y=S.length,x=[],w=0;w<y;w++)x[w>>>2]|=(S.charCodeAt(w)&255)<<24-w%4*8;return new p.init(x,y)}},C=A.Utf8={stringify:function(S){try{return decodeURIComponent(escape(E.stringify(S)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(S){return E.parse(unescape(encodeURIComponent(S)))}},_=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(S){typeof S=="string"&&(S=C.parse(S)),this._data.concat(S),this._nDataBytes+=S.sigBytes},_process:function(S){var y,x=this._data,w=x.words,b=x.sigBytes,B=this.blockSize,L=B*4,R=b/L;S?R=n.ceil(R):R=n.max((R|0)-this._minBufferSize,0);var T=R*B,N=n.min(T*4,b);if(T){for(var k=0;k<T;k+=B)this._doProcessBlock(w,k);y=w.splice(0,T),x.sigBytes-=N}return new p.init(y,N)},clone:function(){var S=d.clone.call(this);return S._data=this._data.clone(),S},_minBufferSize:0});u.Hasher=_.extend({cfg:d.extend(),init:function(S){this.cfg=this.cfg.extend(S),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(S){return this._append(S),this._process(),this},finalize:function(S){S&&this._append(S);var y=this._doFinalize();return y},blockSize:16,_createHelper:function(S){return function(y,x){return new S.init(x).finalize(y)}},_createHmacHelper:function(S){return function(y,x){return new v.HMAC.init(S,x).finalize(y)}}});var v=f.algo={};return f}(Math);return t})}(Nh)),Nh.exports}var Ph={exports:{}},Gm;function jc(){return Gm||(Gm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.Base,c=o.WordArray,f=r.x64={};f.Word=l.extend({init:function(u,d){this.high=u,this.low=d}}),f.WordArray=l.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,p=[],A=0;A<d;A++){var g=u[A];p.push(g.high),p.push(g.low)}return c.create(p,this.sigBytes)},clone:function(){for(var u=l.clone.call(this),d=u.words=this.words.slice(0),p=d.length,A=0;A<p;A++)d[A]=d[A].clone();return u}})}(),t})}(Ph)),Ph.exports}var Uh={exports:{}},Hm;function kx(){return Hm||(Hm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,r=n.lib,o=r.WordArray,l=o.init,c=o.init=function(f){if(f instanceof ArrayBuffer&&(f=new Uint8Array(f)),(f instanceof Int8Array||typeof Uint8ClampedArray<"u"&&f instanceof Uint8ClampedArray||f instanceof Int16Array||f instanceof Uint16Array||f instanceof Int32Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array)&&(f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength)),f instanceof Uint8Array){for(var u=f.byteLength,d=[],p=0;p<u;p++)d[p>>>2]|=f[p]<<24-p%4*8;l.call(this,d,u)}else l.apply(this,arguments)};c.prototype=o}}(),t.lib.WordArray})}(Uh)),Uh.exports}var kh={exports:{}},Vm;function Fx(){return Vm||(Vm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Utf16=l.Utf16BE={stringify:function(f){for(var u=f.words,d=f.sigBytes,p=[],A=0;A<d;A+=2){var g=u[A>>>2]>>>16-A%4*8&65535;p.push(String.fromCharCode(g))}return p.join("")},parse:function(f){for(var u=f.length,d=[],p=0;p<u;p++)d[p>>>1]|=f.charCodeAt(p)<<16-p%2*16;return o.create(d,u*2)}},l.Utf16LE={stringify:function(f){for(var u=f.words,d=f.sigBytes,p=[],A=0;A<d;A+=2){var g=c(u[A>>>2]>>>16-A%4*8&65535);p.push(String.fromCharCode(g))}return p.join("")},parse:function(f){for(var u=f.length,d=[],p=0;p<u;p++)d[p>>>1]|=c(f.charCodeAt(p)<<16-p%2*16);return o.create(d,u*2)}};function c(f){return f<<8&4278255360|f>>>8&16711935}}(),t.enc.Utf16})}(kh)),kh.exports}var Fh={exports:{}},Wm;function qs(){return Wm||(Wm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Base64={stringify:function(f){var u=f.words,d=f.sigBytes,p=this._map;f.clamp();for(var A=[],g=0;g<d;g+=3)for(var E=u[g>>>2]>>>24-g%4*8&255,C=u[g+1>>>2]>>>24-(g+1)%4*8&255,_=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=E<<16|C<<8|_,S=0;S<4&&g+S*.75<d;S++)A.push(p.charAt(v>>>6*(3-S)&63));var y=p.charAt(64);if(y)for(;A.length%4;)A.push(y);return A.join("")},parse:function(f){var u=f.length,d=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var A=0;A<d.length;A++)p[d.charCodeAt(A)]=A}var g=d.charAt(64);if(g){var E=f.indexOf(g);E!==-1&&(u=E)}return c(f,u,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(f,u,d){for(var p=[],A=0,g=0;g<u;g++)if(g%4){var E=d[f.charCodeAt(g-1)]<<g%4*2,C=d[f.charCodeAt(g)]>>>6-g%4*2,_=E|C;p[A>>>2]|=_<<24-A%4*8,A++}return o.create(p,A)}}(),t.enc.Base64})}(Fh)),Fh.exports}var Qh={exports:{}},jm;function Qx(){return jm||(jm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Base64url={stringify:function(f,u){u===void 0&&(u=!0);var d=f.words,p=f.sigBytes,A=u?this._safe_map:this._map;f.clamp();for(var g=[],E=0;E<p;E+=3)for(var C=d[E>>>2]>>>24-E%4*8&255,_=d[E+1>>>2]>>>24-(E+1)%4*8&255,v=d[E+2>>>2]>>>24-(E+2)%4*8&255,S=C<<16|_<<8|v,y=0;y<4&&E+y*.75<p;y++)g.push(A.charAt(S>>>6*(3-y)&63));var x=A.charAt(64);if(x)for(;g.length%4;)g.push(x);return g.join("")},parse:function(f,u){u===void 0&&(u=!0);var d=f.length,p=u?this._safe_map:this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var g=0;g<p.length;g++)A[p.charCodeAt(g)]=g}var E=p.charAt(64);if(E){var C=f.indexOf(E);C!==-1&&(d=C)}return c(f,d,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(f,u,d){for(var p=[],A=0,g=0;g<u;g++)if(g%4){var E=d[f.charCodeAt(g-1)]<<g%4*2,C=d[f.charCodeAt(g)]>>>6-g%4*2,_=E|C;p[A>>>2]|=_<<24-A%4*8,A++}return o.create(p,A)}}(),t.enc.Base64url})}(Qh)),Qh.exports}var Oh={exports:{}},Ym;function Xs(){return Ym||(Ym=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=[];(function(){for(var C=0;C<64;C++)u[C]=n.abs(n.sin(C+1))*4294967296|0})();var d=f.MD5=c.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(C,_){for(var v=0;v<16;v++){var S=_+v,y=C[S];C[S]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}var x=this._hash.words,w=C[_+0],b=C[_+1],B=C[_+2],L=C[_+3],R=C[_+4],T=C[_+5],N=C[_+6],k=C[_+7],O=C[_+8],F=C[_+9],V=C[_+10],X=C[_+11],te=C[_+12],Y=C[_+13],$=C[_+14],U=C[_+15],D=x[0],G=x[1],K=x[2],J=x[3];D=p(D,G,K,J,w,7,u[0]),J=p(J,D,G,K,b,12,u[1]),K=p(K,J,D,G,B,17,u[2]),G=p(G,K,J,D,L,22,u[3]),D=p(D,G,K,J,R,7,u[4]),J=p(J,D,G,K,T,12,u[5]),K=p(K,J,D,G,N,17,u[6]),G=p(G,K,J,D,k,22,u[7]),D=p(D,G,K,J,O,7,u[8]),J=p(J,D,G,K,F,12,u[9]),K=p(K,J,D,G,V,17,u[10]),G=p(G,K,J,D,X,22,u[11]),D=p(D,G,K,J,te,7,u[12]),J=p(J,D,G,K,Y,12,u[13]),K=p(K,J,D,G,$,17,u[14]),G=p(G,K,J,D,U,22,u[15]),D=A(D,G,K,J,b,5,u[16]),J=A(J,D,G,K,N,9,u[17]),K=A(K,J,D,G,X,14,u[18]),G=A(G,K,J,D,w,20,u[19]),D=A(D,G,K,J,T,5,u[20]),J=A(J,D,G,K,V,9,u[21]),K=A(K,J,D,G,U,14,u[22]),G=A(G,K,J,D,R,20,u[23]),D=A(D,G,K,J,F,5,u[24]),J=A(J,D,G,K,$,9,u[25]),K=A(K,J,D,G,L,14,u[26]),G=A(G,K,J,D,O,20,u[27]),D=A(D,G,K,J,Y,5,u[28]),J=A(J,D,G,K,B,9,u[29]),K=A(K,J,D,G,k,14,u[30]),G=A(G,K,J,D,te,20,u[31]),D=g(D,G,K,J,T,4,u[32]),J=g(J,D,G,K,O,11,u[33]),K=g(K,J,D,G,X,16,u[34]),G=g(G,K,J,D,$,23,u[35]),D=g(D,G,K,J,b,4,u[36]),J=g(J,D,G,K,R,11,u[37]),K=g(K,J,D,G,k,16,u[38]),G=g(G,K,J,D,V,23,u[39]),D=g(D,G,K,J,Y,4,u[40]),J=g(J,D,G,K,w,11,u[41]),K=g(K,J,D,G,L,16,u[42]),G=g(G,K,J,D,N,23,u[43]),D=g(D,G,K,J,F,4,u[44]),J=g(J,D,G,K,te,11,u[45]),K=g(K,J,D,G,U,16,u[46]),G=g(G,K,J,D,B,23,u[47]),D=E(D,G,K,J,w,6,u[48]),J=E(J,D,G,K,k,10,u[49]),K=E(K,J,D,G,$,15,u[50]),G=E(G,K,J,D,T,21,u[51]),D=E(D,G,K,J,te,6,u[52]),J=E(J,D,G,K,L,10,u[53]),K=E(K,J,D,G,V,15,u[54]),G=E(G,K,J,D,b,21,u[55]),D=E(D,G,K,J,O,6,u[56]),J=E(J,D,G,K,U,10,u[57]),K=E(K,J,D,G,N,15,u[58]),G=E(G,K,J,D,Y,21,u[59]),D=E(D,G,K,J,R,6,u[60]),J=E(J,D,G,K,X,10,u[61]),K=E(K,J,D,G,B,15,u[62]),G=E(G,K,J,D,F,21,u[63]),x[0]=x[0]+D|0,x[1]=x[1]+G|0,x[2]=x[2]+K|0,x[3]=x[3]+J|0},_doFinalize:function(){var C=this._data,_=C.words,v=this._nDataBytes*8,S=C.sigBytes*8;_[S>>>5]|=128<<24-S%32;var y=n.floor(v/4294967296),x=v;_[(S+64>>>9<<4)+15]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,_[(S+64>>>9<<4)+14]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,C.sigBytes=(_.length+1)*4,this._process();for(var w=this._hash,b=w.words,B=0;B<4;B++){var L=b[B];b[B]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return w},clone:function(){var C=c.clone.call(this);return C._hash=this._hash.clone(),C}});function p(C,_,v,S,y,x,w){var b=C+(_&v|~_&S)+y+w;return(b<<x|b>>>32-x)+_}function A(C,_,v,S,y,x,w){var b=C+(_&S|v&~S)+y+w;return(b<<x|b>>>32-x)+_}function g(C,_,v,S,y,x,w){var b=C+(_^v^S)+y+w;return(b<<x|b>>>32-x)+_}function E(C,_,v,S,y,x,w){var b=C+(v^(_|~S))+y+w;return(b<<x|b>>>32-x)+_}r.MD5=c._createHelper(d),r.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(Oh)),Oh.exports}var zh={exports:{}},qm;function Xm(){return qm||(qm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=r.Hasher,c=n.algo,f=[],u=c.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,p){for(var A=this._hash.words,g=A[0],E=A[1],C=A[2],_=A[3],v=A[4],S=0;S<80;S++){if(S<16)f[S]=d[p+S]|0;else{var y=f[S-3]^f[S-8]^f[S-14]^f[S-16];f[S]=y<<1|y>>>31}var x=(g<<5|g>>>27)+v+f[S];S<20?x+=(E&C|~E&_)+1518500249:S<40?x+=(E^C^_)+1859775393:S<60?x+=(E&C|E&_|C&_)-1894007588:x+=(E^C^_)-899497514,v=_,_=C,C=E<<30|E>>>2,E=g,g=x}A[0]=A[0]+g|0,A[1]=A[1]+E|0,A[2]=A[2]+C|0,A[3]=A[3]+_|0,A[4]=A[4]+v|0},_doFinalize:function(){var d=this._data,p=d.words,A=this._nDataBytes*8,g=d.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=Math.floor(A/4294967296),p[(g+64>>>9<<4)+15]=A,d.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var d=l.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=l._createHelper(u),n.HmacSHA1=l._createHmacHelper(u)}(),t.SHA1})}(zh)),zh.exports}var Gh={exports:{}},Km;function Hh(){return Km||(Km=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=[],d=[];(function(){function g(v){for(var S=n.sqrt(v),y=2;y<=S;y++)if(!(v%y))return!1;return!0}function E(v){return(v-(v|0))*4294967296|0}for(var C=2,_=0;_<64;)g(C)&&(_<8&&(u[_]=E(n.pow(C,1/2))),d[_]=E(n.pow(C,1/3)),_++),C++})();var p=[],A=f.SHA256=c.extend({_doReset:function(){this._hash=new l.init(u.slice(0))},_doProcessBlock:function(g,E){for(var C=this._hash.words,_=C[0],v=C[1],S=C[2],y=C[3],x=C[4],w=C[5],b=C[6],B=C[7],L=0;L<64;L++){if(L<16)p[L]=g[E+L]|0;else{var R=p[L-15],T=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,N=p[L-2],k=(N<<15|N>>>17)^(N<<13|N>>>19)^N>>>10;p[L]=T+p[L-7]+k+p[L-16]}var O=x&w^~x&b,F=_&v^_&S^v&S,V=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),X=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),te=B+X+O+d[L]+p[L],Y=V+F;B=b,b=w,w=x,x=y+te|0,y=S,S=v,v=_,_=te+Y|0}C[0]=C[0]+_|0,C[1]=C[1]+v|0,C[2]=C[2]+S|0,C[3]=C[3]+y|0,C[4]=C[4]+x|0,C[5]=C[5]+w|0,C[6]=C[6]+b|0,C[7]=C[7]+B|0},_doFinalize:function(){var g=this._data,E=g.words,C=this._nDataBytes*8,_=g.sigBytes*8;return E[_>>>5]|=128<<24-_%32,E[(_+64>>>9<<4)+14]=n.floor(C/4294967296),E[(_+64>>>9<<4)+15]=C,g.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});r.SHA256=c._createHelper(A),r.HmacSHA256=c._createHmacHelper(A)}(Math),t.SHA256})}(Gh)),Gh.exports}var Vh={exports:{}},Jm;function Ox(){return Jm||(Jm=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Hh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.algo,c=l.SHA256,f=l.SHA224=c.extend({_doReset:function(){this._hash=new o.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(f),n.HmacSHA224=c._createHmacHelper(f)}(),t.SHA224})}(Vh)),Vh.exports}var Wh={exports:{}},Zm;function $m(){return Zm||(Zm=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Hasher,l=n.x64,c=l.Word,f=l.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var p=[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)],A=[];(function(){for(var E=0;E<80;E++)A[E]=d()})();var g=u.SHA512=o.extend({_doReset:function(){this._hash=new f.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(E,C){for(var _=this._hash.words,v=_[0],S=_[1],y=_[2],x=_[3],w=_[4],b=_[5],B=_[6],L=_[7],R=v.high,T=v.low,N=S.high,k=S.low,O=y.high,F=y.low,V=x.high,X=x.low,te=w.high,Y=w.low,$=b.high,U=b.low,D=B.high,G=B.low,K=L.high,J=L.low,Ae=R,ge=T,be=N,de=k,Oe=O,It=F,ot=V,oe=X,Mt=te,Ne=Y,Ze=$,_e=U,it=D,Ue=G,He=K,$e=J,lt=0;lt<80;lt++){var mt,H,Q=A[lt];if(lt<16)H=Q.high=E[C+lt*2]|0,mt=Q.low=E[C+lt*2+1]|0;else{var se=A[lt-15],Ce=se.high,me=se.low,xe=(Ce>>>1|me<<31)^(Ce>>>8|me<<24)^Ce>>>7,We=(me>>>1|Ce<<31)^(me>>>8|Ce<<24)^(me>>>7|Ce<<25),Se=A[lt-2],Re=Se.high,q=Se.low,Me=(Re>>>19|q<<13)^(Re<<3|q>>>29)^Re>>>6,pe=(q>>>19|Re<<13)^(q<<3|Re>>>29)^(q>>>6|Re<<26),nt=A[lt-7],je=nt.high,Je=nt.low,Ge=A[lt-16],Pe=Ge.high,dt=Ge.low;mt=We+Je,H=xe+je+(mt>>>0<We>>>0?1:0),mt=mt+pe,H=H+Me+(mt>>>0<pe>>>0?1:0),mt=mt+dt,H=H+Pe+(mt>>>0<dt>>>0?1:0),Q.high=H,Q.low=mt}var ee=Mt&Ze^~Mt&it,Te=Ne&_e^~Ne&Ue,ye=Ae&be^Ae&Oe^be&Oe,he=ge&de^ge&It^de&It,we=(Ae>>>28|ge<<4)^(Ae<<30|ge>>>2)^(Ae<<25|ge>>>7),qe=(ge>>>28|Ae<<4)^(ge<<30|Ae>>>2)^(ge<<25|Ae>>>7),At=(Mt>>>14|Ne<<18)^(Mt>>>18|Ne<<14)^(Mt<<23|Ne>>>9),Wt=(Ne>>>14|Mt<<18)^(Ne>>>18|Mt<<14)^(Ne<<23|Mt>>>9),Dn=p[lt],Tt=Dn.high,an=Dn.low,Pt=$e+Wt,Ti=He+At+(Pt>>>0<$e>>>0?1:0),Pt=Pt+Te,Ti=Ti+ee+(Pt>>>0<Te>>>0?1:0),Pt=Pt+an,Ti=Ti+Tt+(Pt>>>0<an>>>0?1:0),Pt=Pt+mt,Ti=Ti+H+(Pt>>>0<mt>>>0?1:0),Cr=qe+he,ir=we+ye+(Cr>>>0<qe>>>0?1:0);He=it,$e=Ue,it=Ze,Ue=_e,Ze=Mt,_e=Ne,Ne=oe+Pt|0,Mt=ot+Ti+(Ne>>>0<oe>>>0?1:0)|0,ot=Oe,oe=It,Oe=be,It=de,be=Ae,de=ge,ge=Pt+Cr|0,Ae=Ti+ir+(ge>>>0<Pt>>>0?1:0)|0}T=v.low=T+ge,v.high=R+Ae+(T>>>0<ge>>>0?1:0),k=S.low=k+de,S.high=N+be+(k>>>0<de>>>0?1:0),F=y.low=F+It,y.high=O+Oe+(F>>>0<It>>>0?1:0),X=x.low=X+oe,x.high=V+ot+(X>>>0<oe>>>0?1:0),Y=w.low=Y+Ne,w.high=te+Mt+(Y>>>0<Ne>>>0?1:0),U=b.low=U+_e,b.high=$+Ze+(U>>>0<_e>>>0?1:0),G=B.low=G+Ue,B.high=D+it+(G>>>0<Ue>>>0?1:0),J=L.low=J+$e,L.high=K+He+(J>>>0<$e>>>0?1:0)},_doFinalize:function(){var E=this._data,C=E.words,_=this._nDataBytes*8,v=E.sigBytes*8;C[v>>>5]|=128<<24-v%32,C[(v+128>>>10<<5)+30]=Math.floor(_/4294967296),C[(v+128>>>10<<5)+31]=_,E.sigBytes=C.length*4,this._process();var S=this._hash.toX32();return S},clone:function(){var E=o.clone.call(this);return E._hash=this._hash.clone(),E},blockSize:1024/32});n.SHA512=o._createHelper(g),n.HmacSHA512=o._createHmacHelper(g)}(),t.SHA512})}(Wh)),Wh.exports}var jh={exports:{}},e0;function zx(){return e0||(e0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc(),$m())})(vt,function(t){return function(){var n=t,r=n.x64,o=r.Word,l=r.WordArray,c=n.algo,f=c.SHA512,u=c.SHA384=f.extend({_doReset:function(){this._hash=new l.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var d=f._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=f._createHelper(u),n.HmacSHA384=f._createHmacHelper(u)}(),t.SHA384})}(jh)),jh.exports}var Yh={exports:{}},t0;function Gx(){return t0||(t0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.x64,u=f.Word,d=r.algo,p=[],A=[],g=[];(function(){for(var _=1,v=0,S=0;S<24;S++){p[_+5*v]=(S+1)*(S+2)/2%64;var y=v%5,x=(2*_+3*v)%5;_=y,v=x}for(var _=0;_<5;_++)for(var v=0;v<5;v++)A[_+5*v]=v+(2*_+3*v)%5*5;for(var w=1,b=0;b<24;b++){for(var B=0,L=0,R=0;R<7;R++){if(w&1){var T=(1<<R)-1;T<32?L^=1<<T:B^=1<<T-32}w&128?w=w<<1^113:w<<=1}g[b]=u.create(B,L)}})();var E=[];(function(){for(var _=0;_<25;_++)E[_]=u.create()})();var C=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var _=this._state=[],v=0;v<25;v++)_[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(_,v){for(var S=this._state,y=this.blockSize/2,x=0;x<y;x++){var w=_[v+2*x],b=_[v+2*x+1];w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;var B=S[x];B.high^=b,B.low^=w}for(var L=0;L<24;L++){for(var R=0;R<5;R++){for(var T=0,N=0,k=0;k<5;k++){var B=S[R+5*k];T^=B.high,N^=B.low}var O=E[R];O.high=T,O.low=N}for(var R=0;R<5;R++)for(var F=E[(R+4)%5],V=E[(R+1)%5],X=V.high,te=V.low,T=F.high^(X<<1|te>>>31),N=F.low^(te<<1|X>>>31),k=0;k<5;k++){var B=S[R+5*k];B.high^=T,B.low^=N}for(var Y=1;Y<25;Y++){var T,N,B=S[Y],$=B.high,U=B.low,D=p[Y];D<32?(T=$<<D|U>>>32-D,N=U<<D|$>>>32-D):(T=U<<D-32|$>>>64-D,N=$<<D-32|U>>>64-D);var G=E[A[Y]];G.high=T,G.low=N}var K=E[0],J=S[0];K.high=J.high,K.low=J.low;for(var R=0;R<5;R++)for(var k=0;k<5;k++){var Y=R+5*k,B=S[Y],Ae=E[Y],ge=E[(R+1)%5+5*k],be=E[(R+2)%5+5*k];B.high=Ae.high^~ge.high&be.high,B.low=Ae.low^~ge.low&be.low}var B=S[0],de=g[L];B.high^=de.high,B.low^=de.low}},_doFinalize:function(){var _=this._data,v=_.words;this._nDataBytes*8;var S=_.sigBytes*8,y=this.blockSize*32;v[S>>>5]|=1<<24-S%32,v[(n.ceil((S+1)/y)*y>>>5)-1]|=128,_.sigBytes=v.length*4,this._process();for(var x=this._state,w=this.cfg.outputLength/8,b=w/8,B=[],L=0;L<b;L++){var R=x[L],T=R.high,N=R.low;T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,B.push(N),B.push(T)}return new l.init(B,w)},clone:function(){for(var _=c.clone.call(this),v=_._state=this._state.slice(0),S=0;S<25;S++)v[S]=v[S].clone();return _}});r.SHA3=c._createHelper(C),r.HmacSHA3=c._createHmacHelper(C)}(Math),t.SHA3})}(Yh)),Yh.exports}var qh={exports:{}},n0;function Hx(){return n0||(n0=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){/** @preserve
19
+ */var Mm;function gx(){if(Mm)return fl;Mm=1;var i=Ct,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(c,f,u){var d,p={},A=null,g=null;u!==void 0&&(A=""+u),f.key!==void 0&&(A=""+f.key),f.ref!==void 0&&(g=f.ref);for(d in f)n.call(f,d)&&!o.hasOwnProperty(d)&&(p[d]=f[d]);if(c&&c.defaultProps)for(d in f=c.defaultProps,f)p[d]===void 0&&(p[d]=f[d]);return{$$typeof:e,type:c,key:A,ref:g,props:p,_owner:r.current}}return fl.Fragment=t,fl.jsx=l,fl.jsxs=l,fl}xm.exports=gx();var De=xm.exports;const sN="";var mx=Object.defineProperty,vx=(i,e,t)=>e in i?mx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ft=(i,e,t)=>(vx(i,typeof e!="symbol"?e+"":e,t),t);const _x={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},Tm=Object.freeze(_x);class Ex{constructor(e){Ft(this,"baseURL"),Ft(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 hl=new Ex({baseURL:Tm.host});function yx(i,e){const t=i.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...i.slice(0,t),...i.slice(t+1)]:i}class Cx{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await hl.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 hl.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await hl.Get(e),n=t.data.find(o=>o.sku==="lens-default");return{...t,data:yx(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await hl.Get(t),r=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:r}}catch{throw new Error("Failed to download model asset.")}}}const Lh=new Cx;class Ix{constructor(e){Ft(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 dl=new Ix(Tm.storePrefix);class xx{constructor(){Ft(this,"authPayload"),Ft(this,"apiKey"),Ft(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 Lh.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(dl.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(dl.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(dl.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=dl.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=dl.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wx(i){if(i.__esModule)return i;var e=i.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(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Dh={exports:{}},Uo=typeof Reflect=="object"?Reflect:null,Bm=Uo&&typeof Uo.apply=="function"?Uo.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Vc;Uo&&typeof Uo.ownKeys=="function"?Vc=Uo.ownKeys:Object.getOwnPropertySymbols?Vc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Vc=function(e){return Object.getOwnPropertyNames(e)};function Mx(i){console&&console.warn&&console.warn(i)}var Rm=Number.isNaN||function(e){return e!==e};function Qt(){Qt.init.call(this)}Dh.exports=Qt,Dh.exports.once=bx,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var bm=10;function Wc(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return bm},set:function(i){if(typeof i!="number"||i<0||Rm(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");bm=i}}),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(e){if(typeof e!="number"||e<0||Rm(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 Lm(i){return i._maxListeners===void 0?Qt.defaultMaxListeners:i._maxListeners}Qt.prototype.getMaxListeners=function(){return Lm(this)},Qt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var c=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw c.context=l,c}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Bm(f,this,t);else for(var u=f.length,d=km(f,u),n=0;n<u;++n)Bm(d[n],this,t);return!0};function Dm(i,e,t,n){var r,o,l;if(Wc(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=n?[t,l]:[l,t]:n?l.unshift(t):l.push(t),r=Lm(i),r>0&&l.length>r&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=i,c.type=e,c.count=l.length,Mx(c)}return i}Qt.prototype.addListener=function(e,t){return Dm(this,e,t,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(e,t){return Dm(this,e,t,!0)};function Tx(){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 Nm(i,e,t){var n={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},r=Tx.bind(n);return r.listener=t,n.wrapFn=r,r}Qt.prototype.once=function(e,t){return Wc(t),this.on(e,Nm(this,e,t)),this},Qt.prototype.prependOnceListener=function(e,t){return Wc(t),this.prependListener(e,Nm(this,e,t)),this},Qt.prototype.removeListener=function(e,t){var n,r,o,l,c;if(Wc(t),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===t||n[l].listener===t){c=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():Bx(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(e){var t,n,r;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 o=Object.keys(n),l;for(r=0;r<o.length;++r)l=o[r],l!=="removeListener"&&this.removeAllListeners(l);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(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function Pm(i,e,t){var n=i._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?Rx(r):km(r,r.length)}Qt.prototype.listeners=function(e){return Pm(this,e,!0)},Qt.prototype.rawListeners=function(e){return Pm(this,e,!1)},Qt.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):Um.call(i,e)},Qt.prototype.listenerCount=Um;function Um(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Vc(this._events):[]};function km(i,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=i[n];return t}function Bx(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function Rx(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function bx(i,e){return new Promise(function(t,n){function r(l){i.removeListener(e,o),n(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",r),t([].slice.call(arguments))}Fm(i,e,o,{once:!0}),e!=="error"&&Lx(i,r,{once:!0})})}function Lx(i,e,t){typeof i.on=="function"&&Fm(i,"error",e,t)}function Fm(i,e,t,n){if(typeof i.on=="function")n.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function r(o){n.once&&i.removeEventListener(e,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var Dx=Dh.exports;const Qm=class Im extends Dx.EventEmitter{emitEvent(e,t){Object.keys(Im.EVENTS).includes(e)&&this.emit(Im.EVENTS[e],t)}};Ft(Qm,"EVENTS",{onAddToCart:"add-to-cart"});let Nx=Qm;var Om={exports:{}};function Px(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Nh={exports:{}};const Ux=wx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zm;function xt(){return zm||(zm=1,function(i,e){(function(t,n){i.exports=n()})(vt,function(){var t=t||function(n,r){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof vt<"u"&&vt.crypto&&(o=vt.crypto),!o&&typeof Px=="function")try{o=Ux}catch{}var l=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function x(){}return function(y){var S;return x.prototype=y,S=new x,x.prototype=null,S}}(),f={},u=f.lib={},d=u.Base=function(){return{extend:function(x){var y=c(this);return x&&y.mixIn(x),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),p=u.WordArray=d.extend({init:function(x,y){x=this.words=x||[],y!=r?this.sigBytes=y:this.sigBytes=x.length*4},toString:function(x){return(x||g).stringify(this)},concat:function(x){var y=this.words,S=x.words,w=this.sigBytes,b=x.sigBytes;if(this.clamp(),w%4)for(var B=0;B<b;B++){var L=S[B>>>2]>>>24-B%4*8&255;y[w+B>>>2]|=L<<24-(w+B)%4*8}else for(var R=0;R<b;R+=4)y[w+R>>>2]=S[R>>>2];return this.sigBytes+=b,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=n.ceil(y/4)},clone:function(){var x=d.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],S=0;S<x;S+=4)y.push(l());return new p.init(y,x)}}),A=f.enc={},g=A.Hex={stringify:function(x){for(var y=x.words,S=x.sigBytes,w=[],b=0;b<S;b++){var B=y[b>>>2]>>>24-b%4*8&255;w.push((B>>>4).toString(16)),w.push((B&15).toString(16))}return w.join("")},parse:function(x){for(var y=x.length,S=[],w=0;w<y;w+=2)S[w>>>3]|=parseInt(x.substr(w,2),16)<<24-w%8*4;return new p.init(S,y/2)}},E=A.Latin1={stringify:function(x){for(var y=x.words,S=x.sigBytes,w=[],b=0;b<S;b++){var B=y[b>>>2]>>>24-b%4*8&255;w.push(String.fromCharCode(B))}return w.join("")},parse:function(x){for(var y=x.length,S=[],w=0;w<y;w++)S[w>>>2]|=(x.charCodeAt(w)&255)<<24-w%4*8;return new p.init(S,y)}},C=A.Utf8={stringify:function(x){try{return decodeURIComponent(escape(E.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return E.parse(unescape(encodeURIComponent(x)))}},_=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(x){typeof x=="string"&&(x=C.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes},_process:function(x){var y,S=this._data,w=S.words,b=S.sigBytes,B=this.blockSize,L=B*4,R=b/L;x?R=n.ceil(R):R=n.max((R|0)-this._minBufferSize,0);var T=R*B,N=n.min(T*4,b);if(T){for(var k=0;k<T;k+=B)this._doProcessBlock(w,k);y=w.splice(0,T),S.sigBytes-=N}return new p.init(y,N)},clone:function(){var x=d.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});u.Hasher=_.extend({cfg:d.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:16,_createHelper:function(x){return function(y,S){return new x.init(S).finalize(y)}},_createHmacHelper:function(x){return function(y,S){return new v.HMAC.init(x,S).finalize(y)}}});var v=f.algo={};return f}(Math);return t})}(Nh)),Nh.exports}var Ph={exports:{}},Gm;function jc(){return Gm||(Gm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.Base,c=o.WordArray,f=r.x64={};f.Word=l.extend({init:function(u,d){this.high=u,this.low=d}}),f.WordArray=l.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,p=[],A=0;A<d;A++){var g=u[A];p.push(g.high),p.push(g.low)}return c.create(p,this.sigBytes)},clone:function(){for(var u=l.clone.call(this),d=u.words=this.words.slice(0),p=d.length,A=0;A<p;A++)d[A]=d[A].clone();return u}})}(),t})}(Ph)),Ph.exports}var Uh={exports:{}},Hm;function kx(){return Hm||(Hm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,r=n.lib,o=r.WordArray,l=o.init,c=o.init=function(f){if(f instanceof ArrayBuffer&&(f=new Uint8Array(f)),(f instanceof Int8Array||typeof Uint8ClampedArray<"u"&&f instanceof Uint8ClampedArray||f instanceof Int16Array||f instanceof Uint16Array||f instanceof Int32Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array)&&(f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength)),f instanceof Uint8Array){for(var u=f.byteLength,d=[],p=0;p<u;p++)d[p>>>2]|=f[p]<<24-p%4*8;l.call(this,d,u)}else l.apply(this,arguments)};c.prototype=o}}(),t.lib.WordArray})}(Uh)),Uh.exports}var kh={exports:{}},Vm;function Fx(){return Vm||(Vm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Utf16=l.Utf16BE={stringify:function(f){for(var u=f.words,d=f.sigBytes,p=[],A=0;A<d;A+=2){var g=u[A>>>2]>>>16-A%4*8&65535;p.push(String.fromCharCode(g))}return p.join("")},parse:function(f){for(var u=f.length,d=[],p=0;p<u;p++)d[p>>>1]|=f.charCodeAt(p)<<16-p%2*16;return o.create(d,u*2)}},l.Utf16LE={stringify:function(f){for(var u=f.words,d=f.sigBytes,p=[],A=0;A<d;A+=2){var g=c(u[A>>>2]>>>16-A%4*8&65535);p.push(String.fromCharCode(g))}return p.join("")},parse:function(f){for(var u=f.length,d=[],p=0;p<u;p++)d[p>>>1]|=c(f.charCodeAt(p)<<16-p%2*16);return o.create(d,u*2)}};function c(f){return f<<8&4278255360|f>>>8&16711935}}(),t.enc.Utf16})}(kh)),kh.exports}var Fh={exports:{}},Wm;function qs(){return Wm||(Wm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Base64={stringify:function(f){var u=f.words,d=f.sigBytes,p=this._map;f.clamp();for(var A=[],g=0;g<d;g+=3)for(var E=u[g>>>2]>>>24-g%4*8&255,C=u[g+1>>>2]>>>24-(g+1)%4*8&255,_=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=E<<16|C<<8|_,x=0;x<4&&g+x*.75<d;x++)A.push(p.charAt(v>>>6*(3-x)&63));var y=p.charAt(64);if(y)for(;A.length%4;)A.push(y);return A.join("")},parse:function(f){var u=f.length,d=this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var A=0;A<d.length;A++)p[d.charCodeAt(A)]=A}var g=d.charAt(64);if(g){var E=f.indexOf(g);E!==-1&&(u=E)}return c(f,u,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(f,u,d){for(var p=[],A=0,g=0;g<u;g++)if(g%4){var E=d[f.charCodeAt(g-1)]<<g%4*2,C=d[f.charCodeAt(g)]>>>6-g%4*2,_=E|C;p[A>>>2]|=_<<24-A%4*8,A++}return o.create(p,A)}}(),t.enc.Base64})}(Fh)),Fh.exports}var Qh={exports:{}},jm;function Qx(){return jm||(jm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.enc;l.Base64url={stringify:function(f,u){u===void 0&&(u=!0);var d=f.words,p=f.sigBytes,A=u?this._safe_map:this._map;f.clamp();for(var g=[],E=0;E<p;E+=3)for(var C=d[E>>>2]>>>24-E%4*8&255,_=d[E+1>>>2]>>>24-(E+1)%4*8&255,v=d[E+2>>>2]>>>24-(E+2)%4*8&255,x=C<<16|_<<8|v,y=0;y<4&&E+y*.75<p;y++)g.push(A.charAt(x>>>6*(3-y)&63));var S=A.charAt(64);if(S)for(;g.length%4;)g.push(S);return g.join("")},parse:function(f,u){u===void 0&&(u=!0);var d=f.length,p=u?this._safe_map:this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var g=0;g<p.length;g++)A[p.charCodeAt(g)]=g}var E=p.charAt(64);if(E){var C=f.indexOf(E);C!==-1&&(d=C)}return c(f,d,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(f,u,d){for(var p=[],A=0,g=0;g<u;g++)if(g%4){var E=d[f.charCodeAt(g-1)]<<g%4*2,C=d[f.charCodeAt(g)]>>>6-g%4*2,_=E|C;p[A>>>2]|=_<<24-A%4*8,A++}return o.create(p,A)}}(),t.enc.Base64url})}(Qh)),Qh.exports}var Oh={exports:{}},Ym;function Xs(){return Ym||(Ym=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=[];(function(){for(var C=0;C<64;C++)u[C]=n.abs(n.sin(C+1))*4294967296|0})();var d=f.MD5=c.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(C,_){for(var v=0;v<16;v++){var x=_+v,y=C[x];C[x]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}var S=this._hash.words,w=C[_+0],b=C[_+1],B=C[_+2],L=C[_+3],R=C[_+4],T=C[_+5],N=C[_+6],k=C[_+7],O=C[_+8],F=C[_+9],V=C[_+10],X=C[_+11],te=C[_+12],q=C[_+13],Z=C[_+14],U=C[_+15],D=S[0],G=S[1],K=S[2],J=S[3];D=p(D,G,K,J,w,7,u[0]),J=p(J,D,G,K,b,12,u[1]),K=p(K,J,D,G,B,17,u[2]),G=p(G,K,J,D,L,22,u[3]),D=p(D,G,K,J,R,7,u[4]),J=p(J,D,G,K,T,12,u[5]),K=p(K,J,D,G,N,17,u[6]),G=p(G,K,J,D,k,22,u[7]),D=p(D,G,K,J,O,7,u[8]),J=p(J,D,G,K,F,12,u[9]),K=p(K,J,D,G,V,17,u[10]),G=p(G,K,J,D,X,22,u[11]),D=p(D,G,K,J,te,7,u[12]),J=p(J,D,G,K,q,12,u[13]),K=p(K,J,D,G,Z,17,u[14]),G=p(G,K,J,D,U,22,u[15]),D=A(D,G,K,J,b,5,u[16]),J=A(J,D,G,K,N,9,u[17]),K=A(K,J,D,G,X,14,u[18]),G=A(G,K,J,D,w,20,u[19]),D=A(D,G,K,J,T,5,u[20]),J=A(J,D,G,K,V,9,u[21]),K=A(K,J,D,G,U,14,u[22]),G=A(G,K,J,D,R,20,u[23]),D=A(D,G,K,J,F,5,u[24]),J=A(J,D,G,K,Z,9,u[25]),K=A(K,J,D,G,L,14,u[26]),G=A(G,K,J,D,O,20,u[27]),D=A(D,G,K,J,q,5,u[28]),J=A(J,D,G,K,B,9,u[29]),K=A(K,J,D,G,k,14,u[30]),G=A(G,K,J,D,te,20,u[31]),D=g(D,G,K,J,T,4,u[32]),J=g(J,D,G,K,O,11,u[33]),K=g(K,J,D,G,X,16,u[34]),G=g(G,K,J,D,Z,23,u[35]),D=g(D,G,K,J,b,4,u[36]),J=g(J,D,G,K,R,11,u[37]),K=g(K,J,D,G,k,16,u[38]),G=g(G,K,J,D,V,23,u[39]),D=g(D,G,K,J,q,4,u[40]),J=g(J,D,G,K,w,11,u[41]),K=g(K,J,D,G,L,16,u[42]),G=g(G,K,J,D,N,23,u[43]),D=g(D,G,K,J,F,4,u[44]),J=g(J,D,G,K,te,11,u[45]),K=g(K,J,D,G,U,16,u[46]),G=g(G,K,J,D,B,23,u[47]),D=E(D,G,K,J,w,6,u[48]),J=E(J,D,G,K,k,10,u[49]),K=E(K,J,D,G,Z,15,u[50]),G=E(G,K,J,D,T,21,u[51]),D=E(D,G,K,J,te,6,u[52]),J=E(J,D,G,K,L,10,u[53]),K=E(K,J,D,G,V,15,u[54]),G=E(G,K,J,D,b,21,u[55]),D=E(D,G,K,J,O,6,u[56]),J=E(J,D,G,K,U,10,u[57]),K=E(K,J,D,G,N,15,u[58]),G=E(G,K,J,D,q,21,u[59]),D=E(D,G,K,J,R,6,u[60]),J=E(J,D,G,K,X,10,u[61]),K=E(K,J,D,G,B,15,u[62]),G=E(G,K,J,D,F,21,u[63]),S[0]=S[0]+D|0,S[1]=S[1]+G|0,S[2]=S[2]+K|0,S[3]=S[3]+J|0},_doFinalize:function(){var C=this._data,_=C.words,v=this._nDataBytes*8,x=C.sigBytes*8;_[x>>>5]|=128<<24-x%32;var y=n.floor(v/4294967296),S=v;_[(x+64>>>9<<4)+15]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,_[(x+64>>>9<<4)+14]=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,C.sigBytes=(_.length+1)*4,this._process();for(var w=this._hash,b=w.words,B=0;B<4;B++){var L=b[B];b[B]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return w},clone:function(){var C=c.clone.call(this);return C._hash=this._hash.clone(),C}});function p(C,_,v,x,y,S,w){var b=C+(_&v|~_&x)+y+w;return(b<<S|b>>>32-S)+_}function A(C,_,v,x,y,S,w){var b=C+(_&x|v&~x)+y+w;return(b<<S|b>>>32-S)+_}function g(C,_,v,x,y,S,w){var b=C+(_^v^x)+y+w;return(b<<S|b>>>32-S)+_}function E(C,_,v,x,y,S,w){var b=C+(v^(_|~x))+y+w;return(b<<S|b>>>32-S)+_}r.MD5=c._createHelper(d),r.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(Oh)),Oh.exports}var zh={exports:{}},qm;function Xm(){return qm||(qm=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=r.Hasher,c=n.algo,f=[],u=c.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,p){for(var A=this._hash.words,g=A[0],E=A[1],C=A[2],_=A[3],v=A[4],x=0;x<80;x++){if(x<16)f[x]=d[p+x]|0;else{var y=f[x-3]^f[x-8]^f[x-14]^f[x-16];f[x]=y<<1|y>>>31}var S=(g<<5|g>>>27)+v+f[x];x<20?S+=(E&C|~E&_)+1518500249:x<40?S+=(E^C^_)+1859775393:x<60?S+=(E&C|E&_|C&_)-1894007588:S+=(E^C^_)-899497514,v=_,_=C,C=E<<30|E>>>2,E=g,g=S}A[0]=A[0]+g|0,A[1]=A[1]+E|0,A[2]=A[2]+C|0,A[3]=A[3]+_|0,A[4]=A[4]+v|0},_doFinalize:function(){var d=this._data,p=d.words,A=this._nDataBytes*8,g=d.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=Math.floor(A/4294967296),p[(g+64>>>9<<4)+15]=A,d.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var d=l.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=l._createHelper(u),n.HmacSHA1=l._createHmacHelper(u)}(),t.SHA1})}(zh)),zh.exports}var Gh={exports:{}},Km;function Hh(){return Km||(Km=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=[],d=[];(function(){function g(v){for(var x=n.sqrt(v),y=2;y<=x;y++)if(!(v%y))return!1;return!0}function E(v){return(v-(v|0))*4294967296|0}for(var C=2,_=0;_<64;)g(C)&&(_<8&&(u[_]=E(n.pow(C,1/2))),d[_]=E(n.pow(C,1/3)),_++),C++})();var p=[],A=f.SHA256=c.extend({_doReset:function(){this._hash=new l.init(u.slice(0))},_doProcessBlock:function(g,E){for(var C=this._hash.words,_=C[0],v=C[1],x=C[2],y=C[3],S=C[4],w=C[5],b=C[6],B=C[7],L=0;L<64;L++){if(L<16)p[L]=g[E+L]|0;else{var R=p[L-15],T=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,N=p[L-2],k=(N<<15|N>>>17)^(N<<13|N>>>19)^N>>>10;p[L]=T+p[L-7]+k+p[L-16]}var O=S&w^~S&b,F=_&v^_&x^v&x,V=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),X=(S<<26|S>>>6)^(S<<21|S>>>11)^(S<<7|S>>>25),te=B+X+O+d[L]+p[L],q=V+F;B=b,b=w,w=S,S=y+te|0,y=x,x=v,v=_,_=te+q|0}C[0]=C[0]+_|0,C[1]=C[1]+v|0,C[2]=C[2]+x|0,C[3]=C[3]+y|0,C[4]=C[4]+S|0,C[5]=C[5]+w|0,C[6]=C[6]+b|0,C[7]=C[7]+B|0},_doFinalize:function(){var g=this._data,E=g.words,C=this._nDataBytes*8,_=g.sigBytes*8;return E[_>>>5]|=128<<24-_%32,E[(_+64>>>9<<4)+14]=n.floor(C/4294967296),E[(_+64>>>9<<4)+15]=C,g.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});r.SHA256=c._createHelper(A),r.HmacSHA256=c._createHmacHelper(A)}(Math),t.SHA256})}(Gh)),Gh.exports}var Vh={exports:{}},Jm;function Ox(){return Jm||(Jm=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Hh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=n.algo,c=l.SHA256,f=l.SHA224=c.extend({_doReset:function(){this._hash=new o.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(f),n.HmacSHA224=c._createHmacHelper(f)}(),t.SHA224})}(Vh)),Vh.exports}var Wh={exports:{}},$m;function Zm(){return $m||($m=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Hasher,l=n.x64,c=l.Word,f=l.WordArray,u=n.algo;function d(){return c.create.apply(c,arguments)}var p=[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)],A=[];(function(){for(var E=0;E<80;E++)A[E]=d()})();var g=u.SHA512=o.extend({_doReset:function(){this._hash=new f.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(E,C){for(var _=this._hash.words,v=_[0],x=_[1],y=_[2],S=_[3],w=_[4],b=_[5],B=_[6],L=_[7],R=v.high,T=v.low,N=x.high,k=x.low,O=y.high,F=y.low,V=S.high,X=S.low,te=w.high,q=w.low,Z=b.high,U=b.low,D=B.high,G=B.low,K=L.high,J=L.low,Ae=R,ge=T,be=N,de=k,Oe=O,It=F,st=V,oe=X,Mt=te,Ne=q,$e=Z,Ee=U,nt=D,Ue=G,He=K,ot=J,ut=0;ut<80;ut++){var At,H,Q=A[ut];if(ut<16)H=Q.high=E[C+ut*2]|0,At=Q.low=E[C+ut*2+1]|0;else{var se=A[ut-15],Ce=se.high,me=se.low,xe=(Ce>>>1|me<<31)^(Ce>>>8|me<<24)^Ce>>>7,We=(me>>>1|Ce<<31)^(me>>>8|Ce<<24)^(me>>>7|Ce<<25),Se=A[ut-2],Re=Se.high,Y=Se.low,Me=(Re>>>19|Y<<13)^(Re<<3|Y>>>29)^Re>>>6,pe=(Y>>>19|Re<<13)^(Y<<3|Re>>>29)^(Y>>>6|Re<<26),tt=A[ut-7],je=tt.high,Je=tt.low,Ge=A[ut-16],Pe=Ge.high,dt=Ge.low;At=We+Je,H=xe+je+(At>>>0<We>>>0?1:0),At=At+pe,H=H+Me+(At>>>0<pe>>>0?1:0),At=At+dt,H=H+Pe+(At>>>0<dt>>>0?1:0),Q.high=H,Q.low=At}var ee=Mt&$e^~Mt&nt,Te=Ne&Ee^~Ne&Ue,ye=Ae&be^Ae&Oe^be&Oe,he=ge&de^ge&It^de&It,we=(Ae>>>28|ge<<4)^(Ae<<30|ge>>>2)^(Ae<<25|ge>>>7),qe=(ge>>>28|Ae<<4)^(ge<<30|Ae>>>2)^(ge<<25|Ae>>>7),pt=(Mt>>>14|Ne<<18)^(Mt>>>18|Ne<<14)^(Mt<<23|Ne>>>9),Wt=(Ne>>>14|Mt<<18)^(Ne>>>18|Mt<<14)^(Ne<<23|Mt>>>9),Dn=p[ut],Tt=Dn.high,an=Dn.low,Pt=ot+Wt,Ti=He+pt+(Pt>>>0<ot>>>0?1:0),Pt=Pt+Te,Ti=Ti+ee+(Pt>>>0<Te>>>0?1:0),Pt=Pt+an,Ti=Ti+Tt+(Pt>>>0<an>>>0?1:0),Pt=Pt+At,Ti=Ti+H+(Pt>>>0<At>>>0?1:0),Cr=qe+he,ir=we+ye+(Cr>>>0<qe>>>0?1:0);He=nt,ot=Ue,nt=$e,Ue=Ee,$e=Mt,Ee=Ne,Ne=oe+Pt|0,Mt=st+Ti+(Ne>>>0<oe>>>0?1:0)|0,st=Oe,oe=It,Oe=be,It=de,be=Ae,de=ge,ge=Pt+Cr|0,Ae=Ti+ir+(ge>>>0<Pt>>>0?1:0)|0}T=v.low=T+ge,v.high=R+Ae+(T>>>0<ge>>>0?1:0),k=x.low=k+de,x.high=N+be+(k>>>0<de>>>0?1:0),F=y.low=F+It,y.high=O+Oe+(F>>>0<It>>>0?1:0),X=S.low=X+oe,S.high=V+st+(X>>>0<oe>>>0?1:0),q=w.low=q+Ne,w.high=te+Mt+(q>>>0<Ne>>>0?1:0),U=b.low=U+Ee,b.high=Z+$e+(U>>>0<Ee>>>0?1:0),G=B.low=G+Ue,B.high=D+nt+(G>>>0<Ue>>>0?1:0),J=L.low=J+ot,L.high=K+He+(J>>>0<ot>>>0?1:0)},_doFinalize:function(){var E=this._data,C=E.words,_=this._nDataBytes*8,v=E.sigBytes*8;C[v>>>5]|=128<<24-v%32,C[(v+128>>>10<<5)+30]=Math.floor(_/4294967296),C[(v+128>>>10<<5)+31]=_,E.sigBytes=C.length*4,this._process();var x=this._hash.toX32();return x},clone:function(){var E=o.clone.call(this);return E._hash=this._hash.clone(),E},blockSize:1024/32});n.SHA512=o._createHelper(g),n.HmacSHA512=o._createHmacHelper(g)}(),t.SHA512})}(Wh)),Wh.exports}var jh={exports:{}},e0;function zx(){return e0||(e0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc(),Zm())})(vt,function(t){return function(){var n=t,r=n.x64,o=r.Word,l=r.WordArray,c=n.algo,f=c.SHA512,u=c.SHA384=f.extend({_doReset:function(){this._hash=new l.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var d=f._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=f._createHelper(u),n.HmacSHA384=f._createHmacHelper(u)}(),t.SHA384})}(jh)),jh.exports}var Yh={exports:{}},t0;function Gx(){return t0||(t0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),jc())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.x64,u=f.Word,d=r.algo,p=[],A=[],g=[];(function(){for(var _=1,v=0,x=0;x<24;x++){p[_+5*v]=(x+1)*(x+2)/2%64;var y=v%5,S=(2*_+3*v)%5;_=y,v=S}for(var _=0;_<5;_++)for(var v=0;v<5;v++)A[_+5*v]=v+(2*_+3*v)%5*5;for(var w=1,b=0;b<24;b++){for(var B=0,L=0,R=0;R<7;R++){if(w&1){var T=(1<<R)-1;T<32?L^=1<<T:B^=1<<T-32}w&128?w=w<<1^113:w<<=1}g[b]=u.create(B,L)}})();var E=[];(function(){for(var _=0;_<25;_++)E[_]=u.create()})();var C=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var _=this._state=[],v=0;v<25;v++)_[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(_,v){for(var x=this._state,y=this.blockSize/2,S=0;S<y;S++){var w=_[v+2*S],b=_[v+2*S+1];w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;var B=x[S];B.high^=b,B.low^=w}for(var L=0;L<24;L++){for(var R=0;R<5;R++){for(var T=0,N=0,k=0;k<5;k++){var B=x[R+5*k];T^=B.high,N^=B.low}var O=E[R];O.high=T,O.low=N}for(var R=0;R<5;R++)for(var F=E[(R+4)%5],V=E[(R+1)%5],X=V.high,te=V.low,T=F.high^(X<<1|te>>>31),N=F.low^(te<<1|X>>>31),k=0;k<5;k++){var B=x[R+5*k];B.high^=T,B.low^=N}for(var q=1;q<25;q++){var T,N,B=x[q],Z=B.high,U=B.low,D=p[q];D<32?(T=Z<<D|U>>>32-D,N=U<<D|Z>>>32-D):(T=U<<D-32|Z>>>64-D,N=Z<<D-32|U>>>64-D);var G=E[A[q]];G.high=T,G.low=N}var K=E[0],J=x[0];K.high=J.high,K.low=J.low;for(var R=0;R<5;R++)for(var k=0;k<5;k++){var q=R+5*k,B=x[q],Ae=E[q],ge=E[(R+1)%5+5*k],be=E[(R+2)%5+5*k];B.high=Ae.high^~ge.high&be.high,B.low=Ae.low^~ge.low&be.low}var B=x[0],de=g[L];B.high^=de.high,B.low^=de.low}},_doFinalize:function(){var _=this._data,v=_.words;this._nDataBytes*8;var x=_.sigBytes*8,y=this.blockSize*32;v[x>>>5]|=1<<24-x%32,v[(n.ceil((x+1)/y)*y>>>5)-1]|=128,_.sigBytes=v.length*4,this._process();for(var S=this._state,w=this.cfg.outputLength/8,b=w/8,B=[],L=0;L<b;L++){var R=S[L],T=R.high,N=R.low;T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,B.push(N),B.push(T)}return new l.init(B,w)},clone:function(){for(var _=c.clone.call(this),v=_._state=this._state.slice(0),x=0;x<25;x++)v[x]=v[x].clone();return _}});r.SHA3=c._createHelper(C),r.HmacSHA3=c._createHmacHelper(C)}(Math),t.SHA3})}(Yh)),Yh.exports}var qh={exports:{}},n0;function Hx(){return n0||(n0=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,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:
@@ -25,19 +25,19 @@ var iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{enumerable:!0
25
25
  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
26
26
 
27
27
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- */return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=l.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=l.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=l.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),A=l.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=l.create([0,1518500249,1859775393,2400959708,2840853838]),E=l.create([1352829926,1548603684,1836072691,2053994217,0]),C=f.RIPEMD160=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(b,B){for(var L=0;L<16;L++){var R=B+L,T=b[R];b[R]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}var N=this._hash.words,k=g.words,O=E.words,F=u.words,V=d.words,X=p.words,te=A.words,Y,$,U,D,G,K,J,Ae,ge,be;K=Y=N[0],J=$=N[1],Ae=U=N[2],ge=D=N[3],be=G=N[4];for(var de,L=0;L<80;L+=1)de=Y+b[B+F[L]]|0,L<16?de+=_($,U,D)+k[0]:L<32?de+=v($,U,D)+k[1]:L<48?de+=S($,U,D)+k[2]:L<64?de+=y($,U,D)+k[3]:de+=x($,U,D)+k[4],de=de|0,de=w(de,X[L]),de=de+G|0,Y=G,G=D,D=w(U,10),U=$,$=de,de=K+b[B+V[L]]|0,L<16?de+=x(J,Ae,ge)+O[0]:L<32?de+=y(J,Ae,ge)+O[1]:L<48?de+=S(J,Ae,ge)+O[2]:L<64?de+=v(J,Ae,ge)+O[3]:de+=_(J,Ae,ge)+O[4],de=de|0,de=w(de,te[L]),de=de+be|0,K=be,be=ge,ge=w(Ae,10),Ae=J,J=de;de=N[1]+U+ge|0,N[1]=N[2]+D+be|0,N[2]=N[3]+G+K|0,N[3]=N[4]+Y+J|0,N[4]=N[0]+$+Ae|0,N[0]=de},_doFinalize:function(){var b=this._data,B=b.words,L=this._nDataBytes*8,R=b.sigBytes*8;B[R>>>5]|=128<<24-R%32,B[(R+64>>>9<<4)+14]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,b.sigBytes=(B.length+1)*4,this._process();for(var T=this._hash,N=T.words,k=0;k<5;k++){var O=N[k];N[k]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return T},clone:function(){var b=c.clone.call(this);return b._hash=this._hash.clone(),b}});function _(b,B,L){return b^B^L}function v(b,B,L){return b&B|~b&L}function S(b,B,L){return(b|~B)^L}function y(b,B,L){return b&L|B&~L}function x(b,B,L){return b^(B|~L)}function w(b,B){return b<<B|b>>>32-B}r.RIPEMD160=c._createHelper(C),r.HmacRIPEMD160=c._createHmacHelper(C)}(),t.RIPEMD160})}(qh)),qh.exports}var Xh={exports:{}},i0;function Kh(){return i0||(i0=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){(function(){var n=t,r=n.lib,o=r.Base,l=n.enc,c=l.Utf8,f=n.algo;f.HMAC=o.extend({init:function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=c.parse(d));var p=u.blockSize,A=p*4;d.sigBytes>A&&(d=u.finalize(d)),d.clamp();for(var g=this._oKey=d.clone(),E=this._iKey=d.clone(),C=g.words,_=E.words,v=0;v<p;v++)C[v]^=1549556828,_[v]^=909522486;g.sigBytes=E.sigBytes=A,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var d=this._hasher,p=d.finalize(u);d.reset();var A=d.finalize(this._oKey.clone().concat(p));return A}})})()})}(Xh)),Xh.exports}var Jh={exports:{}},r0;function Vx(){return r0||(r0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Hh(),Kh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Base,l=r.WordArray,c=n.algo,f=c.SHA256,u=c.HMAC,d=c.PBKDF2=o.extend({cfg:o.extend({keySize:128/32,hasher:f,iterations:25e4}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,A){for(var g=this.cfg,E=u.create(g.hasher,p),C=l.create(),_=l.create([1]),v=C.words,S=_.words,y=g.keySize,x=g.iterations;v.length<y;){var w=E.update(A).finalize(_);E.reset();for(var b=w.words,B=b.length,L=w,R=1;R<x;R++){L=E.finalize(L),E.reset();for(var T=L.words,N=0;N<B;N++)b[N]^=T[N]}C.concat(w),S[0]++}return C.sigBytes=y*4,C}});n.PBKDF2=function(p,A,g){return d.create(g).compute(p,A)}}(),t.PBKDF2})}(Jh)),Jh.exports}var Zh={exports:{}},s0;function os(){return s0||(s0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Xm(),Kh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Base,l=r.WordArray,c=n.algo,f=c.MD5,u=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:f,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,p){for(var A,g=this.cfg,E=g.hasher.create(),C=l.create(),_=C.words,v=g.keySize,S=g.iterations;_.length<v;){A&&E.update(A),A=E.update(d).finalize(p),E.reset();for(var y=1;y<S;y++)A=E.finalize(A),E.reset();C.concat(A)}return C.sigBytes=v*4,C}});n.EvpKDF=function(d,p,A){return u.create(A).compute(d,p)}}(),t.EvpKDF})}(Zh)),Zh.exports}var $h={exports:{}},o0;function Mn(){return o0||(o0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),os())})(vt,function(t){t.lib.Cipher||function(n){var r=t,o=r.lib,l=o.Base,c=o.WordArray,f=o.BufferedBlockAlgorithm,u=r.enc;u.Utf8;var d=u.Base64,p=r.algo,A=p.EvpKDF,g=o.Cipher=f.extend({cfg:l.extend(),createEncryptor:function(T,N){return this.create(this._ENC_XFORM_MODE,T,N)},createDecryptor:function(T,N){return this.create(this._DEC_XFORM_MODE,T,N)},init:function(T,N,k){this.cfg=this.cfg.extend(k),this._xformMode=T,this._key=N,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(T){return this._append(T),this._process()},finalize:function(T){T&&this._append(T);var N=this._doFinalize();return N},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function T(N){return typeof N=="string"?R:b}return function(N){return{encrypt:function(k,O,F){return T(O).encrypt(N,k,O,F)},decrypt:function(k,O,F){return T(O).decrypt(N,k,O,F)}}}}()});o.StreamCipher=g.extend({_doFinalize:function(){var T=this._process(!0);return T},blockSize:1});var E=r.mode={},C=o.BlockCipherMode=l.extend({createEncryptor:function(T,N){return this.Encryptor.create(T,N)},createDecryptor:function(T,N){return this.Decryptor.create(T,N)},init:function(T,N){this._cipher=T,this._iv=N}}),_=E.CBC=function(){var T=C.extend();T.Encryptor=T.extend({processBlock:function(k,O){var F=this._cipher,V=F.blockSize;N.call(this,k,O,V),F.encryptBlock(k,O),this._prevBlock=k.slice(O,O+V)}}),T.Decryptor=T.extend({processBlock:function(k,O){var F=this._cipher,V=F.blockSize,X=k.slice(O,O+V);F.decryptBlock(k,O),N.call(this,k,O,V),this._prevBlock=X}});function N(k,O,F){var V,X=this._iv;X?(V=X,this._iv=n):V=this._prevBlock;for(var te=0;te<F;te++)k[O+te]^=V[te]}return T}(),v=r.pad={},S=v.Pkcs7={pad:function(T,N){for(var k=N*4,O=k-T.sigBytes%k,F=O<<24|O<<16|O<<8|O,V=[],X=0;X<O;X+=4)V.push(F);var te=c.create(V,O);T.concat(te)},unpad:function(T){var N=T.words[T.sigBytes-1>>>2]&255;T.sigBytes-=N}};o.BlockCipher=g.extend({cfg:g.cfg.extend({mode:_,padding:S}),reset:function(){var T;g.reset.call(this);var N=this.cfg,k=N.iv,O=N.mode;this._xformMode==this._ENC_XFORM_MODE?T=O.createEncryptor:(T=O.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==T?this._mode.init(this,k&&k.words):(this._mode=T.call(O,this,k&&k.words),this._mode.__creator=T)},_doProcessBlock:function(T,N){this._mode.processBlock(T,N)},_doFinalize:function(){var T,N=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(N.pad(this._data,this.blockSize),T=this._process(!0)):(T=this._process(!0),N.unpad(T)),T},blockSize:128/32});var y=o.CipherParams=l.extend({init:function(T){this.mixIn(T)},toString:function(T){return(T||this.formatter).stringify(this)}}),x=r.format={},w=x.OpenSSL={stringify:function(T){var N,k=T.ciphertext,O=T.salt;return O?N=c.create([1398893684,1701076831]).concat(O).concat(k):N=k,N.toString(d)},parse:function(T){var N,k=d.parse(T),O=k.words;return O[0]==1398893684&&O[1]==1701076831&&(N=c.create(O.slice(2,4)),O.splice(0,4),k.sigBytes-=16),y.create({ciphertext:k,salt:N})}},b=o.SerializableCipher=l.extend({cfg:l.extend({format:w}),encrypt:function(T,N,k,O){O=this.cfg.extend(O);var F=T.createEncryptor(k,O),V=F.finalize(N),X=F.cfg;return y.create({ciphertext:V,key:k,iv:X.iv,algorithm:T,mode:X.mode,padding:X.padding,blockSize:T.blockSize,formatter:O.format})},decrypt:function(T,N,k,O){O=this.cfg.extend(O),N=this._parse(N,O.format);var F=T.createDecryptor(k,O).finalize(N.ciphertext);return F},_parse:function(T,N){return typeof T=="string"?N.parse(T,this):T}}),B=r.kdf={},L=B.OpenSSL={execute:function(T,N,k,O,F){if(O||(O=c.random(64/8)),F)var V=A.create({keySize:N+k,hasher:F}).compute(T,O);else var V=A.create({keySize:N+k}).compute(T,O);var X=c.create(V.words.slice(N),k*4);return V.sigBytes=N*4,y.create({key:V,iv:X,salt:O})}},R=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:L}),encrypt:function(T,N,k,O){O=this.cfg.extend(O);var F=O.kdf.execute(k,T.keySize,T.ivSize,O.salt,O.hasher);O.iv=F.iv;var V=b.encrypt.call(this,T,N,F.key,O);return V.mixIn(F),V},decrypt:function(T,N,k,O){O=this.cfg.extend(O),N=this._parse(N,O.format);var F=O.kdf.execute(k,T.keySize,T.ivSize,N.salt,O.hasher);O.iv=F.iv;var V=b.decrypt.call(this,T,N,F.key,O);return V}})}()})}($h)),$h.exports}var ed={exports:{}},a0;function Wx(){return a0||(a0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.CFB=function(){var n=t.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize;r.call(this,o,l,f,c),this._prevBlock=o.slice(l,l+f)}}),n.Decryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize,u=o.slice(l,l+f);r.call(this,o,l,f,c),this._prevBlock=u}});function r(o,l,c,f){var u,d=this._iv;d?(u=d.slice(0),this._iv=void 0):u=this._prevBlock,f.encryptBlock(u,0);for(var p=0;p<c;p++)o[l+p]^=u[p]}return n}(),t.mode.CFB})}(ed)),ed.exports}var td={exports:{}},l0;function jx(){return l0||(l0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.CTR=function(){var n=t.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0);var p=d.slice(0);c.encryptBlock(p,0),d[f-1]=d[f-1]+1|0;for(var A=0;A<f;A++)o[l+A]^=p[A]}});return n.Decryptor=r,n}(),t.mode.CTR})}(td)),td.exports}var nd={exports:{}},c0;function Yx(){return c0||(c0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){/** @preserve
28
+ */return function(n){var r=t,o=r.lib,l=o.WordArray,c=o.Hasher,f=r.algo,u=l.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=l.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=l.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),A=l.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=l.create([0,1518500249,1859775393,2400959708,2840853838]),E=l.create([1352829926,1548603684,1836072691,2053994217,0]),C=f.RIPEMD160=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(b,B){for(var L=0;L<16;L++){var R=B+L,T=b[R];b[R]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}var N=this._hash.words,k=g.words,O=E.words,F=u.words,V=d.words,X=p.words,te=A.words,q,Z,U,D,G,K,J,Ae,ge,be;K=q=N[0],J=Z=N[1],Ae=U=N[2],ge=D=N[3],be=G=N[4];for(var de,L=0;L<80;L+=1)de=q+b[B+F[L]]|0,L<16?de+=_(Z,U,D)+k[0]:L<32?de+=v(Z,U,D)+k[1]:L<48?de+=x(Z,U,D)+k[2]:L<64?de+=y(Z,U,D)+k[3]:de+=S(Z,U,D)+k[4],de=de|0,de=w(de,X[L]),de=de+G|0,q=G,G=D,D=w(U,10),U=Z,Z=de,de=K+b[B+V[L]]|0,L<16?de+=S(J,Ae,ge)+O[0]:L<32?de+=y(J,Ae,ge)+O[1]:L<48?de+=x(J,Ae,ge)+O[2]:L<64?de+=v(J,Ae,ge)+O[3]:de+=_(J,Ae,ge)+O[4],de=de|0,de=w(de,te[L]),de=de+be|0,K=be,be=ge,ge=w(Ae,10),Ae=J,J=de;de=N[1]+U+ge|0,N[1]=N[2]+D+be|0,N[2]=N[3]+G+K|0,N[3]=N[4]+q+J|0,N[4]=N[0]+Z+Ae|0,N[0]=de},_doFinalize:function(){var b=this._data,B=b.words,L=this._nDataBytes*8,R=b.sigBytes*8;B[R>>>5]|=128<<24-R%32,B[(R+64>>>9<<4)+14]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,b.sigBytes=(B.length+1)*4,this._process();for(var T=this._hash,N=T.words,k=0;k<5;k++){var O=N[k];N[k]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return T},clone:function(){var b=c.clone.call(this);return b._hash=this._hash.clone(),b}});function _(b,B,L){return b^B^L}function v(b,B,L){return b&B|~b&L}function x(b,B,L){return(b|~B)^L}function y(b,B,L){return b&L|B&~L}function S(b,B,L){return b^(B|~L)}function w(b,B){return b<<B|b>>>32-B}r.RIPEMD160=c._createHelper(C),r.HmacRIPEMD160=c._createHmacHelper(C)}(),t.RIPEMD160})}(qh)),qh.exports}var Xh={exports:{}},i0;function Kh(){return i0||(i0=1,function(i,e){(function(t,n){i.exports=n(xt())})(vt,function(t){(function(){var n=t,r=n.lib,o=r.Base,l=n.enc,c=l.Utf8,f=n.algo;f.HMAC=o.extend({init:function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=c.parse(d));var p=u.blockSize,A=p*4;d.sigBytes>A&&(d=u.finalize(d)),d.clamp();for(var g=this._oKey=d.clone(),E=this._iKey=d.clone(),C=g.words,_=E.words,v=0;v<p;v++)C[v]^=1549556828,_[v]^=909522486;g.sigBytes=E.sigBytes=A,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var d=this._hasher,p=d.finalize(u);d.reset();var A=d.finalize(this._oKey.clone().concat(p));return A}})})()})}(Xh)),Xh.exports}var Jh={exports:{}},r0;function Vx(){return r0||(r0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Hh(),Kh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Base,l=r.WordArray,c=n.algo,f=c.SHA256,u=c.HMAC,d=c.PBKDF2=o.extend({cfg:o.extend({keySize:128/32,hasher:f,iterations:25e4}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,A){for(var g=this.cfg,E=u.create(g.hasher,p),C=l.create(),_=l.create([1]),v=C.words,x=_.words,y=g.keySize,S=g.iterations;v.length<y;){var w=E.update(A).finalize(_);E.reset();for(var b=w.words,B=b.length,L=w,R=1;R<S;R++){L=E.finalize(L),E.reset();for(var T=L.words,N=0;N<B;N++)b[N]^=T[N]}C.concat(w),x[0]++}return C.sigBytes=y*4,C}});n.PBKDF2=function(p,A,g){return d.create(g).compute(p,A)}}(),t.PBKDF2})}(Jh)),Jh.exports}var $h={exports:{}},s0;function os(){return s0||(s0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Xm(),Kh())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.Base,l=r.WordArray,c=n.algo,f=c.MD5,u=c.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:f,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,p){for(var A,g=this.cfg,E=g.hasher.create(),C=l.create(),_=C.words,v=g.keySize,x=g.iterations;_.length<v;){A&&E.update(A),A=E.update(d).finalize(p),E.reset();for(var y=1;y<x;y++)A=E.finalize(A),E.reset();C.concat(A)}return C.sigBytes=v*4,C}});n.EvpKDF=function(d,p,A){return u.create(A).compute(d,p)}}(),t.EvpKDF})}($h)),$h.exports}var Zh={exports:{}},o0;function Mn(){return o0||(o0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),os())})(vt,function(t){t.lib.Cipher||function(n){var r=t,o=r.lib,l=o.Base,c=o.WordArray,f=o.BufferedBlockAlgorithm,u=r.enc;u.Utf8;var d=u.Base64,p=r.algo,A=p.EvpKDF,g=o.Cipher=f.extend({cfg:l.extend(),createEncryptor:function(T,N){return this.create(this._ENC_XFORM_MODE,T,N)},createDecryptor:function(T,N){return this.create(this._DEC_XFORM_MODE,T,N)},init:function(T,N,k){this.cfg=this.cfg.extend(k),this._xformMode=T,this._key=N,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(T){return this._append(T),this._process()},finalize:function(T){T&&this._append(T);var N=this._doFinalize();return N},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function T(N){return typeof N=="string"?R:b}return function(N){return{encrypt:function(k,O,F){return T(O).encrypt(N,k,O,F)},decrypt:function(k,O,F){return T(O).decrypt(N,k,O,F)}}}}()});o.StreamCipher=g.extend({_doFinalize:function(){var T=this._process(!0);return T},blockSize:1});var E=r.mode={},C=o.BlockCipherMode=l.extend({createEncryptor:function(T,N){return this.Encryptor.create(T,N)},createDecryptor:function(T,N){return this.Decryptor.create(T,N)},init:function(T,N){this._cipher=T,this._iv=N}}),_=E.CBC=function(){var T=C.extend();T.Encryptor=T.extend({processBlock:function(k,O){var F=this._cipher,V=F.blockSize;N.call(this,k,O,V),F.encryptBlock(k,O),this._prevBlock=k.slice(O,O+V)}}),T.Decryptor=T.extend({processBlock:function(k,O){var F=this._cipher,V=F.blockSize,X=k.slice(O,O+V);F.decryptBlock(k,O),N.call(this,k,O,V),this._prevBlock=X}});function N(k,O,F){var V,X=this._iv;X?(V=X,this._iv=n):V=this._prevBlock;for(var te=0;te<F;te++)k[O+te]^=V[te]}return T}(),v=r.pad={},x=v.Pkcs7={pad:function(T,N){for(var k=N*4,O=k-T.sigBytes%k,F=O<<24|O<<16|O<<8|O,V=[],X=0;X<O;X+=4)V.push(F);var te=c.create(V,O);T.concat(te)},unpad:function(T){var N=T.words[T.sigBytes-1>>>2]&255;T.sigBytes-=N}};o.BlockCipher=g.extend({cfg:g.cfg.extend({mode:_,padding:x}),reset:function(){var T;g.reset.call(this);var N=this.cfg,k=N.iv,O=N.mode;this._xformMode==this._ENC_XFORM_MODE?T=O.createEncryptor:(T=O.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==T?this._mode.init(this,k&&k.words):(this._mode=T.call(O,this,k&&k.words),this._mode.__creator=T)},_doProcessBlock:function(T,N){this._mode.processBlock(T,N)},_doFinalize:function(){var T,N=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(N.pad(this._data,this.blockSize),T=this._process(!0)):(T=this._process(!0),N.unpad(T)),T},blockSize:128/32});var y=o.CipherParams=l.extend({init:function(T){this.mixIn(T)},toString:function(T){return(T||this.formatter).stringify(this)}}),S=r.format={},w=S.OpenSSL={stringify:function(T){var N,k=T.ciphertext,O=T.salt;return O?N=c.create([1398893684,1701076831]).concat(O).concat(k):N=k,N.toString(d)},parse:function(T){var N,k=d.parse(T),O=k.words;return O[0]==1398893684&&O[1]==1701076831&&(N=c.create(O.slice(2,4)),O.splice(0,4),k.sigBytes-=16),y.create({ciphertext:k,salt:N})}},b=o.SerializableCipher=l.extend({cfg:l.extend({format:w}),encrypt:function(T,N,k,O){O=this.cfg.extend(O);var F=T.createEncryptor(k,O),V=F.finalize(N),X=F.cfg;return y.create({ciphertext:V,key:k,iv:X.iv,algorithm:T,mode:X.mode,padding:X.padding,blockSize:T.blockSize,formatter:O.format})},decrypt:function(T,N,k,O){O=this.cfg.extend(O),N=this._parse(N,O.format);var F=T.createDecryptor(k,O).finalize(N.ciphertext);return F},_parse:function(T,N){return typeof T=="string"?N.parse(T,this):T}}),B=r.kdf={},L=B.OpenSSL={execute:function(T,N,k,O,F){if(O||(O=c.random(64/8)),F)var V=A.create({keySize:N+k,hasher:F}).compute(T,O);else var V=A.create({keySize:N+k}).compute(T,O);var X=c.create(V.words.slice(N),k*4);return V.sigBytes=N*4,y.create({key:V,iv:X,salt:O})}},R=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:L}),encrypt:function(T,N,k,O){O=this.cfg.extend(O);var F=O.kdf.execute(k,T.keySize,T.ivSize,O.salt,O.hasher);O.iv=F.iv;var V=b.encrypt.call(this,T,N,F.key,O);return V.mixIn(F),V},decrypt:function(T,N,k,O){O=this.cfg.extend(O),N=this._parse(N,O.format);var F=O.kdf.execute(k,T.keySize,T.ivSize,N.salt,O.hasher);O.iv=F.iv;var V=b.decrypt.call(this,T,N,F.key,O);return V}})}()})}(Zh)),Zh.exports}var ed={exports:{}},a0;function Wx(){return a0||(a0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.CFB=function(){var n=t.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize;r.call(this,o,l,f,c),this._prevBlock=o.slice(l,l+f)}}),n.Decryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize,u=o.slice(l,l+f);r.call(this,o,l,f,c),this._prevBlock=u}});function r(o,l,c,f){var u,d=this._iv;d?(u=d.slice(0),this._iv=void 0):u=this._prevBlock,f.encryptBlock(u,0);for(var p=0;p<c;p++)o[l+p]^=u[p]}return n}(),t.mode.CFB})}(ed)),ed.exports}var td={exports:{}},l0;function jx(){return l0||(l0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.CTR=function(){var n=t.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=c.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0);var p=d.slice(0);c.encryptBlock(p,0),d[f-1]=d[f-1]+1|0;for(var A=0;A<f;A++)o[l+A]^=p[A]}});return n.Decryptor=r,n}(),t.mode.CTR})}(td)),td.exports}var nd={exports:{}},c0;function Yx(){return c0||(c0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){/** @preserve
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 r(c){if((c>>24&255)===255){var f=c>>16&255,u=c>>8&255,d=c&255;f===255?(f=0,u===255?(u=0,d===255?d=0:++d):++u):++f,c=0,c+=f<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function o(c){return(c[0]=r(c[0]))===0&&(c[1]=r(c[1])),c}var l=n.Encryptor=n.extend({processBlock:function(c,f){var u=this._cipher,d=u.blockSize,p=this._iv,A=this._counter;p&&(A=this._counter=p.slice(0),this._iv=void 0),o(A);var g=A.slice(0);u.encryptBlock(g,0);for(var E=0;E<d;E++)c[f+E]^=g[E]}});return n.Decryptor=l,n}(),t.mode.CTRGladman})}(nd)),nd.exports}var id={exports:{}},u0;function qx(){return u0||(u0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=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 p=0;p<f;p++)o[l+p]^=d[p]}});return n.Decryptor=r,n}(),t.mode.OFB})}(id)),id.exports}var rd={exports:{}},f0;function Xx(){return f0||(f0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(r,o){this._cipher.encryptBlock(r,o)}}),n.Decryptor=n.extend({processBlock:function(r,o){this._cipher.decryptBlock(r,o)}}),n}(),t.mode.ECB})}(rd)),rd.exports}var sd={exports:{}},h0;function Kx(){return h0||(h0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.AnsiX923={pad:function(n,r){var o=n.sigBytes,l=r*4,c=l-o%l,f=o+c-1;n.clamp(),n.words[f>>>2]|=c<<24-f%4*8,n.sigBytes+=c},unpad:function(n){var r=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=r}},t.pad.Ansix923})}(sd)),sd.exports}var od={exports:{}},d0;function Jx(){return d0||(d0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.Iso10126={pad:function(n,r){var o=r*4,l=o-n.sigBytes%o;n.concat(t.lib.WordArray.random(l-1)).concat(t.lib.WordArray.create([l<<24],1))},unpad:function(n){var r=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=r}},t.pad.Iso10126})}(od)),od.exports}var ad={exports:{}},A0;function Zx(){return A0||(A0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.Iso97971={pad:function(n,r){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,r)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(ad)),ad.exports}var ld={exports:{}},p0;function $x(){return p0||(p0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.ZeroPadding={pad:function(n,r){var o=r*4;n.clamp(),n.sigBytes+=o-(n.sigBytes%o||o)},unpad:function(n){for(var r=n.words,o=n.sigBytes-1,o=n.sigBytes-1;o>=0;o--)if(r[o>>>2]>>>24-o%4*8&255){n.sigBytes=o+1;break}}},t.pad.ZeroPadding})}(ld)),ld.exports}var cd={exports:{}},g0;function e2(){return g0||(g0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(cd)),cd.exports}var ud={exports:{}},m0;function t2(){return m0||(m0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.CipherParams,c=r.enc,f=c.Hex,u=r.format;u.Hex={stringify:function(d){return d.ciphertext.toString(f)},parse:function(d){var p=f.parse(d);return l.create({ciphertext:p})}}}(),t.format.Hex})}(ud)),ud.exports}var fd={exports:{}},v0;function n2(){return v0||(v0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.BlockCipher,l=n.algo,c=[],f=[],u=[],d=[],p=[],A=[],g=[],E=[],C=[],_=[];(function(){for(var y=[],x=0;x<256;x++)x<128?y[x]=x<<1:y[x]=x<<1^283;for(var w=0,b=0,x=0;x<256;x++){var B=b^b<<1^b<<2^b<<3^b<<4;B=B>>>8^B&255^99,c[w]=B,f[B]=w;var L=y[w],R=y[L],T=y[R],N=y[B]*257^B*16843008;u[w]=N<<24|N>>>8,d[w]=N<<16|N>>>16,p[w]=N<<8|N>>>24,A[w]=N;var N=T*16843009^R*65537^L*257^w*16843008;g[B]=N<<24|N>>>8,E[B]=N<<16|N>>>16,C[B]=N<<8|N>>>24,_[B]=N,w?(w=L^y[y[y[T^L]]],b^=y[y[b]]):w=b=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],S=l.AES=o.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var x=this._keyPriorReset=this._key,w=x.words,b=x.sigBytes/4,B=this._nRounds=b+6,L=(B+1)*4,R=this._keySchedule=[],T=0;T<L;T++)T<b?R[T]=w[T]:(y=R[T-1],T%b?b>6&&T%b==4&&(y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255]):(y=y<<8|y>>>24,y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255],y^=v[T/b|0]<<24),R[T]=R[T-b]^y);for(var N=this._invKeySchedule=[],k=0;k<L;k++){var T=L-k;if(k%4)var y=R[T];else var y=R[T-4];k<4||T<=4?N[k]=y:N[k]=g[c[y>>>24]]^E[c[y>>>16&255]]^C[c[y>>>8&255]]^_[c[y&255]]}}},encryptBlock:function(y,x){this._doCryptBlock(y,x,this._keySchedule,u,d,p,A,c)},decryptBlock:function(y,x){var w=y[x+1];y[x+1]=y[x+3],y[x+3]=w,this._doCryptBlock(y,x,this._invKeySchedule,g,E,C,_,f);var w=y[x+1];y[x+1]=y[x+3],y[x+3]=w},_doCryptBlock:function(y,x,w,b,B,L,R,T){for(var N=this._nRounds,k=y[x]^w[0],O=y[x+1]^w[1],F=y[x+2]^w[2],V=y[x+3]^w[3],X=4,te=1;te<N;te++){var Y=b[k>>>24]^B[O>>>16&255]^L[F>>>8&255]^R[V&255]^w[X++],$=b[O>>>24]^B[F>>>16&255]^L[V>>>8&255]^R[k&255]^w[X++],U=b[F>>>24]^B[V>>>16&255]^L[k>>>8&255]^R[O&255]^w[X++],D=b[V>>>24]^B[k>>>16&255]^L[O>>>8&255]^R[F&255]^w[X++];k=Y,O=$,F=U,V=D}var Y=(T[k>>>24]<<24|T[O>>>16&255]<<16|T[F>>>8&255]<<8|T[V&255])^w[X++],$=(T[O>>>24]<<24|T[F>>>16&255]<<16|T[V>>>8&255]<<8|T[k&255])^w[X++],U=(T[F>>>24]<<24|T[V>>>16&255]<<16|T[k>>>8&255]<<8|T[O&255])^w[X++],D=(T[V>>>24]<<24|T[k>>>16&255]<<16|T[O>>>8&255]<<8|T[F&255])^w[X++];y[x]=Y,y[x+1]=$,y[x+2]=U,y[x+3]=D},keySize:256/32});n.AES=o._createHelper(S)}(),t.AES})}(fd)),fd.exports}var hd={exports:{}},_0;function i2(){return _0||(_0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=r.BlockCipher,c=n.algo,f=[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],p=[{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}],A=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=l.extend({_doReset:function(){for(var v=this._key,S=v.words,y=[],x=0;x<56;x++){var w=f[x]-1;y[x]=S[w>>>5]>>>31-w%32&1}for(var b=this._subKeys=[],B=0;B<16;B++){for(var L=b[B]=[],R=d[B],x=0;x<24;x++)L[x/6|0]|=y[(u[x]-1+R)%28]<<31-x%6,L[4+(x/6|0)]|=y[28+(u[x+24]-1+R)%28]<<31-x%6;L[0]=L[0]<<1|L[0]>>>31;for(var x=1;x<7;x++)L[x]=L[x]>>>(x-1)*4+3;L[7]=L[7]<<5|L[7]>>>27}for(var T=this._invSubKeys=[],x=0;x<16;x++)T[x]=b[15-x]},encryptBlock:function(v,S){this._doCryptBlock(v,S,this._subKeys)},decryptBlock:function(v,S){this._doCryptBlock(v,S,this._invSubKeys)},_doCryptBlock:function(v,S,y){this._lBlock=v[S],this._rBlock=v[S+1],E.call(this,4,252645135),E.call(this,16,65535),C.call(this,2,858993459),C.call(this,8,16711935),E.call(this,1,1431655765);for(var x=0;x<16;x++){for(var w=y[x],b=this._lBlock,B=this._rBlock,L=0,R=0;R<8;R++)L|=p[R][((B^w[R])&A[R])>>>0];this._lBlock=B,this._rBlock=b^L}var T=this._lBlock;this._lBlock=this._rBlock,this._rBlock=T,E.call(this,1,1431655765),C.call(this,8,16711935),C.call(this,2,858993459),E.call(this,16,65535),E.call(this,4,252645135),v[S]=this._lBlock,v[S+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function E(v,S){var y=(this._lBlock>>>v^this._rBlock)&S;this._rBlock^=y,this._lBlock^=y<<v}function C(v,S){var y=(this._rBlock>>>v^this._lBlock)&S;this._lBlock^=y,this._rBlock^=y<<v}n.DES=l._createHelper(g);var _=c.TripleDES=l.extend({_doReset:function(){var v=this._key,S=v.words;if(S.length!==2&&S.length!==4&&S.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var y=S.slice(0,2),x=S.length<4?S.slice(0,2):S.slice(2,4),w=S.length<6?S.slice(0,2):S.slice(4,6);this._des1=g.createEncryptor(o.create(y)),this._des2=g.createEncryptor(o.create(x)),this._des3=g.createEncryptor(o.create(w))},encryptBlock:function(v,S){this._des1.encryptBlock(v,S),this._des2.decryptBlock(v,S),this._des3.encryptBlock(v,S)},decryptBlock:function(v,S){this._des3.decryptBlock(v,S),this._des2.encryptBlock(v,S),this._des1.decryptBlock(v,S)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=l._createHelper(_)}(),t.TripleDES})}(hd)),hd.exports}var dd={exports:{}},E0;function r2(){return E0||(E0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=l.RC4=o.extend({_doReset:function(){for(var d=this._key,p=d.words,A=d.sigBytes,g=this._S=[],E=0;E<256;E++)g[E]=E;for(var E=0,C=0;E<256;E++){var _=E%A,v=p[_>>>2]>>>24-_%4*8&255;C=(C+g[E]+v)%256;var S=g[E];g[E]=g[C],g[C]=S}this._i=this._j=0},_doProcessBlock:function(d,p){d[p]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var d=this._S,p=this._i,A=this._j,g=0,E=0;E<4;E++){p=(p+1)%256,A=(A+d[p])%256;var C=d[p];d[p]=d[A],d[A]=C,g|=d[(d[p]+d[A])%256]<<24-E*8}return this._i=p,this._j=A,g}n.RC4=o._createHelper(c);var u=l.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)f.call(this)}});n.RC4Drop=o._createHelper(u)}(),t.RC4})}(dd)),dd.exports}var Ad={exports:{}},y0;function s2(){return y0||(y0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=[],f=[],u=[],d=l.Rabbit=o.extend({_doReset:function(){for(var A=this._key.words,g=this.cfg.iv,E=0;E<4;E++)A[E]=(A[E]<<8|A[E]>>>24)&16711935|(A[E]<<24|A[E]>>>8)&4278255360;var C=this._X=[A[0],A[3]<<16|A[2]>>>16,A[1],A[0]<<16|A[3]>>>16,A[2],A[1]<<16|A[0]>>>16,A[3],A[2]<<16|A[1]>>>16],_=this._C=[A[2]<<16|A[2]>>>16,A[0]&4294901760|A[1]&65535,A[3]<<16|A[3]>>>16,A[1]&4294901760|A[2]&65535,A[0]<<16|A[0]>>>16,A[2]&4294901760|A[3]&65535,A[1]<<16|A[1]>>>16,A[3]&4294901760|A[0]&65535];this._b=0;for(var E=0;E<4;E++)p.call(this);for(var E=0;E<8;E++)_[E]^=C[E+4&7];if(g){var v=g.words,S=v[0],y=v[1],x=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,w=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,b=x>>>16|w&4294901760,B=w<<16|x&65535;_[0]^=x,_[1]^=b,_[2]^=w,_[3]^=B,_[4]^=x,_[5]^=b,_[6]^=w,_[7]^=B;for(var E=0;E<4;E++)p.call(this)}},_doProcessBlock:function(A,g){var E=this._X;p.call(this),c[0]=E[0]^E[5]>>>16^E[3]<<16,c[1]=E[2]^E[7]>>>16^E[5]<<16,c[2]=E[4]^E[1]>>>16^E[7]<<16,c[3]=E[6]^E[3]>>>16^E[1]<<16;for(var C=0;C<4;C++)c[C]=(c[C]<<8|c[C]>>>24)&16711935|(c[C]<<24|c[C]>>>8)&4278255360,A[g+C]^=c[C]},blockSize:128/32,ivSize:64/32});function p(){for(var A=this._X,g=this._C,E=0;E<8;E++)f[E]=g[E];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<f[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<f[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<f[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<f[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<f[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<f[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<f[6]>>>0?1:0)|0,this._b=g[7]>>>0<f[7]>>>0?1:0;for(var E=0;E<8;E++){var C=A[E]+g[E],_=C&65535,v=C>>>16,S=((_*_>>>17)+_*v>>>15)+v*v,y=((C&4294901760)*C|0)+((C&65535)*C|0);u[E]=S^y}A[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,A[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,A[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,A[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,A[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,A[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,A[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,A[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=o._createHelper(d)}(),t.Rabbit})}(Ad)),Ad.exports}var pd={exports:{}},C0;function o2(){return C0||(C0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=[],f=[],u=[],d=l.RabbitLegacy=o.extend({_doReset:function(){var A=this._key.words,g=this.cfg.iv,E=this._X=[A[0],A[3]<<16|A[2]>>>16,A[1],A[0]<<16|A[3]>>>16,A[2],A[1]<<16|A[0]>>>16,A[3],A[2]<<16|A[1]>>>16],C=this._C=[A[2]<<16|A[2]>>>16,A[0]&4294901760|A[1]&65535,A[3]<<16|A[3]>>>16,A[1]&4294901760|A[2]&65535,A[0]<<16|A[0]>>>16,A[2]&4294901760|A[3]&65535,A[1]<<16|A[1]>>>16,A[3]&4294901760|A[0]&65535];this._b=0;for(var _=0;_<4;_++)p.call(this);for(var _=0;_<8;_++)C[_]^=E[_+4&7];if(g){var v=g.words,S=v[0],y=v[1],x=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,w=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,b=x>>>16|w&4294901760,B=w<<16|x&65535;C[0]^=x,C[1]^=b,C[2]^=w,C[3]^=B,C[4]^=x,C[5]^=b,C[6]^=w,C[7]^=B;for(var _=0;_<4;_++)p.call(this)}},_doProcessBlock:function(A,g){var E=this._X;p.call(this),c[0]=E[0]^E[5]>>>16^E[3]<<16,c[1]=E[2]^E[7]>>>16^E[5]<<16,c[2]=E[4]^E[1]>>>16^E[7]<<16,c[3]=E[6]^E[3]>>>16^E[1]<<16;for(var C=0;C<4;C++)c[C]=(c[C]<<8|c[C]>>>24)&16711935|(c[C]<<24|c[C]>>>8)&4278255360,A[g+C]^=c[C]},blockSize:128/32,ivSize:64/32});function p(){for(var A=this._X,g=this._C,E=0;E<8;E++)f[E]=g[E];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<f[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<f[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<f[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<f[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<f[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<f[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<f[6]>>>0?1:0)|0,this._b=g[7]>>>0<f[7]>>>0?1:0;for(var E=0;E<8;E++){var C=A[E]+g[E],_=C&65535,v=C>>>16,S=((_*_>>>17)+_*v>>>15)+v*v,y=((C&4294901760)*C|0)+((C&65535)*C|0);u[E]=S^y}A[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,A[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,A[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,A[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,A[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,A[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,A[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,A[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=o._createHelper(d)}(),t.RabbitLegacy})}(pd)),pd.exports}var gd={exports:{}},I0;function a2(){return I0||(I0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.BlockCipher,l=n.algo;const c=16,f=[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 p(_,v){let S=v>>24&255,y=v>>16&255,x=v>>8&255,w=v&255,b=_.sbox[0][S]+_.sbox[1][y];return b=b^_.sbox[2][x],b=b+_.sbox[3][w],b}function A(_,v,S){let y=v,x=S,w;for(let b=0;b<c;++b)y=y^_.pbox[b],x=p(_,y)^x,w=y,y=x,x=w;return w=y,y=x,x=w,x=x^_.pbox[c],y=y^_.pbox[c+1],{left:y,right:x}}function g(_,v,S){let y=v,x=S,w;for(let b=c+1;b>1;--b)y=y^_.pbox[b],x=p(_,y)^x,w=y,y=x,x=w;return w=y,y=x,x=w,x=x^_.pbox[1],y=y^_.pbox[0],{left:y,right:x}}function E(_,v,S){for(let B=0;B<4;B++){_.sbox[B]=[];for(let L=0;L<256;L++)_.sbox[B][L]=u[B][L]}let y=0;for(let B=0;B<c+2;B++)_.pbox[B]=f[B]^v[y],y++,y>=S&&(y=0);let x=0,w=0,b=0;for(let B=0;B<c+2;B+=2)b=A(_,x,w),x=b.left,w=b.right,_.pbox[B]=x,_.pbox[B+1]=w;for(let B=0;B<4;B++)for(let L=0;L<256;L+=2)b=A(_,x,w),x=b.left,w=b.right,_.sbox[B][L]=x,_.sbox[B][L+1]=w;return!0}var C=l.Blowfish=o.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var _=this._keyPriorReset=this._key,v=_.words,S=_.sigBytes/4;E(d,v,S)}},encryptBlock:function(_,v){var S=A(d,_[v],_[v+1]);_[v]=S.left,_[v+1]=S.right},decryptBlock:function(_,v){var S=g(d,_[v],_[v+1]);_[v]=S.left,_[v+1]=S.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=o._createHelper(C)}(),t.Blowfish})}(gd)),gd.exports}(function(i,e){(function(t,n,r){i.exports=n(xt(),jc(),kx(),Fx(),qs(),Qx(),Xs(),Xm(),Hh(),Ox(),$m(),zx(),Gx(),Hx(),Kh(),Vx(),os(),Mn(),Wx(),jx(),Yx(),qx(),Xx(),Kx(),Jx(),Zx(),$x(),e2(),t2(),n2(),i2(),r2(),s2(),o2(),a2())})(vt,function(t){return t})})(Om);var l2=Om.exports;const md=Sx(l2);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const c2=4,x0=0,S0=1,u2=2;function ko(i){let e=i.length;for(;--e>=0;)i[e]=0}const f2=0,w0=1,h2=2,d2=3,A2=258,vd=29,Al=256,pl=Al+1+vd,Fo=30,_d=19,M0=2*pl+1,Ks=15,Ed=16,p2=7,yd=256,T0=16,B0=17,R0=18,Cd=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]),Yc=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]),g2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),b0=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m2=512,Rr=new Array((pl+2)*2);ko(Rr);const gl=new Array(Fo*2);ko(gl);const ml=new Array(m2);ko(ml);const vl=new Array(A2-d2+1);ko(vl);const Id=new Array(vd);ko(Id);const qc=new Array(Fo);ko(qc);function xd(i,e,t,n,r){this.static_tree=i,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=r,this.has_stree=i&&i.length}let L0,D0,N0;function Sd(i,e){this.dyn_tree=i,this.max_code=0,this.stat_desc=e}const P0=i=>i<256?ml[i]:ml[256+(i>>>7)],_l=(i,e)=>{i.pending_buf[i.pending++]=e&255,i.pending_buf[i.pending++]=e>>>8&255},li=(i,e,t)=>{i.bi_valid>Ed-t?(i.bi_buf|=e<<i.bi_valid&65535,_l(i,i.bi_buf),i.bi_buf=e>>Ed-i.bi_valid,i.bi_valid+=t-Ed):(i.bi_buf|=e<<i.bi_valid&65535,i.bi_valid+=t)},ur=(i,e,t)=>{li(i,t[e*2],t[e*2+1])},U0=(i,e)=>{let t=0;do t|=i&1,i>>>=1,t<<=1;while(--e>0);return t>>>1},v2=i=>{i.bi_valid===16?(_l(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},_2=(i,e)=>{const t=e.dyn_tree,n=e.max_code,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,f=e.stat_desc.max_length;let u,d,p,A,g,E,C=0;for(A=0;A<=Ks;A++)i.bl_count[A]=0;for(t[i.heap[i.heap_max]*2+1]=0,u=i.heap_max+1;u<M0;u++)d=i.heap[u],A=t[t[d*2+1]*2+1]+1,A>f&&(A=f,C++),t[d*2+1]=A,!(d>n)&&(i.bl_count[A]++,g=0,d>=c&&(g=l[d-c]),E=t[d*2],i.opt_len+=E*(A+g),o&&(i.static_len+=E*(r[d*2+1]+g)));if(C!==0){do{for(A=f-1;i.bl_count[A]===0;)A--;i.bl_count[A]--,i.bl_count[A+1]+=2,i.bl_count[f]--,C-=2}while(C>0);for(A=f;A!==0;A--)for(d=i.bl_count[A];d!==0;)p=i.heap[--u],!(p>n)&&(t[p*2+1]!==A&&(i.opt_len+=(A-t[p*2+1])*t[p*2],t[p*2+1]=A),d--)}},k0=(i,e,t)=>{const n=new Array(Ks+1);let r=0,o,l;for(o=1;o<=Ks;o++)r=r+t[o-1]<<1,n[o]=r;for(l=0;l<=e;l++){let c=i[l*2+1];c!==0&&(i[l*2]=U0(n[c]++,c))}},E2=()=>{let i,e,t,n,r;const o=new Array(Ks+1);for(t=0,n=0;n<vd-1;n++)for(Id[n]=t,i=0;i<1<<Cd[n];i++)vl[t++]=n;for(vl[t-1]=n,r=0,n=0;n<16;n++)for(qc[n]=r,i=0;i<1<<Yc[n];i++)ml[r++]=n;for(r>>=7;n<Fo;n++)for(qc[n]=r<<7,i=0;i<1<<Yc[n]-7;i++)ml[256+r++]=n;for(e=0;e<=Ks;e++)o[e]=0;for(i=0;i<=143;)Rr[i*2+1]=8,i++,o[8]++;for(;i<=255;)Rr[i*2+1]=9,i++,o[9]++;for(;i<=279;)Rr[i*2+1]=7,i++,o[7]++;for(;i<=287;)Rr[i*2+1]=8,i++,o[8]++;for(k0(Rr,pl+1,o),i=0;i<Fo;i++)gl[i*2+1]=5,gl[i*2]=U0(i,5);L0=new xd(Rr,Cd,Al+1,pl,Ks),D0=new xd(gl,Yc,0,Fo,Ks),N0=new xd(new Array(0),g2,0,_d,p2)},F0=i=>{let e;for(e=0;e<pl;e++)i.dyn_ltree[e*2]=0;for(e=0;e<Fo;e++)i.dyn_dtree[e*2]=0;for(e=0;e<_d;e++)i.bl_tree[e*2]=0;i.dyn_ltree[yd*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},Q0=i=>{i.bi_valid>8?_l(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},O0=(i,e,t,n)=>{const r=e*2,o=t*2;return i[r]<i[o]||i[r]===i[o]&&n[e]<=n[t]},wd=(i,e,t)=>{const n=i.heap[t];let r=t<<1;for(;r<=i.heap_len&&(r<i.heap_len&&O0(e,i.heap[r+1],i.heap[r],i.depth)&&r++,!O0(e,n,i.heap[r],i.depth));)i.heap[t]=i.heap[r],t=r,r<<=1;i.heap[t]=n},z0=(i,e,t)=>{let n,r,o=0,l,c;if(i.sym_next!==0)do n=i.pending_buf[i.sym_buf+o++]&255,n+=(i.pending_buf[i.sym_buf+o++]&255)<<8,r=i.pending_buf[i.sym_buf+o++],n===0?ur(i,r,e):(l=vl[r],ur(i,l+Al+1,e),c=Cd[l],c!==0&&(r-=Id[l],li(i,r,c)),n--,l=P0(n),ur(i,l,t),c=Yc[l],c!==0&&(n-=qc[l],li(i,n,c)));while(o<i.sym_next);ur(i,yd,e)},Md=(i,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.elems;let l,c,f=-1,u;for(i.heap_len=0,i.heap_max=M0,l=0;l<o;l++)t[l*2]!==0?(i.heap[++i.heap_len]=f=l,i.depth[l]=0):t[l*2+1]=0;for(;i.heap_len<2;)u=i.heap[++i.heap_len]=f<2?++f:0,t[u*2]=1,i.depth[u]=0,i.opt_len--,r&&(i.static_len-=n[u*2+1]);for(e.max_code=f,l=i.heap_len>>1;l>=1;l--)wd(i,t,l);u=o;do l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],wd(i,t,1),c=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=c,t[u*2]=t[l*2]+t[c*2],i.depth[u]=(i.depth[l]>=i.depth[c]?i.depth[l]:i.depth[c])+1,t[l*2+1]=t[c*2+1]=u,i.heap[1]=u++,wd(i,t,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],_2(i,e),k0(t,f,i.bl_count)},G0=(i,e,t)=>{let n,r=-1,o,l=e[0*2+1],c=0,f=7,u=4;for(l===0&&(f=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)o=l,l=e[(n+1)*2+1],!(++c<f&&o===l)&&(c<u?i.bl_tree[o*2]+=c:o!==0?(o!==r&&i.bl_tree[o*2]++,i.bl_tree[T0*2]++):c<=10?i.bl_tree[B0*2]++:i.bl_tree[R0*2]++,c=0,r=o,l===0?(f=138,u=3):o===l?(f=6,u=3):(f=7,u=4))},H0=(i,e,t)=>{let n,r=-1,o,l=e[0*2+1],c=0,f=7,u=4;for(l===0&&(f=138,u=3),n=0;n<=t;n++)if(o=l,l=e[(n+1)*2+1],!(++c<f&&o===l)){if(c<u)do ur(i,o,i.bl_tree);while(--c!==0);else o!==0?(o!==r&&(ur(i,o,i.bl_tree),c--),ur(i,T0,i.bl_tree),li(i,c-3,2)):c<=10?(ur(i,B0,i.bl_tree),li(i,c-3,3)):(ur(i,R0,i.bl_tree),li(i,c-11,7));c=0,r=o,l===0?(f=138,u=3):o===l?(f=6,u=3):(f=7,u=4)}},y2=i=>{let e;for(G0(i,i.dyn_ltree,i.l_desc.max_code),G0(i,i.dyn_dtree,i.d_desc.max_code),Md(i,i.bl_desc),e=_d-1;e>=3&&i.bl_tree[b0[e]*2+1]===0;e--);return i.opt_len+=3*(e+1)+5+5+4,e},C2=(i,e,t,n)=>{let r;for(li(i,e-257,5),li(i,t-1,5),li(i,n-4,4),r=0;r<n;r++)li(i,i.bl_tree[b0[r]*2+1],3);H0(i,i.dyn_ltree,e-1),H0(i,i.dyn_dtree,t-1)},I2=i=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&i.dyn_ltree[t*2]!==0)return x0;if(i.dyn_ltree[9*2]!==0||i.dyn_ltree[10*2]!==0||i.dyn_ltree[13*2]!==0)return S0;for(t=32;t<Al;t++)if(i.dyn_ltree[t*2]!==0)return S0;return x0};let V0=!1;const x2=i=>{V0||(E2(),V0=!0),i.l_desc=new Sd(i.dyn_ltree,L0),i.d_desc=new Sd(i.dyn_dtree,D0),i.bl_desc=new Sd(i.bl_tree,N0),i.bi_buf=0,i.bi_valid=0,F0(i)},W0=(i,e,t,n)=>{li(i,(f2<<1)+(n?1:0),3),Q0(i),_l(i,t),_l(i,~t),t&&i.pending_buf.set(i.window.subarray(e,e+t),i.pending),i.pending+=t},S2=i=>{li(i,w0<<1,3),ur(i,yd,Rr),v2(i)},w2=(i,e,t,n)=>{let r,o,l=0;i.level>0?(i.strm.data_type===u2&&(i.strm.data_type=I2(i)),Md(i,i.l_desc),Md(i,i.d_desc),l=y2(i),r=i.opt_len+3+7>>>3,o=i.static_len+3+7>>>3,o<=r&&(r=o)):r=o=t+5,t+4<=r&&e!==-1?W0(i,e,t,n):i.strategy===c2||o===r?(li(i,(w0<<1)+(n?1:0),3),z0(i,Rr,gl)):(li(i,(h2<<1)+(n?1:0),3),C2(i,i.l_desc.max_code+1,i.d_desc.max_code+1,l+1),z0(i,i.dyn_ltree,i.dyn_dtree)),F0(i),n&&Q0(i)},M2=(i,e,t)=>(i.pending_buf[i.sym_buf+i.sym_next++]=e,i.pending_buf[i.sym_buf+i.sym_next++]=e>>8,i.pending_buf[i.sym_buf+i.sym_next++]=t,e===0?i.dyn_ltree[t*2]++:(i.matches++,e--,i.dyn_ltree[(vl[t]+Al+1)*2]++,i.dyn_dtree[P0(e)*2]++),i.sym_next===i.sym_end);var T2=x2,B2=W0,R2=w2,b2=M2,L2=S2,D2={_tr_init:T2,_tr_stored_block:B2,_tr_flush_block:R2,_tr_tally:b2,_tr_align:L2},El=(i,e,t,n)=>{let r=i&65535|0,o=i>>>16&65535|0,l=0;for(;t!==0;){l=t>2e3?2e3:t,t-=l;do r=r+e[n++]|0,o=o+r|0;while(--l);r%=65521,o%=65521}return r|o<<16|0};const N2=()=>{let i,e=[];for(var t=0;t<256;t++){i=t;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;e[t]=i}return e},P2=new Uint32Array(N2());var Tn=(i,e,t,n)=>{const r=P2,o=n+t;i^=-1;for(let l=n;l<o;l++)i=i>>>8^r[(i^e[l])&255];return i^-1},Js={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"},Zs={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:U2,_tr_stored_block:Td,_tr_flush_block:k2,_tr_tally:as,_tr_align:F2}=D2,{Z_NO_FLUSH:ls,Z_PARTIAL_FLUSH:Q2,Z_FULL_FLUSH:O2,Z_FINISH:Di,Z_BLOCK:j0,Z_OK:kn,Z_STREAM_END:Y0,Z_STREAM_ERROR:fr,Z_DATA_ERROR:z2,Z_BUF_ERROR:Bd,Z_DEFAULT_COMPRESSION:G2,Z_FILTERED:H2,Z_HUFFMAN_ONLY:Xc,Z_RLE:V2,Z_FIXED:W2,Z_DEFAULT_STRATEGY:j2,Z_UNKNOWN:Y2,Z_DEFLATED:Kc}=Zs,q2=9,X2=15,K2=8,J2=29,Rd=256+1+J2,Z2=30,$2=19,eS=2*Rd+1,tS=15,St=3,cs=258,hr=cs+St+1,nS=32,Qo=42,bd=57,Ld=69,Dd=73,Nd=91,Pd=103,$s=113,yl=666,Kn=1,Oo=2,eo=3,zo=4,iS=3,to=(i,e)=>(i.msg=Js[e],e),q0=i=>i*2-(i>4?9:0),us=i=>{let e=i.length;for(;--e>=0;)i[e]=0},rS=i=>{let e,t,n,r=i.w_size;e=i.hash_size,n=e;do t=i.head[--n],i.head[n]=t>=r?t-r:0;while(--e);e=r,n=e;do t=i.prev[--n],i.prev[n]=t>=r?t-r:0;while(--e)};let fs=(i,e,t)=>(e<<i.hash_shift^t)&i.hash_mask;const _i=i=>{const e=i.state;let t=e.pending;t>i.avail_out&&(t=i.avail_out),t!==0&&(i.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),i.next_out),i.next_out+=t,e.pending_out+=t,i.total_out+=t,i.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},Ei=(i,e)=>{k2(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,e),i.block_start=i.strstart,_i(i.strm)},Dt=(i,e)=>{i.pending_buf[i.pending++]=e},Cl=(i,e)=>{i.pending_buf[i.pending++]=e>>>8&255,i.pending_buf[i.pending++]=e&255},Ud=(i,e,t,n)=>{let r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.input.subarray(i.next_in,i.next_in+r),t),i.state.wrap===1?i.adler=El(i.adler,e,r,t):i.state.wrap===2&&(i.adler=Tn(i.adler,e,r,t)),i.next_in+=r,i.total_in+=r,r)},X0=(i,e)=>{let t=i.max_chain_length,n=i.strstart,r,o,l=i.prev_length,c=i.nice_match;const f=i.strstart>i.w_size-hr?i.strstart-(i.w_size-hr):0,u=i.window,d=i.w_mask,p=i.prev,A=i.strstart+cs;let g=u[n+l-1],E=u[n+l];i.prev_length>=i.good_match&&(t>>=2),c>i.lookahead&&(c=i.lookahead);do if(r=e,!(u[r+l]!==E||u[r+l-1]!==g||u[r]!==u[n]||u[++r]!==u[n+1])){n+=2,r++;do;while(u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&n<A);if(o=cs-(A-n),n=A-cs,o>l){if(i.match_start=e,l=o,o>=c)break;g=u[n+l-1],E=u[n+l]}}while((e=p[e&d])>f&&--t!==0);return l<=i.lookahead?l:i.lookahead},Go=i=>{const e=i.w_size;let t,n,r;do{if(n=i.window_size-i.lookahead-i.strstart,i.strstart>=e+(e-hr)&&(i.window.set(i.window.subarray(e,e+e-n),0),i.match_start-=e,i.strstart-=e,i.block_start-=e,i.insert>i.strstart&&(i.insert=i.strstart),rS(i),n+=e),i.strm.avail_in===0)break;if(t=Ud(i.strm,i.window,i.strstart+i.lookahead,n),i.lookahead+=t,i.lookahead+i.insert>=St)for(r=i.strstart-i.insert,i.ins_h=i.window[r],i.ins_h=fs(i,i.ins_h,i.window[r+1]);i.insert&&(i.ins_h=fs(i,i.ins_h,i.window[r+St-1]),i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,i.insert--,!(i.lookahead+i.insert<St)););}while(i.lookahead<hr&&i.strm.avail_in!==0)},K0=(i,e)=>{let t=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,n,r,o,l=0,c=i.strm.avail_in;do{if(n=65535,o=i.bi_valid+42>>3,i.strm.avail_out<o||(o=i.strm.avail_out-o,r=i.strstart-i.block_start,n>r+i.strm.avail_in&&(n=r+i.strm.avail_in),n>o&&(n=o),n<t&&(n===0&&e!==Di||e===ls||n!==r+i.strm.avail_in)))break;l=e===Di&&n===r+i.strm.avail_in?1:0,Td(i,0,0,l),i.pending_buf[i.pending-4]=n,i.pending_buf[i.pending-3]=n>>8,i.pending_buf[i.pending-2]=~n,i.pending_buf[i.pending-1]=~n>>8,_i(i.strm),r&&(r>n&&(r=n),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+r),i.strm.next_out),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r,i.block_start+=r,n-=r),n&&(Ud(i.strm,i.strm.output,i.strm.next_out,n),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n)}while(l===0);return c-=i.strm.avail_in,c&&(c>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=c&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-c,i.strm.next_in),i.strstart),i.strstart+=c,i.insert+=c>i.w_size-i.insert?i.w_size-i.insert:c),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),l?zo:e!==ls&&e!==Di&&i.strm.avail_in===0&&i.strstart===i.block_start?Oo:(o=i.window_size-i.strstart,i.strm.avail_in>o&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,o+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),o>i.strm.avail_in&&(o=i.strm.avail_in),o&&(Ud(i.strm,i.window,i.strstart,o),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.high_water<i.strstart&&(i.high_water=i.strstart),o=i.bi_valid+42>>3,o=i.pending_buf_size-o>65535?65535:i.pending_buf_size-o,t=o>i.w_size?i.w_size:o,r=i.strstart-i.block_start,(r>=t||(r||e===Di)&&e!==ls&&i.strm.avail_in===0&&r<=o)&&(n=r>o?o:r,l=e===Di&&i.strm.avail_in===0&&n===r?1:0,Td(i,i.block_start,n,l),i.block_start+=n,_i(i.strm)),l?eo:Kn)},kd=(i,e)=>{let t,n;for(;;){if(i.lookahead<hr){if(Go(i),i.lookahead<hr&&e===ls)return Kn;if(i.lookahead===0)break}if(t=0,i.lookahead>=St&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),t!==0&&i.strstart-t<=i.w_size-hr&&(i.match_length=X0(i,t)),i.match_length>=St)if(n=as(i,i.strstart-i.match_start,i.match_length-St),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=St){i.match_length--;do i.strstart++,i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=fs(i,i.ins_h,i.window[i.strstart+1]);else n=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(n&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=i.strstart<St-1?i.strstart:St-1,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},Ho=(i,e)=>{let t,n,r;for(;;){if(i.lookahead<hr){if(Go(i),i.lookahead<hr&&e===ls)return Kn;if(i.lookahead===0)break}if(t=0,i.lookahead>=St&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=St-1,t!==0&&i.prev_length<i.max_lazy_match&&i.strstart-t<=i.w_size-hr&&(i.match_length=X0(i,t),i.match_length<=5&&(i.strategy===H2||i.match_length===St&&i.strstart-i.match_start>4096)&&(i.match_length=St-1)),i.prev_length>=St&&i.match_length<=i.prev_length){r=i.strstart+i.lookahead-St,n=as(i,i.strstart-1-i.prev_match,i.prev_length-St),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=r&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=St-1,i.strstart++,n&&(Ei(i,!1),i.strm.avail_out===0))return Kn}else if(i.match_available){if(n=as(i,0,i.window[i.strstart-1]),n&&Ei(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return Kn}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(n=as(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<St-1?i.strstart:St-1,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},sS=(i,e)=>{let t,n,r,o;const l=i.window;for(;;){if(i.lookahead<=cs){if(Go(i),i.lookahead<=cs&&e===ls)return Kn;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=St&&i.strstart>0&&(r=i.strstart-1,n=l[r],n===l[++r]&&n===l[++r]&&n===l[++r])){o=i.strstart+cs;do;while(n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&r<o);i.match_length=cs-(o-r),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=St?(t=as(i,1,i.match_length-St),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=0,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},oS=(i,e)=>{let t;for(;;){if(i.lookahead===0&&(Go(i),i.lookahead===0)){if(e===ls)return Kn;break}if(i.match_length=0,t=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=0,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo};function dr(i,e,t,n,r){this.good_length=i,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=r}const Il=[new dr(0,0,0,0,K0),new dr(4,4,8,4,kd),new dr(4,5,16,8,kd),new dr(4,6,32,32,kd),new dr(4,4,16,16,Ho),new dr(8,16,32,32,Ho),new dr(8,16,128,128,Ho),new dr(8,32,128,256,Ho),new dr(32,128,258,1024,Ho),new dr(32,258,258,4096,Ho)],aS=i=>{i.window_size=2*i.w_size,us(i.head),i.max_lazy_match=Il[i.level].max_lazy,i.good_match=Il[i.level].good_length,i.nice_match=Il[i.level].nice_length,i.max_chain_length=Il[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=St-1,i.match_available=0,i.ins_h=0};function lS(){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=Kc,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(eS*2),this.dyn_dtree=new Uint16Array((2*Z2+1)*2),this.bl_tree=new Uint16Array((2*$2+1)*2),us(this.dyn_ltree),us(this.dyn_dtree),us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(tS+1),this.heap=new Uint16Array(2*Rd+1),us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Rd+1),us(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 xl=i=>{if(!i)return 1;const e=i.state;return!e||e.strm!==i||e.status!==Qo&&e.status!==bd&&e.status!==Ld&&e.status!==Dd&&e.status!==Nd&&e.status!==Pd&&e.status!==$s&&e.status!==yl?1:0},J0=i=>{if(xl(i))return to(i,fr);i.total_in=i.total_out=0,i.data_type=Y2;const e=i.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?bd:e.wrap?Qo:$s,i.adler=e.wrap===2?0:1,e.last_flush=-2,U2(e),kn},Z0=i=>{const e=J0(i);return e===kn&&aS(i.state),e},cS=(i,e)=>xl(i)||i.state.wrap!==2?fr:(i.state.gzhead=e,kn),$0=(i,e,t,n,r,o)=>{if(!i)return fr;let l=1;if(e===G2&&(e=6),n<0?(l=0,n=-n):n>15&&(l=2,n-=16),r<1||r>q2||t!==Kc||n<8||n>15||e<0||e>9||o<0||o>W2||n===8&&l!==1)return to(i,fr);n===8&&(n=9);const c=new lS;return i.state=c,c.strm=i,c.status=Qo,c.wrap=l,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=r+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+St-1)/St),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<<r+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=o,c.method=t,Z0(i)},uS=(i,e)=>$0(i,e,Kc,X2,K2,j2),fS=(i,e)=>{if(xl(i)||e>j0||e<0)return i?to(i,fr):fr;const t=i.state;if(!i.output||i.avail_in!==0&&!i.input||t.status===yl&&e!==Di)return to(i,i.avail_out===0?Bd:fr);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(_i(i),i.avail_out===0)return t.last_flush=-1,kn}else if(i.avail_in===0&&q0(e)<=q0(n)&&e!==Di)return to(i,Bd);if(t.status===yl&&i.avail_in!==0)return to(i,Bd);if(t.status===Qo&&t.wrap===0&&(t.status=$s),t.status===Qo){let r=Kc+(t.w_bits-8<<4)<<8,o=-1;if(t.strategy>=Xc||t.level<2?o=0:t.level<6?o=1:t.level===6?o=2:o=3,r|=o<<6,t.strstart!==0&&(r|=nS),r+=31-r%31,Cl(t,r),t.strstart!==0&&(Cl(t,i.adler>>>16),Cl(t,i.adler&65535)),i.adler=1,t.status=$s,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(t.status===bd){if(i.adler=0,Dt(t,31),Dt(t,139),Dt(t,8),t.gzhead)Dt(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)),Dt(t,t.gzhead.time&255),Dt(t,t.gzhead.time>>8&255),Dt(t,t.gzhead.time>>16&255),Dt(t,t.gzhead.time>>24&255),Dt(t,t.level===9?2:t.strategy>=Xc||t.level<2?4:0),Dt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Dt(t,t.gzhead.extra.length&255),Dt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(i.adler=Tn(i.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Ld;else if(Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,t.level===9?2:t.strategy>=Xc||t.level<2?4:0),Dt(t,iS),t.status=$s,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(t.status===Ld){if(t.gzhead.extra){let r=t.pending,o=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+o>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>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=c,_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0,o-=c}let l=new Uint8Array(t.gzhead.extra);t.pending_buf.set(l.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending+=o,t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Dd}if(t.status===Dd){if(t.gzhead.name){let r=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0}t.gzindex<t.gzhead.name.length?o=t.gzhead.name.charCodeAt(t.gzindex++)&255:o=0,Dt(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Nd}if(t.status===Nd){if(t.gzhead.comment){let r=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0}t.gzindex<t.gzhead.comment.length?o=t.gzhead.comment.charCodeAt(t.gzindex++)&255:o=0,Dt(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r))}t.status=Pd}if(t.status===Pd){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(_i(i),t.pending!==0))return t.last_flush=-1,kn;Dt(t,i.adler&255),Dt(t,i.adler>>8&255),i.adler=0}if(t.status=$s,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(i.avail_in!==0||t.lookahead!==0||e!==ls&&t.status!==yl){let r=t.level===0?K0(t,e):t.strategy===Xc?oS(t,e):t.strategy===V2?sS(t,e):Il[t.level].func(t,e);if((r===eo||r===zo)&&(t.status=yl),r===Kn||r===eo)return i.avail_out===0&&(t.last_flush=-1),kn;if(r===Oo&&(e===Q2?F2(t):e!==j0&&(Td(t,0,0,!1),e===O2&&(us(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),_i(i),i.avail_out===0))return t.last_flush=-1,kn}return e!==Di?kn:t.wrap<=0?Y0:(t.wrap===2?(Dt(t,i.adler&255),Dt(t,i.adler>>8&255),Dt(t,i.adler>>16&255),Dt(t,i.adler>>24&255),Dt(t,i.total_in&255),Dt(t,i.total_in>>8&255),Dt(t,i.total_in>>16&255),Dt(t,i.total_in>>24&255)):(Cl(t,i.adler>>>16),Cl(t,i.adler&65535)),_i(i),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?kn:Y0)},hS=i=>{if(xl(i))return fr;const e=i.state.status;return i.state=null,e===$s?to(i,z2):kn},dS=(i,e)=>{let t=e.length;if(xl(i))return fr;const n=i.state,r=n.wrap;if(r===2||r===1&&n.status!==Qo||n.lookahead)return fr;if(r===1&&(i.adler=El(i.adler,e,t,0)),n.wrap=0,t>=n.w_size){r===0&&(us(n.head),n.strstart=0,n.block_start=0,n.insert=0);let f=new Uint8Array(n.w_size);f.set(e.subarray(t-n.w_size,t),0),e=f,t=n.w_size}const o=i.avail_in,l=i.next_in,c=i.input;for(i.avail_in=t,i.next_in=0,i.input=e,Go(n);n.lookahead>=St;){let f=n.strstart,u=n.lookahead-(St-1);do n.ins_h=fs(n,n.ins_h,n.window[f+St-1]),n.prev[f&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=f,f++;while(--u);n.strstart=f,n.lookahead=St-1,Go(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=St-1,n.match_available=0,i.next_in=l,i.input=c,i.avail_in=o,n.wrap=r,kn};var AS=uS,pS=$0,gS=Z0,mS=J0,vS=cS,_S=fS,ES=hS,yS=dS,CS="pako deflate (from Nodeca project)",Sl={deflateInit:AS,deflateInit2:pS,deflateReset:gS,deflateResetKeep:mS,deflateSetHeader:vS,deflate:_S,deflateEnd:ES,deflateSetDictionary:yS,deflateInfo:CS};const IS=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);var xS=function(i){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)IS(t,n)&&(i[n]=t[n])}}return i},SS=i=>{let e=0;for(let n=0,r=i.length;n<r;n++)e+=i[n].length;const t=new Uint8Array(e);for(let n=0,r=0,o=i.length;n<o;n++){let l=i[n];t.set(l,r),r+=l.length}return t},Jc={assign:xS,flattenChunks:SS};let ev=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ev=!1}const wl=new Uint8Array(256);for(let i=0;i<256;i++)wl[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;wl[254]=wl[254]=1;var wS=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let e,t,n,r,o,l=i.length,c=0;for(r=0;r<l;r++)t=i.charCodeAt(r),(t&64512)===55296&&r+1<l&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),o=0,r=0;o<c;r++)t=i.charCodeAt(r),(t&64512)===55296&&r+1<l&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),t<128?e[o++]=t:t<2048?(e[o++]=192|t>>>6,e[o++]=128|t&63):t<65536?(e[o++]=224|t>>>12,e[o++]=128|t>>>6&63,e[o++]=128|t&63):(e[o++]=240|t>>>18,e[o++]=128|t>>>12&63,e[o++]=128|t>>>6&63,e[o++]=128|t&63);return e};const MS=(i,e)=>{if(e<65534&&i.subarray&&ev)return String.fromCharCode.apply(null,i.length===e?i:i.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(i[n]);return t};var TS=(i,e)=>{const t=e||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,e));let n,r;const o=new Array(t*2);for(r=0,n=0;n<t;){let l=i[n++];if(l<128){o[r++]=l;continue}let c=wl[l];if(c>4){o[r++]=65533,n+=c-1;continue}for(l&=c===2?31:c===3?15:7;c>1&&n<t;)l=l<<6|i[n++]&63,c--;if(c>1){o[r++]=65533;continue}l<65536?o[r++]=l:(l-=65536,o[r++]=55296|l>>10&1023,o[r++]=56320|l&1023)}return MS(o,r)},BS=(i,e)=>{e=e||i.length,e>i.length&&(e=i.length);let t=e-1;for(;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+wl[i[t]]>e?t:e},Ml={string2buf:wS,buf2string:TS,utf8border:BS};function RS(){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 tv=RS;const nv=Object.prototype.toString,{Z_NO_FLUSH:bS,Z_SYNC_FLUSH:LS,Z_FULL_FLUSH:DS,Z_FINISH:NS,Z_OK:Zc,Z_STREAM_END:PS,Z_DEFAULT_COMPRESSION:US,Z_DEFAULT_STRATEGY:kS,Z_DEFLATED:FS}=Zs;function Tl(i){this.options=Jc.assign({level:US,method:FS,chunkSize:16384,windowBits:15,memLevel:8,strategy:kS},i||{});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 tv,this.strm.avail_out=0;let t=Sl.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Zc)throw new Error(Js[t]);if(e.header&&Sl.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ml.string2buf(e.dictionary):nv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Sl.deflateSetDictionary(this.strm,n),t!==Zc)throw new Error(Js[t]);this._dict_set=!0}}Tl.prototype.push=function(i,e){const t=this.strm,n=this.options.chunkSize;let r,o;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?NS:bS,typeof i=="string"?t.input=Ml.string2buf(i):nv.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,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),(o===LS||o===DS)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=Sl.deflate(t,o),r===PS)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=Sl.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Zc;if(t.avail_out===0){this.onData(t.output);continue}if(o>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},Tl.prototype.onData=function(i){this.chunks.push(i)},Tl.prototype.onEnd=function(i){i===Zc&&(this.result=Jc.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function Fd(i,e){const t=new Tl(e);if(t.push(i,!0),t.err)throw t.msg||Js[t.err];return t.result}function QS(i,e){return e=e||{},e.raw=!0,Fd(i,e)}function OS(i,e){return e=e||{},e.gzip=!0,Fd(i,e)}var zS=Tl,GS=Fd,HS=QS,VS=OS,WS=Zs,jS={Deflate:zS,deflate:GS,deflateRaw:HS,gzip:VS,constants:WS};const $c=16209,YS=16191;var qS=function(e,t){let n,r,o,l,c,f,u,d,p,A,g,E,C,_,v,S,y,x,w,b,B,L,R,T;const N=e.state;n=e.next_in,R=e.input,r=n+(e.avail_in-5),o=e.next_out,T=e.output,l=o-(t-e.avail_out),c=o+(e.avail_out-257),f=N.dmax,u=N.wsize,d=N.whave,p=N.wnext,A=N.window,g=N.hold,E=N.bits,C=N.lencode,_=N.distcode,v=(1<<N.lenbits)-1,S=(1<<N.distbits)-1;e:do{E<15&&(g+=R[n++]<<E,E+=8,g+=R[n++]<<E,E+=8),y=C[g&v];t:for(;;){if(x=y>>>24,g>>>=x,E-=x,x=y>>>16&255,x===0)T[o++]=y&65535;else if(x&16){w=y&65535,x&=15,x&&(E<x&&(g+=R[n++]<<E,E+=8),w+=g&(1<<x)-1,g>>>=x,E-=x),E<15&&(g+=R[n++]<<E,E+=8,g+=R[n++]<<E,E+=8),y=_[g&S];n:for(;;){if(x=y>>>24,g>>>=x,E-=x,x=y>>>16&255,x&16){if(b=y&65535,x&=15,E<x&&(g+=R[n++]<<E,E+=8,E<x&&(g+=R[n++]<<E,E+=8)),b+=g&(1<<x)-1,b>f){e.msg="invalid distance too far back",N.mode=$c;break e}if(g>>>=x,E-=x,x=o-l,b>x){if(x=b-x,x>d&&N.sane){e.msg="invalid distance too far back",N.mode=$c;break e}if(B=0,L=A,p===0){if(B+=u-x,x<w){w-=x;do T[o++]=A[B++];while(--x);B=o-b,L=T}}else if(p<x){if(B+=u+p-x,x-=p,x<w){w-=x;do T[o++]=A[B++];while(--x);if(B=0,p<w){x=p,w-=x;do T[o++]=A[B++];while(--x);B=o-b,L=T}}}else if(B+=p-x,x<w){w-=x;do T[o++]=A[B++];while(--x);B=o-b,L=T}for(;w>2;)T[o++]=L[B++],T[o++]=L[B++],T[o++]=L[B++],w-=3;w&&(T[o++]=L[B++],w>1&&(T[o++]=L[B++]))}else{B=o-b;do T[o++]=T[B++],T[o++]=T[B++],T[o++]=T[B++],w-=3;while(w>2);w&&(T[o++]=T[B++],w>1&&(T[o++]=T[B++]))}}else if(x&64){e.msg="invalid distance code",N.mode=$c;break e}else{y=_[(y&65535)+(g&(1<<x)-1)];continue n}break}}else if(x&64)if(x&32){N.mode=YS;break e}else{e.msg="invalid literal/length code",N.mode=$c;break e}else{y=C[(y&65535)+(g&(1<<x)-1)];continue t}break}}while(n<r&&o<c);w=E>>3,n-=w,E-=w<<3,g&=(1<<E)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=o<c?257+(c-o):257-(o-c),N.hold=g,N.bits=E};const Vo=15,iv=852,rv=592,sv=0,Qd=1,ov=2,XS=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]),KS=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]),JS=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]),ZS=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 Bl=(i,e,t,n,r,o,l,c)=>{const f=c.bits;let u=0,d=0,p=0,A=0,g=0,E=0,C=0,_=0,v=0,S=0,y,x,w,b,B,L=null,R;const T=new Uint16Array(Vo+1),N=new Uint16Array(Vo+1);let k=null,O,F,V;for(u=0;u<=Vo;u++)T[u]=0;for(d=0;d<n;d++)T[e[t+d]]++;for(g=f,A=Vo;A>=1&&T[A]===0;A--);if(g>A&&(g=A),A===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,c.bits=1,0;for(p=1;p<A&&T[p]===0;p++);for(g<p&&(g=p),_=1,u=1;u<=Vo;u++)if(_<<=1,_-=T[u],_<0)return-1;if(_>0&&(i===sv||A!==1))return-1;for(N[1]=0,u=1;u<Vo;u++)N[u+1]=N[u]+T[u];for(d=0;d<n;d++)e[t+d]!==0&&(l[N[e[t+d]]++]=d);if(i===sv?(L=k=l,R=20):i===Qd?(L=XS,k=KS,R=257):(L=JS,k=ZS,R=0),S=0,d=0,u=p,B=o,E=g,C=0,w=-1,v=1<<g,b=v-1,i===Qd&&v>iv||i===ov&&v>rv)return 1;for(;;){O=u-C,l[d]+1<R?(F=0,V=l[d]):l[d]>=R?(F=k[l[d]-R],V=L[l[d]-R]):(F=32+64,V=0),y=1<<u-C,x=1<<E,p=x;do x-=y,r[B+(S>>C)+x]=O<<24|F<<16|V|0;while(x!==0);for(y=1<<u-1;S&y;)y>>=1;if(y!==0?(S&=y-1,S+=y):S=0,d++,--T[u]===0){if(u===A)break;u=e[t+l[d]]}if(u>g&&(S&b)!==w){for(C===0&&(C=g),B+=p,E=u-C,_=1<<E;E+C<A&&(_-=T[E+C],!(_<=0));)E++,_<<=1;if(v+=1<<E,i===Qd&&v>iv||i===ov&&v>rv)return 1;w=S&b,r[w]=g<<24|E<<16|B-o|0}}return S!==0&&(r[B+S]=u-C<<24|64<<16|0),c.bits=g,0};const $S=0,av=1,lv=2,{Z_FINISH:cv,Z_BLOCK:ew,Z_TREES:eu,Z_OK:no,Z_STREAM_END:tw,Z_NEED_DICT:nw,Z_STREAM_ERROR:Ni,Z_DATA_ERROR:uv,Z_MEM_ERROR:fv,Z_BUF_ERROR:iw,Z_DEFLATED:hv}=Zs,tu=16180,dv=16181,Av=16182,pv=16183,gv=16184,mv=16185,vv=16186,_v=16187,Ev=16188,yv=16189,nu=16190,br=16191,Od=16192,Cv=16193,zd=16194,Iv=16195,xv=16196,Sv=16197,wv=16198,iu=16199,ru=16200,Mv=16201,Tv=16202,Bv=16203,Rv=16204,bv=16205,Gd=16206,Lv=16207,Dv=16208,$t=16209,Nv=16210,Pv=16211,rw=852,sw=592,ow=15,Uv=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function aw(){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 io=i=>{if(!i)return 1;const e=i.state;return!e||e.strm!==i||e.mode<tu||e.mode>Pv?1:0},kv=i=>{if(io(i))return Ni;const e=i.state;return i.total_in=i.total_out=e.total=0,i.msg="",e.wrap&&(i.adler=e.wrap&1),e.mode=tu,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(rw),e.distcode=e.distdyn=new Int32Array(sw),e.sane=1,e.back=-1,no},Fv=i=>{if(io(i))return Ni;const e=i.state;return e.wsize=0,e.whave=0,e.wnext=0,kv(i)},Qv=(i,e)=>{let t;if(io(i))return Ni;const n=i.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ni:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Fv(i))},Ov=(i,e)=>{if(!i)return Ni;const t=new aw;i.state=t,t.strm=i,t.window=null,t.mode=tu;const n=Qv(i,e);return n!==no&&(i.state=null),n},lw=i=>Ov(i,ow);let zv=!0,Hd,Vd;const cw=i=>{if(zv){Hd=new Int32Array(512),Vd=new Int32Array(32);let e=0;for(;e<144;)i.lens[e++]=8;for(;e<256;)i.lens[e++]=9;for(;e<280;)i.lens[e++]=7;for(;e<288;)i.lens[e++]=8;for(Bl(av,i.lens,0,288,Hd,0,i.work,{bits:9}),e=0;e<32;)i.lens[e++]=5;Bl(lv,i.lens,0,32,Vd,0,i.work,{bits:5}),zv=!1}i.lencode=Hd,i.lenbits=9,i.distcode=Vd,i.distbits=5},Gv=(i,e,t,n)=>{let r;const o=i.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(t-o.wsize,t),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>n&&(r=n),o.window.set(e.subarray(t-n,t-n+r),o.wnext),n-=r,n?(o.window.set(e.subarray(t-n,t),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},uw=(i,e)=>{let t,n,r,o,l,c,f,u,d,p,A,g,E,C,_=0,v,S,y,x,w,b,B,L;const R=new Uint8Array(4);let T,N;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(io(i)||!i.output||!i.input&&i.avail_in!==0)return Ni;t=i.state,t.mode===br&&(t.mode=Od),l=i.next_out,r=i.output,f=i.avail_out,o=i.next_in,n=i.input,c=i.avail_in,u=t.hold,d=t.bits,p=c,A=f,L=no;e:for(;;)switch(t.mode){case tu:if(t.wrap===0){t.mode=Od;break}for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0),u=0,d=0,t.mode=dv;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){i.msg="incorrect header check",t.mode=$t;break}if((u&15)!==hv){i.msg="unknown compression method",t.mode=$t;break}if(u>>>=4,d-=4,B=(u&15)+8,t.wbits===0&&(t.wbits=B),B>15||B>t.wbits){i.msg="invalid window size",t.mode=$t;break}t.dmax=1<<t.wbits,t.flags=0,i.adler=t.check=1,t.mode=u&512?yv:br,u=0,d=0;break;case dv:for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==hv){i.msg="unknown compression method",t.mode=$t;break}if(t.flags&57344){i.msg="unknown header flags set",t.mode=$t;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0,t.mode=Av;case Av:for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,t.check=Tn(t.check,R,4,0)),u=0,d=0,t.mode=pv;case pv:for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0,t.mode=gv;case gv:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=mv;case mv:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(B=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(o,o+g),B)),t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,t.length-=g),t.length))break e;t.length=0,t.mode=vv;case vv:if(t.flags&2048){if(c===0)break e;g=0;do B=n[o+g++],t.head&&B&&t.length<65536&&(t.head.name+=String.fromCharCode(B));while(B&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,B)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=_v;case _v:if(t.flags&4096){if(c===0)break e;g=0;do B=n[o+g++],t.head&&B&&t.length<65536&&(t.head.comment+=String.fromCharCode(B));while(B&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,B)break e}else t.head&&(t.head.comment=null);t.mode=Ev;case Ev:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){i.msg="header crc mismatch",t.mode=$t;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),i.adler=t.check=0,t.mode=br;break;case yv:for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}i.adler=t.check=Uv(u),u=0,d=0,t.mode=nu;case nu:if(t.havedict===0)return i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,nw;i.adler=t.check=1,t.mode=br;case br:if(e===ew||e===eu)break e;case Od:if(t.last){u>>>=d&7,d-=d&7,t.mode=Gd;break}for(;d<3;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=Cv;break;case 1:if(cw(t),t.mode=iu,e===eu){u>>>=2,d-=2;break e}break;case 2:t.mode=xv;break;case 3:i.msg="invalid block type",t.mode=$t}u>>>=2,d-=2;break;case Cv:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){i.msg="invalid stored block lengths",t.mode=$t;break}if(t.length=u&65535,u=0,d=0,t.mode=zd,e===eu)break e;case zd:t.mode=Iv;case Iv:if(g=t.length,g){if(g>c&&(g=c),g>f&&(g=f),g===0)break e;r.set(n.subarray(o,o+g),l),c-=g,o+=g,f-=g,l+=g,t.length-=g;break}t.mode=br;break;case xv:for(;d<14;){if(c===0)break e;c--,u+=n[o++]<<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){i.msg="too many length or distance symbols",t.mode=$t;break}t.have=0,t.mode=Sv;case Sv:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.lens[k[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[k[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,T={bits:t.lenbits},L=Bl($S,t.lens,0,19,t.lencode,0,t.work,T),t.lenbits=T.bits,L){i.msg="invalid code lengths set",t.mode=$t;break}t.have=0,t.mode=wv;case wv:for(;t.have<t.nlen+t.ndist;){for(;_=t.lencode[u&(1<<t.lenbits)-1],v=_>>>24,S=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(y<16)u>>>=v,d-=v,t.lens[t.have++]=y;else{if(y===16){for(N=v+2;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(u>>>=v,d-=v,t.have===0){i.msg="invalid bit length repeat",t.mode=$t;break}B=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(y===17){for(N=v+3;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=v,d-=v,B=0,g=3+(u&7),u>>>=3,d-=3}else{for(N=v+7;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=v,d-=v,B=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){i.msg="invalid bit length repeat",t.mode=$t;break}for(;g--;)t.lens[t.have++]=B}}if(t.mode===$t)break;if(t.lens[256]===0){i.msg="invalid code -- missing end-of-block",t.mode=$t;break}if(t.lenbits=9,T={bits:t.lenbits},L=Bl(av,t.lens,0,t.nlen,t.lencode,0,t.work,T),t.lenbits=T.bits,L){i.msg="invalid literal/lengths set",t.mode=$t;break}if(t.distbits=6,t.distcode=t.distdyn,T={bits:t.distbits},L=Bl(lv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,T),t.distbits=T.bits,L){i.msg="invalid distances set",t.mode=$t;break}if(t.mode=iu,e===eu)break e;case iu:t.mode=ru;case ru:if(c>=6&&f>=258){i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,qS(i,A),l=i.next_out,r=i.output,f=i.avail_out,o=i.next_in,n=i.input,c=i.avail_in,u=t.hold,d=t.bits,t.mode===br&&(t.back=-1);break}for(t.back=0;_=t.lencode[u&(1<<t.lenbits)-1],v=_>>>24,S=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(S&&!(S&240)){for(x=v,w=S,b=y;_=t.lencode[b+((u&(1<<x+w)-1)>>x)],v=_>>>24,S=_>>>16&255,y=_&65535,!(x+v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=x,d-=x,t.back+=x}if(u>>>=v,d-=v,t.back+=v,t.length=y,S===0){t.mode=bv;break}if(S&32){t.back=-1,t.mode=br;break}if(S&64){i.msg="invalid literal/length code",t.mode=$t;break}t.extra=S&15,t.mode=Mv;case Mv:if(t.extra){for(N=t.extra;d<N;){if(c===0)break e;c--,u+=n[o++]<<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=Tv;case Tv:for(;_=t.distcode[u&(1<<t.distbits)-1],v=_>>>24,S=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(!(S&240)){for(x=v,w=S,b=y;_=t.distcode[b+((u&(1<<x+w)-1)>>x)],v=_>>>24,S=_>>>16&255,y=_&65535,!(x+v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=x,d-=x,t.back+=x}if(u>>>=v,d-=v,t.back+=v,S&64){i.msg="invalid distance code",t.mode=$t;break}t.offset=y,t.extra=S&15,t.mode=Bv;case Bv:if(t.extra){for(N=t.extra;d<N;){if(c===0)break e;c--,u+=n[o++]<<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){i.msg="invalid distance too far back",t.mode=$t;break}t.mode=Rv;case Rv:if(f===0)break e;if(g=A-f,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){i.msg="invalid distance too far back",t.mode=$t;break}g>t.wnext?(g-=t.wnext,E=t.wsize-g):E=t.wnext-g,g>t.length&&(g=t.length),C=t.window}else C=r,E=l-t.offset,g=t.length;g>f&&(g=f),f-=g,t.length-=g;do r[l++]=C[E++];while(--g);t.length===0&&(t.mode=ru);break;case bv:if(f===0)break e;r[l++]=t.length,f--,t.mode=ru;break;case Gd:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[o++]<<d,d+=8}if(A-=f,i.total_out+=A,t.total+=A,t.wrap&4&&A&&(i.adler=t.check=t.flags?Tn(t.check,r,A,l-A):El(t.check,r,A,l-A)),A=f,t.wrap&4&&(t.flags?u:Uv(u))!==t.check){i.msg="incorrect data check",t.mode=$t;break}u=0,d=0}t.mode=Lv;case Lv:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){i.msg="incorrect length check",t.mode=$t;break}u=0,d=0}t.mode=Dv;case Dv:L=tw;break e;case $t:L=uv;break e;case Nv:return fv;case Pv:default:return Ni}return i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,(t.wsize||A!==i.avail_out&&t.mode<$t&&(t.mode<Gd||e!==cv))&&Gv(i,i.output,i.next_out,A-i.avail_out),p-=i.avail_in,A-=i.avail_out,i.total_in+=p,i.total_out+=A,t.total+=A,t.wrap&4&&A&&(i.adler=t.check=t.flags?Tn(t.check,r,A,i.next_out-A):El(t.check,r,A,i.next_out-A)),i.data_type=t.bits+(t.last?64:0)+(t.mode===br?128:0)+(t.mode===iu||t.mode===zd?256:0),(p===0&&A===0||e===cv)&&L===no&&(L=iw),L},fw=i=>{if(io(i))return Ni;let e=i.state;return e.window&&(e.window=null),i.state=null,no},hw=(i,e)=>{if(io(i))return Ni;const t=i.state;return t.wrap&2?(t.head=e,e.done=!1,no):Ni},dw=(i,e)=>{const t=e.length;let n,r,o;return io(i)||(n=i.state,n.wrap!==0&&n.mode!==nu)?Ni:n.mode===nu&&(r=1,r=El(r,e,t,0),r!==n.check)?uv:(o=Gv(i,e,t,t),o?(n.mode=Nv,fv):(n.havedict=1,no))};var Aw=Fv,pw=Qv,gw=kv,mw=lw,vw=Ov,_w=uw,Ew=fw,yw=hw,Cw=dw,Iw="pako inflate (from Nodeca project)",Lr={inflateReset:Aw,inflateReset2:pw,inflateResetKeep:gw,inflateInit:mw,inflateInit2:vw,inflate:_w,inflateEnd:Ew,inflateGetHeader:yw,inflateSetDictionary:Cw,inflateInfo:Iw};function xw(){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 Sw=xw;const Hv=Object.prototype.toString,{Z_NO_FLUSH:ww,Z_FINISH:Mw,Z_OK:Rl,Z_STREAM_END:Wd,Z_NEED_DICT:jd,Z_STREAM_ERROR:Tw,Z_DATA_ERROR:Vv,Z_MEM_ERROR:Bw}=Zs;function bl(i){this.options=Jc.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});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&&!(i&&i.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 tv,this.strm.avail_out=0;let t=Lr.inflateInit2(this.strm,e.windowBits);if(t!==Rl)throw new Error(Js[t]);if(this.header=new Sw,Lr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ml.string2buf(e.dictionary):Hv.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Lr.inflateSetDictionary(this.strm,e.dictionary),t!==Rl)))throw new Error(Js[t])}bl.prototype.push=function(i,e){const t=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let o,l,c;if(this.ended)return!1;for(e===~~e?l=e:l=e===!0?Mw:ww,Hv.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,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),o=Lr.inflate(t,l),o===jd&&r&&(o=Lr.inflateSetDictionary(t,r),o===Rl?o=Lr.inflate(t,l):o===Vv&&(o=jd));t.avail_in>0&&o===Wd&&t.state.wrap>0&&i[t.next_in]!==0;)Lr.inflateReset(t),o=Lr.inflate(t,l);switch(o){case Tw:case Vv:case jd:case Bw:return this.onEnd(o),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||o===Wd))if(this.options.to==="string"){let f=Ml.utf8border(t.output,t.next_out),u=t.next_out-f,d=Ml.buf2string(t.output,f);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(f,f+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(o===Rl&&c===0)){if(o===Wd)return o=Lr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},bl.prototype.onData=function(i){this.chunks.push(i)},bl.prototype.onEnd=function(i){i===Rl&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Jc.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function Yd(i,e){const t=new bl(e);if(t.push(i),t.err)throw t.msg||Js[t.err];return t.result}function Rw(i,e){return e=e||{},e.raw=!0,Yd(i,e)}var bw=bl,Lw=Yd,Dw=Rw,Nw=Yd,Pw=Zs,Uw={Inflate:bw,inflate:Lw,inflateRaw:Dw,ungzip:Nw,constants:Pw};const{Deflate:kw,deflate:Fw,deflateRaw:Qw,gzip:Ow}=jS,{Inflate:zw,inflate:Gw,inflateRaw:Hw,ungzip:Vw}=Uw;var Ww=kw,jw=Fw,Yw=Qw,qw=Ow,Xw=zw,Kw=Gw,Jw=Hw,Zw=Vw,$w=Zs,eM={Deflate:Ww,deflate:jw,deflateRaw:Yw,gzip:qw,Inflate:Xw,inflate:Kw,inflateRaw:Jw,ungzip:Zw,constants:$w},tM=i=>{if(i===""||!i)return"";let e=i.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(md.MD5(t))};async function nM(i){return await(await fetch(i,{method:"GET"})).arrayBuffer()}function iM(i){return eM.ungzip(i,{to:"string"})}var rM=i=>{let e=window.atob(i),t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r+=1)n[r]=e.charCodeAt(r);return n.buffer};async function sM(i,e){let t=tM(e),n=md.AES.decrypt(i,t).toString(md.enc.Latin1);return rM(n)}async function oM(i,e){let t=e||`org/${i.split("org/")[1].split("/universal")[0]}`,n=Date.now(),r=await nM(i),o=Date.now()-n;n=Date.now();let l=iM(r),c=Date.now()-n;n=Date.now();let f=await sM(l,t),u=Date.now()-n;return{decodedData:f,events:{fileDownloadTime:o,fileUnzipTime:c,fileDecryptionTime:u}}}var aM=oM;/**
32
+ */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function r(c){if((c>>24&255)===255){var f=c>>16&255,u=c>>8&255,d=c&255;f===255?(f=0,u===255?(u=0,d===255?d=0:++d):++u):++f,c=0,c+=f<<16,c+=u<<8,c+=d}else c+=1<<24;return c}function o(c){return(c[0]=r(c[0]))===0&&(c[1]=r(c[1])),c}var l=n.Encryptor=n.extend({processBlock:function(c,f){var u=this._cipher,d=u.blockSize,p=this._iv,A=this._counter;p&&(A=this._counter=p.slice(0),this._iv=void 0),o(A);var g=A.slice(0);u.encryptBlock(g,0);for(var E=0;E<d;E++)c[f+E]^=g[E]}});return n.Decryptor=l,n}(),t.mode.CTRGladman})}(nd)),nd.exports}var id={exports:{}},u0;function qx(){return u0||(u0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(o,l){var c=this._cipher,f=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 p=0;p<f;p++)o[l+p]^=d[p]}});return n.Decryptor=r,n}(),t.mode.OFB})}(id)),id.exports}var rd={exports:{}},f0;function Xx(){return f0||(f0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(r,o){this._cipher.encryptBlock(r,o)}}),n.Decryptor=n.extend({processBlock:function(r,o){this._cipher.decryptBlock(r,o)}}),n}(),t.mode.ECB})}(rd)),rd.exports}var sd={exports:{}},h0;function Kx(){return h0||(h0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.AnsiX923={pad:function(n,r){var o=n.sigBytes,l=r*4,c=l-o%l,f=o+c-1;n.clamp(),n.words[f>>>2]|=c<<24-f%4*8,n.sigBytes+=c},unpad:function(n){var r=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=r}},t.pad.Ansix923})}(sd)),sd.exports}var od={exports:{}},d0;function Jx(){return d0||(d0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.Iso10126={pad:function(n,r){var o=r*4,l=o-n.sigBytes%o;n.concat(t.lib.WordArray.random(l-1)).concat(t.lib.WordArray.create([l<<24],1))},unpad:function(n){var r=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=r}},t.pad.Iso10126})}(od)),od.exports}var ad={exports:{}},A0;function $x(){return A0||(A0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.Iso97971={pad:function(n,r){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,r)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(ad)),ad.exports}var ld={exports:{}},p0;function Zx(){return p0||(p0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.ZeroPadding={pad:function(n,r){var o=r*4;n.clamp(),n.sigBytes+=o-(n.sigBytes%o||o)},unpad:function(n){for(var r=n.words,o=n.sigBytes-1,o=n.sigBytes-1;o>=0;o--)if(r[o>>>2]>>>24-o%4*8&255){n.sigBytes=o+1;break}}},t.pad.ZeroPadding})}(ld)),ld.exports}var cd={exports:{}},g0;function e2(){return g0||(g0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(cd)),cd.exports}var ud={exports:{}},m0;function t2(){return m0||(m0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),Mn())})(vt,function(t){return function(n){var r=t,o=r.lib,l=o.CipherParams,c=r.enc,f=c.Hex,u=r.format;u.Hex={stringify:function(d){return d.ciphertext.toString(f)},parse:function(d){var p=f.parse(d);return l.create({ciphertext:p})}}}(),t.format.Hex})}(ud)),ud.exports}var fd={exports:{}},v0;function n2(){return v0||(v0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.BlockCipher,l=n.algo,c=[],f=[],u=[],d=[],p=[],A=[],g=[],E=[],C=[],_=[];(function(){for(var y=[],S=0;S<256;S++)S<128?y[S]=S<<1:y[S]=S<<1^283;for(var w=0,b=0,S=0;S<256;S++){var B=b^b<<1^b<<2^b<<3^b<<4;B=B>>>8^B&255^99,c[w]=B,f[B]=w;var L=y[w],R=y[L],T=y[R],N=y[B]*257^B*16843008;u[w]=N<<24|N>>>8,d[w]=N<<16|N>>>16,p[w]=N<<8|N>>>24,A[w]=N;var N=T*16843009^R*65537^L*257^w*16843008;g[B]=N<<24|N>>>8,E[B]=N<<16|N>>>16,C[B]=N<<8|N>>>24,_[B]=N,w?(w=L^y[y[y[T^L]]],b^=y[y[b]]):w=b=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],x=l.AES=o.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var S=this._keyPriorReset=this._key,w=S.words,b=S.sigBytes/4,B=this._nRounds=b+6,L=(B+1)*4,R=this._keySchedule=[],T=0;T<L;T++)T<b?R[T]=w[T]:(y=R[T-1],T%b?b>6&&T%b==4&&(y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255]):(y=y<<8|y>>>24,y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[y&255],y^=v[T/b|0]<<24),R[T]=R[T-b]^y);for(var N=this._invKeySchedule=[],k=0;k<L;k++){var T=L-k;if(k%4)var y=R[T];else var y=R[T-4];k<4||T<=4?N[k]=y:N[k]=g[c[y>>>24]]^E[c[y>>>16&255]]^C[c[y>>>8&255]]^_[c[y&255]]}}},encryptBlock:function(y,S){this._doCryptBlock(y,S,this._keySchedule,u,d,p,A,c)},decryptBlock:function(y,S){var w=y[S+1];y[S+1]=y[S+3],y[S+3]=w,this._doCryptBlock(y,S,this._invKeySchedule,g,E,C,_,f);var w=y[S+1];y[S+1]=y[S+3],y[S+3]=w},_doCryptBlock:function(y,S,w,b,B,L,R,T){for(var N=this._nRounds,k=y[S]^w[0],O=y[S+1]^w[1],F=y[S+2]^w[2],V=y[S+3]^w[3],X=4,te=1;te<N;te++){var q=b[k>>>24]^B[O>>>16&255]^L[F>>>8&255]^R[V&255]^w[X++],Z=b[O>>>24]^B[F>>>16&255]^L[V>>>8&255]^R[k&255]^w[X++],U=b[F>>>24]^B[V>>>16&255]^L[k>>>8&255]^R[O&255]^w[X++],D=b[V>>>24]^B[k>>>16&255]^L[O>>>8&255]^R[F&255]^w[X++];k=q,O=Z,F=U,V=D}var q=(T[k>>>24]<<24|T[O>>>16&255]<<16|T[F>>>8&255]<<8|T[V&255])^w[X++],Z=(T[O>>>24]<<24|T[F>>>16&255]<<16|T[V>>>8&255]<<8|T[k&255])^w[X++],U=(T[F>>>24]<<24|T[V>>>16&255]<<16|T[k>>>8&255]<<8|T[O&255])^w[X++],D=(T[V>>>24]<<24|T[k>>>16&255]<<16|T[O>>>8&255]<<8|T[F&255])^w[X++];y[S]=q,y[S+1]=Z,y[S+2]=U,y[S+3]=D},keySize:256/32});n.AES=o._createHelper(x)}(),t.AES})}(fd)),fd.exports}var hd={exports:{}},_0;function i2(){return _0||(_0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.WordArray,l=r.BlockCipher,c=n.algo,f=[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],p=[{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}],A=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=c.DES=l.extend({_doReset:function(){for(var v=this._key,x=v.words,y=[],S=0;S<56;S++){var w=f[S]-1;y[S]=x[w>>>5]>>>31-w%32&1}for(var b=this._subKeys=[],B=0;B<16;B++){for(var L=b[B]=[],R=d[B],S=0;S<24;S++)L[S/6|0]|=y[(u[S]-1+R)%28]<<31-S%6,L[4+(S/6|0)]|=y[28+(u[S+24]-1+R)%28]<<31-S%6;L[0]=L[0]<<1|L[0]>>>31;for(var S=1;S<7;S++)L[S]=L[S]>>>(S-1)*4+3;L[7]=L[7]<<5|L[7]>>>27}for(var T=this._invSubKeys=[],S=0;S<16;S++)T[S]=b[15-S]},encryptBlock:function(v,x){this._doCryptBlock(v,x,this._subKeys)},decryptBlock:function(v,x){this._doCryptBlock(v,x,this._invSubKeys)},_doCryptBlock:function(v,x,y){this._lBlock=v[x],this._rBlock=v[x+1],E.call(this,4,252645135),E.call(this,16,65535),C.call(this,2,858993459),C.call(this,8,16711935),E.call(this,1,1431655765);for(var S=0;S<16;S++){for(var w=y[S],b=this._lBlock,B=this._rBlock,L=0,R=0;R<8;R++)L|=p[R][((B^w[R])&A[R])>>>0];this._lBlock=B,this._rBlock=b^L}var T=this._lBlock;this._lBlock=this._rBlock,this._rBlock=T,E.call(this,1,1431655765),C.call(this,8,16711935),C.call(this,2,858993459),E.call(this,16,65535),E.call(this,4,252645135),v[x]=this._lBlock,v[x+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function E(v,x){var y=(this._lBlock>>>v^this._rBlock)&x;this._rBlock^=y,this._lBlock^=y<<v}function C(v,x){var y=(this._rBlock>>>v^this._lBlock)&x;this._lBlock^=y,this._rBlock^=y<<v}n.DES=l._createHelper(g);var _=c.TripleDES=l.extend({_doReset:function(){var v=this._key,x=v.words;if(x.length!==2&&x.length!==4&&x.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var y=x.slice(0,2),S=x.length<4?x.slice(0,2):x.slice(2,4),w=x.length<6?x.slice(0,2):x.slice(4,6);this._des1=g.createEncryptor(o.create(y)),this._des2=g.createEncryptor(o.create(S)),this._des3=g.createEncryptor(o.create(w))},encryptBlock:function(v,x){this._des1.encryptBlock(v,x),this._des2.decryptBlock(v,x),this._des3.encryptBlock(v,x)},decryptBlock:function(v,x){this._des3.decryptBlock(v,x),this._des2.encryptBlock(v,x),this._des1.decryptBlock(v,x)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=l._createHelper(_)}(),t.TripleDES})}(hd)),hd.exports}var dd={exports:{}},E0;function r2(){return E0||(E0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=l.RC4=o.extend({_doReset:function(){for(var d=this._key,p=d.words,A=d.sigBytes,g=this._S=[],E=0;E<256;E++)g[E]=E;for(var E=0,C=0;E<256;E++){var _=E%A,v=p[_>>>2]>>>24-_%4*8&255;C=(C+g[E]+v)%256;var x=g[E];g[E]=g[C],g[C]=x}this._i=this._j=0},_doProcessBlock:function(d,p){d[p]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var d=this._S,p=this._i,A=this._j,g=0,E=0;E<4;E++){p=(p+1)%256,A=(A+d[p])%256;var C=d[p];d[p]=d[A],d[A]=C,g|=d[(d[p]+d[A])%256]<<24-E*8}return this._i=p,this._j=A,g}n.RC4=o._createHelper(c);var u=l.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)f.call(this)}});n.RC4Drop=o._createHelper(u)}(),t.RC4})}(dd)),dd.exports}var Ad={exports:{}},y0;function s2(){return y0||(y0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=[],f=[],u=[],d=l.Rabbit=o.extend({_doReset:function(){for(var A=this._key.words,g=this.cfg.iv,E=0;E<4;E++)A[E]=(A[E]<<8|A[E]>>>24)&16711935|(A[E]<<24|A[E]>>>8)&4278255360;var C=this._X=[A[0],A[3]<<16|A[2]>>>16,A[1],A[0]<<16|A[3]>>>16,A[2],A[1]<<16|A[0]>>>16,A[3],A[2]<<16|A[1]>>>16],_=this._C=[A[2]<<16|A[2]>>>16,A[0]&4294901760|A[1]&65535,A[3]<<16|A[3]>>>16,A[1]&4294901760|A[2]&65535,A[0]<<16|A[0]>>>16,A[2]&4294901760|A[3]&65535,A[1]<<16|A[1]>>>16,A[3]&4294901760|A[0]&65535];this._b=0;for(var E=0;E<4;E++)p.call(this);for(var E=0;E<8;E++)_[E]^=C[E+4&7];if(g){var v=g.words,x=v[0],y=v[1],S=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,w=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,b=S>>>16|w&4294901760,B=w<<16|S&65535;_[0]^=S,_[1]^=b,_[2]^=w,_[3]^=B,_[4]^=S,_[5]^=b,_[6]^=w,_[7]^=B;for(var E=0;E<4;E++)p.call(this)}},_doProcessBlock:function(A,g){var E=this._X;p.call(this),c[0]=E[0]^E[5]>>>16^E[3]<<16,c[1]=E[2]^E[7]>>>16^E[5]<<16,c[2]=E[4]^E[1]>>>16^E[7]<<16,c[3]=E[6]^E[3]>>>16^E[1]<<16;for(var C=0;C<4;C++)c[C]=(c[C]<<8|c[C]>>>24)&16711935|(c[C]<<24|c[C]>>>8)&4278255360,A[g+C]^=c[C]},blockSize:128/32,ivSize:64/32});function p(){for(var A=this._X,g=this._C,E=0;E<8;E++)f[E]=g[E];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<f[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<f[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<f[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<f[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<f[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<f[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<f[6]>>>0?1:0)|0,this._b=g[7]>>>0<f[7]>>>0?1:0;for(var E=0;E<8;E++){var C=A[E]+g[E],_=C&65535,v=C>>>16,x=((_*_>>>17)+_*v>>>15)+v*v,y=((C&4294901760)*C|0)+((C&65535)*C|0);u[E]=x^y}A[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,A[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,A[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,A[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,A[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,A[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,A[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,A[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=o._createHelper(d)}(),t.Rabbit})}(Ad)),Ad.exports}var pd={exports:{}},C0;function o2(){return C0||(C0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.StreamCipher,l=n.algo,c=[],f=[],u=[],d=l.RabbitLegacy=o.extend({_doReset:function(){var A=this._key.words,g=this.cfg.iv,E=this._X=[A[0],A[3]<<16|A[2]>>>16,A[1],A[0]<<16|A[3]>>>16,A[2],A[1]<<16|A[0]>>>16,A[3],A[2]<<16|A[1]>>>16],C=this._C=[A[2]<<16|A[2]>>>16,A[0]&4294901760|A[1]&65535,A[3]<<16|A[3]>>>16,A[1]&4294901760|A[2]&65535,A[0]<<16|A[0]>>>16,A[2]&4294901760|A[3]&65535,A[1]<<16|A[1]>>>16,A[3]&4294901760|A[0]&65535];this._b=0;for(var _=0;_<4;_++)p.call(this);for(var _=0;_<8;_++)C[_]^=E[_+4&7];if(g){var v=g.words,x=v[0],y=v[1],S=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,w=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,b=S>>>16|w&4294901760,B=w<<16|S&65535;C[0]^=S,C[1]^=b,C[2]^=w,C[3]^=B,C[4]^=S,C[5]^=b,C[6]^=w,C[7]^=B;for(var _=0;_<4;_++)p.call(this)}},_doProcessBlock:function(A,g){var E=this._X;p.call(this),c[0]=E[0]^E[5]>>>16^E[3]<<16,c[1]=E[2]^E[7]>>>16^E[5]<<16,c[2]=E[4]^E[1]>>>16^E[7]<<16,c[3]=E[6]^E[3]>>>16^E[1]<<16;for(var C=0;C<4;C++)c[C]=(c[C]<<8|c[C]>>>24)&16711935|(c[C]<<24|c[C]>>>8)&4278255360,A[g+C]^=c[C]},blockSize:128/32,ivSize:64/32});function p(){for(var A=this._X,g=this._C,E=0;E<8;E++)f[E]=g[E];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<f[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<f[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<f[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<f[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<f[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<f[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<f[6]>>>0?1:0)|0,this._b=g[7]>>>0<f[7]>>>0?1:0;for(var E=0;E<8;E++){var C=A[E]+g[E],_=C&65535,v=C>>>16,x=((_*_>>>17)+_*v>>>15)+v*v,y=((C&4294901760)*C|0)+((C&65535)*C|0);u[E]=x^y}A[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,A[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,A[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,A[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,A[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,A[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,A[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,A[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=o._createHelper(d)}(),t.RabbitLegacy})}(pd)),pd.exports}var gd={exports:{}},I0;function a2(){return I0||(I0=1,function(i,e){(function(t,n,r){i.exports=n(xt(),qs(),Xs(),os(),Mn())})(vt,function(t){return function(){var n=t,r=n.lib,o=r.BlockCipher,l=n.algo;const c=16,f=[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 p(_,v){let x=v>>24&255,y=v>>16&255,S=v>>8&255,w=v&255,b=_.sbox[0][x]+_.sbox[1][y];return b=b^_.sbox[2][S],b=b+_.sbox[3][w],b}function A(_,v,x){let y=v,S=x,w;for(let b=0;b<c;++b)y=y^_.pbox[b],S=p(_,y)^S,w=y,y=S,S=w;return w=y,y=S,S=w,S=S^_.pbox[c],y=y^_.pbox[c+1],{left:y,right:S}}function g(_,v,x){let y=v,S=x,w;for(let b=c+1;b>1;--b)y=y^_.pbox[b],S=p(_,y)^S,w=y,y=S,S=w;return w=y,y=S,S=w,S=S^_.pbox[1],y=y^_.pbox[0],{left:y,right:S}}function E(_,v,x){for(let B=0;B<4;B++){_.sbox[B]=[];for(let L=0;L<256;L++)_.sbox[B][L]=u[B][L]}let y=0;for(let B=0;B<c+2;B++)_.pbox[B]=f[B]^v[y],y++,y>=x&&(y=0);let S=0,w=0,b=0;for(let B=0;B<c+2;B+=2)b=A(_,S,w),S=b.left,w=b.right,_.pbox[B]=S,_.pbox[B+1]=w;for(let B=0;B<4;B++)for(let L=0;L<256;L+=2)b=A(_,S,w),S=b.left,w=b.right,_.sbox[B][L]=S,_.sbox[B][L+1]=w;return!0}var C=l.Blowfish=o.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var _=this._keyPriorReset=this._key,v=_.words,x=_.sigBytes/4;E(d,v,x)}},encryptBlock:function(_,v){var x=A(d,_[v],_[v+1]);_[v]=x.left,_[v+1]=x.right},decryptBlock:function(_,v){var x=g(d,_[v],_[v+1]);_[v]=x.left,_[v+1]=x.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=o._createHelper(C)}(),t.Blowfish})}(gd)),gd.exports}(function(i,e){(function(t,n,r){i.exports=n(xt(),jc(),kx(),Fx(),qs(),Qx(),Xs(),Xm(),Hh(),Ox(),Zm(),zx(),Gx(),Hx(),Kh(),Vx(),os(),Mn(),Wx(),jx(),Yx(),qx(),Xx(),Kx(),Jx(),$x(),Zx(),e2(),t2(),n2(),i2(),r2(),s2(),o2(),a2())})(vt,function(t){return t})})(Om);var l2=Om.exports;const md=Sx(l2);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const c2=4,x0=0,S0=1,u2=2;function ko(i){let e=i.length;for(;--e>=0;)i[e]=0}const f2=0,w0=1,h2=2,d2=3,A2=258,vd=29,Al=256,pl=Al+1+vd,Fo=30,_d=19,M0=2*pl+1,Ks=15,Ed=16,p2=7,yd=256,T0=16,B0=17,R0=18,Cd=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]),Yc=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]),g2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),b0=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m2=512,Rr=new Array((pl+2)*2);ko(Rr);const gl=new Array(Fo*2);ko(gl);const ml=new Array(m2);ko(ml);const vl=new Array(A2-d2+1);ko(vl);const Id=new Array(vd);ko(Id);const qc=new Array(Fo);ko(qc);function xd(i,e,t,n,r){this.static_tree=i,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=r,this.has_stree=i&&i.length}let L0,D0,N0;function Sd(i,e){this.dyn_tree=i,this.max_code=0,this.stat_desc=e}const P0=i=>i<256?ml[i]:ml[256+(i>>>7)],_l=(i,e)=>{i.pending_buf[i.pending++]=e&255,i.pending_buf[i.pending++]=e>>>8&255},li=(i,e,t)=>{i.bi_valid>Ed-t?(i.bi_buf|=e<<i.bi_valid&65535,_l(i,i.bi_buf),i.bi_buf=e>>Ed-i.bi_valid,i.bi_valid+=t-Ed):(i.bi_buf|=e<<i.bi_valid&65535,i.bi_valid+=t)},ur=(i,e,t)=>{li(i,t[e*2],t[e*2+1])},U0=(i,e)=>{let t=0;do t|=i&1,i>>>=1,t<<=1;while(--e>0);return t>>>1},v2=i=>{i.bi_valid===16?(_l(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},_2=(i,e)=>{const t=e.dyn_tree,n=e.max_code,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,f=e.stat_desc.max_length;let u,d,p,A,g,E,C=0;for(A=0;A<=Ks;A++)i.bl_count[A]=0;for(t[i.heap[i.heap_max]*2+1]=0,u=i.heap_max+1;u<M0;u++)d=i.heap[u],A=t[t[d*2+1]*2+1]+1,A>f&&(A=f,C++),t[d*2+1]=A,!(d>n)&&(i.bl_count[A]++,g=0,d>=c&&(g=l[d-c]),E=t[d*2],i.opt_len+=E*(A+g),o&&(i.static_len+=E*(r[d*2+1]+g)));if(C!==0){do{for(A=f-1;i.bl_count[A]===0;)A--;i.bl_count[A]--,i.bl_count[A+1]+=2,i.bl_count[f]--,C-=2}while(C>0);for(A=f;A!==0;A--)for(d=i.bl_count[A];d!==0;)p=i.heap[--u],!(p>n)&&(t[p*2+1]!==A&&(i.opt_len+=(A-t[p*2+1])*t[p*2],t[p*2+1]=A),d--)}},k0=(i,e,t)=>{const n=new Array(Ks+1);let r=0,o,l;for(o=1;o<=Ks;o++)r=r+t[o-1]<<1,n[o]=r;for(l=0;l<=e;l++){let c=i[l*2+1];c!==0&&(i[l*2]=U0(n[c]++,c))}},E2=()=>{let i,e,t,n,r;const o=new Array(Ks+1);for(t=0,n=0;n<vd-1;n++)for(Id[n]=t,i=0;i<1<<Cd[n];i++)vl[t++]=n;for(vl[t-1]=n,r=0,n=0;n<16;n++)for(qc[n]=r,i=0;i<1<<Yc[n];i++)ml[r++]=n;for(r>>=7;n<Fo;n++)for(qc[n]=r<<7,i=0;i<1<<Yc[n]-7;i++)ml[256+r++]=n;for(e=0;e<=Ks;e++)o[e]=0;for(i=0;i<=143;)Rr[i*2+1]=8,i++,o[8]++;for(;i<=255;)Rr[i*2+1]=9,i++,o[9]++;for(;i<=279;)Rr[i*2+1]=7,i++,o[7]++;for(;i<=287;)Rr[i*2+1]=8,i++,o[8]++;for(k0(Rr,pl+1,o),i=0;i<Fo;i++)gl[i*2+1]=5,gl[i*2]=U0(i,5);L0=new xd(Rr,Cd,Al+1,pl,Ks),D0=new xd(gl,Yc,0,Fo,Ks),N0=new xd(new Array(0),g2,0,_d,p2)},F0=i=>{let e;for(e=0;e<pl;e++)i.dyn_ltree[e*2]=0;for(e=0;e<Fo;e++)i.dyn_dtree[e*2]=0;for(e=0;e<_d;e++)i.bl_tree[e*2]=0;i.dyn_ltree[yd*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},Q0=i=>{i.bi_valid>8?_l(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},O0=(i,e,t,n)=>{const r=e*2,o=t*2;return i[r]<i[o]||i[r]===i[o]&&n[e]<=n[t]},wd=(i,e,t)=>{const n=i.heap[t];let r=t<<1;for(;r<=i.heap_len&&(r<i.heap_len&&O0(e,i.heap[r+1],i.heap[r],i.depth)&&r++,!O0(e,n,i.heap[r],i.depth));)i.heap[t]=i.heap[r],t=r,r<<=1;i.heap[t]=n},z0=(i,e,t)=>{let n,r,o=0,l,c;if(i.sym_next!==0)do n=i.pending_buf[i.sym_buf+o++]&255,n+=(i.pending_buf[i.sym_buf+o++]&255)<<8,r=i.pending_buf[i.sym_buf+o++],n===0?ur(i,r,e):(l=vl[r],ur(i,l+Al+1,e),c=Cd[l],c!==0&&(r-=Id[l],li(i,r,c)),n--,l=P0(n),ur(i,l,t),c=Yc[l],c!==0&&(n-=qc[l],li(i,n,c)));while(o<i.sym_next);ur(i,yd,e)},Md=(i,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.elems;let l,c,f=-1,u;for(i.heap_len=0,i.heap_max=M0,l=0;l<o;l++)t[l*2]!==0?(i.heap[++i.heap_len]=f=l,i.depth[l]=0):t[l*2+1]=0;for(;i.heap_len<2;)u=i.heap[++i.heap_len]=f<2?++f:0,t[u*2]=1,i.depth[u]=0,i.opt_len--,r&&(i.static_len-=n[u*2+1]);for(e.max_code=f,l=i.heap_len>>1;l>=1;l--)wd(i,t,l);u=o;do l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],wd(i,t,1),c=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=c,t[u*2]=t[l*2]+t[c*2],i.depth[u]=(i.depth[l]>=i.depth[c]?i.depth[l]:i.depth[c])+1,t[l*2+1]=t[c*2+1]=u,i.heap[1]=u++,wd(i,t,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],_2(i,e),k0(t,f,i.bl_count)},G0=(i,e,t)=>{let n,r=-1,o,l=e[0*2+1],c=0,f=7,u=4;for(l===0&&(f=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)o=l,l=e[(n+1)*2+1],!(++c<f&&o===l)&&(c<u?i.bl_tree[o*2]+=c:o!==0?(o!==r&&i.bl_tree[o*2]++,i.bl_tree[T0*2]++):c<=10?i.bl_tree[B0*2]++:i.bl_tree[R0*2]++,c=0,r=o,l===0?(f=138,u=3):o===l?(f=6,u=3):(f=7,u=4))},H0=(i,e,t)=>{let n,r=-1,o,l=e[0*2+1],c=0,f=7,u=4;for(l===0&&(f=138,u=3),n=0;n<=t;n++)if(o=l,l=e[(n+1)*2+1],!(++c<f&&o===l)){if(c<u)do ur(i,o,i.bl_tree);while(--c!==0);else o!==0?(o!==r&&(ur(i,o,i.bl_tree),c--),ur(i,T0,i.bl_tree),li(i,c-3,2)):c<=10?(ur(i,B0,i.bl_tree),li(i,c-3,3)):(ur(i,R0,i.bl_tree),li(i,c-11,7));c=0,r=o,l===0?(f=138,u=3):o===l?(f=6,u=3):(f=7,u=4)}},y2=i=>{let e;for(G0(i,i.dyn_ltree,i.l_desc.max_code),G0(i,i.dyn_dtree,i.d_desc.max_code),Md(i,i.bl_desc),e=_d-1;e>=3&&i.bl_tree[b0[e]*2+1]===0;e--);return i.opt_len+=3*(e+1)+5+5+4,e},C2=(i,e,t,n)=>{let r;for(li(i,e-257,5),li(i,t-1,5),li(i,n-4,4),r=0;r<n;r++)li(i,i.bl_tree[b0[r]*2+1],3);H0(i,i.dyn_ltree,e-1),H0(i,i.dyn_dtree,t-1)},I2=i=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&i.dyn_ltree[t*2]!==0)return x0;if(i.dyn_ltree[9*2]!==0||i.dyn_ltree[10*2]!==0||i.dyn_ltree[13*2]!==0)return S0;for(t=32;t<Al;t++)if(i.dyn_ltree[t*2]!==0)return S0;return x0};let V0=!1;const x2=i=>{V0||(E2(),V0=!0),i.l_desc=new Sd(i.dyn_ltree,L0),i.d_desc=new Sd(i.dyn_dtree,D0),i.bl_desc=new Sd(i.bl_tree,N0),i.bi_buf=0,i.bi_valid=0,F0(i)},W0=(i,e,t,n)=>{li(i,(f2<<1)+(n?1:0),3),Q0(i),_l(i,t),_l(i,~t),t&&i.pending_buf.set(i.window.subarray(e,e+t),i.pending),i.pending+=t},S2=i=>{li(i,w0<<1,3),ur(i,yd,Rr),v2(i)},w2=(i,e,t,n)=>{let r,o,l=0;i.level>0?(i.strm.data_type===u2&&(i.strm.data_type=I2(i)),Md(i,i.l_desc),Md(i,i.d_desc),l=y2(i),r=i.opt_len+3+7>>>3,o=i.static_len+3+7>>>3,o<=r&&(r=o)):r=o=t+5,t+4<=r&&e!==-1?W0(i,e,t,n):i.strategy===c2||o===r?(li(i,(w0<<1)+(n?1:0),3),z0(i,Rr,gl)):(li(i,(h2<<1)+(n?1:0),3),C2(i,i.l_desc.max_code+1,i.d_desc.max_code+1,l+1),z0(i,i.dyn_ltree,i.dyn_dtree)),F0(i),n&&Q0(i)},M2=(i,e,t)=>(i.pending_buf[i.sym_buf+i.sym_next++]=e,i.pending_buf[i.sym_buf+i.sym_next++]=e>>8,i.pending_buf[i.sym_buf+i.sym_next++]=t,e===0?i.dyn_ltree[t*2]++:(i.matches++,e--,i.dyn_ltree[(vl[t]+Al+1)*2]++,i.dyn_dtree[P0(e)*2]++),i.sym_next===i.sym_end);var T2=x2,B2=W0,R2=w2,b2=M2,L2=S2,D2={_tr_init:T2,_tr_stored_block:B2,_tr_flush_block:R2,_tr_tally:b2,_tr_align:L2},El=(i,e,t,n)=>{let r=i&65535|0,o=i>>>16&65535|0,l=0;for(;t!==0;){l=t>2e3?2e3:t,t-=l;do r=r+e[n++]|0,o=o+r|0;while(--l);r%=65521,o%=65521}return r|o<<16|0};const N2=()=>{let i,e=[];for(var t=0;t<256;t++){i=t;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;e[t]=i}return e},P2=new Uint32Array(N2());var Tn=(i,e,t,n)=>{const r=P2,o=n+t;i^=-1;for(let l=n;l<o;l++)i=i>>>8^r[(i^e[l])&255];return i^-1},Js={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"},$s={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:U2,_tr_stored_block:Td,_tr_flush_block:k2,_tr_tally:as,_tr_align:F2}=D2,{Z_NO_FLUSH:ls,Z_PARTIAL_FLUSH:Q2,Z_FULL_FLUSH:O2,Z_FINISH:Di,Z_BLOCK:j0,Z_OK:kn,Z_STREAM_END:Y0,Z_STREAM_ERROR:fr,Z_DATA_ERROR:z2,Z_BUF_ERROR:Bd,Z_DEFAULT_COMPRESSION:G2,Z_FILTERED:H2,Z_HUFFMAN_ONLY:Xc,Z_RLE:V2,Z_FIXED:W2,Z_DEFAULT_STRATEGY:j2,Z_UNKNOWN:Y2,Z_DEFLATED:Kc}=$s,q2=9,X2=15,K2=8,J2=29,Rd=256+1+J2,$2=30,Z2=19,eS=2*Rd+1,tS=15,St=3,cs=258,hr=cs+St+1,nS=32,Qo=42,bd=57,Ld=69,Dd=73,Nd=91,Pd=103,Zs=113,yl=666,Kn=1,Oo=2,eo=3,zo=4,iS=3,to=(i,e)=>(i.msg=Js[e],e),q0=i=>i*2-(i>4?9:0),us=i=>{let e=i.length;for(;--e>=0;)i[e]=0},rS=i=>{let e,t,n,r=i.w_size;e=i.hash_size,n=e;do t=i.head[--n],i.head[n]=t>=r?t-r:0;while(--e);e=r,n=e;do t=i.prev[--n],i.prev[n]=t>=r?t-r:0;while(--e)};let fs=(i,e,t)=>(e<<i.hash_shift^t)&i.hash_mask;const _i=i=>{const e=i.state;let t=e.pending;t>i.avail_out&&(t=i.avail_out),t!==0&&(i.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),i.next_out),i.next_out+=t,e.pending_out+=t,i.total_out+=t,i.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},Ei=(i,e)=>{k2(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,e),i.block_start=i.strstart,_i(i.strm)},Dt=(i,e)=>{i.pending_buf[i.pending++]=e},Cl=(i,e)=>{i.pending_buf[i.pending++]=e>>>8&255,i.pending_buf[i.pending++]=e&255},Ud=(i,e,t,n)=>{let r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,e.set(i.input.subarray(i.next_in,i.next_in+r),t),i.state.wrap===1?i.adler=El(i.adler,e,r,t):i.state.wrap===2&&(i.adler=Tn(i.adler,e,r,t)),i.next_in+=r,i.total_in+=r,r)},X0=(i,e)=>{let t=i.max_chain_length,n=i.strstart,r,o,l=i.prev_length,c=i.nice_match;const f=i.strstart>i.w_size-hr?i.strstart-(i.w_size-hr):0,u=i.window,d=i.w_mask,p=i.prev,A=i.strstart+cs;let g=u[n+l-1],E=u[n+l];i.prev_length>=i.good_match&&(t>>=2),c>i.lookahead&&(c=i.lookahead);do if(r=e,!(u[r+l]!==E||u[r+l-1]!==g||u[r]!==u[n]||u[++r]!==u[n+1])){n+=2,r++;do;while(u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&u[++n]===u[++r]&&n<A);if(o=cs-(A-n),n=A-cs,o>l){if(i.match_start=e,l=o,o>=c)break;g=u[n+l-1],E=u[n+l]}}while((e=p[e&d])>f&&--t!==0);return l<=i.lookahead?l:i.lookahead},Go=i=>{const e=i.w_size;let t,n,r;do{if(n=i.window_size-i.lookahead-i.strstart,i.strstart>=e+(e-hr)&&(i.window.set(i.window.subarray(e,e+e-n),0),i.match_start-=e,i.strstart-=e,i.block_start-=e,i.insert>i.strstart&&(i.insert=i.strstart),rS(i),n+=e),i.strm.avail_in===0)break;if(t=Ud(i.strm,i.window,i.strstart+i.lookahead,n),i.lookahead+=t,i.lookahead+i.insert>=St)for(r=i.strstart-i.insert,i.ins_h=i.window[r],i.ins_h=fs(i,i.ins_h,i.window[r+1]);i.insert&&(i.ins_h=fs(i,i.ins_h,i.window[r+St-1]),i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,i.insert--,!(i.lookahead+i.insert<St)););}while(i.lookahead<hr&&i.strm.avail_in!==0)},K0=(i,e)=>{let t=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,n,r,o,l=0,c=i.strm.avail_in;do{if(n=65535,o=i.bi_valid+42>>3,i.strm.avail_out<o||(o=i.strm.avail_out-o,r=i.strstart-i.block_start,n>r+i.strm.avail_in&&(n=r+i.strm.avail_in),n>o&&(n=o),n<t&&(n===0&&e!==Di||e===ls||n!==r+i.strm.avail_in)))break;l=e===Di&&n===r+i.strm.avail_in?1:0,Td(i,0,0,l),i.pending_buf[i.pending-4]=n,i.pending_buf[i.pending-3]=n>>8,i.pending_buf[i.pending-2]=~n,i.pending_buf[i.pending-1]=~n>>8,_i(i.strm),r&&(r>n&&(r=n),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+r),i.strm.next_out),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r,i.block_start+=r,n-=r),n&&(Ud(i.strm,i.strm.output,i.strm.next_out,n),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n)}while(l===0);return c-=i.strm.avail_in,c&&(c>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=c&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-c,i.strm.next_in),i.strstart),i.strstart+=c,i.insert+=c>i.w_size-i.insert?i.w_size-i.insert:c),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),l?zo:e!==ls&&e!==Di&&i.strm.avail_in===0&&i.strstart===i.block_start?Oo:(o=i.window_size-i.strstart,i.strm.avail_in>o&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,o+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),o>i.strm.avail_in&&(o=i.strm.avail_in),o&&(Ud(i.strm,i.window,i.strstart,o),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.high_water<i.strstart&&(i.high_water=i.strstart),o=i.bi_valid+42>>3,o=i.pending_buf_size-o>65535?65535:i.pending_buf_size-o,t=o>i.w_size?i.w_size:o,r=i.strstart-i.block_start,(r>=t||(r||e===Di)&&e!==ls&&i.strm.avail_in===0&&r<=o)&&(n=r>o?o:r,l=e===Di&&i.strm.avail_in===0&&n===r?1:0,Td(i,i.block_start,n,l),i.block_start+=n,_i(i.strm)),l?eo:Kn)},kd=(i,e)=>{let t,n;for(;;){if(i.lookahead<hr){if(Go(i),i.lookahead<hr&&e===ls)return Kn;if(i.lookahead===0)break}if(t=0,i.lookahead>=St&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),t!==0&&i.strstart-t<=i.w_size-hr&&(i.match_length=X0(i,t)),i.match_length>=St)if(n=as(i,i.strstart-i.match_start,i.match_length-St),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=St){i.match_length--;do i.strstart++,i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=fs(i,i.ins_h,i.window[i.strstart+1]);else n=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(n&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=i.strstart<St-1?i.strstart:St-1,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},Ho=(i,e)=>{let t,n,r;for(;;){if(i.lookahead<hr){if(Go(i),i.lookahead<hr&&e===ls)return Kn;if(i.lookahead===0)break}if(t=0,i.lookahead>=St&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=St-1,t!==0&&i.prev_length<i.max_lazy_match&&i.strstart-t<=i.w_size-hr&&(i.match_length=X0(i,t),i.match_length<=5&&(i.strategy===H2||i.match_length===St&&i.strstart-i.match_start>4096)&&(i.match_length=St-1)),i.prev_length>=St&&i.match_length<=i.prev_length){r=i.strstart+i.lookahead-St,n=as(i,i.strstart-1-i.prev_match,i.prev_length-St),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=r&&(i.ins_h=fs(i,i.ins_h,i.window[i.strstart+St-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=St-1,i.strstart++,n&&(Ei(i,!1),i.strm.avail_out===0))return Kn}else if(i.match_available){if(n=as(i,0,i.window[i.strstart-1]),n&&Ei(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return Kn}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(n=as(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<St-1?i.strstart:St-1,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},sS=(i,e)=>{let t,n,r,o;const l=i.window;for(;;){if(i.lookahead<=cs){if(Go(i),i.lookahead<=cs&&e===ls)return Kn;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=St&&i.strstart>0&&(r=i.strstart-1,n=l[r],n===l[++r]&&n===l[++r]&&n===l[++r])){o=i.strstart+cs;do;while(n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&n===l[++r]&&r<o);i.match_length=cs-(o-r),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=St?(t=as(i,1,i.match_length-St),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=0,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo},oS=(i,e)=>{let t;for(;;){if(i.lookahead===0&&(Go(i),i.lookahead===0)){if(e===ls)return Kn;break}if(i.match_length=0,t=as(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(Ei(i,!1),i.strm.avail_out===0))return Kn}return i.insert=0,e===Di?(Ei(i,!0),i.strm.avail_out===0?eo:zo):i.sym_next&&(Ei(i,!1),i.strm.avail_out===0)?Kn:Oo};function dr(i,e,t,n,r){this.good_length=i,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=r}const Il=[new dr(0,0,0,0,K0),new dr(4,4,8,4,kd),new dr(4,5,16,8,kd),new dr(4,6,32,32,kd),new dr(4,4,16,16,Ho),new dr(8,16,32,32,Ho),new dr(8,16,128,128,Ho),new dr(8,32,128,256,Ho),new dr(32,128,258,1024,Ho),new dr(32,258,258,4096,Ho)],aS=i=>{i.window_size=2*i.w_size,us(i.head),i.max_lazy_match=Il[i.level].max_lazy,i.good_match=Il[i.level].good_length,i.nice_match=Il[i.level].nice_length,i.max_chain_length=Il[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=St-1,i.match_available=0,i.ins_h=0};function lS(){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=Kc,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(eS*2),this.dyn_dtree=new Uint16Array((2*$2+1)*2),this.bl_tree=new Uint16Array((2*Z2+1)*2),us(this.dyn_ltree),us(this.dyn_dtree),us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(tS+1),this.heap=new Uint16Array(2*Rd+1),us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Rd+1),us(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 xl=i=>{if(!i)return 1;const e=i.state;return!e||e.strm!==i||e.status!==Qo&&e.status!==bd&&e.status!==Ld&&e.status!==Dd&&e.status!==Nd&&e.status!==Pd&&e.status!==Zs&&e.status!==yl?1:0},J0=i=>{if(xl(i))return to(i,fr);i.total_in=i.total_out=0,i.data_type=Y2;const e=i.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?bd:e.wrap?Qo:Zs,i.adler=e.wrap===2?0:1,e.last_flush=-2,U2(e),kn},$0=i=>{const e=J0(i);return e===kn&&aS(i.state),e},cS=(i,e)=>xl(i)||i.state.wrap!==2?fr:(i.state.gzhead=e,kn),Z0=(i,e,t,n,r,o)=>{if(!i)return fr;let l=1;if(e===G2&&(e=6),n<0?(l=0,n=-n):n>15&&(l=2,n-=16),r<1||r>q2||t!==Kc||n<8||n>15||e<0||e>9||o<0||o>W2||n===8&&l!==1)return to(i,fr);n===8&&(n=9);const c=new lS;return i.state=c,c.strm=i,c.status=Qo,c.wrap=l,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=r+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+St-1)/St),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<<r+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=o,c.method=t,$0(i)},uS=(i,e)=>Z0(i,e,Kc,X2,K2,j2),fS=(i,e)=>{if(xl(i)||e>j0||e<0)return i?to(i,fr):fr;const t=i.state;if(!i.output||i.avail_in!==0&&!i.input||t.status===yl&&e!==Di)return to(i,i.avail_out===0?Bd:fr);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(_i(i),i.avail_out===0)return t.last_flush=-1,kn}else if(i.avail_in===0&&q0(e)<=q0(n)&&e!==Di)return to(i,Bd);if(t.status===yl&&i.avail_in!==0)return to(i,Bd);if(t.status===Qo&&t.wrap===0&&(t.status=Zs),t.status===Qo){let r=Kc+(t.w_bits-8<<4)<<8,o=-1;if(t.strategy>=Xc||t.level<2?o=0:t.level<6?o=1:t.level===6?o=2:o=3,r|=o<<6,t.strstart!==0&&(r|=nS),r+=31-r%31,Cl(t,r),t.strstart!==0&&(Cl(t,i.adler>>>16),Cl(t,i.adler&65535)),i.adler=1,t.status=Zs,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(t.status===bd){if(i.adler=0,Dt(t,31),Dt(t,139),Dt(t,8),t.gzhead)Dt(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)),Dt(t,t.gzhead.time&255),Dt(t,t.gzhead.time>>8&255),Dt(t,t.gzhead.time>>16&255),Dt(t,t.gzhead.time>>24&255),Dt(t,t.level===9?2:t.strategy>=Xc||t.level<2?4:0),Dt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Dt(t,t.gzhead.extra.length&255),Dt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(i.adler=Tn(i.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Ld;else if(Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,t.level===9?2:t.strategy>=Xc||t.level<2?4:0),Dt(t,iS),t.status=Zs,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(t.status===Ld){if(t.gzhead.extra){let r=t.pending,o=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+o>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>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex+=c,_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0,o-=c}let l=new Uint8Array(t.gzhead.extra);t.pending_buf.set(l.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending+=o,t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Dd}if(t.status===Dd){if(t.gzhead.name){let r=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0}t.gzindex<t.gzhead.name.length?o=t.gzhead.name.charCodeAt(t.gzindex++)&255:o=0,Dt(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),t.gzindex=0}t.status=Nd}if(t.status===Nd){if(t.gzhead.comment){let r=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r)),_i(i),t.pending!==0)return t.last_flush=-1,kn;r=0}t.gzindex<t.gzhead.comment.length?o=t.gzhead.comment.charCodeAt(t.gzindex++)&255:o=0,Dt(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>r&&(i.adler=Tn(i.adler,t.pending_buf,t.pending-r,r))}t.status=Pd}if(t.status===Pd){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(_i(i),t.pending!==0))return t.last_flush=-1,kn;Dt(t,i.adler&255),Dt(t,i.adler>>8&255),i.adler=0}if(t.status=Zs,_i(i),t.pending!==0)return t.last_flush=-1,kn}if(i.avail_in!==0||t.lookahead!==0||e!==ls&&t.status!==yl){let r=t.level===0?K0(t,e):t.strategy===Xc?oS(t,e):t.strategy===V2?sS(t,e):Il[t.level].func(t,e);if((r===eo||r===zo)&&(t.status=yl),r===Kn||r===eo)return i.avail_out===0&&(t.last_flush=-1),kn;if(r===Oo&&(e===Q2?F2(t):e!==j0&&(Td(t,0,0,!1),e===O2&&(us(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),_i(i),i.avail_out===0))return t.last_flush=-1,kn}return e!==Di?kn:t.wrap<=0?Y0:(t.wrap===2?(Dt(t,i.adler&255),Dt(t,i.adler>>8&255),Dt(t,i.adler>>16&255),Dt(t,i.adler>>24&255),Dt(t,i.total_in&255),Dt(t,i.total_in>>8&255),Dt(t,i.total_in>>16&255),Dt(t,i.total_in>>24&255)):(Cl(t,i.adler>>>16),Cl(t,i.adler&65535)),_i(i),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?kn:Y0)},hS=i=>{if(xl(i))return fr;const e=i.state.status;return i.state=null,e===Zs?to(i,z2):kn},dS=(i,e)=>{let t=e.length;if(xl(i))return fr;const n=i.state,r=n.wrap;if(r===2||r===1&&n.status!==Qo||n.lookahead)return fr;if(r===1&&(i.adler=El(i.adler,e,t,0)),n.wrap=0,t>=n.w_size){r===0&&(us(n.head),n.strstart=0,n.block_start=0,n.insert=0);let f=new Uint8Array(n.w_size);f.set(e.subarray(t-n.w_size,t),0),e=f,t=n.w_size}const o=i.avail_in,l=i.next_in,c=i.input;for(i.avail_in=t,i.next_in=0,i.input=e,Go(n);n.lookahead>=St;){let f=n.strstart,u=n.lookahead-(St-1);do n.ins_h=fs(n,n.ins_h,n.window[f+St-1]),n.prev[f&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=f,f++;while(--u);n.strstart=f,n.lookahead=St-1,Go(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=St-1,n.match_available=0,i.next_in=l,i.input=c,i.avail_in=o,n.wrap=r,kn};var AS=uS,pS=Z0,gS=$0,mS=J0,vS=cS,_S=fS,ES=hS,yS=dS,CS="pako deflate (from Nodeca project)",Sl={deflateInit:AS,deflateInit2:pS,deflateReset:gS,deflateResetKeep:mS,deflateSetHeader:vS,deflate:_S,deflateEnd:ES,deflateSetDictionary:yS,deflateInfo:CS};const IS=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);var xS=function(i){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)IS(t,n)&&(i[n]=t[n])}}return i},SS=i=>{let e=0;for(let n=0,r=i.length;n<r;n++)e+=i[n].length;const t=new Uint8Array(e);for(let n=0,r=0,o=i.length;n<o;n++){let l=i[n];t.set(l,r),r+=l.length}return t},Jc={assign:xS,flattenChunks:SS};let ev=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ev=!1}const wl=new Uint8Array(256);for(let i=0;i<256;i++)wl[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;wl[254]=wl[254]=1;var wS=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let e,t,n,r,o,l=i.length,c=0;for(r=0;r<l;r++)t=i.charCodeAt(r),(t&64512)===55296&&r+1<l&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),c+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(c),o=0,r=0;o<c;r++)t=i.charCodeAt(r),(t&64512)===55296&&r+1<l&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),r++)),t<128?e[o++]=t:t<2048?(e[o++]=192|t>>>6,e[o++]=128|t&63):t<65536?(e[o++]=224|t>>>12,e[o++]=128|t>>>6&63,e[o++]=128|t&63):(e[o++]=240|t>>>18,e[o++]=128|t>>>12&63,e[o++]=128|t>>>6&63,e[o++]=128|t&63);return e};const MS=(i,e)=>{if(e<65534&&i.subarray&&ev)return String.fromCharCode.apply(null,i.length===e?i:i.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(i[n]);return t};var TS=(i,e)=>{const t=e||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,e));let n,r;const o=new Array(t*2);for(r=0,n=0;n<t;){let l=i[n++];if(l<128){o[r++]=l;continue}let c=wl[l];if(c>4){o[r++]=65533,n+=c-1;continue}for(l&=c===2?31:c===3?15:7;c>1&&n<t;)l=l<<6|i[n++]&63,c--;if(c>1){o[r++]=65533;continue}l<65536?o[r++]=l:(l-=65536,o[r++]=55296|l>>10&1023,o[r++]=56320|l&1023)}return MS(o,r)},BS=(i,e)=>{e=e||i.length,e>i.length&&(e=i.length);let t=e-1;for(;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+wl[i[t]]>e?t:e},Ml={string2buf:wS,buf2string:TS,utf8border:BS};function RS(){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 tv=RS;const nv=Object.prototype.toString,{Z_NO_FLUSH:bS,Z_SYNC_FLUSH:LS,Z_FULL_FLUSH:DS,Z_FINISH:NS,Z_OK:$c,Z_STREAM_END:PS,Z_DEFAULT_COMPRESSION:US,Z_DEFAULT_STRATEGY:kS,Z_DEFLATED:FS}=$s;function Tl(i){this.options=Jc.assign({level:US,method:FS,chunkSize:16384,windowBits:15,memLevel:8,strategy:kS},i||{});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 tv,this.strm.avail_out=0;let t=Sl.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==$c)throw new Error(Js[t]);if(e.header&&Sl.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ml.string2buf(e.dictionary):nv.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Sl.deflateSetDictionary(this.strm,n),t!==$c)throw new Error(Js[t]);this._dict_set=!0}}Tl.prototype.push=function(i,e){const t=this.strm,n=this.options.chunkSize;let r,o;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?NS:bS,typeof i=="string"?t.input=Ml.string2buf(i):nv.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,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),(o===LS||o===DS)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=Sl.deflate(t,o),r===PS)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=Sl.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===$c;if(t.avail_out===0){this.onData(t.output);continue}if(o>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},Tl.prototype.onData=function(i){this.chunks.push(i)},Tl.prototype.onEnd=function(i){i===$c&&(this.result=Jc.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function Fd(i,e){const t=new Tl(e);if(t.push(i,!0),t.err)throw t.msg||Js[t.err];return t.result}function QS(i,e){return e=e||{},e.raw=!0,Fd(i,e)}function OS(i,e){return e=e||{},e.gzip=!0,Fd(i,e)}var zS=Tl,GS=Fd,HS=QS,VS=OS,WS=$s,jS={Deflate:zS,deflate:GS,deflateRaw:HS,gzip:VS,constants:WS};const Zc=16209,YS=16191;var qS=function(e,t){let n,r,o,l,c,f,u,d,p,A,g,E,C,_,v,x,y,S,w,b,B,L,R,T;const N=e.state;n=e.next_in,R=e.input,r=n+(e.avail_in-5),o=e.next_out,T=e.output,l=o-(t-e.avail_out),c=o+(e.avail_out-257),f=N.dmax,u=N.wsize,d=N.whave,p=N.wnext,A=N.window,g=N.hold,E=N.bits,C=N.lencode,_=N.distcode,v=(1<<N.lenbits)-1,x=(1<<N.distbits)-1;e:do{E<15&&(g+=R[n++]<<E,E+=8,g+=R[n++]<<E,E+=8),y=C[g&v];t:for(;;){if(S=y>>>24,g>>>=S,E-=S,S=y>>>16&255,S===0)T[o++]=y&65535;else if(S&16){w=y&65535,S&=15,S&&(E<S&&(g+=R[n++]<<E,E+=8),w+=g&(1<<S)-1,g>>>=S,E-=S),E<15&&(g+=R[n++]<<E,E+=8,g+=R[n++]<<E,E+=8),y=_[g&x];n:for(;;){if(S=y>>>24,g>>>=S,E-=S,S=y>>>16&255,S&16){if(b=y&65535,S&=15,E<S&&(g+=R[n++]<<E,E+=8,E<S&&(g+=R[n++]<<E,E+=8)),b+=g&(1<<S)-1,b>f){e.msg="invalid distance too far back",N.mode=Zc;break e}if(g>>>=S,E-=S,S=o-l,b>S){if(S=b-S,S>d&&N.sane){e.msg="invalid distance too far back",N.mode=Zc;break e}if(B=0,L=A,p===0){if(B+=u-S,S<w){w-=S;do T[o++]=A[B++];while(--S);B=o-b,L=T}}else if(p<S){if(B+=u+p-S,S-=p,S<w){w-=S;do T[o++]=A[B++];while(--S);if(B=0,p<w){S=p,w-=S;do T[o++]=A[B++];while(--S);B=o-b,L=T}}}else if(B+=p-S,S<w){w-=S;do T[o++]=A[B++];while(--S);B=o-b,L=T}for(;w>2;)T[o++]=L[B++],T[o++]=L[B++],T[o++]=L[B++],w-=3;w&&(T[o++]=L[B++],w>1&&(T[o++]=L[B++]))}else{B=o-b;do T[o++]=T[B++],T[o++]=T[B++],T[o++]=T[B++],w-=3;while(w>2);w&&(T[o++]=T[B++],w>1&&(T[o++]=T[B++]))}}else if(S&64){e.msg="invalid distance code",N.mode=Zc;break e}else{y=_[(y&65535)+(g&(1<<S)-1)];continue n}break}}else if(S&64)if(S&32){N.mode=YS;break e}else{e.msg="invalid literal/length code",N.mode=Zc;break e}else{y=C[(y&65535)+(g&(1<<S)-1)];continue t}break}}while(n<r&&o<c);w=E>>3,n-=w,E-=w<<3,g&=(1<<E)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=o<c?257+(c-o):257-(o-c),N.hold=g,N.bits=E};const Vo=15,iv=852,rv=592,sv=0,Qd=1,ov=2,XS=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]),KS=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]),JS=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]),$S=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 Bl=(i,e,t,n,r,o,l,c)=>{const f=c.bits;let u=0,d=0,p=0,A=0,g=0,E=0,C=0,_=0,v=0,x=0,y,S,w,b,B,L=null,R;const T=new Uint16Array(Vo+1),N=new Uint16Array(Vo+1);let k=null,O,F,V;for(u=0;u<=Vo;u++)T[u]=0;for(d=0;d<n;d++)T[e[t+d]]++;for(g=f,A=Vo;A>=1&&T[A]===0;A--);if(g>A&&(g=A),A===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,c.bits=1,0;for(p=1;p<A&&T[p]===0;p++);for(g<p&&(g=p),_=1,u=1;u<=Vo;u++)if(_<<=1,_-=T[u],_<0)return-1;if(_>0&&(i===sv||A!==1))return-1;for(N[1]=0,u=1;u<Vo;u++)N[u+1]=N[u]+T[u];for(d=0;d<n;d++)e[t+d]!==0&&(l[N[e[t+d]]++]=d);if(i===sv?(L=k=l,R=20):i===Qd?(L=XS,k=KS,R=257):(L=JS,k=$S,R=0),x=0,d=0,u=p,B=o,E=g,C=0,w=-1,v=1<<g,b=v-1,i===Qd&&v>iv||i===ov&&v>rv)return 1;for(;;){O=u-C,l[d]+1<R?(F=0,V=l[d]):l[d]>=R?(F=k[l[d]-R],V=L[l[d]-R]):(F=32+64,V=0),y=1<<u-C,S=1<<E,p=S;do S-=y,r[B+(x>>C)+S]=O<<24|F<<16|V|0;while(S!==0);for(y=1<<u-1;x&y;)y>>=1;if(y!==0?(x&=y-1,x+=y):x=0,d++,--T[u]===0){if(u===A)break;u=e[t+l[d]]}if(u>g&&(x&b)!==w){for(C===0&&(C=g),B+=p,E=u-C,_=1<<E;E+C<A&&(_-=T[E+C],!(_<=0));)E++,_<<=1;if(v+=1<<E,i===Qd&&v>iv||i===ov&&v>rv)return 1;w=x&b,r[w]=g<<24|E<<16|B-o|0}}return x!==0&&(r[B+x]=u-C<<24|64<<16|0),c.bits=g,0};const ZS=0,av=1,lv=2,{Z_FINISH:cv,Z_BLOCK:ew,Z_TREES:eu,Z_OK:no,Z_STREAM_END:tw,Z_NEED_DICT:nw,Z_STREAM_ERROR:Ni,Z_DATA_ERROR:uv,Z_MEM_ERROR:fv,Z_BUF_ERROR:iw,Z_DEFLATED:hv}=$s,tu=16180,dv=16181,Av=16182,pv=16183,gv=16184,mv=16185,vv=16186,_v=16187,Ev=16188,yv=16189,nu=16190,br=16191,Od=16192,Cv=16193,zd=16194,Iv=16195,xv=16196,Sv=16197,wv=16198,iu=16199,ru=16200,Mv=16201,Tv=16202,Bv=16203,Rv=16204,bv=16205,Gd=16206,Lv=16207,Dv=16208,Zt=16209,Nv=16210,Pv=16211,rw=852,sw=592,ow=15,Uv=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function aw(){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 io=i=>{if(!i)return 1;const e=i.state;return!e||e.strm!==i||e.mode<tu||e.mode>Pv?1:0},kv=i=>{if(io(i))return Ni;const e=i.state;return i.total_in=i.total_out=e.total=0,i.msg="",e.wrap&&(i.adler=e.wrap&1),e.mode=tu,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(rw),e.distcode=e.distdyn=new Int32Array(sw),e.sane=1,e.back=-1,no},Fv=i=>{if(io(i))return Ni;const e=i.state;return e.wsize=0,e.whave=0,e.wnext=0,kv(i)},Qv=(i,e)=>{let t;if(io(i))return Ni;const n=i.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ni:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Fv(i))},Ov=(i,e)=>{if(!i)return Ni;const t=new aw;i.state=t,t.strm=i,t.window=null,t.mode=tu;const n=Qv(i,e);return n!==no&&(i.state=null),n},lw=i=>Ov(i,ow);let zv=!0,Hd,Vd;const cw=i=>{if(zv){Hd=new Int32Array(512),Vd=new Int32Array(32);let e=0;for(;e<144;)i.lens[e++]=8;for(;e<256;)i.lens[e++]=9;for(;e<280;)i.lens[e++]=7;for(;e<288;)i.lens[e++]=8;for(Bl(av,i.lens,0,288,Hd,0,i.work,{bits:9}),e=0;e<32;)i.lens[e++]=5;Bl(lv,i.lens,0,32,Vd,0,i.work,{bits:5}),zv=!1}i.lencode=Hd,i.lenbits=9,i.distcode=Vd,i.distbits=5},Gv=(i,e,t,n)=>{let r;const o=i.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(t-o.wsize,t),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>n&&(r=n),o.window.set(e.subarray(t-n,t-n+r),o.wnext),n-=r,n?(o.window.set(e.subarray(t-n,t),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},uw=(i,e)=>{let t,n,r,o,l,c,f,u,d,p,A,g,E,C,_=0,v,x,y,S,w,b,B,L;const R=new Uint8Array(4);let T,N;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(io(i)||!i.output||!i.input&&i.avail_in!==0)return Ni;t=i.state,t.mode===br&&(t.mode=Od),l=i.next_out,r=i.output,f=i.avail_out,o=i.next_in,n=i.input,c=i.avail_in,u=t.hold,d=t.bits,p=c,A=f,L=no;e:for(;;)switch(t.mode){case tu:if(t.wrap===0){t.mode=Od;break}for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0),u=0,d=0,t.mode=dv;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){i.msg="incorrect header check",t.mode=Zt;break}if((u&15)!==hv){i.msg="unknown compression method",t.mode=Zt;break}if(u>>>=4,d-=4,B=(u&15)+8,t.wbits===0&&(t.wbits=B),B>15||B>t.wbits){i.msg="invalid window size",t.mode=Zt;break}t.dmax=1<<t.wbits,t.flags=0,i.adler=t.check=1,t.mode=u&512?yv:br,u=0,d=0;break;case dv:for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==hv){i.msg="unknown compression method",t.mode=Zt;break}if(t.flags&57344){i.msg="unknown header flags set",t.mode=Zt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0,t.mode=Av;case Av:for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,t.check=Tn(t.check,R,4,0)),u=0,d=0,t.mode=pv;case pv:for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0,t.mode=gv;case gv:if(t.flags&1024){for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,t.check=Tn(t.check,R,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=mv;case mv:if(t.flags&1024&&(g=t.length,g>c&&(g=c),g&&(t.head&&(B=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(o,o+g),B)),t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,t.length-=g),t.length))break e;t.length=0,t.mode=vv;case vv:if(t.flags&2048){if(c===0)break e;g=0;do B=n[o+g++],t.head&&B&&t.length<65536&&(t.head.name+=String.fromCharCode(B));while(B&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,B)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=_v;case _v:if(t.flags&4096){if(c===0)break e;g=0;do B=n[o+g++],t.head&&B&&t.length<65536&&(t.head.comment+=String.fromCharCode(B));while(B&&g<c);if(t.flags&512&&t.wrap&4&&(t.check=Tn(t.check,n,g,o)),c-=g,o+=g,B)break e}else t.head&&(t.head.comment=null);t.mode=Ev;case Ev:if(t.flags&512){for(;d<16;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){i.msg="header crc mismatch",t.mode=Zt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),i.adler=t.check=0,t.mode=br;break;case yv:for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}i.adler=t.check=Uv(u),u=0,d=0,t.mode=nu;case nu:if(t.havedict===0)return i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,nw;i.adler=t.check=1,t.mode=br;case br:if(e===ew||e===eu)break e;case Od:if(t.last){u>>>=d&7,d-=d&7,t.mode=Gd;break}for(;d<3;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=Cv;break;case 1:if(cw(t),t.mode=iu,e===eu){u>>>=2,d-=2;break e}break;case 2:t.mode=xv;break;case 3:i.msg="invalid block type",t.mode=Zt}u>>>=2,d-=2;break;case Cv:for(u>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){i.msg="invalid stored block lengths",t.mode=Zt;break}if(t.length=u&65535,u=0,d=0,t.mode=zd,e===eu)break e;case zd:t.mode=Iv;case Iv:if(g=t.length,g){if(g>c&&(g=c),g>f&&(g=f),g===0)break e;r.set(n.subarray(o,o+g),l),c-=g,o+=g,f-=g,l+=g,t.length-=g;break}t.mode=br;break;case xv:for(;d<14;){if(c===0)break e;c--,u+=n[o++]<<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){i.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=Sv;case Sv:for(;t.have<t.ncode;){for(;d<3;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}t.lens[k[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[k[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,T={bits:t.lenbits},L=Bl(ZS,t.lens,0,19,t.lencode,0,t.work,T),t.lenbits=T.bits,L){i.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=wv;case wv:for(;t.have<t.nlen+t.ndist;){for(;_=t.lencode[u&(1<<t.lenbits)-1],v=_>>>24,x=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(y<16)u>>>=v,d-=v,t.lens[t.have++]=y;else{if(y===16){for(N=v+2;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(u>>>=v,d-=v,t.have===0){i.msg="invalid bit length repeat",t.mode=Zt;break}B=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(y===17){for(N=v+3;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=v,d-=v,B=0,g=3+(u&7),u>>>=3,d-=3}else{for(N=v+7;d<N;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=v,d-=v,B=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){i.msg="invalid bit length repeat",t.mode=Zt;break}for(;g--;)t.lens[t.have++]=B}}if(t.mode===Zt)break;if(t.lens[256]===0){i.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,T={bits:t.lenbits},L=Bl(av,t.lens,0,t.nlen,t.lencode,0,t.work,T),t.lenbits=T.bits,L){i.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,T={bits:t.distbits},L=Bl(lv,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,T),t.distbits=T.bits,L){i.msg="invalid distances set",t.mode=Zt;break}if(t.mode=iu,e===eu)break e;case iu:t.mode=ru;case ru:if(c>=6&&f>=258){i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,qS(i,A),l=i.next_out,r=i.output,f=i.avail_out,o=i.next_in,n=i.input,c=i.avail_in,u=t.hold,d=t.bits,t.mode===br&&(t.back=-1);break}for(t.back=0;_=t.lencode[u&(1<<t.lenbits)-1],v=_>>>24,x=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(x&&!(x&240)){for(S=v,w=x,b=y;_=t.lencode[b+((u&(1<<S+w)-1)>>S)],v=_>>>24,x=_>>>16&255,y=_&65535,!(S+v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=S,d-=S,t.back+=S}if(u>>>=v,d-=v,t.back+=v,t.length=y,x===0){t.mode=bv;break}if(x&32){t.back=-1,t.mode=br;break}if(x&64){i.msg="invalid literal/length code",t.mode=Zt;break}t.extra=x&15,t.mode=Mv;case Mv:if(t.extra){for(N=t.extra;d<N;){if(c===0)break e;c--,u+=n[o++]<<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=Tv;case Tv:for(;_=t.distcode[u&(1<<t.distbits)-1],v=_>>>24,x=_>>>16&255,y=_&65535,!(v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(!(x&240)){for(S=v,w=x,b=y;_=t.distcode[b+((u&(1<<S+w)-1)>>S)],v=_>>>24,x=_>>>16&255,y=_&65535,!(S+v<=d);){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}u>>>=S,d-=S,t.back+=S}if(u>>>=v,d-=v,t.back+=v,x&64){i.msg="invalid distance code",t.mode=Zt;break}t.offset=y,t.extra=x&15,t.mode=Bv;case Bv:if(t.extra){for(N=t.extra;d<N;){if(c===0)break e;c--,u+=n[o++]<<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){i.msg="invalid distance too far back",t.mode=Zt;break}t.mode=Rv;case Rv:if(f===0)break e;if(g=A-f,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){i.msg="invalid distance too far back",t.mode=Zt;break}g>t.wnext?(g-=t.wnext,E=t.wsize-g):E=t.wnext-g,g>t.length&&(g=t.length),C=t.window}else C=r,E=l-t.offset,g=t.length;g>f&&(g=f),f-=g,t.length-=g;do r[l++]=C[E++];while(--g);t.length===0&&(t.mode=ru);break;case bv:if(f===0)break e;r[l++]=t.length,f--,t.mode=ru;break;case Gd:if(t.wrap){for(;d<32;){if(c===0)break e;c--,u|=n[o++]<<d,d+=8}if(A-=f,i.total_out+=A,t.total+=A,t.wrap&4&&A&&(i.adler=t.check=t.flags?Tn(t.check,r,A,l-A):El(t.check,r,A,l-A)),A=f,t.wrap&4&&(t.flags?u:Uv(u))!==t.check){i.msg="incorrect data check",t.mode=Zt;break}u=0,d=0}t.mode=Lv;case Lv:if(t.wrap&&t.flags){for(;d<32;){if(c===0)break e;c--,u+=n[o++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){i.msg="incorrect length check",t.mode=Zt;break}u=0,d=0}t.mode=Dv;case Dv:L=tw;break e;case Zt:L=uv;break e;case Nv:return fv;case Pv:default:return Ni}return i.next_out=l,i.avail_out=f,i.next_in=o,i.avail_in=c,t.hold=u,t.bits=d,(t.wsize||A!==i.avail_out&&t.mode<Zt&&(t.mode<Gd||e!==cv))&&Gv(i,i.output,i.next_out,A-i.avail_out),p-=i.avail_in,A-=i.avail_out,i.total_in+=p,i.total_out+=A,t.total+=A,t.wrap&4&&A&&(i.adler=t.check=t.flags?Tn(t.check,r,A,i.next_out-A):El(t.check,r,A,i.next_out-A)),i.data_type=t.bits+(t.last?64:0)+(t.mode===br?128:0)+(t.mode===iu||t.mode===zd?256:0),(p===0&&A===0||e===cv)&&L===no&&(L=iw),L},fw=i=>{if(io(i))return Ni;let e=i.state;return e.window&&(e.window=null),i.state=null,no},hw=(i,e)=>{if(io(i))return Ni;const t=i.state;return t.wrap&2?(t.head=e,e.done=!1,no):Ni},dw=(i,e)=>{const t=e.length;let n,r,o;return io(i)||(n=i.state,n.wrap!==0&&n.mode!==nu)?Ni:n.mode===nu&&(r=1,r=El(r,e,t,0),r!==n.check)?uv:(o=Gv(i,e,t,t),o?(n.mode=Nv,fv):(n.havedict=1,no))};var Aw=Fv,pw=Qv,gw=kv,mw=lw,vw=Ov,_w=uw,Ew=fw,yw=hw,Cw=dw,Iw="pako inflate (from Nodeca project)",Lr={inflateReset:Aw,inflateReset2:pw,inflateResetKeep:gw,inflateInit:mw,inflateInit2:vw,inflate:_w,inflateEnd:Ew,inflateGetHeader:yw,inflateSetDictionary:Cw,inflateInfo:Iw};function xw(){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 Sw=xw;const Hv=Object.prototype.toString,{Z_NO_FLUSH:ww,Z_FINISH:Mw,Z_OK:Rl,Z_STREAM_END:Wd,Z_NEED_DICT:jd,Z_STREAM_ERROR:Tw,Z_DATA_ERROR:Vv,Z_MEM_ERROR:Bw}=$s;function bl(i){this.options=Jc.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});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&&!(i&&i.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 tv,this.strm.avail_out=0;let t=Lr.inflateInit2(this.strm,e.windowBits);if(t!==Rl)throw new Error(Js[t]);if(this.header=new Sw,Lr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ml.string2buf(e.dictionary):Hv.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Lr.inflateSetDictionary(this.strm,e.dictionary),t!==Rl)))throw new Error(Js[t])}bl.prototype.push=function(i,e){const t=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let o,l,c;if(this.ended)return!1;for(e===~~e?l=e:l=e===!0?Mw:ww,Hv.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,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),o=Lr.inflate(t,l),o===jd&&r&&(o=Lr.inflateSetDictionary(t,r),o===Rl?o=Lr.inflate(t,l):o===Vv&&(o=jd));t.avail_in>0&&o===Wd&&t.state.wrap>0&&i[t.next_in]!==0;)Lr.inflateReset(t),o=Lr.inflate(t,l);switch(o){case Tw:case Vv:case jd:case Bw:return this.onEnd(o),this.ended=!0,!1}if(c=t.avail_out,t.next_out&&(t.avail_out===0||o===Wd))if(this.options.to==="string"){let f=Ml.utf8border(t.output,t.next_out),u=t.next_out-f,d=Ml.buf2string(t.output,f);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(f,f+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(o===Rl&&c===0)){if(o===Wd)return o=Lr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},bl.prototype.onData=function(i){this.chunks.push(i)},bl.prototype.onEnd=function(i){i===Rl&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Jc.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function Yd(i,e){const t=new bl(e);if(t.push(i),t.err)throw t.msg||Js[t.err];return t.result}function Rw(i,e){return e=e||{},e.raw=!0,Yd(i,e)}var bw=bl,Lw=Yd,Dw=Rw,Nw=Yd,Pw=$s,Uw={Inflate:bw,inflate:Lw,inflateRaw:Dw,ungzip:Nw,constants:Pw};const{Deflate:kw,deflate:Fw,deflateRaw:Qw,gzip:Ow}=jS,{Inflate:zw,inflate:Gw,inflateRaw:Hw,ungzip:Vw}=Uw;var Ww=kw,jw=Fw,Yw=Qw,qw=Ow,Xw=zw,Kw=Gw,Jw=Hw,$w=Vw,Zw=$s,eM={Deflate:Ww,deflate:jw,deflateRaw:Yw,gzip:qw,Inflate:Xw,inflate:Kw,inflateRaw:Jw,ungzip:$w,constants:Zw},tM=i=>{if(i===""||!i)return"";let e=i.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(md.MD5(t))};async function nM(i){return await(await fetch(i,{method:"GET"})).arrayBuffer()}function iM(i){return eM.ungzip(i,{to:"string"})}var rM=i=>{let e=window.atob(i),t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r+=1)n[r]=e.charCodeAt(r);return n.buffer};async function sM(i,e){let t=tM(e),n=md.AES.decrypt(i,t).toString(md.enc.Latin1);return rM(n)}async function oM(i,e){let t=e||`org/${i.split("org/")[1].split("/universal")[0]}`,n=Date.now(),r=await nM(i),o=Date.now()-n;n=Date.now();let l=iM(r),c=Date.now()-n;n=Date.now();let f=await sM(l,t),u=Date.now()-n;return{decodedData:f,events:{fileDownloadTime:o,fileUnzipTime:c,fileDecryptionTime:u}}}var aM=oM;/**
33
33
  * @license
34
34
  * Copyright 2010-2023 Three.js Authors
35
35
  * SPDX-License-Identifier: MIT
36
- */const su="158",Wo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},jo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lM=0,Wv=1,cM=2,jv=1,uM=2,Dr=3,ji=0,Bn=1,Yi=2,Nr=0,Yo=1,Yv=2,qv=3,Xv=4,fM=5,ro=100,hM=101,dM=102,Kv=103,Jv=104,AM=200,pM=201,gM=202,mM=203,qd=204,Xd=205,vM=206,_M=207,EM=208,yM=209,CM=210,IM=211,xM=212,SM=213,wM=214,MM=0,TM=1,BM=2,ou=3,RM=4,bM=5,LM=6,DM=7,Zv=0,NM=1,PM=2,hs=0,$v=1,e1=2,t1=3,Kd=4,UM=5,n1="attached",kM="detached",i1=300,so=301,qo=302,Ll=303,Jd=304,au=306,Xo=1e3,Fn=1001,lu=1002,qt=1003,Zd=1004,cu=1005,un=1006,r1=1007,Pr=1008,fn=1009,$d=1010,s1=1011,uu=1012,Dl=1013,yi=1014,hn=1015,Jn=1016,o1=1017,a1=1018,oo=1020,FM=1021,on=1023,QM=1024,OM=1025,ao=1026,Ko=1027,lo=1028,eA=1029,co=1030,fu=1031,Nl=1033,hu=33776,tA=33777,nA=33778,du=33779,iA=35840,l1=35841,rA=35842,c1=35843,u1=36196,sA=37492,oA=37496,aA=37808,f1=37809,h1=37810,d1=37811,Au=37812,A1=37813,p1=37814,g1=37815,m1=37816,v1=37817,_1=37818,E1=37819,y1=37820,C1=37821,pu=36492,I1=36494,x1=36495,zM=36283,S1=36284,w1=36285,M1=36286,Pl=2300,Jo=2301,lA=2302,T1=2400,B1=2401,R1=2402,GM=2500,HM=0,b1=1,cA=2,L1=3e3,uo=3001,VM=3200,WM=3201,D1=0,jM=1,ci="",Xt="srgb",En="srgb-linear",gu="display-p3",Ul="display-p3-linear",mu="linear",Vt="srgb",vu="rec709",_u="p3",Zo=7680,N1=519,YM=512,qM=513,XM=514,KM=515,JM=516,ZM=517,$M=518,e3=519,uA=35044,P1="300 es",fA=1035,Ur=2e3,Eu=2001;class fo{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 r=this._listeners[e];if(r!==void 0){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let o=0,l=r.length;o<l;o++)r[o].call(this,e);e.target=null}}}const Gn=["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 U1=1234567;const kl=Math.PI/180,$o=180/Math.PI;function qi(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Gn[i&255]+Gn[i>>8&255]+Gn[i>>16&255]+Gn[i>>24&255]+"-"+Gn[e&255]+Gn[e>>8&255]+"-"+Gn[e>>16&15|64]+Gn[e>>24&255]+"-"+Gn[t&63|128]+Gn[t>>8&255]+"-"+Gn[t>>16&255]+Gn[t>>24&255]+Gn[n&255]+Gn[n>>8&255]+Gn[n>>16&255]+Gn[n>>24&255]).toLowerCase()}function yn(i,e,t){return Math.max(e,Math.min(t,i))}function hA(i,e){return(i%e+e)%e}function t3(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function n3(i,e,t){return i!==e?(t-i)/(e-i):0}function Fl(i,e,t){return(1-t)*i+t*e}function i3(i,e,t,n){return Fl(i,e,1-Math.exp(-t*n))}function r3(i,e=1){return e-Math.abs(hA(i,e*2)-e)}function s3(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function o3(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function a3(i,e){return i+Math.floor(Math.random()*(e-i+1))}function l3(i,e){return i+Math.random()*(e-i)}function c3(i){return i*(.5-Math.random())}function u3(i){i!==void 0&&(U1=i);let e=U1+=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 f3(i){return i*kl}function h3(i){return i*$o}function dA(i){return(i&i-1)===0&&i!==0}function k1(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function yu(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function d3(i,e,t,n,r){const o=Math.cos,l=Math.sin,c=o(t/2),f=l(t/2),u=o((e+n)/2),d=l((e+n)/2),p=o((e-n)/2),A=l((e-n)/2),g=o((n-e)/2),E=l((n-e)/2);switch(r){case"XYX":i.set(c*d,f*p,f*A,c*u);break;case"YZY":i.set(f*A,c*d,f*p,c*u);break;case"ZXZ":i.set(f*p,f*A,c*d,c*u);break;case"XZX":i.set(c*d,f*E,f*g,c*u);break;case"YXY":i.set(f*g,c*d,f*E,c*u);break;case"ZYZ":i.set(f*E,f*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ar(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Ot(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const AA={DEG2RAD:kl,RAD2DEG:$o,generateUUID:qi,clamp:yn,euclideanModulo:hA,mapLinear:t3,inverseLerp:n3,lerp:Fl,damp:i3,pingpong:r3,smoothstep:s3,smootherstep:o3,randInt:a3,randFloat:l3,randFloatSpread:c3,seededRandom:u3,degToRad:f3,radToDeg:h3,isPowerOfTwo:dA,ceilPowerOfTwo:k1,floorPowerOfTwo:yu,setQuaternionFromProperEuler:d3,normalize:Ot,denormalize:Ar};class Ke{constructor(e=0,t=0){Ke.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(yn(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),r=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*n-l*r+e.x,this.y=o*r+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _t{constructor(e,t,n,r,o,l,c,f,u){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,o,l,c,f,u)}set(e,t,n,r,o,l,c,f,u){const d=this.elements;return d[0]=e,d[1]=r,d[2]=c,d[3]=t,d[4]=o,d[5]=f,d[6]=n,d[7]=l,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,r=t.elements,o=this.elements,l=n[0],c=n[3],f=n[6],u=n[1],d=n[4],p=n[7],A=n[2],g=n[5],E=n[8],C=r[0],_=r[3],v=r[6],S=r[1],y=r[4],x=r[7],w=r[2],b=r[5],B=r[8];return o[0]=l*C+c*S+f*w,o[3]=l*_+c*y+f*b,o[6]=l*v+c*x+f*B,o[1]=u*C+d*S+p*w,o[4]=u*_+d*y+p*b,o[7]=u*v+d*x+p*B,o[2]=A*C+g*S+E*w,o[5]=A*_+g*y+E*b,o[8]=A*v+g*x+E*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8];return t*l*d-t*c*u-n*o*d+n*c*f+r*o*u-r*l*f}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8],p=d*l-c*u,A=c*f-d*o,g=u*o-l*f,E=t*p+n*A+r*g;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/E;return e[0]=p*C,e[1]=(r*u-d*n)*C,e[2]=(c*n-r*l)*C,e[3]=A*C,e[4]=(d*t-r*f)*C,e[5]=(r*o-c*t)*C,e[6]=g*C,e[7]=(n*f-u*t)*C,e[8]=(l*t-n*o)*C,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,o,l,c){const f=Math.cos(o),u=Math.sin(o);return this.set(n*f,n*u,-n*(f*l+u*c)+l+e,-r*u,r*f,-r*(-u*l+f*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(pA.makeScale(e,t)),this}rotate(e){return this.premultiply(pA.makeRotation(-e)),this}translate(e,t){return this.premultiply(pA.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 r=0;r<9;r++)if(t[r]!==n[r])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 pA=new _t;function F1(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function Ql(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function A3(){const i=Ql("canvas");return i.style.display="block",i}const Q1={};function Ol(i){i in Q1||(Q1[i]=!0,console.warn(i))}const O1=new _t().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),z1=new _t().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Cu={[En]:{transfer:mu,primaries:vu,toReference:i=>i,fromReference:i=>i},[Xt]:{transfer:Vt,primaries:vu,toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[Ul]:{transfer:mu,primaries:_u,toReference:i=>i.applyMatrix3(z1),fromReference:i=>i.applyMatrix3(O1)},[gu]:{transfer:Vt,primaries:_u,toReference:i=>i.convertSRGBToLinear().applyMatrix3(z1),fromReference:i=>i.applyMatrix3(O1).convertLinearToSRGB()}},p3=new Set([En,Ul]),Nt={enabled:!0,_workingColorSpace:En,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(i){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!i},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!p3.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,e,t){if(this.enabled===!1||e===t||!e||!t)return i;const n=Cu[e].toReference,r=Cu[t].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,e){return this.convert(i,this._workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this._workingColorSpace)},getPrimaries:function(i){return Cu[i].primaries},getTransfer:function(i){return i===ci?mu:Cu[i].transfer}};function ea(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function gA(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let ta;class G1{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ta===void 0&&(ta=Ql("canvas")),ta.width=e.width,ta.height=e.height;const n=ta.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ta}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=Ql("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),o=r.data;for(let l=0;l<o.length;l++)o[l]=ea(o[l]/255)*255;return n.putImageData(r,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(ea(t[n]/255)*255):t[n]=ea(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 g3=0;class H1{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:g3++}),this.uuid=qi(),this.data=e,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:""},r=this.data;if(r!==null){let o;if(Array.isArray(r)){o=[];for(let l=0,c=r.length;l<c;l++)r[l].isDataTexture?o.push(mA(r[l].image)):o.push(mA(r[l]))}else o=mA(r);n.url=o}return t||(e.images[this.uuid]=n),n}}function mA(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?G1.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let m3=0;class Rn extends fo{constructor(e=Rn.DEFAULT_IMAGE,t=Rn.DEFAULT_MAPPING,n=Fn,r=Fn,o=un,l=Pr,c=on,f=fn,u=Rn.DEFAULT_ANISOTROPY,d=ci){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:m3++}),this.uuid=qi(),this.name="",this.source=new H1(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=l,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=f,this.offset=new Ke(0,0),this.repeat=new Ke(1,1),this.center=new Ke(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof d=="string"?this.colorSpace=d:(Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=d===uo?Xt:ci),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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!==i1)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Xo:e.x=e.x-Math.floor(e.x);break;case Fn:e.x=e.x<0?0:1;break;case lu: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 Xo:e.y=e.y-Math.floor(e.y);break;case Fn:e.y=e.y<0?0:1;break;case lu: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)}get encoding(){return Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Xt?uo:L1}set encoding(e){Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===uo?Xt:ci}}Rn.DEFAULT_IMAGE=null,Rn.DEFAULT_MAPPING=i1,Rn.DEFAULT_ANISOTROPY=1;class Gt{constructor(e=0,t=0,n=0,r=1){Gt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=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,r=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*r+l[12]*o,this.y=l[1]*t+l[5]*n+l[9]*r+l[13]*o,this.z=l[2]*t+l[6]*n+l[10]*r+l[14]*o,this.w=l[3]*t+l[7]*n+l[11]*r+l[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,o;const f=e.elements,u=f[0],d=f[4],p=f[8],A=f[1],g=f[5],E=f[9],C=f[2],_=f[6],v=f[10];if(Math.abs(d-A)<.01&&Math.abs(p-C)<.01&&Math.abs(E-_)<.01){if(Math.abs(d+A)<.1&&Math.abs(p+C)<.1&&Math.abs(E+_)<.1&&Math.abs(u+g+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(u+1)/2,x=(g+1)/2,w=(v+1)/2,b=(d+A)/4,B=(p+C)/4,L=(E+_)/4;return y>x&&y>w?y<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(y),r=b/n,o=B/n):x>w?x<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(x),n=b/r,o=L/r):w<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(w),n=B/o,r=L/o),this.set(n,r,o,t),this}let S=Math.sqrt((_-E)*(_-E)+(p-C)*(p-C)+(A-d)*(A-d));return Math.abs(S)<.001&&(S=1),this.x=(_-E)/S,this.y=(p-C)/S,this.z=(A-d)/S,this.w=Math.acos((u+g+v-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 v3 extends fo{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Gt(0,0,e,t),this.scissorTest=!1,this.viewport=new Gt(0,0,e,t);const r={width:e,height:t,depth:1};n.encoding!==void 0&&(Ol("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===uo?Xt:ci),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:un,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new Rn(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new H1(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 Xi extends v3{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class V1 extends Rn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=qt,this.minFilter=qt,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class W1 extends Rn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=qt,this.minFilter=qt,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class pr{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,o,l,c){let f=n[r+0],u=n[r+1],d=n[r+2],p=n[r+3];const A=o[l+0],g=o[l+1],E=o[l+2],C=o[l+3];if(c===0){e[t+0]=f,e[t+1]=u,e[t+2]=d,e[t+3]=p;return}if(c===1){e[t+0]=A,e[t+1]=g,e[t+2]=E,e[t+3]=C;return}if(p!==C||f!==A||u!==g||d!==E){let _=1-c;const v=f*A+u*g+d*E+p*C,S=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){const w=Math.sqrt(y),b=Math.atan2(w,v*S);_=Math.sin(_*b)/w,c=Math.sin(c*b)/w}const x=c*S;if(f=f*_+A*x,u=u*_+g*x,d=d*_+E*x,p=p*_+C*x,_===1-c){const w=1/Math.sqrt(f*f+u*u+d*d+p*p);f*=w,u*=w,d*=w,p*=w}}e[t]=f,e[t+1]=u,e[t+2]=d,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,o,l){const c=n[r],f=n[r+1],u=n[r+2],d=n[r+3],p=o[l],A=o[l+1],g=o[l+2],E=o[l+3];return e[t]=c*E+d*p+f*g-u*A,e[t+1]=f*E+d*A+u*p-c*g,e[t+2]=u*E+d*g+c*A-f*p,e[t+3]=d*E-c*p-f*A-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,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,r=e._y,o=e._z,l=e._order,c=Math.cos,f=Math.sin,u=c(n/2),d=c(r/2),p=c(o/2),A=f(n/2),g=f(r/2),E=f(o/2);switch(l){case"XYZ":this._x=A*d*p+u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p-A*g*E;break;case"YXZ":this._x=A*d*p+u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p+A*g*E;break;case"ZXY":this._x=A*d*p-u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p-A*g*E;break;case"ZYX":this._x=A*d*p-u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p+A*g*E;break;case"YZX":this._x=A*d*p+u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p-A*g*E;break;case"XZY":this._x=A*d*p-u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p+A*g*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],o=t[8],l=t[1],c=t[5],f=t[9],u=t[2],d=t[6],p=t[10],A=n+c+p;if(A>0){const g=.5/Math.sqrt(A+1);this._w=.25/g,this._x=(d-f)*g,this._y=(o-u)*g,this._z=(l-r)*g}else if(n>c&&n>p){const g=2*Math.sqrt(1+n-c-p);this._w=(d-f)/g,this._x=.25*g,this._y=(r+l)/g,this._z=(o+u)/g}else if(c>p){const g=2*Math.sqrt(1+c-n-p);this._w=(o-u)/g,this._x=(r+l)/g,this._y=.25*g,this._z=(f+d)/g}else{const g=2*Math.sqrt(1+p-n-c);this._w=(l-r)/g,this._x=(o+u)/g,this._y=(f+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(yn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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,r=e._y,o=e._z,l=e._w,c=t._x,f=t._y,u=t._z,d=t._w;return this._x=n*d+l*c+r*u-o*f,this._y=r*d+l*f+o*c-n*u,this._z=o*d+l*u+n*f-r*c,this._w=l*d-n*c-r*f-o*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,o=this._z,l=this._w;let c=l*e._w+n*e._x+r*e._y+o*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=l,this._x=n,this._y=r,this._z=o,this;const f=1-c*c;if(f<=Number.EPSILON){const g=1-t;return this._w=g*l+t*this._w,this._x=g*n+t*this._x,this._y=g*r+t*this._y,this._z=g*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(f),d=Math.atan2(u,c),p=Math.sin((1-t)*d)/u,A=Math.sin(t*d)/u;return this._w=l*p+this._w*A,this._x=n*p+this._x*A,this._y=r*p+this._y*A,this._z=o*p+this._z*A,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(o),n*Math.cos(o),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}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(j1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(j1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*r,this.y=o[1]*t+o[4]*n+o[7]*r,this.z=o[2]*t+o[5]*n+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,o=e.elements,l=1/(o[3]*t+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*r+o[12])*l,this.y=(o[1]*t+o[5]*n+o[9]*r+o[13])*l,this.z=(o[2]*t+o[6]*n+o[10]*r+o[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,o=e.x,l=e.y,c=e.z,f=e.w,u=2*(l*r-c*n),d=2*(c*t-o*r),p=2*(o*n-l*t);return this.x=t+f*u+l*p-c*d,this.y=n+f*d+c*u-o*p,this.z=r+f*p+o*d-l*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,r=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r,this.y=o[1]*t+o[5]*n+o[9]*r,this.z=o[2]*t+o[6]*n+o[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,o=e.z,l=t.x,c=t.y,f=t.z;return this.x=r*f-o*c,this.y=o*l-n*f,this.z=n*c-r*l,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 vA.copy(this).projectOnVector(e),this.sub(vA)}reflect(e){return this.sub(vA.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(yn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,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()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const vA=new j,j1=new pr;class gn{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(Ki.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Ki.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=Ki.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 o=n.getAttribute("position");if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=o.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,Ki):Ki.fromBufferAttribute(o,l),Ki.applyMatrix4(e.matrixWorld),this.expandByPoint(Ki);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Iu.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Iu.copy(n.boundingBox)),Iu.applyMatrix4(e.matrixWorld),this.union(Iu)}const r=e.children;for(let o=0,l=r.length;o<l;o++)this.expandByObject(r[o],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,Ki),Ki.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(zl),xu.subVectors(this.max,zl),na.subVectors(e.a,zl),ia.subVectors(e.b,zl),ra.subVectors(e.c,zl),ds.subVectors(ia,na),As.subVectors(ra,ia),ho.subVectors(na,ra);let t=[0,-ds.z,ds.y,0,-As.z,As.y,0,-ho.z,ho.y,ds.z,0,-ds.x,As.z,0,-As.x,ho.z,0,-ho.x,-ds.y,ds.x,0,-As.y,As.x,0,-ho.y,ho.x,0];return!_A(t,na,ia,ra,xu)||(t=[1,0,0,0,1,0,0,0,1],!_A(t,na,ia,ra,xu))?!1:(Su.crossVectors(ds,As),t=[Su.x,Su.y,Su.z],_A(t,na,ia,ra,xu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ki).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ki).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:(kr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),kr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),kr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),kr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),kr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),kr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),kr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),kr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(kr),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 kr=[new j,new j,new j,new j,new j,new j,new j,new j],Ki=new j,Iu=new gn,na=new j,ia=new j,ra=new j,ds=new j,As=new j,ho=new j,zl=new j,xu=new j,Su=new j,Ao=new j;function _A(i,e,t,n,r){for(let o=0,l=i.length-3;o<=l;o+=3){Ao.fromArray(i,o);const c=r.x*Math.abs(Ao.x)+r.y*Math.abs(Ao.y)+r.z*Math.abs(Ao.z),f=e.dot(Ao),u=t.dot(Ao),d=n.dot(Ao);if(Math.max(-Math.max(f,u,d),Math.min(f,u,d))>c)return!1}return!0}const _3=new gn,Gl=new j,EA=new j;class Ji{constructor(e=new j,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_3.setFromPoints(e).getCenter(n);let r=0;for(let o=0,l=e.length;o<l;o++)r=Math.max(r,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gl.subVectors(e,this.center);const t=Gl.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(Gl,r/n),this.radius+=r}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):(EA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gl.copy(e.center).add(EA)),this.expandByPoint(Gl.copy(e.center).sub(EA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Fr=new j,yA=new j,wu=new j,ps=new j,CA=new j,Mu=new j,IA=new j;class Hl{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,Fr)),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=Fr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Fr.copy(this.origin).addScaledVector(this.direction,t),Fr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){yA.copy(e).add(t).multiplyScalar(.5),wu.copy(t).sub(e).normalize(),ps.copy(this.origin).sub(yA);const o=e.distanceTo(t)*.5,l=-this.direction.dot(wu),c=ps.dot(this.direction),f=-ps.dot(wu),u=ps.lengthSq(),d=Math.abs(1-l*l);let p,A,g,E;if(d>0)if(p=l*f-c,A=l*c-f,E=o*d,p>=0)if(A>=-E)if(A<=E){const C=1/d;p*=C,A*=C,g=p*(p+l*A+2*c)+A*(l*p+A+2*f)+u}else A=o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;else A=-o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;else A<=-E?(p=Math.max(0,-(-l*o+c)),A=p>0?-o:Math.min(Math.max(-o,-f),o),g=-p*p+A*(A+2*f)+u):A<=E?(p=0,A=Math.min(Math.max(-o,-f),o),g=A*(A+2*f)+u):(p=Math.max(0,-(l*o+c)),A=p>0?o:Math.min(Math.max(-o,-f),o),g=-p*p+A*(A+2*f)+u);else A=l>0?-o:o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(yA).addScaledVector(wu,A),g}intersectSphere(e,t){Fr.subVectors(e.center,this.origin);const n=Fr.dot(this.direction),r=Fr.dot(Fr)-n*n,o=e.radius*e.radius;if(r>o)return null;const l=Math.sqrt(o-r),c=n-l,f=n+l;return f<0?null:c<0?this.at(f,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,r,o,l,c,f;const u=1/this.direction.x,d=1/this.direction.y,p=1/this.direction.z,A=this.origin;return u>=0?(n=(e.min.x-A.x)*u,r=(e.max.x-A.x)*u):(n=(e.max.x-A.x)*u,r=(e.min.x-A.x)*u),d>=0?(o=(e.min.y-A.y)*d,l=(e.max.y-A.y)*d):(o=(e.max.y-A.y)*d,l=(e.min.y-A.y)*d),n>l||o>r||((o>n||isNaN(n))&&(n=o),(l<r||isNaN(r))&&(r=l),p>=0?(c=(e.min.z-A.z)*p,f=(e.max.z-A.z)*p):(c=(e.max.z-A.z)*p,f=(e.min.z-A.z)*p),n>f||c>r)||((c>n||n!==n)&&(n=c),(f<r||r!==r)&&(r=f),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Fr)!==null}intersectTriangle(e,t,n,r,o){CA.subVectors(t,e),Mu.subVectors(n,e),IA.crossVectors(CA,Mu);let l=this.direction.dot(IA),c;if(l>0){if(r)return null;c=1}else if(l<0)c=-1,l=-l;else return null;ps.subVectors(this.origin,e);const f=c*this.direction.dot(Mu.crossVectors(ps,Mu));if(f<0)return null;const u=c*this.direction.dot(CA.cross(ps));if(u<0||f+u>l)return null;const d=-c*ps.dot(IA);return d<0?null:this.at(d/l,o)}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 ct{constructor(e,t,n,r,o,l,c,f,u,d,p,A,g,E,C,_){ct.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,r,o,l,c,f,u,d,p,A,g,E,C,_)}set(e,t,n,r,o,l,c,f,u,d,p,A,g,E,C,_){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=o,v[5]=l,v[9]=c,v[13]=f,v[2]=u,v[6]=d,v[10]=p,v[14]=A,v[3]=g,v[7]=E,v[11]=C,v[15]=_,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 ct().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/sa.setFromMatrixColumn(e,0).length(),o=1/sa.setFromMatrixColumn(e,1).length(),l=1/sa.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,o=e.z,l=Math.cos(n),c=Math.sin(n),f=Math.cos(r),u=Math.sin(r),d=Math.cos(o),p=Math.sin(o);if(e.order==="XYZ"){const A=l*d,g=l*p,E=c*d,C=c*p;t[0]=f*d,t[4]=-f*p,t[8]=u,t[1]=g+E*u,t[5]=A-C*u,t[9]=-c*f,t[2]=C-A*u,t[6]=E+g*u,t[10]=l*f}else if(e.order==="YXZ"){const A=f*d,g=f*p,E=u*d,C=u*p;t[0]=A+C*c,t[4]=E*c-g,t[8]=l*u,t[1]=l*p,t[5]=l*d,t[9]=-c,t[2]=g*c-E,t[6]=C+A*c,t[10]=l*f}else if(e.order==="ZXY"){const A=f*d,g=f*p,E=u*d,C=u*p;t[0]=A-C*c,t[4]=-l*p,t[8]=E+g*c,t[1]=g+E*c,t[5]=l*d,t[9]=C-A*c,t[2]=-l*u,t[6]=c,t[10]=l*f}else if(e.order==="ZYX"){const A=l*d,g=l*p,E=c*d,C=c*p;t[0]=f*d,t[4]=E*u-g,t[8]=A*u+C,t[1]=f*p,t[5]=C*u+A,t[9]=g*u-E,t[2]=-u,t[6]=c*f,t[10]=l*f}else if(e.order==="YZX"){const A=l*f,g=l*u,E=c*f,C=c*u;t[0]=f*d,t[4]=C-A*p,t[8]=E*p+g,t[1]=p,t[5]=l*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*p+E,t[10]=A-C*p}else if(e.order==="XZY"){const A=l*f,g=l*u,E=c*f,C=c*u;t[0]=f*d,t[4]=-p,t[8]=u*d,t[1]=A*p+C,t[5]=l*d,t[9]=g*p-E,t[2]=E*p-g,t[6]=c*d,t[10]=C*p+A}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(E3,e,y3)}lookAt(e,t,n){const r=this.elements;return Ci.subVectors(e,t),Ci.lengthSq()===0&&(Ci.z=1),Ci.normalize(),gs.crossVectors(n,Ci),gs.lengthSq()===0&&(Math.abs(n.z)===1?Ci.x+=1e-4:Ci.z+=1e-4,Ci.normalize(),gs.crossVectors(n,Ci)),gs.normalize(),Tu.crossVectors(Ci,gs),r[0]=gs.x,r[4]=Tu.x,r[8]=Ci.x,r[1]=gs.y,r[5]=Tu.y,r[9]=Ci.y,r[2]=gs.z,r[6]=Tu.z,r[10]=Ci.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,o=this.elements,l=n[0],c=n[4],f=n[8],u=n[12],d=n[1],p=n[5],A=n[9],g=n[13],E=n[2],C=n[6],_=n[10],v=n[14],S=n[3],y=n[7],x=n[11],w=n[15],b=r[0],B=r[4],L=r[8],R=r[12],T=r[1],N=r[5],k=r[9],O=r[13],F=r[2],V=r[6],X=r[10],te=r[14],Y=r[3],$=r[7],U=r[11],D=r[15];return o[0]=l*b+c*T+f*F+u*Y,o[4]=l*B+c*N+f*V+u*$,o[8]=l*L+c*k+f*X+u*U,o[12]=l*R+c*O+f*te+u*D,o[1]=d*b+p*T+A*F+g*Y,o[5]=d*B+p*N+A*V+g*$,o[9]=d*L+p*k+A*X+g*U,o[13]=d*R+p*O+A*te+g*D,o[2]=E*b+C*T+_*F+v*Y,o[6]=E*B+C*N+_*V+v*$,o[10]=E*L+C*k+_*X+v*U,o[14]=E*R+C*O+_*te+v*D,o[3]=S*b+y*T+x*F+w*Y,o[7]=S*B+y*N+x*V+w*$,o[11]=S*L+y*k+x*X+w*U,o[15]=S*R+y*O+x*te+w*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],o=e[12],l=e[1],c=e[5],f=e[9],u=e[13],d=e[2],p=e[6],A=e[10],g=e[14],E=e[3],C=e[7],_=e[11],v=e[15];return E*(+o*f*p-r*u*p-o*c*A+n*u*A+r*c*g-n*f*g)+C*(+t*f*g-t*u*A+o*l*A-r*l*g+r*u*d-o*f*d)+_*(+t*u*p-t*c*g-o*l*p+n*l*g+o*c*d-n*u*d)+v*(-r*c*d-t*f*p+t*c*A+r*l*p-n*l*A+n*f*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 r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8],p=e[9],A=e[10],g=e[11],E=e[12],C=e[13],_=e[14],v=e[15],S=p*_*u-C*A*u+C*f*g-c*_*g-p*f*v+c*A*v,y=E*A*u-d*_*u-E*f*g+l*_*g+d*f*v-l*A*v,x=d*C*u-E*p*u+E*c*g-l*C*g-d*c*v+l*p*v,w=E*p*f-d*C*f-E*c*A+l*C*A+d*c*_-l*p*_,b=t*S+n*y+r*x+o*w;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/b;return e[0]=S*B,e[1]=(C*A*o-p*_*o-C*r*g+n*_*g+p*r*v-n*A*v)*B,e[2]=(c*_*o-C*f*o+C*r*u-n*_*u-c*r*v+n*f*v)*B,e[3]=(p*f*o-c*A*o-p*r*u+n*A*u+c*r*g-n*f*g)*B,e[4]=y*B,e[5]=(d*_*o-E*A*o+E*r*g-t*_*g-d*r*v+t*A*v)*B,e[6]=(E*f*o-l*_*o-E*r*u+t*_*u+l*r*v-t*f*v)*B,e[7]=(l*A*o-d*f*o+d*r*u-t*A*u-l*r*g+t*f*g)*B,e[8]=x*B,e[9]=(E*p*o-d*C*o-E*n*g+t*C*g+d*n*v-t*p*v)*B,e[10]=(l*C*o-E*c*o+E*n*u-t*C*u-l*n*v+t*c*v)*B,e[11]=(d*c*o-l*p*o-d*n*u+t*p*u+l*n*g-t*c*g)*B,e[12]=w*B,e[13]=(d*C*r-E*p*r+E*n*A-t*C*A-d*n*_+t*p*_)*B,e[14]=(E*c*r-l*C*r-E*n*f+t*C*f+l*n*_-t*c*_)*B,e[15]=(l*p*r-d*c*r+d*n*f-t*p*f-l*n*A+t*c*A)*B,this}scale(e){const t=this.elements,n=e.x,r=e.y,o=e.z;return t[0]*=n,t[4]*=r,t[8]*=o,t[1]*=n,t[5]*=r,t[9]*=o,t[2]*=n,t[6]*=r,t[10]*=o,t[3]*=n,t[7]*=r,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),o=1-n,l=e.x,c=e.y,f=e.z,u=o*l,d=o*c;return this.set(u*l+n,u*c-r*f,u*f+r*c,0,u*c+r*f,d*c+n,d*f-r*l,0,u*f-r*c,d*f+r*l,o*f*f+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,o,l){return this.set(1,n,o,0,e,1,l,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,o=t._x,l=t._y,c=t._z,f=t._w,u=o+o,d=l+l,p=c+c,A=o*u,g=o*d,E=o*p,C=l*d,_=l*p,v=c*p,S=f*u,y=f*d,x=f*p,w=n.x,b=n.y,B=n.z;return r[0]=(1-(C+v))*w,r[1]=(g+x)*w,r[2]=(E-y)*w,r[3]=0,r[4]=(g-x)*b,r[5]=(1-(A+v))*b,r[6]=(_+S)*b,r[7]=0,r[8]=(E+y)*B,r[9]=(_-S)*B,r[10]=(1-(A+C))*B,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let o=sa.set(r[0],r[1],r[2]).length();const l=sa.set(r[4],r[5],r[6]).length(),c=sa.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],Zi.copy(this);const u=1/o,d=1/l,p=1/c;return Zi.elements[0]*=u,Zi.elements[1]*=u,Zi.elements[2]*=u,Zi.elements[4]*=d,Zi.elements[5]*=d,Zi.elements[6]*=d,Zi.elements[8]*=p,Zi.elements[9]*=p,Zi.elements[10]*=p,t.setFromRotationMatrix(Zi),n.x=o,n.y=l,n.z=c,this}makePerspective(e,t,n,r,o,l,c=Ur){const f=this.elements,u=2*o/(t-e),d=2*o/(n-r),p=(t+e)/(t-e),A=(n+r)/(n-r);let g,E;if(c===Ur)g=-(l+o)/(l-o),E=-2*l*o/(l-o);else if(c===Eu)g=-l/(l-o),E=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=u,f[4]=0,f[8]=p,f[12]=0,f[1]=0,f[5]=d,f[9]=A,f[13]=0,f[2]=0,f[6]=0,f[10]=g,f[14]=E,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,t,n,r,o,l,c=Ur){const f=this.elements,u=1/(t-e),d=1/(n-r),p=1/(l-o),A=(t+e)*u,g=(n+r)*d;let E,C;if(c===Ur)E=(l+o)*p,C=-2*p;else if(c===Eu)E=o*p,C=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=2*u,f[4]=0,f[8]=0,f[12]=-A,f[1]=0,f[5]=2*d,f[9]=0,f[13]=-g,f[2]=0,f[6]=0,f[10]=C,f[14]=-E,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])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 sa=new j,Zi=new ct,E3=new j(0,0,0),y3=new j(1,1,1),gs=new j,Tu=new j,Ci=new j,Y1=new ct,q1=new pr;class Bu{constructor(e=0,t=0,n=0,r=Bu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,o=r[0],l=r[4],c=r[8],f=r[1],u=r[5],d=r[9],p=r[2],A=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(yn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(A,u),this._z=0);break;case"YXZ":this._x=Math.asin(-yn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(f,u)):(this._y=Math.atan2(-p,o),this._z=0);break;case"ZXY":this._x=Math.asin(yn(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-l,u)):(this._y=0,this._z=Math.atan2(f,o));break;case"ZYX":this._y=Math.asin(-yn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(A,g),this._z=Math.atan2(f,o)):(this._x=0,this._z=Math.atan2(-l,u));break;case"YZX":this._z=Math.asin(yn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-p,o)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-yn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(A,u),this._y=Math.atan2(c,o)):(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 Y1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Y1,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return q1.setFromEuler(this),this.setFromQuaternion(q1,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}}Bu.DEFAULT_ORDER="XYZ";class xA{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 C3=0;const X1=new j,oa=new pr,Qr=new ct,Ru=new j,Vl=new j,I3=new j,x3=new pr,K1=new j(1,0,0),J1=new j(0,1,0),Z1=new j(0,0,1),S3={type:"added"},w3={type:"removed"};class tn extends fo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:C3++}),this.uuid=qi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=tn.DEFAULT_UP.clone();const e=new j,t=new Bu,n=new pr,r=new j(1,1,1);function o(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ct},normalMatrix:{value:new _t}}),this.matrix=new ct,this.matrixWorld=new ct,this.matrixAutoUpdate=tn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new xA,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return oa.setFromAxisAngle(e,t),this.quaternion.multiply(oa),this}rotateOnWorldAxis(e,t){return oa.setFromAxisAngle(e,t),this.quaternion.premultiply(oa),this}rotateX(e){return this.rotateOnAxis(K1,e)}rotateY(e){return this.rotateOnAxis(J1,e)}rotateZ(e){return this.rotateOnAxis(Z1,e)}translateOnAxis(e,t){return X1.copy(e).applyQuaternion(this.quaternion),this.position.add(X1.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(K1,e)}translateY(e){return this.translateOnAxis(J1,e)}translateZ(e){return this.translateOnAxis(Z1,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Qr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ru.copy(e):Ru.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Vl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Qr.lookAt(Vl,Ru,this.up):Qr.lookAt(Ru,Vl,this.up),this.quaternion.setFromRotationMatrix(Qr),r&&(Qr.extractRotation(r.matrixWorld),oa.setFromRotationMatrix(Qr),this.quaternion.premultiply(oa.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.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(S3)):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(w3)),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),Qr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Qr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Qr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t){let n=[];this[e]===t&&n.push(this);for(let r=0,o=this.children.length;r<o;r++){const l=this.children[r].getObjectsByProperty(e,t);l.length>0&&(n=n.concat(l))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,e,I3),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,x3,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;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,r=t.length;n<r;n++){const o=t[n];(o.matrixWorldAutoUpdate===!0||e===!0)&&o.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 r=this.children;for(let o=0,l=r.length;o<l;o++){const c=r[o];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 r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function o(c,f){return c[f.uuid]===void 0&&(c[f.uuid]=f.toJSON(e)),f.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const f=c.shapes;if(Array.isArray(f))for(let u=0,d=f.length;u<d;u++){const p=f[u];o(e.shapes,p)}else o(e.shapes,f)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let f=0,u=this.material.length;f<u;f++)c.push(o(e.materials,this.material[f]));r.material=c}else r.material=o(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const f=this.animations[c];r.animations.push(o(e.animations,f))}}if(t){const c=l(e.geometries),f=l(e.materials),u=l(e.textures),d=l(e.images),p=l(e.shapes),A=l(e.skeletons),g=l(e.animations),E=l(e.nodes);c.length>0&&(n.geometries=c),f.length>0&&(n.materials=f),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),p.length>0&&(n.shapes=p),A.length>0&&(n.skeletons=A),g.length>0&&(n.animations=g),E.length>0&&(n.nodes=E)}return n.object=r,n;function l(c){const f=[];for(const u in c){const d=c[u];delete d.metadata,f.push(d)}return f}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}tn.DEFAULT_UP=new j(0,1,0),tn.DEFAULT_MATRIX_AUTO_UPDATE=!0,tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const $i=new j,Or=new j,SA=new j,zr=new j,aa=new j,la=new j,$1=new j,wA=new j,MA=new j,TA=new j;let bu=!1;class Hn{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),$i.subVectors(e,t),r.cross($i);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,n,r,o){$i.subVectors(r,t),Or.subVectors(n,t),SA.subVectors(e,t);const l=$i.dot($i),c=$i.dot(Or),f=$i.dot(SA),u=Or.dot(Or),d=Or.dot(SA),p=l*u-c*c;if(p===0)return o.set(-2,-1,-1);const A=1/p,g=(u*f-c*d)*A,E=(l*d-c*f)*A;return o.set(1-g-E,E,g)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,zr),zr.x>=0&&zr.y>=0&&zr.x+zr.y<=1}static getUV(e,t,n,r,o,l,c,f){return bu===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bu=!0),this.getInterpolation(e,t,n,r,o,l,c,f)}static getInterpolation(e,t,n,r,o,l,c,f){return this.getBarycoord(e,t,n,r,zr),f.setScalar(0),f.addScaledVector(o,zr.x),f.addScaledVector(l,zr.y),f.addScaledVector(c,zr.z),f}static isFrontFacing(e,t,n,r){return $i.subVectors(n,t),Or.subVectors(e,t),$i.cross(Or).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $i.subVectors(this.c,this.b),Or.subVectors(this.a,this.b),$i.cross(Or).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Hn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,o){return bu===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bu=!0),Hn.getInterpolation(e,this.a,this.b,this.c,t,n,r,o)}getInterpolation(e,t,n,r,o){return Hn.getInterpolation(e,this.a,this.b,this.c,t,n,r,o)}containsPoint(e){return Hn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,o=this.c;let l,c;aa.subVectors(r,n),la.subVectors(o,n),wA.subVectors(e,n);const f=aa.dot(wA),u=la.dot(wA);if(f<=0&&u<=0)return t.copy(n);MA.subVectors(e,r);const d=aa.dot(MA),p=la.dot(MA);if(d>=0&&p<=d)return t.copy(r);const A=f*p-d*u;if(A<=0&&f>=0&&d<=0)return l=f/(f-d),t.copy(n).addScaledVector(aa,l);TA.subVectors(e,o);const g=aa.dot(TA),E=la.dot(TA);if(E>=0&&g<=E)return t.copy(o);const C=g*u-f*E;if(C<=0&&u>=0&&E<=0)return c=u/(u-E),t.copy(n).addScaledVector(la,c);const _=d*E-g*p;if(_<=0&&p-d>=0&&g-E>=0)return $1.subVectors(o,r),c=(p-d)/(p-d+(g-E)),t.copy(r).addScaledVector($1,c);const v=1/(_+C+A);return l=C*v,c=A*v,t.copy(n).addScaledVector(aa,l).addScaledVector(la,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const e_={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},ms={h:0,s:0,l:0},Lu={h:0,s:0,l:0};function BA(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class tt{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 r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Xt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Nt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=Nt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Nt.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=Nt.workingColorSpace){if(e=hA(e,1),t=yn(t,0,1),n=yn(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,l=2*n-o;this.r=BA(l,o,e+1/3),this.g=BA(l,o,e),this.b=BA(l,o,e-1/3)}return Nt.toWorkingColorSpace(this,r),this}setStyle(e,t=Xt){function n(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=r[1],c=r[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=r[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,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=Xt){const n=e_[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=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}copyLinearToSRGB(e){return this.r=gA(e.r),this.g=gA(e.g),this.b=gA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Xt){return Nt.fromWorkingColorSpace(Vn.copy(this),e),Math.round(yn(Vn.r*255,0,255))*65536+Math.round(yn(Vn.g*255,0,255))*256+Math.round(yn(Vn.b*255,0,255))}getHexString(e=Xt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Nt.workingColorSpace){Nt.fromWorkingColorSpace(Vn.copy(this),t);const n=Vn.r,r=Vn.g,o=Vn.b,l=Math.max(n,r,o),c=Math.min(n,r,o);let f,u;const d=(c+l)/2;if(c===l)f=0,u=0;else{const p=l-c;switch(u=d<=.5?p/(l+c):p/(2-l-c),l){case n:f=(r-o)/p+(r<o?6:0);break;case r:f=(o-n)/p+2;break;case o:f=(n-r)/p+4;break}f/=6}return e.h=f,e.s=u,e.l=d,e}getRGB(e,t=Nt.workingColorSpace){return Nt.fromWorkingColorSpace(Vn.copy(this),t),e.r=Vn.r,e.g=Vn.g,e.b=Vn.b,e}getStyle(e=Xt){Nt.fromWorkingColorSpace(Vn.copy(this),e);const t=Vn.r,n=Vn.g,r=Vn.b;return e!==Xt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(ms),this.setHSL(ms.h+e,ms.s+t,ms.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(ms),e.getHSL(Lu);const n=Fl(ms.h,Lu.h,t),r=Fl(ms.s,Lu.s,t),o=Fl(ms.l,Lu.l,t);return this.setHSL(n,r,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*r,this.g=o[1]*t+o[4]*n+o[7]*r,this.b=o[2]*t+o[5]*n+o[8]*r,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 Vn=new tt;tt.NAMES=e_;let M3=0;class gr extends fo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:M3++}),this.uuid=qi(),this.name="",this.type="Material",this.blending=Yo,this.side=ji,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=qd,this.blendDst=Xd,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=ou,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=N1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Zo,this.stencilZFail=Zo,this.stencilZPass=Zo,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 r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.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&&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.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!==Yo&&(n.blending=this.blending),this.side!==ji&&(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!==qd&&(n.blendSrc=this.blendSrc),this.blendDst!==Xd&&(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!==ou&&(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!==N1&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Zo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Zo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Zo&&(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 r(o){const l=[];for(const c in o){const f=o[c];delete f.metadata,l.push(f)}return l}if(t){const o=r(e.textures),l=r(e.images);o.length>0&&(n.textures=o),l.length>0&&(n.images=l)}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 r=t.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=t[o].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 Gr extends gr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zv,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Hr=T3();function T3(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let f=0;f<256;++f){const u=f-127;u<-27?(n[f]=0,n[f|256]=32768,r[f]=24,r[f|256]=24):u<-14?(n[f]=1024>>-u-14,n[f|256]=1024>>-u-14|32768,r[f]=-u-1,r[f|256]=-u-1):u<=15?(n[f]=u+15<<10,n[f|256]=u+15<<10|32768,r[f]=13,r[f|256]=13):u<128?(n[f]=31744,n[f|256]=64512,r[f]=24,r[f|256]=24):(n[f]=31744,n[f|256]=64512,r[f]=13,r[f|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64);for(let f=1;f<1024;++f){let u=f<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,o[f]=u|d}for(let f=1024;f<2048;++f)o[f]=939524096+(f-1024<<13);for(let f=1;f<31;++f)l[f]=f<<23;l[31]=1199570944,l[32]=2147483648;for(let f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(let f=1;f<64;++f)f!==32&&(c[f]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:o,exponentTable:l,offsetTable:c}}function B3(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=yn(i,-65504,65504),Hr.floatView[0]=i;const e=Hr.uint32View[0],t=e>>23&511;return Hr.baseTable[t]+((e&8388607)>>Hr.shiftTable[t])}function R3(i){const e=i>>10;return Hr.uint32View[0]=Hr.mantissaTable[Hr.offsetTable[e]+(i&1023)]+Hr.exponentTable[e],Hr.floatView[0]}const Du={toHalfFloat:B3,fromHalfFloat:R3},mn=new j,Nu=new Ke;class bn{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=uA,this.updateRange={offset:0,count:-1},this.gpuType=hn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[e+r]=t.array[n+r];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++)Nu.fromBufferAttribute(this,t),Nu.applyMatrix3(e),this.setXY(t,Nu.x,Nu.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix3(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix4(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyNormalMatrix(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.transformDirection(e),this.setXYZ(t,mn.x,mn.y,mn.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=Ar(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ot(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ar(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ar(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),o=Ot(o,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=o,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!==uA&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}class t_ extends bn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class n_ extends bn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class er extends bn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let b3=0;const Pi=new ct,RA=new tn,ca=new j,Ii=new gn,Wl=new gn,Ln=new j;class xi extends fo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:b3++}),this.uuid=qi(),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(F1(e)?n_:t_)(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 o=new _t().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Pi.makeRotationFromQuaternion(e),this.applyMatrix4(Pi),this}rotateX(e){return Pi.makeRotationX(e),this.applyMatrix4(Pi),this}rotateY(e){return Pi.makeRotationY(e),this.applyMatrix4(Pi),this}rotateZ(e){return Pi.makeRotationZ(e),this.applyMatrix4(Pi),this}translate(e,t,n){return Pi.makeTranslation(e,t,n),this.applyMatrix4(Pi),this}scale(e,t,n){return Pi.makeScale(e,t,n),this.applyMatrix4(Pi),this}lookAt(e){return RA.lookAt(e),RA.updateMatrix(),this.applyMatrix4(RA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ca).negate(),this.translate(ca.x,ca.y,ca.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new er(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new gn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',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,r=t.length;n<r;n++){const o=t[n];Ii.setFromBufferAttribute(o),this.morphTargetsRelative?(Ln.addVectors(this.boundingBox.min,Ii.min),this.boundingBox.expandByPoint(Ln),Ln.addVectors(this.boundingBox.max,Ii.max),this.boundingBox.expandByPoint(Ln)):(this.boundingBox.expandByPoint(Ii.min),this.boundingBox.expandByPoint(Ii.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 Ji);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(Ii.setFromBufferAttribute(e),t)for(let o=0,l=t.length;o<l;o++){const c=t[o];Wl.setFromBufferAttribute(c),this.morphTargetsRelative?(Ln.addVectors(Ii.min,Wl.min),Ii.expandByPoint(Ln),Ln.addVectors(Ii.max,Wl.max),Ii.expandByPoint(Ln)):(Ii.expandByPoint(Wl.min),Ii.expandByPoint(Wl.max))}Ii.getCenter(n);let r=0;for(let o=0,l=e.count;o<l;o++)Ln.fromBufferAttribute(e,o),r=Math.max(r,n.distanceToSquared(Ln));if(t)for(let o=0,l=t.length;o<l;o++){const c=t[o],f=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Ln.fromBufferAttribute(c,u),f&&(ca.fromBufferAttribute(e,u),Ln.add(ca)),r=Math.max(r,n.distanceToSquared(Ln))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(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=e.array,r=t.position.array,o=t.normal.array,l=t.uv.array,c=r.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*c),4));const f=this.getAttribute("tangent").array,u=[],d=[];for(let T=0;T<c;T++)u[T]=new j,d[T]=new j;const p=new j,A=new j,g=new j,E=new Ke,C=new Ke,_=new Ke,v=new j,S=new j;function y(T,N,k){p.fromArray(r,T*3),A.fromArray(r,N*3),g.fromArray(r,k*3),E.fromArray(l,T*2),C.fromArray(l,N*2),_.fromArray(l,k*2),A.sub(p),g.sub(p),C.sub(E),_.sub(E);const O=1/(C.x*_.y-_.x*C.y);isFinite(O)&&(v.copy(A).multiplyScalar(_.y).addScaledVector(g,-C.y).multiplyScalar(O),S.copy(g).multiplyScalar(C.x).addScaledVector(A,-_.x).multiplyScalar(O),u[T].add(v),u[N].add(v),u[k].add(v),d[T].add(S),d[N].add(S),d[k].add(S))}let x=this.groups;x.length===0&&(x=[{start:0,count:n.length}]);for(let T=0,N=x.length;T<N;++T){const k=x[T],O=k.start,F=k.count;for(let V=O,X=O+F;V<X;V+=3)y(n[V+0],n[V+1],n[V+2])}const w=new j,b=new j,B=new j,L=new j;function R(T){B.fromArray(o,T*3),L.copy(B);const N=u[T];w.copy(N),w.sub(B.multiplyScalar(B.dot(N))).normalize(),b.crossVectors(L,N);const O=b.dot(d[T])<0?-1:1;f[T*4]=w.x,f[T*4+1]=w.y,f[T*4+2]=w.z,f[T*4+3]=O}for(let T=0,N=x.length;T<N;++T){const k=x[T],O=k.start,F=k.count;for(let V=O,X=O+F;V<X;V+=3)R(n[V+0]),R(n[V+1]),R(n[V+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 bn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let A=0,g=n.count;A<g;A++)n.setXYZ(A,0,0,0);const r=new j,o=new j,l=new j,c=new j,f=new j,u=new j,d=new j,p=new j;if(e)for(let A=0,g=e.count;A<g;A+=3){const E=e.getX(A+0),C=e.getX(A+1),_=e.getX(A+2);r.fromBufferAttribute(t,E),o.fromBufferAttribute(t,C),l.fromBufferAttribute(t,_),d.subVectors(l,o),p.subVectors(r,o),d.cross(p),c.fromBufferAttribute(n,E),f.fromBufferAttribute(n,C),u.fromBufferAttribute(n,_),c.add(d),f.add(d),u.add(d),n.setXYZ(E,c.x,c.y,c.z),n.setXYZ(C,f.x,f.y,f.z),n.setXYZ(_,u.x,u.y,u.z)}else for(let A=0,g=t.count;A<g;A+=3)r.fromBufferAttribute(t,A+0),o.fromBufferAttribute(t,A+1),l.fromBufferAttribute(t,A+2),d.subVectors(l,o),p.subVectors(r,o),d.cross(p),n.setXYZ(A+0,d.x,d.y,d.z),n.setXYZ(A+1,d.x,d.y,d.z),n.setXYZ(A+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++)Ln.fromBufferAttribute(e,t),Ln.normalize(),e.setXYZ(t,Ln.x,Ln.y,Ln.z)}toNonIndexed(){function e(c,f){const u=c.array,d=c.itemSize,p=c.normalized,A=new u.constructor(f.length*d);let g=0,E=0;for(let C=0,_=f.length;C<_;C++){c.isInterleavedBufferAttribute?g=f[C]*c.data.stride+c.offset:g=f[C]*d;for(let v=0;v<d;v++)A[E++]=u[g++]}return new bn(A,d,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new xi,n=this.index.array,r=this.attributes;for(const c in r){const f=r[c],u=e(f,n);t.setAttribute(c,u)}const o=this.morphAttributes;for(const c in o){const f=[],u=o[c];for(let d=0,p=u.length;d<p;d++){const A=u[d],g=e(A,n);f.push(g)}t.morphAttributes[c]=f}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let c=0,f=l.length;c<f;c++){const u=l[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 f=this.parameters;for(const u in f)f[u]!==void 0&&(e[u]=f[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 f in n){const u=n[f];e.data.attributes[f]=u.toJSON(e.data)}const r={};let o=!1;for(const f in this.morphAttributes){const u=this.morphAttributes[f],d=[];for(let p=0,A=u.length;p<A;p++){const g=u[p];d.push(g.toJSON(e.data))}d.length>0&&(r[f]=d,o=!0)}o&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));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 r=e.attributes;for(const u in r){const d=r[u];this.setAttribute(u,d.clone(t))}const o=e.morphAttributes;for(const u in o){const d=[],p=o[u];for(let A=0,g=p.length;A<g;A++)d.push(p[A].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let u=0,d=l.length;u<d;u++){const p=l[u];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const f=e.boundingSphere;return f!==null&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const i_=new ct,po=new Hl,Pu=new Ji,r_=new j,ua=new j,fa=new j,ha=new j,bA=new j,Uu=new j,ku=new Ke,Fu=new Ke,Qu=new Ke,s_=new j,o_=new j,a_=new j,Ou=new j,zu=new j;class Wn extends tn{constructor(e=new xi,t=new Gr){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 t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(o&&c){Uu.set(0,0,0);for(let f=0,u=o.length;f<u;f++){const d=c[f],p=o[f];d!==0&&(bA.fromBufferAttribute(p,e),l?Uu.addScaledVector(bA,d):Uu.addScaledVector(bA.sub(t),d))}t.add(Uu)}return t}raycast(e,t){const n=this.geometry,r=this.material,o=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Pu.copy(n.boundingSphere),Pu.applyMatrix4(o),po.copy(e.ray).recast(e.near),!(Pu.containsPoint(po.origin)===!1&&(po.intersectSphere(Pu,r_)===null||po.origin.distanceToSquared(r_)>(e.far-e.near)**2))&&(i_.copy(o).invert(),po.copy(e.ray).applyMatrix4(i_),!(n.boundingBox!==null&&po.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,po)))}_computeIntersections(e,t,n){let r;const o=this.geometry,l=this.material,c=o.index,f=o.attributes.position,u=o.attributes.uv,d=o.attributes.uv1,p=o.attributes.normal,A=o.groups,g=o.drawRange;if(c!==null)if(Array.isArray(l))for(let E=0,C=A.length;E<C;E++){const _=A[E],v=l[_.materialIndex],S=Math.max(_.start,g.start),y=Math.min(c.count,Math.min(_.start+_.count,g.start+g.count));for(let x=S,w=y;x<w;x+=3){const b=c.getX(x),B=c.getX(x+1),L=c.getX(x+2);r=Gu(this,v,e,n,u,d,p,b,B,L),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const E=Math.max(0,g.start),C=Math.min(c.count,g.start+g.count);for(let _=E,v=C;_<v;_+=3){const S=c.getX(_),y=c.getX(_+1),x=c.getX(_+2);r=Gu(this,l,e,n,u,d,p,S,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(f!==void 0)if(Array.isArray(l))for(let E=0,C=A.length;E<C;E++){const _=A[E],v=l[_.materialIndex],S=Math.max(_.start,g.start),y=Math.min(f.count,Math.min(_.start+_.count,g.start+g.count));for(let x=S,w=y;x<w;x+=3){const b=x,B=x+1,L=x+2;r=Gu(this,v,e,n,u,d,p,b,B,L),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const E=Math.max(0,g.start),C=Math.min(f.count,g.start+g.count);for(let _=E,v=C;_<v;_+=3){const S=_,y=_+1,x=_+2;r=Gu(this,l,e,n,u,d,p,S,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function L3(i,e,t,n,r,o,l,c){let f;if(e.side===Bn?f=n.intersectTriangle(l,o,r,!0,c):f=n.intersectTriangle(r,o,l,e.side===ji,c),f===null)return null;zu.copy(c),zu.applyMatrix4(i.matrixWorld);const u=t.ray.origin.distanceTo(zu);return u<t.near||u>t.far?null:{distance:u,point:zu.clone(),object:i}}function Gu(i,e,t,n,r,o,l,c,f,u){i.getVertexPosition(c,ua),i.getVertexPosition(f,fa),i.getVertexPosition(u,ha);const d=L3(i,e,t,n,ua,fa,ha,Ou);if(d){r&&(ku.fromBufferAttribute(r,c),Fu.fromBufferAttribute(r,f),Qu.fromBufferAttribute(r,u),d.uv=Hn.getInterpolation(Ou,ua,fa,ha,ku,Fu,Qu,new Ke)),o&&(ku.fromBufferAttribute(o,c),Fu.fromBufferAttribute(o,f),Qu.fromBufferAttribute(o,u),d.uv1=Hn.getInterpolation(Ou,ua,fa,ha,ku,Fu,Qu,new Ke),d.uv2=d.uv1),l&&(s_.fromBufferAttribute(l,c),o_.fromBufferAttribute(l,f),a_.fromBufferAttribute(l,u),d.normal=Hn.getInterpolation(Ou,ua,fa,ha,s_,o_,a_,new j),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const p={a:c,b:f,c:u,normal:new j,materialIndex:0};Hn.getNormal(ua,fa,ha,p.normal),d.face=p}return d}class jl extends xi{constructor(e=1,t=1,n=1,r=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:o,depthSegments:l};const c=this;r=Math.floor(r),o=Math.floor(o),l=Math.floor(l);const f=[],u=[],d=[],p=[];let A=0,g=0;E("z","y","x",-1,-1,n,t,e,l,o,0),E("z","y","x",1,-1,n,t,-e,l,o,1),E("x","z","y",1,1,e,n,t,r,l,2),E("x","z","y",1,-1,e,n,-t,r,l,3),E("x","y","z",1,-1,e,t,n,r,o,4),E("x","y","z",-1,-1,e,t,-n,r,o,5),this.setIndex(f),this.setAttribute("position",new er(u,3)),this.setAttribute("normal",new er(d,3)),this.setAttribute("uv",new er(p,2));function E(C,_,v,S,y,x,w,b,B,L,R){const T=x/B,N=w/L,k=x/2,O=w/2,F=b/2,V=B+1,X=L+1;let te=0,Y=0;const $=new j;for(let U=0;U<X;U++){const D=U*N-O;for(let G=0;G<V;G++){const K=G*T-k;$[C]=K*S,$[_]=D*y,$[v]=F,u.push($.x,$.y,$.z),$[C]=0,$[_]=0,$[v]=b>0?1:-1,d.push($.x,$.y,$.z),p.push(G/B),p.push(1-U/L),te+=1}}for(let U=0;U<L;U++)for(let D=0;D<B;D++){const G=A+D+V*U,K=A+D+V*(U+1),J=A+(D+1)+V*(U+1),Ae=A+(D+1)+V*U;f.push(G,K,Ae),f.push(K,J,Ae),Y+=6}c.addGroup(g,Y,R),g+=Y,A+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function da(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function Zn(i){const e={};for(let t=0;t<i.length;t++){const n=da(i[t]);for(const r in n)e[r]=n[r]}return e}function D3(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function l_(i){return i.getRenderTarget()===null?i.outputColorSpace:Nt.workingColorSpace}const Hu={clone:da,merge:Zn};var N3=`void main() {
36
+ */const su="158",Wo={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},jo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lM=0,Wv=1,cM=2,jv=1,uM=2,Dr=3,ji=0,Bn=1,Yi=2,Nr=0,Yo=1,Yv=2,qv=3,Xv=4,fM=5,ro=100,hM=101,dM=102,Kv=103,Jv=104,AM=200,pM=201,gM=202,mM=203,qd=204,Xd=205,vM=206,_M=207,EM=208,yM=209,CM=210,IM=211,xM=212,SM=213,wM=214,MM=0,TM=1,BM=2,ou=3,RM=4,bM=5,LM=6,DM=7,$v=0,NM=1,PM=2,hs=0,Zv=1,e1=2,t1=3,Kd=4,UM=5,n1="attached",kM="detached",i1=300,so=301,qo=302,Ll=303,Jd=304,au=306,Xo=1e3,Fn=1001,lu=1002,qt=1003,$d=1004,cu=1005,un=1006,r1=1007,Pr=1008,fn=1009,Zd=1010,s1=1011,uu=1012,Dl=1013,yi=1014,hn=1015,Jn=1016,o1=1017,a1=1018,oo=1020,FM=1021,on=1023,QM=1024,OM=1025,ao=1026,Ko=1027,lo=1028,eA=1029,co=1030,fu=1031,Nl=1033,hu=33776,tA=33777,nA=33778,du=33779,iA=35840,l1=35841,rA=35842,c1=35843,u1=36196,sA=37492,oA=37496,aA=37808,f1=37809,h1=37810,d1=37811,Au=37812,A1=37813,p1=37814,g1=37815,m1=37816,v1=37817,_1=37818,E1=37819,y1=37820,C1=37821,pu=36492,I1=36494,x1=36495,zM=36283,S1=36284,w1=36285,M1=36286,Pl=2300,Jo=2301,lA=2302,T1=2400,B1=2401,R1=2402,GM=2500,HM=0,b1=1,cA=2,L1=3e3,uo=3001,VM=3200,WM=3201,D1=0,jM=1,ci="",Xt="srgb",En="srgb-linear",gu="display-p3",Ul="display-p3-linear",mu="linear",Vt="srgb",vu="rec709",_u="p3",$o=7680,N1=519,YM=512,qM=513,XM=514,KM=515,JM=516,$M=517,ZM=518,e3=519,uA=35044,P1="300 es",fA=1035,Ur=2e3,Eu=2001;class fo{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 r=this._listeners[e];if(r!==void 0){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let o=0,l=r.length;o<l;o++)r[o].call(this,e);e.target=null}}}const Gn=["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 U1=1234567;const kl=Math.PI/180,Zo=180/Math.PI;function qi(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Gn[i&255]+Gn[i>>8&255]+Gn[i>>16&255]+Gn[i>>24&255]+"-"+Gn[e&255]+Gn[e>>8&255]+"-"+Gn[e>>16&15|64]+Gn[e>>24&255]+"-"+Gn[t&63|128]+Gn[t>>8&255]+"-"+Gn[t>>16&255]+Gn[t>>24&255]+Gn[n&255]+Gn[n>>8&255]+Gn[n>>16&255]+Gn[n>>24&255]).toLowerCase()}function yn(i,e,t){return Math.max(e,Math.min(t,i))}function hA(i,e){return(i%e+e)%e}function t3(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function n3(i,e,t){return i!==e?(t-i)/(e-i):0}function Fl(i,e,t){return(1-t)*i+t*e}function i3(i,e,t,n){return Fl(i,e,1-Math.exp(-t*n))}function r3(i,e=1){return e-Math.abs(hA(i,e*2)-e)}function s3(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function o3(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function a3(i,e){return i+Math.floor(Math.random()*(e-i+1))}function l3(i,e){return i+Math.random()*(e-i)}function c3(i){return i*(.5-Math.random())}function u3(i){i!==void 0&&(U1=i);let e=U1+=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 f3(i){return i*kl}function h3(i){return i*Zo}function dA(i){return(i&i-1)===0&&i!==0}function k1(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function yu(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function d3(i,e,t,n,r){const o=Math.cos,l=Math.sin,c=o(t/2),f=l(t/2),u=o((e+n)/2),d=l((e+n)/2),p=o((e-n)/2),A=l((e-n)/2),g=o((n-e)/2),E=l((n-e)/2);switch(r){case"XYX":i.set(c*d,f*p,f*A,c*u);break;case"YZY":i.set(f*A,c*d,f*p,c*u);break;case"ZXZ":i.set(f*p,f*A,c*d,c*u);break;case"XZX":i.set(c*d,f*E,f*g,c*u);break;case"YXY":i.set(f*g,c*d,f*E,c*u);break;case"ZYZ":i.set(f*E,f*g,c*d,c*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ar(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Ot(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const AA={DEG2RAD:kl,RAD2DEG:Zo,generateUUID:qi,clamp:yn,euclideanModulo:hA,mapLinear:t3,inverseLerp:n3,lerp:Fl,damp:i3,pingpong:r3,smoothstep:s3,smootherstep:o3,randInt:a3,randFloat:l3,randFloatSpread:c3,seededRandom:u3,degToRad:f3,radToDeg:h3,isPowerOfTwo:dA,ceilPowerOfTwo:k1,floorPowerOfTwo:yu,setQuaternionFromProperEuler:d3,normalize:Ot,denormalize:Ar};class Ke{constructor(e=0,t=0){Ke.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(yn(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),r=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*n-l*r+e.x,this.y=o*r+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _t{constructor(e,t,n,r,o,l,c,f,u){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,o,l,c,f,u)}set(e,t,n,r,o,l,c,f,u){const d=this.elements;return d[0]=e,d[1]=r,d[2]=c,d[3]=t,d[4]=o,d[5]=f,d[6]=n,d[7]=l,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,r=t.elements,o=this.elements,l=n[0],c=n[3],f=n[6],u=n[1],d=n[4],p=n[7],A=n[2],g=n[5],E=n[8],C=r[0],_=r[3],v=r[6],x=r[1],y=r[4],S=r[7],w=r[2],b=r[5],B=r[8];return o[0]=l*C+c*x+f*w,o[3]=l*_+c*y+f*b,o[6]=l*v+c*S+f*B,o[1]=u*C+d*x+p*w,o[4]=u*_+d*y+p*b,o[7]=u*v+d*S+p*B,o[2]=A*C+g*x+E*w,o[5]=A*_+g*y+E*b,o[8]=A*v+g*S+E*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8];return t*l*d-t*c*u-n*o*d+n*c*f+r*o*u-r*l*f}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8],p=d*l-c*u,A=c*f-d*o,g=u*o-l*f,E=t*p+n*A+r*g;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/E;return e[0]=p*C,e[1]=(r*u-d*n)*C,e[2]=(c*n-r*l)*C,e[3]=A*C,e[4]=(d*t-r*f)*C,e[5]=(r*o-c*t)*C,e[6]=g*C,e[7]=(n*f-u*t)*C,e[8]=(l*t-n*o)*C,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,o,l,c){const f=Math.cos(o),u=Math.sin(o);return this.set(n*f,n*u,-n*(f*l+u*c)+l+e,-r*u,r*f,-r*(-u*l+f*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(pA.makeScale(e,t)),this}rotate(e){return this.premultiply(pA.makeRotation(-e)),this}translate(e,t){return this.premultiply(pA.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 r=0;r<9;r++)if(t[r]!==n[r])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 pA=new _t;function F1(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function Ql(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function A3(){const i=Ql("canvas");return i.style.display="block",i}const Q1={};function Ol(i){i in Q1||(Q1[i]=!0,console.warn(i))}const O1=new _t().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),z1=new _t().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Cu={[En]:{transfer:mu,primaries:vu,toReference:i=>i,fromReference:i=>i},[Xt]:{transfer:Vt,primaries:vu,toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[Ul]:{transfer:mu,primaries:_u,toReference:i=>i.applyMatrix3(z1),fromReference:i=>i.applyMatrix3(O1)},[gu]:{transfer:Vt,primaries:_u,toReference:i=>i.convertSRGBToLinear().applyMatrix3(z1),fromReference:i=>i.applyMatrix3(O1).convertLinearToSRGB()}},p3=new Set([En,Ul]),Nt={enabled:!0,_workingColorSpace:En,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(i){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!i},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!p3.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,e,t){if(this.enabled===!1||e===t||!e||!t)return i;const n=Cu[e].toReference,r=Cu[t].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,e){return this.convert(i,this._workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this._workingColorSpace)},getPrimaries:function(i){return Cu[i].primaries},getTransfer:function(i){return i===ci?mu:Cu[i].transfer}};function ea(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function gA(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let ta;class G1{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ta===void 0&&(ta=Ql("canvas")),ta.width=e.width,ta.height=e.height;const n=ta.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ta}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=Ql("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),o=r.data;for(let l=0;l<o.length;l++)o[l]=ea(o[l]/255)*255;return n.putImageData(r,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(ea(t[n]/255)*255):t[n]=ea(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 g3=0;class H1{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:g3++}),this.uuid=qi(),this.data=e,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:""},r=this.data;if(r!==null){let o;if(Array.isArray(r)){o=[];for(let l=0,c=r.length;l<c;l++)r[l].isDataTexture?o.push(mA(r[l].image)):o.push(mA(r[l]))}else o=mA(r);n.url=o}return t||(e.images[this.uuid]=n),n}}function mA(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?G1.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let m3=0;class Rn extends fo{constructor(e=Rn.DEFAULT_IMAGE,t=Rn.DEFAULT_MAPPING,n=Fn,r=Fn,o=un,l=Pr,c=on,f=fn,u=Rn.DEFAULT_ANISOTROPY,d=ci){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:m3++}),this.uuid=qi(),this.name="",this.source=new H1(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=o,this.minFilter=l,this.anisotropy=u,this.format=c,this.internalFormat=null,this.type=f,this.offset=new Ke(0,0),this.repeat=new Ke(1,1),this.center=new Ke(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof d=="string"?this.colorSpace=d:(Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=d===uo?Xt:ci),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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!==i1)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Xo:e.x=e.x-Math.floor(e.x);break;case Fn:e.x=e.x<0?0:1;break;case lu: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 Xo:e.y=e.y-Math.floor(e.y);break;case Fn:e.y=e.y<0?0:1;break;case lu: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)}get encoding(){return Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Xt?uo:L1}set encoding(e){Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===uo?Xt:ci}}Rn.DEFAULT_IMAGE=null,Rn.DEFAULT_MAPPING=i1,Rn.DEFAULT_ANISOTROPY=1;class Gt{constructor(e=0,t=0,n=0,r=1){Gt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=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,r=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*r+l[12]*o,this.y=l[1]*t+l[5]*n+l[9]*r+l[13]*o,this.z=l[2]*t+l[6]*n+l[10]*r+l[14]*o,this.w=l[3]*t+l[7]*n+l[11]*r+l[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,o;const f=e.elements,u=f[0],d=f[4],p=f[8],A=f[1],g=f[5],E=f[9],C=f[2],_=f[6],v=f[10];if(Math.abs(d-A)<.01&&Math.abs(p-C)<.01&&Math.abs(E-_)<.01){if(Math.abs(d+A)<.1&&Math.abs(p+C)<.1&&Math.abs(E+_)<.1&&Math.abs(u+g+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(u+1)/2,S=(g+1)/2,w=(v+1)/2,b=(d+A)/4,B=(p+C)/4,L=(E+_)/4;return y>S&&y>w?y<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(y),r=b/n,o=B/n):S>w?S<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(S),n=b/r,o=L/r):w<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(w),n=B/o,r=L/o),this.set(n,r,o,t),this}let x=Math.sqrt((_-E)*(_-E)+(p-C)*(p-C)+(A-d)*(A-d));return Math.abs(x)<.001&&(x=1),this.x=(_-E)/x,this.y=(p-C)/x,this.z=(A-d)/x,this.w=Math.acos((u+g+v-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 v3 extends fo{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Gt(0,0,e,t),this.scissorTest=!1,this.viewport=new Gt(0,0,e,t);const r={width:e,height:t,depth:1};n.encoding!==void 0&&(Ol("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===uo?Xt:ci),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:un,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new Rn(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new H1(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 Xi extends v3{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class V1 extends Rn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=qt,this.minFilter=qt,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class W1 extends Rn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=qt,this.minFilter=qt,this.wrapR=Fn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class pr{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,o,l,c){let f=n[r+0],u=n[r+1],d=n[r+2],p=n[r+3];const A=o[l+0],g=o[l+1],E=o[l+2],C=o[l+3];if(c===0){e[t+0]=f,e[t+1]=u,e[t+2]=d,e[t+3]=p;return}if(c===1){e[t+0]=A,e[t+1]=g,e[t+2]=E,e[t+3]=C;return}if(p!==C||f!==A||u!==g||d!==E){let _=1-c;const v=f*A+u*g+d*E+p*C,x=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){const w=Math.sqrt(y),b=Math.atan2(w,v*x);_=Math.sin(_*b)/w,c=Math.sin(c*b)/w}const S=c*x;if(f=f*_+A*S,u=u*_+g*S,d=d*_+E*S,p=p*_+C*S,_===1-c){const w=1/Math.sqrt(f*f+u*u+d*d+p*p);f*=w,u*=w,d*=w,p*=w}}e[t]=f,e[t+1]=u,e[t+2]=d,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,o,l){const c=n[r],f=n[r+1],u=n[r+2],d=n[r+3],p=o[l],A=o[l+1],g=o[l+2],E=o[l+3];return e[t]=c*E+d*p+f*g-u*A,e[t+1]=f*E+d*A+u*p-c*g,e[t+2]=u*E+d*g+c*A-f*p,e[t+3]=d*E-c*p-f*A-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,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,r=e._y,o=e._z,l=e._order,c=Math.cos,f=Math.sin,u=c(n/2),d=c(r/2),p=c(o/2),A=f(n/2),g=f(r/2),E=f(o/2);switch(l){case"XYZ":this._x=A*d*p+u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p-A*g*E;break;case"YXZ":this._x=A*d*p+u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p+A*g*E;break;case"ZXY":this._x=A*d*p-u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p-A*g*E;break;case"ZYX":this._x=A*d*p-u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p+A*g*E;break;case"YZX":this._x=A*d*p+u*g*E,this._y=u*g*p+A*d*E,this._z=u*d*E-A*g*p,this._w=u*d*p-A*g*E;break;case"XZY":this._x=A*d*p-u*g*E,this._y=u*g*p-A*d*E,this._z=u*d*E+A*g*p,this._w=u*d*p+A*g*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],o=t[8],l=t[1],c=t[5],f=t[9],u=t[2],d=t[6],p=t[10],A=n+c+p;if(A>0){const g=.5/Math.sqrt(A+1);this._w=.25/g,this._x=(d-f)*g,this._y=(o-u)*g,this._z=(l-r)*g}else if(n>c&&n>p){const g=2*Math.sqrt(1+n-c-p);this._w=(d-f)/g,this._x=.25*g,this._y=(r+l)/g,this._z=(o+u)/g}else if(c>p){const g=2*Math.sqrt(1+c-n-p);this._w=(o-u)/g,this._x=(r+l)/g,this._y=.25*g,this._z=(f+d)/g}else{const g=2*Math.sqrt(1+p-n-c);this._w=(l-r)/g,this._x=(o+u)/g,this._y=(f+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(yn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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,r=e._y,o=e._z,l=e._w,c=t._x,f=t._y,u=t._z,d=t._w;return this._x=n*d+l*c+r*u-o*f,this._y=r*d+l*f+o*c-n*u,this._z=o*d+l*u+n*f-r*c,this._w=l*d-n*c-r*f-o*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,o=this._z,l=this._w;let c=l*e._w+n*e._x+r*e._y+o*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=l,this._x=n,this._y=r,this._z=o,this;const f=1-c*c;if(f<=Number.EPSILON){const g=1-t;return this._w=g*l+t*this._w,this._x=g*n+t*this._x,this._y=g*r+t*this._y,this._z=g*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(f),d=Math.atan2(u,c),p=Math.sin((1-t)*d)/u,A=Math.sin(t*d)/u;return this._w=l*p+this._w*A,this._x=n*p+this._x*A,this._y=r*p+this._y*A,this._z=o*p+this._z*A,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(o),n*Math.cos(o),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}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(j1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(j1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*r,this.y=o[1]*t+o[4]*n+o[7]*r,this.z=o[2]*t+o[5]*n+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,o=e.elements,l=1/(o[3]*t+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*r+o[12])*l,this.y=(o[1]*t+o[5]*n+o[9]*r+o[13])*l,this.z=(o[2]*t+o[6]*n+o[10]*r+o[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,o=e.x,l=e.y,c=e.z,f=e.w,u=2*(l*r-c*n),d=2*(c*t-o*r),p=2*(o*n-l*t);return this.x=t+f*u+l*p-c*d,this.y=n+f*d+c*u-o*p,this.z=r+f*p+o*d-l*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,r=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r,this.y=o[1]*t+o[5]*n+o[9]*r,this.z=o[2]*t+o[6]*n+o[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,o=e.z,l=t.x,c=t.y,f=t.z;return this.x=r*f-o*c,this.y=o*l-n*f,this.z=n*c-r*l,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 vA.copy(this).projectOnVector(e),this.sub(vA)}reflect(e){return this.sub(vA.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(yn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,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()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const vA=new j,j1=new pr;class gn{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(Ki.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Ki.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=Ki.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 o=n.getAttribute("position");if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=o.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,Ki):Ki.fromBufferAttribute(o,l),Ki.applyMatrix4(e.matrixWorld),this.expandByPoint(Ki);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Iu.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Iu.copy(n.boundingBox)),Iu.applyMatrix4(e.matrixWorld),this.union(Iu)}const r=e.children;for(let o=0,l=r.length;o<l;o++)this.expandByObject(r[o],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,Ki),Ki.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(zl),xu.subVectors(this.max,zl),na.subVectors(e.a,zl),ia.subVectors(e.b,zl),ra.subVectors(e.c,zl),ds.subVectors(ia,na),As.subVectors(ra,ia),ho.subVectors(na,ra);let t=[0,-ds.z,ds.y,0,-As.z,As.y,0,-ho.z,ho.y,ds.z,0,-ds.x,As.z,0,-As.x,ho.z,0,-ho.x,-ds.y,ds.x,0,-As.y,As.x,0,-ho.y,ho.x,0];return!_A(t,na,ia,ra,xu)||(t=[1,0,0,0,1,0,0,0,1],!_A(t,na,ia,ra,xu))?!1:(Su.crossVectors(ds,As),t=[Su.x,Su.y,Su.z],_A(t,na,ia,ra,xu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ki).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ki).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:(kr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),kr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),kr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),kr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),kr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),kr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),kr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),kr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(kr),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 kr=[new j,new j,new j,new j,new j,new j,new j,new j],Ki=new j,Iu=new gn,na=new j,ia=new j,ra=new j,ds=new j,As=new j,ho=new j,zl=new j,xu=new j,Su=new j,Ao=new j;function _A(i,e,t,n,r){for(let o=0,l=i.length-3;o<=l;o+=3){Ao.fromArray(i,o);const c=r.x*Math.abs(Ao.x)+r.y*Math.abs(Ao.y)+r.z*Math.abs(Ao.z),f=e.dot(Ao),u=t.dot(Ao),d=n.dot(Ao);if(Math.max(-Math.max(f,u,d),Math.min(f,u,d))>c)return!1}return!0}const _3=new gn,Gl=new j,EA=new j;class Ji{constructor(e=new j,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_3.setFromPoints(e).getCenter(n);let r=0;for(let o=0,l=e.length;o<l;o++)r=Math.max(r,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gl.subVectors(e,this.center);const t=Gl.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(Gl,r/n),this.radius+=r}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):(EA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gl.copy(e.center).add(EA)),this.expandByPoint(Gl.copy(e.center).sub(EA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Fr=new j,yA=new j,wu=new j,ps=new j,CA=new j,Mu=new j,IA=new j;class Hl{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,Fr)),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=Fr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Fr.copy(this.origin).addScaledVector(this.direction,t),Fr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){yA.copy(e).add(t).multiplyScalar(.5),wu.copy(t).sub(e).normalize(),ps.copy(this.origin).sub(yA);const o=e.distanceTo(t)*.5,l=-this.direction.dot(wu),c=ps.dot(this.direction),f=-ps.dot(wu),u=ps.lengthSq(),d=Math.abs(1-l*l);let p,A,g,E;if(d>0)if(p=l*f-c,A=l*c-f,E=o*d,p>=0)if(A>=-E)if(A<=E){const C=1/d;p*=C,A*=C,g=p*(p+l*A+2*c)+A*(l*p+A+2*f)+u}else A=o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;else A=-o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;else A<=-E?(p=Math.max(0,-(-l*o+c)),A=p>0?-o:Math.min(Math.max(-o,-f),o),g=-p*p+A*(A+2*f)+u):A<=E?(p=0,A=Math.min(Math.max(-o,-f),o),g=A*(A+2*f)+u):(p=Math.max(0,-(l*o+c)),A=p>0?o:Math.min(Math.max(-o,-f),o),g=-p*p+A*(A+2*f)+u);else A=l>0?-o:o,p=Math.max(0,-(l*A+c)),g=-p*p+A*(A+2*f)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(yA).addScaledVector(wu,A),g}intersectSphere(e,t){Fr.subVectors(e.center,this.origin);const n=Fr.dot(this.direction),r=Fr.dot(Fr)-n*n,o=e.radius*e.radius;if(r>o)return null;const l=Math.sqrt(o-r),c=n-l,f=n+l;return f<0?null:c<0?this.at(f,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,r,o,l,c,f;const u=1/this.direction.x,d=1/this.direction.y,p=1/this.direction.z,A=this.origin;return u>=0?(n=(e.min.x-A.x)*u,r=(e.max.x-A.x)*u):(n=(e.max.x-A.x)*u,r=(e.min.x-A.x)*u),d>=0?(o=(e.min.y-A.y)*d,l=(e.max.y-A.y)*d):(o=(e.max.y-A.y)*d,l=(e.min.y-A.y)*d),n>l||o>r||((o>n||isNaN(n))&&(n=o),(l<r||isNaN(r))&&(r=l),p>=0?(c=(e.min.z-A.z)*p,f=(e.max.z-A.z)*p):(c=(e.max.z-A.z)*p,f=(e.min.z-A.z)*p),n>f||c>r)||((c>n||n!==n)&&(n=c),(f<r||r!==r)&&(r=f),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Fr)!==null}intersectTriangle(e,t,n,r,o){CA.subVectors(t,e),Mu.subVectors(n,e),IA.crossVectors(CA,Mu);let l=this.direction.dot(IA),c;if(l>0){if(r)return null;c=1}else if(l<0)c=-1,l=-l;else return null;ps.subVectors(this.origin,e);const f=c*this.direction.dot(Mu.crossVectors(ps,Mu));if(f<0)return null;const u=c*this.direction.dot(CA.cross(ps));if(u<0||f+u>l)return null;const d=-c*ps.dot(IA);return d<0?null:this.at(d/l,o)}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 lt{constructor(e,t,n,r,o,l,c,f,u,d,p,A,g,E,C,_){lt.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,r,o,l,c,f,u,d,p,A,g,E,C,_)}set(e,t,n,r,o,l,c,f,u,d,p,A,g,E,C,_){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=o,v[5]=l,v[9]=c,v[13]=f,v[2]=u,v[6]=d,v[10]=p,v[14]=A,v[3]=g,v[7]=E,v[11]=C,v[15]=_,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 lt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/sa.setFromMatrixColumn(e,0).length(),o=1/sa.setFromMatrixColumn(e,1).length(),l=1/sa.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,o=e.z,l=Math.cos(n),c=Math.sin(n),f=Math.cos(r),u=Math.sin(r),d=Math.cos(o),p=Math.sin(o);if(e.order==="XYZ"){const A=l*d,g=l*p,E=c*d,C=c*p;t[0]=f*d,t[4]=-f*p,t[8]=u,t[1]=g+E*u,t[5]=A-C*u,t[9]=-c*f,t[2]=C-A*u,t[6]=E+g*u,t[10]=l*f}else if(e.order==="YXZ"){const A=f*d,g=f*p,E=u*d,C=u*p;t[0]=A+C*c,t[4]=E*c-g,t[8]=l*u,t[1]=l*p,t[5]=l*d,t[9]=-c,t[2]=g*c-E,t[6]=C+A*c,t[10]=l*f}else if(e.order==="ZXY"){const A=f*d,g=f*p,E=u*d,C=u*p;t[0]=A-C*c,t[4]=-l*p,t[8]=E+g*c,t[1]=g+E*c,t[5]=l*d,t[9]=C-A*c,t[2]=-l*u,t[6]=c,t[10]=l*f}else if(e.order==="ZYX"){const A=l*d,g=l*p,E=c*d,C=c*p;t[0]=f*d,t[4]=E*u-g,t[8]=A*u+C,t[1]=f*p,t[5]=C*u+A,t[9]=g*u-E,t[2]=-u,t[6]=c*f,t[10]=l*f}else if(e.order==="YZX"){const A=l*f,g=l*u,E=c*f,C=c*u;t[0]=f*d,t[4]=C-A*p,t[8]=E*p+g,t[1]=p,t[5]=l*d,t[9]=-c*d,t[2]=-u*d,t[6]=g*p+E,t[10]=A-C*p}else if(e.order==="XZY"){const A=l*f,g=l*u,E=c*f,C=c*u;t[0]=f*d,t[4]=-p,t[8]=u*d,t[1]=A*p+C,t[5]=l*d,t[9]=g*p-E,t[2]=E*p-g,t[6]=c*d,t[10]=C*p+A}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(E3,e,y3)}lookAt(e,t,n){const r=this.elements;return Ci.subVectors(e,t),Ci.lengthSq()===0&&(Ci.z=1),Ci.normalize(),gs.crossVectors(n,Ci),gs.lengthSq()===0&&(Math.abs(n.z)===1?Ci.x+=1e-4:Ci.z+=1e-4,Ci.normalize(),gs.crossVectors(n,Ci)),gs.normalize(),Tu.crossVectors(Ci,gs),r[0]=gs.x,r[4]=Tu.x,r[8]=Ci.x,r[1]=gs.y,r[5]=Tu.y,r[9]=Ci.y,r[2]=gs.z,r[6]=Tu.z,r[10]=Ci.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,o=this.elements,l=n[0],c=n[4],f=n[8],u=n[12],d=n[1],p=n[5],A=n[9],g=n[13],E=n[2],C=n[6],_=n[10],v=n[14],x=n[3],y=n[7],S=n[11],w=n[15],b=r[0],B=r[4],L=r[8],R=r[12],T=r[1],N=r[5],k=r[9],O=r[13],F=r[2],V=r[6],X=r[10],te=r[14],q=r[3],Z=r[7],U=r[11],D=r[15];return o[0]=l*b+c*T+f*F+u*q,o[4]=l*B+c*N+f*V+u*Z,o[8]=l*L+c*k+f*X+u*U,o[12]=l*R+c*O+f*te+u*D,o[1]=d*b+p*T+A*F+g*q,o[5]=d*B+p*N+A*V+g*Z,o[9]=d*L+p*k+A*X+g*U,o[13]=d*R+p*O+A*te+g*D,o[2]=E*b+C*T+_*F+v*q,o[6]=E*B+C*N+_*V+v*Z,o[10]=E*L+C*k+_*X+v*U,o[14]=E*R+C*O+_*te+v*D,o[3]=x*b+y*T+S*F+w*q,o[7]=x*B+y*N+S*V+w*Z,o[11]=x*L+y*k+S*X+w*U,o[15]=x*R+y*O+S*te+w*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],o=e[12],l=e[1],c=e[5],f=e[9],u=e[13],d=e[2],p=e[6],A=e[10],g=e[14],E=e[3],C=e[7],_=e[11],v=e[15];return E*(+o*f*p-r*u*p-o*c*A+n*u*A+r*c*g-n*f*g)+C*(+t*f*g-t*u*A+o*l*A-r*l*g+r*u*d-o*f*d)+_*(+t*u*p-t*c*g-o*l*p+n*l*g+o*c*d-n*u*d)+v*(-r*c*d-t*f*p+t*c*A+r*l*p-n*l*A+n*f*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 r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],o=e[3],l=e[4],c=e[5],f=e[6],u=e[7],d=e[8],p=e[9],A=e[10],g=e[11],E=e[12],C=e[13],_=e[14],v=e[15],x=p*_*u-C*A*u+C*f*g-c*_*g-p*f*v+c*A*v,y=E*A*u-d*_*u-E*f*g+l*_*g+d*f*v-l*A*v,S=d*C*u-E*p*u+E*c*g-l*C*g-d*c*v+l*p*v,w=E*p*f-d*C*f-E*c*A+l*C*A+d*c*_-l*p*_,b=t*x+n*y+r*S+o*w;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/b;return e[0]=x*B,e[1]=(C*A*o-p*_*o-C*r*g+n*_*g+p*r*v-n*A*v)*B,e[2]=(c*_*o-C*f*o+C*r*u-n*_*u-c*r*v+n*f*v)*B,e[3]=(p*f*o-c*A*o-p*r*u+n*A*u+c*r*g-n*f*g)*B,e[4]=y*B,e[5]=(d*_*o-E*A*o+E*r*g-t*_*g-d*r*v+t*A*v)*B,e[6]=(E*f*o-l*_*o-E*r*u+t*_*u+l*r*v-t*f*v)*B,e[7]=(l*A*o-d*f*o+d*r*u-t*A*u-l*r*g+t*f*g)*B,e[8]=S*B,e[9]=(E*p*o-d*C*o-E*n*g+t*C*g+d*n*v-t*p*v)*B,e[10]=(l*C*o-E*c*o+E*n*u-t*C*u-l*n*v+t*c*v)*B,e[11]=(d*c*o-l*p*o-d*n*u+t*p*u+l*n*g-t*c*g)*B,e[12]=w*B,e[13]=(d*C*r-E*p*r+E*n*A-t*C*A-d*n*_+t*p*_)*B,e[14]=(E*c*r-l*C*r-E*n*f+t*C*f+l*n*_-t*c*_)*B,e[15]=(l*p*r-d*c*r+d*n*f-t*p*f-l*n*A+t*c*A)*B,this}scale(e){const t=this.elements,n=e.x,r=e.y,o=e.z;return t[0]*=n,t[4]*=r,t[8]*=o,t[1]*=n,t[5]*=r,t[9]*=o,t[2]*=n,t[6]*=r,t[10]*=o,t[3]*=n,t[7]*=r,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),o=1-n,l=e.x,c=e.y,f=e.z,u=o*l,d=o*c;return this.set(u*l+n,u*c-r*f,u*f+r*c,0,u*c+r*f,d*c+n,d*f-r*l,0,u*f-r*c,d*f+r*l,o*f*f+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,o,l){return this.set(1,n,o,0,e,1,l,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,o=t._x,l=t._y,c=t._z,f=t._w,u=o+o,d=l+l,p=c+c,A=o*u,g=o*d,E=o*p,C=l*d,_=l*p,v=c*p,x=f*u,y=f*d,S=f*p,w=n.x,b=n.y,B=n.z;return r[0]=(1-(C+v))*w,r[1]=(g+S)*w,r[2]=(E-y)*w,r[3]=0,r[4]=(g-S)*b,r[5]=(1-(A+v))*b,r[6]=(_+x)*b,r[7]=0,r[8]=(E+y)*B,r[9]=(_-x)*B,r[10]=(1-(A+C))*B,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let o=sa.set(r[0],r[1],r[2]).length();const l=sa.set(r[4],r[5],r[6]).length(),c=sa.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],$i.copy(this);const u=1/o,d=1/l,p=1/c;return $i.elements[0]*=u,$i.elements[1]*=u,$i.elements[2]*=u,$i.elements[4]*=d,$i.elements[5]*=d,$i.elements[6]*=d,$i.elements[8]*=p,$i.elements[9]*=p,$i.elements[10]*=p,t.setFromRotationMatrix($i),n.x=o,n.y=l,n.z=c,this}makePerspective(e,t,n,r,o,l,c=Ur){const f=this.elements,u=2*o/(t-e),d=2*o/(n-r),p=(t+e)/(t-e),A=(n+r)/(n-r);let g,E;if(c===Ur)g=-(l+o)/(l-o),E=-2*l*o/(l-o);else if(c===Eu)g=-l/(l-o),E=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=u,f[4]=0,f[8]=p,f[12]=0,f[1]=0,f[5]=d,f[9]=A,f[13]=0,f[2]=0,f[6]=0,f[10]=g,f[14]=E,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,t,n,r,o,l,c=Ur){const f=this.elements,u=1/(t-e),d=1/(n-r),p=1/(l-o),A=(t+e)*u,g=(n+r)*d;let E,C;if(c===Ur)E=(l+o)*p,C=-2*p;else if(c===Eu)E=o*p,C=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=2*u,f[4]=0,f[8]=0,f[12]=-A,f[1]=0,f[5]=2*d,f[9]=0,f[13]=-g,f[2]=0,f[6]=0,f[10]=C,f[14]=-E,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])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 sa=new j,$i=new lt,E3=new j(0,0,0),y3=new j(1,1,1),gs=new j,Tu=new j,Ci=new j,Y1=new lt,q1=new pr;class Bu{constructor(e=0,t=0,n=0,r=Bu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,o=r[0],l=r[4],c=r[8],f=r[1],u=r[5],d=r[9],p=r[2],A=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(yn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(A,u),this._z=0);break;case"YXZ":this._x=Math.asin(-yn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(f,u)):(this._y=Math.atan2(-p,o),this._z=0);break;case"ZXY":this._x=Math.asin(yn(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-l,u)):(this._y=0,this._z=Math.atan2(f,o));break;case"ZYX":this._y=Math.asin(-yn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(A,g),this._z=Math.atan2(f,o)):(this._x=0,this._z=Math.atan2(-l,u));break;case"YZX":this._z=Math.asin(yn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-p,o)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-yn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(A,u),this._y=Math.atan2(c,o)):(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 Y1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Y1,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return q1.setFromEuler(this),this.setFromQuaternion(q1,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}}Bu.DEFAULT_ORDER="XYZ";class xA{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 C3=0;const X1=new j,oa=new pr,Qr=new lt,Ru=new j,Vl=new j,I3=new j,x3=new pr,K1=new j(1,0,0),J1=new j(0,1,0),$1=new j(0,0,1),S3={type:"added"},w3={type:"removed"};class tn extends fo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:C3++}),this.uuid=qi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=tn.DEFAULT_UP.clone();const e=new j,t=new Bu,n=new pr,r=new j(1,1,1);function o(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new lt},normalMatrix:{value:new _t}}),this.matrix=new lt,this.matrixWorld=new lt,this.matrixAutoUpdate=tn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new xA,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return oa.setFromAxisAngle(e,t),this.quaternion.multiply(oa),this}rotateOnWorldAxis(e,t){return oa.setFromAxisAngle(e,t),this.quaternion.premultiply(oa),this}rotateX(e){return this.rotateOnAxis(K1,e)}rotateY(e){return this.rotateOnAxis(J1,e)}rotateZ(e){return this.rotateOnAxis($1,e)}translateOnAxis(e,t){return X1.copy(e).applyQuaternion(this.quaternion),this.position.add(X1.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(K1,e)}translateY(e){return this.translateOnAxis(J1,e)}translateZ(e){return this.translateOnAxis($1,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Qr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ru.copy(e):Ru.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Vl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Qr.lookAt(Vl,Ru,this.up):Qr.lookAt(Ru,Vl,this.up),this.quaternion.setFromRotationMatrix(Qr),r&&(Qr.extractRotation(r.matrixWorld),oa.setFromRotationMatrix(Qr),this.quaternion.premultiply(oa.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.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(S3)):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(w3)),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),Qr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Qr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Qr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t){let n=[];this[e]===t&&n.push(this);for(let r=0,o=this.children.length;r<o;r++){const l=this.children[r].getObjectsByProperty(e,t);l.length>0&&(n=n.concat(l))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,e,I3),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,x3,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;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,r=t.length;n<r;n++){const o=t[n];(o.matrixWorldAutoUpdate===!0||e===!0)&&o.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 r=this.children;for(let o=0,l=r.length;o<l;o++){const c=r[o];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 r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function o(c,f){return c[f.uuid]===void 0&&(c[f.uuid]=f.toJSON(e)),f.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const f=c.shapes;if(Array.isArray(f))for(let u=0,d=f.length;u<d;u++){const p=f[u];o(e.shapes,p)}else o(e.shapes,f)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let f=0,u=this.material.length;f<u;f++)c.push(o(e.materials,this.material[f]));r.material=c}else r.material=o(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const f=this.animations[c];r.animations.push(o(e.animations,f))}}if(t){const c=l(e.geometries),f=l(e.materials),u=l(e.textures),d=l(e.images),p=l(e.shapes),A=l(e.skeletons),g=l(e.animations),E=l(e.nodes);c.length>0&&(n.geometries=c),f.length>0&&(n.materials=f),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),p.length>0&&(n.shapes=p),A.length>0&&(n.skeletons=A),g.length>0&&(n.animations=g),E.length>0&&(n.nodes=E)}return n.object=r,n;function l(c){const f=[];for(const u in c){const d=c[u];delete d.metadata,f.push(d)}return f}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}tn.DEFAULT_UP=new j(0,1,0),tn.DEFAULT_MATRIX_AUTO_UPDATE=!0,tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Zi=new j,Or=new j,SA=new j,zr=new j,aa=new j,la=new j,Z1=new j,wA=new j,MA=new j,TA=new j;let bu=!1;class Hn{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Zi.subVectors(e,t),r.cross(Zi);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,n,r,o){Zi.subVectors(r,t),Or.subVectors(n,t),SA.subVectors(e,t);const l=Zi.dot(Zi),c=Zi.dot(Or),f=Zi.dot(SA),u=Or.dot(Or),d=Or.dot(SA),p=l*u-c*c;if(p===0)return o.set(-2,-1,-1);const A=1/p,g=(u*f-c*d)*A,E=(l*d-c*f)*A;return o.set(1-g-E,E,g)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,zr),zr.x>=0&&zr.y>=0&&zr.x+zr.y<=1}static getUV(e,t,n,r,o,l,c,f){return bu===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bu=!0),this.getInterpolation(e,t,n,r,o,l,c,f)}static getInterpolation(e,t,n,r,o,l,c,f){return this.getBarycoord(e,t,n,r,zr),f.setScalar(0),f.addScaledVector(o,zr.x),f.addScaledVector(l,zr.y),f.addScaledVector(c,zr.z),f}static isFrontFacing(e,t,n,r){return Zi.subVectors(n,t),Or.subVectors(e,t),Zi.cross(Or).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Zi.subVectors(this.c,this.b),Or.subVectors(this.a,this.b),Zi.cross(Or).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Hn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,o){return bu===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bu=!0),Hn.getInterpolation(e,this.a,this.b,this.c,t,n,r,o)}getInterpolation(e,t,n,r,o){return Hn.getInterpolation(e,this.a,this.b,this.c,t,n,r,o)}containsPoint(e){return Hn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,o=this.c;let l,c;aa.subVectors(r,n),la.subVectors(o,n),wA.subVectors(e,n);const f=aa.dot(wA),u=la.dot(wA);if(f<=0&&u<=0)return t.copy(n);MA.subVectors(e,r);const d=aa.dot(MA),p=la.dot(MA);if(d>=0&&p<=d)return t.copy(r);const A=f*p-d*u;if(A<=0&&f>=0&&d<=0)return l=f/(f-d),t.copy(n).addScaledVector(aa,l);TA.subVectors(e,o);const g=aa.dot(TA),E=la.dot(TA);if(E>=0&&g<=E)return t.copy(o);const C=g*u-f*E;if(C<=0&&u>=0&&E<=0)return c=u/(u-E),t.copy(n).addScaledVector(la,c);const _=d*E-g*p;if(_<=0&&p-d>=0&&g-E>=0)return Z1.subVectors(o,r),c=(p-d)/(p-d+(g-E)),t.copy(r).addScaledVector(Z1,c);const v=1/(_+C+A);return l=C*v,c=A*v,t.copy(n).addScaledVector(aa,l).addScaledVector(la,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const e_={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},ms={h:0,s:0,l:0},Lu={h:0,s:0,l:0};function BA(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class et{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 r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Xt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Nt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=Nt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Nt.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=Nt.workingColorSpace){if(e=hA(e,1),t=yn(t,0,1),n=yn(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,l=2*n-o;this.r=BA(l,o,e+1/3),this.g=BA(l,o,e),this.b=BA(l,o,e-1/3)}return Nt.toWorkingColorSpace(this,r),this}setStyle(e,t=Xt){function n(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=r[1],c=r[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=r[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,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=Xt){const n=e_[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=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}copyLinearToSRGB(e){return this.r=gA(e.r),this.g=gA(e.g),this.b=gA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Xt){return Nt.fromWorkingColorSpace(Vn.copy(this),e),Math.round(yn(Vn.r*255,0,255))*65536+Math.round(yn(Vn.g*255,0,255))*256+Math.round(yn(Vn.b*255,0,255))}getHexString(e=Xt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Nt.workingColorSpace){Nt.fromWorkingColorSpace(Vn.copy(this),t);const n=Vn.r,r=Vn.g,o=Vn.b,l=Math.max(n,r,o),c=Math.min(n,r,o);let f,u;const d=(c+l)/2;if(c===l)f=0,u=0;else{const p=l-c;switch(u=d<=.5?p/(l+c):p/(2-l-c),l){case n:f=(r-o)/p+(r<o?6:0);break;case r:f=(o-n)/p+2;break;case o:f=(n-r)/p+4;break}f/=6}return e.h=f,e.s=u,e.l=d,e}getRGB(e,t=Nt.workingColorSpace){return Nt.fromWorkingColorSpace(Vn.copy(this),t),e.r=Vn.r,e.g=Vn.g,e.b=Vn.b,e}getStyle(e=Xt){Nt.fromWorkingColorSpace(Vn.copy(this),e);const t=Vn.r,n=Vn.g,r=Vn.b;return e!==Xt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(ms),this.setHSL(ms.h+e,ms.s+t,ms.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(ms),e.getHSL(Lu);const n=Fl(ms.h,Lu.h,t),r=Fl(ms.s,Lu.s,t),o=Fl(ms.l,Lu.l,t);return this.setHSL(n,r,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*r,this.g=o[1]*t+o[4]*n+o[7]*r,this.b=o[2]*t+o[5]*n+o[8]*r,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 Vn=new et;et.NAMES=e_;let M3=0;class gr extends fo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:M3++}),this.uuid=qi(),this.name="",this.type="Material",this.blending=Yo,this.side=ji,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=qd,this.blendDst=Xd,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new et(0,0,0),this.blendAlpha=0,this.depthFunc=ou,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=N1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=$o,this.stencilZFail=$o,this.stencilZPass=$o,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 r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.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&&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.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!==Yo&&(n.blending=this.blending),this.side!==ji&&(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!==qd&&(n.blendSrc=this.blendSrc),this.blendDst!==Xd&&(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!==ou&&(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!==N1&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==$o&&(n.stencilFail=this.stencilFail),this.stencilZFail!==$o&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==$o&&(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 r(o){const l=[];for(const c in o){const f=o[c];delete f.metadata,l.push(f)}return l}if(t){const o=r(e.textures),l=r(e.images);o.length>0&&(n.textures=o),l.length>0&&(n.images=l)}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 r=t.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=t[o].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 Gr extends gr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new et(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$v,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Hr=T3();function T3(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let f=0;f<256;++f){const u=f-127;u<-27?(n[f]=0,n[f|256]=32768,r[f]=24,r[f|256]=24):u<-14?(n[f]=1024>>-u-14,n[f|256]=1024>>-u-14|32768,r[f]=-u-1,r[f|256]=-u-1):u<=15?(n[f]=u+15<<10,n[f|256]=u+15<<10|32768,r[f]=13,r[f|256]=13):u<128?(n[f]=31744,n[f|256]=64512,r[f]=24,r[f|256]=24):(n[f]=31744,n[f|256]=64512,r[f]=13,r[f|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64);for(let f=1;f<1024;++f){let u=f<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,o[f]=u|d}for(let f=1024;f<2048;++f)o[f]=939524096+(f-1024<<13);for(let f=1;f<31;++f)l[f]=f<<23;l[31]=1199570944,l[32]=2147483648;for(let f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(let f=1;f<64;++f)f!==32&&(c[f]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:o,exponentTable:l,offsetTable:c}}function B3(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=yn(i,-65504,65504),Hr.floatView[0]=i;const e=Hr.uint32View[0],t=e>>23&511;return Hr.baseTable[t]+((e&8388607)>>Hr.shiftTable[t])}function R3(i){const e=i>>10;return Hr.uint32View[0]=Hr.mantissaTable[Hr.offsetTable[e]+(i&1023)]+Hr.exponentTable[e],Hr.floatView[0]}const Du={toHalfFloat:B3,fromHalfFloat:R3},mn=new j,Nu=new Ke;class bn{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=uA,this.updateRange={offset:0,count:-1},this.gpuType=hn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[e+r]=t.array[n+r];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++)Nu.fromBufferAttribute(this,t),Nu.applyMatrix3(e),this.setXY(t,Nu.x,Nu.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix3(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix4(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.applyNormalMatrix(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)mn.fromBufferAttribute(this,t),mn.transformDirection(e),this.setXYZ(t,mn.x,mn.y,mn.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=Ar(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ot(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ar(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ar(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),o=Ot(o,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=o,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!==uA&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}class t_ extends bn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class n_ extends bn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class er extends bn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let b3=0;const Pi=new lt,RA=new tn,ca=new j,Ii=new gn,Wl=new gn,Ln=new j;class xi extends fo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:b3++}),this.uuid=qi(),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(F1(e)?n_:t_)(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 o=new _t().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Pi.makeRotationFromQuaternion(e),this.applyMatrix4(Pi),this}rotateX(e){return Pi.makeRotationX(e),this.applyMatrix4(Pi),this}rotateY(e){return Pi.makeRotationY(e),this.applyMatrix4(Pi),this}rotateZ(e){return Pi.makeRotationZ(e),this.applyMatrix4(Pi),this}translate(e,t,n){return Pi.makeTranslation(e,t,n),this.applyMatrix4(Pi),this}scale(e,t,n){return Pi.makeScale(e,t,n),this.applyMatrix4(Pi),this}lookAt(e){return RA.lookAt(e),RA.updateMatrix(),this.applyMatrix4(RA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ca).negate(),this.translate(ca.x,ca.y,ca.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];t.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new er(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new gn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',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,r=t.length;n<r;n++){const o=t[n];Ii.setFromBufferAttribute(o),this.morphTargetsRelative?(Ln.addVectors(this.boundingBox.min,Ii.min),this.boundingBox.expandByPoint(Ln),Ln.addVectors(this.boundingBox.max,Ii.max),this.boundingBox.expandByPoint(Ln)):(this.boundingBox.expandByPoint(Ii.min),this.boundingBox.expandByPoint(Ii.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 Ji);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(Ii.setFromBufferAttribute(e),t)for(let o=0,l=t.length;o<l;o++){const c=t[o];Wl.setFromBufferAttribute(c),this.morphTargetsRelative?(Ln.addVectors(Ii.min,Wl.min),Ii.expandByPoint(Ln),Ln.addVectors(Ii.max,Wl.max),Ii.expandByPoint(Ln)):(Ii.expandByPoint(Wl.min),Ii.expandByPoint(Wl.max))}Ii.getCenter(n);let r=0;for(let o=0,l=e.count;o<l;o++)Ln.fromBufferAttribute(e,o),r=Math.max(r,n.distanceToSquared(Ln));if(t)for(let o=0,l=t.length;o<l;o++){const c=t[o],f=this.morphTargetsRelative;for(let u=0,d=c.count;u<d;u++)Ln.fromBufferAttribute(c,u),f&&(ca.fromBufferAttribute(e,u),Ln.add(ca)),r=Math.max(r,n.distanceToSquared(Ln))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(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=e.array,r=t.position.array,o=t.normal.array,l=t.uv.array,c=r.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*c),4));const f=this.getAttribute("tangent").array,u=[],d=[];for(let T=0;T<c;T++)u[T]=new j,d[T]=new j;const p=new j,A=new j,g=new j,E=new Ke,C=new Ke,_=new Ke,v=new j,x=new j;function y(T,N,k){p.fromArray(r,T*3),A.fromArray(r,N*3),g.fromArray(r,k*3),E.fromArray(l,T*2),C.fromArray(l,N*2),_.fromArray(l,k*2),A.sub(p),g.sub(p),C.sub(E),_.sub(E);const O=1/(C.x*_.y-_.x*C.y);isFinite(O)&&(v.copy(A).multiplyScalar(_.y).addScaledVector(g,-C.y).multiplyScalar(O),x.copy(g).multiplyScalar(C.x).addScaledVector(A,-_.x).multiplyScalar(O),u[T].add(v),u[N].add(v),u[k].add(v),d[T].add(x),d[N].add(x),d[k].add(x))}let S=this.groups;S.length===0&&(S=[{start:0,count:n.length}]);for(let T=0,N=S.length;T<N;++T){const k=S[T],O=k.start,F=k.count;for(let V=O,X=O+F;V<X;V+=3)y(n[V+0],n[V+1],n[V+2])}const w=new j,b=new j,B=new j,L=new j;function R(T){B.fromArray(o,T*3),L.copy(B);const N=u[T];w.copy(N),w.sub(B.multiplyScalar(B.dot(N))).normalize(),b.crossVectors(L,N);const O=b.dot(d[T])<0?-1:1;f[T*4]=w.x,f[T*4+1]=w.y,f[T*4+2]=w.z,f[T*4+3]=O}for(let T=0,N=S.length;T<N;++T){const k=S[T],O=k.start,F=k.count;for(let V=O,X=O+F;V<X;V+=3)R(n[V+0]),R(n[V+1]),R(n[V+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 bn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let A=0,g=n.count;A<g;A++)n.setXYZ(A,0,0,0);const r=new j,o=new j,l=new j,c=new j,f=new j,u=new j,d=new j,p=new j;if(e)for(let A=0,g=e.count;A<g;A+=3){const E=e.getX(A+0),C=e.getX(A+1),_=e.getX(A+2);r.fromBufferAttribute(t,E),o.fromBufferAttribute(t,C),l.fromBufferAttribute(t,_),d.subVectors(l,o),p.subVectors(r,o),d.cross(p),c.fromBufferAttribute(n,E),f.fromBufferAttribute(n,C),u.fromBufferAttribute(n,_),c.add(d),f.add(d),u.add(d),n.setXYZ(E,c.x,c.y,c.z),n.setXYZ(C,f.x,f.y,f.z),n.setXYZ(_,u.x,u.y,u.z)}else for(let A=0,g=t.count;A<g;A+=3)r.fromBufferAttribute(t,A+0),o.fromBufferAttribute(t,A+1),l.fromBufferAttribute(t,A+2),d.subVectors(l,o),p.subVectors(r,o),d.cross(p),n.setXYZ(A+0,d.x,d.y,d.z),n.setXYZ(A+1,d.x,d.y,d.z),n.setXYZ(A+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++)Ln.fromBufferAttribute(e,t),Ln.normalize(),e.setXYZ(t,Ln.x,Ln.y,Ln.z)}toNonIndexed(){function e(c,f){const u=c.array,d=c.itemSize,p=c.normalized,A=new u.constructor(f.length*d);let g=0,E=0;for(let C=0,_=f.length;C<_;C++){c.isInterleavedBufferAttribute?g=f[C]*c.data.stride+c.offset:g=f[C]*d;for(let v=0;v<d;v++)A[E++]=u[g++]}return new bn(A,d,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new xi,n=this.index.array,r=this.attributes;for(const c in r){const f=r[c],u=e(f,n);t.setAttribute(c,u)}const o=this.morphAttributes;for(const c in o){const f=[],u=o[c];for(let d=0,p=u.length;d<p;d++){const A=u[d],g=e(A,n);f.push(g)}t.morphAttributes[c]=f}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let c=0,f=l.length;c<f;c++){const u=l[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 f=this.parameters;for(const u in f)f[u]!==void 0&&(e[u]=f[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 f in n){const u=n[f];e.data.attributes[f]=u.toJSON(e.data)}const r={};let o=!1;for(const f in this.morphAttributes){const u=this.morphAttributes[f],d=[];for(let p=0,A=u.length;p<A;p++){const g=u[p];d.push(g.toJSON(e.data))}d.length>0&&(r[f]=d,o=!0)}o&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));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 r=e.attributes;for(const u in r){const d=r[u];this.setAttribute(u,d.clone(t))}const o=e.morphAttributes;for(const u in o){const d=[],p=o[u];for(let A=0,g=p.length;A<g;A++)d.push(p[A].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let u=0,d=l.length;u<d;u++){const p=l[u];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const f=e.boundingSphere;return f!==null&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const i_=new lt,po=new Hl,Pu=new Ji,r_=new j,ua=new j,fa=new j,ha=new j,bA=new j,Uu=new j,ku=new Ke,Fu=new Ke,Qu=new Ke,s_=new j,o_=new j,a_=new j,Ou=new j,zu=new j;class Wn extends tn{constructor(e=new xi,t=new Gr){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 t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(o&&c){Uu.set(0,0,0);for(let f=0,u=o.length;f<u;f++){const d=c[f],p=o[f];d!==0&&(bA.fromBufferAttribute(p,e),l?Uu.addScaledVector(bA,d):Uu.addScaledVector(bA.sub(t),d))}t.add(Uu)}return t}raycast(e,t){const n=this.geometry,r=this.material,o=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Pu.copy(n.boundingSphere),Pu.applyMatrix4(o),po.copy(e.ray).recast(e.near),!(Pu.containsPoint(po.origin)===!1&&(po.intersectSphere(Pu,r_)===null||po.origin.distanceToSquared(r_)>(e.far-e.near)**2))&&(i_.copy(o).invert(),po.copy(e.ray).applyMatrix4(i_),!(n.boundingBox!==null&&po.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,po)))}_computeIntersections(e,t,n){let r;const o=this.geometry,l=this.material,c=o.index,f=o.attributes.position,u=o.attributes.uv,d=o.attributes.uv1,p=o.attributes.normal,A=o.groups,g=o.drawRange;if(c!==null)if(Array.isArray(l))for(let E=0,C=A.length;E<C;E++){const _=A[E],v=l[_.materialIndex],x=Math.max(_.start,g.start),y=Math.min(c.count,Math.min(_.start+_.count,g.start+g.count));for(let S=x,w=y;S<w;S+=3){const b=c.getX(S),B=c.getX(S+1),L=c.getX(S+2);r=Gu(this,v,e,n,u,d,p,b,B,L),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const E=Math.max(0,g.start),C=Math.min(c.count,g.start+g.count);for(let _=E,v=C;_<v;_+=3){const x=c.getX(_),y=c.getX(_+1),S=c.getX(_+2);r=Gu(this,l,e,n,u,d,p,x,y,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(f!==void 0)if(Array.isArray(l))for(let E=0,C=A.length;E<C;E++){const _=A[E],v=l[_.materialIndex],x=Math.max(_.start,g.start),y=Math.min(f.count,Math.min(_.start+_.count,g.start+g.count));for(let S=x,w=y;S<w;S+=3){const b=S,B=S+1,L=S+2;r=Gu(this,v,e,n,u,d,p,b,B,L),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const E=Math.max(0,g.start),C=Math.min(f.count,g.start+g.count);for(let _=E,v=C;_<v;_+=3){const x=_,y=_+1,S=_+2;r=Gu(this,l,e,n,u,d,p,x,y,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function L3(i,e,t,n,r,o,l,c){let f;if(e.side===Bn?f=n.intersectTriangle(l,o,r,!0,c):f=n.intersectTriangle(r,o,l,e.side===ji,c),f===null)return null;zu.copy(c),zu.applyMatrix4(i.matrixWorld);const u=t.ray.origin.distanceTo(zu);return u<t.near||u>t.far?null:{distance:u,point:zu.clone(),object:i}}function Gu(i,e,t,n,r,o,l,c,f,u){i.getVertexPosition(c,ua),i.getVertexPosition(f,fa),i.getVertexPosition(u,ha);const d=L3(i,e,t,n,ua,fa,ha,Ou);if(d){r&&(ku.fromBufferAttribute(r,c),Fu.fromBufferAttribute(r,f),Qu.fromBufferAttribute(r,u),d.uv=Hn.getInterpolation(Ou,ua,fa,ha,ku,Fu,Qu,new Ke)),o&&(ku.fromBufferAttribute(o,c),Fu.fromBufferAttribute(o,f),Qu.fromBufferAttribute(o,u),d.uv1=Hn.getInterpolation(Ou,ua,fa,ha,ku,Fu,Qu,new Ke),d.uv2=d.uv1),l&&(s_.fromBufferAttribute(l,c),o_.fromBufferAttribute(l,f),a_.fromBufferAttribute(l,u),d.normal=Hn.getInterpolation(Ou,ua,fa,ha,s_,o_,a_,new j),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const p={a:c,b:f,c:u,normal:new j,materialIndex:0};Hn.getNormal(ua,fa,ha,p.normal),d.face=p}return d}class jl extends xi{constructor(e=1,t=1,n=1,r=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:o,depthSegments:l};const c=this;r=Math.floor(r),o=Math.floor(o),l=Math.floor(l);const f=[],u=[],d=[],p=[];let A=0,g=0;E("z","y","x",-1,-1,n,t,e,l,o,0),E("z","y","x",1,-1,n,t,-e,l,o,1),E("x","z","y",1,1,e,n,t,r,l,2),E("x","z","y",1,-1,e,n,-t,r,l,3),E("x","y","z",1,-1,e,t,n,r,o,4),E("x","y","z",-1,-1,e,t,-n,r,o,5),this.setIndex(f),this.setAttribute("position",new er(u,3)),this.setAttribute("normal",new er(d,3)),this.setAttribute("uv",new er(p,2));function E(C,_,v,x,y,S,w,b,B,L,R){const T=S/B,N=w/L,k=S/2,O=w/2,F=b/2,V=B+1,X=L+1;let te=0,q=0;const Z=new j;for(let U=0;U<X;U++){const D=U*N-O;for(let G=0;G<V;G++){const K=G*T-k;Z[C]=K*x,Z[_]=D*y,Z[v]=F,u.push(Z.x,Z.y,Z.z),Z[C]=0,Z[_]=0,Z[v]=b>0?1:-1,d.push(Z.x,Z.y,Z.z),p.push(G/B),p.push(1-U/L),te+=1}}for(let U=0;U<L;U++)for(let D=0;D<B;D++){const G=A+D+V*U,K=A+D+V*(U+1),J=A+(D+1)+V*(U+1),Ae=A+(D+1)+V*U;f.push(G,K,Ae),f.push(K,J,Ae),q+=6}c.addGroup(g,q,R),g+=q,A+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function da(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function $n(i){const e={};for(let t=0;t<i.length;t++){const n=da(i[t]);for(const r in n)e[r]=n[r]}return e}function D3(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function l_(i){return i.getRenderTarget()===null?i.outputColorSpace:Nt.workingColorSpace}const Hu={clone:da,merge:$n};var N3=`void main() {
37
37
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
38
38
  }`,P3=`void main() {
39
39
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
40
- }`;class Si extends gr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=N3,this.fragmentShader=P3,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=da(e.uniforms),this.uniformsGroups=D3(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 r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?t.uniforms[r]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[r]={type:"m4",value:l.toArray()}:t.uniforms[r]={value:l}}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 r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class c_ extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ct,this.projectionMatrix=new ct,this.projectionMatrixInverse=new ct,this.coordinateSystem=Ur}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class $n extends c_{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=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=$o*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(kl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $o*2*Math.atan(Math.tan(kl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,o,l){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=r,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(kl*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,o=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const f=l.fullWidth,u=l.fullHeight;o+=l.offsetX*r/f,t-=l.offsetY*n/u,r*=l.width/f,n*=l.height/u}const c=this.filmOffset;c!==0&&(o+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Aa=-90,pa=1;class U3 extends tn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new $n(Aa,pa,e,t);r.layers=this.layers,this.add(r);const o=new $n(Aa,pa,e,t);o.layers=this.layers,this.add(o);const l=new $n(Aa,pa,e,t);l.layers=this.layers,this.add(l);const c=new $n(Aa,pa,e,t);c.layers=this.layers,this.add(c);const f=new $n(Aa,pa,e,t);f.layers=this.layers,this.add(f);const u=new $n(Aa,pa,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,o,l,c,f]=t;for(const u of t)this.remove(u);if(e===Ur)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),f.up.set(0,1,0),f.lookAt(0,0,-1);else if(e===Eu)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),f.up.set(0,-1,0),f.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:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,l,c,f,u,d]=this.children,p=e.getRenderTarget(),A=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),E=e.xr.enabled;e.xr.enabled=!1;const C=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,o),e.setRenderTarget(n,1,r),e.render(t,l),e.setRenderTarget(n,2,r),e.render(t,c),e.setRenderTarget(n,3,r),e.render(t,f),e.setRenderTarget(n,4,r),e.render(t,u),n.texture.generateMipmaps=C,e.setRenderTarget(n,5,r),e.render(t,d),e.setRenderTarget(p,A,g),e.xr.enabled=E,n.texture.needsPMREMUpdate=!0}}class u_ extends Rn{constructor(e,t,n,r,o,l,c,f,u,d){e=e!==void 0?e:[],t=t!==void 0?t:so,super(e,t,n,r,o,l,c,f,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class k3 extends Xi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];t.encoding!==void 0&&(Ol("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===uo?Xt:ci),this.texture=new u_(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:un}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:`
40
+ }`;class Si extends gr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=N3,this.fragmentShader=P3,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=da(e.uniforms),this.uniformsGroups=D3(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 r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?t.uniforms[r]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[r]={type:"m4",value:l.toArray()}:t.uniforms[r]={value:l}}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 r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class c_ extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new lt,this.projectionMatrix=new lt,this.projectionMatrixInverse=new lt,this.coordinateSystem=Ur}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Zn extends c_{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=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=Zo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(kl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Zo*2*Math.atan(Math.tan(kl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,o,l){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=r,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(kl*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,o=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const f=l.fullWidth,u=l.fullHeight;o+=l.offsetX*r/f,t-=l.offsetY*n/u,r*=l.width/f,n*=l.height/u}const c=this.filmOffset;c!==0&&(o+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Aa=-90,pa=1;class U3 extends tn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Zn(Aa,pa,e,t);r.layers=this.layers,this.add(r);const o=new Zn(Aa,pa,e,t);o.layers=this.layers,this.add(o);const l=new Zn(Aa,pa,e,t);l.layers=this.layers,this.add(l);const c=new Zn(Aa,pa,e,t);c.layers=this.layers,this.add(c);const f=new Zn(Aa,pa,e,t);f.layers=this.layers,this.add(f);const u=new Zn(Aa,pa,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,o,l,c,f]=t;for(const u of t)this.remove(u);if(e===Ur)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),f.up.set(0,1,0),f.lookAt(0,0,-1);else if(e===Eu)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),f.up.set(0,-1,0),f.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:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,l,c,f,u,d]=this.children,p=e.getRenderTarget(),A=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),E=e.xr.enabled;e.xr.enabled=!1;const C=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,o),e.setRenderTarget(n,1,r),e.render(t,l),e.setRenderTarget(n,2,r),e.render(t,c),e.setRenderTarget(n,3,r),e.render(t,f),e.setRenderTarget(n,4,r),e.render(t,u),n.texture.generateMipmaps=C,e.setRenderTarget(n,5,r),e.render(t,d),e.setRenderTarget(p,A,g),e.xr.enabled=E,n.texture.needsPMREMUpdate=!0}}class u_ extends Rn{constructor(e,t,n,r,o,l,c,f,u,d){e=e!==void 0?e:[],t=t!==void 0?t:so,super(e,t,n,r,o,l,c,f,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class k3 extends Xi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];t.encoding!==void 0&&(Ol("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===uo?Xt:ci),this.texture=new u_(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:un}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 iN=Object.defineProperty;var rN=(Ys,Tr,Br)=>Tr in Ys?iN(Ys,Tr,{enumerable:!0
72
72
  gl_FragColor = texture2D( tEquirect, sampleUV );
73
73
 
74
74
  }
75
- `},r=new jl(5,5,5),o=new Si({name:"CubemapFromEquirect",uniforms:da(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Bn,blending:Nr});o.uniforms.tEquirect.value=t;const l=new Wn(r,o),c=t.minFilter;return t.minFilter===Pr&&(t.minFilter=un),new U3(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t,n,r){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,r);e.setRenderTarget(o)}}const LA=new j,F3=new j,Q3=new _t;class mr{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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=LA.subVectors(n,t).cross(F3.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(LA),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}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||Q3.getNormalMatrix(e),r=this.coplanarPoint(LA).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(o),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 go=new Ji,Vu=new j;class DA{constructor(e=new mr,t=new mr,n=new mr,r=new mr,o=new mr,l=new mr){this.planes=[e,t,n,r,o,l]}set(e,t,n,r,o,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(r),c[4].copy(o),c[5].copy(l),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=Ur){const n=this.planes,r=e.elements,o=r[0],l=r[1],c=r[2],f=r[3],u=r[4],d=r[5],p=r[6],A=r[7],g=r[8],E=r[9],C=r[10],_=r[11],v=r[12],S=r[13],y=r[14],x=r[15];if(n[0].setComponents(f-o,A-u,_-g,x-v).normalize(),n[1].setComponents(f+o,A+u,_+g,x+v).normalize(),n[2].setComponents(f+l,A+d,_+E,x+S).normalize(),n[3].setComponents(f-l,A-d,_-E,x-S).normalize(),n[4].setComponents(f-c,A-p,_-C,x-y).normalize(),t===Ur)n[5].setComponents(f+c,A+p,_+C,x+y).normalize();else if(t===Eu)n[5].setComponents(c,p,C,y).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(),go.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(e){return go.center.set(0,0,0),go.radius=.7071067811865476,go.applyMatrix4(e.matrixWorld),this.intersectsSphere(go)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Vu.x=r.normal.x>0?e.max.x:e.min.x,Vu.y=r.normal.y>0?e.max.y:e.min.y,Vu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Vu)<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 f_(){let i=null,e=!1,t=null,n=null;function r(o,l){t(o,l),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){i=o}}}function O3(i,e){const t=e.isWebGL2,n=new WeakMap;function r(u,d){const p=u.array,A=u.usage,g=i.createBuffer();i.bindBuffer(d,g),i.bufferData(d,p,A),u.onUploadCallback();let E;if(p instanceof Float32Array)E=i.FLOAT;else if(p instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)E=i.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=i.UNSIGNED_SHORT;else if(p instanceof Int16Array)E=i.SHORT;else if(p instanceof Uint32Array)E=i.UNSIGNED_INT;else if(p instanceof Int32Array)E=i.INT;else if(p instanceof Int8Array)E=i.BYTE;else if(p instanceof Uint8Array)E=i.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)E=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:g,type:E,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version}}function o(u,d,p){const A=d.array,g=d.updateRange;i.bindBuffer(p,u),g.count===-1?i.bufferSubData(p,0,A):(t?i.bufferSubData(p,g.offset*A.BYTES_PER_ELEMENT,A,g.offset,g.count):i.bufferSubData(p,g.offset*A.BYTES_PER_ELEMENT,A.subarray(g.offset,g.offset+g.count)),g.count=-1),d.onUploadCallback()}function l(u){return u.isInterleavedBufferAttribute&&(u=u.data),n.get(u)}function c(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=n.get(u);d&&(i.deleteBuffer(d.buffer),n.delete(u))}function f(u,d){if(u.isGLBufferAttribute){const A=n.get(u);(!A||A.version<u.version)&&n.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);const p=n.get(u);p===void 0?n.set(u,r(u,d)):p.version<u.version&&(o(p.buffer,u,d),p.version=u.version)}return{get:l,remove:c,update:f}}class Wu extends xi{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const o=e/2,l=t/2,c=Math.floor(n),f=Math.floor(r),u=c+1,d=f+1,p=e/c,A=t/f,g=[],E=[],C=[],_=[];for(let v=0;v<d;v++){const S=v*A-l;for(let y=0;y<u;y++){const x=y*p-o;E.push(x,-S,0),C.push(0,0,1),_.push(y/c),_.push(1-v/f)}}for(let v=0;v<f;v++)for(let S=0;S<c;S++){const y=S+u*v,x=S+u*(v+1),w=S+1+u*(v+1),b=S+1+u*v;g.push(y,x,b),g.push(x,w,b)}this.setIndex(g),this.setAttribute("position",new er(E,3)),this.setAttribute("normal",new er(C,3)),this.setAttribute("uv",new er(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wu(e.width,e.height,e.widthSegments,e.heightSegments)}}var z3=`#ifdef USE_ALPHAHASH
75
+ `},r=new jl(5,5,5),o=new Si({name:"CubemapFromEquirect",uniforms:da(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Bn,blending:Nr});o.uniforms.tEquirect.value=t;const l=new Wn(r,o),c=t.minFilter;return t.minFilter===Pr&&(t.minFilter=un),new U3(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t,n,r){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,r);e.setRenderTarget(o)}}const LA=new j,F3=new j,Q3=new _t;class mr{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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=LA.subVectors(n,t).cross(F3.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(LA),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}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||Q3.getNormalMatrix(e),r=this.coplanarPoint(LA).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(o),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 go=new Ji,Vu=new j;class DA{constructor(e=new mr,t=new mr,n=new mr,r=new mr,o=new mr,l=new mr){this.planes=[e,t,n,r,o,l]}set(e,t,n,r,o,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(r),c[4].copy(o),c[5].copy(l),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=Ur){const n=this.planes,r=e.elements,o=r[0],l=r[1],c=r[2],f=r[3],u=r[4],d=r[5],p=r[6],A=r[7],g=r[8],E=r[9],C=r[10],_=r[11],v=r[12],x=r[13],y=r[14],S=r[15];if(n[0].setComponents(f-o,A-u,_-g,S-v).normalize(),n[1].setComponents(f+o,A+u,_+g,S+v).normalize(),n[2].setComponents(f+l,A+d,_+E,S+x).normalize(),n[3].setComponents(f-l,A-d,_-E,S-x).normalize(),n[4].setComponents(f-c,A-p,_-C,S-y).normalize(),t===Ur)n[5].setComponents(f+c,A+p,_+C,S+y).normalize();else if(t===Eu)n[5].setComponents(c,p,C,y).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(),go.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),go.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(go)}intersectsSprite(e){return go.center.set(0,0,0),go.radius=.7071067811865476,go.applyMatrix4(e.matrixWorld),this.intersectsSphere(go)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Vu.x=r.normal.x>0?e.max.x:e.min.x,Vu.y=r.normal.y>0?e.max.y:e.min.y,Vu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Vu)<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 f_(){let i=null,e=!1,t=null,n=null;function r(o,l){t(o,l),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){i=o}}}function O3(i,e){const t=e.isWebGL2,n=new WeakMap;function r(u,d){const p=u.array,A=u.usage,g=i.createBuffer();i.bindBuffer(d,g),i.bufferData(d,p,A),u.onUploadCallback();let E;if(p instanceof Float32Array)E=i.FLOAT;else if(p instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)E=i.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=i.UNSIGNED_SHORT;else if(p instanceof Int16Array)E=i.SHORT;else if(p instanceof Uint32Array)E=i.UNSIGNED_INT;else if(p instanceof Int32Array)E=i.INT;else if(p instanceof Int8Array)E=i.BYTE;else if(p instanceof Uint8Array)E=i.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)E=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:g,type:E,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version}}function o(u,d,p){const A=d.array,g=d.updateRange;i.bindBuffer(p,u),g.count===-1?i.bufferSubData(p,0,A):(t?i.bufferSubData(p,g.offset*A.BYTES_PER_ELEMENT,A,g.offset,g.count):i.bufferSubData(p,g.offset*A.BYTES_PER_ELEMENT,A.subarray(g.offset,g.offset+g.count)),g.count=-1),d.onUploadCallback()}function l(u){return u.isInterleavedBufferAttribute&&(u=u.data),n.get(u)}function c(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=n.get(u);d&&(i.deleteBuffer(d.buffer),n.delete(u))}function f(u,d){if(u.isGLBufferAttribute){const A=n.get(u);(!A||A.version<u.version)&&n.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);const p=n.get(u);p===void 0?n.set(u,r(u,d)):p.version<u.version&&(o(p.buffer,u,d),p.version=u.version)}return{get:l,remove:c,update:f}}class Wu extends xi{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const o=e/2,l=t/2,c=Math.floor(n),f=Math.floor(r),u=c+1,d=f+1,p=e/c,A=t/f,g=[],E=[],C=[],_=[];for(let v=0;v<d;v++){const x=v*A-l;for(let y=0;y<u;y++){const S=y*p-o;E.push(S,-x,0),C.push(0,0,1),_.push(y/c),_.push(1-v/f)}}for(let v=0;v<f;v++)for(let x=0;x<c;x++){const y=x+u*v,S=x+u*(v+1),w=x+1+u*(v+1),b=x+1+u*v;g.push(y,S,b),g.push(S,w,b)}this.setIndex(g),this.setAttribute("position",new er(E,3)),this.setAttribute("normal",new er(C,3)),this.setAttribute("uv",new er(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wu(e.width,e.height,e.widthSegments,e.heightSegments)}}var z3=`#ifdef USE_ALPHAHASH
76
76
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
77
77
  #endif`,G3=`#ifdef USE_ALPHAHASH
78
78
  const float ALPHA_HASH_SCALE = 0.05;
@@ -153,7 +153,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
153
153
  float G = G_BlinnPhong_Implicit( );
154
154
  float D = D_BlinnPhong( shininess, dotNH );
155
155
  return F * ( G * D );
156
- } // validated`,Z3=`#ifdef USE_IRIDESCENCE
156
+ } // validated`,$3=`#ifdef USE_IRIDESCENCE
157
157
  const mat3 XYZ_TO_REC709 = mat3(
158
158
  3.2404542, -0.9692660, 0.0556434,
159
159
  -1.5371385, 1.8760108, -0.2040259,
@@ -216,7 +216,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
216
216
  }
217
217
  return max( I, vec3( 0.0 ) );
218
218
  }
219
- #endif`,$3=`#ifdef USE_BUMPMAP
219
+ #endif`,Z3=`#ifdef USE_BUMPMAP
220
220
  uniform sampler2D bumpMap;
221
221
  uniform float bumpScale;
222
222
  vec2 dHdxy_fwd() {
@@ -1416,7 +1416,7 @@ IncidentLight directLight;
1416
1416
  metalnessFactor *= texelMetalness.b;
1417
1417
  #endif`,JT=`#ifdef USE_METALNESSMAP
1418
1418
  uniform sampler2D metalnessMap;
1419
- #endif`,ZT=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
1419
+ #endif`,$T=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
1420
1420
  vColor *= morphTargetBaseInfluence;
1421
1421
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1422
1422
  #if defined( USE_COLOR_ALPHA )
@@ -1425,7 +1425,7 @@ IncidentLight directLight;
1425
1425
  if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1426
1426
  #endif
1427
1427
  }
1428
- #endif`,$T=`#ifdef USE_MORPHNORMALS
1428
+ #endif`,ZT=`#ifdef USE_MORPHNORMALS
1429
1429
  objectNormal *= morphTargetBaseInfluence;
1430
1430
  #ifdef MORPHTARGETS_TEXTURE
1431
1431
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
@@ -2396,7 +2396,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,L4=`#ifdef USE_TRANSMISS
2396
2396
  worldPosition = instanceMatrix * worldPosition;
2397
2397
  #endif
2398
2398
  worldPosition = modelMatrix * worldPosition;
2399
- #endif`;const gt={alphahash_fragment:z3,alphahash_pars_fragment:G3,alphamap_fragment:H3,alphamap_pars_fragment:V3,alphatest_fragment:W3,alphatest_pars_fragment:j3,aomap_fragment:Y3,aomap_pars_fragment:q3,begin_vertex:X3,beginnormal_vertex:K3,bsdfs:J3,iridescence_fragment:Z3,bumpmap_pars_fragment:$3,clipping_planes_fragment:eT,clipping_planes_pars_fragment:tT,clipping_planes_pars_vertex:nT,clipping_planes_vertex:iT,color_fragment:rT,color_pars_fragment:sT,color_pars_vertex:oT,color_vertex:aT,common:lT,cube_uv_reflection_fragment:cT,defaultnormal_vertex:uT,displacementmap_pars_vertex:fT,displacementmap_vertex:hT,emissivemap_fragment:dT,emissivemap_pars_fragment:AT,colorspace_fragment:pT,colorspace_pars_fragment:gT,envmap_fragment:mT,envmap_common_pars_fragment:vT,envmap_pars_fragment:_T,envmap_pars_vertex:ET,envmap_physical_pars_fragment:LT,envmap_vertex:yT,fog_vertex:CT,fog_pars_vertex:IT,fog_fragment:xT,fog_pars_fragment:ST,gradientmap_pars_fragment:wT,lightmap_fragment:MT,lightmap_pars_fragment:TT,lights_lambert_fragment:BT,lights_lambert_pars_fragment:RT,lights_pars_begin:bT,lights_toon_fragment:DT,lights_toon_pars_fragment:NT,lights_phong_fragment:PT,lights_phong_pars_fragment:UT,lights_physical_fragment:kT,lights_physical_pars_fragment:FT,lights_fragment_begin:QT,lights_fragment_maps:OT,lights_fragment_end:zT,logdepthbuf_fragment:GT,logdepthbuf_pars_fragment:HT,logdepthbuf_pars_vertex:VT,logdepthbuf_vertex:WT,map_fragment:jT,map_pars_fragment:YT,map_particle_fragment:qT,map_particle_pars_fragment:XT,metalnessmap_fragment:KT,metalnessmap_pars_fragment:JT,morphcolor_vertex:ZT,morphnormal_vertex:$T,morphtarget_pars_vertex:e4,morphtarget_vertex:t4,normal_fragment_begin:n4,normal_fragment_maps:i4,normal_pars_fragment:r4,normal_pars_vertex:s4,normal_vertex:o4,normalmap_pars_fragment:a4,clearcoat_normal_fragment_begin:l4,clearcoat_normal_fragment_maps:c4,clearcoat_pars_fragment:u4,iridescence_pars_fragment:f4,opaque_fragment:h4,packing:d4,premultiplied_alpha_fragment:A4,project_vertex:p4,dithering_fragment:g4,dithering_pars_fragment:m4,roughnessmap_fragment:v4,roughnessmap_pars_fragment:_4,shadowmap_pars_fragment:E4,shadowmap_pars_vertex:y4,shadowmap_vertex:C4,shadowmask_pars_fragment:I4,skinbase_vertex:x4,skinning_pars_vertex:S4,skinning_vertex:w4,skinnormal_vertex:M4,specularmap_fragment:T4,specularmap_pars_fragment:B4,tonemapping_fragment:R4,tonemapping_pars_fragment:b4,transmission_fragment:L4,transmission_pars_fragment:D4,uv_pars_fragment:N4,uv_pars_vertex:P4,uv_vertex:U4,worldpos_vertex:k4,background_vert:`varying vec2 vUv;
2399
+ #endif`;const mt={alphahash_fragment:z3,alphahash_pars_fragment:G3,alphamap_fragment:H3,alphamap_pars_fragment:V3,alphatest_fragment:W3,alphatest_pars_fragment:j3,aomap_fragment:Y3,aomap_pars_fragment:q3,begin_vertex:X3,beginnormal_vertex:K3,bsdfs:J3,iridescence_fragment:$3,bumpmap_pars_fragment:Z3,clipping_planes_fragment:eT,clipping_planes_pars_fragment:tT,clipping_planes_pars_vertex:nT,clipping_planes_vertex:iT,color_fragment:rT,color_pars_fragment:sT,color_pars_vertex:oT,color_vertex:aT,common:lT,cube_uv_reflection_fragment:cT,defaultnormal_vertex:uT,displacementmap_pars_vertex:fT,displacementmap_vertex:hT,emissivemap_fragment:dT,emissivemap_pars_fragment:AT,colorspace_fragment:pT,colorspace_pars_fragment:gT,envmap_fragment:mT,envmap_common_pars_fragment:vT,envmap_pars_fragment:_T,envmap_pars_vertex:ET,envmap_physical_pars_fragment:LT,envmap_vertex:yT,fog_vertex:CT,fog_pars_vertex:IT,fog_fragment:xT,fog_pars_fragment:ST,gradientmap_pars_fragment:wT,lightmap_fragment:MT,lightmap_pars_fragment:TT,lights_lambert_fragment:BT,lights_lambert_pars_fragment:RT,lights_pars_begin:bT,lights_toon_fragment:DT,lights_toon_pars_fragment:NT,lights_phong_fragment:PT,lights_phong_pars_fragment:UT,lights_physical_fragment:kT,lights_physical_pars_fragment:FT,lights_fragment_begin:QT,lights_fragment_maps:OT,lights_fragment_end:zT,logdepthbuf_fragment:GT,logdepthbuf_pars_fragment:HT,logdepthbuf_pars_vertex:VT,logdepthbuf_vertex:WT,map_fragment:jT,map_pars_fragment:YT,map_particle_fragment:qT,map_particle_pars_fragment:XT,metalnessmap_fragment:KT,metalnessmap_pars_fragment:JT,morphcolor_vertex:$T,morphnormal_vertex:ZT,morphtarget_pars_vertex:e4,morphtarget_vertex:t4,normal_fragment_begin:n4,normal_fragment_maps:i4,normal_pars_fragment:r4,normal_pars_vertex:s4,normal_vertex:o4,normalmap_pars_fragment:a4,clearcoat_normal_fragment_begin:l4,clearcoat_normal_fragment_maps:c4,clearcoat_pars_fragment:u4,iridescence_pars_fragment:f4,opaque_fragment:h4,packing:d4,premultiplied_alpha_fragment:A4,project_vertex:p4,dithering_fragment:g4,dithering_pars_fragment:m4,roughnessmap_fragment:v4,roughnessmap_pars_fragment:_4,shadowmap_pars_fragment:E4,shadowmap_pars_vertex:y4,shadowmap_vertex:C4,shadowmask_pars_fragment:I4,skinbase_vertex:x4,skinning_pars_vertex:S4,skinning_vertex:w4,skinnormal_vertex:M4,specularmap_fragment:T4,specularmap_pars_fragment:B4,tonemapping_fragment:R4,tonemapping_pars_fragment:b4,transmission_fragment:L4,transmission_pars_fragment:D4,uv_pars_fragment:N4,uv_pars_vertex:P4,uv_vertex:U4,worldpos_vertex:k4,background_vert:`varying vec2 vUv;
2400
2400
  uniform mat3 uvTransform;
2401
2401
  void main() {
2402
2402
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
@@ -3409,7 +3409,7 @@ void main() {
3409
3409
  #include <tonemapping_fragment>
3410
3410
  #include <colorspace_fragment>
3411
3411
  #include <fog_fragment>
3412
- }`},Le={common:{diffuse:{value:new tt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Ke(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tt(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 tt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new tt(16777215)},opacity:{value:1},center:{value:new Ke(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},vr={basic:{uniforms:Zn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:gt.meshbasic_vert,fragmentShader:gt.meshbasic_frag},lambert:{uniforms:Zn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new tt(0)}}]),vertexShader:gt.meshlambert_vert,fragmentShader:gt.meshlambert_frag},phong:{uniforms:Zn([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new tt(0)},specular:{value:new tt(1118481)},shininess:{value:30}}]),vertexShader:gt.meshphong_vert,fragmentShader:gt.meshphong_frag},standard:{uniforms:Zn([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new tt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag},toon:{uniforms:Zn([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new tt(0)}}]),vertexShader:gt.meshtoon_vert,fragmentShader:gt.meshtoon_frag},matcap:{uniforms:Zn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:gt.meshmatcap_vert,fragmentShader:gt.meshmatcap_frag},points:{uniforms:Zn([Le.points,Le.fog]),vertexShader:gt.points_vert,fragmentShader:gt.points_frag},dashed:{uniforms:Zn([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gt.linedashed_vert,fragmentShader:gt.linedashed_frag},depth:{uniforms:Zn([Le.common,Le.displacementmap]),vertexShader:gt.depth_vert,fragmentShader:gt.depth_frag},normal:{uniforms:Zn([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:gt.meshnormal_vert,fragmentShader:gt.meshnormal_frag},sprite:{uniforms:Zn([Le.sprite,Le.fog]),vertexShader:gt.sprite_vert,fragmentShader:gt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:gt.background_vert,fragmentShader:gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:gt.backgroundCube_vert,fragmentShader:gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gt.cube_vert,fragmentShader:gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gt.equirect_vert,fragmentShader:gt.equirect_frag},distanceRGBA:{uniforms:Zn([Le.common,Le.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gt.distanceRGBA_vert,fragmentShader:gt.distanceRGBA_frag},shadow:{uniforms:Zn([Le.lights,Le.fog,{color:{value:new tt(0)},opacity:{value:1}}]),vertexShader:gt.shadow_vert,fragmentShader:gt.shadow_frag}};vr.physical={uniforms:Zn([vr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Ke(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new tt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Ke},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new tt(0)},specularColor:{value:new tt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Ke},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag};const ju={r:0,b:0,g:0};function F4(i,e,t,n,r,o,l){const c=new tt(0);let f=o===!0?0:1,u,d,p=null,A=0,g=null;function E(_,v){let S=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?C(c,f):y&&y.isColor&&(C(y,1),S=!0);const x=i.xr.getEnvironmentBlendMode();x==="additive"?n.buffers.color.setClear(0,0,0,1,l):x==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(i.autoClear||S)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),y&&(y.isCubeTexture||y.mapping===au)?(d===void 0&&(d=new Wn(new jl(1,1,1),new Si({name:"BackgroundCubeMaterial",uniforms:da(vr.backgroundCube.uniforms),vertexShader:vr.backgroundCube.vertexShader,fragmentShader:vr.backgroundCube.fragmentShader,side:Bn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(w,b,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),d.material.uniforms.envMap.value=y,d.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,d.material.toneMapped=Nt.getTransfer(y.colorSpace)!==Vt,(p!==y||A!==y.version||g!==i.toneMapping)&&(d.material.needsUpdate=!0,p=y,A=y.version,g=i.toneMapping),d.layers.enableAll(),_.unshift(d,d.geometry,d.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new Wn(new Wu(2,2),new Si({name:"BackgroundMaterial",uniforms:da(vr.background.uniforms),vertexShader:vr.background.vertexShader,fragmentShader:vr.background.fragmentShader,side:ji,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Nt.getTransfer(y.colorSpace)!==Vt,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(p!==y||A!==y.version||g!==i.toneMapping)&&(u.material.needsUpdate=!0,p=y,A=y.version,g=i.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function C(_,v){_.getRGB(ju,l_(i)),n.buffers.color.setClear(ju.r,ju.g,ju.b,v,l)}return{getClearColor:function(){return c},setClearColor:function(_,v=1){c.set(_),f=v,C(c,f)},getClearAlpha:function(){return f},setClearAlpha:function(_){f=_,C(c,f)},render:E}}function Q4(i,e,t,n){const r=i.getParameter(i.MAX_VERTEX_ATTRIBS),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),l=n.isWebGL2||o!==null,c={},f=_(null);let u=f,d=!1;function p(F,V,X,te,Y){let $=!1;if(l){const U=C(te,X,V);u!==U&&(u=U,g(u.object)),$=v(F,te,X,Y),$&&S(F,te,X,Y)}else{const U=V.wireframe===!0;(u.geometry!==te.id||u.program!==X.id||u.wireframe!==U)&&(u.geometry=te.id,u.program=X.id,u.wireframe=U,$=!0)}Y!==null&&t.update(Y,i.ELEMENT_ARRAY_BUFFER),($||d)&&(d=!1,L(F,V,X,te),Y!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(Y).buffer))}function A(){return n.isWebGL2?i.createVertexArray():o.createVertexArrayOES()}function g(F){return n.isWebGL2?i.bindVertexArray(F):o.bindVertexArrayOES(F)}function E(F){return n.isWebGL2?i.deleteVertexArray(F):o.deleteVertexArrayOES(F)}function C(F,V,X){const te=X.wireframe===!0;let Y=c[F.id];Y===void 0&&(Y={},c[F.id]=Y);let $=Y[V.id];$===void 0&&($={},Y[V.id]=$);let U=$[te];return U===void 0&&(U=_(A()),$[te]=U),U}function _(F){const V=[],X=[],te=[];for(let Y=0;Y<r;Y++)V[Y]=0,X[Y]=0,te[Y]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:V,enabledAttributes:X,attributeDivisors:te,object:F,attributes:{},index:null}}function v(F,V,X,te){const Y=u.attributes,$=V.attributes;let U=0;const D=X.getAttributes();for(const G in D)if(D[G].location>=0){const J=Y[G];let Ae=$[G];if(Ae===void 0&&(G==="instanceMatrix"&&F.instanceMatrix&&(Ae=F.instanceMatrix),G==="instanceColor"&&F.instanceColor&&(Ae=F.instanceColor)),J===void 0||J.attribute!==Ae||Ae&&J.data!==Ae.data)return!0;U++}return u.attributesNum!==U||u.index!==te}function S(F,V,X,te){const Y={},$=V.attributes;let U=0;const D=X.getAttributes();for(const G in D)if(D[G].location>=0){let J=$[G];J===void 0&&(G==="instanceMatrix"&&F.instanceMatrix&&(J=F.instanceMatrix),G==="instanceColor"&&F.instanceColor&&(J=F.instanceColor));const Ae={};Ae.attribute=J,J&&J.data&&(Ae.data=J.data),Y[G]=Ae,U++}u.attributes=Y,u.attributesNum=U,u.index=te}function y(){const F=u.newAttributes;for(let V=0,X=F.length;V<X;V++)F[V]=0}function x(F){w(F,0)}function w(F,V){const X=u.newAttributes,te=u.enabledAttributes,Y=u.attributeDivisors;X[F]=1,te[F]===0&&(i.enableVertexAttribArray(F),te[F]=1),Y[F]!==V&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](F,V),Y[F]=V)}function b(){const F=u.newAttributes,V=u.enabledAttributes;for(let X=0,te=V.length;X<te;X++)V[X]!==F[X]&&(i.disableVertexAttribArray(X),V[X]=0)}function B(F,V,X,te,Y,$,U){U===!0?i.vertexAttribIPointer(F,V,X,Y,$):i.vertexAttribPointer(F,V,X,te,Y,$)}function L(F,V,X,te){if(n.isWebGL2===!1&&(F.isInstancedMesh||te.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();const Y=te.attributes,$=X.getAttributes(),U=V.defaultAttributeValues;for(const D in $){const G=$[D];if(G.location>=0){let K=Y[D];if(K===void 0&&(D==="instanceMatrix"&&F.instanceMatrix&&(K=F.instanceMatrix),D==="instanceColor"&&F.instanceColor&&(K=F.instanceColor)),K!==void 0){const J=K.normalized,Ae=K.itemSize,ge=t.get(K);if(ge===void 0)continue;const be=ge.buffer,de=ge.type,Oe=ge.bytesPerElement,It=n.isWebGL2===!0&&(de===i.INT||de===i.UNSIGNED_INT||K.gpuType===Dl);if(K.isInterleavedBufferAttribute){const ot=K.data,oe=ot.stride,Mt=K.offset;if(ot.isInstancedInterleavedBuffer){for(let Ne=0;Ne<G.locationSize;Ne++)w(G.location+Ne,ot.meshPerAttribute);F.isInstancedMesh!==!0&&te._maxInstanceCount===void 0&&(te._maxInstanceCount=ot.meshPerAttribute*ot.count)}else for(let Ne=0;Ne<G.locationSize;Ne++)x(G.location+Ne);i.bindBuffer(i.ARRAY_BUFFER,be);for(let Ne=0;Ne<G.locationSize;Ne++)B(G.location+Ne,Ae/G.locationSize,de,J,oe*Oe,(Mt+Ae/G.locationSize*Ne)*Oe,It)}else{if(K.isInstancedBufferAttribute){for(let ot=0;ot<G.locationSize;ot++)w(G.location+ot,K.meshPerAttribute);F.isInstancedMesh!==!0&&te._maxInstanceCount===void 0&&(te._maxInstanceCount=K.meshPerAttribute*K.count)}else for(let ot=0;ot<G.locationSize;ot++)x(G.location+ot);i.bindBuffer(i.ARRAY_BUFFER,be);for(let ot=0;ot<G.locationSize;ot++)B(G.location+ot,Ae/G.locationSize,de,J,Ae*Oe,Ae/G.locationSize*ot*Oe,It)}}else if(U!==void 0){const J=U[D];if(J!==void 0)switch(J.length){case 2:i.vertexAttrib2fv(G.location,J);break;case 3:i.vertexAttrib3fv(G.location,J);break;case 4:i.vertexAttrib4fv(G.location,J);break;default:i.vertexAttrib1fv(G.location,J)}}}}b()}function R(){k();for(const F in c){const V=c[F];for(const X in V){const te=V[X];for(const Y in te)E(te[Y].object),delete te[Y];delete V[X]}delete c[F]}}function T(F){if(c[F.id]===void 0)return;const V=c[F.id];for(const X in V){const te=V[X];for(const Y in te)E(te[Y].object),delete te[Y];delete V[X]}delete c[F.id]}function N(F){for(const V in c){const X=c[V];if(X[F.id]===void 0)continue;const te=X[F.id];for(const Y in te)E(te[Y].object),delete te[Y];delete X[F.id]}}function k(){O(),d=!0,u!==f&&(u=f,g(u.object))}function O(){f.geometry=null,f.program=null,f.wireframe=!1}return{setup:p,reset:k,resetDefaultState:O,dispose:R,releaseStatesOfGeometry:T,releaseStatesOfProgram:N,initAttributes:y,enableAttribute:x,disableUnusedAttributes:b}}function O4(i,e,t,n){const r=n.isWebGL2;let o;function l(u){o=u}function c(u,d){i.drawArrays(o,u,d),t.update(d,o,1)}function f(u,d,p){if(p===0)return;let A,g;if(r)A=i,g="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",A===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}A[g](o,u,d,p),t.update(d,o,p)}this.setMode=l,this.render=c,this.renderInstances=f}function z4(i,e,t){let n;function r(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const B=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(B.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function o(B){if(B==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const l=typeof WebGL2RenderingContext<"u"&&i.constructor.name==="WebGL2RenderingContext";let c=t.precision!==void 0?t.precision:"highp";const f=o(c);f!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",f,"instead."),c=f);const u=l||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),A=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),E=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),C=i.getParameter(i.MAX_VERTEX_ATTRIBS),_=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),v=i.getParameter(i.MAX_VARYING_VECTORS),S=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),y=A>0,x=l||e.has("OES_texture_float"),w=y&&x,b=l?i.getParameter(i.MAX_SAMPLES):0;return{isWebGL2:l,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:o,precision:c,logarithmicDepthBuffer:d,maxTextures:p,maxVertexTextures:A,maxTextureSize:g,maxCubemapSize:E,maxAttributes:C,maxVertexUniforms:_,maxVaryings:v,maxFragmentUniforms:S,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:w,maxSamples:b}}function G4(i){const e=this;let t=null,n=0,r=!1,o=!1;const l=new mr,c=new _t,f={value:null,needsUpdate:!1};this.uniform=f,this.numPlanes=0,this.numIntersection=0,this.init=function(p,A){const g=p.length!==0||A||n!==0||r;return r=A,n=p.length,g},this.beginShadows=function(){o=!0,d(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(p,A){t=d(p,A,0)},this.setState=function(p,A,g){const E=p.clippingPlanes,C=p.clipIntersection,_=p.clipShadows,v=i.get(p);if(!r||E===null||E.length===0||o&&!_)o?d(null):u();else{const S=o?0:n,y=S*4;let x=v.clippingState||null;f.value=x,x=d(E,A,y,g);for(let w=0;w!==y;++w)x[w]=t[w];v.clippingState=x,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=S}};function u(){f.value!==t&&(f.value=t,f.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(p,A,g,E){const C=p!==null?p.length:0;let _=null;if(C!==0){if(_=f.value,E!==!0||_===null){const v=g+C*4,S=A.matrixWorldInverse;c.getNormalMatrix(S),(_===null||_.length<v)&&(_=new Float32Array(v));for(let y=0,x=g;y!==C;++y,x+=4)l.copy(p[y]).applyMatrix4(S,c),l.normal.toArray(_,x),_[x+3]=l.constant}f.value=_,f.needsUpdate=!0}return e.numPlanes=C,e.numIntersection=0,_}}function H4(i){let e=new WeakMap;function t(l,c){return c===Ll?l.mapping=so:c===Jd&&(l.mapping=qo),l}function n(l){if(l&&l.isTexture&&l.isRenderTargetTexture===!1){const c=l.mapping;if(c===Ll||c===Jd)if(e.has(l)){const f=e.get(l).texture;return t(f,l.mapping)}else{const f=l.image;if(f&&f.height>0){const u=new k3(f.height/2);return u.fromEquirectangularTexture(i,l),e.set(l,u),l.addEventListener("dispose",r),t(u.texture,l.mapping)}else return null}}return l}function r(l){const c=l.target;c.removeEventListener("dispose",r);const f=e.get(c);f!==void 0&&(e.delete(c),f.dispose())}function o(){e=new WeakMap}return{get:n,dispose:o}}class Yl extends c_{constructor(e=-1,t=1,n=1,r=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=o,this.far=l,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,r,o,l){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=r,this.view.width=o,this.view.height=l,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,r=(this.top+this.bottom)/2;let o=n-e,l=n+e,c=r+t,f=r-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;o+=u*this.view.offsetX,l=o+u*this.view.width,c-=d*this.view.offsetY,f=c-d*this.view.height}this.projectionMatrix.makeOrthographic(o,l,c,f,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 ga=4,h_=[.125,.215,.35,.446,.526,.582],mo=20,NA=new Yl,d_=new tt;let PA=null,UA=0,kA=0;const vo=(1+Math.sqrt(5))/2,ma=1/vo,A_=[new j(1,1,1),new j(-1,1,1),new j(1,1,-1),new j(-1,1,-1),new j(0,vo,ma),new j(0,vo,-ma),new j(ma,0,vo),new j(-ma,0,vo),new j(vo,ma,0),new j(-vo,ma,0)];class p_{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,r=100){PA=this._renderer.getRenderTarget(),UA=this._renderer.getActiveCubeFace(),kA=this._renderer.getActiveMipmapLevel(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,r,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=v_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=m_(),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(PA,UA,kA),e.scissorTest=!1,Yu(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===so||e.mapping===qo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),PA=this._renderer.getRenderTarget(),UA=this._renderer.getActiveCubeFace(),kA=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:un,minFilter:un,generateMipmaps:!1,type:Jn,format:on,colorSpace:En,depthBuffer:!1},r=g_(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=g_(e,t,n);const{_lodMax:o}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=V4(o)),this._blurMaterial=W4(o,e,t)}return r}_compileMaterial(e){const t=new Wn(this._lodPlanes[0],e);this._renderer.compile(t,NA)}_sceneToCubeUV(e,t,n,r){const c=new $n(90,1,t,n),f=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],d=this._renderer,p=d.autoClear,A=d.toneMapping;d.getClearColor(d_),d.toneMapping=hs,d.autoClear=!1;const g=new Gr({name:"PMREM.Background",side:Bn,depthWrite:!1,depthTest:!1}),E=new Wn(new jl,g);let C=!1;const _=e.background;_?_.isColor&&(g.color.copy(_),e.background=null,C=!0):(g.color.copy(d_),C=!0);for(let v=0;v<6;v++){const S=v%3;S===0?(c.up.set(0,f[v],0),c.lookAt(u[v],0,0)):S===1?(c.up.set(0,0,f[v]),c.lookAt(0,u[v],0)):(c.up.set(0,f[v],0),c.lookAt(0,0,u[v]));const y=this._cubeSize;Yu(r,S*y,v>2?y:0,y,y),d.setRenderTarget(r),C&&d.render(E,c),d.render(e,c)}E.geometry.dispose(),E.material.dispose(),d.toneMapping=A,d.autoClear=p,e.background=_}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===so||e.mapping===qo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=v_()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=m_());const o=r?this._cubemapMaterial:this._equirectMaterial,l=new Wn(this._lodPlanes[0],o),c=o.uniforms;c.envMap.value=e;const f=this._cubeSize;Yu(t,0,0,3*f,2*f),n.setRenderTarget(t),n.render(l,NA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const o=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),l=A_[(r-1)%A_.length];this._blur(e,r-1,r,o,l)}t.autoClear=n}_blur(e,t,n,r,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,r,"latitudinal",o),this._halfBlur(l,e,n,n,r,"longitudinal",o)}_halfBlur(e,t,n,r,o,l,c){const f=this._renderer,u=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,p=new Wn(this._lodPlanes[r],u),A=u.uniforms,g=this._sizeLods[n]-1,E=isFinite(o)?Math.PI/(2*g):2*Math.PI/(2*mo-1),C=o/E,_=isFinite(o)?1+Math.floor(d*C):mo;_>mo&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${mo}`);const v=[];let S=0;for(let B=0;B<mo;++B){const L=B/C,R=Math.exp(-L*L/2);v.push(R),B===0?S+=R:B<_&&(S+=2*R)}for(let B=0;B<v.length;B++)v[B]=v[B]/S;A.envMap.value=e.texture,A.samples.value=_,A.weights.value=v,A.latitudinal.value=l==="latitudinal",c&&(A.poleAxis.value=c);const{_lodMax:y}=this;A.dTheta.value=E,A.mipInt.value=y-n;const x=this._sizeLods[r],w=3*x*(r>y-ga?r-y+ga:0),b=4*(this._cubeSize-x);Yu(t,w,b,3*x,2*x),f.setRenderTarget(t),f.render(p,NA)}}function V4(i){const e=[],t=[],n=[];let r=i;const o=i-ga+1+h_.length;for(let l=0;l<o;l++){const c=Math.pow(2,r);t.push(c);let f=1/c;l>i-ga?f=h_[l-i+ga-1]:l===0&&(f=0),n.push(f);const u=1/(c-2),d=-u,p=1+u,A=[d,d,p,d,p,p,d,d,p,p,d,p],g=6,E=6,C=3,_=2,v=1,S=new Float32Array(C*E*g),y=new Float32Array(_*E*g),x=new Float32Array(v*E*g);for(let b=0;b<g;b++){const B=b%3*2/3-1,L=b>2?0:-1,R=[B,L,0,B+2/3,L,0,B+2/3,L+1,0,B,L,0,B+2/3,L+1,0,B,L+1,0];S.set(R,C*E*b),y.set(A,_*E*b);const T=[b,b,b,b,b,b];x.set(T,v*E*b)}const w=new xi;w.setAttribute("position",new bn(S,C)),w.setAttribute("uv",new bn(y,_)),w.setAttribute("faceIndex",new bn(x,v)),e.push(w),r>ga&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function g_(i,e,t){const n=new Xi(i,e,t);return n.texture.mapping=au,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Yu(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function W4(i,e,t){const n=new Float32Array(mo),r=new j(0,1,0);return new Si({name:"SphericalGaussianBlur",defines:{n:mo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:FA(),fragmentShader:`
3412
+ }`},Le={common:{diffuse:{value:new et(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Ke(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new et(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 et(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new et(16777215)},opacity:{value:1},center:{value:new Ke(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},vr={basic:{uniforms:$n([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:$n([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:$n([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new et(0)},specular:{value:new et(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:$n([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new et(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:$n([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new et(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:$n([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:$n([Le.points,Le.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:$n([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:$n([Le.common,Le.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:$n([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:$n([Le.sprite,Le.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},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}},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:$n([Le.common,Le.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:$n([Le.lights,Le.fog,{color:{value:new et(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};vr.physical={uniforms:$n([vr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Ke(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new et(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Ke},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new et(0)},specularColor:{value:new et(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Ke},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const ju={r:0,b:0,g:0};function F4(i,e,t,n,r,o,l){const c=new et(0);let f=o===!0?0:1,u,d,p=null,A=0,g=null;function E(_,v){let x=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?C(c,f):y&&y.isColor&&(C(y,1),x=!0);const S=i.xr.getEnvironmentBlendMode();S==="additive"?n.buffers.color.setClear(0,0,0,1,l):S==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(i.autoClear||x)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),y&&(y.isCubeTexture||y.mapping===au)?(d===void 0&&(d=new Wn(new jl(1,1,1),new Si({name:"BackgroundCubeMaterial",uniforms:da(vr.backgroundCube.uniforms),vertexShader:vr.backgroundCube.vertexShader,fragmentShader:vr.backgroundCube.fragmentShader,side:Bn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(w,b,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),d.material.uniforms.envMap.value=y,d.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,d.material.toneMapped=Nt.getTransfer(y.colorSpace)!==Vt,(p!==y||A!==y.version||g!==i.toneMapping)&&(d.material.needsUpdate=!0,p=y,A=y.version,g=i.toneMapping),d.layers.enableAll(),_.unshift(d,d.geometry,d.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new Wn(new Wu(2,2),new Si({name:"BackgroundMaterial",uniforms:da(vr.background.uniforms),vertexShader:vr.background.vertexShader,fragmentShader:vr.background.fragmentShader,side:ji,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Nt.getTransfer(y.colorSpace)!==Vt,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(p!==y||A!==y.version||g!==i.toneMapping)&&(u.material.needsUpdate=!0,p=y,A=y.version,g=i.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function C(_,v){_.getRGB(ju,l_(i)),n.buffers.color.setClear(ju.r,ju.g,ju.b,v,l)}return{getClearColor:function(){return c},setClearColor:function(_,v=1){c.set(_),f=v,C(c,f)},getClearAlpha:function(){return f},setClearAlpha:function(_){f=_,C(c,f)},render:E}}function Q4(i,e,t,n){const r=i.getParameter(i.MAX_VERTEX_ATTRIBS),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),l=n.isWebGL2||o!==null,c={},f=_(null);let u=f,d=!1;function p(F,V,X,te,q){let Z=!1;if(l){const U=C(te,X,V);u!==U&&(u=U,g(u.object)),Z=v(F,te,X,q),Z&&x(F,te,X,q)}else{const U=V.wireframe===!0;(u.geometry!==te.id||u.program!==X.id||u.wireframe!==U)&&(u.geometry=te.id,u.program=X.id,u.wireframe=U,Z=!0)}q!==null&&t.update(q,i.ELEMENT_ARRAY_BUFFER),(Z||d)&&(d=!1,L(F,V,X,te),q!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(q).buffer))}function A(){return n.isWebGL2?i.createVertexArray():o.createVertexArrayOES()}function g(F){return n.isWebGL2?i.bindVertexArray(F):o.bindVertexArrayOES(F)}function E(F){return n.isWebGL2?i.deleteVertexArray(F):o.deleteVertexArrayOES(F)}function C(F,V,X){const te=X.wireframe===!0;let q=c[F.id];q===void 0&&(q={},c[F.id]=q);let Z=q[V.id];Z===void 0&&(Z={},q[V.id]=Z);let U=Z[te];return U===void 0&&(U=_(A()),Z[te]=U),U}function _(F){const V=[],X=[],te=[];for(let q=0;q<r;q++)V[q]=0,X[q]=0,te[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:V,enabledAttributes:X,attributeDivisors:te,object:F,attributes:{},index:null}}function v(F,V,X,te){const q=u.attributes,Z=V.attributes;let U=0;const D=X.getAttributes();for(const G in D)if(D[G].location>=0){const J=q[G];let Ae=Z[G];if(Ae===void 0&&(G==="instanceMatrix"&&F.instanceMatrix&&(Ae=F.instanceMatrix),G==="instanceColor"&&F.instanceColor&&(Ae=F.instanceColor)),J===void 0||J.attribute!==Ae||Ae&&J.data!==Ae.data)return!0;U++}return u.attributesNum!==U||u.index!==te}function x(F,V,X,te){const q={},Z=V.attributes;let U=0;const D=X.getAttributes();for(const G in D)if(D[G].location>=0){let J=Z[G];J===void 0&&(G==="instanceMatrix"&&F.instanceMatrix&&(J=F.instanceMatrix),G==="instanceColor"&&F.instanceColor&&(J=F.instanceColor));const Ae={};Ae.attribute=J,J&&J.data&&(Ae.data=J.data),q[G]=Ae,U++}u.attributes=q,u.attributesNum=U,u.index=te}function y(){const F=u.newAttributes;for(let V=0,X=F.length;V<X;V++)F[V]=0}function S(F){w(F,0)}function w(F,V){const X=u.newAttributes,te=u.enabledAttributes,q=u.attributeDivisors;X[F]=1,te[F]===0&&(i.enableVertexAttribArray(F),te[F]=1),q[F]!==V&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](F,V),q[F]=V)}function b(){const F=u.newAttributes,V=u.enabledAttributes;for(let X=0,te=V.length;X<te;X++)V[X]!==F[X]&&(i.disableVertexAttribArray(X),V[X]=0)}function B(F,V,X,te,q,Z,U){U===!0?i.vertexAttribIPointer(F,V,X,q,Z):i.vertexAttribPointer(F,V,X,te,q,Z)}function L(F,V,X,te){if(n.isWebGL2===!1&&(F.isInstancedMesh||te.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();const q=te.attributes,Z=X.getAttributes(),U=V.defaultAttributeValues;for(const D in Z){const G=Z[D];if(G.location>=0){let K=q[D];if(K===void 0&&(D==="instanceMatrix"&&F.instanceMatrix&&(K=F.instanceMatrix),D==="instanceColor"&&F.instanceColor&&(K=F.instanceColor)),K!==void 0){const J=K.normalized,Ae=K.itemSize,ge=t.get(K);if(ge===void 0)continue;const be=ge.buffer,de=ge.type,Oe=ge.bytesPerElement,It=n.isWebGL2===!0&&(de===i.INT||de===i.UNSIGNED_INT||K.gpuType===Dl);if(K.isInterleavedBufferAttribute){const st=K.data,oe=st.stride,Mt=K.offset;if(st.isInstancedInterleavedBuffer){for(let Ne=0;Ne<G.locationSize;Ne++)w(G.location+Ne,st.meshPerAttribute);F.isInstancedMesh!==!0&&te._maxInstanceCount===void 0&&(te._maxInstanceCount=st.meshPerAttribute*st.count)}else for(let Ne=0;Ne<G.locationSize;Ne++)S(G.location+Ne);i.bindBuffer(i.ARRAY_BUFFER,be);for(let Ne=0;Ne<G.locationSize;Ne++)B(G.location+Ne,Ae/G.locationSize,de,J,oe*Oe,(Mt+Ae/G.locationSize*Ne)*Oe,It)}else{if(K.isInstancedBufferAttribute){for(let st=0;st<G.locationSize;st++)w(G.location+st,K.meshPerAttribute);F.isInstancedMesh!==!0&&te._maxInstanceCount===void 0&&(te._maxInstanceCount=K.meshPerAttribute*K.count)}else for(let st=0;st<G.locationSize;st++)S(G.location+st);i.bindBuffer(i.ARRAY_BUFFER,be);for(let st=0;st<G.locationSize;st++)B(G.location+st,Ae/G.locationSize,de,J,Ae*Oe,Ae/G.locationSize*st*Oe,It)}}else if(U!==void 0){const J=U[D];if(J!==void 0)switch(J.length){case 2:i.vertexAttrib2fv(G.location,J);break;case 3:i.vertexAttrib3fv(G.location,J);break;case 4:i.vertexAttrib4fv(G.location,J);break;default:i.vertexAttrib1fv(G.location,J)}}}}b()}function R(){k();for(const F in c){const V=c[F];for(const X in V){const te=V[X];for(const q in te)E(te[q].object),delete te[q];delete V[X]}delete c[F]}}function T(F){if(c[F.id]===void 0)return;const V=c[F.id];for(const X in V){const te=V[X];for(const q in te)E(te[q].object),delete te[q];delete V[X]}delete c[F.id]}function N(F){for(const V in c){const X=c[V];if(X[F.id]===void 0)continue;const te=X[F.id];for(const q in te)E(te[q].object),delete te[q];delete X[F.id]}}function k(){O(),d=!0,u!==f&&(u=f,g(u.object))}function O(){f.geometry=null,f.program=null,f.wireframe=!1}return{setup:p,reset:k,resetDefaultState:O,dispose:R,releaseStatesOfGeometry:T,releaseStatesOfProgram:N,initAttributes:y,enableAttribute:S,disableUnusedAttributes:b}}function O4(i,e,t,n){const r=n.isWebGL2;let o;function l(u){o=u}function c(u,d){i.drawArrays(o,u,d),t.update(d,o,1)}function f(u,d,p){if(p===0)return;let A,g;if(r)A=i,g="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),g="drawArraysInstancedANGLE",A===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}A[g](o,u,d,p),t.update(d,o,p)}this.setMode=l,this.render=c,this.renderInstances=f}function z4(i,e,t){let n;function r(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const B=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(B.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function o(B){if(B==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const l=typeof WebGL2RenderingContext<"u"&&i.constructor.name==="WebGL2RenderingContext";let c=t.precision!==void 0?t.precision:"highp";const f=o(c);f!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",f,"instead."),c=f);const u=l||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),A=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),E=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),C=i.getParameter(i.MAX_VERTEX_ATTRIBS),_=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),v=i.getParameter(i.MAX_VARYING_VECTORS),x=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),y=A>0,S=l||e.has("OES_texture_float"),w=y&&S,b=l?i.getParameter(i.MAX_SAMPLES):0;return{isWebGL2:l,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:o,precision:c,logarithmicDepthBuffer:d,maxTextures:p,maxVertexTextures:A,maxTextureSize:g,maxCubemapSize:E,maxAttributes:C,maxVertexUniforms:_,maxVaryings:v,maxFragmentUniforms:x,vertexTextures:y,floatFragmentTextures:S,floatVertexTextures:w,maxSamples:b}}function G4(i){const e=this;let t=null,n=0,r=!1,o=!1;const l=new mr,c=new _t,f={value:null,needsUpdate:!1};this.uniform=f,this.numPlanes=0,this.numIntersection=0,this.init=function(p,A){const g=p.length!==0||A||n!==0||r;return r=A,n=p.length,g},this.beginShadows=function(){o=!0,d(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(p,A){t=d(p,A,0)},this.setState=function(p,A,g){const E=p.clippingPlanes,C=p.clipIntersection,_=p.clipShadows,v=i.get(p);if(!r||E===null||E.length===0||o&&!_)o?d(null):u();else{const x=o?0:n,y=x*4;let S=v.clippingState||null;f.value=S,S=d(E,A,y,g);for(let w=0;w!==y;++w)S[w]=t[w];v.clippingState=S,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=x}};function u(){f.value!==t&&(f.value=t,f.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(p,A,g,E){const C=p!==null?p.length:0;let _=null;if(C!==0){if(_=f.value,E!==!0||_===null){const v=g+C*4,x=A.matrixWorldInverse;c.getNormalMatrix(x),(_===null||_.length<v)&&(_=new Float32Array(v));for(let y=0,S=g;y!==C;++y,S+=4)l.copy(p[y]).applyMatrix4(x,c),l.normal.toArray(_,S),_[S+3]=l.constant}f.value=_,f.needsUpdate=!0}return e.numPlanes=C,e.numIntersection=0,_}}function H4(i){let e=new WeakMap;function t(l,c){return c===Ll?l.mapping=so:c===Jd&&(l.mapping=qo),l}function n(l){if(l&&l.isTexture&&l.isRenderTargetTexture===!1){const c=l.mapping;if(c===Ll||c===Jd)if(e.has(l)){const f=e.get(l).texture;return t(f,l.mapping)}else{const f=l.image;if(f&&f.height>0){const u=new k3(f.height/2);return u.fromEquirectangularTexture(i,l),e.set(l,u),l.addEventListener("dispose",r),t(u.texture,l.mapping)}else return null}}return l}function r(l){const c=l.target;c.removeEventListener("dispose",r);const f=e.get(c);f!==void 0&&(e.delete(c),f.dispose())}function o(){e=new WeakMap}return{get:n,dispose:o}}class Yl extends c_{constructor(e=-1,t=1,n=1,r=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=o,this.far=l,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,r,o,l){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=r,this.view.width=o,this.view.height=l,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,r=(this.top+this.bottom)/2;let o=n-e,l=n+e,c=r+t,f=r-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;o+=u*this.view.offsetX,l=o+u*this.view.width,c-=d*this.view.offsetY,f=c-d*this.view.height}this.projectionMatrix.makeOrthographic(o,l,c,f,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 ga=4,h_=[.125,.215,.35,.446,.526,.582],mo=20,NA=new Yl,d_=new et;let PA=null,UA=0,kA=0;const vo=(1+Math.sqrt(5))/2,ma=1/vo,A_=[new j(1,1,1),new j(-1,1,1),new j(1,1,-1),new j(-1,1,-1),new j(0,vo,ma),new j(0,vo,-ma),new j(ma,0,vo),new j(-ma,0,vo),new j(vo,ma,0),new j(-vo,ma,0)];class p_{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,r=100){PA=this._renderer.getRenderTarget(),UA=this._renderer.getActiveCubeFace(),kA=this._renderer.getActiveMipmapLevel(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,r,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=v_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=m_(),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(PA,UA,kA),e.scissorTest=!1,Yu(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===so||e.mapping===qo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),PA=this._renderer.getRenderTarget(),UA=this._renderer.getActiveCubeFace(),kA=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:un,minFilter:un,generateMipmaps:!1,type:Jn,format:on,colorSpace:En,depthBuffer:!1},r=g_(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=g_(e,t,n);const{_lodMax:o}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=V4(o)),this._blurMaterial=W4(o,e,t)}return r}_compileMaterial(e){const t=new Wn(this._lodPlanes[0],e);this._renderer.compile(t,NA)}_sceneToCubeUV(e,t,n,r){const c=new Zn(90,1,t,n),f=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],d=this._renderer,p=d.autoClear,A=d.toneMapping;d.getClearColor(d_),d.toneMapping=hs,d.autoClear=!1;const g=new Gr({name:"PMREM.Background",side:Bn,depthWrite:!1,depthTest:!1}),E=new Wn(new jl,g);let C=!1;const _=e.background;_?_.isColor&&(g.color.copy(_),e.background=null,C=!0):(g.color.copy(d_),C=!0);for(let v=0;v<6;v++){const x=v%3;x===0?(c.up.set(0,f[v],0),c.lookAt(u[v],0,0)):x===1?(c.up.set(0,0,f[v]),c.lookAt(0,u[v],0)):(c.up.set(0,f[v],0),c.lookAt(0,0,u[v]));const y=this._cubeSize;Yu(r,x*y,v>2?y:0,y,y),d.setRenderTarget(r),C&&d.render(E,c),d.render(e,c)}E.geometry.dispose(),E.material.dispose(),d.toneMapping=A,d.autoClear=p,e.background=_}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===so||e.mapping===qo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=v_()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=m_());const o=r?this._cubemapMaterial:this._equirectMaterial,l=new Wn(this._lodPlanes[0],o),c=o.uniforms;c.envMap.value=e;const f=this._cubeSize;Yu(t,0,0,3*f,2*f),n.setRenderTarget(t),n.render(l,NA)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const o=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),l=A_[(r-1)%A_.length];this._blur(e,r-1,r,o,l)}t.autoClear=n}_blur(e,t,n,r,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,r,"latitudinal",o),this._halfBlur(l,e,n,n,r,"longitudinal",o)}_halfBlur(e,t,n,r,o,l,c){const f=this._renderer,u=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,p=new Wn(this._lodPlanes[r],u),A=u.uniforms,g=this._sizeLods[n]-1,E=isFinite(o)?Math.PI/(2*g):2*Math.PI/(2*mo-1),C=o/E,_=isFinite(o)?1+Math.floor(d*C):mo;_>mo&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${mo}`);const v=[];let x=0;for(let B=0;B<mo;++B){const L=B/C,R=Math.exp(-L*L/2);v.push(R),B===0?x+=R:B<_&&(x+=2*R)}for(let B=0;B<v.length;B++)v[B]=v[B]/x;A.envMap.value=e.texture,A.samples.value=_,A.weights.value=v,A.latitudinal.value=l==="latitudinal",c&&(A.poleAxis.value=c);const{_lodMax:y}=this;A.dTheta.value=E,A.mipInt.value=y-n;const S=this._sizeLods[r],w=3*S*(r>y-ga?r-y+ga:0),b=4*(this._cubeSize-S);Yu(t,w,b,3*S,2*S),f.setRenderTarget(t),f.render(p,NA)}}function V4(i){const e=[],t=[],n=[];let r=i;const o=i-ga+1+h_.length;for(let l=0;l<o;l++){const c=Math.pow(2,r);t.push(c);let f=1/c;l>i-ga?f=h_[l-i+ga-1]:l===0&&(f=0),n.push(f);const u=1/(c-2),d=-u,p=1+u,A=[d,d,p,d,p,p,d,d,p,p,d,p],g=6,E=6,C=3,_=2,v=1,x=new Float32Array(C*E*g),y=new Float32Array(_*E*g),S=new Float32Array(v*E*g);for(let b=0;b<g;b++){const B=b%3*2/3-1,L=b>2?0:-1,R=[B,L,0,B+2/3,L,0,B+2/3,L+1,0,B,L,0,B+2/3,L+1,0,B,L+1,0];x.set(R,C*E*b),y.set(A,_*E*b);const T=[b,b,b,b,b,b];S.set(T,v*E*b)}const w=new xi;w.setAttribute("position",new bn(x,C)),w.setAttribute("uv",new bn(y,_)),w.setAttribute("faceIndex",new bn(S,v)),e.push(w),r>ga&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function g_(i,e,t){const n=new Xi(i,e,t);return n.texture.mapping=au,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Yu(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function W4(i,e,t){const n=new Float32Array(mo),r=new j(0,1,0);return new Si({name:"SphericalGaussianBlur",defines:{n:mo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:FA(),fragmentShader:`
3413
3413
 
3414
3414
  precision mediump float;
3415
3415
  precision mediump int;
@@ -3559,37 +3559,37 @@ void main() {
3559
3559
  gl_Position = vec4( position, 1.0 );
3560
3560
 
3561
3561
  }
3562
- `}function j4(i){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const f=c.mapping,u=f===Ll||f===Jd,d=f===so||f===qo;if(u||d)if(c.isRenderTargetTexture&&c.needsPMREMUpdate===!0){c.needsPMREMUpdate=!1;let p=e.get(c);return t===null&&(t=new p_(i)),p=u?t.fromEquirectangular(c,p):t.fromCubemap(c,p),e.set(c,p),p.texture}else{if(e.has(c))return e.get(c).texture;{const p=c.image;if(u&&p&&p.height>0||d&&p&&r(p)){t===null&&(t=new p_(i));const A=u?t.fromEquirectangular(c):t.fromCubemap(c);return e.set(c,A),c.addEventListener("dispose",o),A.texture}else return null}}}return c}function r(c){let f=0;const u=6;for(let d=0;d<u;d++)c[d]!==void 0&&f++;return f===u}function o(c){const f=c.target;f.removeEventListener("dispose",o);const u=e.get(f);u!==void 0&&(e.delete(f),u.dispose())}function l(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:l}}function Y4(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const r=t(n);return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function q4(i,e,t,n){const r={},o=new WeakMap;function l(p){const A=p.target;A.index!==null&&e.remove(A.index);for(const E in A.attributes)e.remove(A.attributes[E]);for(const E in A.morphAttributes){const C=A.morphAttributes[E];for(let _=0,v=C.length;_<v;_++)e.remove(C[_])}A.removeEventListener("dispose",l),delete r[A.id];const g=o.get(A);g&&(e.remove(g),o.delete(A)),n.releaseStatesOfGeometry(A),A.isInstancedBufferGeometry===!0&&delete A._maxInstanceCount,t.memory.geometries--}function c(p,A){return r[A.id]===!0||(A.addEventListener("dispose",l),r[A.id]=!0,t.memory.geometries++),A}function f(p){const A=p.attributes;for(const E in A)e.update(A[E],i.ARRAY_BUFFER);const g=p.morphAttributes;for(const E in g){const C=g[E];for(let _=0,v=C.length;_<v;_++)e.update(C[_],i.ARRAY_BUFFER)}}function u(p){const A=[],g=p.index,E=p.attributes.position;let C=0;if(g!==null){const S=g.array;C=g.version;for(let y=0,x=S.length;y<x;y+=3){const w=S[y+0],b=S[y+1],B=S[y+2];A.push(w,b,b,B,B,w)}}else if(E!==void 0){const S=E.array;C=E.version;for(let y=0,x=S.length/3-1;y<x;y+=3){const w=y+0,b=y+1,B=y+2;A.push(w,b,b,B,B,w)}}else return;const _=new(F1(A)?n_:t_)(A,1);_.version=C;const v=o.get(p);v&&e.remove(v),o.set(p,_)}function d(p){const A=o.get(p);if(A){const g=p.index;g!==null&&A.version<g.version&&u(p)}else u(p);return o.get(p)}return{get:c,update:f,getWireframeAttribute:d}}function X4(i,e,t,n){const r=n.isWebGL2;let o;function l(A){o=A}let c,f;function u(A){c=A.type,f=A.bytesPerElement}function d(A,g){i.drawElements(o,g,c,A*f),t.update(g,o,1)}function p(A,g,E){if(E===0)return;let C,_;if(r)C=i,_="drawElementsInstanced";else if(C=e.get("ANGLE_instanced_arrays"),_="drawElementsInstancedANGLE",C===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}C[_](o,g,c,A*f,E),t.update(g,o,E)}this.setMode=l,this.setIndex=u,this.render=d,this.renderInstances=p}function K4(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(o,l,c){switch(t.calls++,l){case i.TRIANGLES:t.triangles+=c*(o/3);break;case i.LINES:t.lines+=c*(o/2);break;case i.LINE_STRIP:t.lines+=c*(o-1);break;case i.LINE_LOOP:t.lines+=c*o;break;case i.POINTS:t.points+=c*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function J4(i,e){return i[0]-e[0]}function Z4(i,e){return Math.abs(e[1])-Math.abs(i[1])}function $4(i,e,t){const n={},r=new Float32Array(8),o=new WeakMap,l=new Gt,c=[];for(let u=0;u<8;u++)c[u]=[u,0];function f(u,d,p){const A=u.morphTargetInfluences;if(e.isWebGL2===!0){const g=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,E=g!==void 0?g.length:0;let C=o.get(d);if(C===void 0||C.count!==E){let S=function(){O.dispose(),o.delete(d),d.removeEventListener("dispose",S)};C!==void 0&&C.texture.dispose();const y=d.morphAttributes.position!==void 0,x=d.morphAttributes.normal!==void 0,w=d.morphAttributes.color!==void 0,b=d.morphAttributes.position||[],B=d.morphAttributes.normal||[],L=d.morphAttributes.color||[];let R=0;y===!0&&(R=1),x===!0&&(R=2),w===!0&&(R=3);let T=d.attributes.position.count*R,N=1;T>e.maxTextureSize&&(N=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const k=new Float32Array(T*N*4*E),O=new V1(k,T,N,E);O.type=hn,O.needsUpdate=!0;const F=R*4;for(let V=0;V<E;V++){const X=b[V],te=B[V],Y=L[V],$=T*N*4*V;for(let U=0;U<X.count;U++){const D=U*F;y===!0&&(l.fromBufferAttribute(X,U),k[$+D+0]=l.x,k[$+D+1]=l.y,k[$+D+2]=l.z,k[$+D+3]=0),x===!0&&(l.fromBufferAttribute(te,U),k[$+D+4]=l.x,k[$+D+5]=l.y,k[$+D+6]=l.z,k[$+D+7]=0),w===!0&&(l.fromBufferAttribute(Y,U),k[$+D+8]=l.x,k[$+D+9]=l.y,k[$+D+10]=l.z,k[$+D+11]=Y.itemSize===4?l.w:1)}}C={count:E,texture:O,size:new Ke(T,N)},o.set(d,C),d.addEventListener("dispose",S)}let _=0;for(let S=0;S<A.length;S++)_+=A[S];const v=d.morphTargetsRelative?1:1-_;p.getUniforms().setValue(i,"morphTargetBaseInfluence",v),p.getUniforms().setValue(i,"morphTargetInfluences",A),p.getUniforms().setValue(i,"morphTargetsTexture",C.texture,t),p.getUniforms().setValue(i,"morphTargetsTextureSize",C.size)}else{const g=A===void 0?0:A.length;let E=n[d.id];if(E===void 0||E.length!==g){E=[];for(let y=0;y<g;y++)E[y]=[y,0];n[d.id]=E}for(let y=0;y<g;y++){const x=E[y];x[0]=y,x[1]=A[y]}E.sort(Z4);for(let y=0;y<8;y++)y<g&&E[y][1]?(c[y][0]=E[y][0],c[y][1]=E[y][1]):(c[y][0]=Number.MAX_SAFE_INTEGER,c[y][1]=0);c.sort(J4);const C=d.morphAttributes.position,_=d.morphAttributes.normal;let v=0;for(let y=0;y<8;y++){const x=c[y],w=x[0],b=x[1];w!==Number.MAX_SAFE_INTEGER&&b?(C&&d.getAttribute("morphTarget"+y)!==C[w]&&d.setAttribute("morphTarget"+y,C[w]),_&&d.getAttribute("morphNormal"+y)!==_[w]&&d.setAttribute("morphNormal"+y,_[w]),r[y]=b,v+=b):(C&&d.hasAttribute("morphTarget"+y)===!0&&d.deleteAttribute("morphTarget"+y),_&&d.hasAttribute("morphNormal"+y)===!0&&d.deleteAttribute("morphNormal"+y),r[y]=0)}const S=d.morphTargetsRelative?1:1-v;p.getUniforms().setValue(i,"morphTargetBaseInfluence",S),p.getUniforms().setValue(i,"morphTargetInfluences",r)}}return{update:f}}function eB(i,e,t,n){let r=new WeakMap;function o(f){const u=n.render.frame,d=f.geometry,p=e.get(f,d);if(r.get(p)!==u&&(e.update(p),r.set(p,u)),f.isInstancedMesh&&(f.hasEventListener("dispose",c)===!1&&f.addEventListener("dispose",c),r.get(f)!==u&&(t.update(f.instanceMatrix,i.ARRAY_BUFFER),f.instanceColor!==null&&t.update(f.instanceColor,i.ARRAY_BUFFER),r.set(f,u))),f.isSkinnedMesh){const A=f.skeleton;r.get(A)!==u&&(A.update(),r.set(A,u))}return p}function l(){r=new WeakMap}function c(f){const u=f.target;u.removeEventListener("dispose",c),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:o,dispose:l}}const __=new Rn,E_=new V1,y_=new W1,C_=new u_,I_=[],x_=[],S_=new Float32Array(16),w_=new Float32Array(9),M_=new Float32Array(4);function va(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let o=I_[r];if(o===void 0&&(o=new Float32Array(r),I_[r]=o),e!==0){n.toArray(o,0);for(let l=1,c=0;l!==e;++l)c+=t,i[l].toArray(o,c)}return o}function Cn(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function In(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function qu(i,e){let t=x_[e];t===void 0&&(t=new Int32Array(e),x_[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function tB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function nB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2fv(this.addr,e),In(t,e)}}function iB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.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)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Cn(t,e))return;i.uniform3fv(this.addr,e),In(t,e)}}function rB(i,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)&&(i.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(Cn(t,e))return;i.uniform4fv(this.addr,e),In(t,e)}}function sB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;M_.set(n),i.uniformMatrix2fv(this.addr,!1,M_),In(t,n)}}function oB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;w_.set(n),i.uniformMatrix3fv(this.addr,!1,w_),In(t,n)}}function aB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;S_.set(n),i.uniformMatrix4fv(this.addr,!1,S_),In(t,n)}}function lB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function cB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2iv(this.addr,e),In(t,e)}}function uB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cn(t,e))return;i.uniform3iv(this.addr,e),In(t,e)}}function fB(i,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)&&(i.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(Cn(t,e))return;i.uniform4iv(this.addr,e),In(t,e)}}function hB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function dB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2uiv(this.addr,e),In(t,e)}}function AB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cn(t,e))return;i.uniform3uiv(this.addr,e),In(t,e)}}function pB(i,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)&&(i.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(Cn(t,e))return;i.uniform4uiv(this.addr,e),In(t,e)}}function gB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2D(e||__,r)}function mB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||y_,r)}function vB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||C_,r)}function _B(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||E_,r)}function EB(i){switch(i){case 5126:return tB;case 35664:return nB;case 35665:return iB;case 35666:return rB;case 35674:return sB;case 35675:return oB;case 35676:return aB;case 5124:case 35670:return lB;case 35667:case 35671:return cB;case 35668:case 35672:return uB;case 35669:case 35673:return fB;case 5125:return hB;case 36294:return dB;case 36295:return AB;case 36296:return pB;case 35678:case 36198:case 36298:case 36306:case 35682:return gB;case 35679:case 36299:case 36307:return mB;case 35680:case 36300:case 36308:case 36293:return vB;case 36289:case 36303:case 36311:case 36292:return _B}}function yB(i,e){i.uniform1fv(this.addr,e)}function CB(i,e){const t=va(e,this.size,2);i.uniform2fv(this.addr,t)}function IB(i,e){const t=va(e,this.size,3);i.uniform3fv(this.addr,t)}function xB(i,e){const t=va(e,this.size,4);i.uniform4fv(this.addr,t)}function SB(i,e){const t=va(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function wB(i,e){const t=va(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function MB(i,e){const t=va(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function TB(i,e){i.uniform1iv(this.addr,e)}function BB(i,e){i.uniform2iv(this.addr,e)}function RB(i,e){i.uniform3iv(this.addr,e)}function bB(i,e){i.uniform4iv(this.addr,e)}function LB(i,e){i.uniform1uiv(this.addr,e)}function DB(i,e){i.uniform2uiv(this.addr,e)}function NB(i,e){i.uniform3uiv(this.addr,e)}function PB(i,e){i.uniform4uiv(this.addr,e)}function UB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture2D(e[l]||__,o[l])}function kB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture3D(e[l]||y_,o[l])}function FB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTextureCube(e[l]||C_,o[l])}function QB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture2DArray(e[l]||E_,o[l])}function OB(i){switch(i){case 5126:return yB;case 35664:return CB;case 35665:return IB;case 35666:return xB;case 35674:return SB;case 35675:return wB;case 35676:return MB;case 5124:case 35670:return TB;case 35667:case 35671:return BB;case 35668:case 35672:return RB;case 35669:case 35673:return bB;case 5125:return LB;case 36294:return DB;case 36295:return NB;case 36296:return PB;case 35678:case 36198:case 36298:case 36306:case 35682:return UB;case 35679:case 36299:case 36307:return kB;case 35680:case 36300:case 36308:case 36293:return FB;case 36289:case 36303:case 36311:case 36292:return QB}}class zB{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=EB(t.type)}}class GB{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=OB(t.type)}}class HB{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let o=0,l=r.length;o!==l;++o){const c=r[o];c.setValue(e,t[c.id],n)}}}const QA=/(\w+)(\])?(\[|\.)?/g;function T_(i,e){i.seq.push(e),i.map[e.id]=e}function VB(i,e,t){const n=i.name,r=n.length;for(QA.lastIndex=0;;){const o=QA.exec(n),l=QA.lastIndex;let c=o[1];const f=o[2]==="]",u=o[3];if(f&&(c=c|0),u===void 0||u==="["&&l+2===r){T_(t,u===void 0?new zB(c,i,e):new GB(c,i,e));break}else{let p=t.map[c];p===void 0&&(p=new HB(c),T_(t,p)),t=p}}}class Xu{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const o=e.getActiveUniform(t,r),l=e.getUniformLocation(t,o.name);VB(o,l,this)}}setValue(e,t,n,r){const o=this.map[t];o!==void 0&&o.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let o=0,l=t.length;o!==l;++o){const c=t[o],f=n[c.id];f.needsUpdate!==!1&&c.setValue(e,f.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,o=e.length;r!==o;++r){const l=e[r];l.id in t&&n.push(l)}return n}}function B_(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const WB=37297;let jB=0;function YB(i,e){const t=i.split(`
3562
+ `}function j4(i){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const f=c.mapping,u=f===Ll||f===Jd,d=f===so||f===qo;if(u||d)if(c.isRenderTargetTexture&&c.needsPMREMUpdate===!0){c.needsPMREMUpdate=!1;let p=e.get(c);return t===null&&(t=new p_(i)),p=u?t.fromEquirectangular(c,p):t.fromCubemap(c,p),e.set(c,p),p.texture}else{if(e.has(c))return e.get(c).texture;{const p=c.image;if(u&&p&&p.height>0||d&&p&&r(p)){t===null&&(t=new p_(i));const A=u?t.fromEquirectangular(c):t.fromCubemap(c);return e.set(c,A),c.addEventListener("dispose",o),A.texture}else return null}}}return c}function r(c){let f=0;const u=6;for(let d=0;d<u;d++)c[d]!==void 0&&f++;return f===u}function o(c){const f=c.target;f.removeEventListener("dispose",o);const u=e.get(f);u!==void 0&&(e.delete(f),u.dispose())}function l(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:l}}function Y4(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(n){n.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const r=t(n);return r===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function q4(i,e,t,n){const r={},o=new WeakMap;function l(p){const A=p.target;A.index!==null&&e.remove(A.index);for(const E in A.attributes)e.remove(A.attributes[E]);for(const E in A.morphAttributes){const C=A.morphAttributes[E];for(let _=0,v=C.length;_<v;_++)e.remove(C[_])}A.removeEventListener("dispose",l),delete r[A.id];const g=o.get(A);g&&(e.remove(g),o.delete(A)),n.releaseStatesOfGeometry(A),A.isInstancedBufferGeometry===!0&&delete A._maxInstanceCount,t.memory.geometries--}function c(p,A){return r[A.id]===!0||(A.addEventListener("dispose",l),r[A.id]=!0,t.memory.geometries++),A}function f(p){const A=p.attributes;for(const E in A)e.update(A[E],i.ARRAY_BUFFER);const g=p.morphAttributes;for(const E in g){const C=g[E];for(let _=0,v=C.length;_<v;_++)e.update(C[_],i.ARRAY_BUFFER)}}function u(p){const A=[],g=p.index,E=p.attributes.position;let C=0;if(g!==null){const x=g.array;C=g.version;for(let y=0,S=x.length;y<S;y+=3){const w=x[y+0],b=x[y+1],B=x[y+2];A.push(w,b,b,B,B,w)}}else if(E!==void 0){const x=E.array;C=E.version;for(let y=0,S=x.length/3-1;y<S;y+=3){const w=y+0,b=y+1,B=y+2;A.push(w,b,b,B,B,w)}}else return;const _=new(F1(A)?n_:t_)(A,1);_.version=C;const v=o.get(p);v&&e.remove(v),o.set(p,_)}function d(p){const A=o.get(p);if(A){const g=p.index;g!==null&&A.version<g.version&&u(p)}else u(p);return o.get(p)}return{get:c,update:f,getWireframeAttribute:d}}function X4(i,e,t,n){const r=n.isWebGL2;let o;function l(A){o=A}let c,f;function u(A){c=A.type,f=A.bytesPerElement}function d(A,g){i.drawElements(o,g,c,A*f),t.update(g,o,1)}function p(A,g,E){if(E===0)return;let C,_;if(r)C=i,_="drawElementsInstanced";else if(C=e.get("ANGLE_instanced_arrays"),_="drawElementsInstancedANGLE",C===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}C[_](o,g,c,A*f,E),t.update(g,o,E)}this.setMode=l,this.setIndex=u,this.render=d,this.renderInstances=p}function K4(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(o,l,c){switch(t.calls++,l){case i.TRIANGLES:t.triangles+=c*(o/3);break;case i.LINES:t.lines+=c*(o/2);break;case i.LINE_STRIP:t.lines+=c*(o-1);break;case i.LINE_LOOP:t.lines+=c*o;break;case i.POINTS:t.points+=c*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function J4(i,e){return i[0]-e[0]}function $4(i,e){return Math.abs(e[1])-Math.abs(i[1])}function Z4(i,e,t){const n={},r=new Float32Array(8),o=new WeakMap,l=new Gt,c=[];for(let u=0;u<8;u++)c[u]=[u,0];function f(u,d,p){const A=u.morphTargetInfluences;if(e.isWebGL2===!0){const g=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,E=g!==void 0?g.length:0;let C=o.get(d);if(C===void 0||C.count!==E){let x=function(){O.dispose(),o.delete(d),d.removeEventListener("dispose",x)};C!==void 0&&C.texture.dispose();const y=d.morphAttributes.position!==void 0,S=d.morphAttributes.normal!==void 0,w=d.morphAttributes.color!==void 0,b=d.morphAttributes.position||[],B=d.morphAttributes.normal||[],L=d.morphAttributes.color||[];let R=0;y===!0&&(R=1),S===!0&&(R=2),w===!0&&(R=3);let T=d.attributes.position.count*R,N=1;T>e.maxTextureSize&&(N=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);const k=new Float32Array(T*N*4*E),O=new V1(k,T,N,E);O.type=hn,O.needsUpdate=!0;const F=R*4;for(let V=0;V<E;V++){const X=b[V],te=B[V],q=L[V],Z=T*N*4*V;for(let U=0;U<X.count;U++){const D=U*F;y===!0&&(l.fromBufferAttribute(X,U),k[Z+D+0]=l.x,k[Z+D+1]=l.y,k[Z+D+2]=l.z,k[Z+D+3]=0),S===!0&&(l.fromBufferAttribute(te,U),k[Z+D+4]=l.x,k[Z+D+5]=l.y,k[Z+D+6]=l.z,k[Z+D+7]=0),w===!0&&(l.fromBufferAttribute(q,U),k[Z+D+8]=l.x,k[Z+D+9]=l.y,k[Z+D+10]=l.z,k[Z+D+11]=q.itemSize===4?l.w:1)}}C={count:E,texture:O,size:new Ke(T,N)},o.set(d,C),d.addEventListener("dispose",x)}let _=0;for(let x=0;x<A.length;x++)_+=A[x];const v=d.morphTargetsRelative?1:1-_;p.getUniforms().setValue(i,"morphTargetBaseInfluence",v),p.getUniforms().setValue(i,"morphTargetInfluences",A),p.getUniforms().setValue(i,"morphTargetsTexture",C.texture,t),p.getUniforms().setValue(i,"morphTargetsTextureSize",C.size)}else{const g=A===void 0?0:A.length;let E=n[d.id];if(E===void 0||E.length!==g){E=[];for(let y=0;y<g;y++)E[y]=[y,0];n[d.id]=E}for(let y=0;y<g;y++){const S=E[y];S[0]=y,S[1]=A[y]}E.sort($4);for(let y=0;y<8;y++)y<g&&E[y][1]?(c[y][0]=E[y][0],c[y][1]=E[y][1]):(c[y][0]=Number.MAX_SAFE_INTEGER,c[y][1]=0);c.sort(J4);const C=d.morphAttributes.position,_=d.morphAttributes.normal;let v=0;for(let y=0;y<8;y++){const S=c[y],w=S[0],b=S[1];w!==Number.MAX_SAFE_INTEGER&&b?(C&&d.getAttribute("morphTarget"+y)!==C[w]&&d.setAttribute("morphTarget"+y,C[w]),_&&d.getAttribute("morphNormal"+y)!==_[w]&&d.setAttribute("morphNormal"+y,_[w]),r[y]=b,v+=b):(C&&d.hasAttribute("morphTarget"+y)===!0&&d.deleteAttribute("morphTarget"+y),_&&d.hasAttribute("morphNormal"+y)===!0&&d.deleteAttribute("morphNormal"+y),r[y]=0)}const x=d.morphTargetsRelative?1:1-v;p.getUniforms().setValue(i,"morphTargetBaseInfluence",x),p.getUniforms().setValue(i,"morphTargetInfluences",r)}}return{update:f}}function eB(i,e,t,n){let r=new WeakMap;function o(f){const u=n.render.frame,d=f.geometry,p=e.get(f,d);if(r.get(p)!==u&&(e.update(p),r.set(p,u)),f.isInstancedMesh&&(f.hasEventListener("dispose",c)===!1&&f.addEventListener("dispose",c),r.get(f)!==u&&(t.update(f.instanceMatrix,i.ARRAY_BUFFER),f.instanceColor!==null&&t.update(f.instanceColor,i.ARRAY_BUFFER),r.set(f,u))),f.isSkinnedMesh){const A=f.skeleton;r.get(A)!==u&&(A.update(),r.set(A,u))}return p}function l(){r=new WeakMap}function c(f){const u=f.target;u.removeEventListener("dispose",c),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:o,dispose:l}}const __=new Rn,E_=new V1,y_=new W1,C_=new u_,I_=[],x_=[],S_=new Float32Array(16),w_=new Float32Array(9),M_=new Float32Array(4);function va(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let o=I_[r];if(o===void 0&&(o=new Float32Array(r),I_[r]=o),e!==0){n.toArray(o,0);for(let l=1,c=0;l!==e;++l)c+=t,i[l].toArray(o,c)}return o}function Cn(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function In(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function qu(i,e){let t=x_[e];t===void 0&&(t=new Int32Array(e),x_[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function tB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function nB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2fv(this.addr,e),In(t,e)}}function iB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.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)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Cn(t,e))return;i.uniform3fv(this.addr,e),In(t,e)}}function rB(i,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)&&(i.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(Cn(t,e))return;i.uniform4fv(this.addr,e),In(t,e)}}function sB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;M_.set(n),i.uniformMatrix2fv(this.addr,!1,M_),In(t,n)}}function oB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;w_.set(n),i.uniformMatrix3fv(this.addr,!1,w_),In(t,n)}}function aB(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Cn(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),In(t,e)}else{if(Cn(t,n))return;S_.set(n),i.uniformMatrix4fv(this.addr,!1,S_),In(t,n)}}function lB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function cB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2iv(this.addr,e),In(t,e)}}function uB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cn(t,e))return;i.uniform3iv(this.addr,e),In(t,e)}}function fB(i,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)&&(i.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(Cn(t,e))return;i.uniform4iv(this.addr,e),In(t,e)}}function hB(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function dB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Cn(t,e))return;i.uniform2uiv(this.addr,e),In(t,e)}}function AB(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Cn(t,e))return;i.uniform3uiv(this.addr,e),In(t,e)}}function pB(i,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)&&(i.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(Cn(t,e))return;i.uniform4uiv(this.addr,e),In(t,e)}}function gB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2D(e||__,r)}function mB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||y_,r)}function vB(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||C_,r)}function _B(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||E_,r)}function EB(i){switch(i){case 5126:return tB;case 35664:return nB;case 35665:return iB;case 35666:return rB;case 35674:return sB;case 35675:return oB;case 35676:return aB;case 5124:case 35670:return lB;case 35667:case 35671:return cB;case 35668:case 35672:return uB;case 35669:case 35673:return fB;case 5125:return hB;case 36294:return dB;case 36295:return AB;case 36296:return pB;case 35678:case 36198:case 36298:case 36306:case 35682:return gB;case 35679:case 36299:case 36307:return mB;case 35680:case 36300:case 36308:case 36293:return vB;case 36289:case 36303:case 36311:case 36292:return _B}}function yB(i,e){i.uniform1fv(this.addr,e)}function CB(i,e){const t=va(e,this.size,2);i.uniform2fv(this.addr,t)}function IB(i,e){const t=va(e,this.size,3);i.uniform3fv(this.addr,t)}function xB(i,e){const t=va(e,this.size,4);i.uniform4fv(this.addr,t)}function SB(i,e){const t=va(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function wB(i,e){const t=va(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function MB(i,e){const t=va(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function TB(i,e){i.uniform1iv(this.addr,e)}function BB(i,e){i.uniform2iv(this.addr,e)}function RB(i,e){i.uniform3iv(this.addr,e)}function bB(i,e){i.uniform4iv(this.addr,e)}function LB(i,e){i.uniform1uiv(this.addr,e)}function DB(i,e){i.uniform2uiv(this.addr,e)}function NB(i,e){i.uniform3uiv(this.addr,e)}function PB(i,e){i.uniform4uiv(this.addr,e)}function UB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture2D(e[l]||__,o[l])}function kB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture3D(e[l]||y_,o[l])}function FB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTextureCube(e[l]||C_,o[l])}function QB(i,e,t){const n=this.cache,r=e.length,o=qu(t,r);Cn(n,o)||(i.uniform1iv(this.addr,o),In(n,o));for(let l=0;l!==r;++l)t.setTexture2DArray(e[l]||E_,o[l])}function OB(i){switch(i){case 5126:return yB;case 35664:return CB;case 35665:return IB;case 35666:return xB;case 35674:return SB;case 35675:return wB;case 35676:return MB;case 5124:case 35670:return TB;case 35667:case 35671:return BB;case 35668:case 35672:return RB;case 35669:case 35673:return bB;case 5125:return LB;case 36294:return DB;case 36295:return NB;case 36296:return PB;case 35678:case 36198:case 36298:case 36306:case 35682:return UB;case 35679:case 36299:case 36307:return kB;case 35680:case 36300:case 36308:case 36293:return FB;case 36289:case 36303:case 36311:case 36292:return QB}}class zB{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=EB(t.type)}}class GB{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=OB(t.type)}}class HB{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let o=0,l=r.length;o!==l;++o){const c=r[o];c.setValue(e,t[c.id],n)}}}const QA=/(\w+)(\])?(\[|\.)?/g;function T_(i,e){i.seq.push(e),i.map[e.id]=e}function VB(i,e,t){const n=i.name,r=n.length;for(QA.lastIndex=0;;){const o=QA.exec(n),l=QA.lastIndex;let c=o[1];const f=o[2]==="]",u=o[3];if(f&&(c=c|0),u===void 0||u==="["&&l+2===r){T_(t,u===void 0?new zB(c,i,e):new GB(c,i,e));break}else{let p=t.map[c];p===void 0&&(p=new HB(c),T_(t,p)),t=p}}}class Xu{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const o=e.getActiveUniform(t,r),l=e.getUniformLocation(t,o.name);VB(o,l,this)}}setValue(e,t,n,r){const o=this.map[t];o!==void 0&&o.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let o=0,l=t.length;o!==l;++o){const c=t[o],f=n[c.id];f.needsUpdate!==!1&&c.setValue(e,f.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,o=e.length;r!==o;++r){const l=e[r];l.id in t&&n.push(l)}return n}}function B_(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const WB=37297;let jB=0;function YB(i,e){const t=i.split(`
3563
3563
  `),n=[],r=Math.max(e-6,0),o=Math.min(e+6,t.length);for(let l=r;l<o;l++){const c=l+1;n.push(`${c===e?">":" "} ${c}: ${t[l]}`)}return n.join(`
3564
3564
  `)}function qB(i){const e=Nt.getPrimaries(Nt.workingColorSpace),t=Nt.getPrimaries(i);let n;switch(e===t?n="":e===_u&&t===vu?n="LinearDisplayP3ToLinearSRGB":e===vu&&t===_u&&(n="LinearSRGBToLinearDisplayP3"),i){case En:case Ul:return[n,"LinearTransferOETF"];case Xt:case gu:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",i),[n,"LinearTransferOETF"]}}function R_(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const o=/ERROR: 0:(\d+)/.exec(r);if(o){const l=parseInt(o[1]);return t.toUpperCase()+`
3565
3565
 
3566
3566
  `+r+`
3567
3567
 
3568
- `+YB(i.getShaderSource(e),l)}else return r}function XB(i,e){const t=qB(e);return`vec4 ${i}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function KB(i,e){let t;switch(e){case $v:t="Linear";break;case e1:t="Reinhard";break;case t1:t="OptimizedCineon";break;case Kd:t="ACESFilmic";break;case UM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function JB(i){return[i.extensionDerivatives||i.envMapCubeUVHeight||i.bumpMap||i.normalMapTangentSpace||i.clearcoatNormalMap||i.flatShading||i.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ql).join(`
3569
- `)}function ZB(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3570
- `)}function $B(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const o=i.getActiveAttrib(e,r),l=o.name;let c=1;o.type===i.FLOAT_MAT2&&(c=2),o.type===i.FLOAT_MAT3&&(c=3),o.type===i.FLOAT_MAT4&&(c=4),t[l]={type:o.type,location:i.getAttribLocation(e,l),locationSize:c}}return t}function ql(i){return i!==""}function b_(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function L_(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const eR=/^[ \t]*#include +<([\w\d./]+)>/gm;function OA(i){return i.replace(eR,nR)}const tR=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function nR(i,e){let t=gt[e];if(t===void 0){const n=tR.get(e);if(n!==void 0)t=gt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return OA(t)}const iR=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function D_(i){return i.replace(iR,rR)}function rR(i,e,t,n){let r="";for(let o=parseInt(e);o<parseInt(t);o++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function N_(i){let e="precision "+i.precision+` float;
3568
+ `+YB(i.getShaderSource(e),l)}else return r}function XB(i,e){const t=qB(e);return`vec4 ${i}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function KB(i,e){let t;switch(e){case Zv:t="Linear";break;case e1:t="Reinhard";break;case t1:t="OptimizedCineon";break;case Kd:t="ACESFilmic";break;case UM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function JB(i){return[i.extensionDerivatives||i.envMapCubeUVHeight||i.bumpMap||i.normalMapTangentSpace||i.clearcoatNormalMap||i.flatShading||i.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ql).join(`
3569
+ `)}function $B(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3570
+ `)}function ZB(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const o=i.getActiveAttrib(e,r),l=o.name;let c=1;o.type===i.FLOAT_MAT2&&(c=2),o.type===i.FLOAT_MAT3&&(c=3),o.type===i.FLOAT_MAT4&&(c=4),t[l]={type:o.type,location:i.getAttribLocation(e,l),locationSize:c}}return t}function ql(i){return i!==""}function b_(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function L_(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const eR=/^[ \t]*#include +<([\w\d./]+)>/gm;function OA(i){return i.replace(eR,nR)}const tR=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function nR(i,e){let t=mt[e];if(t===void 0){const n=tR.get(e);if(n!==void 0)t=mt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return OA(t)}const iR=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function D_(i){return i.replace(iR,rR)}function rR(i,e,t,n){let r="";for(let o=parseInt(e);o<parseInt(t);o++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function N_(i){let e="precision "+i.precision+` float;
3571
3571
  precision `+i.precision+" int;";return i.precision==="highp"?e+=`
3572
3572
  #define HIGH_PRECISION`:i.precision==="mediump"?e+=`
3573
3573
  #define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
3574
- #define LOW_PRECISION`),e}function sR(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===jv?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===uM?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Dr&&(e="SHADOWMAP_TYPE_VSM"),e}function oR(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case so:case qo:e="ENVMAP_TYPE_CUBE";break;case au:e="ENVMAP_TYPE_CUBE_UV";break}return e}function aR(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case qo:e="ENVMAP_MODE_REFRACTION";break}return e}function lR(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case Zv:e="ENVMAP_BLENDING_MULTIPLY";break;case NM:e="ENVMAP_BLENDING_MIX";break;case PM:e="ENVMAP_BLENDING_ADD";break}return e}function cR(i){const e=i.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 uR(i,e,t,n){const r=i.getContext(),o=t.defines;let l=t.vertexShader,c=t.fragmentShader;const f=sR(t),u=oR(t),d=aR(t),p=lR(t),A=cR(t),g=t.isWebGL2?"":JB(t),E=ZB(o),C=r.createProgram();let _,v,S=t.glslVersion?"#version "+t.glslVersion+`
3574
+ #define LOW_PRECISION`),e}function sR(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===jv?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===uM?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Dr&&(e="SHADOWMAP_TYPE_VSM"),e}function oR(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case so:case qo:e="ENVMAP_TYPE_CUBE";break;case au:e="ENVMAP_TYPE_CUBE_UV";break}return e}function aR(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case qo:e="ENVMAP_MODE_REFRACTION";break}return e}function lR(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case $v:e="ENVMAP_BLENDING_MULTIPLY";break;case NM:e="ENVMAP_BLENDING_MIX";break;case PM:e="ENVMAP_BLENDING_ADD";break}return e}function cR(i){const e=i.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 uR(i,e,t,n){const r=i.getContext(),o=t.defines;let l=t.vertexShader,c=t.fragmentShader;const f=sR(t),u=oR(t),d=aR(t),p=lR(t),A=cR(t),g=t.isWebGL2?"":JB(t),E=$B(o),C=r.createProgram();let _,v,x=t.glslVersion?"#version "+t.glslVersion+`
3575
3575
  `:"";t.isRawShaderMaterial?(_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E].filter(ql).join(`
3576
3576
  `),_.length>0&&(_+=`
3577
3577
  `),v=[g,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E].filter(ql).join(`
3578
3578
  `),v.length>0&&(v+=`
3579
3579
  `)):(_=[N_(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+f:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3580
3580
  `].filter(ql).join(`
3581
- `),v=[g,N_(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.envMap?"#define "+p:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+f:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==hs?"#define TONE_MAPPING":"",t.toneMapping!==hs?gt.tonemapping_pars_fragment:"",t.toneMapping!==hs?KB("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",gt.colorspace_pars_fragment,XB("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3581
+ `),v=[g,N_(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.envMap?"#define "+p:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+f:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==hs?"#define TONE_MAPPING":"",t.toneMapping!==hs?mt.tonemapping_pars_fragment:"",t.toneMapping!==hs?KB("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",mt.colorspace_pars_fragment,XB("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3582
3582
  `].filter(ql).join(`
3583
- `)),l=OA(l),l=b_(l,t),l=L_(l,t),c=OA(c),c=b_(c,t),c=L_(c,t),l=D_(l),c=D_(c),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(S=`#version 300 es
3583
+ `)),l=OA(l),l=b_(l,t),l=L_(l,t),c=OA(c),c=b_(c,t),c=L_(c,t),l=D_(l),c=D_(c),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(x=`#version 300 es
3584
3584
  `,_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
3585
3585
  `)+`
3586
3586
  `+_,v=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===P1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===P1?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
3587
3587
  `)+`
3588
- `+v);const y=S+_+l,x=S+v+c,w=B_(r,r.VERTEX_SHADER,y),b=B_(r,r.FRAGMENT_SHADER,x);r.attachShader(C,w),r.attachShader(C,b),t.index0AttributeName!==void 0?r.bindAttribLocation(C,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(C,0,"position"),r.linkProgram(C);function B(N){if(i.debug.checkShaderErrors){const k=r.getProgramInfoLog(C).trim(),O=r.getShaderInfoLog(w).trim(),F=r.getShaderInfoLog(b).trim();let V=!0,X=!0;if(r.getProgramParameter(C,r.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,C,w,b);else{const te=R_(r,w,"vertex"),Y=R_(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(C,r.VALIDATE_STATUS)+`
3588
+ `+v);const y=x+_+l,S=x+v+c,w=B_(r,r.VERTEX_SHADER,y),b=B_(r,r.FRAGMENT_SHADER,S);r.attachShader(C,w),r.attachShader(C,b),t.index0AttributeName!==void 0?r.bindAttribLocation(C,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(C,0,"position"),r.linkProgram(C);function B(N){if(i.debug.checkShaderErrors){const k=r.getProgramInfoLog(C).trim(),O=r.getShaderInfoLog(w).trim(),F=r.getShaderInfoLog(b).trim();let V=!0,X=!0;if(r.getProgramParameter(C,r.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,C,w,b);else{const te=R_(r,w,"vertex"),q=R_(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(C,r.VALIDATE_STATUS)+`
3589
3589
 
3590
3590
  Program Info Log: `+k+`
3591
3591
  `+te+`
3592
- `+Y)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(O===""||F==="")&&(X=!1);X&&(N.diagnostics={runnable:V,programLog:k,vertexShader:{log:O,prefix:_},fragmentShader:{log:F,prefix:v}})}r.deleteShader(w),r.deleteShader(b),L=new Xu(r,C),R=$B(r,C)}let L;this.getUniforms=function(){return L===void 0&&B(this),L};let R;this.getAttributes=function(){return R===void 0&&B(this),R};let T=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=r.getProgramParameter(C,WB)),T},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=jB++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=w,this.fragmentShader=b,this}let fR=0;class hR{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(o)===!1&&(l.add(o),o.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 dR(e),t.set(e,n)),n}}class dR{constructor(e){this.id=fR++,this.code=e,this.usedTimes=0}}function AR(i,e,t,n,r,o,l){const c=new xA,f=new hR,u=[],d=r.isWebGL2,p=r.logarithmicDepthBuffer,A=r.vertexTextures;let g=r.precision;const E={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 C(R){return R===0?"uv":`uv${R}`}function _(R,T,N,k,O){const F=k.fog,V=O.geometry,X=R.isMeshStandardMaterial?k.environment:null,te=(R.isMeshStandardMaterial?t:e).get(R.envMap||X),Y=te&&te.mapping===au?te.image.height:null,$=E[R.type];R.precision!==null&&(g=r.getMaxPrecision(R.precision),g!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",g,"instead."));const U=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,D=U!==void 0?U.length:0;let G=0;V.morphAttributes.position!==void 0&&(G=1),V.morphAttributes.normal!==void 0&&(G=2),V.morphAttributes.color!==void 0&&(G=3);let K,J,Ae,ge;if($){const Wt=vr[$];K=Wt.vertexShader,J=Wt.fragmentShader}else K=R.vertexShader,J=R.fragmentShader,f.update(R),Ae=f.getVertexShaderID(R),ge=f.getFragmentShaderID(R);const be=i.getRenderTarget(),de=O.isInstancedMesh===!0,Oe=!!R.map,It=!!R.matcap,ot=!!te,oe=!!R.aoMap,Mt=!!R.lightMap,Ne=!!R.bumpMap,Ze=!!R.normalMap,_e=!!R.displacementMap,it=!!R.emissiveMap,Ue=!!R.metalnessMap,He=!!R.roughnessMap,$e=R.anisotropy>0,lt=R.clearcoat>0,mt=R.iridescence>0,H=R.sheen>0,Q=R.transmission>0,se=$e&&!!R.anisotropyMap,Ce=lt&&!!R.clearcoatMap,me=lt&&!!R.clearcoatNormalMap,xe=lt&&!!R.clearcoatRoughnessMap,We=mt&&!!R.iridescenceMap,Se=mt&&!!R.iridescenceThicknessMap,Re=H&&!!R.sheenColorMap,q=H&&!!R.sheenRoughnessMap,Me=!!R.specularMap,pe=!!R.specularColorMap,nt=!!R.specularIntensityMap,je=Q&&!!R.transmissionMap,Je=Q&&!!R.thicknessMap,Ge=!!R.gradientMap,Pe=!!R.alphaMap,dt=R.alphaTest>0,ee=!!R.alphaHash,Te=!!R.extensions,ye=!!V.attributes.uv1,he=!!V.attributes.uv2,we=!!V.attributes.uv3;let qe=hs;return R.toneMapped&&(be===null||be.isXRRenderTarget===!0)&&(qe=i.toneMapping),{isWebGL2:d,shaderID:$,shaderType:R.type,shaderName:R.name,vertexShader:K,fragmentShader:J,defines:R.defines,customVertexShaderID:Ae,customFragmentShaderID:ge,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:g,instancing:de,instancingColor:de&&O.instanceColor!==null,supportsVertexTextures:A,outputColorSpace:be===null?i.outputColorSpace:be.isXRRenderTarget===!0?be.texture.colorSpace:En,map:Oe,matcap:It,envMap:ot,envMapMode:ot&&te.mapping,envMapCubeUVHeight:Y,aoMap:oe,lightMap:Mt,bumpMap:Ne,normalMap:Ze,displacementMap:A&&_e,emissiveMap:it,normalMapObjectSpace:Ze&&R.normalMapType===jM,normalMapTangentSpace:Ze&&R.normalMapType===D1,metalnessMap:Ue,roughnessMap:He,anisotropy:$e,anisotropyMap:se,clearcoat:lt,clearcoatMap:Ce,clearcoatNormalMap:me,clearcoatRoughnessMap:xe,iridescence:mt,iridescenceMap:We,iridescenceThicknessMap:Se,sheen:H,sheenColorMap:Re,sheenRoughnessMap:q,specularMap:Me,specularColorMap:pe,specularIntensityMap:nt,transmission:Q,transmissionMap:je,thicknessMap:Je,gradientMap:Ge,opaque:R.transparent===!1&&R.blending===Yo,alphaMap:Pe,alphaTest:dt,alphaHash:ee,combine:R.combine,mapUv:Oe&&C(R.map.channel),aoMapUv:oe&&C(R.aoMap.channel),lightMapUv:Mt&&C(R.lightMap.channel),bumpMapUv:Ne&&C(R.bumpMap.channel),normalMapUv:Ze&&C(R.normalMap.channel),displacementMapUv:_e&&C(R.displacementMap.channel),emissiveMapUv:it&&C(R.emissiveMap.channel),metalnessMapUv:Ue&&C(R.metalnessMap.channel),roughnessMapUv:He&&C(R.roughnessMap.channel),anisotropyMapUv:se&&C(R.anisotropyMap.channel),clearcoatMapUv:Ce&&C(R.clearcoatMap.channel),clearcoatNormalMapUv:me&&C(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:xe&&C(R.clearcoatRoughnessMap.channel),iridescenceMapUv:We&&C(R.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&C(R.iridescenceThicknessMap.channel),sheenColorMapUv:Re&&C(R.sheenColorMap.channel),sheenRoughnessMapUv:q&&C(R.sheenRoughnessMap.channel),specularMapUv:Me&&C(R.specularMap.channel),specularColorMapUv:pe&&C(R.specularColorMap.channel),specularIntensityMapUv:nt&&C(R.specularIntensityMap.channel),transmissionMapUv:je&&C(R.transmissionMap.channel),thicknessMapUv:Je&&C(R.thicknessMap.channel),alphaMapUv:Pe&&C(R.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(Ze||$e),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,vertexUv1s:ye,vertexUv2s:he,vertexUv3s:we,pointsUvs:O.isPoints===!0&&!!V.attributes.uv&&(Oe||Pe),fog:!!F,useFog:R.fog===!0,fogExp2:F&&F.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:O.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:D,morphTextureStride:G,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:R.dithering,shadowMapEnabled:i.shadowMap.enabled&&N.length>0,shadowMapType:i.shadowMap.type,toneMapping:qe,useLegacyLights:i._useLegacyLights,decodeVideoTexture:Oe&&R.map.isVideoTexture===!0&&Nt.getTransfer(R.map.colorSpace)===Vt,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===Yi,flipSided:R.side===Bn,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:Te&&R.extensions.derivatives===!0,extensionFragDepth:Te&&R.extensions.fragDepth===!0,extensionDrawBuffers:Te&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:Te&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()}}function v(R){const T=[];if(R.shaderID?T.push(R.shaderID):(T.push(R.customVertexShaderID),T.push(R.customFragmentShaderID)),R.defines!==void 0)for(const N in R.defines)T.push(N),T.push(R.defines[N]);return R.isRawShaderMaterial===!1&&(S(T,R),y(T,R),T.push(i.outputColorSpace)),T.push(R.customProgramCacheKey),T.join()}function S(R,T){R.push(T.precision),R.push(T.outputColorSpace),R.push(T.envMapMode),R.push(T.envMapCubeUVHeight),R.push(T.mapUv),R.push(T.alphaMapUv),R.push(T.lightMapUv),R.push(T.aoMapUv),R.push(T.bumpMapUv),R.push(T.normalMapUv),R.push(T.displacementMapUv),R.push(T.emissiveMapUv),R.push(T.metalnessMapUv),R.push(T.roughnessMapUv),R.push(T.anisotropyMapUv),R.push(T.clearcoatMapUv),R.push(T.clearcoatNormalMapUv),R.push(T.clearcoatRoughnessMapUv),R.push(T.iridescenceMapUv),R.push(T.iridescenceThicknessMapUv),R.push(T.sheenColorMapUv),R.push(T.sheenRoughnessMapUv),R.push(T.specularMapUv),R.push(T.specularColorMapUv),R.push(T.specularIntensityMapUv),R.push(T.transmissionMapUv),R.push(T.thicknessMapUv),R.push(T.combine),R.push(T.fogExp2),R.push(T.sizeAttenuation),R.push(T.morphTargetsCount),R.push(T.morphAttributeCount),R.push(T.numDirLights),R.push(T.numPointLights),R.push(T.numSpotLights),R.push(T.numSpotLightMaps),R.push(T.numHemiLights),R.push(T.numRectAreaLights),R.push(T.numDirLightShadows),R.push(T.numPointLightShadows),R.push(T.numSpotLightShadows),R.push(T.numSpotLightShadowsWithMaps),R.push(T.numLightProbes),R.push(T.shadowMapType),R.push(T.toneMapping),R.push(T.numClippingPlanes),R.push(T.numClipIntersection),R.push(T.depthPacking)}function y(R,T){c.disableAll(),T.isWebGL2&&c.enable(0),T.supportsVertexTextures&&c.enable(1),T.instancing&&c.enable(2),T.instancingColor&&c.enable(3),T.matcap&&c.enable(4),T.envMap&&c.enable(5),T.normalMapObjectSpace&&c.enable(6),T.normalMapTangentSpace&&c.enable(7),T.clearcoat&&c.enable(8),T.iridescence&&c.enable(9),T.alphaTest&&c.enable(10),T.vertexColors&&c.enable(11),T.vertexAlphas&&c.enable(12),T.vertexUv1s&&c.enable(13),T.vertexUv2s&&c.enable(14),T.vertexUv3s&&c.enable(15),T.vertexTangents&&c.enable(16),T.anisotropy&&c.enable(17),T.alphaHash&&c.enable(18),R.push(c.mask),c.disableAll(),T.fog&&c.enable(0),T.useFog&&c.enable(1),T.flatShading&&c.enable(2),T.logarithmicDepthBuffer&&c.enable(3),T.skinning&&c.enable(4),T.morphTargets&&c.enable(5),T.morphNormals&&c.enable(6),T.morphColors&&c.enable(7),T.premultipliedAlpha&&c.enable(8),T.shadowMapEnabled&&c.enable(9),T.useLegacyLights&&c.enable(10),T.doubleSided&&c.enable(11),T.flipSided&&c.enable(12),T.useDepthPacking&&c.enable(13),T.dithering&&c.enable(14),T.transmission&&c.enable(15),T.sheen&&c.enable(16),T.opaque&&c.enable(17),T.pointsUvs&&c.enable(18),T.decodeVideoTexture&&c.enable(19),R.push(c.mask)}function x(R){const T=E[R.type];let N;if(T){const k=vr[T];N=Hu.clone(k.uniforms)}else N=R.uniforms;return N}function w(R,T){let N;for(let k=0,O=u.length;k<O;k++){const F=u[k];if(F.cacheKey===T){N=F,++N.usedTimes;break}}return N===void 0&&(N=new uR(i,T,R,o),u.push(N)),N}function b(R){if(--R.usedTimes===0){const T=u.indexOf(R);u[T]=u[u.length-1],u.pop(),R.destroy()}}function B(R){f.remove(R)}function L(){f.dispose()}return{getParameters:_,getProgramCacheKey:v,getUniforms:x,acquireProgram:w,releaseProgram:b,releaseShaderCache:B,programs:u,dispose:L}}function pR(){let i=new WeakMap;function e(o){let l=i.get(o);return l===void 0&&(l={},i.set(o,l)),l}function t(o){i.delete(o)}function n(o,l,c){i.get(o)[l]=c}function r(){i=new WeakMap}return{get:e,remove:t,update:n,dispose:r}}function gR(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function P_(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function U_(){const i=[];let e=0;const t=[],n=[],r=[];function o(){e=0,t.length=0,n.length=0,r.length=0}function l(p,A,g,E,C,_){let v=i[e];return v===void 0?(v={id:p.id,object:p,geometry:A,material:g,groupOrder:E,renderOrder:p.renderOrder,z:C,group:_},i[e]=v):(v.id=p.id,v.object=p,v.geometry=A,v.material=g,v.groupOrder=E,v.renderOrder=p.renderOrder,v.z=C,v.group=_),e++,v}function c(p,A,g,E,C,_){const v=l(p,A,g,E,C,_);g.transmission>0?n.push(v):g.transparent===!0?r.push(v):t.push(v)}function f(p,A,g,E,C,_){const v=l(p,A,g,E,C,_);g.transmission>0?n.unshift(v):g.transparent===!0?r.unshift(v):t.unshift(v)}function u(p,A){t.length>1&&t.sort(p||gR),n.length>1&&n.sort(A||P_),r.length>1&&r.sort(A||P_)}function d(){for(let p=e,A=i.length;p<A;p++){const g=i[p];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:r,init:o,push:c,unshift:f,finish:d,sort:u}}function mR(){let i=new WeakMap;function e(n,r){const o=i.get(n);let l;return o===void 0?(l=new U_,i.set(n,[l])):r>=o.length?(l=new U_,o.push(l)):l=o[r],l}function t(){i=new WeakMap}return{get:e,dispose:t}}function vR(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new tt};break;case"SpotLight":t={position:new j,direction:new j,color:new tt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new tt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new tt,groundColor:new tt};break;case"RectAreaLight":t={color:new tt,position:new j,halfWidth:new j,halfHeight:new j};break}return i[e.id]=t,t}}}function _R(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let ER=0;function yR(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function CR(i,e){const t=new vR,n=_R(),r={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 d=0;d<9;d++)r.probe.push(new j);const o=new j,l=new ct,c=new ct;function f(d,p){let A=0,g=0,E=0;for(let k=0;k<9;k++)r.probe[k].set(0,0,0);let C=0,_=0,v=0,S=0,y=0,x=0,w=0,b=0,B=0,L=0,R=0;d.sort(yR);const T=p===!0?Math.PI:1;for(let k=0,O=d.length;k<O;k++){const F=d[k],V=F.color,X=F.intensity,te=F.distance,Y=F.shadow&&F.shadow.map?F.shadow.map.texture:null;if(F.isAmbientLight)A+=V.r*X*T,g+=V.g*X*T,E+=V.b*X*T;else if(F.isLightProbe){for(let $=0;$<9;$++)r.probe[$].addScaledVector(F.sh.coefficients[$],X);R++}else if(F.isDirectionalLight){const $=t.get(F);if($.color.copy(F.color).multiplyScalar(F.intensity*T),F.castShadow){const U=F.shadow,D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,r.directionalShadow[C]=D,r.directionalShadowMap[C]=Y,r.directionalShadowMatrix[C]=F.shadow.matrix,x++}r.directional[C]=$,C++}else if(F.isSpotLight){const $=t.get(F);$.position.setFromMatrixPosition(F.matrixWorld),$.color.copy(V).multiplyScalar(X*T),$.distance=te,$.coneCos=Math.cos(F.angle),$.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),$.decay=F.decay,r.spot[v]=$;const U=F.shadow;if(F.map&&(r.spotLightMap[B]=F.map,B++,U.updateMatrices(F),F.castShadow&&L++),r.spotLightMatrix[v]=U.matrix,F.castShadow){const D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,r.spotShadow[v]=D,r.spotShadowMap[v]=Y,b++}v++}else if(F.isRectAreaLight){const $=t.get(F);$.color.copy(V).multiplyScalar(X),$.halfWidth.set(F.width*.5,0,0),$.halfHeight.set(0,F.height*.5,0),r.rectArea[S]=$,S++}else if(F.isPointLight){const $=t.get(F);if($.color.copy(F.color).multiplyScalar(F.intensity*T),$.distance=F.distance,$.decay=F.decay,F.castShadow){const U=F.shadow,D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,D.shadowCameraNear=U.camera.near,D.shadowCameraFar=U.camera.far,r.pointShadow[_]=D,r.pointShadowMap[_]=Y,r.pointShadowMatrix[_]=F.shadow.matrix,w++}r.point[_]=$,_++}else if(F.isHemisphereLight){const $=t.get(F);$.skyColor.copy(F.color).multiplyScalar(X*T),$.groundColor.copy(F.groundColor).multiplyScalar(X*T),r.hemi[y]=$,y++}}S>0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_FLOAT_1,r.rectAreaLTC2=Le.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_HALF_1,r.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=A,r.ambient[1]=g,r.ambient[2]=E;const N=r.hash;(N.directionalLength!==C||N.pointLength!==_||N.spotLength!==v||N.rectAreaLength!==S||N.hemiLength!==y||N.numDirectionalShadows!==x||N.numPointShadows!==w||N.numSpotShadows!==b||N.numSpotMaps!==B||N.numLightProbes!==R)&&(r.directional.length=C,r.spot.length=v,r.rectArea.length=S,r.point.length=_,r.hemi.length=y,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=w,r.pointShadowMap.length=w,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=w,r.spotLightMatrix.length=b+B-L,r.spotLightMap.length=B,r.numSpotLightShadowsWithMaps=L,r.numLightProbes=R,N.directionalLength=C,N.pointLength=_,N.spotLength=v,N.rectAreaLength=S,N.hemiLength=y,N.numDirectionalShadows=x,N.numPointShadows=w,N.numSpotShadows=b,N.numSpotMaps=B,N.numLightProbes=R,r.version=ER++)}function u(d,p){let A=0,g=0,E=0,C=0,_=0;const v=p.matrixWorldInverse;for(let S=0,y=d.length;S<y;S++){const x=d[S];if(x.isDirectionalLight){const w=r.directional[A];w.direction.setFromMatrixPosition(x.matrixWorld),o.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(v),A++}else if(x.isSpotLight){const w=r.spot[E];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(v),w.direction.setFromMatrixPosition(x.matrixWorld),o.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(v),E++}else if(x.isRectAreaLight){const w=r.rectArea[C];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(v),c.identity(),l.copy(x.matrixWorld),l.premultiply(v),c.extractRotation(l),w.halfWidth.set(x.width*.5,0,0),w.halfHeight.set(0,x.height*.5,0),w.halfWidth.applyMatrix4(c),w.halfHeight.applyMatrix4(c),C++}else if(x.isPointLight){const w=r.point[g];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(v),g++}else if(x.isHemisphereLight){const w=r.hemi[_];w.direction.setFromMatrixPosition(x.matrixWorld),w.direction.transformDirection(v),_++}}}return{setup:f,setupView:u,state:r}}function k_(i,e){const t=new CR(i,e),n=[],r=[];function o(){n.length=0,r.length=0}function l(p){n.push(p)}function c(p){r.push(p)}function f(p){t.setup(n,p)}function u(p){t.setupView(n,p)}return{init:o,state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:f,setupLightsView:u,pushLight:l,pushShadow:c}}function IR(i,e){let t=new WeakMap;function n(o,l=0){const c=t.get(o);let f;return c===void 0?(f=new k_(i,e),t.set(o,[f])):l>=c.length?(f=new k_(i,e),c.push(f)):f=c[l],f}function r(){t=new WeakMap}return{get:n,dispose:r}}class F_ extends gr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=VM,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 xR extends gr{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 SR=`void main() {
3592
+ `+q)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(O===""||F==="")&&(X=!1);X&&(N.diagnostics={runnable:V,programLog:k,vertexShader:{log:O,prefix:_},fragmentShader:{log:F,prefix:v}})}r.deleteShader(w),r.deleteShader(b),L=new Xu(r,C),R=ZB(r,C)}let L;this.getUniforms=function(){return L===void 0&&B(this),L};let R;this.getAttributes=function(){return R===void 0&&B(this),R};let T=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=r.getProgramParameter(C,WB)),T},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=jB++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=w,this.fragmentShader=b,this}let fR=0;class hR{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(o)===!1&&(l.add(o),o.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 dR(e),t.set(e,n)),n}}class dR{constructor(e){this.id=fR++,this.code=e,this.usedTimes=0}}function AR(i,e,t,n,r,o,l){const c=new xA,f=new hR,u=[],d=r.isWebGL2,p=r.logarithmicDepthBuffer,A=r.vertexTextures;let g=r.precision;const E={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 C(R){return R===0?"uv":`uv${R}`}function _(R,T,N,k,O){const F=k.fog,V=O.geometry,X=R.isMeshStandardMaterial?k.environment:null,te=(R.isMeshStandardMaterial?t:e).get(R.envMap||X),q=te&&te.mapping===au?te.image.height:null,Z=E[R.type];R.precision!==null&&(g=r.getMaxPrecision(R.precision),g!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",g,"instead."));const U=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,D=U!==void 0?U.length:0;let G=0;V.morphAttributes.position!==void 0&&(G=1),V.morphAttributes.normal!==void 0&&(G=2),V.morphAttributes.color!==void 0&&(G=3);let K,J,Ae,ge;if(Z){const Wt=vr[Z];K=Wt.vertexShader,J=Wt.fragmentShader}else K=R.vertexShader,J=R.fragmentShader,f.update(R),Ae=f.getVertexShaderID(R),ge=f.getFragmentShaderID(R);const be=i.getRenderTarget(),de=O.isInstancedMesh===!0,Oe=!!R.map,It=!!R.matcap,st=!!te,oe=!!R.aoMap,Mt=!!R.lightMap,Ne=!!R.bumpMap,$e=!!R.normalMap,Ee=!!R.displacementMap,nt=!!R.emissiveMap,Ue=!!R.metalnessMap,He=!!R.roughnessMap,ot=R.anisotropy>0,ut=R.clearcoat>0,At=R.iridescence>0,H=R.sheen>0,Q=R.transmission>0,se=ot&&!!R.anisotropyMap,Ce=ut&&!!R.clearcoatMap,me=ut&&!!R.clearcoatNormalMap,xe=ut&&!!R.clearcoatRoughnessMap,We=At&&!!R.iridescenceMap,Se=At&&!!R.iridescenceThicknessMap,Re=H&&!!R.sheenColorMap,Y=H&&!!R.sheenRoughnessMap,Me=!!R.specularMap,pe=!!R.specularColorMap,tt=!!R.specularIntensityMap,je=Q&&!!R.transmissionMap,Je=Q&&!!R.thicknessMap,Ge=!!R.gradientMap,Pe=!!R.alphaMap,dt=R.alphaTest>0,ee=!!R.alphaHash,Te=!!R.extensions,ye=!!V.attributes.uv1,he=!!V.attributes.uv2,we=!!V.attributes.uv3;let qe=hs;return R.toneMapped&&(be===null||be.isXRRenderTarget===!0)&&(qe=i.toneMapping),{isWebGL2:d,shaderID:Z,shaderType:R.type,shaderName:R.name,vertexShader:K,fragmentShader:J,defines:R.defines,customVertexShaderID:Ae,customFragmentShaderID:ge,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:g,instancing:de,instancingColor:de&&O.instanceColor!==null,supportsVertexTextures:A,outputColorSpace:be===null?i.outputColorSpace:be.isXRRenderTarget===!0?be.texture.colorSpace:En,map:Oe,matcap:It,envMap:st,envMapMode:st&&te.mapping,envMapCubeUVHeight:q,aoMap:oe,lightMap:Mt,bumpMap:Ne,normalMap:$e,displacementMap:A&&Ee,emissiveMap:nt,normalMapObjectSpace:$e&&R.normalMapType===jM,normalMapTangentSpace:$e&&R.normalMapType===D1,metalnessMap:Ue,roughnessMap:He,anisotropy:ot,anisotropyMap:se,clearcoat:ut,clearcoatMap:Ce,clearcoatNormalMap:me,clearcoatRoughnessMap:xe,iridescence:At,iridescenceMap:We,iridescenceThicknessMap:Se,sheen:H,sheenColorMap:Re,sheenRoughnessMap:Y,specularMap:Me,specularColorMap:pe,specularIntensityMap:tt,transmission:Q,transmissionMap:je,thicknessMap:Je,gradientMap:Ge,opaque:R.transparent===!1&&R.blending===Yo,alphaMap:Pe,alphaTest:dt,alphaHash:ee,combine:R.combine,mapUv:Oe&&C(R.map.channel),aoMapUv:oe&&C(R.aoMap.channel),lightMapUv:Mt&&C(R.lightMap.channel),bumpMapUv:Ne&&C(R.bumpMap.channel),normalMapUv:$e&&C(R.normalMap.channel),displacementMapUv:Ee&&C(R.displacementMap.channel),emissiveMapUv:nt&&C(R.emissiveMap.channel),metalnessMapUv:Ue&&C(R.metalnessMap.channel),roughnessMapUv:He&&C(R.roughnessMap.channel),anisotropyMapUv:se&&C(R.anisotropyMap.channel),clearcoatMapUv:Ce&&C(R.clearcoatMap.channel),clearcoatNormalMapUv:me&&C(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:xe&&C(R.clearcoatRoughnessMap.channel),iridescenceMapUv:We&&C(R.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&C(R.iridescenceThicknessMap.channel),sheenColorMapUv:Re&&C(R.sheenColorMap.channel),sheenRoughnessMapUv:Y&&C(R.sheenRoughnessMap.channel),specularMapUv:Me&&C(R.specularMap.channel),specularColorMapUv:pe&&C(R.specularColorMap.channel),specularIntensityMapUv:tt&&C(R.specularIntensityMap.channel),transmissionMapUv:je&&C(R.transmissionMap.channel),thicknessMapUv:Je&&C(R.thicknessMap.channel),alphaMapUv:Pe&&C(R.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&($e||ot),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,vertexUv1s:ye,vertexUv2s:he,vertexUv3s:we,pointsUvs:O.isPoints===!0&&!!V.attributes.uv&&(Oe||Pe),fog:!!F,useFog:R.fog===!0,fogExp2:F&&F.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:O.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:D,morphTextureStride:G,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:R.dithering,shadowMapEnabled:i.shadowMap.enabled&&N.length>0,shadowMapType:i.shadowMap.type,toneMapping:qe,useLegacyLights:i._useLegacyLights,decodeVideoTexture:Oe&&R.map.isVideoTexture===!0&&Nt.getTransfer(R.map.colorSpace)===Vt,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===Yi,flipSided:R.side===Bn,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:Te&&R.extensions.derivatives===!0,extensionFragDepth:Te&&R.extensions.fragDepth===!0,extensionDrawBuffers:Te&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:Te&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()}}function v(R){const T=[];if(R.shaderID?T.push(R.shaderID):(T.push(R.customVertexShaderID),T.push(R.customFragmentShaderID)),R.defines!==void 0)for(const N in R.defines)T.push(N),T.push(R.defines[N]);return R.isRawShaderMaterial===!1&&(x(T,R),y(T,R),T.push(i.outputColorSpace)),T.push(R.customProgramCacheKey),T.join()}function x(R,T){R.push(T.precision),R.push(T.outputColorSpace),R.push(T.envMapMode),R.push(T.envMapCubeUVHeight),R.push(T.mapUv),R.push(T.alphaMapUv),R.push(T.lightMapUv),R.push(T.aoMapUv),R.push(T.bumpMapUv),R.push(T.normalMapUv),R.push(T.displacementMapUv),R.push(T.emissiveMapUv),R.push(T.metalnessMapUv),R.push(T.roughnessMapUv),R.push(T.anisotropyMapUv),R.push(T.clearcoatMapUv),R.push(T.clearcoatNormalMapUv),R.push(T.clearcoatRoughnessMapUv),R.push(T.iridescenceMapUv),R.push(T.iridescenceThicknessMapUv),R.push(T.sheenColorMapUv),R.push(T.sheenRoughnessMapUv),R.push(T.specularMapUv),R.push(T.specularColorMapUv),R.push(T.specularIntensityMapUv),R.push(T.transmissionMapUv),R.push(T.thicknessMapUv),R.push(T.combine),R.push(T.fogExp2),R.push(T.sizeAttenuation),R.push(T.morphTargetsCount),R.push(T.morphAttributeCount),R.push(T.numDirLights),R.push(T.numPointLights),R.push(T.numSpotLights),R.push(T.numSpotLightMaps),R.push(T.numHemiLights),R.push(T.numRectAreaLights),R.push(T.numDirLightShadows),R.push(T.numPointLightShadows),R.push(T.numSpotLightShadows),R.push(T.numSpotLightShadowsWithMaps),R.push(T.numLightProbes),R.push(T.shadowMapType),R.push(T.toneMapping),R.push(T.numClippingPlanes),R.push(T.numClipIntersection),R.push(T.depthPacking)}function y(R,T){c.disableAll(),T.isWebGL2&&c.enable(0),T.supportsVertexTextures&&c.enable(1),T.instancing&&c.enable(2),T.instancingColor&&c.enable(3),T.matcap&&c.enable(4),T.envMap&&c.enable(5),T.normalMapObjectSpace&&c.enable(6),T.normalMapTangentSpace&&c.enable(7),T.clearcoat&&c.enable(8),T.iridescence&&c.enable(9),T.alphaTest&&c.enable(10),T.vertexColors&&c.enable(11),T.vertexAlphas&&c.enable(12),T.vertexUv1s&&c.enable(13),T.vertexUv2s&&c.enable(14),T.vertexUv3s&&c.enable(15),T.vertexTangents&&c.enable(16),T.anisotropy&&c.enable(17),T.alphaHash&&c.enable(18),R.push(c.mask),c.disableAll(),T.fog&&c.enable(0),T.useFog&&c.enable(1),T.flatShading&&c.enable(2),T.logarithmicDepthBuffer&&c.enable(3),T.skinning&&c.enable(4),T.morphTargets&&c.enable(5),T.morphNormals&&c.enable(6),T.morphColors&&c.enable(7),T.premultipliedAlpha&&c.enable(8),T.shadowMapEnabled&&c.enable(9),T.useLegacyLights&&c.enable(10),T.doubleSided&&c.enable(11),T.flipSided&&c.enable(12),T.useDepthPacking&&c.enable(13),T.dithering&&c.enable(14),T.transmission&&c.enable(15),T.sheen&&c.enable(16),T.opaque&&c.enable(17),T.pointsUvs&&c.enable(18),T.decodeVideoTexture&&c.enable(19),R.push(c.mask)}function S(R){const T=E[R.type];let N;if(T){const k=vr[T];N=Hu.clone(k.uniforms)}else N=R.uniforms;return N}function w(R,T){let N;for(let k=0,O=u.length;k<O;k++){const F=u[k];if(F.cacheKey===T){N=F,++N.usedTimes;break}}return N===void 0&&(N=new uR(i,T,R,o),u.push(N)),N}function b(R){if(--R.usedTimes===0){const T=u.indexOf(R);u[T]=u[u.length-1],u.pop(),R.destroy()}}function B(R){f.remove(R)}function L(){f.dispose()}return{getParameters:_,getProgramCacheKey:v,getUniforms:S,acquireProgram:w,releaseProgram:b,releaseShaderCache:B,programs:u,dispose:L}}function pR(){let i=new WeakMap;function e(o){let l=i.get(o);return l===void 0&&(l={},i.set(o,l)),l}function t(o){i.delete(o)}function n(o,l,c){i.get(o)[l]=c}function r(){i=new WeakMap}return{get:e,remove:t,update:n,dispose:r}}function gR(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function P_(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function U_(){const i=[];let e=0;const t=[],n=[],r=[];function o(){e=0,t.length=0,n.length=0,r.length=0}function l(p,A,g,E,C,_){let v=i[e];return v===void 0?(v={id:p.id,object:p,geometry:A,material:g,groupOrder:E,renderOrder:p.renderOrder,z:C,group:_},i[e]=v):(v.id=p.id,v.object=p,v.geometry=A,v.material=g,v.groupOrder=E,v.renderOrder=p.renderOrder,v.z=C,v.group=_),e++,v}function c(p,A,g,E,C,_){const v=l(p,A,g,E,C,_);g.transmission>0?n.push(v):g.transparent===!0?r.push(v):t.push(v)}function f(p,A,g,E,C,_){const v=l(p,A,g,E,C,_);g.transmission>0?n.unshift(v):g.transparent===!0?r.unshift(v):t.unshift(v)}function u(p,A){t.length>1&&t.sort(p||gR),n.length>1&&n.sort(A||P_),r.length>1&&r.sort(A||P_)}function d(){for(let p=e,A=i.length;p<A;p++){const g=i[p];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:r,init:o,push:c,unshift:f,finish:d,sort:u}}function mR(){let i=new WeakMap;function e(n,r){const o=i.get(n);let l;return o===void 0?(l=new U_,i.set(n,[l])):r>=o.length?(l=new U_,o.push(l)):l=o[r],l}function t(){i=new WeakMap}return{get:e,dispose:t}}function vR(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new et};break;case"SpotLight":t={position:new j,direction:new j,color:new et,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new et,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new et,groundColor:new et};break;case"RectAreaLight":t={color:new et,position:new j,halfWidth:new j,halfHeight:new j};break}return i[e.id]=t,t}}}function _R(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ke,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let ER=0;function yR(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function CR(i,e){const t=new vR,n=_R(),r={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 d=0;d<9;d++)r.probe.push(new j);const o=new j,l=new lt,c=new lt;function f(d,p){let A=0,g=0,E=0;for(let k=0;k<9;k++)r.probe[k].set(0,0,0);let C=0,_=0,v=0,x=0,y=0,S=0,w=0,b=0,B=0,L=0,R=0;d.sort(yR);const T=p===!0?Math.PI:1;for(let k=0,O=d.length;k<O;k++){const F=d[k],V=F.color,X=F.intensity,te=F.distance,q=F.shadow&&F.shadow.map?F.shadow.map.texture:null;if(F.isAmbientLight)A+=V.r*X*T,g+=V.g*X*T,E+=V.b*X*T;else if(F.isLightProbe){for(let Z=0;Z<9;Z++)r.probe[Z].addScaledVector(F.sh.coefficients[Z],X);R++}else if(F.isDirectionalLight){const Z=t.get(F);if(Z.color.copy(F.color).multiplyScalar(F.intensity*T),F.castShadow){const U=F.shadow,D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,r.directionalShadow[C]=D,r.directionalShadowMap[C]=q,r.directionalShadowMatrix[C]=F.shadow.matrix,S++}r.directional[C]=Z,C++}else if(F.isSpotLight){const Z=t.get(F);Z.position.setFromMatrixPosition(F.matrixWorld),Z.color.copy(V).multiplyScalar(X*T),Z.distance=te,Z.coneCos=Math.cos(F.angle),Z.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),Z.decay=F.decay,r.spot[v]=Z;const U=F.shadow;if(F.map&&(r.spotLightMap[B]=F.map,B++,U.updateMatrices(F),F.castShadow&&L++),r.spotLightMatrix[v]=U.matrix,F.castShadow){const D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,r.spotShadow[v]=D,r.spotShadowMap[v]=q,b++}v++}else if(F.isRectAreaLight){const Z=t.get(F);Z.color.copy(V).multiplyScalar(X),Z.halfWidth.set(F.width*.5,0,0),Z.halfHeight.set(0,F.height*.5,0),r.rectArea[x]=Z,x++}else if(F.isPointLight){const Z=t.get(F);if(Z.color.copy(F.color).multiplyScalar(F.intensity*T),Z.distance=F.distance,Z.decay=F.decay,F.castShadow){const U=F.shadow,D=n.get(F);D.shadowBias=U.bias,D.shadowNormalBias=U.normalBias,D.shadowRadius=U.radius,D.shadowMapSize=U.mapSize,D.shadowCameraNear=U.camera.near,D.shadowCameraFar=U.camera.far,r.pointShadow[_]=D,r.pointShadowMap[_]=q,r.pointShadowMatrix[_]=F.shadow.matrix,w++}r.point[_]=Z,_++}else if(F.isHemisphereLight){const Z=t.get(F);Z.skyColor.copy(F.color).multiplyScalar(X*T),Z.groundColor.copy(F.groundColor).multiplyScalar(X*T),r.hemi[y]=Z,y++}}x>0&&(e.isWebGL2||i.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_FLOAT_1,r.rectAreaLTC2=Le.LTC_FLOAT_2):i.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Le.LTC_HALF_1,r.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=A,r.ambient[1]=g,r.ambient[2]=E;const N=r.hash;(N.directionalLength!==C||N.pointLength!==_||N.spotLength!==v||N.rectAreaLength!==x||N.hemiLength!==y||N.numDirectionalShadows!==S||N.numPointShadows!==w||N.numSpotShadows!==b||N.numSpotMaps!==B||N.numLightProbes!==R)&&(r.directional.length=C,r.spot.length=v,r.rectArea.length=x,r.point.length=_,r.hemi.length=y,r.directionalShadow.length=S,r.directionalShadowMap.length=S,r.pointShadow.length=w,r.pointShadowMap.length=w,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=S,r.pointShadowMatrix.length=w,r.spotLightMatrix.length=b+B-L,r.spotLightMap.length=B,r.numSpotLightShadowsWithMaps=L,r.numLightProbes=R,N.directionalLength=C,N.pointLength=_,N.spotLength=v,N.rectAreaLength=x,N.hemiLength=y,N.numDirectionalShadows=S,N.numPointShadows=w,N.numSpotShadows=b,N.numSpotMaps=B,N.numLightProbes=R,r.version=ER++)}function u(d,p){let A=0,g=0,E=0,C=0,_=0;const v=p.matrixWorldInverse;for(let x=0,y=d.length;x<y;x++){const S=d[x];if(S.isDirectionalLight){const w=r.directional[A];w.direction.setFromMatrixPosition(S.matrixWorld),o.setFromMatrixPosition(S.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(v),A++}else if(S.isSpotLight){const w=r.spot[E];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(v),w.direction.setFromMatrixPosition(S.matrixWorld),o.setFromMatrixPosition(S.target.matrixWorld),w.direction.sub(o),w.direction.transformDirection(v),E++}else if(S.isRectAreaLight){const w=r.rectArea[C];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(v),c.identity(),l.copy(S.matrixWorld),l.premultiply(v),c.extractRotation(l),w.halfWidth.set(S.width*.5,0,0),w.halfHeight.set(0,S.height*.5,0),w.halfWidth.applyMatrix4(c),w.halfHeight.applyMatrix4(c),C++}else if(S.isPointLight){const w=r.point[g];w.position.setFromMatrixPosition(S.matrixWorld),w.position.applyMatrix4(v),g++}else if(S.isHemisphereLight){const w=r.hemi[_];w.direction.setFromMatrixPosition(S.matrixWorld),w.direction.transformDirection(v),_++}}}return{setup:f,setupView:u,state:r}}function k_(i,e){const t=new CR(i,e),n=[],r=[];function o(){n.length=0,r.length=0}function l(p){n.push(p)}function c(p){r.push(p)}function f(p){t.setup(n,p)}function u(p){t.setupView(n,p)}return{init:o,state:{lightsArray:n,shadowsArray:r,lights:t},setupLights:f,setupLightsView:u,pushLight:l,pushShadow:c}}function IR(i,e){let t=new WeakMap;function n(o,l=0){const c=t.get(o);let f;return c===void 0?(f=new k_(i,e),t.set(o,[f])):l>=c.length?(f=new k_(i,e),c.push(f)):f=c[l],f}function r(){t=new WeakMap}return{get:n,dispose:r}}class F_ extends gr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=VM,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 xR extends gr{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 SR=`void main() {
3593
3593
  gl_Position = vec4( position, 1.0 );
3594
3594
  }`,wR=`uniform sampler2D shadow_pass;
3595
3595
  uniform vec2 resolution;
@@ -3617,12 +3617,12 @@ void main() {
3617
3617
  squared_mean = squared_mean / samples;
3618
3618
  float std_dev = sqrt( squared_mean - mean * mean );
3619
3619
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3620
- }`;function MR(i,e,t){let n=new DA;const r=new Ke,o=new Ke,l=new Gt,c=new F_({depthPacking:WM}),f=new xR,u={},d=t.maxTextureSize,p={[ji]:Bn,[Bn]:ji,[Yi]:Yi},A=new Si({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ke},radius:{value:4}},vertexShader:SR,fragmentShader:wR}),g=A.clone();g.defines.HORIZONTAL_PASS=1;const E=new xi;E.setAttribute("position",new bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new Wn(E,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=jv;let v=this.type;this.render=function(w,b,B){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||w.length===0)return;const L=i.getRenderTarget(),R=i.getActiveCubeFace(),T=i.getActiveMipmapLevel(),N=i.state;N.setBlending(Nr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const k=v!==Dr&&this.type===Dr,O=v===Dr&&this.type!==Dr;for(let F=0,V=w.length;F<V;F++){const X=w[F],te=X.shadow;if(te===void 0){console.warn("THREE.WebGLShadowMap:",X,"has no shadow.");continue}if(te.autoUpdate===!1&&te.needsUpdate===!1)continue;r.copy(te.mapSize);const Y=te.getFrameExtents();if(r.multiply(Y),o.copy(te.mapSize),(r.x>d||r.y>d)&&(r.x>d&&(o.x=Math.floor(d/Y.x),r.x=o.x*Y.x,te.mapSize.x=o.x),r.y>d&&(o.y=Math.floor(d/Y.y),r.y=o.y*Y.y,te.mapSize.y=o.y)),te.map===null||k===!0||O===!0){const U=this.type!==Dr?{minFilter:qt,magFilter:qt}:{};te.map!==null&&te.map.dispose(),te.map=new Xi(r.x,r.y,U),te.map.texture.name=X.name+".shadowMap",te.camera.updateProjectionMatrix()}i.setRenderTarget(te.map),i.clear();const $=te.getViewportCount();for(let U=0;U<$;U++){const D=te.getViewport(U);l.set(o.x*D.x,o.y*D.y,o.x*D.z,o.y*D.w),N.viewport(l),te.updateMatrices(X,U),n=te.getFrustum(),x(b,B,te.camera,X,this.type)}te.isPointLightShadow!==!0&&this.type===Dr&&S(te,B),te.needsUpdate=!1}v=this.type,_.needsUpdate=!1,i.setRenderTarget(L,R,T)};function S(w,b){const B=e.update(C);A.defines.VSM_SAMPLES!==w.blurSamples&&(A.defines.VSM_SAMPLES=w.blurSamples,g.defines.VSM_SAMPLES=w.blurSamples,A.needsUpdate=!0,g.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new Xi(r.x,r.y)),A.uniforms.shadow_pass.value=w.map.texture,A.uniforms.resolution.value=w.mapSize,A.uniforms.radius.value=w.radius,i.setRenderTarget(w.mapPass),i.clear(),i.renderBufferDirect(b,null,B,A,C,null),g.uniforms.shadow_pass.value=w.mapPass.texture,g.uniforms.resolution.value=w.mapSize,g.uniforms.radius.value=w.radius,i.setRenderTarget(w.map),i.clear(),i.renderBufferDirect(b,null,B,g,C,null)}function y(w,b,B,L){let R=null;const T=B.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(T!==void 0)R=T;else if(R=B.isPointLight===!0?f:c,i.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){const N=R.uuid,k=b.uuid;let O=u[N];O===void 0&&(O={},u[N]=O);let F=O[k];F===void 0&&(F=R.clone(),O[k]=F),R=F}if(R.visible=b.visible,R.wireframe=b.wireframe,L===Dr?R.side=b.shadowSide!==null?b.shadowSide:b.side:R.side=b.shadowSide!==null?b.shadowSide:p[b.side],R.alphaMap=b.alphaMap,R.alphaTest=b.alphaTest,R.map=b.map,R.clipShadows=b.clipShadows,R.clippingPlanes=b.clippingPlanes,R.clipIntersection=b.clipIntersection,R.displacementMap=b.displacementMap,R.displacementScale=b.displacementScale,R.displacementBias=b.displacementBias,R.wireframeLinewidth=b.wireframeLinewidth,R.linewidth=b.linewidth,B.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const N=i.properties.get(R);N.light=B}return R}function x(w,b,B,L,R){if(w.visible===!1)return;if(w.layers.test(b.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&R===Dr)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,w.matrixWorld);const k=e.update(w),O=w.material;if(Array.isArray(O)){const F=k.groups;for(let V=0,X=F.length;V<X;V++){const te=F[V],Y=O[te.materialIndex];if(Y&&Y.visible){const $=y(w,Y,L,R);i.renderBufferDirect(B,null,k,$,w,te)}}}else if(O.visible){const F=y(w,O,L,R);i.renderBufferDirect(B,null,k,F,w,null)}}const N=w.children;for(let k=0,O=N.length;k<O;k++)x(N[k],b,B,L,R)}}function TR(i,e,t){const n=t.isWebGL2;function r(){let ee=!1;const Te=new Gt;let ye=null;const he=new Gt(0,0,0,0);return{setMask:function(we){ye!==we&&!ee&&(i.colorMask(we,we,we,we),ye=we)},setLocked:function(we){ee=we},setClear:function(we,qe,At,Wt,Dn){Dn===!0&&(we*=Wt,qe*=Wt,At*=Wt),Te.set(we,qe,At,Wt),he.equals(Te)===!1&&(i.clearColor(we,qe,At,Wt),he.copy(Te))},reset:function(){ee=!1,ye=null,he.set(-1,0,0,0)}}}function o(){let ee=!1,Te=null,ye=null,he=null;return{setTest:function(we){we?Oe(i.DEPTH_TEST):It(i.DEPTH_TEST)},setMask:function(we){Te!==we&&!ee&&(i.depthMask(we),Te=we)},setFunc:function(we){if(ye!==we){switch(we){case MM:i.depthFunc(i.NEVER);break;case TM:i.depthFunc(i.ALWAYS);break;case BM:i.depthFunc(i.LESS);break;case ou:i.depthFunc(i.LEQUAL);break;case RM:i.depthFunc(i.EQUAL);break;case bM:i.depthFunc(i.GEQUAL);break;case LM:i.depthFunc(i.GREATER);break;case DM:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ye=we}},setLocked:function(we){ee=we},setClear:function(we){he!==we&&(i.clearDepth(we),he=we)},reset:function(){ee=!1,Te=null,ye=null,he=null}}}function l(){let ee=!1,Te=null,ye=null,he=null,we=null,qe=null,At=null,Wt=null,Dn=null;return{setTest:function(Tt){ee||(Tt?Oe(i.STENCIL_TEST):It(i.STENCIL_TEST))},setMask:function(Tt){Te!==Tt&&!ee&&(i.stencilMask(Tt),Te=Tt)},setFunc:function(Tt,an,Pt){(ye!==Tt||he!==an||we!==Pt)&&(i.stencilFunc(Tt,an,Pt),ye=Tt,he=an,we=Pt)},setOp:function(Tt,an,Pt){(qe!==Tt||At!==an||Wt!==Pt)&&(i.stencilOp(Tt,an,Pt),qe=Tt,At=an,Wt=Pt)},setLocked:function(Tt){ee=Tt},setClear:function(Tt){Dn!==Tt&&(i.clearStencil(Tt),Dn=Tt)},reset:function(){ee=!1,Te=null,ye=null,he=null,we=null,qe=null,At=null,Wt=null,Dn=null}}}const c=new r,f=new o,u=new l,d=new WeakMap,p=new WeakMap;let A={},g={},E=new WeakMap,C=[],_=null,v=!1,S=null,y=null,x=null,w=null,b=null,B=null,L=null,R=new tt(0,0,0),T=0,N=!1,k=null,O=null,F=null,V=null,X=null;const te=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Y=!1,$=0;const U=i.getParameter(i.VERSION);U.indexOf("WebGL")!==-1?($=parseFloat(/^WebGL (\d)/.exec(U)[1]),Y=$>=1):U.indexOf("OpenGL ES")!==-1&&($=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),Y=$>=2);let D=null,G={};const K=i.getParameter(i.SCISSOR_BOX),J=i.getParameter(i.VIEWPORT),Ae=new Gt().fromArray(K),ge=new Gt().fromArray(J);function be(ee,Te,ye,he){const we=new Uint8Array(4),qe=i.createTexture();i.bindTexture(ee,qe),i.texParameteri(ee,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(ee,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let At=0;At<ye;At++)n&&(ee===i.TEXTURE_3D||ee===i.TEXTURE_2D_ARRAY)?i.texImage3D(Te,0,i.RGBA,1,1,he,0,i.RGBA,i.UNSIGNED_BYTE,we):i.texImage2D(Te+At,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,we);return qe}const de={};de[i.TEXTURE_2D]=be(i.TEXTURE_2D,i.TEXTURE_2D,1),de[i.TEXTURE_CUBE_MAP]=be(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(de[i.TEXTURE_2D_ARRAY]=be(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),de[i.TEXTURE_3D]=be(i.TEXTURE_3D,i.TEXTURE_3D,1,1)),c.setClear(0,0,0,1),f.setClear(1),u.setClear(0),Oe(i.DEPTH_TEST),f.setFunc(ou),Ue(!1),He(Wv),Oe(i.CULL_FACE),_e(Nr);function Oe(ee){A[ee]!==!0&&(i.enable(ee),A[ee]=!0)}function It(ee){A[ee]!==!1&&(i.disable(ee),A[ee]=!1)}function ot(ee,Te){return g[ee]!==Te?(i.bindFramebuffer(ee,Te),g[ee]=Te,n&&(ee===i.DRAW_FRAMEBUFFER&&(g[i.FRAMEBUFFER]=Te),ee===i.FRAMEBUFFER&&(g[i.DRAW_FRAMEBUFFER]=Te)),!0):!1}function oe(ee,Te){let ye=C,he=!1;if(ee)if(ye=E.get(Te),ye===void 0&&(ye=[],E.set(Te,ye)),ee.isWebGLMultipleRenderTargets){const we=ee.texture;if(ye.length!==we.length||ye[0]!==i.COLOR_ATTACHMENT0){for(let qe=0,At=we.length;qe<At;qe++)ye[qe]=i.COLOR_ATTACHMENT0+qe;ye.length=we.length,he=!0}}else ye[0]!==i.COLOR_ATTACHMENT0&&(ye[0]=i.COLOR_ATTACHMENT0,he=!0);else ye[0]!==i.BACK&&(ye[0]=i.BACK,he=!0);he&&(t.isWebGL2?i.drawBuffers(ye):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(ye))}function Mt(ee){return _!==ee?(i.useProgram(ee),_=ee,!0):!1}const Ne={[ro]:i.FUNC_ADD,[hM]:i.FUNC_SUBTRACT,[dM]:i.FUNC_REVERSE_SUBTRACT};if(n)Ne[Kv]=i.MIN,Ne[Jv]=i.MAX;else{const ee=e.get("EXT_blend_minmax");ee!==null&&(Ne[Kv]=ee.MIN_EXT,Ne[Jv]=ee.MAX_EXT)}const Ze={[AM]:i.ZERO,[pM]:i.ONE,[gM]:i.SRC_COLOR,[qd]:i.SRC_ALPHA,[CM]:i.SRC_ALPHA_SATURATE,[EM]:i.DST_COLOR,[vM]:i.DST_ALPHA,[mM]:i.ONE_MINUS_SRC_COLOR,[Xd]:i.ONE_MINUS_SRC_ALPHA,[yM]:i.ONE_MINUS_DST_COLOR,[_M]:i.ONE_MINUS_DST_ALPHA,[IM]:i.CONSTANT_COLOR,[xM]:i.ONE_MINUS_CONSTANT_COLOR,[SM]:i.CONSTANT_ALPHA,[wM]:i.ONE_MINUS_CONSTANT_ALPHA};function _e(ee,Te,ye,he,we,qe,At,Wt,Dn,Tt){if(ee===Nr){v===!0&&(It(i.BLEND),v=!1);return}if(v===!1&&(Oe(i.BLEND),v=!0),ee!==fM){if(ee!==S||Tt!==N){if((y!==ro||b!==ro)&&(i.blendEquation(i.FUNC_ADD),y=ro,b=ro),Tt)switch(ee){case Yo:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Yv:i.blendFunc(i.ONE,i.ONE);break;case qv:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case Xv:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",ee);break}else switch(ee){case Yo:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Yv:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case qv:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case Xv:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",ee);break}x=null,w=null,B=null,L=null,R.set(0,0,0),T=0,S=ee,N=Tt}return}we=we||Te,qe=qe||ye,At=At||he,(Te!==y||we!==b)&&(i.blendEquationSeparate(Ne[Te],Ne[we]),y=Te,b=we),(ye!==x||he!==w||qe!==B||At!==L)&&(i.blendFuncSeparate(Ze[ye],Ze[he],Ze[qe],Ze[At]),x=ye,w=he,B=qe,L=At),(Wt.equals(R)===!1||Dn!==T)&&(i.blendColor(Wt.r,Wt.g,Wt.b,Dn),R.copy(Wt),T=Dn),S=ee,N=!1}function it(ee,Te){ee.side===Yi?It(i.CULL_FACE):Oe(i.CULL_FACE);let ye=ee.side===Bn;Te&&(ye=!ye),Ue(ye),ee.blending===Yo&&ee.transparent===!1?_e(Nr):_e(ee.blending,ee.blendEquation,ee.blendSrc,ee.blendDst,ee.blendEquationAlpha,ee.blendSrcAlpha,ee.blendDstAlpha,ee.blendColor,ee.blendAlpha,ee.premultipliedAlpha),f.setFunc(ee.depthFunc),f.setTest(ee.depthTest),f.setMask(ee.depthWrite),c.setMask(ee.colorWrite);const he=ee.stencilWrite;u.setTest(he),he&&(u.setMask(ee.stencilWriteMask),u.setFunc(ee.stencilFunc,ee.stencilRef,ee.stencilFuncMask),u.setOp(ee.stencilFail,ee.stencilZFail,ee.stencilZPass)),lt(ee.polygonOffset,ee.polygonOffsetFactor,ee.polygonOffsetUnits),ee.alphaToCoverage===!0?Oe(i.SAMPLE_ALPHA_TO_COVERAGE):It(i.SAMPLE_ALPHA_TO_COVERAGE)}function Ue(ee){k!==ee&&(ee?i.frontFace(i.CW):i.frontFace(i.CCW),k=ee)}function He(ee){ee!==lM?(Oe(i.CULL_FACE),ee!==O&&(ee===Wv?i.cullFace(i.BACK):ee===cM?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):It(i.CULL_FACE),O=ee}function $e(ee){ee!==F&&(Y&&i.lineWidth(ee),F=ee)}function lt(ee,Te,ye){ee?(Oe(i.POLYGON_OFFSET_FILL),(V!==Te||X!==ye)&&(i.polygonOffset(Te,ye),V=Te,X=ye)):It(i.POLYGON_OFFSET_FILL)}function mt(ee){ee?Oe(i.SCISSOR_TEST):It(i.SCISSOR_TEST)}function H(ee){ee===void 0&&(ee=i.TEXTURE0+te-1),D!==ee&&(i.activeTexture(ee),D=ee)}function Q(ee,Te,ye){ye===void 0&&(D===null?ye=i.TEXTURE0+te-1:ye=D);let he=G[ye];he===void 0&&(he={type:void 0,texture:void 0},G[ye]=he),(he.type!==ee||he.texture!==Te)&&(D!==ye&&(i.activeTexture(ye),D=ye),i.bindTexture(ee,Te||de[ee]),he.type=ee,he.texture=Te)}function se(){const ee=G[D];ee!==void 0&&ee.type!==void 0&&(i.bindTexture(ee.type,null),ee.type=void 0,ee.texture=void 0)}function Ce(){try{i.compressedTexImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function me(){try{i.compressedTexImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function xe(){try{i.texSubImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function We(){try{i.texSubImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Se(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Re(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function q(){try{i.texStorage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Me(){try{i.texStorage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function pe(){try{i.texImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function nt(){try{i.texImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function je(ee){Ae.equals(ee)===!1&&(i.scissor(ee.x,ee.y,ee.z,ee.w),Ae.copy(ee))}function Je(ee){ge.equals(ee)===!1&&(i.viewport(ee.x,ee.y,ee.z,ee.w),ge.copy(ee))}function Ge(ee,Te){let ye=p.get(Te);ye===void 0&&(ye=new WeakMap,p.set(Te,ye));let he=ye.get(ee);he===void 0&&(he=i.getUniformBlockIndex(Te,ee.name),ye.set(ee,he))}function Pe(ee,Te){const he=p.get(Te).get(ee);d.get(Te)!==he&&(i.uniformBlockBinding(Te,he,ee.__bindingPointIndex),d.set(Te,he))}function dt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),n===!0&&(i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),A={},D=null,G={},g={},E=new WeakMap,C=[],_=null,v=!1,S=null,y=null,x=null,w=null,b=null,B=null,L=null,R=new tt(0,0,0),T=0,N=!1,k=null,O=null,F=null,V=null,X=null,Ae.set(0,0,i.canvas.width,i.canvas.height),ge.set(0,0,i.canvas.width,i.canvas.height),c.reset(),f.reset(),u.reset()}return{buffers:{color:c,depth:f,stencil:u},enable:Oe,disable:It,bindFramebuffer:ot,drawBuffers:oe,useProgram:Mt,setBlending:_e,setMaterial:it,setFlipSided:Ue,setCullFace:He,setLineWidth:$e,setPolygonOffset:lt,setScissorTest:mt,activeTexture:H,bindTexture:Q,unbindTexture:se,compressedTexImage2D:Ce,compressedTexImage3D:me,texImage2D:pe,texImage3D:nt,updateUBOMapping:Ge,uniformBlockBinding:Pe,texStorage2D:q,texStorage3D:Me,texSubImage2D:xe,texSubImage3D:We,compressedTexSubImage2D:Se,compressedTexSubImage3D:Re,scissor:je,viewport:Je,reset:dt}}function BR(i,e,t,n,r,o,l){const c=r.isWebGL2,f=r.maxTextures,u=r.maxCubemapSize,d=r.maxTextureSize,p=r.maxSamples,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,g=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),E=new WeakMap;let C;const _=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(H,Q){return v?new OffscreenCanvas(H,Q):Ql("canvas")}function y(H,Q,se,Ce){let me=1;if((H.width>Ce||H.height>Ce)&&(me=Ce/Math.max(H.width,H.height)),me<1||Q===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const xe=Q?yu:Math.floor,We=xe(me*H.width),Se=xe(me*H.height);C===void 0&&(C=S(We,Se));const Re=se?S(We,Se):C;return Re.width=We,Re.height=Se,Re.getContext("2d").drawImage(H,0,0,We,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+We+"x"+Se+")."),Re}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function x(H){return dA(H.width)&&dA(H.height)}function w(H){return c?!1:H.wrapS!==Fn||H.wrapT!==Fn||H.minFilter!==qt&&H.minFilter!==un}function b(H,Q){return H.generateMipmaps&&Q&&H.minFilter!==qt&&H.minFilter!==un}function B(H){i.generateMipmap(H)}function L(H,Q,se,Ce,me=!1){if(c===!1)return Q;if(H!==null){if(i[H]!==void 0)return i[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let xe=Q;if(Q===i.RED&&(se===i.FLOAT&&(xe=i.R32F),se===i.HALF_FLOAT&&(xe=i.R16F),se===i.UNSIGNED_BYTE&&(xe=i.R8)),Q===i.RED_INTEGER&&(se===i.UNSIGNED_BYTE&&(xe=i.R8UI),se===i.UNSIGNED_SHORT&&(xe=i.R16UI),se===i.UNSIGNED_INT&&(xe=i.R32UI),se===i.BYTE&&(xe=i.R8I),se===i.SHORT&&(xe=i.R16I),se===i.INT&&(xe=i.R32I)),Q===i.RG&&(se===i.FLOAT&&(xe=i.RG32F),se===i.HALF_FLOAT&&(xe=i.RG16F),se===i.UNSIGNED_BYTE&&(xe=i.RG8)),Q===i.RGBA){const We=me?mu:Nt.getTransfer(Ce);se===i.FLOAT&&(xe=i.RGBA32F),se===i.HALF_FLOAT&&(xe=i.RGBA16F),se===i.UNSIGNED_BYTE&&(xe=We===Vt?i.SRGB8_ALPHA8:i.RGBA8),se===i.UNSIGNED_SHORT_4_4_4_4&&(xe=i.RGBA4),se===i.UNSIGNED_SHORT_5_5_5_1&&(xe=i.RGB5_A1)}return(xe===i.R16F||xe===i.R32F||xe===i.RG16F||xe===i.RG32F||xe===i.RGBA16F||xe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),xe}function R(H,Q,se){return b(H,se)===!0||H.isFramebufferTexture&&H.minFilter!==qt&&H.minFilter!==un?Math.log2(Math.max(Q.width,Q.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?Q.mipmaps.length:1}function T(H){return H===qt||H===Zd||H===cu?i.NEAREST:i.LINEAR}function N(H){const Q=H.target;Q.removeEventListener("dispose",N),O(Q),Q.isVideoTexture&&E.delete(Q)}function k(H){const Q=H.target;Q.removeEventListener("dispose",k),V(Q)}function O(H){const Q=n.get(H);if(Q.__webglInit===void 0)return;const se=H.source,Ce=_.get(se);if(Ce){const me=Ce[Q.__cacheKey];me.usedTimes--,me.usedTimes===0&&F(H),Object.keys(Ce).length===0&&_.delete(se)}n.remove(H)}function F(H){const Q=n.get(H);i.deleteTexture(Q.__webglTexture);const se=H.source,Ce=_.get(se);delete Ce[Q.__cacheKey],l.memory.textures--}function V(H){const Q=H.texture,se=n.get(H),Ce=n.get(Q);if(Ce.__webglTexture!==void 0&&(i.deleteTexture(Ce.__webglTexture),l.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(se.__webglFramebuffer[me]))for(let xe=0;xe<se.__webglFramebuffer[me].length;xe++)i.deleteFramebuffer(se.__webglFramebuffer[me][xe]);else i.deleteFramebuffer(se.__webglFramebuffer[me]);se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer[me])}else{if(Array.isArray(se.__webglFramebuffer))for(let me=0;me<se.__webglFramebuffer.length;me++)i.deleteFramebuffer(se.__webglFramebuffer[me]);else i.deleteFramebuffer(se.__webglFramebuffer);if(se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer),se.__webglMultisampledFramebuffer&&i.deleteFramebuffer(se.__webglMultisampledFramebuffer),se.__webglColorRenderbuffer)for(let me=0;me<se.__webglColorRenderbuffer.length;me++)se.__webglColorRenderbuffer[me]&&i.deleteRenderbuffer(se.__webglColorRenderbuffer[me]);se.__webglDepthRenderbuffer&&i.deleteRenderbuffer(se.__webglDepthRenderbuffer)}if(H.isWebGLMultipleRenderTargets)for(let me=0,xe=Q.length;me<xe;me++){const We=n.get(Q[me]);We.__webglTexture&&(i.deleteTexture(We.__webglTexture),l.memory.textures--),n.remove(Q[me])}n.remove(Q),n.remove(H)}let X=0;function te(){X=0}function Y(){const H=X;return H>=f&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+f),X+=1,H}function $(H){const Q=[];return Q.push(H.wrapS),Q.push(H.wrapT),Q.push(H.wrapR||0),Q.push(H.magFilter),Q.push(H.minFilter),Q.push(H.anisotropy),Q.push(H.internalFormat),Q.push(H.format),Q.push(H.type),Q.push(H.generateMipmaps),Q.push(H.premultiplyAlpha),Q.push(H.flipY),Q.push(H.unpackAlignment),Q.push(H.colorSpace),Q.join()}function U(H,Q){const se=n.get(H);if(H.isVideoTexture&&lt(H),H.isRenderTargetTexture===!1&&H.version>0&&se.__version!==H.version){const Ce=H.image;if(Ce===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ce.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Oe(se,H,Q);return}}t.bindTexture(i.TEXTURE_2D,se.__webglTexture,i.TEXTURE0+Q)}function D(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){Oe(se,H,Q);return}t.bindTexture(i.TEXTURE_2D_ARRAY,se.__webglTexture,i.TEXTURE0+Q)}function G(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){Oe(se,H,Q);return}t.bindTexture(i.TEXTURE_3D,se.__webglTexture,i.TEXTURE0+Q)}function K(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){It(se,H,Q);return}t.bindTexture(i.TEXTURE_CUBE_MAP,se.__webglTexture,i.TEXTURE0+Q)}const J={[Xo]:i.REPEAT,[Fn]:i.CLAMP_TO_EDGE,[lu]:i.MIRRORED_REPEAT},Ae={[qt]:i.NEAREST,[Zd]:i.NEAREST_MIPMAP_NEAREST,[cu]:i.NEAREST_MIPMAP_LINEAR,[un]:i.LINEAR,[r1]:i.LINEAR_MIPMAP_NEAREST,[Pr]:i.LINEAR_MIPMAP_LINEAR},ge={[YM]:i.NEVER,[e3]:i.ALWAYS,[qM]:i.LESS,[KM]:i.LEQUAL,[XM]:i.EQUAL,[$M]:i.GEQUAL,[JM]:i.GREATER,[ZM]:i.NOTEQUAL};function be(H,Q,se){if(se?(i.texParameteri(H,i.TEXTURE_WRAP_S,J[Q.wrapS]),i.texParameteri(H,i.TEXTURE_WRAP_T,J[Q.wrapT]),(H===i.TEXTURE_3D||H===i.TEXTURE_2D_ARRAY)&&i.texParameteri(H,i.TEXTURE_WRAP_R,J[Q.wrapR]),i.texParameteri(H,i.TEXTURE_MAG_FILTER,Ae[Q.magFilter]),i.texParameteri(H,i.TEXTURE_MIN_FILTER,Ae[Q.minFilter])):(i.texParameteri(H,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(H,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(H===i.TEXTURE_3D||H===i.TEXTURE_2D_ARRAY)&&i.texParameteri(H,i.TEXTURE_WRAP_R,i.CLAMP_TO_EDGE),(Q.wrapS!==Fn||Q.wrapT!==Fn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(H,i.TEXTURE_MAG_FILTER,T(Q.magFilter)),i.texParameteri(H,i.TEXTURE_MIN_FILTER,T(Q.minFilter)),Q.minFilter!==qt&&Q.minFilter!==un&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),Q.compareFunction&&(i.texParameteri(H,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(H,i.TEXTURE_COMPARE_FUNC,ge[Q.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Ce=e.get("EXT_texture_filter_anisotropic");if(Q.magFilter===qt||Q.minFilter!==cu&&Q.minFilter!==Pr||Q.type===hn&&e.has("OES_texture_float_linear")===!1||c===!1&&Q.type===Jn&&e.has("OES_texture_half_float_linear")===!1)return;(Q.anisotropy>1||n.get(Q).__currentAnisotropy)&&(i.texParameterf(H,Ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(Q.anisotropy,r.getMaxAnisotropy())),n.get(Q).__currentAnisotropy=Q.anisotropy)}}function de(H,Q){let se=!1;H.__webglInit===void 0&&(H.__webglInit=!0,Q.addEventListener("dispose",N));const Ce=Q.source;let me=_.get(Ce);me===void 0&&(me={},_.set(Ce,me));const xe=$(Q);if(xe!==H.__cacheKey){me[xe]===void 0&&(me[xe]={texture:i.createTexture(),usedTimes:0},l.memory.textures++,se=!0),me[xe].usedTimes++;const We=me[H.__cacheKey];We!==void 0&&(me[H.__cacheKey].usedTimes--,We.usedTimes===0&&F(Q)),H.__cacheKey=xe,H.__webglTexture=me[xe].texture}return se}function Oe(H,Q,se){let Ce=i.TEXTURE_2D;(Q.isDataArrayTexture||Q.isCompressedArrayTexture)&&(Ce=i.TEXTURE_2D_ARRAY),Q.isData3DTexture&&(Ce=i.TEXTURE_3D);const me=de(H,Q),xe=Q.source;t.bindTexture(Ce,H.__webglTexture,i.TEXTURE0+se);const We=n.get(xe);if(xe.version!==We.__version||me===!0){t.activeTexture(i.TEXTURE0+se);const Se=Nt.getPrimaries(Nt.workingColorSpace),Re=Q.colorSpace===ci?null:Nt.getPrimaries(Q.colorSpace),q=Q.colorSpace===ci||Se===Re?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,Q.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,Q.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,q);const Me=w(Q)&&x(Q.image)===!1;let pe=y(Q.image,Me,!1,d);pe=mt(Q,pe);const nt=x(pe)||c,je=o.convert(Q.format,Q.colorSpace);let Je=o.convert(Q.type),Ge=L(Q.internalFormat,je,Je,Q.colorSpace,Q.isVideoTexture);be(Ce,Q,nt);let Pe;const dt=Q.mipmaps,ee=c&&Q.isVideoTexture!==!0,Te=We.__version===void 0||me===!0,ye=R(Q,pe,nt);if(Q.isDepthTexture)Ge=i.DEPTH_COMPONENT,c?Q.type===hn?Ge=i.DEPTH_COMPONENT32F:Q.type===yi?Ge=i.DEPTH_COMPONENT24:Q.type===oo?Ge=i.DEPTH24_STENCIL8:Ge=i.DEPTH_COMPONENT16:Q.type===hn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),Q.format===ao&&Ge===i.DEPTH_COMPONENT&&Q.type!==uu&&Q.type!==yi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),Q.type=yi,Je=o.convert(Q.type)),Q.format===Ko&&Ge===i.DEPTH_COMPONENT&&(Ge=i.DEPTH_STENCIL,Q.type!==oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),Q.type=oo,Je=o.convert(Q.type))),Te&&(ee?t.texStorage2D(i.TEXTURE_2D,1,Ge,pe.width,pe.height):t.texImage2D(i.TEXTURE_2D,0,Ge,pe.width,pe.height,0,je,Je,null));else if(Q.isDataTexture)if(dt.length>0&&nt){ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Je,Pe.data):t.texImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,je,Je,Pe.data);Q.generateMipmaps=!1}else ee?(Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height),t.texSubImage2D(i.TEXTURE_2D,0,0,0,pe.width,pe.height,je,Je,pe.data)):t.texImage2D(i.TEXTURE_2D,0,Ge,pe.width,pe.height,0,je,Je,pe.data);else if(Q.isCompressedTexture)if(Q.isCompressedArrayTexture){ee&&Te&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ye,Ge,dt[0].width,dt[0].height,pe.depth);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],Q.format!==on?je!==null?ee?t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,he,0,0,0,Pe.width,Pe.height,pe.depth,je,Pe.data,0,0):t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,he,Ge,Pe.width,Pe.height,pe.depth,0,Pe.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ee?t.texSubImage3D(i.TEXTURE_2D_ARRAY,he,0,0,0,Pe.width,Pe.height,pe.depth,je,Je,Pe.data):t.texImage3D(i.TEXTURE_2D_ARRAY,he,Ge,Pe.width,Pe.height,pe.depth,0,je,Je,Pe.data)}else{ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],Q.format!==on?je!==null?ee?t.compressedTexSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Pe.data):t.compressedTexImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,Pe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Je,Pe.data):t.texImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,je,Je,Pe.data)}else if(Q.isDataArrayTexture)ee?(Te&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ye,Ge,pe.width,pe.height,pe.depth),t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,pe.width,pe.height,pe.depth,je,Je,pe.data)):t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ge,pe.width,pe.height,pe.depth,0,je,Je,pe.data);else if(Q.isData3DTexture)ee?(Te&&t.texStorage3D(i.TEXTURE_3D,ye,Ge,pe.width,pe.height,pe.depth),t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,pe.width,pe.height,pe.depth,je,Je,pe.data)):t.texImage3D(i.TEXTURE_3D,0,Ge,pe.width,pe.height,pe.depth,0,je,Je,pe.data);else if(Q.isFramebufferTexture){if(Te)if(ee)t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height);else{let he=pe.width,we=pe.height;for(let qe=0;qe<ye;qe++)t.texImage2D(i.TEXTURE_2D,qe,Ge,he,we,0,je,Je,null),he>>=1,we>>=1}}else if(dt.length>0&&nt){ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,je,Je,Pe):t.texImage2D(i.TEXTURE_2D,he,Ge,je,Je,Pe);Q.generateMipmaps=!1}else ee?(Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height),t.texSubImage2D(i.TEXTURE_2D,0,0,0,je,Je,pe)):t.texImage2D(i.TEXTURE_2D,0,Ge,je,Je,pe);b(Q,nt)&&B(Ce),We.__version=xe.version,Q.onUpdate&&Q.onUpdate(Q)}H.__version=Q.version}function It(H,Q,se){if(Q.image.length!==6)return;const Ce=de(H,Q),me=Q.source;t.bindTexture(i.TEXTURE_CUBE_MAP,H.__webglTexture,i.TEXTURE0+se);const xe=n.get(me);if(me.version!==xe.__version||Ce===!0){t.activeTexture(i.TEXTURE0+se);const We=Nt.getPrimaries(Nt.workingColorSpace),Se=Q.colorSpace===ci?null:Nt.getPrimaries(Q.colorSpace),Re=Q.colorSpace===ci||We===Se?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,Q.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,Q.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);const q=Q.isCompressedTexture||Q.image[0].isCompressedTexture,Me=Q.image[0]&&Q.image[0].isDataTexture,pe=[];for(let he=0;he<6;he++)!q&&!Me?pe[he]=y(Q.image[he],!1,!0,u):pe[he]=Me?Q.image[he].image:Q.image[he],pe[he]=mt(Q,pe[he]);const nt=pe[0],je=x(nt)||c,Je=o.convert(Q.format,Q.colorSpace),Ge=o.convert(Q.type),Pe=L(Q.internalFormat,Je,Ge,Q.colorSpace),dt=c&&Q.isVideoTexture!==!0,ee=xe.__version===void 0||Ce===!0;let Te=R(Q,nt,je);be(i.TEXTURE_CUBE_MAP,Q,je);let ye;if(q){dt&&ee&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Te,Pe,nt.width,nt.height);for(let he=0;he<6;he++){ye=pe[he].mipmaps;for(let we=0;we<ye.length;we++){const qe=ye[we];Q.format!==on?Je!==null?dt?t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,0,0,qe.width,qe.height,Je,qe.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,Pe,qe.width,qe.height,0,qe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,0,0,qe.width,qe.height,Je,Ge,qe.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,Pe,qe.width,qe.height,0,Je,Ge,qe.data)}}}else{ye=Q.mipmaps,dt&&ee&&(ye.length>0&&Te++,t.texStorage2D(i.TEXTURE_CUBE_MAP,Te,Pe,pe[0].width,pe[0].height));for(let he=0;he<6;he++)if(Me){dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,pe[he].width,pe[he].height,Je,Ge,pe[he].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,Pe,pe[he].width,pe[he].height,0,Je,Ge,pe[he].data);for(let we=0;we<ye.length;we++){const At=ye[we].image[he].image;dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,0,0,At.width,At.height,Je,Ge,At.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,Pe,At.width,At.height,0,Je,Ge,At.data)}}else{dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Je,Ge,pe[he]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,Pe,Je,Ge,pe[he]);for(let we=0;we<ye.length;we++){const qe=ye[we];dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,0,0,Je,Ge,qe.image[he]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,Pe,Je,Ge,qe.image[he])}}}b(Q,je)&&B(i.TEXTURE_CUBE_MAP),xe.__version=me.version,Q.onUpdate&&Q.onUpdate(Q)}H.__version=Q.version}function ot(H,Q,se,Ce,me,xe){const We=o.convert(se.format,se.colorSpace),Se=o.convert(se.type),Re=L(se.internalFormat,We,Se,se.colorSpace);if(!n.get(Q).__hasExternalTextures){const Me=Math.max(1,Q.width>>xe),pe=Math.max(1,Q.height>>xe);me===i.TEXTURE_3D||me===i.TEXTURE_2D_ARRAY?t.texImage3D(me,xe,Re,Me,pe,Q.depth,0,We,Se,null):t.texImage2D(me,xe,Re,Me,pe,0,We,Se,null)}t.bindFramebuffer(i.FRAMEBUFFER,H),$e(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Ce,me,n.get(se).__webglTexture,0,He(Q)):(me===i.TEXTURE_2D||me>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Ce,me,n.get(se).__webglTexture,xe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function oe(H,Q,se){if(i.bindRenderbuffer(i.RENDERBUFFER,H),Q.depthBuffer&&!Q.stencilBuffer){let Ce=c===!0?i.DEPTH_COMPONENT24:i.DEPTH_COMPONENT16;if(se||$e(Q)){const me=Q.depthTexture;me&&me.isDepthTexture&&(me.type===hn?Ce=i.DEPTH_COMPONENT32F:me.type===yi&&(Ce=i.DEPTH_COMPONENT24));const xe=He(Q);$e(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,xe,Ce,Q.width,Q.height):i.renderbufferStorageMultisample(i.RENDERBUFFER,xe,Ce,Q.width,Q.height)}else i.renderbufferStorage(i.RENDERBUFFER,Ce,Q.width,Q.height);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,H)}else if(Q.depthBuffer&&Q.stencilBuffer){const Ce=He(Q);se&&$e(Q)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,i.DEPTH24_STENCIL8,Q.width,Q.height):$e(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ce,i.DEPTH24_STENCIL8,Q.width,Q.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,Q.width,Q.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,H)}else{const Ce=Q.isWebGLMultipleRenderTargets===!0?Q.texture:[Q.texture];for(let me=0;me<Ce.length;me++){const xe=Ce[me],We=o.convert(xe.format,xe.colorSpace),Se=o.convert(xe.type),Re=L(xe.internalFormat,We,Se,xe.colorSpace),q=He(Q);se&&$e(Q)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,q,Re,Q.width,Q.height):$e(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,q,Re,Q.width,Q.height):i.renderbufferStorage(i.RENDERBUFFER,Re,Q.width,Q.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Mt(H,Q){if(Q&&Q.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,H),!(Q.depthTexture&&Q.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(Q.depthTexture).__webglTexture||Q.depthTexture.image.width!==Q.width||Q.depthTexture.image.height!==Q.height)&&(Q.depthTexture.image.width=Q.width,Q.depthTexture.image.height=Q.height,Q.depthTexture.needsUpdate=!0),U(Q.depthTexture,0);const Ce=n.get(Q.depthTexture).__webglTexture,me=He(Q);if(Q.depthTexture.format===ao)$e(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ce,0,me):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ce,0);else if(Q.depthTexture.format===Ko)$e(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ce,0,me):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ce,0);else throw new Error("Unknown depthTexture format")}function Ne(H){const Q=n.get(H),se=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture&&!Q.__autoAllocateDepthBuffer){if(se)throw new Error("target.depthTexture not supported in Cube render targets");Mt(Q.__webglFramebuffer,H)}else if(se){Q.__webglDepthbuffer=[];for(let Ce=0;Ce<6;Ce++)t.bindFramebuffer(i.FRAMEBUFFER,Q.__webglFramebuffer[Ce]),Q.__webglDepthbuffer[Ce]=i.createRenderbuffer(),oe(Q.__webglDepthbuffer[Ce],H,!1)}else t.bindFramebuffer(i.FRAMEBUFFER,Q.__webglFramebuffer),Q.__webglDepthbuffer=i.createRenderbuffer(),oe(Q.__webglDepthbuffer,H,!1);t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ze(H,Q,se){const Ce=n.get(H);Q!==void 0&&ot(Ce.__webglFramebuffer,H,H.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),se!==void 0&&Ne(H)}function _e(H){const Q=H.texture,se=n.get(H),Ce=n.get(Q);H.addEventListener("dispose",k),H.isWebGLMultipleRenderTargets!==!0&&(Ce.__webglTexture===void 0&&(Ce.__webglTexture=i.createTexture()),Ce.__version=Q.version,l.memory.textures++);const me=H.isWebGLCubeRenderTarget===!0,xe=H.isWebGLMultipleRenderTargets===!0,We=x(H)||c;if(me){se.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(c&&Q.mipmaps&&Q.mipmaps.length>0){se.__webglFramebuffer[Se]=[];for(let Re=0;Re<Q.mipmaps.length;Re++)se.__webglFramebuffer[Se][Re]=i.createFramebuffer()}else se.__webglFramebuffer[Se]=i.createFramebuffer()}else{if(c&&Q.mipmaps&&Q.mipmaps.length>0){se.__webglFramebuffer=[];for(let Se=0;Se<Q.mipmaps.length;Se++)se.__webglFramebuffer[Se]=i.createFramebuffer()}else se.__webglFramebuffer=i.createFramebuffer();if(xe)if(r.drawBuffers){const Se=H.texture;for(let Re=0,q=Se.length;Re<q;Re++){const Me=n.get(Se[Re]);Me.__webglTexture===void 0&&(Me.__webglTexture=i.createTexture(),l.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(c&&H.samples>0&&$e(H)===!1){const Se=xe?Q:[Q];se.__webglMultisampledFramebuffer=i.createFramebuffer(),se.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,se.__webglMultisampledFramebuffer);for(let Re=0;Re<Se.length;Re++){const q=Se[Re];se.__webglColorRenderbuffer[Re]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,se.__webglColorRenderbuffer[Re]);const Me=o.convert(q.format,q.colorSpace),pe=o.convert(q.type),nt=L(q.internalFormat,Me,pe,q.colorSpace,H.isXRRenderTarget===!0),je=He(H);i.renderbufferStorageMultisample(i.RENDERBUFFER,je,nt,H.width,H.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Re,i.RENDERBUFFER,se.__webglColorRenderbuffer[Re])}i.bindRenderbuffer(i.RENDERBUFFER,null),H.depthBuffer&&(se.__webglDepthRenderbuffer=i.createRenderbuffer(),oe(se.__webglDepthRenderbuffer,H,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(me){t.bindTexture(i.TEXTURE_CUBE_MAP,Ce.__webglTexture),be(i.TEXTURE_CUBE_MAP,Q,We);for(let Se=0;Se<6;Se++)if(c&&Q.mipmaps&&Q.mipmaps.length>0)for(let Re=0;Re<Q.mipmaps.length;Re++)ot(se.__webglFramebuffer[Se][Re],H,Q,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Re);else ot(se.__webglFramebuffer[Se],H,Q,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0);b(Q,We)&&B(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(xe){const Se=H.texture;for(let Re=0,q=Se.length;Re<q;Re++){const Me=Se[Re],pe=n.get(Me);t.bindTexture(i.TEXTURE_2D,pe.__webglTexture),be(i.TEXTURE_2D,Me,We),ot(se.__webglFramebuffer,H,Me,i.COLOR_ATTACHMENT0+Re,i.TEXTURE_2D,0),b(Me,We)&&B(i.TEXTURE_2D)}t.unbindTexture()}else{let Se=i.TEXTURE_2D;if((H.isWebGL3DRenderTarget||H.isWebGLArrayRenderTarget)&&(c?Se=H.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Se,Ce.__webglTexture),be(Se,Q,We),c&&Q.mipmaps&&Q.mipmaps.length>0)for(let Re=0;Re<Q.mipmaps.length;Re++)ot(se.__webglFramebuffer[Re],H,Q,i.COLOR_ATTACHMENT0,Se,Re);else ot(se.__webglFramebuffer,H,Q,i.COLOR_ATTACHMENT0,Se,0);b(Q,We)&&B(Se),t.unbindTexture()}H.depthBuffer&&Ne(H)}function it(H){const Q=x(H)||c,se=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Ce=0,me=se.length;Ce<me;Ce++){const xe=se[Ce];if(b(xe,Q)){const We=H.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D,Se=n.get(xe).__webglTexture;t.bindTexture(We,Se),B(We),t.unbindTexture()}}}function Ue(H){if(c&&H.samples>0&&$e(H)===!1){const Q=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],se=H.width,Ce=H.height;let me=i.COLOR_BUFFER_BIT;const xe=[],We=H.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Se=n.get(H),Re=H.isWebGLMultipleRenderTargets===!0;if(Re)for(let q=0;q<Q.length;q++)t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+q,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+q,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Se.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Se.__webglFramebuffer);for(let q=0;q<Q.length;q++){xe.push(i.COLOR_ATTACHMENT0+q),H.depthBuffer&&xe.push(We);const Me=Se.__ignoreDepthValues!==void 0?Se.__ignoreDepthValues:!1;if(Me===!1&&(H.depthBuffer&&(me|=i.DEPTH_BUFFER_BIT),H.stencilBuffer&&(me|=i.STENCIL_BUFFER_BIT)),Re&&i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Se.__webglColorRenderbuffer[q]),Me===!0&&(i.invalidateFramebuffer(i.READ_FRAMEBUFFER,[We]),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[We])),Re){const pe=n.get(Q[q]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,pe,0)}i.blitFramebuffer(0,0,se,Ce,0,0,se,Ce,me,i.NEAREST),g&&i.invalidateFramebuffer(i.READ_FRAMEBUFFER,xe)}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),Re)for(let q=0;q<Q.length;q++){t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+q,i.RENDERBUFFER,Se.__webglColorRenderbuffer[q]);const Me=n.get(Q[q]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+q,i.TEXTURE_2D,Me,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Se.__webglMultisampledFramebuffer)}}function He(H){return Math.min(p,H.samples)}function $e(H){const Q=n.get(H);return c&&H.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&Q.__useRenderToTexture!==!1}function lt(H){const Q=l.render.frame;E.get(H)!==Q&&(E.set(H,Q),H.update())}function mt(H,Q){const se=H.colorSpace,Ce=H.format,me=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===fA||se!==En&&se!==ci&&(Nt.getTransfer(se)===Vt?c===!1?e.has("EXT_sRGB")===!0&&Ce===on?(H.format=fA,H.minFilter=un,H.generateMipmaps=!1):Q=G1.sRGBToLinear(Q):(Ce!==on||me!==fn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",se)),Q}this.allocateTextureUnit=Y,this.resetTextureUnits=te,this.setTexture2D=U,this.setTexture2DArray=D,this.setTexture3D=G,this.setTextureCube=K,this.rebindTextures=Ze,this.setupRenderTarget=_e,this.updateRenderTargetMipmap=it,this.updateMultisampleRenderTarget=Ue,this.setupDepthRenderbuffer=Ne,this.setupFrameBufferTexture=ot,this.useMultisampledRTT=$e}function RR(i,e,t){const n=t.isWebGL2;function r(o,l=ci){let c;const f=Nt.getTransfer(l);if(o===fn)return i.UNSIGNED_BYTE;if(o===o1)return i.UNSIGNED_SHORT_4_4_4_4;if(o===a1)return i.UNSIGNED_SHORT_5_5_5_1;if(o===$d)return i.BYTE;if(o===s1)return i.SHORT;if(o===uu)return i.UNSIGNED_SHORT;if(o===Dl)return i.INT;if(o===yi)return i.UNSIGNED_INT;if(o===hn)return i.FLOAT;if(o===Jn)return n?i.HALF_FLOAT:(c=e.get("OES_texture_half_float"),c!==null?c.HALF_FLOAT_OES:null);if(o===FM)return i.ALPHA;if(o===on)return i.RGBA;if(o===QM)return i.LUMINANCE;if(o===OM)return i.LUMINANCE_ALPHA;if(o===ao)return i.DEPTH_COMPONENT;if(o===Ko)return i.DEPTH_STENCIL;if(o===fA)return c=e.get("EXT_sRGB"),c!==null?c.SRGB_ALPHA_EXT:null;if(o===lo)return i.RED;if(o===eA)return i.RED_INTEGER;if(o===co)return i.RG;if(o===fu)return i.RG_INTEGER;if(o===Nl)return i.RGBA_INTEGER;if(o===hu||o===tA||o===nA||o===du)if(f===Vt)if(c=e.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(o===hu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===tA)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===nA)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===du)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=e.get("WEBGL_compressed_texture_s3tc"),c!==null){if(o===hu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===tA)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===nA)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===du)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===iA||o===l1||o===rA||o===c1)if(c=e.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(o===iA)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===l1)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===rA)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===c1)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===u1)return c=e.get("WEBGL_compressed_texture_etc1"),c!==null?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===sA||o===oA)if(c=e.get("WEBGL_compressed_texture_etc"),c!==null){if(o===sA)return f===Vt?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(o===oA)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===aA||o===f1||o===h1||o===d1||o===Au||o===A1||o===p1||o===g1||o===m1||o===v1||o===_1||o===E1||o===y1||o===C1)if(c=e.get("WEBGL_compressed_texture_astc"),c!==null){if(o===aA)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===f1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===h1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===d1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===Au)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===A1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===p1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===g1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===m1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===v1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===_1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===E1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===y1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===C1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===pu||o===I1||o===x1)if(c=e.get("EXT_texture_compression_bptc"),c!==null){if(o===pu)return f===Vt?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===I1)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===x1)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===zM||o===S1||o===w1||o===M1)if(c=e.get("EXT_texture_compression_rgtc"),c!==null){if(o===pu)return c.COMPRESSED_RED_RGTC1_EXT;if(o===S1)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===w1)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===M1)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===oo?n?i.UNSIGNED_INT_24_8:(c=e.get("WEBGL_depth_texture"),c!==null?c.UNSIGNED_INT_24_8_WEBGL:null):i[o]!==void 0?i[o]:null}return{convert:r}}class bR extends $n{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class vs extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const LR={type:"move"};class zA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vs,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 vs,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 vs,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 r=null,o=null,l=null;const c=this._targetRay,f=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){l=!0;for(const C of e.hand.values()){const _=t.getJointPose(C,n),v=this._getHandJoint(u,C);_!==null&&(v.matrix.fromArray(_.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=_.radius),v.visible=_!==null}const d=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],A=d.position.distanceTo(p.position),g=.02,E=.005;u.inputState.pinching&&A>g+E?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&A<=g-E&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else f!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(f.matrix.fromArray(o.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,o.linearVelocity?(f.hasLinearVelocity=!0,f.linearVelocity.copy(o.linearVelocity)):f.hasLinearVelocity=!1,o.angularVelocity?(f.hasAngularVelocity=!0,f.angularVelocity.copy(o.angularVelocity)):f.hasAngularVelocity=!1));c!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&o!==null&&(r=o),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(LR)))}return c!==null&&(c.visible=r!==null),f!==null&&(f.visible=o!==null),u!==null&&(u.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new vs;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class DR extends Rn{constructor(e,t,n,r,o,l,c,f,u,d){if(d=d!==void 0?d:ao,d!==ao&&d!==Ko)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===ao&&(n=yi),n===void 0&&d===Ko&&(n=oo),super(null,r,o,l,c,f,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=c!==void 0?c:qt,this.minFilter=f!==void 0?f:qt,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}}class NR extends fo{constructor(e,t){super();const n=this;let r=null,o=1,l=null,c="local-floor",f=1,u=null,d=null,p=null,A=null,g=null,E=null;const C=t.getContextAttributes();let _=null,v=null;const S=[],y=[],x=new $n;x.layers.enable(1),x.viewport=new Gt;const w=new $n;w.layers.enable(2),w.viewport=new Gt;const b=[x,w],B=new bR;B.layers.enable(1),B.layers.enable(2);let L=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(D){let G=S[D];return G===void 0&&(G=new zA,S[D]=G),G.getTargetRaySpace()},this.getControllerGrip=function(D){let G=S[D];return G===void 0&&(G=new zA,S[D]=G),G.getGripSpace()},this.getHand=function(D){let G=S[D];return G===void 0&&(G=new zA,S[D]=G),G.getHandSpace()};function T(D){const G=y.indexOf(D.inputSource);if(G===-1)return;const K=S[G];K!==void 0&&(K.update(D.inputSource,D.frame,u||l),K.dispatchEvent({type:D.type,data:D.inputSource}))}function N(){r.removeEventListener("select",T),r.removeEventListener("selectstart",T),r.removeEventListener("selectend",T),r.removeEventListener("squeeze",T),r.removeEventListener("squeezestart",T),r.removeEventListener("squeezeend",T),r.removeEventListener("end",N),r.removeEventListener("inputsourceschange",k);for(let D=0;D<S.length;D++){const G=y[D];G!==null&&(y[D]=null,S[D].disconnect(G))}L=null,R=null,e.setRenderTarget(_),g=null,A=null,p=null,r=null,v=null,U.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(D){o=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(D){c=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||l},this.setReferenceSpace=function(D){u=D},this.getBaseLayer=function(){return A!==null?A:g},this.getBinding=function(){return p},this.getFrame=function(){return E},this.getSession=function(){return r},this.setSession=async function(D){if(r=D,r!==null){if(_=e.getRenderTarget(),r.addEventListener("select",T),r.addEventListener("selectstart",T),r.addEventListener("selectend",T),r.addEventListener("squeeze",T),r.addEventListener("squeezestart",T),r.addEventListener("squeezeend",T),r.addEventListener("end",N),r.addEventListener("inputsourceschange",k),C.xrCompatible!==!0&&await t.makeXRCompatible(),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const G={antialias:r.renderState.layers===void 0?C.antialias:!0,alpha:!0,depth:C.depth,stencil:C.stencil,framebufferScaleFactor:o};g=new XRWebGLLayer(r,t,G),r.updateRenderState({baseLayer:g}),v=new Xi(g.framebufferWidth,g.framebufferHeight,{format:on,type:fn,colorSpace:e.outputColorSpace,stencilBuffer:C.stencil})}else{let G=null,K=null,J=null;C.depth&&(J=C.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,G=C.stencil?Ko:ao,K=C.stencil?oo:yi);const Ae={colorFormat:t.RGBA8,depthFormat:J,scaleFactor:o};p=new XRWebGLBinding(r,t),A=p.createProjectionLayer(Ae),r.updateRenderState({layers:[A]}),v=new Xi(A.textureWidth,A.textureHeight,{format:on,type:fn,depthTexture:new DR(A.textureWidth,A.textureHeight,K,void 0,void 0,void 0,void 0,void 0,void 0,G),stencilBuffer:C.stencil,colorSpace:e.outputColorSpace,samples:C.antialias?4:0});const ge=e.properties.get(v);ge.__ignoreDepthValues=A.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(f),u=null,l=await r.requestReferenceSpace(c),U.setContext(r),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function k(D){for(let G=0;G<D.removed.length;G++){const K=D.removed[G],J=y.indexOf(K);J>=0&&(y[J]=null,S[J].disconnect(K))}for(let G=0;G<D.added.length;G++){const K=D.added[G];let J=y.indexOf(K);if(J===-1){for(let ge=0;ge<S.length;ge++)if(ge>=y.length){y.push(K),J=ge;break}else if(y[ge]===null){y[ge]=K,J=ge;break}if(J===-1)break}const Ae=S[J];Ae&&Ae.connect(K)}}const O=new j,F=new j;function V(D,G,K){O.setFromMatrixPosition(G.matrixWorld),F.setFromMatrixPosition(K.matrixWorld);const J=O.distanceTo(F),Ae=G.projectionMatrix.elements,ge=K.projectionMatrix.elements,be=Ae[14]/(Ae[10]-1),de=Ae[14]/(Ae[10]+1),Oe=(Ae[9]+1)/Ae[5],It=(Ae[9]-1)/Ae[5],ot=(Ae[8]-1)/Ae[0],oe=(ge[8]+1)/ge[0],Mt=be*ot,Ne=be*oe,Ze=J/(-ot+oe),_e=Ze*-ot;G.matrixWorld.decompose(D.position,D.quaternion,D.scale),D.translateX(_e),D.translateZ(Ze),D.matrixWorld.compose(D.position,D.quaternion,D.scale),D.matrixWorldInverse.copy(D.matrixWorld).invert();const it=be+Ze,Ue=de+Ze,He=Mt-_e,$e=Ne+(J-_e),lt=Oe*de/Ue*it,mt=It*de/Ue*it;D.projectionMatrix.makePerspective(He,$e,lt,mt,it,Ue),D.projectionMatrixInverse.copy(D.projectionMatrix).invert()}function X(D,G){G===null?D.matrixWorld.copy(D.matrix):D.matrixWorld.multiplyMatrices(G.matrixWorld,D.matrix),D.matrixWorldInverse.copy(D.matrixWorld).invert()}this.updateCamera=function(D){if(r===null)return;B.near=w.near=x.near=D.near,B.far=w.far=x.far=D.far,(L!==B.near||R!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),L=B.near,R=B.far);const G=D.parent,K=B.cameras;X(B,G);for(let J=0;J<K.length;J++)X(K[J],G);K.length===2?V(B,x,w):B.projectionMatrix.copy(x.projectionMatrix),te(D,B,G)};function te(D,G,K){K===null?D.matrix.copy(G.matrixWorld):(D.matrix.copy(K.matrixWorld),D.matrix.invert(),D.matrix.multiply(G.matrixWorld)),D.matrix.decompose(D.position,D.quaternion,D.scale),D.updateMatrixWorld(!0),D.projectionMatrix.copy(G.projectionMatrix),D.projectionMatrixInverse.copy(G.projectionMatrixInverse),D.isPerspectiveCamera&&(D.fov=$o*2*Math.atan(1/D.projectionMatrix.elements[5]),D.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(A===null&&g===null))return f},this.setFoveation=function(D){f=D,A!==null&&(A.fixedFoveation=D),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=D)};let Y=null;function $(D,G){if(d=G.getViewerPose(u||l),E=G,d!==null){const K=d.views;g!==null&&(e.setRenderTargetFramebuffer(v,g.framebuffer),e.setRenderTarget(v));let J=!1;K.length!==B.cameras.length&&(B.cameras.length=0,J=!0);for(let Ae=0;Ae<K.length;Ae++){const ge=K[Ae];let be=null;if(g!==null)be=g.getViewport(ge);else{const Oe=p.getViewSubImage(A,ge);be=Oe.viewport,Ae===0&&(e.setRenderTargetTextures(v,Oe.colorTexture,A.ignoreDepthValues?void 0:Oe.depthStencilTexture),e.setRenderTarget(v))}let de=b[Ae];de===void 0&&(de=new $n,de.layers.enable(Ae),de.viewport=new Gt,b[Ae]=de),de.matrix.fromArray(ge.transform.matrix),de.matrix.decompose(de.position,de.quaternion,de.scale),de.projectionMatrix.fromArray(ge.projectionMatrix),de.projectionMatrixInverse.copy(de.projectionMatrix).invert(),de.viewport.set(be.x,be.y,be.width,be.height),Ae===0&&(B.matrix.copy(de.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),J===!0&&B.cameras.push(de)}}for(let K=0;K<S.length;K++){const J=y[K],Ae=S[K];J!==null&&Ae!==void 0&&Ae.update(J,G,u||l)}Y&&Y(D,G),G.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:G}),E=null}const U=new f_;U.setAnimationLoop($),this.setAnimationLoop=function(D){Y=D},this.dispose=function(){}}}function PR(i,e){function t(_,v){_.matrixAutoUpdate===!0&&_.updateMatrix(),v.value.copy(_.matrix)}function n(_,v){v.color.getRGB(_.fogColor.value,l_(i)),v.isFog?(_.fogNear.value=v.near,_.fogFar.value=v.far):v.isFogExp2&&(_.fogDensity.value=v.density)}function r(_,v,S,y,x){v.isMeshBasicMaterial||v.isMeshLambertMaterial?o(_,v):v.isMeshToonMaterial?(o(_,v),p(_,v)):v.isMeshPhongMaterial?(o(_,v),d(_,v)):v.isMeshStandardMaterial?(o(_,v),A(_,v),v.isMeshPhysicalMaterial&&g(_,v,x)):v.isMeshMatcapMaterial?(o(_,v),E(_,v)):v.isMeshDepthMaterial?o(_,v):v.isMeshDistanceMaterial?(o(_,v),C(_,v)):v.isMeshNormalMaterial?o(_,v):v.isLineBasicMaterial?(l(_,v),v.isLineDashedMaterial&&c(_,v)):v.isPointsMaterial?f(_,v,S,y):v.isSpriteMaterial?u(_,v):v.isShadowMaterial?(_.color.value.copy(v.color),_.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function o(_,v){_.opacity.value=v.opacity,v.color&&_.diffuse.value.copy(v.color),v.emissive&&_.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.bumpMap&&(_.bumpMap.value=v.bumpMap,t(v.bumpMap,_.bumpMapTransform),_.bumpScale.value=v.bumpScale,v.side===Bn&&(_.bumpScale.value*=-1)),v.normalMap&&(_.normalMap.value=v.normalMap,t(v.normalMap,_.normalMapTransform),_.normalScale.value.copy(v.normalScale),v.side===Bn&&_.normalScale.value.negate()),v.displacementMap&&(_.displacementMap.value=v.displacementMap,t(v.displacementMap,_.displacementMapTransform),_.displacementScale.value=v.displacementScale,_.displacementBias.value=v.displacementBias),v.emissiveMap&&(_.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,_.emissiveMapTransform)),v.specularMap&&(_.specularMap.value=v.specularMap,t(v.specularMap,_.specularMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest);const S=e.get(v).envMap;if(S&&(_.envMap.value=S,_.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap){_.lightMap.value=v.lightMap;const y=i._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=v.lightMapIntensity*y,t(v.lightMap,_.lightMapTransform)}v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,_.aoMapTransform))}function l(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform))}function c(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function f(_,v,S,y){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*S,_.scale.value=y*.5,v.map&&(_.map.value=v.map,t(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function d(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function p(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function A(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,_.roughnessMapTransform)),e.get(v).envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function g(_,v,S){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Bn&&_.clearcoatNormalScale.value.negate())),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=S.texture,_.transmissionSamplerSize.value.set(S.width,S.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,_.specularIntensityMapTransform))}function E(_,v){v.matcap&&(_.matcap.value=v.matcap)}function C(_,v){const S=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(S.matrixWorld),_.nearDistance.value=S.shadow.camera.near,_.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function UR(i,e,t,n){let r={},o={},l=[];const c=t.isWebGL2?i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS):0;function f(S,y){const x=y.program;n.uniformBlockBinding(S,x)}function u(S,y){let x=r[S.id];x===void 0&&(E(S),x=d(S),r[S.id]=x,S.addEventListener("dispose",_));const w=y.program;n.updateUBOMapping(S,w);const b=e.render.frame;o[S.id]!==b&&(A(S),o[S.id]=b)}function d(S){const y=p();S.__bindingPointIndex=y;const x=i.createBuffer(),w=S.__size,b=S.usage;return i.bindBuffer(i.UNIFORM_BUFFER,x),i.bufferData(i.UNIFORM_BUFFER,w,b),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,y,x),x}function p(){for(let S=0;S<c;S++)if(l.indexOf(S)===-1)return l.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function A(S){const y=r[S.id],x=S.uniforms,w=S.__cache;i.bindBuffer(i.UNIFORM_BUFFER,y);for(let b=0,B=x.length;b<B;b++){const L=x[b];if(g(L,b,w)===!0){const R=L.__offset,T=Array.isArray(L.value)?L.value:[L.value];let N=0;for(let k=0;k<T.length;k++){const O=T[k],F=C(O);typeof O=="number"?(L.__data[0]=O,i.bufferSubData(i.UNIFORM_BUFFER,R+N,L.__data)):O.isMatrix3?(L.__data[0]=O.elements[0],L.__data[1]=O.elements[1],L.__data[2]=O.elements[2],L.__data[3]=O.elements[0],L.__data[4]=O.elements[3],L.__data[5]=O.elements[4],L.__data[6]=O.elements[5],L.__data[7]=O.elements[0],L.__data[8]=O.elements[6],L.__data[9]=O.elements[7],L.__data[10]=O.elements[8],L.__data[11]=O.elements[0]):(O.toArray(L.__data,N),N+=F.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,R,L.__data)}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function g(S,y,x){const w=S.value;if(x[y]===void 0){if(typeof w=="number")x[y]=w;else{const b=Array.isArray(w)?w:[w],B=[];for(let L=0;L<b.length;L++)B.push(b[L].clone());x[y]=B}return!0}else if(typeof w=="number"){if(x[y]!==w)return x[y]=w,!0}else{const b=Array.isArray(x[y])?x[y]:[x[y]],B=Array.isArray(w)?w:[w];for(let L=0;L<b.length;L++){const R=b[L];if(R.equals(B[L])===!1)return R.copy(B[L]),!0}}return!1}function E(S){const y=S.uniforms;let x=0;const w=16;let b=0;for(let B=0,L=y.length;B<L;B++){const R=y[B],T={boundary:0,storage:0},N=Array.isArray(R.value)?R.value:[R.value];for(let k=0,O=N.length;k<O;k++){const F=N[k],V=C(F);T.boundary+=V.boundary,T.storage+=V.storage}if(R.__data=new Float32Array(T.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=x,B>0){b=x%w;const k=w-b;b!==0&&k-T.boundary<0&&(x+=w-b,R.__offset=x)}x+=T.storage}return b=x%w,b>0&&(x+=w-b),S.__size=x,S.__cache={},this}function C(S){const y={boundary:0,storage:0};return typeof S=="number"?(y.boundary=4,y.storage=4):S.isVector2?(y.boundary=8,y.storage=8):S.isVector3||S.isColor?(y.boundary=16,y.storage=12):S.isVector4?(y.boundary=16,y.storage=16):S.isMatrix3?(y.boundary=48,y.storage=48):S.isMatrix4?(y.boundary=64,y.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),y}function _(S){const y=S.target;y.removeEventListener("dispose",_);const x=l.indexOf(y.__bindingPointIndex);l.splice(x,1),i.deleteBuffer(r[y.id]),delete r[y.id],delete o[y.id]}function v(){for(const S in r)i.deleteBuffer(r[S]);l=[],r={},o={}}return{bind:f,update:u,dispose:v}}class Q_{constructor(e={}){const{canvas:t=A3(),context:n=null,depth:r=!0,stencil:o=!0,alpha:l=!1,antialias:c=!1,premultipliedAlpha:f=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:p=!1}=e;this.isWebGLRenderer=!0;let A;n!==null?A=n.getContextAttributes().alpha:A=l;const g=new Uint32Array(4),E=new Int32Array(4);let C=null,_=null;const v=[],S=[];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=Xt,this._useLegacyLights=!1,this.toneMapping=hs,this.toneMappingExposure=1;const y=this;let x=!1,w=0,b=0,B=null,L=-1,R=null;const T=new Gt,N=new Gt;let k=null;const O=new tt(0);let F=0,V=t.width,X=t.height,te=1,Y=null,$=null;const U=new Gt(0,0,V,X),D=new Gt(0,0,V,X);let G=!1;const K=new DA;let J=!1,Ae=!1,ge=null;const be=new ct,de=new Ke,Oe=new j,It={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return B===null?te:1}let oe=n;function Mt(z,re){for(let ce=0;ce<z.length;ce++){const ue=z[ce],fe=t.getContext(ue,re);if(fe!==null)return fe}return null}try{const z={alpha:!0,depth:r,stencil:o,antialias:c,premultipliedAlpha:f,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${su}`),t.addEventListener("webglcontextlost",dt,!1),t.addEventListener("webglcontextrestored",ee,!1),t.addEventListener("webglcontextcreationerror",Te,!1),oe===null){const re=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&re.shift(),oe=Mt(re,z),oe===null)throw Mt(re)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&oe instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),oe.getShaderPrecisionFormat===void 0&&(oe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,Ze,_e,it,Ue,He,$e,lt,mt,H,Q,se,Ce,me,xe,We,Se,Re,q,Me,pe,nt,je,Je;function Ge(){Ne=new Y4(oe),Ze=new z4(oe,Ne,e),Ne.init(Ze),nt=new RR(oe,Ne,Ze),_e=new TR(oe,Ne,Ze),it=new K4(oe),Ue=new pR,He=new BR(oe,Ne,_e,Ue,Ze,nt,it),$e=new H4(y),lt=new j4(y),mt=new O3(oe,Ze),je=new Q4(oe,Ne,mt,Ze),H=new q4(oe,mt,it,je),Q=new eB(oe,H,mt,it),q=new $4(oe,Ze,He),We=new G4(Ue),se=new AR(y,$e,lt,Ne,Ze,je,We),Ce=new PR(y,Ue),me=new mR,xe=new IR(Ne,Ze),Re=new F4(y,$e,lt,_e,Q,A,f),Se=new MR(y,Q,Ze),Je=new UR(oe,it,Ze,_e),Me=new O4(oe,Ne,it,Ze),pe=new X4(oe,Ne,it,Ze),it.programs=se.programs,y.capabilities=Ze,y.extensions=Ne,y.properties=Ue,y.renderLists=me,y.shadowMap=Se,y.state=_e,y.info=it}Ge();const Pe=new NR(y,oe);this.xr=Pe,this.getContext=function(){return oe},this.getContextAttributes=function(){return oe.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(z){z!==void 0&&(te=z,this.setSize(V,X,!1))},this.getSize=function(z){return z.set(V,X)},this.setSize=function(z,re,ce=!0){if(Pe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}V=z,X=re,t.width=Math.floor(z*te),t.height=Math.floor(re*te),ce===!0&&(t.style.width=z+"px",t.style.height=re+"px"),this.setViewport(0,0,z,re)},this.getDrawingBufferSize=function(z){return z.set(V*te,X*te).floor()},this.setDrawingBufferSize=function(z,re,ce){V=z,X=re,te=ce,t.width=Math.floor(z*ce),t.height=Math.floor(re*ce),this.setViewport(0,0,z,re)},this.getCurrentViewport=function(z){return z.copy(T)},this.getViewport=function(z){return z.copy(U)},this.setViewport=function(z,re,ce,ue){z.isVector4?U.set(z.x,z.y,z.z,z.w):U.set(z,re,ce,ue),_e.viewport(T.copy(U).multiplyScalar(te).floor())},this.getScissor=function(z){return z.copy(D)},this.setScissor=function(z,re,ce,ue){z.isVector4?D.set(z.x,z.y,z.z,z.w):D.set(z,re,ce,ue),_e.scissor(N.copy(D).multiplyScalar(te).floor())},this.getScissorTest=function(){return G},this.setScissorTest=function(z){_e.setScissorTest(G=z)},this.setOpaqueSort=function(z){Y=z},this.setTransparentSort=function(z){$=z},this.getClearColor=function(z){return z.copy(Re.getClearColor())},this.setClearColor=function(){Re.setClearColor.apply(Re,arguments)},this.getClearAlpha=function(){return Re.getClearAlpha()},this.setClearAlpha=function(){Re.setClearAlpha.apply(Re,arguments)},this.clear=function(z=!0,re=!0,ce=!0){let ue=0;if(z){let fe=!1;if(B!==null){const ke=B.texture.format;fe=ke===Nl||ke===fu||ke===eA}if(fe){const ke=B.texture.type,et=ke===fn||ke===yi||ke===uu||ke===oo||ke===o1||ke===a1,at=Re.getClearColor(),Qe=Re.getClearAlpha(),pt=at.r,ft=at.g,ht=at.b;et?(g[0]=pt,g[1]=ft,g[2]=ht,g[3]=Qe,oe.clearBufferuiv(oe.COLOR,0,g)):(E[0]=pt,E[1]=ft,E[2]=ht,E[3]=Qe,oe.clearBufferiv(oe.COLOR,0,E))}else ue|=oe.COLOR_BUFFER_BIT}re&&(ue|=oe.DEPTH_BUFFER_BIT),ce&&(ue|=oe.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),oe.clear(ue)},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",dt,!1),t.removeEventListener("webglcontextrestored",ee,!1),t.removeEventListener("webglcontextcreationerror",Te,!1),me.dispose(),xe.dispose(),Ue.dispose(),$e.dispose(),lt.dispose(),Q.dispose(),je.dispose(),Je.dispose(),se.dispose(),Pe.dispose(),Pe.removeEventListener("sessionstart",Dn),Pe.removeEventListener("sessionend",Tt),ge&&(ge.dispose(),ge=null),an.stop()};function dt(z){z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function ee(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const z=it.autoReset,re=Se.enabled,ce=Se.autoUpdate,ue=Se.needsUpdate,fe=Se.type;Ge(),it.autoReset=z,Se.enabled=re,Se.autoUpdate=ce,Se.needsUpdate=ue,Se.type=fe}function Te(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function ye(z){const re=z.target;re.removeEventListener("dispose",ye),he(re)}function he(z){we(z),Ue.remove(z)}function we(z){const re=Ue.get(z).programs;re!==void 0&&(re.forEach(function(ce){se.releaseProgram(ce)}),z.isShaderMaterial&&se.releaseShaderCache(z))}this.renderBufferDirect=function(z,re,ce,ue,fe,ke){re===null&&(re=It);const et=fe.isMesh&&fe.matrixWorld.determinant()<0,at=Wp(z,re,ce,ue,fe);_e.setMaterial(ue,et);let Qe=ce.index,pt=1;if(ue.wireframe===!0){if(Qe=H.getWireframeAttribute(ce),Qe===void 0)return;pt=2}const ft=ce.drawRange,ht=ce.attributes.position;let jt=ft.start*pt,ii=(ft.start+ft.count)*pt;ke!==null&&(jt=Math.max(jt,ke.start*pt),ii=Math.min(ii,(ke.start+ke.count)*pt)),Qe!==null?(jt=Math.max(jt,0),ii=Math.min(ii,Qe.count)):ht!=null&&(jt=Math.max(jt,0),ii=Math.min(ii,ht.count));const dn=ii-jt;if(dn<0||dn===1/0)return;je.setup(fe,ue,at,ce,Qe);let di,Bt=Me;if(Qe!==null&&(di=mt.get(Qe),Bt=pe,Bt.setIndex(di)),fe.isMesh)ue.wireframe===!0?(_e.setLineWidth(ue.wireframeLinewidth*ot()),Bt.setMode(oe.LINES)):Bt.setMode(oe.TRIANGLES);else if(fe.isLine){let Et=ue.linewidth;Et===void 0&&(Et=1),_e.setLineWidth(Et*ot()),fe.isLineSegments?Bt.setMode(oe.LINES):fe.isLineLoop?Bt.setMode(oe.LINE_LOOP):Bt.setMode(oe.LINE_STRIP)}else fe.isPoints?Bt.setMode(oe.POINTS):fe.isSprite&&Bt.setMode(oe.TRIANGLES);if(fe.isInstancedMesh)Bt.renderInstances(jt,dn,fe.count);else if(ce.isInstancedBufferGeometry){const Et=ce._maxInstanceCount!==void 0?ce._maxInstanceCount:1/0,ri=Math.min(ce.instanceCount,Et);Bt.renderInstances(jt,dn,ri)}else Bt.render(jt,dn)};function qe(z,re,ce){z.transparent===!0&&z.side===Yi&&z.forceSinglePass===!1?(z.side=Bn,z.needsUpdate=!0,ws(z,re,ce),z.side=ji,z.needsUpdate=!0,ws(z,re,ce),z.side=Yi):ws(z,re,ce)}this.compile=function(z,re,ce=null){ce===null&&(ce=z),_=xe.get(ce),_.init(),S.push(_),ce.traverseVisible(function(fe){fe.isLight&&fe.layers.test(re.layers)&&(_.pushLight(fe),fe.castShadow&&_.pushShadow(fe))}),z!==ce&&z.traverseVisible(function(fe){fe.isLight&&fe.layers.test(re.layers)&&(_.pushLight(fe),fe.castShadow&&_.pushShadow(fe))}),_.setupLights(y._useLegacyLights);const ue=new Set;return z.traverse(function(fe){const ke=fe.material;if(ke)if(Array.isArray(ke))for(let et=0;et<ke.length;et++){const at=ke[et];qe(at,ce,fe),ue.add(at)}else qe(ke,ce,fe),ue.add(ke)}),S.pop(),_=null,ue},this.compileAsync=function(z,re,ce=null){const ue=this.compile(z,re,ce);return new Promise(fe=>{function ke(){if(ue.forEach(function(et){Ue.get(et).currentProgram.isReady()&&ue.delete(et)}),ue.size===0){fe(z);return}setTimeout(ke,10)}Ne.get("KHR_parallel_shader_compile")!==null?ke():setTimeout(ke,10)})};let At=null;function Wt(z){At&&At(z)}function Dn(){an.stop()}function Tt(){an.start()}const an=new f_;an.setAnimationLoop(Wt),typeof self<"u"&&an.setContext(self),this.setAnimationLoop=function(z){At=z,Pe.setAnimationLoop(z),z===null?an.stop():an.start()},Pe.addEventListener("sessionstart",Dn),Pe.addEventListener("sessionend",Tt),this.render=function(z,re){if(re!==void 0&&re.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),re.parent===null&&re.matrixWorldAutoUpdate===!0&&re.updateMatrixWorld(),Pe.enabled===!0&&Pe.isPresenting===!0&&(Pe.cameraAutoUpdate===!0&&Pe.updateCamera(re),re=Pe.getCamera()),z.isScene===!0&&z.onBeforeRender(y,z,re,B),_=xe.get(z,S.length),_.init(),S.push(_),be.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),K.setFromProjectionMatrix(be),Ae=this.localClippingEnabled,J=We.init(this.clippingPlanes,Ae),C=me.get(z,v.length),C.init(),v.push(C),Pt(z,re,0,y.sortObjects),C.finish(),y.sortObjects===!0&&C.sort(Y,$),this.info.render.frame++,J===!0&&We.beginShadows();const ce=_.state.shadowsArray;if(Se.render(ce,z,re),J===!0&&We.endShadows(),this.info.autoReset===!0&&this.info.reset(),Re.render(C,z),_.setupLights(y._useLegacyLights),re.isArrayCamera){const ue=re.cameras;for(let fe=0,ke=ue.length;fe<ke;fe++){const et=ue[fe];Ti(C,z,et,et.viewport)}}else Ti(C,z,re);B!==null&&(He.updateMultisampleRenderTarget(B),He.updateRenderTargetMipmap(B)),z.isScene===!0&&z.onAfterRender(y,z,re),je.resetDefaultState(),L=-1,R=null,S.pop(),S.length>0?_=S[S.length-1]:_=null,v.pop(),v.length>0?C=v[v.length-1]:C=null};function Pt(z,re,ce,ue){if(z.visible===!1)return;if(z.layers.test(re.layers)){if(z.isGroup)ce=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(re);else if(z.isLight)_.pushLight(z),z.castShadow&&_.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||K.intersectsSprite(z)){ue&&Oe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(be);const et=Q.update(z),at=z.material;at.visible&&C.push(z,et,at,ce,Oe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||K.intersectsObject(z))){const et=Q.update(z),at=z.material;if(ue&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),Oe.copy(z.boundingSphere.center)):(et.boundingSphere===null&&et.computeBoundingSphere(),Oe.copy(et.boundingSphere.center)),Oe.applyMatrix4(z.matrixWorld).applyMatrix4(be)),Array.isArray(at)){const Qe=et.groups;for(let pt=0,ft=Qe.length;pt<ft;pt++){const ht=Qe[pt],jt=at[ht.materialIndex];jt&&jt.visible&&C.push(z,et,jt,ce,Oe.z,ht)}}else at.visible&&C.push(z,et,at,ce,Oe.z,null)}}const ke=z.children;for(let et=0,at=ke.length;et<at;et++)Pt(ke[et],re,ce,ue)}function Ti(z,re,ce,ue){const fe=z.opaque,ke=z.transmissive,et=z.transparent;_.setupLightsView(ce),J===!0&&We.setGlobalState(y.clippingPlanes,ce),ke.length>0&&Cr(fe,ke,re,ce),ue&&_e.viewport(T.copy(ue)),fe.length>0&&ir(fe,re,ce),ke.length>0&&ir(ke,re,ce),et.length>0&&ir(et,re,ce),_e.buffers.depth.setTest(!0),_e.buffers.depth.setMask(!0),_e.buffers.color.setMask(!0),_e.setPolygonOffset(!1)}function Cr(z,re,ce,ue){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;const ke=Ze.isWebGL2;ge===null&&(ge=new Xi(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")?Jn:fn,minFilter:Pr,samples:ke?4:0})),y.getDrawingBufferSize(de),ke?ge.setSize(de.x,de.y):ge.setSize(yu(de.x),yu(de.y));const et=y.getRenderTarget();y.setRenderTarget(ge),y.getClearColor(O),F=y.getClearAlpha(),F<1&&y.setClearColor(16777215,.5),y.clear();const at=y.toneMapping;y.toneMapping=hs,ir(z,ce,ue),He.updateMultisampleRenderTarget(ge),He.updateRenderTargetMipmap(ge);let Qe=!1;for(let pt=0,ft=re.length;pt<ft;pt++){const ht=re[pt],jt=ht.object,ii=ht.geometry,dn=ht.material,di=ht.group;if(dn.side===Yi&&jt.layers.test(ue.layers)){const Bt=dn.side;dn.side=Bn,dn.needsUpdate=!0,Co(jt,ce,ue,ii,dn,di),dn.side=Bt,dn.needsUpdate=!0,Qe=!0}}Qe===!0&&(He.updateMultisampleRenderTarget(ge),He.updateRenderTargetMipmap(ge)),y.setRenderTarget(et),y.setClearColor(O,F),y.toneMapping=at}function ir(z,re,ce){const ue=re.isScene===!0?re.overrideMaterial:null;for(let fe=0,ke=z.length;fe<ke;fe++){const et=z[fe],at=et.object,Qe=et.geometry,pt=ue===null?et.material:ue,ft=et.group;at.layers.test(ce.layers)&&Co(at,re,ce,Qe,pt,ft)}}function Co(z,re,ce,ue,fe,ke){z.onBeforeRender(y,re,ce,ue,fe,ke),z.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,z.matrixWorld),z.normalMatrix.getNormalMatrix(z.modelViewMatrix),fe.onBeforeRender(y,re,ce,ue,z,ke),fe.transparent===!0&&fe.side===Yi&&fe.forceSinglePass===!1?(fe.side=Bn,fe.needsUpdate=!0,y.renderBufferDirect(ce,re,ue,fe,z,ke),fe.side=ji,fe.needsUpdate=!0,y.renderBufferDirect(ce,re,ue,fe,z,ke),fe.side=Yi):y.renderBufferDirect(ce,re,ue,fe,z,ke),z.onAfterRender(y,re,ce,ue,fe,ke)}function ws(z,re,ce){re.isScene!==!0&&(re=It);const ue=Ue.get(z),fe=_.state.lights,ke=_.state.shadowsArray,et=fe.state.version,at=se.getParameters(z,fe.state,ke,re,ce),Qe=se.getProgramCacheKey(at);let pt=ue.programs;ue.environment=z.isMeshStandardMaterial?re.environment:null,ue.fog=re.fog,ue.envMap=(z.isMeshStandardMaterial?lt:$e).get(z.envMap||ue.environment),pt===void 0&&(z.addEventListener("dispose",ye),pt=new Map,ue.programs=pt);let ft=pt.get(Qe);if(ft!==void 0){if(ue.currentProgram===ft&&ue.lightsStateVersion===et)return Mf(z,at),ft}else at.uniforms=se.getUniforms(z),z.onBuild(ce,at,y),z.onBeforeCompile(at,y),ft=se.acquireProgram(at,Qe),pt.set(Qe,ft),ue.uniforms=at.uniforms;const ht=ue.uniforms;return(!z.isShaderMaterial&&!z.isRawShaderMaterial||z.clipping===!0)&&(ht.clippingPlanes=We.uniform),Mf(z,at),ue.needsLights=Tf(z),ue.lightsStateVersion=et,ue.needsLights&&(ht.ambientLightColor.value=fe.state.ambient,ht.lightProbe.value=fe.state.probe,ht.directionalLights.value=fe.state.directional,ht.directionalLightShadows.value=fe.state.directionalShadow,ht.spotLights.value=fe.state.spot,ht.spotLightShadows.value=fe.state.spotShadow,ht.rectAreaLights.value=fe.state.rectArea,ht.ltc_1.value=fe.state.rectAreaLTC1,ht.ltc_2.value=fe.state.rectAreaLTC2,ht.pointLights.value=fe.state.point,ht.pointLightShadows.value=fe.state.pointShadow,ht.hemisphereLights.value=fe.state.hemi,ht.directionalShadowMap.value=fe.state.directionalShadowMap,ht.directionalShadowMatrix.value=fe.state.directionalShadowMatrix,ht.spotShadowMap.value=fe.state.spotShadowMap,ht.spotLightMatrix.value=fe.state.spotLightMatrix,ht.spotLightMap.value=fe.state.spotLightMap,ht.pointShadowMap.value=fe.state.pointShadowMap,ht.pointShadowMatrix.value=fe.state.pointShadowMatrix),ue.currentProgram=ft,ue.uniformsList=null,ft}function wf(z){if(z.uniformsList===null){const re=z.currentProgram.getUniforms();z.uniformsList=Xu.seqWithValue(re.seq,z.uniforms)}return z.uniformsList}function Mf(z,re){const ce=Ue.get(z);ce.outputColorSpace=re.outputColorSpace,ce.instancing=re.instancing,ce.instancingColor=re.instancingColor,ce.skinning=re.skinning,ce.morphTargets=re.morphTargets,ce.morphNormals=re.morphNormals,ce.morphColors=re.morphColors,ce.morphTargetsCount=re.morphTargetsCount,ce.numClippingPlanes=re.numClippingPlanes,ce.numIntersection=re.numClipIntersection,ce.vertexAlphas=re.vertexAlphas,ce.vertexTangents=re.vertexTangents,ce.toneMapping=re.toneMapping}function Wp(z,re,ce,ue,fe){re.isScene!==!0&&(re=It),He.resetTextureUnits();const ke=re.fog,et=ue.isMeshStandardMaterial?re.environment:null,at=B===null?y.outputColorSpace:B.isXRRenderTarget===!0?B.texture.colorSpace:En,Qe=(ue.isMeshStandardMaterial?lt:$e).get(ue.envMap||et),pt=ue.vertexColors===!0&&!!ce.attributes.color&&ce.attributes.color.itemSize===4,ft=!!ce.attributes.tangent&&(!!ue.normalMap||ue.anisotropy>0),ht=!!ce.morphAttributes.position,jt=!!ce.morphAttributes.normal,ii=!!ce.morphAttributes.color;let dn=hs;ue.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&(dn=y.toneMapping);const di=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,Bt=di!==void 0?di.length:0,Et=Ue.get(ue),ri=_.state.lights;if(J===!0&&(Ae===!0||z!==R)){const si=z===R&&ue.id===L;We.setState(ue,z,si)}let ln=!1;ue.version===Et.__version?(Et.needsLights&&Et.lightsStateVersion!==ri.state.version||Et.outputColorSpace!==at||fe.isInstancedMesh&&Et.instancing===!1||!fe.isInstancedMesh&&Et.instancing===!0||fe.isSkinnedMesh&&Et.skinning===!1||!fe.isSkinnedMesh&&Et.skinning===!0||fe.isInstancedMesh&&Et.instancingColor===!0&&fe.instanceColor===null||fe.isInstancedMesh&&Et.instancingColor===!1&&fe.instanceColor!==null||Et.envMap!==Qe||ue.fog===!0&&Et.fog!==ke||Et.numClippingPlanes!==void 0&&(Et.numClippingPlanes!==We.numPlanes||Et.numIntersection!==We.numIntersection)||Et.vertexAlphas!==pt||Et.vertexTangents!==ft||Et.morphTargets!==ht||Et.morphNormals!==jt||Et.morphColors!==ii||Et.toneMapping!==dn||Ze.isWebGL2===!0&&Et.morphTargetsCount!==Bt)&&(ln=!0):(ln=!0,Et.__version=ue.version);let Jr=Et.currentProgram;ln===!0&&(Jr=ws(ue,re,fe));let Bf=!1,Ir=!1,Ms=!1;const An=Jr.getUniforms(),Qi=Et.uniforms;if(_e.useProgram(Jr.program)&&(Bf=!0,Ir=!0,Ms=!0),ue.id!==L&&(L=ue.id,Ir=!0),Bf||R!==z){An.setValue(oe,"projectionMatrix",z.projectionMatrix),An.setValue(oe,"viewMatrix",z.matrixWorldInverse);const si=An.map.cameraPosition;si!==void 0&&si.setValue(oe,Oe.setFromMatrixPosition(z.matrixWorld)),Ze.logarithmicDepthBuffer&&An.setValue(oe,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(ue.isMeshPhongMaterial||ue.isMeshToonMaterial||ue.isMeshLambertMaterial||ue.isMeshBasicMaterial||ue.isMeshStandardMaterial||ue.isShaderMaterial)&&An.setValue(oe,"isOrthographic",z.isOrthographicCamera===!0),R!==z&&(R=z,Ir=!0,Ms=!0)}if(fe.isSkinnedMesh){An.setOptional(oe,fe,"bindMatrix"),An.setOptional(oe,fe,"bindMatrixInverse");const si=fe.skeleton;si&&(Ze.floatVertexTextures?(si.boneTexture===null&&si.computeBoneTexture(),An.setValue(oe,"boneTexture",si.boneTexture,He),An.setValue(oe,"boneTextureSize",si.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const uc=ce.morphAttributes;if((uc.position!==void 0||uc.normal!==void 0||uc.color!==void 0&&Ze.isWebGL2===!0)&&q.update(fe,ce,Jr),(Ir||Et.receiveShadow!==fe.receiveShadow)&&(Et.receiveShadow=fe.receiveShadow,An.setValue(oe,"receiveShadow",fe.receiveShadow)),ue.isMeshGouraudMaterial&&ue.envMap!==null&&(Qi.envMap.value=Qe,Qi.flipEnvMap.value=Qe.isCubeTexture&&Qe.isRenderTargetTexture===!1?-1:1),Ir&&(An.setValue(oe,"toneMappingExposure",y.toneMappingExposure),Et.needsLights&&Kr(Qi,Ms),ke&&ue.fog===!0&&Ce.refreshFogUniforms(Qi,ke),Ce.refreshMaterialUniforms(Qi,ue,te,X,ge),Xu.upload(oe,wf(Et),Qi,He)),ue.isShaderMaterial&&ue.uniformsNeedUpdate===!0&&(Xu.upload(oe,wf(Et),Qi,He),ue.uniformsNeedUpdate=!1),ue.isSpriteMaterial&&An.setValue(oe,"center",fe.center),An.setValue(oe,"modelViewMatrix",fe.modelViewMatrix),An.setValue(oe,"normalMatrix",fe.normalMatrix),An.setValue(oe,"modelMatrix",fe.matrixWorld),ue.isShaderMaterial||ue.isRawShaderMaterial){const si=ue.uniformsGroups;for(let Io=0,Rf=si.length;Io<Rf;Io++)if(Ze.isWebGL2){const Ga=si[Io];Je.update(Ga,Jr),Je.bind(Ga,Jr)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Jr}function Kr(z,re){z.ambientLightColor.needsUpdate=re,z.lightProbe.needsUpdate=re,z.directionalLights.needsUpdate=re,z.directionalLightShadows.needsUpdate=re,z.pointLights.needsUpdate=re,z.pointLightShadows.needsUpdate=re,z.spotLights.needsUpdate=re,z.spotLightShadows.needsUpdate=re,z.rectAreaLights.needsUpdate=re,z.hemisphereLights.needsUpdate=re}function Tf(z){return z.isMeshLambertMaterial||z.isMeshToonMaterial||z.isMeshPhongMaterial||z.isMeshStandardMaterial||z.isShadowMaterial||z.isShaderMaterial&&z.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return B},this.setRenderTargetTextures=function(z,re,ce){Ue.get(z.texture).__webglTexture=re,Ue.get(z.depthTexture).__webglTexture=ce;const ue=Ue.get(z);ue.__hasExternalTextures=!0,ue.__hasExternalTextures&&(ue.__autoAllocateDepthBuffer=ce===void 0,ue.__autoAllocateDepthBuffer||Ne.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ue.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(z,re){const ce=Ue.get(z);ce.__webglFramebuffer=re,ce.__useDefaultFramebuffer=re===void 0},this.setRenderTarget=function(z,re=0,ce=0){B=z,w=re,b=ce;let ue=!0,fe=null,ke=!1,et=!1;if(z){const Qe=Ue.get(z);Qe.__useDefaultFramebuffer!==void 0?(_e.bindFramebuffer(oe.FRAMEBUFFER,null),ue=!1):Qe.__webglFramebuffer===void 0?He.setupRenderTarget(z):Qe.__hasExternalTextures&&He.rebindTextures(z,Ue.get(z.texture).__webglTexture,Ue.get(z.depthTexture).__webglTexture);const pt=z.texture;(pt.isData3DTexture||pt.isDataArrayTexture||pt.isCompressedArrayTexture)&&(et=!0);const ft=Ue.get(z).__webglFramebuffer;z.isWebGLCubeRenderTarget?(Array.isArray(ft[re])?fe=ft[re][ce]:fe=ft[re],ke=!0):Ze.isWebGL2&&z.samples>0&&He.useMultisampledRTT(z)===!1?fe=Ue.get(z).__webglMultisampledFramebuffer:Array.isArray(ft)?fe=ft[ce]:fe=ft,T.copy(z.viewport),N.copy(z.scissor),k=z.scissorTest}else T.copy(U).multiplyScalar(te).floor(),N.copy(D).multiplyScalar(te).floor(),k=G;if(_e.bindFramebuffer(oe.FRAMEBUFFER,fe)&&Ze.drawBuffers&&ue&&_e.drawBuffers(z,fe),_e.viewport(T),_e.scissor(N),_e.setScissorTest(k),ke){const Qe=Ue.get(z.texture);oe.framebufferTexture2D(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,oe.TEXTURE_CUBE_MAP_POSITIVE_X+re,Qe.__webglTexture,ce)}else if(et){const Qe=Ue.get(z.texture),pt=re||0;oe.framebufferTextureLayer(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,Qe.__webglTexture,ce||0,pt)}L=-1},this.readRenderTargetPixels=function(z,re,ce,ue,fe,ke,et){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let at=Ue.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&et!==void 0&&(at=at[et]),at){_e.bindFramebuffer(oe.FRAMEBUFFER,at);try{const Qe=z.texture,pt=Qe.format,ft=Qe.type;if(pt!==on&&nt.convert(pt)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=ft===Jn&&(Ne.has("EXT_color_buffer_half_float")||Ze.isWebGL2&&Ne.has("EXT_color_buffer_float"));if(ft!==fn&&nt.convert(ft)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ft===hn&&(Ze.isWebGL2||Ne.has("OES_texture_float")||Ne.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re>=0&&re<=z.width-ue&&ce>=0&&ce<=z.height-fe&&oe.readPixels(re,ce,ue,fe,nt.convert(pt),nt.convert(ft),ke)}finally{const Qe=B!==null?Ue.get(B).__webglFramebuffer:null;_e.bindFramebuffer(oe.FRAMEBUFFER,Qe)}}},this.copyFramebufferToTexture=function(z,re,ce=0){const ue=Math.pow(2,-ce),fe=Math.floor(re.image.width*ue),ke=Math.floor(re.image.height*ue);He.setTexture2D(re,0),oe.copyTexSubImage2D(oe.TEXTURE_2D,ce,0,0,z.x,z.y,fe,ke),_e.unbindTexture()},this.copyTextureToTexture=function(z,re,ce,ue=0){const fe=re.image.width,ke=re.image.height,et=nt.convert(ce.format),at=nt.convert(ce.type);He.setTexture2D(ce,0),oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,ce.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,ce.unpackAlignment),re.isDataTexture?oe.texSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,fe,ke,et,at,re.image.data):re.isCompressedTexture?oe.compressedTexSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,re.mipmaps[0].width,re.mipmaps[0].height,et,re.mipmaps[0].data):oe.texSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,et,at,re.image),ue===0&&ce.generateMipmaps&&oe.generateMipmap(oe.TEXTURE_2D),_e.unbindTexture()},this.copyTextureToTexture3D=function(z,re,ce,ue,fe=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ke=z.max.x-z.min.x+1,et=z.max.y-z.min.y+1,at=z.max.z-z.min.z+1,Qe=nt.convert(ue.format),pt=nt.convert(ue.type);let ft;if(ue.isData3DTexture)He.setTexture3D(ue,0),ft=oe.TEXTURE_3D;else if(ue.isDataArrayTexture)He.setTexture2DArray(ue,0),ft=oe.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,ue.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,ue.unpackAlignment);const ht=oe.getParameter(oe.UNPACK_ROW_LENGTH),jt=oe.getParameter(oe.UNPACK_IMAGE_HEIGHT),ii=oe.getParameter(oe.UNPACK_SKIP_PIXELS),dn=oe.getParameter(oe.UNPACK_SKIP_ROWS),di=oe.getParameter(oe.UNPACK_SKIP_IMAGES),Bt=ce.isCompressedTexture?ce.mipmaps[0]:ce.image;oe.pixelStorei(oe.UNPACK_ROW_LENGTH,Bt.width),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,Bt.height),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,z.min.x),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,z.min.y),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,z.min.z),ce.isDataTexture||ce.isData3DTexture?oe.texSubImage3D(ft,fe,re.x,re.y,re.z,ke,et,at,Qe,pt,Bt.data):ce.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),oe.compressedTexSubImage3D(ft,fe,re.x,re.y,re.z,ke,et,at,Qe,Bt.data)):oe.texSubImage3D(ft,fe,re.x,re.y,re.z,ke,et,at,Qe,pt,Bt),oe.pixelStorei(oe.UNPACK_ROW_LENGTH,ht),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,jt),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,ii),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,dn),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,di),fe===0&&ue.generateMipmaps&&oe.generateMipmap(ft),_e.unbindTexture()},this.initTexture=function(z){z.isCubeTexture?He.setTextureCube(z,0):z.isData3DTexture?He.setTexture3D(z,0):z.isDataArrayTexture||z.isCompressedArrayTexture?He.setTexture2DArray(z,0):He.setTexture2D(z,0),_e.unbindTexture()},this.resetState=function(){w=0,b=0,B=null,_e.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ur}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===gu?"display-p3":"srgb",t.unpackColorSpace=Nt.workingColorSpace===Ul?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Xt?uo:L1}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===uo?Xt:En}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 kR extends Q_{}kR.prototype.isWebGL1Renderer=!0;class FR extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,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,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}}class QR{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=uA,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=qi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,o=this.stride;r<o;r++)this.array[e+r]=t.array[n+r];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=qi()),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=qi()),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 ei=new j;class GA{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.applyMatrix4(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.applyNormalMatrix(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.transformDirection(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ar(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ar(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ar(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),o=Ot(o,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=o,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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}return new bn(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 GA(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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}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 O_=new j,z_=new Gt,G_=new Gt,OR=new j,H_=new ct,Ku=new j,HA=new Ji,V_=new ct,VA=new Hl;class zR extends Wn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=n1,this.bindMatrix=new ct,this.bindMatrixInverse=new ct,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new gn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Ku),this.boundingBox.expandByPoint(Ku)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ji),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Ku),this.boundingSphere.expandByPoint(Ku)}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,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),HA.copy(this.boundingSphere),HA.applyMatrix4(r),e.ray.intersectsSphere(HA)!==!1&&(V_.copy(r).invert(),VA.copy(e.ray).applyMatrix4(V_),!(this.boundingBox!==null&&VA.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,VA)))}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 Gt,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===n1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===kM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;z_.fromBufferAttribute(r.attributes.skinIndex,e),G_.fromBufferAttribute(r.attributes.skinWeight,e),O_.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const l=G_.getComponent(o);if(l!==0){const c=z_.getComponent(o);H_.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(OR.copy(O_).applyMatrix4(H_),l)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class W_ extends tn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _a extends Rn{constructor(e=null,t=1,n=1,r,o,l,c,f,u=qt,d=qt,p,A){super(null,l,c,f,u,d,r,o,p,A),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const j_=new ct,GR=new ct;class WA{constructor(e=[],t=[]){this.uuid=qi(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,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,r=this.bones.length;n<r;n++)this.boneInverses.push(new ct)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new ct;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,r=this.boneTexture;for(let o=0,l=e.length;o<l;o++){const c=e[o]?e[o].matrixWorld:GR;j_.multiplyMatrices(c,t[o]),j_.toArray(n,o*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new WA(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=k1(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new _a(t,e,e,on,hn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const o=e.bones[n];let l=t[o];l===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),l=new W_),this.bones.push(l),this.boneInverses.push(new ct().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,o=t.length;r<o;r++){const l=t[r];e.bones.push(l.uuid);const c=n[r];e.boneInverses.push(c.toArray())}return e}}class jA extends bn{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ea=new ct,Y_=new ct,Ju=[],q_=new gn,HR=new ct,Xl=new Wn,Kl=new Ji;class VR extends Wn{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new jA(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,HR)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new gn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ea),q_.copy(e.boundingBox).applyMatrix4(Ea),this.boundingBox.union(q_)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ji),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ea),Kl.copy(e.boundingSphere).applyMatrix4(Ea),this.boundingSphere.union(Kl)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),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)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Xl.geometry=this.geometry,Xl.material=this.material,Xl.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Kl.copy(this.boundingSphere),Kl.applyMatrix4(n),e.ray.intersectsSphere(Kl)!==!1))for(let o=0;o<r;o++){this.getMatrixAt(o,Ea),Y_.multiplyMatrices(n,Ea),Xl.matrixWorld=Y_,Xl.raycast(e,Ju);for(let l=0,c=Ju.length;l<c;l++){const f=Ju[l];f.instanceId=o,f.object=this,t.push(f)}Ju.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new jA(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class X_ extends gr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tt(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 K_=new j,J_=new j,Z_=new ct,YA=new Hl,Zu=new Ji;class qA extends tn{constructor(e=new xi,t=new X_){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 r=1,o=t.count;r<o;r++)K_.fromBufferAttribute(t,r-1),J_.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=K_.distanceTo(J_);e.setAttribute("lineDistance",new er(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,o=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Zu.copy(n.boundingSphere),Zu.applyMatrix4(r),Zu.radius+=o,e.ray.intersectsSphere(Zu)===!1)return;Z_.copy(r).invert(),YA.copy(e.ray).applyMatrix4(Z_);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,u=new j,d=new j,p=new j,A=new j,g=this.isLineSegments?2:1,E=n.index,_=n.attributes.position;if(E!==null){const v=Math.max(0,l.start),S=Math.min(E.count,l.start+l.count);for(let y=v,x=S-1;y<x;y+=g){const w=E.getX(y),b=E.getX(y+1);if(u.fromBufferAttribute(_,w),d.fromBufferAttribute(_,b),YA.distanceSqToSegment(u,d,A,p)>f)continue;A.applyMatrix4(this.matrixWorld);const L=e.ray.origin.distanceTo(A);L<e.near||L>e.far||t.push({distance:L,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,l.start),S=Math.min(_.count,l.start+l.count);for(let y=v,x=S-1;y<x;y+=g){if(u.fromBufferAttribute(_,y),d.fromBufferAttribute(_,y+1),YA.distanceSqToSegment(u,d,A,p)>f)continue;A.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(A);b<e.near||b>e.far||t.push({distance:b,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}const $_=new j,eE=new j;class WR extends qA{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 r=0,o=t.count;r<o;r+=2)$_.fromBufferAttribute(t,r),eE.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+$_.distanceTo(eE);e.setAttribute("lineDistance",new er(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class jR extends qA{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class tE extends gr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tt(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 nE=new ct,XA=new Hl,$u=new Ji,ef=new j;class YR extends tn{constructor(e=new xi,t=new tE){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,o=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),$u.copy(n.boundingSphere),$u.applyMatrix4(r),$u.radius+=o,e.ray.intersectsSphere($u)===!1)return;nE.copy(r).invert(),XA.copy(e.ray).applyMatrix4(nE);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,u=n.index,p=n.attributes.position;if(u!==null){const A=Math.max(0,l.start),g=Math.min(u.count,l.start+l.count);for(let E=A,C=g;E<C;E++){const _=u.getX(E);ef.fromBufferAttribute(p,_),iE(ef,_,f,r,e,t,this)}}else{const A=Math.max(0,l.start),g=Math.min(p.count,l.start+l.count);for(let E=A,C=g;E<C;E++)ef.fromBufferAttribute(p,E),iE(ef,E,f,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}function iE(i,e,t,n,r,o,l){const c=XA.distanceSqToPoint(i);if(c<t){const f=new j;XA.closestPointToPoint(i,f),f.applyMatrix4(n);const u=r.ray.origin.distanceTo(f);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(c),point:f,index:e,face:null,object:l})}}class tf extends Rn{constructor(e,t,n,r,o,l,c,f,u,d,p,A){super(null,l,c,f,u,d,r,o,p,A),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class qR extends tf{constructor(e,t,n,r,o,l){super(e,t,n,o,l),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Fn}}class XR extends tf{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,so),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class KR extends Si{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class KA extends gr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new tt(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 tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=D1,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class _r extends KA{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 Ke(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return yn(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 tt(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 tt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tt(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 nf(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function JR(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function ZR(i){function e(r,o){return i[r]-i[o]}const t=i.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort(e),n}function rE(i,e,t){const n=i.length,r=new i.constructor(n);for(let o=0,l=0;l!==n;++o){const c=t[o]*e;for(let f=0;f!==e;++f)r[l++]=i[c+f]}return r}function sE(i,e,t,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];if(o===void 0)return;let l=o[n];if(l!==void 0)if(Array.isArray(l))do l=o[n],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=i[r++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[n],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=i[r++];while(o!==void 0);else do l=o[n],l!==void 0&&(e.push(o.time),t.push(l)),o=i[r++];while(o!==void 0)}class Jl{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],o=t[n-1];e:{t:{let l;n:{i:if(!(e<r)){for(let c=n+2;;){if(r===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(o=r,r=t[++n],e<r)break t}l=t.length;break n}if(!(e>=o)){const c=t[1];e<c&&(n=2,o=c);for(let f=n-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===f)break;if(r=o,o=t[--n-1],e>=o)break t}l=n,n=0;break n}break e}for(;n<l;){const c=n+l>>>1;e<t[c]?l=c:n=c+1}if(r=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r;for(let l=0;l!==r;++l)t[l]=n[o+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class $R extends Jl{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:T1,endingEnd:T1}}intervalChanged_(e,t,n){const r=this.parameterPositions;let o=e-2,l=e+1,c=r[o],f=r[l];if(c===void 0)switch(this.getSettings_().endingStart){case B1:o=e,c=2*t-n;break;case R1:o=r.length-2,c=t+r[o]-r[o+1];break;default:o=e,c=n}if(f===void 0)switch(this.getSettings_().endingEnd){case B1:l=e,f=2*n-t;break;case R1:l=1,f=n+r[1]-r[0];break;default:l=e-1,f=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(f-n),this._offsetPrev=o*d,this._offsetNext=l*d}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=e*c,u=f-c,d=this._offsetPrev,p=this._offsetNext,A=this._weightPrev,g=this._weightNext,E=(n-t)/(r-t),C=E*E,_=C*E,v=-A*_+2*A*C-A*E,S=(1+A)*_+(-1.5-2*A)*C+(-.5+A)*E+1,y=(-1-g)*_+(1.5+g)*C+.5*E,x=g*_-g*C;for(let w=0;w!==c;++w)o[w]=v*l[d+w]+S*l[u+w]+y*l[f+w]+x*l[p+w];return o}}class eb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=e*c,u=f-c,d=(n-t)/(r-t),p=1-d;for(let A=0;A!==c;++A)o[A]=l[u+A]*p+l[f+A]*d;return o}}class tb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Er{constructor(e,t,n,r){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=nf(t,this.TimeBufferType),this.values=nf(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:nf(e.times,Array),values:nf(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new tb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new eb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new $R(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pl:t=this.InterpolantFactoryMethodDiscrete;break;case Jo:t=this.InterpolantFactoryMethodLinear;break;case lA: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 Pl;case this.InterpolantFactoryMethodLinear:return Jo;case this.InterpolantFactoryMethodSmooth:return lA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let o=0,l=r-1;for(;o!==r&&n[o]<e;)++o;for(;l!==-1&&n[l]>t;)--l;if(++l,o!==0||l!==r){o>=l&&(l=Math.max(l,1),o=l-1);const c=this.getValueSize();this.times=n.slice(o,l),this.values=this.values.slice(o*c,l*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,r=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==o;c++){const f=n[c];if(typeof f=="number"&&isNaN(f)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,f),e=!1;break}if(l!==null&&l>f){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,f,l),e=!1;break}l=f}if(r!==void 0&&JR(r))for(let c=0,f=r.length;c!==f;++c){const u=r[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(),r=this.getInterpolation()===lA,o=e.length-1;let l=1;for(let c=1;c<o;++c){let f=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(r)f=!0;else{const p=c*n,A=p-n,g=p+n;for(let E=0;E!==n;++E){const C=t[p+E];if(C!==t[A+E]||C!==t[g+E]){f=!0;break}}}if(f){if(c!==l){e[l]=e[c];const p=c*n,A=l*n;for(let g=0;g!==n;++g)t[A+g]=t[p+g]}++l}}if(o>0){e[l]=e[o];for(let c=o*n,f=l*n,u=0;u!==n;++u)t[f+u]=t[c+u];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Er.prototype.TimeBufferType=Float32Array,Er.prototype.ValueBufferType=Float32Array,Er.prototype.DefaultInterpolation=Jo;class ya extends Er{}ya.prototype.ValueTypeName="bool",ya.prototype.ValueBufferType=Array,ya.prototype.DefaultInterpolation=Pl,ya.prototype.InterpolantFactoryMethodLinear=void 0,ya.prototype.InterpolantFactoryMethodSmooth=void 0;class oE extends Er{}oE.prototype.ValueTypeName="color";class Ca extends Er{}Ca.prototype.ValueTypeName="number";class nb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=(n-t)/(r-t);let u=e*c;for(let d=u+c;u!==d;u+=4)pr.slerpFlat(o,0,l,u-c,l,u,f);return o}}class _o extends Er{InterpolantFactoryMethodLinear(e){return new nb(this.times,this.values,this.getValueSize(),e)}}_o.prototype.ValueTypeName="quaternion",_o.prototype.DefaultInterpolation=Jo,_o.prototype.InterpolantFactoryMethodSmooth=void 0;class Ia extends Er{}Ia.prototype.ValueTypeName="string",Ia.prototype.ValueBufferType=Array,Ia.prototype.DefaultInterpolation=Pl,Ia.prototype.InterpolantFactoryMethodLinear=void 0,Ia.prototype.InterpolantFactoryMethodSmooth=void 0;class xa extends Er{}xa.prototype.ValueTypeName="vector";class ib{constructor(e,t=-1,n,r=GM){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=qi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let l=0,c=n.length;l!==c;++l)t.push(sb(n[l]).scale(r));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=n.length;o!==l;++o)t.push(Er.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const o=t.length,l=[];for(let c=0;c<o;c++){let f=[],u=[];f.push((c+o-1)%o,c,(c+1)%o),u.push(0,1,0);const d=ZR(f);f=rE(f,1,d),u=rE(u,1,d),!r&&f[0]===0&&(f.push(o),u.push(u[0])),l.push(new Ca(".morphTargetInfluences["+t[c].name+"]",f,u).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let c=0,f=e.length;c<f;c++){const u=e[c],d=u.name.match(o);if(d&&d.length>1){const p=d[1];let A=r[p];A||(r[p]=A=[]),A.push(u)}}const l=[];for(const c in r)l.push(this.CreateFromMorphTargetSequence(c,r[c],t,n));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(p,A,g,E,C){if(g.length!==0){const _=[],v=[];sE(g,_,v,E),_.length!==0&&C.push(new p(A,_,v))}},r=[],o=e.name||"default",l=e.fps||30,c=e.blendMode;let f=e.length||-1;const u=e.hierarchy||[];for(let p=0;p<u.length;p++){const A=u[p].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const g={};let E;for(E=0;E<A.length;E++)if(A[E].morphTargets)for(let C=0;C<A[E].morphTargets.length;C++)g[A[E].morphTargets[C]]=-1;for(const C in g){const _=[],v=[];for(let S=0;S!==A[E].morphTargets.length;++S){const y=A[E];_.push(y.time),v.push(y.morphTarget===C?1:0)}r.push(new Ca(".morphTargetInfluence["+C+"]",_,v))}f=g.length*l}else{const g=".bones["+t[p].name+"]";n(xa,g+".position",A,"pos",r),n(_o,g+".quaternion",A,"rot",r),n(xa,g+".scale",A,"scl",r)}}return r.length===0?null:new this(o,f,r,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,r=e.length;n!==r;++n){const o=this.tracks[n];t=Math.max(t,o.times[o.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 rb(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ca;case"vector":case"vector2":case"vector3":case"vector4":return xa;case"color":return oE;case"quaternion":return _o;case"bool":case"boolean":return ya;case"string":return Ia}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function sb(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=rb(i.type);if(i.times===void 0){const t=[],n=[];sE(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Sa={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class aE{constructor(e,t,n){const r=this;let o=!1,l=0,c=0,f;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,o===!1&&r.onStart!==void 0&&r.onStart(d,l,c),o=!0},this.itemEnd=function(d){l++,r.onProgress!==void 0&&r.onProgress(d,l,c),l===c&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(d){r.onError!==void 0&&r.onError(d)},this.resolveURL=function(d){return f?f(d):d},this.setURLModifier=function(d){return f=d,this},this.addHandler=function(d,p){return u.push(d,p),this},this.removeHandler=function(d){const p=u.indexOf(d);return p!==-1&&u.splice(p,2),this},this.getHandler=function(d){for(let p=0,A=u.length;p<A;p+=2){const g=u[p],E=u[p+1];if(g.global&&(g.lastIndex=0),g.test(d))return E}return null}}}const ob=new aE;class _s{constructor(e){this.manager=e!==void 0?e:ob,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,o){n.load(e,r,t,o)})}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}}_s.DEFAULT_MATERIAL_NAME="__DEFAULT";const Vr={};class ab extends Error{constructor(e,t){super(e),this.response=t}}class wa extends _s{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=Sa.get(e);if(o!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(o),this.manager.itemEnd(e)},0),o;if(Vr[e]!==void 0){Vr[e].push({onLoad:t,onProgress:n,onError:r});return}Vr[e]=[],Vr[e].push({onLoad:t,onProgress:n,onError:r});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,f=this.responseType;fetch(l).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=Vr[e],p=u.body.getReader(),A=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=A?parseInt(A):0,E=g!==0;let C=0;const _=new ReadableStream({start(v){S();function S(){p.read().then(({done:y,value:x})=>{if(y)v.close();else{C+=x.byteLength;const w=new ProgressEvent("progress",{lengthComputable:E,loaded:C,total:g});for(let b=0,B=d.length;b<B;b++){const L=d[b];L.onProgress&&L.onProgress(w)}v.enqueue(x),S()}})}}});return new Response(_)}else throw new ab(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(f){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 p=/charset="?([^;"\s]*)"?/i.exec(c),A=p&&p[1]?p[1].toLowerCase():void 0,g=new TextDecoder(A);return u.arrayBuffer().then(E=>g.decode(E))}}}).then(u=>{Sa.add(e,u);const d=Vr[e];delete Vr[e];for(let p=0,A=d.length;p<A;p++){const g=d[p];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Vr[e];if(d===void 0)throw this.manager.itemError(e),u;delete Vr[e];for(let p=0,A=d.length;p<A;p++){const g=d[p];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 lb extends _s{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Sa.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const c=Ql("img");function f(){d(),Sa.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(p){d(),r&&r(p),o.manager.itemError(e),o.manager.itemEnd(e)}function d(){c.removeEventListener("load",f,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",f,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(e),c.src=e,c}}class cb extends _s{constructor(e){super(e)}load(e,t,n,r){const o=this,l=new _a,c=new wa(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(o.withCredentials),c.load(e,function(f){let u;try{u=o.parse(f)}catch(d){if(r!==void 0)r(d);else{console.error(d);return}}u.image!==void 0?l.image=u.image:u.data!==void 0&&(l.image.width=u.width,l.image.height=u.height,l.image.data=u.data),l.wrapS=u.wrapS!==void 0?u.wrapS:Fn,l.wrapT=u.wrapT!==void 0?u.wrapT:Fn,l.magFilter=u.magFilter!==void 0?u.magFilter:un,l.minFilter=u.minFilter!==void 0?u.minFilter:un,l.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0?l.colorSpace=u.colorSpace:u.encoding!==void 0&&(l.encoding=u.encoding),u.flipY!==void 0&&(l.flipY=u.flipY),u.format!==void 0&&(l.format=u.format),u.type!==void 0&&(l.type=u.type),u.mipmaps!==void 0&&(l.mipmaps=u.mipmaps,l.minFilter=Pr),u.mipmapCount===1&&(l.minFilter=un),u.generateMipmaps!==void 0&&(l.generateMipmaps=u.generateMipmaps),l.needsUpdate=!0,t&&t(l,u)},n,r),l}}class lE extends _s{constructor(e){super(e)}load(e,t,n,r){const o=new Rn,l=new lb(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(c){o.image=c,o.needsUpdate=!0,t!==void 0&&t(o)},n,r),o}}class JA extends tn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tt(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}}const ZA=new ct,cE=new j,uE=new j;class $A{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ke(512,512),this.map=null,this.mapPass=null,this.matrix=new ct,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new DA,this._frameExtents=new Ke(1,1),this._viewportCount=1,this._viewports=[new Gt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;cE.setFromMatrixPosition(e.matrixWorld),t.position.copy(cE),uE.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(uE),t.updateMatrixWorld(),ZA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ZA),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ZA)}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 ub extends $A{constructor(){super(new $n(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=$o*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;(n!==t.fov||r!==t.aspect||o!==t.far)&&(t.fov=n,t.aspect=r,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class fb extends JA{constructor(e,t,n=0,r=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.distance=n,this.angle=r,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new ub}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 fE=new ct,Zl=new j,ep=new j;class hb extends $A{constructor(){super(new $n(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ke(4,2),this._viewportCount=6,this._viewports=[new Gt(2,1,1,1),new Gt(0,1,1,1),new Gt(3,1,1,1),new Gt(1,1,1,1),new Gt(3,0,1,1),new Gt(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,r=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),Zl.setFromMatrixPosition(e.matrixWorld),n.position.copy(Zl),ep.copy(n.position),ep.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ep),n.updateMatrixWorld(),r.makeTranslation(-Zl.x,-Zl.y,-Zl.z),fE.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fE)}}class db extends JA{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new hb}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 Ab extends $A{constructor(){super(new Yl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class pb extends JA{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.shadow=new Ab}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class tp{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{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 gb extends _s{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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Sa.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader,fetch(e,c).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(f){Sa.add(e,f),t&&t(f),o.manager.itemEnd(e)}).catch(function(f){r&&r(f),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}class mb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=hE(),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=hE();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function hE(){return(typeof performance>"u"?Date:performance).now()}const np="\\[\\]\\.:\\/",vb=new RegExp("["+np+"]","g"),ip="[^"+np+"]",_b="[^"+np.replace("\\.","")+"]",Eb=/((?:WC+[\/:])*)/.source.replace("WC",ip),yb=/(WCOD+)?/.source.replace("WCOD",_b),Cb=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ip),Ib=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ip),xb=new RegExp("^"+Eb+yb+Cb+Ib+"$"),Sb=["material","materials","bones","map"];class wb{constructor(e,t,n){const r=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,o=n.length;r!==o;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}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(vb,"")}static parseTrackName(e){const t=xb.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);Sb.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=o)}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(o){for(let l=0;l<o.length;l++){const c=o[l];if(c.name===t||c.uuid===t)return c;const f=n(c.children);if(f)return f}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let o=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 l=e[r];if(l===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" 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 f=this.BindingType.Direct;if(o!==void 0){if(r==="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[o]!==void 0&&(o=e.morphTargetDictionary[o])}f=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=o}else l.fromArray!==void 0&&l.toArray!==void 0?(f=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(f=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=r;this.getValue=this.GetterByBindingType[f],this.setValue=this.SetterByBindingTypeAndVersioning[f][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=wb,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 dE{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(yn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const AE=new j,rf=new j;class Wr{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){AE.subVectors(e,this.start),rf.subVectors(this.end,this.start);const n=rf.dot(rf);let o=rf.dot(AE)/n;return t&&(o=yn(o,0,1)),o}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:su}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=su);const pE={type:"change"},rp={type:"start"},gE={type:"end"},sf=new Hl,mE=new mr,Mb=Math.cos(70*AA.DEG2RAD);class Tb extends fo{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:Wo.ROTATE,MIDDLE:Wo.DOLLY,RIGHT:Wo.PAN},this.touches={ONE:jo.ROTATE,TWO:jo.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(q){q.addEventListener("keydown",Q),this._domElementKeyEvents=q},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Q),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(pE),n.update(),o=r.NONE},this.update=function(){const q=new j,Me=new pr().setFromUnitVectors(e.up,new j(0,1,0)),pe=Me.clone().invert(),nt=new j,je=new pr,Je=new j,Ge=2*Math.PI;return function(dt=null){const ee=n.object.position;q.copy(ee).sub(n.target),q.applyQuaternion(Me),c.setFromVector3(q),n.autoRotate&&o===r.NONE&&N(R(dt)),n.enableDamping?(c.theta+=f.theta*n.dampingFactor,c.phi+=f.phi*n.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let Te=n.minAzimuthAngle,ye=n.maxAzimuthAngle;isFinite(Te)&&isFinite(ye)&&(Te<-Math.PI?Te+=Ge:Te>Math.PI&&(Te-=Ge),ye<-Math.PI?ye+=Ge:ye>Math.PI&&(ye-=Ge),Te<=ye?c.theta=Math.max(Te,Math.min(ye,c.theta)):c.theta=c.theta>(Te+ye)/2?Math.max(Te,c.theta):Math.min(ye,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),n.zoomToCursor&&b||n.object.isOrthographicCamera?c.radius=$(c.radius):c.radius=$(c.radius*u),q.setFromSpherical(c),q.applyQuaternion(pe),ee.copy(n.target).add(q),n.object.lookAt(n.target),n.enableDamping===!0?(f.theta*=1-n.dampingFactor,f.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let he=!1;if(n.zoomToCursor&&b){let we=null;if(n.object.isPerspectiveCamera){const qe=q.length();we=$(qe*u);const At=qe-we;n.object.position.addScaledVector(x,At),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const qe=new j(w.x,w.y,0);qe.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),he=!0;const At=new j(w.x,w.y,0);At.unproject(n.object),n.object.position.sub(At).add(qe),n.object.updateMatrixWorld(),we=q.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;we!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(we).add(n.object.position):(sf.origin.copy(n.object.position),sf.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(sf.direction))<Mb?e.lookAt(n.target):(mE.setFromNormalAndCoplanarPoint(n.object.up,n.target),sf.intersectPlane(mE,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),he=!0);return u=1,b=!1,he||nt.distanceToSquared(n.object.position)>l||8*(1-je.dot(n.object.quaternion))>l||Je.distanceToSquared(n.target)>0?(n.dispatchEvent(pE),nt.copy(n.object.position),je.copy(n.object.quaternion),Je.copy(n.target),he=!1,!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",me),n.domElement.removeEventListener("pointerdown",Ue),n.domElement.removeEventListener("pointercancel",$e),n.domElement.removeEventListener("wheel",H),n.domElement.removeEventListener("pointermove",He),n.domElement.removeEventListener("pointerup",$e),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Q),n._domElementKeyEvents=null)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=r.NONE;const l=1e-6,c=new dE,f=new dE;let u=1;const d=new j,p=new Ke,A=new Ke,g=new Ke,E=new Ke,C=new Ke,_=new Ke,v=new Ke,S=new Ke,y=new Ke,x=new j,w=new Ke;let b=!1;const B=[],L={};function R(q){return q!==null?2*Math.PI/60*n.autoRotateSpeed*q:2*Math.PI/60/60*n.autoRotateSpeed}function T(){return Math.pow(.95,n.zoomSpeed)}function N(q){f.theta-=q}function k(q){f.phi-=q}const O=function(){const q=new j;return function(pe,nt){q.setFromMatrixColumn(nt,0),q.multiplyScalar(-pe),d.add(q)}}(),F=function(){const q=new j;return function(pe,nt){n.screenSpacePanning===!0?q.setFromMatrixColumn(nt,1):(q.setFromMatrixColumn(nt,0),q.crossVectors(n.object.up,q)),q.multiplyScalar(pe),d.add(q)}}(),V=function(){const q=new j;return function(pe,nt){const je=n.domElement;if(n.object.isPerspectiveCamera){const Je=n.object.position;q.copy(Je).sub(n.target);let Ge=q.length();Ge*=Math.tan(n.object.fov/2*Math.PI/180),O(2*pe*Ge/je.clientHeight,n.object.matrix),F(2*nt*Ge/je.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(O(pe*(n.object.right-n.object.left)/n.object.zoom/je.clientWidth,n.object.matrix),F(nt*(n.object.top-n.object.bottom)/n.object.zoom/je.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function X(q){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=q:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function te(q){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=q:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Y(q){if(!n.zoomToCursor)return;b=!0;const Me=n.domElement.getBoundingClientRect(),pe=q.clientX-Me.left,nt=q.clientY-Me.top,je=Me.width,Je=Me.height;w.x=pe/je*2-1,w.y=-(nt/Je)*2+1,x.set(w.x,w.y,1).unproject(n.object).sub(n.object.position).normalize()}function $(q){return Math.max(n.minDistance,Math.min(n.maxDistance,q))}function U(q){p.set(q.clientX,q.clientY)}function D(q){Y(q),v.set(q.clientX,q.clientY)}function G(q){E.set(q.clientX,q.clientY)}function K(q){A.set(q.clientX,q.clientY),g.subVectors(A,p).multiplyScalar(n.rotateSpeed);const Me=n.domElement;N(2*Math.PI*g.x/Me.clientHeight),k(2*Math.PI*g.y/Me.clientHeight),p.copy(A),n.update()}function J(q){S.set(q.clientX,q.clientY),y.subVectors(S,v),y.y>0?X(T()):y.y<0&&te(T()),v.copy(S),n.update()}function Ae(q){C.set(q.clientX,q.clientY),_.subVectors(C,E).multiplyScalar(n.panSpeed),V(_.x,_.y),E.copy(C),n.update()}function ge(q){Y(q),q.deltaY<0?te(T()):q.deltaY>0&&X(T()),n.update()}function be(q){let Me=!1;switch(q.code){case n.keys.UP:q.ctrlKey||q.metaKey||q.shiftKey?k(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(0,n.keyPanSpeed),Me=!0;break;case n.keys.BOTTOM:q.ctrlKey||q.metaKey||q.shiftKey?k(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(0,-n.keyPanSpeed),Me=!0;break;case n.keys.LEFT:q.ctrlKey||q.metaKey||q.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(n.keyPanSpeed,0),Me=!0;break;case n.keys.RIGHT:q.ctrlKey||q.metaKey||q.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(-n.keyPanSpeed,0),Me=!0;break}Me&&(q.preventDefault(),n.update())}function de(){if(B.length===1)p.set(B[0].pageX,B[0].pageY);else{const q=.5*(B[0].pageX+B[1].pageX),Me=.5*(B[0].pageY+B[1].pageY);p.set(q,Me)}}function Oe(){if(B.length===1)E.set(B[0].pageX,B[0].pageY);else{const q=.5*(B[0].pageX+B[1].pageX),Me=.5*(B[0].pageY+B[1].pageY);E.set(q,Me)}}function It(){const q=B[0].pageX-B[1].pageX,Me=B[0].pageY-B[1].pageY,pe=Math.sqrt(q*q+Me*Me);v.set(0,pe)}function ot(){n.enableZoom&&It(),n.enablePan&&Oe()}function oe(){n.enableZoom&&It(),n.enableRotate&&de()}function Mt(q){if(B.length==1)A.set(q.pageX,q.pageY);else{const pe=Re(q),nt=.5*(q.pageX+pe.x),je=.5*(q.pageY+pe.y);A.set(nt,je)}g.subVectors(A,p).multiplyScalar(n.rotateSpeed);const Me=n.domElement;N(2*Math.PI*g.x/Me.clientHeight),k(2*Math.PI*g.y/Me.clientHeight),p.copy(A)}function Ne(q){if(B.length===1)C.set(q.pageX,q.pageY);else{const Me=Re(q),pe=.5*(q.pageX+Me.x),nt=.5*(q.pageY+Me.y);C.set(pe,nt)}_.subVectors(C,E).multiplyScalar(n.panSpeed),V(_.x,_.y),E.copy(C)}function Ze(q){const Me=Re(q),pe=q.pageX-Me.x,nt=q.pageY-Me.y,je=Math.sqrt(pe*pe+nt*nt);S.set(0,je),y.set(0,Math.pow(S.y/v.y,n.zoomSpeed)),X(y.y),v.copy(S)}function _e(q){n.enableZoom&&Ze(q),n.enablePan&&Ne(q)}function it(q){n.enableZoom&&Ze(q),n.enableRotate&&Mt(q)}function Ue(q){n.enabled!==!1&&(B.length===0&&(n.domElement.setPointerCapture(q.pointerId),n.domElement.addEventListener("pointermove",He),n.domElement.addEventListener("pointerup",$e)),xe(q),q.pointerType==="touch"?se(q):lt(q))}function He(q){n.enabled!==!1&&(q.pointerType==="touch"?Ce(q):mt(q))}function $e(q){We(q),B.length===0&&(n.domElement.releasePointerCapture(q.pointerId),n.domElement.removeEventListener("pointermove",He),n.domElement.removeEventListener("pointerup",$e)),n.dispatchEvent(gE),o=r.NONE}function lt(q){let Me;switch(q.button){case 0:Me=n.mouseButtons.LEFT;break;case 1:Me=n.mouseButtons.MIDDLE;break;case 2:Me=n.mouseButtons.RIGHT;break;default:Me=-1}switch(Me){case Wo.DOLLY:if(n.enableZoom===!1)return;D(q),o=r.DOLLY;break;case Wo.ROTATE:if(q.ctrlKey||q.metaKey||q.shiftKey){if(n.enablePan===!1)return;G(q),o=r.PAN}else{if(n.enableRotate===!1)return;U(q),o=r.ROTATE}break;case Wo.PAN:if(q.ctrlKey||q.metaKey||q.shiftKey){if(n.enableRotate===!1)return;U(q),o=r.ROTATE}else{if(n.enablePan===!1)return;G(q),o=r.PAN}break;default:o=r.NONE}o!==r.NONE&&n.dispatchEvent(rp)}function mt(q){switch(o){case r.ROTATE:if(n.enableRotate===!1)return;K(q);break;case r.DOLLY:if(n.enableZoom===!1)return;J(q);break;case r.PAN:if(n.enablePan===!1)return;Ae(q);break}}function H(q){n.enabled===!1||n.enableZoom===!1||o!==r.NONE||(q.preventDefault(),n.dispatchEvent(rp),ge(q),n.dispatchEvent(gE))}function Q(q){n.enabled===!1||n.enablePan===!1||be(q)}function se(q){switch(Se(q),B.length){case 1:switch(n.touches.ONE){case jo.ROTATE:if(n.enableRotate===!1)return;de(),o=r.TOUCH_ROTATE;break;case jo.PAN:if(n.enablePan===!1)return;Oe(),o=r.TOUCH_PAN;break;default:o=r.NONE}break;case 2:switch(n.touches.TWO){case jo.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ot(),o=r.TOUCH_DOLLY_PAN;break;case jo.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;oe(),o=r.TOUCH_DOLLY_ROTATE;break;default:o=r.NONE}break;default:o=r.NONE}o!==r.NONE&&n.dispatchEvent(rp)}function Ce(q){switch(Se(q),o){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;Mt(q),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;Ne(q),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;_e(q),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;it(q),n.update();break;default:o=r.NONE}}function me(q){n.enabled!==!1&&q.preventDefault()}function xe(q){B.push(q)}function We(q){delete L[q.pointerId];for(let Me=0;Me<B.length;Me++)if(B[Me].pointerId==q.pointerId){B.splice(Me,1);return}}function Se(q){let Me=L[q.pointerId];Me===void 0&&(Me=new Ke,L[q.pointerId]=Me),Me.set(q.pageX,q.pageY)}function Re(q){const Me=q.pointerId===B[0].pointerId?B[1]:B[0];return L[Me.pointerId]}n.domElement.addEventListener("contextmenu",me),n.domElement.addEventListener("pointerdown",Ue),n.domElement.addEventListener("pointercancel",$e),n.domElement.addEventListener("wheel",H,{passive:!1}),this.update()}}function vE(i,e){if(e===HM)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===cA||e===b1){let t=i.getIndex();if(t===null){const l=[],c=i.getAttribute("position");if(c!==void 0){for(let f=0;f<c.count;f++)l.push(f);i.setIndex(l),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===cA)for(let l=1;l<=n;l++)r.push(t.getX(0)),r.push(t.getX(l)),r.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(r.push(t.getX(l)),r.push(t.getX(l+1)),r.push(t.getX(l+2))):(r.push(t.getX(l+2)),r.push(t.getX(l+1)),r.push(t.getX(l)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Bb extends _s{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Nb(t)}),this.register(function(t){return new Gb(t)}),this.register(function(t){return new Hb(t)}),this.register(function(t){return new Vb(t)}),this.register(function(t){return new Ub(t)}),this.register(function(t){return new kb(t)}),this.register(function(t){return new Fb(t)}),this.register(function(t){return new Qb(t)}),this.register(function(t){return new Db(t)}),this.register(function(t){return new Ob(t)}),this.register(function(t){return new Pb(t)}),this.register(function(t){return new zb(t)}),this.register(function(t){return new bb(t)}),this.register(function(t){return new Wb(t)}),this.register(function(t){return new jb(t)})}load(e,t,n,r){const o=this;let l;this.resourcePath!==""?l=this.resourcePath:this.path!==""?l=this.path:l=tp.extractUrlBase(e),this.manager.itemStart(e);const c=function(u){r?r(u):console.error(u),o.manager.itemError(e),o.manager.itemEnd(e)},f=new wa(this.manager);f.setPath(this.path),f.setResponseType("arraybuffer"),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(u){try{o.parse(u,l,function(d){t(d),o.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,r){let o;const l={},c={},f=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(f.decode(new Uint8Array(e,0,4))===_E){try{l[wt.KHR_BINARY_GLTF]=new Yb(e)}catch(p){r&&r(p);return}o=JSON.parse(l[wt.KHR_BINARY_GLTF].content)}else o=JSON.parse(f.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new o5(o,{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 p=this.pluginCallbacks[d](u);p.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[p.name]=p,l[p.name]=!0}if(o.extensionsUsed)for(let d=0;d<o.extensionsUsed.length;++d){const p=o.extensionsUsed[d],A=o.extensionsRequired||[];switch(p){case wt.KHR_MATERIALS_UNLIT:l[p]=new Lb;break;case wt.KHR_DRACO_MESH_COMPRESSION:l[p]=new qb(o,this.dracoLoader);break;case wt.KHR_TEXTURE_TRANSFORM:l[p]=new Xb;break;case wt.KHR_MESH_QUANTIZATION:l[p]=new Kb;break;default:A.indexOf(p)>=0&&c[p]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+p+'".')}}u.setExtensions(l),u.setPlugins(c),u.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function Rb(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const wt={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_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 bb{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,f=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let u;const d=new tt(16777215);f.color!==void 0&&d.setRGB(f.color[0],f.color[1],f.color[2],En);const p=f.range!==void 0?f.range:0;switch(f.type){case"directional":u=new pb(d),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new db(d),u.distance=p;break;case"spot":u=new fb(d),u.distance=p,f.spot=f.spot||{},f.spot.innerConeAngle=f.spot.innerConeAngle!==void 0?f.spot.innerConeAngle:0,f.spot.outerConeAngle=f.spot.outerConeAngle!==void 0?f.spot.outerConeAngle:Math.PI/4,u.angle=f.spot.outerConeAngle,u.penumbra=1-f.spot.innerConeAngle/f.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+f.type)}return u.position.set(0,0,0),u.decay=2,ys(u,f),f.intensity!==void 0&&(u.intensity=f.intensity),u.name=t.createUniqueName(f.name||"light_"+e),r=Promise.resolve(u),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(f){return n._getNodeRef(t.cache,c,f)})}}class Lb{constructor(){this.name=wt.KHR_MATERIALS_UNLIT}getMaterialType(){return Gr}extendParams(e,t,n){const r=[];e.color=new tt(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],En),e.opacity=l[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,Xt))}return Promise.all(r)}}class Db{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Nb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const c=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ke(c,c)}return Promise.all(o)}}class Pb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class Ub{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new tt(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=r.extensions[this.name];if(l.sheenColorFactor!==void 0){const c=l.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],En)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,Xt)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class kb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class Fb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const c=l.attenuationColor||[1,1,1];return t.attenuationColor=new tt().setRGB(c[0],c[1],c[2],En),Promise.all(o)}}class Qb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class Ob{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const c=l.specularColorFactor||[1,1,1];return t.specularColor=new tt().setRGB(c[0],c[1],c[2],En),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,Xt)),Promise.all(o)}}class zb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class Gb{constructor(e){this.parser=e,this.name=wt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const o=r.extensions[this.name],l=t.options.ktx2Loader;if(!l){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,o.source,l)}}class Hb{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],c=r.images[l.source];let f=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(f=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,l.source,f);if(r.extensionsRequired&&r.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 Vb{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],c=r.images[l.source];let f=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(f=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,l.source,f);if(r.extensionsRequired&&r.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 Wb{constructor(e){this.name=wt.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 r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(c){const f=r.byteOffset||0,u=r.byteLength||0,d=r.count,p=r.byteStride,A=new Uint8Array(c,f,u);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(d,p,A,r.mode,r.filter).then(function(g){return g.buffer}):l.ready.then(function(){const g=new ArrayBuffer(d*p);return l.decodeGltfBuffer(new Uint8Array(g),d,p,A,r.mode,r.filter),g})})}else return null}}class jb{constructor(e){this.name=wt.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 r=t.meshes[n.mesh];for(const u of r.primitives)if(u.mode!==Ui.TRIANGLES&&u.mode!==Ui.TRIANGLE_STRIP&&u.mode!==Ui.TRIANGLE_FAN&&u.mode!==void 0)return null;const l=n.extensions[this.name].attributes,c=[],f={};for(const u in l)c.push(this.parser.getDependency("accessor",l[u]).then(d=>(f[u]=d,f[u])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(u=>{const d=u.pop(),p=d.isGroup?d.children:[d],A=u[0].count,g=[];for(const E of p){const C=new ct,_=new j,v=new pr,S=new j(1,1,1),y=new VR(E.geometry,E.material,A);for(let x=0;x<A;x++)f.TRANSLATION&&_.fromBufferAttribute(f.TRANSLATION,x),f.ROTATION&&v.fromBufferAttribute(f.ROTATION,x),f.SCALE&&S.fromBufferAttribute(f.SCALE,x),y.setMatrixAt(x,C.compose(_,v,S));for(const x in f)if(x==="_COLOR_0"){const w=f[x];y.instanceColor=new jA(w.array,w.itemSize,w.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&E.geometry.setAttribute(x,f[x]);tn.prototype.copy.call(y,E),this.parser.assignFinalMaterial(y),g.push(y)}return d.isGroup?(d.clear(),d.add(...g),d):g[0]}))}}const _E="glTF",$l=12,EE={JSON:1313821514,BIN:5130562};class Yb{constructor(e){this.name=wt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,$l),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!==_E)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-$l,o=new DataView(e,$l);let l=0;for(;l<r;){const c=o.getUint32(l,!0);l+=4;const f=o.getUint32(l,!0);if(l+=4,f===EE.JSON){const u=new Uint8Array(e,$l+l,c);this.content=n.decode(u)}else if(f===EE.BIN){const u=$l+l;this.body=e.slice(u,u+c)}l+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class qb{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=wt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,c={},f={},u={};for(const d in l){const p=op[d]||d.toLowerCase();c[p]=l[d]}for(const d in e.attributes){const p=op[d]||d.toLowerCase();if(l[d]!==void 0){const A=n.accessors[e.attributes[d]],g=Ma[A.componentType];u[p]=g.name,f[p]=A.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(p){r.decodeDracoFile(d,function(A){for(const g in A.attributes){const E=A.attributes[g],C=f[g];C!==void 0&&(E.normalized=C)}p(A)},c,u)})})}}class Xb{constructor(){this.name=wt.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 Kb{constructor(){this.name=wt.KHR_MESH_QUANTIZATION}}class yE extends Jl{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let l=0;l!==r;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=c*2,u=c*3,d=r-t,p=(n-t)/d,A=p*p,g=A*p,E=e*u,C=E-u,_=-2*g+3*A,v=g-A,S=1-_,y=v-A+p;for(let x=0;x!==c;x++){const w=l[C+x+c],b=l[C+x+f]*d,B=l[E+x+c],L=l[E+x]*d;o[x]=S*w+y*b+_*B+v*L}return o}}const Jb=new pr;class Zb extends yE{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return Jb.fromArray(o).normalize().toArray(o),o}}const Ui={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},Ma={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},CE={9728:qt,9729:un,9984:Zd,9985:r1,9986:cu,9987:Pr},IE={33071:Fn,33648:lu,10497:Xo},sp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},op={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"},Es={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},$b={CUBICSPLINE:void 0,LINEAR:Jo,STEP:Pl},ap={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function e5(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new KA({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ji})),i.DefaultMaterial}function Eo(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ys(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function t5(i,e,t){let n=!1,r=!1,o=!1;for(let u=0,d=e.length;u<d;u++){const p=e[u];if(p.POSITION!==void 0&&(n=!0),p.NORMAL!==void 0&&(r=!0),p.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const l=[],c=[],f=[];for(let u=0,d=e.length;u<d;u++){const p=e[u];if(n){const A=p.POSITION!==void 0?t.getDependency("accessor",p.POSITION):i.attributes.position;l.push(A)}if(r){const A=p.NORMAL!==void 0?t.getDependency("accessor",p.NORMAL):i.attributes.normal;c.push(A)}if(o){const A=p.COLOR_0!==void 0?t.getDependency("accessor",p.COLOR_0):i.attributes.color;f.push(A)}}return Promise.all([Promise.all(l),Promise.all(c),Promise.all(f)]).then(function(u){const d=u[0],p=u[1],A=u[2];return n&&(i.morphAttributes.position=d),r&&(i.morphAttributes.normal=p),o&&(i.morphAttributes.color=A),i.morphTargetsRelative=!0,i})}function n5(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function i5(i){let e;const t=i.extensions&&i.extensions[wt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+lp(t.attributes):e=i.indices+":"+lp(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+lp(i.targets[n]);return e}function lp(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function cp(i){switch(i){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 r5(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const s5=new ct;class o5{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Rb,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,r=!1,o=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,o=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||r&&o<98?this.textureLoader=new lE(this.options.manager):this.textureLoader=new gb(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new wa(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,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const c={scene:l[0][r.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:r.asset,parser:n,userData:{}};return Eo(o,c,r),ys(c,r),Promise.all(n._invokeAll(function(f){return f.afterRoot&&f.afterRoot(c)})).then(function(){e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const l=t[r].joints;for(let c=0,f=l.length;c<f;c++)e[l[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const l=e[r];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.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 r=n.clone(),o=(l,c)=>{const f=this.associations.get(l);f!=null&&this.associations.set(c,f);for(const[u,d]of l.children.entries())o(d,c.children[u])};return o(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const o=e(t[r]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,l){return n.getDependency(e,l)})),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[wt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,l){n.load(tp.resolveURL(t.uri,r.path),o,void 0,function(){l(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 r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const l=sp[r.type],c=Ma[r.componentType],f=r.normalized===!0,u=new c(r.count*l);return Promise.resolve(new bn(u,l,f))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(l){const c=l[0],f=sp[r.type],u=Ma[r.componentType],d=u.BYTES_PER_ELEMENT,p=d*f,A=r.byteOffset||0,g=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,E=r.normalized===!0;let C,_;if(g&&g!==p){const v=Math.floor(A/g),S="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let y=t.cache.get(S);y||(C=new u(c,v*g,r.count*g/d),y=new QR(C,g/d),t.cache.add(S,y)),_=new GA(y,f,A%g/d,E)}else c===null?C=new u(r.count*f):C=new u(c,A,r.count*f),_=new bn(C,f,E);if(r.sparse!==void 0){const v=sp.SCALAR,S=Ma[r.sparse.indices.componentType],y=r.sparse.indices.byteOffset||0,x=r.sparse.values.byteOffset||0,w=new S(l[1],y,r.sparse.count*v),b=new u(l[2],x,r.sparse.count*f);c!==null&&(_=new bn(_.array.slice(),_.itemSize,_.normalized));for(let B=0,L=w.length;B<L;B++){const R=w[B];if(_.setX(R,b[B*f]),f>=2&&_.setY(R,b[B*f+1]),f>=3&&_.setZ(R,b[B*f+2]),f>=4&&_.setW(R,b[B*f+3]),f>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let c=this.textureLoader;if(l.uri){const f=n.manager.getHandler(l.uri);f!==null&&(c=f)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,l=o.textures[e],c=o.images[t],f=(c.uri||c.bufferView)+":"+l.sampler;if(this.textureCache[f])return this.textureCache[f];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=l.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(o.samplers||{})[l.sampler]||{};return d.magFilter=CE[A.magFilter]||un,d.minFilter=CE[A.minFilter]||Pr,d.wrapS=IE[A.wrapS]||Xo,d.wrapT=IE[A.wrapT]||Xo,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[f]=u,u}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(p=>p.clone());const l=r.images[e],c=self.URL||self.webkitURL;let f=l.uri||"",u=!1;if(l.bufferView!==void 0)f=n.getDependency("bufferView",l.bufferView).then(function(p){u=!0;const A=new Blob([p],{type:l.mimeType});return f=c.createObjectURL(A),f});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(f).then(function(p){return new Promise(function(A,g){let E=A;t.isImageBitmapLoader===!0&&(E=function(C){const _=new Rn(C);_.needsUpdate=!0,A(_)}),t.load(tp.resolveURL(p,o.path),E,void 0,g)})}).then(function(p){return u===!0&&c.revokeObjectURL(f),p.userData.mimeType=l.mimeType||r5(l.uri),p}).catch(function(p){throw console.error("THREE.GLTFLoader: Couldn't load texture",f),p});return this.sourceCache[e]=d,d}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[wt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const f=o.associations.get(l);l=o.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(l,c),o.associations.set(l,f)}}return r!==void 0&&(l.colorSpace=r),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let f=this.cache.get(c);f||(f=new tE,gr.prototype.copy.call(f,n),f.color.copy(n.color),f.map=n.map,f.sizeAttenuation=!1,this.cache.add(c,f)),n=f}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let f=this.cache.get(c);f||(f=new X_,gr.prototype.copy.call(f,n),f.color.copy(n.color),f.map=n.map,this.cache.add(c,f)),n=f}if(r||o||l){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),l&&(c+="flat-shading:");let f=this.cache.get(c);f||(f=n.clone(),o&&(f.vertexColors=!0),l&&(f.flatShading=!0),r&&(f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(n))),n=f}e.material=n}getMaterialType(){return KA}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let l;const c={},f=o.extensions||{},u=[];if(f[wt.KHR_MATERIALS_UNLIT]){const p=r[wt.KHR_MATERIALS_UNLIT];l=p.getMaterialType(),u.push(p.extendParams(c,o,t))}else{const p=o.pbrMetallicRoughness||{};if(c.color=new tt(1,1,1),c.opacity=1,Array.isArray(p.baseColorFactor)){const A=p.baseColorFactor;c.color.setRGB(A[0],A[1],A[2],En),c.opacity=A[3]}p.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",p.baseColorTexture,Xt)),c.metalness=p.metallicFactor!==void 0?p.metallicFactor:1,c.roughness=p.roughnessFactor!==void 0?p.roughnessFactor:1,p.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",p.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",p.metallicRoughnessTexture))),l=this._invokeOne(function(A){return A.getMaterialType&&A.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(A){return A.extendMaterialParams&&A.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=Yi);const d=o.alphaMode||ap.OPAQUE;if(d===ap.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===ap.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==Gr&&(u.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new Ke(1,1),o.normalTexture.scale!==void 0)){const p=o.normalTexture.scale;c.normalScale.set(p,p)}if(o.occlusionTexture!==void 0&&l!==Gr&&(u.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==Gr){const p=o.emissiveFactor;c.emissive=new tt().setRGB(p[0],p[1],p[2],En)}return o.emissiveTexture!==void 0&&l!==Gr&&u.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,Xt)),Promise.all(u).then(function(){const p=new l(c);return o.name&&(p.name=o.name),ys(p,o),t.associations.set(p,{materials:e}),o.extensions&&Eo(r,p,o),p})}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,r=this.primitiveCache;function o(c){return n[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(f){return xE(f,c,t)})}const l=[];for(let c=0,f=e.length;c<f;c++){const u=e[c],d=i5(u),p=r[d];if(p)l.push(p.promise);else{let A;u.extensions&&u.extensions[wt.KHR_DRACO_MESH_COMPRESSION]?A=o(u):A=xE(new xi,u,t),r[d]={primitive:u,promise:A},l.push(A)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],l=o.primitives,c=[];for(let f=0,u=l.length;f<u;f++){const d=l[f].material===void 0?e5(this.cache):this.getDependency("material",l[f].material);c.push(d)}return c.push(t.loadGeometries(l)),Promise.all(c).then(function(f){const u=f.slice(0,f.length-1),d=f[f.length-1],p=[];for(let g=0,E=d.length;g<E;g++){const C=d[g],_=l[g];let v;const S=u[g];if(_.mode===Ui.TRIANGLES||_.mode===Ui.TRIANGLE_STRIP||_.mode===Ui.TRIANGLE_FAN||_.mode===void 0)v=o.isSkinnedMesh===!0?new zR(C,S):new Wn(C,S),v.isSkinnedMesh===!0&&v.normalizeSkinWeights(),_.mode===Ui.TRIANGLE_STRIP?v.geometry=vE(v.geometry,b1):_.mode===Ui.TRIANGLE_FAN&&(v.geometry=vE(v.geometry,cA));else if(_.mode===Ui.LINES)v=new WR(C,S);else if(_.mode===Ui.LINE_STRIP)v=new qA(C,S);else if(_.mode===Ui.LINE_LOOP)v=new jR(C,S);else if(_.mode===Ui.POINTS)v=new YR(C,S);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(v.geometry.morphAttributes).length>0&&n5(v,o),v.name=t.createUniqueName(o.name||"mesh_"+e),ys(v,o),_.extensions&&Eo(r,v,_),t.assignFinalMaterial(v),p.push(v)}for(let g=0,E=p.length;g<E;g++)t.associations.set(p[g],{meshes:e,primitives:g});if(p.length===1)return o.extensions&&Eo(r,p[0],o),p[0];const A=new vs;o.extensions&&Eo(r,A,o),t.associations.set(A,{meshes:e});for(let g=0,E=p.length;g<E;g++)A.add(p[g]);return A})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new $n(AA.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new Yl(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ys(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),l=r,c=[],f=[];for(let u=0,d=l.length;u<d;u++){const p=l[u];if(p){c.push(p);const A=new ct;o!==null&&A.fromArray(o.array,u*16),f.push(A)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new WA(c,f)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,l=[],c=[],f=[],u=[],d=[];for(let p=0,A=r.channels.length;p<A;p++){const g=r.channels[p],E=r.samplers[g.sampler],C=g.target,_=C.node,v=r.parameters!==void 0?r.parameters[E.input]:E.input,S=r.parameters!==void 0?r.parameters[E.output]:E.output;C.node!==void 0&&(l.push(this.getDependency("node",_)),c.push(this.getDependency("accessor",v)),f.push(this.getDependency("accessor",S)),u.push(E),d.push(C))}return Promise.all([Promise.all(l),Promise.all(c),Promise.all(f),Promise.all(u),Promise.all(d)]).then(function(p){const A=p[0],g=p[1],E=p[2],C=p[3],_=p[4],v=[];for(let S=0,y=A.length;S<y;S++){const x=A[S],w=g[S],b=E[S],B=C[S],L=_[S];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const R=n._createAnimationTracks(x,w,b,B,L);if(R)for(let T=0;T<R.length;T++)v.push(R[T])}return new ib(o,void 0,v)})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&l.traverse(function(c){if(c.isMesh)for(let f=0,u=r.weights.length;f<u;f++)c.morphTargetInfluences[f]=r.weights[f]}),l})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),l=[],c=r.children||[];for(let u=0,d=c.length;u<d;u++)l.push(n.getDependency("node",c[u]));const f=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(l),f]).then(function(u){const d=u[0],p=u[1],A=u[2];A!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(A,s5)});for(let g=0,E=p.length;g<E;g++)d.add(p[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?r.createUniqueName(o.name):"",c=[],f=r._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return f&&c.push(f),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(u){return r._getNodeRef(r.cameraCache,o.camera,u)})),r._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(o.isBone===!0?d=new W_:u.length>1?d=new vs:u.length===1?d=u[0]:d=new tn,d!==u[0])for(let p=0,A=u.length;p<A;p++)d.add(u[p]);if(o.name&&(d.userData.name=o.name,d.name=l),ys(d,o),o.extensions&&Eo(n,d,o),o.matrix!==void 0){const p=new ct;p.fromArray(o.matrix),d.applyMatrix4(p)}else o.translation!==void 0&&d.position.fromArray(o.translation),o.rotation!==void 0&&d.quaternion.fromArray(o.rotation),o.scale!==void 0&&d.scale.fromArray(o.scale);return r.associations.has(d)||r.associations.set(d,{}),r.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new vs;n.name&&(o.name=r.createUniqueName(n.name)),ys(o,n),n.extensions&&Eo(t,o,n);const l=n.nodes||[],c=[];for(let f=0,u=l.length;f<u;f++)c.push(r.getDependency("node",l[f]));return Promise.all(c).then(function(f){for(let d=0,p=f.length;d<p;d++)o.add(f[d]);const u=d=>{const p=new Map;for(const[A,g]of r.associations)(A instanceof gr||A instanceof Rn)&&p.set(A,g);return d.traverse(A=>{const g=r.associations.get(A);g!=null&&p.set(A,g)}),p};return r.associations=u(o),o})}_createAnimationTracks(e,t,n,r,o){const l=[],c=e.name?e.name:e.uuid,f=[];Es[o.path]===Es.weights?e.traverse(function(A){A.morphTargetInfluences&&f.push(A.name?A.name:A.uuid)}):f.push(c);let u;switch(Es[o.path]){case Es.weights:u=Ca;break;case Es.rotation:u=_o;break;case Es.position:case Es.scale:u=xa;break;default:switch(n.itemSize){case 1:u=Ca;break;case 2:case 3:default:u=xa;break}break}const d=r.interpolation!==void 0?$b[r.interpolation]:Jo,p=this._getArrayFromAccessor(n);for(let A=0,g=f.length;A<g;A++){const E=new u(f[A]+"."+Es[o.path],t.array,p,d);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),l.push(E)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=cp(t.constructor),r=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof _o?Zb:yE;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function a5(i,e,t){const n=e.attributes,r=new gn;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],f=c.min,u=c.max;if(f!==void 0&&u!==void 0){if(r.set(new j(f[0],f[1],f[2]),new j(u[0],u[1],u[2])),c.normalized){const d=cp(Ma[c.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new j,f=new j;for(let u=0,d=o.length;u<d;u++){const p=o[u];if(p.POSITION!==void 0){const A=t.json.accessors[p.POSITION],g=A.min,E=A.max;if(g!==void 0&&E!==void 0){if(f.setX(Math.max(Math.abs(g[0]),Math.abs(E[0]))),f.setY(Math.max(Math.abs(g[1]),Math.abs(E[1]))),f.setZ(Math.max(Math.abs(g[2]),Math.abs(E[2]))),A.normalized){const C=cp(Ma[A.componentType]);f.multiplyScalar(C)}c.max(f)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const l=new Ji;r.getCenter(l.center),l.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=l}function xE(i,e,t){const n=e.attributes,r=[];function o(l,c){return t.getDependency("accessor",l).then(function(f){i.setAttribute(c,f)})}for(const l in n){const c=op[l]||l.toLowerCase();c in i.attributes||r.push(o(n[l],c))}if(e.indices!==void 0&&!i.index){const l=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(l)}return Nt.workingColorSpace!==En&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Nt.workingColorSpace}" not supported.`),ys(i,e),a5(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?t5(i,e.targets,t):i})}class l5{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:r,msg:o,transfer:l}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,l)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].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 c5=0,SE=2,u5=1,wE=2,f5=0,h5=1,d5=10,A5=0,ME=9,TE=15,BE=16,RE=22,bE=37,LE=43,DE=76,NE=83,PE=97,UE=100,kE=103,FE=109,QE=165,OE=166;class p5{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 ec{constructor(e,t,n,r){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,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 r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const ti=[171,75,84,88,32,50,48,187,13,10,26,10];function zE(i){return typeof TextDecoder<"u"?new TextDecoder().decode(i):Buffer.from(i).toString("utf8")}function g5(i){const e=new Uint8Array(i.buffer,i.byteOffset,ti.length);if(e[0]!==ti[0]||e[1]!==ti[1]||e[2]!==ti[2]||e[3]!==ti[3]||e[4]!==ti[4]||e[5]!==ti[5]||e[6]!==ti[6]||e[7]!==ti[7]||e[8]!==ti[8]||e[9]!==ti[9]||e[10]!==ti[10]||e[11]!==ti[11])throw new Error("Missing KTX 2.0 identifier.");const t=new p5,n=17*Uint32Array.BYTES_PER_ELEMENT,r=new ec(i,ti.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32();const o=r._nextUint32();t.supercompressionScheme=r._nextUint32();const l=r._nextUint32(),c=r._nextUint32(),f=r._nextUint32(),u=r._nextUint32(),d=r._nextUint64(),p=r._nextUint64(),A=new ec(i,ti.length+n,3*o*8,!0);for(let te=0;te<o;te++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+A._nextUint64(),A._nextUint64()),uncompressedByteLength:A._nextUint64()});const g=new ec(i,l,c,!0),E={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:[]},C=(E.descriptorBlockSize/4-6)/4;for(let te=0;te<C;te++){const Y={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&Y.channelType?(Y.sampleLower=g._nextInt32(),Y.sampleUpper=g._nextInt32()):(Y.sampleLower=g._nextUint32(),Y.sampleUpper=g._nextUint32()),E.samples[te]=Y}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const _=new ec(i,f,u,!0);for(;_._offset<u;){const te=_._nextUint32(),Y=_._scan(te),$=zE(Y),U=_._scan(te-Y.byteLength);t.keyValue[$]=$.match(/^ktx/i)?zE(U):U,_._offset%4&&_._skip(4-_._offset%4)}if(p<=0)return t;const v=new ec(i,d,p,!0),S=v._nextUint16(),y=v._nextUint16(),x=v._nextUint32(),w=v._nextUint32(),b=v._nextUint32(),B=v._nextUint32(),L=[];for(let te=0;te<o;te++)L.push({imageFlags:v._nextUint32(),rgbSliceByteOffset:v._nextUint32(),rgbSliceByteLength:v._nextUint32(),alphaSliceByteOffset:v._nextUint32(),alphaSliceByteLength:v._nextUint32()});const R=d+v._offset,T=R+x,N=T+w,k=N+b,O=new Uint8Array(i.buffer,i.byteOffset+R,x),F=new Uint8Array(i.buffer,i.byteOffset+T,w),V=new Uint8Array(i.buffer,i.byteOffset+N,b),X=new Uint8Array(i.buffer,i.byteOffset+k,B);return t.globalData={endpointCount:S,selectorCount:y,imageDescs:L,endpointsData:O,selectorsData:F,tablesData:V,extendedData:X},t}let up,jr,fp;const hp={env:{emscripten_notify_memory_growth:function(i){fp=new Uint8Array(jr.exports.memory.buffer)}}};class m5{init(){return up||(up=typeof fetch<"u"?fetch("data:application/wasm;base64,"+GE).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,hp)).then(this._init):WebAssembly.instantiate(Buffer.from(GE,"base64"),hp).then(this._init),up)}_init(e){jr=e.instance,hp.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!jr)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=jr.exports.malloc(n);fp.set(e,r),t=t||Number(jr.exports.ZSTD_findDecompressedSize(r,n));const o=jr.exports.malloc(t),l=jr.exports.ZSTD_decompress(o,t,r,n),c=fp.slice(o,o+l);return jr.exports.free(r),jr.exports.free(o),c}}const GE="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",dp=new WeakMap;let Ap=0,pp;class yr extends _s{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new l5,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}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(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")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const e=new wa(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new wa(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([o,l])=>{const c=yr.BasisWorker.toString(),f=["/* constants */","let _EngineFormat = "+JSON.stringify(yr.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(yr.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(yr.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3621
- `);this.workerSourceURL=URL.createObjectURL(new Blob([f])),this.transcoderBinary=l,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})}),Ap>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Ap++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new wa(this.manager);o.setResponseType("arraybuffer"),o.setWithCredentials(this.withCredentials),o.load(e,l=>{if(dp.has(l))return dp.get(l).promise.then(t).catch(r);this._createTexture(l).then(c=>t?t(c):null).catch(r)},n,r)}_createTextureFrom(e,t){const{faces:n,width:r,height:o,format:l,type:c,error:f,dfdFlags:u}=e;if(c==="error")return Promise.reject(f);let d;if(t.faceCount===6)d=new XR(n,l,fn);else{const p=n[0].mipmaps;d=t.layerCount>1?new qR(p,r,o,t.layerCount,l,fn):new tf(p,r,o,l,fn)}return d.minFilter=n[0].mipmaps.length===1?un:Pr,d.magFilter=un,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=HE(t),d.premultiplyAlpha=!!(u&u5),d}async _createTexture(e,t={}){const n=g5(new Uint8Array(e));if(n.vkFormat!==A5)return _5(n);const r=t,o=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:r},[e])).then(l=>this._createTextureFrom(l.data,n));return dp.set(e,{promise:o}),o}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Ap--,this}}yr.BasisFormat={ETC1S:0,UASTC_4x4:1},yr.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},yr.EngineFormat={RGBAFormat:on,RGBA_ASTC_4x4_Format:aA,RGBA_BPTC_Format:pu,RGBA_ETC2_EAC_Format:oA,RGBA_PVRTC_4BPPV1_Format:rA,RGBA_S3TC_DXT5_Format:du,RGB_ETC1_Format:u1,RGB_ETC2_Format:sA,RGB_PVRTC_4BPPV1_Format:iA,RGB_S3TC_DXT1_Format:hu},yr.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(E){const C=E.data;switch(C.type){case"init":i=C.config,l(C.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:_,buffers:v,width:S,height:y,hasAlpha:x,format:w,dfdFlags:b}=c(C.buffer);self.postMessage({type:"transcode",id:C.id,faces:_,width:S,height:y,hasAlpha:x,format:w,dfdFlags:b},v)}catch(_){console.error(_),self.postMessage({type:"error",id:C.id,error:_.message})}});break}});function l(E){e=new Promise(C=>{t={wasmBinary:E,onRuntimeInitialized:C},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(E){const C=new t.KTX2File(new Uint8Array(E));function _(){C.close(),C.delete()}if(!C.isValid())throw _(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const v=C.isUASTC()?o.UASTC_4x4:o.ETC1S,S=C.getWidth(),y=C.getHeight(),x=C.getLayers()||1,w=C.getLevels(),b=C.getFaces(),B=C.getHasAlpha(),L=C.getDFDFlags(),{transcoderFormat:R,engineFormat:T}=p(v,S,y,B);if(!S||!y||!w)throw _(),new Error("THREE.KTX2Loader: Invalid texture");if(!C.startTranscoding())throw _(),new Error("THREE.KTX2Loader: .startTranscoding failed");const N=[],k=[];for(let O=0;O<b;O++){const F=[];for(let V=0;V<w;V++){const X=[];let te,Y;for(let U=0;U<x;U++){const D=C.getImageLevelInfo(V,U,O);O===0&&V===0&&U===0&&(D.origWidth%4!==0||D.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?(te=D.origWidth,Y=D.origHeight):(te=D.width,Y=D.height);const G=new Uint8Array(C.getImageTranscodedSizeInBytes(V,U,0,R));if(!C.transcodeImage(G,V,U,O,R,0,-1,-1))throw _(),new Error("THREE.KTX2Loader: .transcodeImage failed.");X.push(G)}const $=g(X);F.push({data:$,width:te,height:Y}),k.push($.buffer)}N.push({mipmaps:F,width:S,height:y,format:T})}return _(),{faces:N,buffers:k,width:S,height:y,hasAlpha:B,format:T,dfdFlags:L}}const f=[{if:"astcSupported",basisFormat:[o.UASTC_4x4],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.BC1,r.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=f.sort(function(E,C){return E.priorityETC1S-C.priorityETC1S}),d=f.sort(function(E,C){return E.priorityUASTC-C.priorityUASTC});function p(E,C,_,v){let S,y;const x=E===o.ETC1S?u:d;for(let w=0;w<x.length;w++){const b=x[w];if(i[b.if]&&b.basisFormat.includes(E)&&!(v&&b.transcoderFormat.length<2)&&!(b.needsPowerOfTwo&&!(A(C)&&A(_))))return S=b.transcoderFormat[v?1:0],y=b.engineFormat[v?1:0],{transcoderFormat:S,engineFormat:y}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),S=r.RGBA32,y=n.RGBAFormat,{transcoderFormat:S,engineFormat:y}}function A(E){return E<=2?!0:(E&E-1)===0&&E!==0}function g(E){if(E.length===1)return E[0];let C=0;for(let S=0;S<E.length;S++){const y=E[S];C+=y.byteLength}const _=new Uint8Array(C);let v=0;for(let S=0;S<E.length;S++){const y=E[S];_.set(y,v),v+=y.byteLength}return _}};const v5=new Set([on,co,lo]),gp={[FE]:on,[PE]:on,[bE]:on,[LE]:on,[kE]:co,[NE]:co,[BE]:co,[RE]:co,[UE]:lo,[DE]:lo,[TE]:lo,[ME]:lo,[OE]:Au,[QE]:Au},mp={[FE]:hn,[PE]:Jn,[bE]:fn,[LE]:fn,[kE]:hn,[NE]:Jn,[BE]:fn,[RE]:fn,[UE]:hn,[DE]:Jn,[TE]:fn,[ME]:fn,[OE]:fn,[QE]:fn};async function _5(i){const{vkFormat:e}=i;if(gp[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;i.supercompressionScheme===SE&&(pp||(pp=new Promise(async o=>{const l=new m5;await l.init(),o(l)})),t=await pp);const n=[];for(let o=0;o<i.levels.length;o++){const l=Math.max(1,i.pixelWidth>>o),c=Math.max(1,i.pixelHeight>>o),f=i.pixelDepth?Math.max(1,i.pixelDepth>>o):0,u=i.levels[o];let d;if(i.supercompressionScheme===c5)d=u.levelData;else if(i.supercompressionScheme===SE)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let p;mp[e]===hn?p=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):mp[e]===Jn?p=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):p=d,n.push({data:p,width:l,height:c,depth:f})}let r;if(v5.has(gp[e]))r=i.pixelDepth===0?new _a(n[0].data,i.pixelWidth,i.pixelHeight):new W1(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth);else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");r=new tf(n,i.pixelWidth,i.pixelHeight)}return r.mipmaps=n,r.type=mp[e],r.format=gp[e],r.colorSpace=HE(i),r.needsUpdate=!0,Promise.resolve(r)}function HE(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===h5?e.transferFunction===wE?Xt:En:e.colorPrimaries===d5?e.transferFunction===wE?gu:Ul:(e.colorPrimaries===f5||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ci)}class E5 extends cb{constructor(e){super(e),this.type=Jn}parse(e){const l=function(L,R){switch(L){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(R||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(R||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(R||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(R||""))}},d=`
3620
+ }`;function MR(i,e,t){let n=new DA;const r=new Ke,o=new Ke,l=new Gt,c=new F_({depthPacking:WM}),f=new xR,u={},d=t.maxTextureSize,p={[ji]:Bn,[Bn]:ji,[Yi]:Yi},A=new Si({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ke},radius:{value:4}},vertexShader:SR,fragmentShader:wR}),g=A.clone();g.defines.HORIZONTAL_PASS=1;const E=new xi;E.setAttribute("position",new bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new Wn(E,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=jv;let v=this.type;this.render=function(w,b,B){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||w.length===0)return;const L=i.getRenderTarget(),R=i.getActiveCubeFace(),T=i.getActiveMipmapLevel(),N=i.state;N.setBlending(Nr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const k=v!==Dr&&this.type===Dr,O=v===Dr&&this.type!==Dr;for(let F=0,V=w.length;F<V;F++){const X=w[F],te=X.shadow;if(te===void 0){console.warn("THREE.WebGLShadowMap:",X,"has no shadow.");continue}if(te.autoUpdate===!1&&te.needsUpdate===!1)continue;r.copy(te.mapSize);const q=te.getFrameExtents();if(r.multiply(q),o.copy(te.mapSize),(r.x>d||r.y>d)&&(r.x>d&&(o.x=Math.floor(d/q.x),r.x=o.x*q.x,te.mapSize.x=o.x),r.y>d&&(o.y=Math.floor(d/q.y),r.y=o.y*q.y,te.mapSize.y=o.y)),te.map===null||k===!0||O===!0){const U=this.type!==Dr?{minFilter:qt,magFilter:qt}:{};te.map!==null&&te.map.dispose(),te.map=new Xi(r.x,r.y,U),te.map.texture.name=X.name+".shadowMap",te.camera.updateProjectionMatrix()}i.setRenderTarget(te.map),i.clear();const Z=te.getViewportCount();for(let U=0;U<Z;U++){const D=te.getViewport(U);l.set(o.x*D.x,o.y*D.y,o.x*D.z,o.y*D.w),N.viewport(l),te.updateMatrices(X,U),n=te.getFrustum(),S(b,B,te.camera,X,this.type)}te.isPointLightShadow!==!0&&this.type===Dr&&x(te,B),te.needsUpdate=!1}v=this.type,_.needsUpdate=!1,i.setRenderTarget(L,R,T)};function x(w,b){const B=e.update(C);A.defines.VSM_SAMPLES!==w.blurSamples&&(A.defines.VSM_SAMPLES=w.blurSamples,g.defines.VSM_SAMPLES=w.blurSamples,A.needsUpdate=!0,g.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new Xi(r.x,r.y)),A.uniforms.shadow_pass.value=w.map.texture,A.uniforms.resolution.value=w.mapSize,A.uniforms.radius.value=w.radius,i.setRenderTarget(w.mapPass),i.clear(),i.renderBufferDirect(b,null,B,A,C,null),g.uniforms.shadow_pass.value=w.mapPass.texture,g.uniforms.resolution.value=w.mapSize,g.uniforms.radius.value=w.radius,i.setRenderTarget(w.map),i.clear(),i.renderBufferDirect(b,null,B,g,C,null)}function y(w,b,B,L){let R=null;const T=B.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(T!==void 0)R=T;else if(R=B.isPointLight===!0?f:c,i.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){const N=R.uuid,k=b.uuid;let O=u[N];O===void 0&&(O={},u[N]=O);let F=O[k];F===void 0&&(F=R.clone(),O[k]=F),R=F}if(R.visible=b.visible,R.wireframe=b.wireframe,L===Dr?R.side=b.shadowSide!==null?b.shadowSide:b.side:R.side=b.shadowSide!==null?b.shadowSide:p[b.side],R.alphaMap=b.alphaMap,R.alphaTest=b.alphaTest,R.map=b.map,R.clipShadows=b.clipShadows,R.clippingPlanes=b.clippingPlanes,R.clipIntersection=b.clipIntersection,R.displacementMap=b.displacementMap,R.displacementScale=b.displacementScale,R.displacementBias=b.displacementBias,R.wireframeLinewidth=b.wireframeLinewidth,R.linewidth=b.linewidth,B.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const N=i.properties.get(R);N.light=B}return R}function S(w,b,B,L,R){if(w.visible===!1)return;if(w.layers.test(b.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&R===Dr)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,w.matrixWorld);const k=e.update(w),O=w.material;if(Array.isArray(O)){const F=k.groups;for(let V=0,X=F.length;V<X;V++){const te=F[V],q=O[te.materialIndex];if(q&&q.visible){const Z=y(w,q,L,R);i.renderBufferDirect(B,null,k,Z,w,te)}}}else if(O.visible){const F=y(w,O,L,R);i.renderBufferDirect(B,null,k,F,w,null)}}const N=w.children;for(let k=0,O=N.length;k<O;k++)S(N[k],b,B,L,R)}}function TR(i,e,t){const n=t.isWebGL2;function r(){let ee=!1;const Te=new Gt;let ye=null;const he=new Gt(0,0,0,0);return{setMask:function(we){ye!==we&&!ee&&(i.colorMask(we,we,we,we),ye=we)},setLocked:function(we){ee=we},setClear:function(we,qe,pt,Wt,Dn){Dn===!0&&(we*=Wt,qe*=Wt,pt*=Wt),Te.set(we,qe,pt,Wt),he.equals(Te)===!1&&(i.clearColor(we,qe,pt,Wt),he.copy(Te))},reset:function(){ee=!1,ye=null,he.set(-1,0,0,0)}}}function o(){let ee=!1,Te=null,ye=null,he=null;return{setTest:function(we){we?Oe(i.DEPTH_TEST):It(i.DEPTH_TEST)},setMask:function(we){Te!==we&&!ee&&(i.depthMask(we),Te=we)},setFunc:function(we){if(ye!==we){switch(we){case MM:i.depthFunc(i.NEVER);break;case TM:i.depthFunc(i.ALWAYS);break;case BM:i.depthFunc(i.LESS);break;case ou:i.depthFunc(i.LEQUAL);break;case RM:i.depthFunc(i.EQUAL);break;case bM:i.depthFunc(i.GEQUAL);break;case LM:i.depthFunc(i.GREATER);break;case DM:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ye=we}},setLocked:function(we){ee=we},setClear:function(we){he!==we&&(i.clearDepth(we),he=we)},reset:function(){ee=!1,Te=null,ye=null,he=null}}}function l(){let ee=!1,Te=null,ye=null,he=null,we=null,qe=null,pt=null,Wt=null,Dn=null;return{setTest:function(Tt){ee||(Tt?Oe(i.STENCIL_TEST):It(i.STENCIL_TEST))},setMask:function(Tt){Te!==Tt&&!ee&&(i.stencilMask(Tt),Te=Tt)},setFunc:function(Tt,an,Pt){(ye!==Tt||he!==an||we!==Pt)&&(i.stencilFunc(Tt,an,Pt),ye=Tt,he=an,we=Pt)},setOp:function(Tt,an,Pt){(qe!==Tt||pt!==an||Wt!==Pt)&&(i.stencilOp(Tt,an,Pt),qe=Tt,pt=an,Wt=Pt)},setLocked:function(Tt){ee=Tt},setClear:function(Tt){Dn!==Tt&&(i.clearStencil(Tt),Dn=Tt)},reset:function(){ee=!1,Te=null,ye=null,he=null,we=null,qe=null,pt=null,Wt=null,Dn=null}}}const c=new r,f=new o,u=new l,d=new WeakMap,p=new WeakMap;let A={},g={},E=new WeakMap,C=[],_=null,v=!1,x=null,y=null,S=null,w=null,b=null,B=null,L=null,R=new et(0,0,0),T=0,N=!1,k=null,O=null,F=null,V=null,X=null;const te=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let q=!1,Z=0;const U=i.getParameter(i.VERSION);U.indexOf("WebGL")!==-1?(Z=parseFloat(/^WebGL (\d)/.exec(U)[1]),q=Z>=1):U.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),q=Z>=2);let D=null,G={};const K=i.getParameter(i.SCISSOR_BOX),J=i.getParameter(i.VIEWPORT),Ae=new Gt().fromArray(K),ge=new Gt().fromArray(J);function be(ee,Te,ye,he){const we=new Uint8Array(4),qe=i.createTexture();i.bindTexture(ee,qe),i.texParameteri(ee,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(ee,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let pt=0;pt<ye;pt++)n&&(ee===i.TEXTURE_3D||ee===i.TEXTURE_2D_ARRAY)?i.texImage3D(Te,0,i.RGBA,1,1,he,0,i.RGBA,i.UNSIGNED_BYTE,we):i.texImage2D(Te+pt,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,we);return qe}const de={};de[i.TEXTURE_2D]=be(i.TEXTURE_2D,i.TEXTURE_2D,1),de[i.TEXTURE_CUBE_MAP]=be(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(de[i.TEXTURE_2D_ARRAY]=be(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),de[i.TEXTURE_3D]=be(i.TEXTURE_3D,i.TEXTURE_3D,1,1)),c.setClear(0,0,0,1),f.setClear(1),u.setClear(0),Oe(i.DEPTH_TEST),f.setFunc(ou),Ue(!1),He(Wv),Oe(i.CULL_FACE),Ee(Nr);function Oe(ee){A[ee]!==!0&&(i.enable(ee),A[ee]=!0)}function It(ee){A[ee]!==!1&&(i.disable(ee),A[ee]=!1)}function st(ee,Te){return g[ee]!==Te?(i.bindFramebuffer(ee,Te),g[ee]=Te,n&&(ee===i.DRAW_FRAMEBUFFER&&(g[i.FRAMEBUFFER]=Te),ee===i.FRAMEBUFFER&&(g[i.DRAW_FRAMEBUFFER]=Te)),!0):!1}function oe(ee,Te){let ye=C,he=!1;if(ee)if(ye=E.get(Te),ye===void 0&&(ye=[],E.set(Te,ye)),ee.isWebGLMultipleRenderTargets){const we=ee.texture;if(ye.length!==we.length||ye[0]!==i.COLOR_ATTACHMENT0){for(let qe=0,pt=we.length;qe<pt;qe++)ye[qe]=i.COLOR_ATTACHMENT0+qe;ye.length=we.length,he=!0}}else ye[0]!==i.COLOR_ATTACHMENT0&&(ye[0]=i.COLOR_ATTACHMENT0,he=!0);else ye[0]!==i.BACK&&(ye[0]=i.BACK,he=!0);he&&(t.isWebGL2?i.drawBuffers(ye):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(ye))}function Mt(ee){return _!==ee?(i.useProgram(ee),_=ee,!0):!1}const Ne={[ro]:i.FUNC_ADD,[hM]:i.FUNC_SUBTRACT,[dM]:i.FUNC_REVERSE_SUBTRACT};if(n)Ne[Kv]=i.MIN,Ne[Jv]=i.MAX;else{const ee=e.get("EXT_blend_minmax");ee!==null&&(Ne[Kv]=ee.MIN_EXT,Ne[Jv]=ee.MAX_EXT)}const $e={[AM]:i.ZERO,[pM]:i.ONE,[gM]:i.SRC_COLOR,[qd]:i.SRC_ALPHA,[CM]:i.SRC_ALPHA_SATURATE,[EM]:i.DST_COLOR,[vM]:i.DST_ALPHA,[mM]:i.ONE_MINUS_SRC_COLOR,[Xd]:i.ONE_MINUS_SRC_ALPHA,[yM]:i.ONE_MINUS_DST_COLOR,[_M]:i.ONE_MINUS_DST_ALPHA,[IM]:i.CONSTANT_COLOR,[xM]:i.ONE_MINUS_CONSTANT_COLOR,[SM]:i.CONSTANT_ALPHA,[wM]:i.ONE_MINUS_CONSTANT_ALPHA};function Ee(ee,Te,ye,he,we,qe,pt,Wt,Dn,Tt){if(ee===Nr){v===!0&&(It(i.BLEND),v=!1);return}if(v===!1&&(Oe(i.BLEND),v=!0),ee!==fM){if(ee!==x||Tt!==N){if((y!==ro||b!==ro)&&(i.blendEquation(i.FUNC_ADD),y=ro,b=ro),Tt)switch(ee){case Yo:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Yv:i.blendFunc(i.ONE,i.ONE);break;case qv:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case Xv:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",ee);break}else switch(ee){case Yo:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Yv:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case qv:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case Xv:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",ee);break}S=null,w=null,B=null,L=null,R.set(0,0,0),T=0,x=ee,N=Tt}return}we=we||Te,qe=qe||ye,pt=pt||he,(Te!==y||we!==b)&&(i.blendEquationSeparate(Ne[Te],Ne[we]),y=Te,b=we),(ye!==S||he!==w||qe!==B||pt!==L)&&(i.blendFuncSeparate($e[ye],$e[he],$e[qe],$e[pt]),S=ye,w=he,B=qe,L=pt),(Wt.equals(R)===!1||Dn!==T)&&(i.blendColor(Wt.r,Wt.g,Wt.b,Dn),R.copy(Wt),T=Dn),x=ee,N=!1}function nt(ee,Te){ee.side===Yi?It(i.CULL_FACE):Oe(i.CULL_FACE);let ye=ee.side===Bn;Te&&(ye=!ye),Ue(ye),ee.blending===Yo&&ee.transparent===!1?Ee(Nr):Ee(ee.blending,ee.blendEquation,ee.blendSrc,ee.blendDst,ee.blendEquationAlpha,ee.blendSrcAlpha,ee.blendDstAlpha,ee.blendColor,ee.blendAlpha,ee.premultipliedAlpha),f.setFunc(ee.depthFunc),f.setTest(ee.depthTest),f.setMask(ee.depthWrite),c.setMask(ee.colorWrite);const he=ee.stencilWrite;u.setTest(he),he&&(u.setMask(ee.stencilWriteMask),u.setFunc(ee.stencilFunc,ee.stencilRef,ee.stencilFuncMask),u.setOp(ee.stencilFail,ee.stencilZFail,ee.stencilZPass)),ut(ee.polygonOffset,ee.polygonOffsetFactor,ee.polygonOffsetUnits),ee.alphaToCoverage===!0?Oe(i.SAMPLE_ALPHA_TO_COVERAGE):It(i.SAMPLE_ALPHA_TO_COVERAGE)}function Ue(ee){k!==ee&&(ee?i.frontFace(i.CW):i.frontFace(i.CCW),k=ee)}function He(ee){ee!==lM?(Oe(i.CULL_FACE),ee!==O&&(ee===Wv?i.cullFace(i.BACK):ee===cM?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):It(i.CULL_FACE),O=ee}function ot(ee){ee!==F&&(q&&i.lineWidth(ee),F=ee)}function ut(ee,Te,ye){ee?(Oe(i.POLYGON_OFFSET_FILL),(V!==Te||X!==ye)&&(i.polygonOffset(Te,ye),V=Te,X=ye)):It(i.POLYGON_OFFSET_FILL)}function At(ee){ee?Oe(i.SCISSOR_TEST):It(i.SCISSOR_TEST)}function H(ee){ee===void 0&&(ee=i.TEXTURE0+te-1),D!==ee&&(i.activeTexture(ee),D=ee)}function Q(ee,Te,ye){ye===void 0&&(D===null?ye=i.TEXTURE0+te-1:ye=D);let he=G[ye];he===void 0&&(he={type:void 0,texture:void 0},G[ye]=he),(he.type!==ee||he.texture!==Te)&&(D!==ye&&(i.activeTexture(ye),D=ye),i.bindTexture(ee,Te||de[ee]),he.type=ee,he.texture=Te)}function se(){const ee=G[D];ee!==void 0&&ee.type!==void 0&&(i.bindTexture(ee.type,null),ee.type=void 0,ee.texture=void 0)}function Ce(){try{i.compressedTexImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function me(){try{i.compressedTexImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function xe(){try{i.texSubImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function We(){try{i.texSubImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Se(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Re(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Y(){try{i.texStorage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function Me(){try{i.texStorage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function pe(){try{i.texImage2D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function tt(){try{i.texImage3D.apply(i,arguments)}catch(ee){console.error("THREE.WebGLState:",ee)}}function je(ee){Ae.equals(ee)===!1&&(i.scissor(ee.x,ee.y,ee.z,ee.w),Ae.copy(ee))}function Je(ee){ge.equals(ee)===!1&&(i.viewport(ee.x,ee.y,ee.z,ee.w),ge.copy(ee))}function Ge(ee,Te){let ye=p.get(Te);ye===void 0&&(ye=new WeakMap,p.set(Te,ye));let he=ye.get(ee);he===void 0&&(he=i.getUniformBlockIndex(Te,ee.name),ye.set(ee,he))}function Pe(ee,Te){const he=p.get(Te).get(ee);d.get(Te)!==he&&(i.uniformBlockBinding(Te,he,ee.__bindingPointIndex),d.set(Te,he))}function dt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),n===!0&&(i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),A={},D=null,G={},g={},E=new WeakMap,C=[],_=null,v=!1,x=null,y=null,S=null,w=null,b=null,B=null,L=null,R=new et(0,0,0),T=0,N=!1,k=null,O=null,F=null,V=null,X=null,Ae.set(0,0,i.canvas.width,i.canvas.height),ge.set(0,0,i.canvas.width,i.canvas.height),c.reset(),f.reset(),u.reset()}return{buffers:{color:c,depth:f,stencil:u},enable:Oe,disable:It,bindFramebuffer:st,drawBuffers:oe,useProgram:Mt,setBlending:Ee,setMaterial:nt,setFlipSided:Ue,setCullFace:He,setLineWidth:ot,setPolygonOffset:ut,setScissorTest:At,activeTexture:H,bindTexture:Q,unbindTexture:se,compressedTexImage2D:Ce,compressedTexImage3D:me,texImage2D:pe,texImage3D:tt,updateUBOMapping:Ge,uniformBlockBinding:Pe,texStorage2D:Y,texStorage3D:Me,texSubImage2D:xe,texSubImage3D:We,compressedTexSubImage2D:Se,compressedTexSubImage3D:Re,scissor:je,viewport:Je,reset:dt}}function BR(i,e,t,n,r,o,l){const c=r.isWebGL2,f=r.maxTextures,u=r.maxCubemapSize,d=r.maxTextureSize,p=r.maxSamples,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,g=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),E=new WeakMap;let C;const _=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(H,Q){return v?new OffscreenCanvas(H,Q):Ql("canvas")}function y(H,Q,se,Ce){let me=1;if((H.width>Ce||H.height>Ce)&&(me=Ce/Math.max(H.width,H.height)),me<1||Q===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const xe=Q?yu:Math.floor,We=xe(me*H.width),Se=xe(me*H.height);C===void 0&&(C=x(We,Se));const Re=se?x(We,Se):C;return Re.width=We,Re.height=Se,Re.getContext("2d").drawImage(H,0,0,We,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+We+"x"+Se+")."),Re}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function S(H){return dA(H.width)&&dA(H.height)}function w(H){return c?!1:H.wrapS!==Fn||H.wrapT!==Fn||H.minFilter!==qt&&H.minFilter!==un}function b(H,Q){return H.generateMipmaps&&Q&&H.minFilter!==qt&&H.minFilter!==un}function B(H){i.generateMipmap(H)}function L(H,Q,se,Ce,me=!1){if(c===!1)return Q;if(H!==null){if(i[H]!==void 0)return i[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let xe=Q;if(Q===i.RED&&(se===i.FLOAT&&(xe=i.R32F),se===i.HALF_FLOAT&&(xe=i.R16F),se===i.UNSIGNED_BYTE&&(xe=i.R8)),Q===i.RED_INTEGER&&(se===i.UNSIGNED_BYTE&&(xe=i.R8UI),se===i.UNSIGNED_SHORT&&(xe=i.R16UI),se===i.UNSIGNED_INT&&(xe=i.R32UI),se===i.BYTE&&(xe=i.R8I),se===i.SHORT&&(xe=i.R16I),se===i.INT&&(xe=i.R32I)),Q===i.RG&&(se===i.FLOAT&&(xe=i.RG32F),se===i.HALF_FLOAT&&(xe=i.RG16F),se===i.UNSIGNED_BYTE&&(xe=i.RG8)),Q===i.RGBA){const We=me?mu:Nt.getTransfer(Ce);se===i.FLOAT&&(xe=i.RGBA32F),se===i.HALF_FLOAT&&(xe=i.RGBA16F),se===i.UNSIGNED_BYTE&&(xe=We===Vt?i.SRGB8_ALPHA8:i.RGBA8),se===i.UNSIGNED_SHORT_4_4_4_4&&(xe=i.RGBA4),se===i.UNSIGNED_SHORT_5_5_5_1&&(xe=i.RGB5_A1)}return(xe===i.R16F||xe===i.R32F||xe===i.RG16F||xe===i.RG32F||xe===i.RGBA16F||xe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),xe}function R(H,Q,se){return b(H,se)===!0||H.isFramebufferTexture&&H.minFilter!==qt&&H.minFilter!==un?Math.log2(Math.max(Q.width,Q.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?Q.mipmaps.length:1}function T(H){return H===qt||H===$d||H===cu?i.NEAREST:i.LINEAR}function N(H){const Q=H.target;Q.removeEventListener("dispose",N),O(Q),Q.isVideoTexture&&E.delete(Q)}function k(H){const Q=H.target;Q.removeEventListener("dispose",k),V(Q)}function O(H){const Q=n.get(H);if(Q.__webglInit===void 0)return;const se=H.source,Ce=_.get(se);if(Ce){const me=Ce[Q.__cacheKey];me.usedTimes--,me.usedTimes===0&&F(H),Object.keys(Ce).length===0&&_.delete(se)}n.remove(H)}function F(H){const Q=n.get(H);i.deleteTexture(Q.__webglTexture);const se=H.source,Ce=_.get(se);delete Ce[Q.__cacheKey],l.memory.textures--}function V(H){const Q=H.texture,se=n.get(H),Ce=n.get(Q);if(Ce.__webglTexture!==void 0&&(i.deleteTexture(Ce.__webglTexture),l.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(se.__webglFramebuffer[me]))for(let xe=0;xe<se.__webglFramebuffer[me].length;xe++)i.deleteFramebuffer(se.__webglFramebuffer[me][xe]);else i.deleteFramebuffer(se.__webglFramebuffer[me]);se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer[me])}else{if(Array.isArray(se.__webglFramebuffer))for(let me=0;me<se.__webglFramebuffer.length;me++)i.deleteFramebuffer(se.__webglFramebuffer[me]);else i.deleteFramebuffer(se.__webglFramebuffer);if(se.__webglDepthbuffer&&i.deleteRenderbuffer(se.__webglDepthbuffer),se.__webglMultisampledFramebuffer&&i.deleteFramebuffer(se.__webglMultisampledFramebuffer),se.__webglColorRenderbuffer)for(let me=0;me<se.__webglColorRenderbuffer.length;me++)se.__webglColorRenderbuffer[me]&&i.deleteRenderbuffer(se.__webglColorRenderbuffer[me]);se.__webglDepthRenderbuffer&&i.deleteRenderbuffer(se.__webglDepthRenderbuffer)}if(H.isWebGLMultipleRenderTargets)for(let me=0,xe=Q.length;me<xe;me++){const We=n.get(Q[me]);We.__webglTexture&&(i.deleteTexture(We.__webglTexture),l.memory.textures--),n.remove(Q[me])}n.remove(Q),n.remove(H)}let X=0;function te(){X=0}function q(){const H=X;return H>=f&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+f),X+=1,H}function Z(H){const Q=[];return Q.push(H.wrapS),Q.push(H.wrapT),Q.push(H.wrapR||0),Q.push(H.magFilter),Q.push(H.minFilter),Q.push(H.anisotropy),Q.push(H.internalFormat),Q.push(H.format),Q.push(H.type),Q.push(H.generateMipmaps),Q.push(H.premultiplyAlpha),Q.push(H.flipY),Q.push(H.unpackAlignment),Q.push(H.colorSpace),Q.join()}function U(H,Q){const se=n.get(H);if(H.isVideoTexture&&ut(H),H.isRenderTargetTexture===!1&&H.version>0&&se.__version!==H.version){const Ce=H.image;if(Ce===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ce.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Oe(se,H,Q);return}}t.bindTexture(i.TEXTURE_2D,se.__webglTexture,i.TEXTURE0+Q)}function D(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){Oe(se,H,Q);return}t.bindTexture(i.TEXTURE_2D_ARRAY,se.__webglTexture,i.TEXTURE0+Q)}function G(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){Oe(se,H,Q);return}t.bindTexture(i.TEXTURE_3D,se.__webglTexture,i.TEXTURE0+Q)}function K(H,Q){const se=n.get(H);if(H.version>0&&se.__version!==H.version){It(se,H,Q);return}t.bindTexture(i.TEXTURE_CUBE_MAP,se.__webglTexture,i.TEXTURE0+Q)}const J={[Xo]:i.REPEAT,[Fn]:i.CLAMP_TO_EDGE,[lu]:i.MIRRORED_REPEAT},Ae={[qt]:i.NEAREST,[$d]:i.NEAREST_MIPMAP_NEAREST,[cu]:i.NEAREST_MIPMAP_LINEAR,[un]:i.LINEAR,[r1]:i.LINEAR_MIPMAP_NEAREST,[Pr]:i.LINEAR_MIPMAP_LINEAR},ge={[YM]:i.NEVER,[e3]:i.ALWAYS,[qM]:i.LESS,[KM]:i.LEQUAL,[XM]:i.EQUAL,[ZM]:i.GEQUAL,[JM]:i.GREATER,[$M]:i.NOTEQUAL};function be(H,Q,se){if(se?(i.texParameteri(H,i.TEXTURE_WRAP_S,J[Q.wrapS]),i.texParameteri(H,i.TEXTURE_WRAP_T,J[Q.wrapT]),(H===i.TEXTURE_3D||H===i.TEXTURE_2D_ARRAY)&&i.texParameteri(H,i.TEXTURE_WRAP_R,J[Q.wrapR]),i.texParameteri(H,i.TEXTURE_MAG_FILTER,Ae[Q.magFilter]),i.texParameteri(H,i.TEXTURE_MIN_FILTER,Ae[Q.minFilter])):(i.texParameteri(H,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(H,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(H===i.TEXTURE_3D||H===i.TEXTURE_2D_ARRAY)&&i.texParameteri(H,i.TEXTURE_WRAP_R,i.CLAMP_TO_EDGE),(Q.wrapS!==Fn||Q.wrapT!==Fn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(H,i.TEXTURE_MAG_FILTER,T(Q.magFilter)),i.texParameteri(H,i.TEXTURE_MIN_FILTER,T(Q.minFilter)),Q.minFilter!==qt&&Q.minFilter!==un&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),Q.compareFunction&&(i.texParameteri(H,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(H,i.TEXTURE_COMPARE_FUNC,ge[Q.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Ce=e.get("EXT_texture_filter_anisotropic");if(Q.magFilter===qt||Q.minFilter!==cu&&Q.minFilter!==Pr||Q.type===hn&&e.has("OES_texture_float_linear")===!1||c===!1&&Q.type===Jn&&e.has("OES_texture_half_float_linear")===!1)return;(Q.anisotropy>1||n.get(Q).__currentAnisotropy)&&(i.texParameterf(H,Ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(Q.anisotropy,r.getMaxAnisotropy())),n.get(Q).__currentAnisotropy=Q.anisotropy)}}function de(H,Q){let se=!1;H.__webglInit===void 0&&(H.__webglInit=!0,Q.addEventListener("dispose",N));const Ce=Q.source;let me=_.get(Ce);me===void 0&&(me={},_.set(Ce,me));const xe=Z(Q);if(xe!==H.__cacheKey){me[xe]===void 0&&(me[xe]={texture:i.createTexture(),usedTimes:0},l.memory.textures++,se=!0),me[xe].usedTimes++;const We=me[H.__cacheKey];We!==void 0&&(me[H.__cacheKey].usedTimes--,We.usedTimes===0&&F(Q)),H.__cacheKey=xe,H.__webglTexture=me[xe].texture}return se}function Oe(H,Q,se){let Ce=i.TEXTURE_2D;(Q.isDataArrayTexture||Q.isCompressedArrayTexture)&&(Ce=i.TEXTURE_2D_ARRAY),Q.isData3DTexture&&(Ce=i.TEXTURE_3D);const me=de(H,Q),xe=Q.source;t.bindTexture(Ce,H.__webglTexture,i.TEXTURE0+se);const We=n.get(xe);if(xe.version!==We.__version||me===!0){t.activeTexture(i.TEXTURE0+se);const Se=Nt.getPrimaries(Nt.workingColorSpace),Re=Q.colorSpace===ci?null:Nt.getPrimaries(Q.colorSpace),Y=Q.colorSpace===ci||Se===Re?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,Q.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,Q.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Y);const Me=w(Q)&&S(Q.image)===!1;let pe=y(Q.image,Me,!1,d);pe=At(Q,pe);const tt=S(pe)||c,je=o.convert(Q.format,Q.colorSpace);let Je=o.convert(Q.type),Ge=L(Q.internalFormat,je,Je,Q.colorSpace,Q.isVideoTexture);be(Ce,Q,tt);let Pe;const dt=Q.mipmaps,ee=c&&Q.isVideoTexture!==!0,Te=We.__version===void 0||me===!0,ye=R(Q,pe,tt);if(Q.isDepthTexture)Ge=i.DEPTH_COMPONENT,c?Q.type===hn?Ge=i.DEPTH_COMPONENT32F:Q.type===yi?Ge=i.DEPTH_COMPONENT24:Q.type===oo?Ge=i.DEPTH24_STENCIL8:Ge=i.DEPTH_COMPONENT16:Q.type===hn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),Q.format===ao&&Ge===i.DEPTH_COMPONENT&&Q.type!==uu&&Q.type!==yi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),Q.type=yi,Je=o.convert(Q.type)),Q.format===Ko&&Ge===i.DEPTH_COMPONENT&&(Ge=i.DEPTH_STENCIL,Q.type!==oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),Q.type=oo,Je=o.convert(Q.type))),Te&&(ee?t.texStorage2D(i.TEXTURE_2D,1,Ge,pe.width,pe.height):t.texImage2D(i.TEXTURE_2D,0,Ge,pe.width,pe.height,0,je,Je,null));else if(Q.isDataTexture)if(dt.length>0&&tt){ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Je,Pe.data):t.texImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,je,Je,Pe.data);Q.generateMipmaps=!1}else ee?(Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height),t.texSubImage2D(i.TEXTURE_2D,0,0,0,pe.width,pe.height,je,Je,pe.data)):t.texImage2D(i.TEXTURE_2D,0,Ge,pe.width,pe.height,0,je,Je,pe.data);else if(Q.isCompressedTexture)if(Q.isCompressedArrayTexture){ee&&Te&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ye,Ge,dt[0].width,dt[0].height,pe.depth);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],Q.format!==on?je!==null?ee?t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,he,0,0,0,Pe.width,Pe.height,pe.depth,je,Pe.data,0,0):t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,he,Ge,Pe.width,Pe.height,pe.depth,0,Pe.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ee?t.texSubImage3D(i.TEXTURE_2D_ARRAY,he,0,0,0,Pe.width,Pe.height,pe.depth,je,Je,Pe.data):t.texImage3D(i.TEXTURE_2D_ARRAY,he,Ge,Pe.width,Pe.height,pe.depth,0,je,Je,Pe.data)}else{ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],Q.format!==on?je!==null?ee?t.compressedTexSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Pe.data):t.compressedTexImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,Pe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,Pe.width,Pe.height,je,Je,Pe.data):t.texImage2D(i.TEXTURE_2D,he,Ge,Pe.width,Pe.height,0,je,Je,Pe.data)}else if(Q.isDataArrayTexture)ee?(Te&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ye,Ge,pe.width,pe.height,pe.depth),t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,pe.width,pe.height,pe.depth,je,Je,pe.data)):t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ge,pe.width,pe.height,pe.depth,0,je,Je,pe.data);else if(Q.isData3DTexture)ee?(Te&&t.texStorage3D(i.TEXTURE_3D,ye,Ge,pe.width,pe.height,pe.depth),t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,pe.width,pe.height,pe.depth,je,Je,pe.data)):t.texImage3D(i.TEXTURE_3D,0,Ge,pe.width,pe.height,pe.depth,0,je,Je,pe.data);else if(Q.isFramebufferTexture){if(Te)if(ee)t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height);else{let he=pe.width,we=pe.height;for(let qe=0;qe<ye;qe++)t.texImage2D(i.TEXTURE_2D,qe,Ge,he,we,0,je,Je,null),he>>=1,we>>=1}}else if(dt.length>0&&tt){ee&&Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,dt[0].width,dt[0].height);for(let he=0,we=dt.length;he<we;he++)Pe=dt[he],ee?t.texSubImage2D(i.TEXTURE_2D,he,0,0,je,Je,Pe):t.texImage2D(i.TEXTURE_2D,he,Ge,je,Je,Pe);Q.generateMipmaps=!1}else ee?(Te&&t.texStorage2D(i.TEXTURE_2D,ye,Ge,pe.width,pe.height),t.texSubImage2D(i.TEXTURE_2D,0,0,0,je,Je,pe)):t.texImage2D(i.TEXTURE_2D,0,Ge,je,Je,pe);b(Q,tt)&&B(Ce),We.__version=xe.version,Q.onUpdate&&Q.onUpdate(Q)}H.__version=Q.version}function It(H,Q,se){if(Q.image.length!==6)return;const Ce=de(H,Q),me=Q.source;t.bindTexture(i.TEXTURE_CUBE_MAP,H.__webglTexture,i.TEXTURE0+se);const xe=n.get(me);if(me.version!==xe.__version||Ce===!0){t.activeTexture(i.TEXTURE0+se);const We=Nt.getPrimaries(Nt.workingColorSpace),Se=Q.colorSpace===ci?null:Nt.getPrimaries(Q.colorSpace),Re=Q.colorSpace===ci||We===Se?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,Q.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,Q.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);const Y=Q.isCompressedTexture||Q.image[0].isCompressedTexture,Me=Q.image[0]&&Q.image[0].isDataTexture,pe=[];for(let he=0;he<6;he++)!Y&&!Me?pe[he]=y(Q.image[he],!1,!0,u):pe[he]=Me?Q.image[he].image:Q.image[he],pe[he]=At(Q,pe[he]);const tt=pe[0],je=S(tt)||c,Je=o.convert(Q.format,Q.colorSpace),Ge=o.convert(Q.type),Pe=L(Q.internalFormat,Je,Ge,Q.colorSpace),dt=c&&Q.isVideoTexture!==!0,ee=xe.__version===void 0||Ce===!0;let Te=R(Q,tt,je);be(i.TEXTURE_CUBE_MAP,Q,je);let ye;if(Y){dt&&ee&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Te,Pe,tt.width,tt.height);for(let he=0;he<6;he++){ye=pe[he].mipmaps;for(let we=0;we<ye.length;we++){const qe=ye[we];Q.format!==on?Je!==null?dt?t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,0,0,qe.width,qe.height,Je,qe.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,Pe,qe.width,qe.height,0,qe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,0,0,qe.width,qe.height,Je,Ge,qe.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we,Pe,qe.width,qe.height,0,Je,Ge,qe.data)}}}else{ye=Q.mipmaps,dt&&ee&&(ye.length>0&&Te++,t.texStorage2D(i.TEXTURE_CUBE_MAP,Te,Pe,pe[0].width,pe[0].height));for(let he=0;he<6;he++)if(Me){dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,pe[he].width,pe[he].height,Je,Ge,pe[he].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,Pe,pe[he].width,pe[he].height,0,Je,Ge,pe[he].data);for(let we=0;we<ye.length;we++){const pt=ye[we].image[he].image;dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,0,0,pt.width,pt.height,Je,Ge,pt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,Pe,pt.width,pt.height,0,Je,Ge,pt.data)}}else{dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Je,Ge,pe[he]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,Pe,Je,Ge,pe[he]);for(let we=0;we<ye.length;we++){const qe=ye[we];dt?t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,0,0,Je,Ge,qe.image[he]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,we+1,Pe,Je,Ge,qe.image[he])}}}b(Q,je)&&B(i.TEXTURE_CUBE_MAP),xe.__version=me.version,Q.onUpdate&&Q.onUpdate(Q)}H.__version=Q.version}function st(H,Q,se,Ce,me,xe){const We=o.convert(se.format,se.colorSpace),Se=o.convert(se.type),Re=L(se.internalFormat,We,Se,se.colorSpace);if(!n.get(Q).__hasExternalTextures){const Me=Math.max(1,Q.width>>xe),pe=Math.max(1,Q.height>>xe);me===i.TEXTURE_3D||me===i.TEXTURE_2D_ARRAY?t.texImage3D(me,xe,Re,Me,pe,Q.depth,0,We,Se,null):t.texImage2D(me,xe,Re,Me,pe,0,We,Se,null)}t.bindFramebuffer(i.FRAMEBUFFER,H),ot(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Ce,me,n.get(se).__webglTexture,0,He(Q)):(me===i.TEXTURE_2D||me>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Ce,me,n.get(se).__webglTexture,xe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function oe(H,Q,se){if(i.bindRenderbuffer(i.RENDERBUFFER,H),Q.depthBuffer&&!Q.stencilBuffer){let Ce=c===!0?i.DEPTH_COMPONENT24:i.DEPTH_COMPONENT16;if(se||ot(Q)){const me=Q.depthTexture;me&&me.isDepthTexture&&(me.type===hn?Ce=i.DEPTH_COMPONENT32F:me.type===yi&&(Ce=i.DEPTH_COMPONENT24));const xe=He(Q);ot(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,xe,Ce,Q.width,Q.height):i.renderbufferStorageMultisample(i.RENDERBUFFER,xe,Ce,Q.width,Q.height)}else i.renderbufferStorage(i.RENDERBUFFER,Ce,Q.width,Q.height);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,H)}else if(Q.depthBuffer&&Q.stencilBuffer){const Ce=He(Q);se&&ot(Q)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,i.DEPTH24_STENCIL8,Q.width,Q.height):ot(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ce,i.DEPTH24_STENCIL8,Q.width,Q.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,Q.width,Q.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,H)}else{const Ce=Q.isWebGLMultipleRenderTargets===!0?Q.texture:[Q.texture];for(let me=0;me<Ce.length;me++){const xe=Ce[me],We=o.convert(xe.format,xe.colorSpace),Se=o.convert(xe.type),Re=L(xe.internalFormat,We,Se,xe.colorSpace),Y=He(Q);se&&ot(Q)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,Y,Re,Q.width,Q.height):ot(Q)?A.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Y,Re,Q.width,Q.height):i.renderbufferStorage(i.RENDERBUFFER,Re,Q.width,Q.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Mt(H,Q){if(Q&&Q.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,H),!(Q.depthTexture&&Q.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(Q.depthTexture).__webglTexture||Q.depthTexture.image.width!==Q.width||Q.depthTexture.image.height!==Q.height)&&(Q.depthTexture.image.width=Q.width,Q.depthTexture.image.height=Q.height,Q.depthTexture.needsUpdate=!0),U(Q.depthTexture,0);const Ce=n.get(Q.depthTexture).__webglTexture,me=He(Q);if(Q.depthTexture.format===ao)ot(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ce,0,me):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ce,0);else if(Q.depthTexture.format===Ko)ot(Q)?A.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ce,0,me):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ce,0);else throw new Error("Unknown depthTexture format")}function Ne(H){const Q=n.get(H),se=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture&&!Q.__autoAllocateDepthBuffer){if(se)throw new Error("target.depthTexture not supported in Cube render targets");Mt(Q.__webglFramebuffer,H)}else if(se){Q.__webglDepthbuffer=[];for(let Ce=0;Ce<6;Ce++)t.bindFramebuffer(i.FRAMEBUFFER,Q.__webglFramebuffer[Ce]),Q.__webglDepthbuffer[Ce]=i.createRenderbuffer(),oe(Q.__webglDepthbuffer[Ce],H,!1)}else t.bindFramebuffer(i.FRAMEBUFFER,Q.__webglFramebuffer),Q.__webglDepthbuffer=i.createRenderbuffer(),oe(Q.__webglDepthbuffer,H,!1);t.bindFramebuffer(i.FRAMEBUFFER,null)}function $e(H,Q,se){const Ce=n.get(H);Q!==void 0&&st(Ce.__webglFramebuffer,H,H.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),se!==void 0&&Ne(H)}function Ee(H){const Q=H.texture,se=n.get(H),Ce=n.get(Q);H.addEventListener("dispose",k),H.isWebGLMultipleRenderTargets!==!0&&(Ce.__webglTexture===void 0&&(Ce.__webglTexture=i.createTexture()),Ce.__version=Q.version,l.memory.textures++);const me=H.isWebGLCubeRenderTarget===!0,xe=H.isWebGLMultipleRenderTargets===!0,We=S(H)||c;if(me){se.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(c&&Q.mipmaps&&Q.mipmaps.length>0){se.__webglFramebuffer[Se]=[];for(let Re=0;Re<Q.mipmaps.length;Re++)se.__webglFramebuffer[Se][Re]=i.createFramebuffer()}else se.__webglFramebuffer[Se]=i.createFramebuffer()}else{if(c&&Q.mipmaps&&Q.mipmaps.length>0){se.__webglFramebuffer=[];for(let Se=0;Se<Q.mipmaps.length;Se++)se.__webglFramebuffer[Se]=i.createFramebuffer()}else se.__webglFramebuffer=i.createFramebuffer();if(xe)if(r.drawBuffers){const Se=H.texture;for(let Re=0,Y=Se.length;Re<Y;Re++){const Me=n.get(Se[Re]);Me.__webglTexture===void 0&&(Me.__webglTexture=i.createTexture(),l.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(c&&H.samples>0&&ot(H)===!1){const Se=xe?Q:[Q];se.__webglMultisampledFramebuffer=i.createFramebuffer(),se.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,se.__webglMultisampledFramebuffer);for(let Re=0;Re<Se.length;Re++){const Y=Se[Re];se.__webglColorRenderbuffer[Re]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,se.__webglColorRenderbuffer[Re]);const Me=o.convert(Y.format,Y.colorSpace),pe=o.convert(Y.type),tt=L(Y.internalFormat,Me,pe,Y.colorSpace,H.isXRRenderTarget===!0),je=He(H);i.renderbufferStorageMultisample(i.RENDERBUFFER,je,tt,H.width,H.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Re,i.RENDERBUFFER,se.__webglColorRenderbuffer[Re])}i.bindRenderbuffer(i.RENDERBUFFER,null),H.depthBuffer&&(se.__webglDepthRenderbuffer=i.createRenderbuffer(),oe(se.__webglDepthRenderbuffer,H,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(me){t.bindTexture(i.TEXTURE_CUBE_MAP,Ce.__webglTexture),be(i.TEXTURE_CUBE_MAP,Q,We);for(let Se=0;Se<6;Se++)if(c&&Q.mipmaps&&Q.mipmaps.length>0)for(let Re=0;Re<Q.mipmaps.length;Re++)st(se.__webglFramebuffer[Se][Re],H,Q,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Re);else st(se.__webglFramebuffer[Se],H,Q,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0);b(Q,We)&&B(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(xe){const Se=H.texture;for(let Re=0,Y=Se.length;Re<Y;Re++){const Me=Se[Re],pe=n.get(Me);t.bindTexture(i.TEXTURE_2D,pe.__webglTexture),be(i.TEXTURE_2D,Me,We),st(se.__webglFramebuffer,H,Me,i.COLOR_ATTACHMENT0+Re,i.TEXTURE_2D,0),b(Me,We)&&B(i.TEXTURE_2D)}t.unbindTexture()}else{let Se=i.TEXTURE_2D;if((H.isWebGL3DRenderTarget||H.isWebGLArrayRenderTarget)&&(c?Se=H.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Se,Ce.__webglTexture),be(Se,Q,We),c&&Q.mipmaps&&Q.mipmaps.length>0)for(let Re=0;Re<Q.mipmaps.length;Re++)st(se.__webglFramebuffer[Re],H,Q,i.COLOR_ATTACHMENT0,Se,Re);else st(se.__webglFramebuffer,H,Q,i.COLOR_ATTACHMENT0,Se,0);b(Q,We)&&B(Se),t.unbindTexture()}H.depthBuffer&&Ne(H)}function nt(H){const Q=S(H)||c,se=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Ce=0,me=se.length;Ce<me;Ce++){const xe=se[Ce];if(b(xe,Q)){const We=H.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D,Se=n.get(xe).__webglTexture;t.bindTexture(We,Se),B(We),t.unbindTexture()}}}function Ue(H){if(c&&H.samples>0&&ot(H)===!1){const Q=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],se=H.width,Ce=H.height;let me=i.COLOR_BUFFER_BIT;const xe=[],We=H.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Se=n.get(H),Re=H.isWebGLMultipleRenderTargets===!0;if(Re)for(let Y=0;Y<Q.length;Y++)t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Y,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Y,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Se.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Se.__webglFramebuffer);for(let Y=0;Y<Q.length;Y++){xe.push(i.COLOR_ATTACHMENT0+Y),H.depthBuffer&&xe.push(We);const Me=Se.__ignoreDepthValues!==void 0?Se.__ignoreDepthValues:!1;if(Me===!1&&(H.depthBuffer&&(me|=i.DEPTH_BUFFER_BIT),H.stencilBuffer&&(me|=i.STENCIL_BUFFER_BIT)),Re&&i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Se.__webglColorRenderbuffer[Y]),Me===!0&&(i.invalidateFramebuffer(i.READ_FRAMEBUFFER,[We]),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[We])),Re){const pe=n.get(Q[Y]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,pe,0)}i.blitFramebuffer(0,0,se,Ce,0,0,se,Ce,me,i.NEAREST),g&&i.invalidateFramebuffer(i.READ_FRAMEBUFFER,xe)}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),Re)for(let Y=0;Y<Q.length;Y++){t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Y,i.RENDERBUFFER,Se.__webglColorRenderbuffer[Y]);const Me=n.get(Q[Y]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Y,i.TEXTURE_2D,Me,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Se.__webglMultisampledFramebuffer)}}function He(H){return Math.min(p,H.samples)}function ot(H){const Q=n.get(H);return c&&H.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&Q.__useRenderToTexture!==!1}function ut(H){const Q=l.render.frame;E.get(H)!==Q&&(E.set(H,Q),H.update())}function At(H,Q){const se=H.colorSpace,Ce=H.format,me=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===fA||se!==En&&se!==ci&&(Nt.getTransfer(se)===Vt?c===!1?e.has("EXT_sRGB")===!0&&Ce===on?(H.format=fA,H.minFilter=un,H.generateMipmaps=!1):Q=G1.sRGBToLinear(Q):(Ce!==on||me!==fn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",se)),Q}this.allocateTextureUnit=q,this.resetTextureUnits=te,this.setTexture2D=U,this.setTexture2DArray=D,this.setTexture3D=G,this.setTextureCube=K,this.rebindTextures=$e,this.setupRenderTarget=Ee,this.updateRenderTargetMipmap=nt,this.updateMultisampleRenderTarget=Ue,this.setupDepthRenderbuffer=Ne,this.setupFrameBufferTexture=st,this.useMultisampledRTT=ot}function RR(i,e,t){const n=t.isWebGL2;function r(o,l=ci){let c;const f=Nt.getTransfer(l);if(o===fn)return i.UNSIGNED_BYTE;if(o===o1)return i.UNSIGNED_SHORT_4_4_4_4;if(o===a1)return i.UNSIGNED_SHORT_5_5_5_1;if(o===Zd)return i.BYTE;if(o===s1)return i.SHORT;if(o===uu)return i.UNSIGNED_SHORT;if(o===Dl)return i.INT;if(o===yi)return i.UNSIGNED_INT;if(o===hn)return i.FLOAT;if(o===Jn)return n?i.HALF_FLOAT:(c=e.get("OES_texture_half_float"),c!==null?c.HALF_FLOAT_OES:null);if(o===FM)return i.ALPHA;if(o===on)return i.RGBA;if(o===QM)return i.LUMINANCE;if(o===OM)return i.LUMINANCE_ALPHA;if(o===ao)return i.DEPTH_COMPONENT;if(o===Ko)return i.DEPTH_STENCIL;if(o===fA)return c=e.get("EXT_sRGB"),c!==null?c.SRGB_ALPHA_EXT:null;if(o===lo)return i.RED;if(o===eA)return i.RED_INTEGER;if(o===co)return i.RG;if(o===fu)return i.RG_INTEGER;if(o===Nl)return i.RGBA_INTEGER;if(o===hu||o===tA||o===nA||o===du)if(f===Vt)if(c=e.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(o===hu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===tA)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===nA)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===du)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=e.get("WEBGL_compressed_texture_s3tc"),c!==null){if(o===hu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===tA)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===nA)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===du)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===iA||o===l1||o===rA||o===c1)if(c=e.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(o===iA)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===l1)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===rA)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===c1)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===u1)return c=e.get("WEBGL_compressed_texture_etc1"),c!==null?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===sA||o===oA)if(c=e.get("WEBGL_compressed_texture_etc"),c!==null){if(o===sA)return f===Vt?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(o===oA)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===aA||o===f1||o===h1||o===d1||o===Au||o===A1||o===p1||o===g1||o===m1||o===v1||o===_1||o===E1||o===y1||o===C1)if(c=e.get("WEBGL_compressed_texture_astc"),c!==null){if(o===aA)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===f1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===h1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===d1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===Au)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===A1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===p1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===g1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===m1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===v1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===_1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===E1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===y1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===C1)return f===Vt?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===pu||o===I1||o===x1)if(c=e.get("EXT_texture_compression_bptc"),c!==null){if(o===pu)return f===Vt?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===I1)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===x1)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===zM||o===S1||o===w1||o===M1)if(c=e.get("EXT_texture_compression_rgtc"),c!==null){if(o===pu)return c.COMPRESSED_RED_RGTC1_EXT;if(o===S1)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===w1)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===M1)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===oo?n?i.UNSIGNED_INT_24_8:(c=e.get("WEBGL_depth_texture"),c!==null?c.UNSIGNED_INT_24_8_WEBGL:null):i[o]!==void 0?i[o]:null}return{convert:r}}class bR extends Zn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class vs extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const LR={type:"move"};class zA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vs,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 vs,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 vs,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 r=null,o=null,l=null;const c=this._targetRay,f=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){l=!0;for(const C of e.hand.values()){const _=t.getJointPose(C,n),v=this._getHandJoint(u,C);_!==null&&(v.matrix.fromArray(_.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=_.radius),v.visible=_!==null}const d=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],A=d.position.distanceTo(p.position),g=.02,E=.005;u.inputState.pinching&&A>g+E?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&A<=g-E&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else f!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(f.matrix.fromArray(o.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,o.linearVelocity?(f.hasLinearVelocity=!0,f.linearVelocity.copy(o.linearVelocity)):f.hasLinearVelocity=!1,o.angularVelocity?(f.hasAngularVelocity=!0,f.angularVelocity.copy(o.angularVelocity)):f.hasAngularVelocity=!1));c!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&o!==null&&(r=o),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(LR)))}return c!==null&&(c.visible=r!==null),f!==null&&(f.visible=o!==null),u!==null&&(u.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new vs;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class DR extends Rn{constructor(e,t,n,r,o,l,c,f,u,d){if(d=d!==void 0?d:ao,d!==ao&&d!==Ko)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===ao&&(n=yi),n===void 0&&d===Ko&&(n=oo),super(null,r,o,l,c,f,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=c!==void 0?c:qt,this.minFilter=f!==void 0?f:qt,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}}class NR extends fo{constructor(e,t){super();const n=this;let r=null,o=1,l=null,c="local-floor",f=1,u=null,d=null,p=null,A=null,g=null,E=null;const C=t.getContextAttributes();let _=null,v=null;const x=[],y=[],S=new Zn;S.layers.enable(1),S.viewport=new Gt;const w=new Zn;w.layers.enable(2),w.viewport=new Gt;const b=[S,w],B=new bR;B.layers.enable(1),B.layers.enable(2);let L=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(D){let G=x[D];return G===void 0&&(G=new zA,x[D]=G),G.getTargetRaySpace()},this.getControllerGrip=function(D){let G=x[D];return G===void 0&&(G=new zA,x[D]=G),G.getGripSpace()},this.getHand=function(D){let G=x[D];return G===void 0&&(G=new zA,x[D]=G),G.getHandSpace()};function T(D){const G=y.indexOf(D.inputSource);if(G===-1)return;const K=x[G];K!==void 0&&(K.update(D.inputSource,D.frame,u||l),K.dispatchEvent({type:D.type,data:D.inputSource}))}function N(){r.removeEventListener("select",T),r.removeEventListener("selectstart",T),r.removeEventListener("selectend",T),r.removeEventListener("squeeze",T),r.removeEventListener("squeezestart",T),r.removeEventListener("squeezeend",T),r.removeEventListener("end",N),r.removeEventListener("inputsourceschange",k);for(let D=0;D<x.length;D++){const G=y[D];G!==null&&(y[D]=null,x[D].disconnect(G))}L=null,R=null,e.setRenderTarget(_),g=null,A=null,p=null,r=null,v=null,U.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(D){o=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(D){c=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||l},this.setReferenceSpace=function(D){u=D},this.getBaseLayer=function(){return A!==null?A:g},this.getBinding=function(){return p},this.getFrame=function(){return E},this.getSession=function(){return r},this.setSession=async function(D){if(r=D,r!==null){if(_=e.getRenderTarget(),r.addEventListener("select",T),r.addEventListener("selectstart",T),r.addEventListener("selectend",T),r.addEventListener("squeeze",T),r.addEventListener("squeezestart",T),r.addEventListener("squeezeend",T),r.addEventListener("end",N),r.addEventListener("inputsourceschange",k),C.xrCompatible!==!0&&await t.makeXRCompatible(),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const G={antialias:r.renderState.layers===void 0?C.antialias:!0,alpha:!0,depth:C.depth,stencil:C.stencil,framebufferScaleFactor:o};g=new XRWebGLLayer(r,t,G),r.updateRenderState({baseLayer:g}),v=new Xi(g.framebufferWidth,g.framebufferHeight,{format:on,type:fn,colorSpace:e.outputColorSpace,stencilBuffer:C.stencil})}else{let G=null,K=null,J=null;C.depth&&(J=C.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,G=C.stencil?Ko:ao,K=C.stencil?oo:yi);const Ae={colorFormat:t.RGBA8,depthFormat:J,scaleFactor:o};p=new XRWebGLBinding(r,t),A=p.createProjectionLayer(Ae),r.updateRenderState({layers:[A]}),v=new Xi(A.textureWidth,A.textureHeight,{format:on,type:fn,depthTexture:new DR(A.textureWidth,A.textureHeight,K,void 0,void 0,void 0,void 0,void 0,void 0,G),stencilBuffer:C.stencil,colorSpace:e.outputColorSpace,samples:C.antialias?4:0});const ge=e.properties.get(v);ge.__ignoreDepthValues=A.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(f),u=null,l=await r.requestReferenceSpace(c),U.setContext(r),U.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function k(D){for(let G=0;G<D.removed.length;G++){const K=D.removed[G],J=y.indexOf(K);J>=0&&(y[J]=null,x[J].disconnect(K))}for(let G=0;G<D.added.length;G++){const K=D.added[G];let J=y.indexOf(K);if(J===-1){for(let ge=0;ge<x.length;ge++)if(ge>=y.length){y.push(K),J=ge;break}else if(y[ge]===null){y[ge]=K,J=ge;break}if(J===-1)break}const Ae=x[J];Ae&&Ae.connect(K)}}const O=new j,F=new j;function V(D,G,K){O.setFromMatrixPosition(G.matrixWorld),F.setFromMatrixPosition(K.matrixWorld);const J=O.distanceTo(F),Ae=G.projectionMatrix.elements,ge=K.projectionMatrix.elements,be=Ae[14]/(Ae[10]-1),de=Ae[14]/(Ae[10]+1),Oe=(Ae[9]+1)/Ae[5],It=(Ae[9]-1)/Ae[5],st=(Ae[8]-1)/Ae[0],oe=(ge[8]+1)/ge[0],Mt=be*st,Ne=be*oe,$e=J/(-st+oe),Ee=$e*-st;G.matrixWorld.decompose(D.position,D.quaternion,D.scale),D.translateX(Ee),D.translateZ($e),D.matrixWorld.compose(D.position,D.quaternion,D.scale),D.matrixWorldInverse.copy(D.matrixWorld).invert();const nt=be+$e,Ue=de+$e,He=Mt-Ee,ot=Ne+(J-Ee),ut=Oe*de/Ue*nt,At=It*de/Ue*nt;D.projectionMatrix.makePerspective(He,ot,ut,At,nt,Ue),D.projectionMatrixInverse.copy(D.projectionMatrix).invert()}function X(D,G){G===null?D.matrixWorld.copy(D.matrix):D.matrixWorld.multiplyMatrices(G.matrixWorld,D.matrix),D.matrixWorldInverse.copy(D.matrixWorld).invert()}this.updateCamera=function(D){if(r===null)return;B.near=w.near=S.near=D.near,B.far=w.far=S.far=D.far,(L!==B.near||R!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),L=B.near,R=B.far);const G=D.parent,K=B.cameras;X(B,G);for(let J=0;J<K.length;J++)X(K[J],G);K.length===2?V(B,S,w):B.projectionMatrix.copy(S.projectionMatrix),te(D,B,G)};function te(D,G,K){K===null?D.matrix.copy(G.matrixWorld):(D.matrix.copy(K.matrixWorld),D.matrix.invert(),D.matrix.multiply(G.matrixWorld)),D.matrix.decompose(D.position,D.quaternion,D.scale),D.updateMatrixWorld(!0),D.projectionMatrix.copy(G.projectionMatrix),D.projectionMatrixInverse.copy(G.projectionMatrixInverse),D.isPerspectiveCamera&&(D.fov=Zo*2*Math.atan(1/D.projectionMatrix.elements[5]),D.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(A===null&&g===null))return f},this.setFoveation=function(D){f=D,A!==null&&(A.fixedFoveation=D),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=D)};let q=null;function Z(D,G){if(d=G.getViewerPose(u||l),E=G,d!==null){const K=d.views;g!==null&&(e.setRenderTargetFramebuffer(v,g.framebuffer),e.setRenderTarget(v));let J=!1;K.length!==B.cameras.length&&(B.cameras.length=0,J=!0);for(let Ae=0;Ae<K.length;Ae++){const ge=K[Ae];let be=null;if(g!==null)be=g.getViewport(ge);else{const Oe=p.getViewSubImage(A,ge);be=Oe.viewport,Ae===0&&(e.setRenderTargetTextures(v,Oe.colorTexture,A.ignoreDepthValues?void 0:Oe.depthStencilTexture),e.setRenderTarget(v))}let de=b[Ae];de===void 0&&(de=new Zn,de.layers.enable(Ae),de.viewport=new Gt,b[Ae]=de),de.matrix.fromArray(ge.transform.matrix),de.matrix.decompose(de.position,de.quaternion,de.scale),de.projectionMatrix.fromArray(ge.projectionMatrix),de.projectionMatrixInverse.copy(de.projectionMatrix).invert(),de.viewport.set(be.x,be.y,be.width,be.height),Ae===0&&(B.matrix.copy(de.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),J===!0&&B.cameras.push(de)}}for(let K=0;K<x.length;K++){const J=y[K],Ae=x[K];J!==null&&Ae!==void 0&&Ae.update(J,G,u||l)}q&&q(D,G),G.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:G}),E=null}const U=new f_;U.setAnimationLoop(Z),this.setAnimationLoop=function(D){q=D},this.dispose=function(){}}}function PR(i,e){function t(_,v){_.matrixAutoUpdate===!0&&_.updateMatrix(),v.value.copy(_.matrix)}function n(_,v){v.color.getRGB(_.fogColor.value,l_(i)),v.isFog?(_.fogNear.value=v.near,_.fogFar.value=v.far):v.isFogExp2&&(_.fogDensity.value=v.density)}function r(_,v,x,y,S){v.isMeshBasicMaterial||v.isMeshLambertMaterial?o(_,v):v.isMeshToonMaterial?(o(_,v),p(_,v)):v.isMeshPhongMaterial?(o(_,v),d(_,v)):v.isMeshStandardMaterial?(o(_,v),A(_,v),v.isMeshPhysicalMaterial&&g(_,v,S)):v.isMeshMatcapMaterial?(o(_,v),E(_,v)):v.isMeshDepthMaterial?o(_,v):v.isMeshDistanceMaterial?(o(_,v),C(_,v)):v.isMeshNormalMaterial?o(_,v):v.isLineBasicMaterial?(l(_,v),v.isLineDashedMaterial&&c(_,v)):v.isPointsMaterial?f(_,v,x,y):v.isSpriteMaterial?u(_,v):v.isShadowMaterial?(_.color.value.copy(v.color),_.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function o(_,v){_.opacity.value=v.opacity,v.color&&_.diffuse.value.copy(v.color),v.emissive&&_.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.bumpMap&&(_.bumpMap.value=v.bumpMap,t(v.bumpMap,_.bumpMapTransform),_.bumpScale.value=v.bumpScale,v.side===Bn&&(_.bumpScale.value*=-1)),v.normalMap&&(_.normalMap.value=v.normalMap,t(v.normalMap,_.normalMapTransform),_.normalScale.value.copy(v.normalScale),v.side===Bn&&_.normalScale.value.negate()),v.displacementMap&&(_.displacementMap.value=v.displacementMap,t(v.displacementMap,_.displacementMapTransform),_.displacementScale.value=v.displacementScale,_.displacementBias.value=v.displacementBias),v.emissiveMap&&(_.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,_.emissiveMapTransform)),v.specularMap&&(_.specularMap.value=v.specularMap,t(v.specularMap,_.specularMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest);const x=e.get(v).envMap;if(x&&(_.envMap.value=x,_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap){_.lightMap.value=v.lightMap;const y=i._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=v.lightMapIntensity*y,t(v.lightMap,_.lightMapTransform)}v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,_.aoMapTransform))}function l(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform))}function c(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function f(_,v,x,y){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*x,_.scale.value=y*.5,v.map&&(_.map.value=v.map,t(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function d(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function p(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function A(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,_.roughnessMapTransform)),e.get(v).envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function g(_,v,x){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Bn&&_.clearcoatNormalScale.value.negate())),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=x.texture,_.transmissionSamplerSize.value.set(x.width,x.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,_.specularIntensityMapTransform))}function E(_,v){v.matcap&&(_.matcap.value=v.matcap)}function C(_,v){const x=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(x.matrixWorld),_.nearDistance.value=x.shadow.camera.near,_.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function UR(i,e,t,n){let r={},o={},l=[];const c=t.isWebGL2?i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS):0;function f(x,y){const S=y.program;n.uniformBlockBinding(x,S)}function u(x,y){let S=r[x.id];S===void 0&&(E(x),S=d(x),r[x.id]=S,x.addEventListener("dispose",_));const w=y.program;n.updateUBOMapping(x,w);const b=e.render.frame;o[x.id]!==b&&(A(x),o[x.id]=b)}function d(x){const y=p();x.__bindingPointIndex=y;const S=i.createBuffer(),w=x.__size,b=x.usage;return i.bindBuffer(i.UNIFORM_BUFFER,S),i.bufferData(i.UNIFORM_BUFFER,w,b),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,y,S),S}function p(){for(let x=0;x<c;x++)if(l.indexOf(x)===-1)return l.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function A(x){const y=r[x.id],S=x.uniforms,w=x.__cache;i.bindBuffer(i.UNIFORM_BUFFER,y);for(let b=0,B=S.length;b<B;b++){const L=S[b];if(g(L,b,w)===!0){const R=L.__offset,T=Array.isArray(L.value)?L.value:[L.value];let N=0;for(let k=0;k<T.length;k++){const O=T[k],F=C(O);typeof O=="number"?(L.__data[0]=O,i.bufferSubData(i.UNIFORM_BUFFER,R+N,L.__data)):O.isMatrix3?(L.__data[0]=O.elements[0],L.__data[1]=O.elements[1],L.__data[2]=O.elements[2],L.__data[3]=O.elements[0],L.__data[4]=O.elements[3],L.__data[5]=O.elements[4],L.__data[6]=O.elements[5],L.__data[7]=O.elements[0],L.__data[8]=O.elements[6],L.__data[9]=O.elements[7],L.__data[10]=O.elements[8],L.__data[11]=O.elements[0]):(O.toArray(L.__data,N),N+=F.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,R,L.__data)}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function g(x,y,S){const w=x.value;if(S[y]===void 0){if(typeof w=="number")S[y]=w;else{const b=Array.isArray(w)?w:[w],B=[];for(let L=0;L<b.length;L++)B.push(b[L].clone());S[y]=B}return!0}else if(typeof w=="number"){if(S[y]!==w)return S[y]=w,!0}else{const b=Array.isArray(S[y])?S[y]:[S[y]],B=Array.isArray(w)?w:[w];for(let L=0;L<b.length;L++){const R=b[L];if(R.equals(B[L])===!1)return R.copy(B[L]),!0}}return!1}function E(x){const y=x.uniforms;let S=0;const w=16;let b=0;for(let B=0,L=y.length;B<L;B++){const R=y[B],T={boundary:0,storage:0},N=Array.isArray(R.value)?R.value:[R.value];for(let k=0,O=N.length;k<O;k++){const F=N[k],V=C(F);T.boundary+=V.boundary,T.storage+=V.storage}if(R.__data=new Float32Array(T.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=S,B>0){b=S%w;const k=w-b;b!==0&&k-T.boundary<0&&(S+=w-b,R.__offset=S)}S+=T.storage}return b=S%w,b>0&&(S+=w-b),x.__size=S,x.__cache={},this}function C(x){const y={boundary:0,storage:0};return typeof x=="number"?(y.boundary=4,y.storage=4):x.isVector2?(y.boundary=8,y.storage=8):x.isVector3||x.isColor?(y.boundary=16,y.storage=12):x.isVector4?(y.boundary=16,y.storage=16):x.isMatrix3?(y.boundary=48,y.storage=48):x.isMatrix4?(y.boundary=64,y.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),y}function _(x){const y=x.target;y.removeEventListener("dispose",_);const S=l.indexOf(y.__bindingPointIndex);l.splice(S,1),i.deleteBuffer(r[y.id]),delete r[y.id],delete o[y.id]}function v(){for(const x in r)i.deleteBuffer(r[x]);l=[],r={},o={}}return{bind:f,update:u,dispose:v}}class Q_{constructor(e={}){const{canvas:t=A3(),context:n=null,depth:r=!0,stencil:o=!0,alpha:l=!1,antialias:c=!1,premultipliedAlpha:f=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:p=!1}=e;this.isWebGLRenderer=!0;let A;n!==null?A=n.getContextAttributes().alpha:A=l;const g=new Uint32Array(4),E=new Int32Array(4);let C=null,_=null;const v=[],x=[];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=Xt,this._useLegacyLights=!1,this.toneMapping=hs,this.toneMappingExposure=1;const y=this;let S=!1,w=0,b=0,B=null,L=-1,R=null;const T=new Gt,N=new Gt;let k=null;const O=new et(0);let F=0,V=t.width,X=t.height,te=1,q=null,Z=null;const U=new Gt(0,0,V,X),D=new Gt(0,0,V,X);let G=!1;const K=new DA;let J=!1,Ae=!1,ge=null;const be=new lt,de=new Ke,Oe=new j,It={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function st(){return B===null?te:1}let oe=n;function Mt(z,re){for(let ce=0;ce<z.length;ce++){const ue=z[ce],fe=t.getContext(ue,re);if(fe!==null)return fe}return null}try{const z={alpha:!0,depth:r,stencil:o,antialias:c,premultipliedAlpha:f,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${su}`),t.addEventListener("webglcontextlost",dt,!1),t.addEventListener("webglcontextrestored",ee,!1),t.addEventListener("webglcontextcreationerror",Te,!1),oe===null){const re=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&re.shift(),oe=Mt(re,z),oe===null)throw Mt(re)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&oe instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),oe.getShaderPrecisionFormat===void 0&&(oe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,$e,Ee,nt,Ue,He,ot,ut,At,H,Q,se,Ce,me,xe,We,Se,Re,Y,Me,pe,tt,je,Je;function Ge(){Ne=new Y4(oe),$e=new z4(oe,Ne,e),Ne.init($e),tt=new RR(oe,Ne,$e),Ee=new TR(oe,Ne,$e),nt=new K4(oe),Ue=new pR,He=new BR(oe,Ne,Ee,Ue,$e,tt,nt),ot=new H4(y),ut=new j4(y),At=new O3(oe,$e),je=new Q4(oe,Ne,At,$e),H=new q4(oe,At,nt,je),Q=new eB(oe,H,At,nt),Y=new Z4(oe,$e,He),We=new G4(Ue),se=new AR(y,ot,ut,Ne,$e,je,We),Ce=new PR(y,Ue),me=new mR,xe=new IR(Ne,$e),Re=new F4(y,ot,ut,Ee,Q,A,f),Se=new MR(y,Q,$e),Je=new UR(oe,nt,$e,Ee),Me=new O4(oe,Ne,nt,$e),pe=new X4(oe,Ne,nt,$e),nt.programs=se.programs,y.capabilities=$e,y.extensions=Ne,y.properties=Ue,y.renderLists=me,y.shadowMap=Se,y.state=Ee,y.info=nt}Ge();const Pe=new NR(y,oe);this.xr=Pe,this.getContext=function(){return oe},this.getContextAttributes=function(){return oe.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(z){z!==void 0&&(te=z,this.setSize(V,X,!1))},this.getSize=function(z){return z.set(V,X)},this.setSize=function(z,re,ce=!0){if(Pe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}V=z,X=re,t.width=Math.floor(z*te),t.height=Math.floor(re*te),ce===!0&&(t.style.width=z+"px",t.style.height=re+"px"),this.setViewport(0,0,z,re)},this.getDrawingBufferSize=function(z){return z.set(V*te,X*te).floor()},this.setDrawingBufferSize=function(z,re,ce){V=z,X=re,te=ce,t.width=Math.floor(z*ce),t.height=Math.floor(re*ce),this.setViewport(0,0,z,re)},this.getCurrentViewport=function(z){return z.copy(T)},this.getViewport=function(z){return z.copy(U)},this.setViewport=function(z,re,ce,ue){z.isVector4?U.set(z.x,z.y,z.z,z.w):U.set(z,re,ce,ue),Ee.viewport(T.copy(U).multiplyScalar(te).floor())},this.getScissor=function(z){return z.copy(D)},this.setScissor=function(z,re,ce,ue){z.isVector4?D.set(z.x,z.y,z.z,z.w):D.set(z,re,ce,ue),Ee.scissor(N.copy(D).multiplyScalar(te).floor())},this.getScissorTest=function(){return G},this.setScissorTest=function(z){Ee.setScissorTest(G=z)},this.setOpaqueSort=function(z){q=z},this.setTransparentSort=function(z){Z=z},this.getClearColor=function(z){return z.copy(Re.getClearColor())},this.setClearColor=function(){Re.setClearColor.apply(Re,arguments)},this.getClearAlpha=function(){return Re.getClearAlpha()},this.setClearAlpha=function(){Re.setClearAlpha.apply(Re,arguments)},this.clear=function(z=!0,re=!0,ce=!0){let ue=0;if(z){let fe=!1;if(B!==null){const ke=B.texture.format;fe=ke===Nl||ke===fu||ke===eA}if(fe){const ke=B.texture.type,Ze=ke===fn||ke===yi||ke===uu||ke===oo||ke===o1||ke===a1,at=Re.getClearColor(),Qe=Re.getClearAlpha(),gt=at.r,ft=at.g,ht=at.b;Ze?(g[0]=gt,g[1]=ft,g[2]=ht,g[3]=Qe,oe.clearBufferuiv(oe.COLOR,0,g)):(E[0]=gt,E[1]=ft,E[2]=ht,E[3]=Qe,oe.clearBufferiv(oe.COLOR,0,E))}else ue|=oe.COLOR_BUFFER_BIT}re&&(ue|=oe.DEPTH_BUFFER_BIT),ce&&(ue|=oe.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),oe.clear(ue)},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",dt,!1),t.removeEventListener("webglcontextrestored",ee,!1),t.removeEventListener("webglcontextcreationerror",Te,!1),me.dispose(),xe.dispose(),Ue.dispose(),ot.dispose(),ut.dispose(),Q.dispose(),je.dispose(),Je.dispose(),se.dispose(),Pe.dispose(),Pe.removeEventListener("sessionstart",Dn),Pe.removeEventListener("sessionend",Tt),ge&&(ge.dispose(),ge=null),an.stop()};function dt(z){z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function ee(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const z=nt.autoReset,re=Se.enabled,ce=Se.autoUpdate,ue=Se.needsUpdate,fe=Se.type;Ge(),nt.autoReset=z,Se.enabled=re,Se.autoUpdate=ce,Se.needsUpdate=ue,Se.type=fe}function Te(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function ye(z){const re=z.target;re.removeEventListener("dispose",ye),he(re)}function he(z){we(z),Ue.remove(z)}function we(z){const re=Ue.get(z).programs;re!==void 0&&(re.forEach(function(ce){se.releaseProgram(ce)}),z.isShaderMaterial&&se.releaseShaderCache(z))}this.renderBufferDirect=function(z,re,ce,ue,fe,ke){re===null&&(re=It);const Ze=fe.isMesh&&fe.matrixWorld.determinant()<0,at=Wp(z,re,ce,ue,fe);Ee.setMaterial(ue,Ze);let Qe=ce.index,gt=1;if(ue.wireframe===!0){if(Qe=H.getWireframeAttribute(ce),Qe===void 0)return;gt=2}const ft=ce.drawRange,ht=ce.attributes.position;let jt=ft.start*gt,ii=(ft.start+ft.count)*gt;ke!==null&&(jt=Math.max(jt,ke.start*gt),ii=Math.min(ii,(ke.start+ke.count)*gt)),Qe!==null?(jt=Math.max(jt,0),ii=Math.min(ii,Qe.count)):ht!=null&&(jt=Math.max(jt,0),ii=Math.min(ii,ht.count));const dn=ii-jt;if(dn<0||dn===1/0)return;je.setup(fe,ue,at,ce,Qe);let di,Bt=Me;if(Qe!==null&&(di=At.get(Qe),Bt=pe,Bt.setIndex(di)),fe.isMesh)ue.wireframe===!0?(Ee.setLineWidth(ue.wireframeLinewidth*st()),Bt.setMode(oe.LINES)):Bt.setMode(oe.TRIANGLES);else if(fe.isLine){let Et=ue.linewidth;Et===void 0&&(Et=1),Ee.setLineWidth(Et*st()),fe.isLineSegments?Bt.setMode(oe.LINES):fe.isLineLoop?Bt.setMode(oe.LINE_LOOP):Bt.setMode(oe.LINE_STRIP)}else fe.isPoints?Bt.setMode(oe.POINTS):fe.isSprite&&Bt.setMode(oe.TRIANGLES);if(fe.isInstancedMesh)Bt.renderInstances(jt,dn,fe.count);else if(ce.isInstancedBufferGeometry){const Et=ce._maxInstanceCount!==void 0?ce._maxInstanceCount:1/0,ri=Math.min(ce.instanceCount,Et);Bt.renderInstances(jt,dn,ri)}else Bt.render(jt,dn)};function qe(z,re,ce){z.transparent===!0&&z.side===Yi&&z.forceSinglePass===!1?(z.side=Bn,z.needsUpdate=!0,ws(z,re,ce),z.side=ji,z.needsUpdate=!0,ws(z,re,ce),z.side=Yi):ws(z,re,ce)}this.compile=function(z,re,ce=null){ce===null&&(ce=z),_=xe.get(ce),_.init(),x.push(_),ce.traverseVisible(function(fe){fe.isLight&&fe.layers.test(re.layers)&&(_.pushLight(fe),fe.castShadow&&_.pushShadow(fe))}),z!==ce&&z.traverseVisible(function(fe){fe.isLight&&fe.layers.test(re.layers)&&(_.pushLight(fe),fe.castShadow&&_.pushShadow(fe))}),_.setupLights(y._useLegacyLights);const ue=new Set;return z.traverse(function(fe){const ke=fe.material;if(ke)if(Array.isArray(ke))for(let Ze=0;Ze<ke.length;Ze++){const at=ke[Ze];qe(at,ce,fe),ue.add(at)}else qe(ke,ce,fe),ue.add(ke)}),x.pop(),_=null,ue},this.compileAsync=function(z,re,ce=null){const ue=this.compile(z,re,ce);return new Promise(fe=>{function ke(){if(ue.forEach(function(Ze){Ue.get(Ze).currentProgram.isReady()&&ue.delete(Ze)}),ue.size===0){fe(z);return}setTimeout(ke,10)}Ne.get("KHR_parallel_shader_compile")!==null?ke():setTimeout(ke,10)})};let pt=null;function Wt(z){pt&&pt(z)}function Dn(){an.stop()}function Tt(){an.start()}const an=new f_;an.setAnimationLoop(Wt),typeof self<"u"&&an.setContext(self),this.setAnimationLoop=function(z){pt=z,Pe.setAnimationLoop(z),z===null?an.stop():an.start()},Pe.addEventListener("sessionstart",Dn),Pe.addEventListener("sessionend",Tt),this.render=function(z,re){if(re!==void 0&&re.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),re.parent===null&&re.matrixWorldAutoUpdate===!0&&re.updateMatrixWorld(),Pe.enabled===!0&&Pe.isPresenting===!0&&(Pe.cameraAutoUpdate===!0&&Pe.updateCamera(re),re=Pe.getCamera()),z.isScene===!0&&z.onBeforeRender(y,z,re,B),_=xe.get(z,x.length),_.init(),x.push(_),be.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),K.setFromProjectionMatrix(be),Ae=this.localClippingEnabled,J=We.init(this.clippingPlanes,Ae),C=me.get(z,v.length),C.init(),v.push(C),Pt(z,re,0,y.sortObjects),C.finish(),y.sortObjects===!0&&C.sort(q,Z),this.info.render.frame++,J===!0&&We.beginShadows();const ce=_.state.shadowsArray;if(Se.render(ce,z,re),J===!0&&We.endShadows(),this.info.autoReset===!0&&this.info.reset(),Re.render(C,z),_.setupLights(y._useLegacyLights),re.isArrayCamera){const ue=re.cameras;for(let fe=0,ke=ue.length;fe<ke;fe++){const Ze=ue[fe];Ti(C,z,Ze,Ze.viewport)}}else Ti(C,z,re);B!==null&&(He.updateMultisampleRenderTarget(B),He.updateRenderTargetMipmap(B)),z.isScene===!0&&z.onAfterRender(y,z,re),je.resetDefaultState(),L=-1,R=null,x.pop(),x.length>0?_=x[x.length-1]:_=null,v.pop(),v.length>0?C=v[v.length-1]:C=null};function Pt(z,re,ce,ue){if(z.visible===!1)return;if(z.layers.test(re.layers)){if(z.isGroup)ce=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(re);else if(z.isLight)_.pushLight(z),z.castShadow&&_.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||K.intersectsSprite(z)){ue&&Oe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(be);const Ze=Q.update(z),at=z.material;at.visible&&C.push(z,Ze,at,ce,Oe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||K.intersectsObject(z))){const Ze=Q.update(z),at=z.material;if(ue&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),Oe.copy(z.boundingSphere.center)):(Ze.boundingSphere===null&&Ze.computeBoundingSphere(),Oe.copy(Ze.boundingSphere.center)),Oe.applyMatrix4(z.matrixWorld).applyMatrix4(be)),Array.isArray(at)){const Qe=Ze.groups;for(let gt=0,ft=Qe.length;gt<ft;gt++){const ht=Qe[gt],jt=at[ht.materialIndex];jt&&jt.visible&&C.push(z,Ze,jt,ce,Oe.z,ht)}}else at.visible&&C.push(z,Ze,at,ce,Oe.z,null)}}const ke=z.children;for(let Ze=0,at=ke.length;Ze<at;Ze++)Pt(ke[Ze],re,ce,ue)}function Ti(z,re,ce,ue){const fe=z.opaque,ke=z.transmissive,Ze=z.transparent;_.setupLightsView(ce),J===!0&&We.setGlobalState(y.clippingPlanes,ce),ke.length>0&&Cr(fe,ke,re,ce),ue&&Ee.viewport(T.copy(ue)),fe.length>0&&ir(fe,re,ce),ke.length>0&&ir(ke,re,ce),Ze.length>0&&ir(Ze,re,ce),Ee.buffers.depth.setTest(!0),Ee.buffers.depth.setMask(!0),Ee.buffers.color.setMask(!0),Ee.setPolygonOffset(!1)}function Cr(z,re,ce,ue){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;const ke=$e.isWebGL2;ge===null&&(ge=new Xi(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")?Jn:fn,minFilter:Pr,samples:ke?4:0})),y.getDrawingBufferSize(de),ke?ge.setSize(de.x,de.y):ge.setSize(yu(de.x),yu(de.y));const Ze=y.getRenderTarget();y.setRenderTarget(ge),y.getClearColor(O),F=y.getClearAlpha(),F<1&&y.setClearColor(16777215,.5),y.clear();const at=y.toneMapping;y.toneMapping=hs,ir(z,ce,ue),He.updateMultisampleRenderTarget(ge),He.updateRenderTargetMipmap(ge);let Qe=!1;for(let gt=0,ft=re.length;gt<ft;gt++){const ht=re[gt],jt=ht.object,ii=ht.geometry,dn=ht.material,di=ht.group;if(dn.side===Yi&&jt.layers.test(ue.layers)){const Bt=dn.side;dn.side=Bn,dn.needsUpdate=!0,Co(jt,ce,ue,ii,dn,di),dn.side=Bt,dn.needsUpdate=!0,Qe=!0}}Qe===!0&&(He.updateMultisampleRenderTarget(ge),He.updateRenderTargetMipmap(ge)),y.setRenderTarget(Ze),y.setClearColor(O,F),y.toneMapping=at}function ir(z,re,ce){const ue=re.isScene===!0?re.overrideMaterial:null;for(let fe=0,ke=z.length;fe<ke;fe++){const Ze=z[fe],at=Ze.object,Qe=Ze.geometry,gt=ue===null?Ze.material:ue,ft=Ze.group;at.layers.test(ce.layers)&&Co(at,re,ce,Qe,gt,ft)}}function Co(z,re,ce,ue,fe,ke){z.onBeforeRender(y,re,ce,ue,fe,ke),z.modelViewMatrix.multiplyMatrices(ce.matrixWorldInverse,z.matrixWorld),z.normalMatrix.getNormalMatrix(z.modelViewMatrix),fe.onBeforeRender(y,re,ce,ue,z,ke),fe.transparent===!0&&fe.side===Yi&&fe.forceSinglePass===!1?(fe.side=Bn,fe.needsUpdate=!0,y.renderBufferDirect(ce,re,ue,fe,z,ke),fe.side=ji,fe.needsUpdate=!0,y.renderBufferDirect(ce,re,ue,fe,z,ke),fe.side=Yi):y.renderBufferDirect(ce,re,ue,fe,z,ke),z.onAfterRender(y,re,ce,ue,fe,ke)}function ws(z,re,ce){re.isScene!==!0&&(re=It);const ue=Ue.get(z),fe=_.state.lights,ke=_.state.shadowsArray,Ze=fe.state.version,at=se.getParameters(z,fe.state,ke,re,ce),Qe=se.getProgramCacheKey(at);let gt=ue.programs;ue.environment=z.isMeshStandardMaterial?re.environment:null,ue.fog=re.fog,ue.envMap=(z.isMeshStandardMaterial?ut:ot).get(z.envMap||ue.environment),gt===void 0&&(z.addEventListener("dispose",ye),gt=new Map,ue.programs=gt);let ft=gt.get(Qe);if(ft!==void 0){if(ue.currentProgram===ft&&ue.lightsStateVersion===Ze)return Mf(z,at),ft}else at.uniforms=se.getUniforms(z),z.onBuild(ce,at,y),z.onBeforeCompile(at,y),ft=se.acquireProgram(at,Qe),gt.set(Qe,ft),ue.uniforms=at.uniforms;const ht=ue.uniforms;return(!z.isShaderMaterial&&!z.isRawShaderMaterial||z.clipping===!0)&&(ht.clippingPlanes=We.uniform),Mf(z,at),ue.needsLights=Tf(z),ue.lightsStateVersion=Ze,ue.needsLights&&(ht.ambientLightColor.value=fe.state.ambient,ht.lightProbe.value=fe.state.probe,ht.directionalLights.value=fe.state.directional,ht.directionalLightShadows.value=fe.state.directionalShadow,ht.spotLights.value=fe.state.spot,ht.spotLightShadows.value=fe.state.spotShadow,ht.rectAreaLights.value=fe.state.rectArea,ht.ltc_1.value=fe.state.rectAreaLTC1,ht.ltc_2.value=fe.state.rectAreaLTC2,ht.pointLights.value=fe.state.point,ht.pointLightShadows.value=fe.state.pointShadow,ht.hemisphereLights.value=fe.state.hemi,ht.directionalShadowMap.value=fe.state.directionalShadowMap,ht.directionalShadowMatrix.value=fe.state.directionalShadowMatrix,ht.spotShadowMap.value=fe.state.spotShadowMap,ht.spotLightMatrix.value=fe.state.spotLightMatrix,ht.spotLightMap.value=fe.state.spotLightMap,ht.pointShadowMap.value=fe.state.pointShadowMap,ht.pointShadowMatrix.value=fe.state.pointShadowMatrix),ue.currentProgram=ft,ue.uniformsList=null,ft}function wf(z){if(z.uniformsList===null){const re=z.currentProgram.getUniforms();z.uniformsList=Xu.seqWithValue(re.seq,z.uniforms)}return z.uniformsList}function Mf(z,re){const ce=Ue.get(z);ce.outputColorSpace=re.outputColorSpace,ce.instancing=re.instancing,ce.instancingColor=re.instancingColor,ce.skinning=re.skinning,ce.morphTargets=re.morphTargets,ce.morphNormals=re.morphNormals,ce.morphColors=re.morphColors,ce.morphTargetsCount=re.morphTargetsCount,ce.numClippingPlanes=re.numClippingPlanes,ce.numIntersection=re.numClipIntersection,ce.vertexAlphas=re.vertexAlphas,ce.vertexTangents=re.vertexTangents,ce.toneMapping=re.toneMapping}function Wp(z,re,ce,ue,fe){re.isScene!==!0&&(re=It),He.resetTextureUnits();const ke=re.fog,Ze=ue.isMeshStandardMaterial?re.environment:null,at=B===null?y.outputColorSpace:B.isXRRenderTarget===!0?B.texture.colorSpace:En,Qe=(ue.isMeshStandardMaterial?ut:ot).get(ue.envMap||Ze),gt=ue.vertexColors===!0&&!!ce.attributes.color&&ce.attributes.color.itemSize===4,ft=!!ce.attributes.tangent&&(!!ue.normalMap||ue.anisotropy>0),ht=!!ce.morphAttributes.position,jt=!!ce.morphAttributes.normal,ii=!!ce.morphAttributes.color;let dn=hs;ue.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&(dn=y.toneMapping);const di=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,Bt=di!==void 0?di.length:0,Et=Ue.get(ue),ri=_.state.lights;if(J===!0&&(Ae===!0||z!==R)){const si=z===R&&ue.id===L;We.setState(ue,z,si)}let ln=!1;ue.version===Et.__version?(Et.needsLights&&Et.lightsStateVersion!==ri.state.version||Et.outputColorSpace!==at||fe.isInstancedMesh&&Et.instancing===!1||!fe.isInstancedMesh&&Et.instancing===!0||fe.isSkinnedMesh&&Et.skinning===!1||!fe.isSkinnedMesh&&Et.skinning===!0||fe.isInstancedMesh&&Et.instancingColor===!0&&fe.instanceColor===null||fe.isInstancedMesh&&Et.instancingColor===!1&&fe.instanceColor!==null||Et.envMap!==Qe||ue.fog===!0&&Et.fog!==ke||Et.numClippingPlanes!==void 0&&(Et.numClippingPlanes!==We.numPlanes||Et.numIntersection!==We.numIntersection)||Et.vertexAlphas!==gt||Et.vertexTangents!==ft||Et.morphTargets!==ht||Et.morphNormals!==jt||Et.morphColors!==ii||Et.toneMapping!==dn||$e.isWebGL2===!0&&Et.morphTargetsCount!==Bt)&&(ln=!0):(ln=!0,Et.__version=ue.version);let Jr=Et.currentProgram;ln===!0&&(Jr=ws(ue,re,fe));let Bf=!1,Ir=!1,Ms=!1;const An=Jr.getUniforms(),Qi=Et.uniforms;if(Ee.useProgram(Jr.program)&&(Bf=!0,Ir=!0,Ms=!0),ue.id!==L&&(L=ue.id,Ir=!0),Bf||R!==z){An.setValue(oe,"projectionMatrix",z.projectionMatrix),An.setValue(oe,"viewMatrix",z.matrixWorldInverse);const si=An.map.cameraPosition;si!==void 0&&si.setValue(oe,Oe.setFromMatrixPosition(z.matrixWorld)),$e.logarithmicDepthBuffer&&An.setValue(oe,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(ue.isMeshPhongMaterial||ue.isMeshToonMaterial||ue.isMeshLambertMaterial||ue.isMeshBasicMaterial||ue.isMeshStandardMaterial||ue.isShaderMaterial)&&An.setValue(oe,"isOrthographic",z.isOrthographicCamera===!0),R!==z&&(R=z,Ir=!0,Ms=!0)}if(fe.isSkinnedMesh){An.setOptional(oe,fe,"bindMatrix"),An.setOptional(oe,fe,"bindMatrixInverse");const si=fe.skeleton;si&&($e.floatVertexTextures?(si.boneTexture===null&&si.computeBoneTexture(),An.setValue(oe,"boneTexture",si.boneTexture,He),An.setValue(oe,"boneTextureSize",si.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const uc=ce.morphAttributes;if((uc.position!==void 0||uc.normal!==void 0||uc.color!==void 0&&$e.isWebGL2===!0)&&Y.update(fe,ce,Jr),(Ir||Et.receiveShadow!==fe.receiveShadow)&&(Et.receiveShadow=fe.receiveShadow,An.setValue(oe,"receiveShadow",fe.receiveShadow)),ue.isMeshGouraudMaterial&&ue.envMap!==null&&(Qi.envMap.value=Qe,Qi.flipEnvMap.value=Qe.isCubeTexture&&Qe.isRenderTargetTexture===!1?-1:1),Ir&&(An.setValue(oe,"toneMappingExposure",y.toneMappingExposure),Et.needsLights&&Kr(Qi,Ms),ke&&ue.fog===!0&&Ce.refreshFogUniforms(Qi,ke),Ce.refreshMaterialUniforms(Qi,ue,te,X,ge),Xu.upload(oe,wf(Et),Qi,He)),ue.isShaderMaterial&&ue.uniformsNeedUpdate===!0&&(Xu.upload(oe,wf(Et),Qi,He),ue.uniformsNeedUpdate=!1),ue.isSpriteMaterial&&An.setValue(oe,"center",fe.center),An.setValue(oe,"modelViewMatrix",fe.modelViewMatrix),An.setValue(oe,"normalMatrix",fe.normalMatrix),An.setValue(oe,"modelMatrix",fe.matrixWorld),ue.isShaderMaterial||ue.isRawShaderMaterial){const si=ue.uniformsGroups;for(let Io=0,Rf=si.length;Io<Rf;Io++)if($e.isWebGL2){const Ga=si[Io];Je.update(Ga,Jr),Je.bind(Ga,Jr)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Jr}function Kr(z,re){z.ambientLightColor.needsUpdate=re,z.lightProbe.needsUpdate=re,z.directionalLights.needsUpdate=re,z.directionalLightShadows.needsUpdate=re,z.pointLights.needsUpdate=re,z.pointLightShadows.needsUpdate=re,z.spotLights.needsUpdate=re,z.spotLightShadows.needsUpdate=re,z.rectAreaLights.needsUpdate=re,z.hemisphereLights.needsUpdate=re}function Tf(z){return z.isMeshLambertMaterial||z.isMeshToonMaterial||z.isMeshPhongMaterial||z.isMeshStandardMaterial||z.isShadowMaterial||z.isShaderMaterial&&z.lights===!0}this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return B},this.setRenderTargetTextures=function(z,re,ce){Ue.get(z.texture).__webglTexture=re,Ue.get(z.depthTexture).__webglTexture=ce;const ue=Ue.get(z);ue.__hasExternalTextures=!0,ue.__hasExternalTextures&&(ue.__autoAllocateDepthBuffer=ce===void 0,ue.__autoAllocateDepthBuffer||Ne.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ue.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(z,re){const ce=Ue.get(z);ce.__webglFramebuffer=re,ce.__useDefaultFramebuffer=re===void 0},this.setRenderTarget=function(z,re=0,ce=0){B=z,w=re,b=ce;let ue=!0,fe=null,ke=!1,Ze=!1;if(z){const Qe=Ue.get(z);Qe.__useDefaultFramebuffer!==void 0?(Ee.bindFramebuffer(oe.FRAMEBUFFER,null),ue=!1):Qe.__webglFramebuffer===void 0?He.setupRenderTarget(z):Qe.__hasExternalTextures&&He.rebindTextures(z,Ue.get(z.texture).__webglTexture,Ue.get(z.depthTexture).__webglTexture);const gt=z.texture;(gt.isData3DTexture||gt.isDataArrayTexture||gt.isCompressedArrayTexture)&&(Ze=!0);const ft=Ue.get(z).__webglFramebuffer;z.isWebGLCubeRenderTarget?(Array.isArray(ft[re])?fe=ft[re][ce]:fe=ft[re],ke=!0):$e.isWebGL2&&z.samples>0&&He.useMultisampledRTT(z)===!1?fe=Ue.get(z).__webglMultisampledFramebuffer:Array.isArray(ft)?fe=ft[ce]:fe=ft,T.copy(z.viewport),N.copy(z.scissor),k=z.scissorTest}else T.copy(U).multiplyScalar(te).floor(),N.copy(D).multiplyScalar(te).floor(),k=G;if(Ee.bindFramebuffer(oe.FRAMEBUFFER,fe)&&$e.drawBuffers&&ue&&Ee.drawBuffers(z,fe),Ee.viewport(T),Ee.scissor(N),Ee.setScissorTest(k),ke){const Qe=Ue.get(z.texture);oe.framebufferTexture2D(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,oe.TEXTURE_CUBE_MAP_POSITIVE_X+re,Qe.__webglTexture,ce)}else if(Ze){const Qe=Ue.get(z.texture),gt=re||0;oe.framebufferTextureLayer(oe.FRAMEBUFFER,oe.COLOR_ATTACHMENT0,Qe.__webglTexture,ce||0,gt)}L=-1},this.readRenderTargetPixels=function(z,re,ce,ue,fe,ke,Ze){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let at=Ue.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ze!==void 0&&(at=at[Ze]),at){Ee.bindFramebuffer(oe.FRAMEBUFFER,at);try{const Qe=z.texture,gt=Qe.format,ft=Qe.type;if(gt!==on&&tt.convert(gt)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=ft===Jn&&(Ne.has("EXT_color_buffer_half_float")||$e.isWebGL2&&Ne.has("EXT_color_buffer_float"));if(ft!==fn&&tt.convert(ft)!==oe.getParameter(oe.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ft===hn&&($e.isWebGL2||Ne.has("OES_texture_float")||Ne.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re>=0&&re<=z.width-ue&&ce>=0&&ce<=z.height-fe&&oe.readPixels(re,ce,ue,fe,tt.convert(gt),tt.convert(ft),ke)}finally{const Qe=B!==null?Ue.get(B).__webglFramebuffer:null;Ee.bindFramebuffer(oe.FRAMEBUFFER,Qe)}}},this.copyFramebufferToTexture=function(z,re,ce=0){const ue=Math.pow(2,-ce),fe=Math.floor(re.image.width*ue),ke=Math.floor(re.image.height*ue);He.setTexture2D(re,0),oe.copyTexSubImage2D(oe.TEXTURE_2D,ce,0,0,z.x,z.y,fe,ke),Ee.unbindTexture()},this.copyTextureToTexture=function(z,re,ce,ue=0){const fe=re.image.width,ke=re.image.height,Ze=tt.convert(ce.format),at=tt.convert(ce.type);He.setTexture2D(ce,0),oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,ce.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,ce.unpackAlignment),re.isDataTexture?oe.texSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,fe,ke,Ze,at,re.image.data):re.isCompressedTexture?oe.compressedTexSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,re.mipmaps[0].width,re.mipmaps[0].height,Ze,re.mipmaps[0].data):oe.texSubImage2D(oe.TEXTURE_2D,ue,z.x,z.y,Ze,at,re.image),ue===0&&ce.generateMipmaps&&oe.generateMipmap(oe.TEXTURE_2D),Ee.unbindTexture()},this.copyTextureToTexture3D=function(z,re,ce,ue,fe=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ke=z.max.x-z.min.x+1,Ze=z.max.y-z.min.y+1,at=z.max.z-z.min.z+1,Qe=tt.convert(ue.format),gt=tt.convert(ue.type);let ft;if(ue.isData3DTexture)He.setTexture3D(ue,0),ft=oe.TEXTURE_3D;else if(ue.isDataArrayTexture)He.setTexture2DArray(ue,0),ft=oe.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}oe.pixelStorei(oe.UNPACK_FLIP_Y_WEBGL,ue.flipY),oe.pixelStorei(oe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),oe.pixelStorei(oe.UNPACK_ALIGNMENT,ue.unpackAlignment);const ht=oe.getParameter(oe.UNPACK_ROW_LENGTH),jt=oe.getParameter(oe.UNPACK_IMAGE_HEIGHT),ii=oe.getParameter(oe.UNPACK_SKIP_PIXELS),dn=oe.getParameter(oe.UNPACK_SKIP_ROWS),di=oe.getParameter(oe.UNPACK_SKIP_IMAGES),Bt=ce.isCompressedTexture?ce.mipmaps[0]:ce.image;oe.pixelStorei(oe.UNPACK_ROW_LENGTH,Bt.width),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,Bt.height),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,z.min.x),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,z.min.y),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,z.min.z),ce.isDataTexture||ce.isData3DTexture?oe.texSubImage3D(ft,fe,re.x,re.y,re.z,ke,Ze,at,Qe,gt,Bt.data):ce.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),oe.compressedTexSubImage3D(ft,fe,re.x,re.y,re.z,ke,Ze,at,Qe,Bt.data)):oe.texSubImage3D(ft,fe,re.x,re.y,re.z,ke,Ze,at,Qe,gt,Bt),oe.pixelStorei(oe.UNPACK_ROW_LENGTH,ht),oe.pixelStorei(oe.UNPACK_IMAGE_HEIGHT,jt),oe.pixelStorei(oe.UNPACK_SKIP_PIXELS,ii),oe.pixelStorei(oe.UNPACK_SKIP_ROWS,dn),oe.pixelStorei(oe.UNPACK_SKIP_IMAGES,di),fe===0&&ue.generateMipmaps&&oe.generateMipmap(ft),Ee.unbindTexture()},this.initTexture=function(z){z.isCubeTexture?He.setTextureCube(z,0):z.isData3DTexture?He.setTexture3D(z,0):z.isDataArrayTexture||z.isCompressedArrayTexture?He.setTexture2DArray(z,0):He.setTexture2D(z,0),Ee.unbindTexture()},this.resetState=function(){w=0,b=0,B=null,Ee.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ur}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===gu?"display-p3":"srgb",t.unpackColorSpace=Nt.workingColorSpace===Ul?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Xt?uo:L1}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===uo?Xt:En}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 kR extends Q_{}kR.prototype.isWebGL1Renderer=!0;class FR extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,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,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}}class QR{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=uA,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=qi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,o=this.stride;r<o;r++)this.array[e+r]=t.array[n+r];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=qi()),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=qi()),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 ei=new j;class GA{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.applyMatrix4(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.applyNormalMatrix(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ei.fromBufferAttribute(this,t),ei.transformDirection(e),this.setXYZ(t,ei.x,ei.y,ei.z);return this}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ot(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=Ar(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ar(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ar(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ar(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,o){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),o=Ot(o,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=o,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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}return new bn(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 GA(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 r=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[r+o])}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 O_=new j,z_=new Gt,G_=new Gt,OR=new j,H_=new lt,Ku=new j,HA=new Ji,V_=new lt,VA=new Hl;class zR extends Wn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=n1,this.bindMatrix=new lt,this.bindMatrixInverse=new lt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new gn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Ku),this.boundingBox.expandByPoint(Ku)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ji),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Ku),this.boundingSphere.expandByPoint(Ku)}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,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),HA.copy(this.boundingSphere),HA.applyMatrix4(r),e.ray.intersectsSphere(HA)!==!1&&(V_.copy(r).invert(),VA.copy(e.ray).applyMatrix4(V_),!(this.boundingBox!==null&&VA.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,VA)))}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 Gt,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===n1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===kM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;z_.fromBufferAttribute(r.attributes.skinIndex,e),G_.fromBufferAttribute(r.attributes.skinWeight,e),O_.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const l=G_.getComponent(o);if(l!==0){const c=z_.getComponent(o);H_.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(OR.copy(O_).applyMatrix4(H_),l)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class W_ extends tn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _a extends Rn{constructor(e=null,t=1,n=1,r,o,l,c,f,u=qt,d=qt,p,A){super(null,l,c,f,u,d,r,o,p,A),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const j_=new lt,GR=new lt;class WA{constructor(e=[],t=[]){this.uuid=qi(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,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,r=this.bones.length;n<r;n++)this.boneInverses.push(new lt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new lt;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,r=this.boneTexture;for(let o=0,l=e.length;o<l;o++){const c=e[o]?e[o].matrixWorld:GR;j_.multiplyMatrices(c,t[o]),j_.toArray(n,o*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new WA(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=k1(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new _a(t,e,e,on,hn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const o=e.bones[n];let l=t[o];l===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),l=new W_),this.bones.push(l),this.boneInverses.push(new lt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,o=t.length;r<o;r++){const l=t[r];e.bones.push(l.uuid);const c=n[r];e.boneInverses.push(c.toArray())}return e}}class jA extends bn{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ea=new lt,Y_=new lt,Ju=[],q_=new gn,HR=new lt,Xl=new Wn,Kl=new Ji;class VR extends Wn{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new jA(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,HR)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new gn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ea),q_.copy(e.boundingBox).applyMatrix4(Ea),this.boundingBox.union(q_)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ji),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ea),Kl.copy(e.boundingSphere).applyMatrix4(Ea),this.boundingSphere.union(Kl)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),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)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Xl.geometry=this.geometry,Xl.material=this.material,Xl.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Kl.copy(this.boundingSphere),Kl.applyMatrix4(n),e.ray.intersectsSphere(Kl)!==!1))for(let o=0;o<r;o++){this.getMatrixAt(o,Ea),Y_.multiplyMatrices(n,Ea),Xl.matrixWorld=Y_,Xl.raycast(e,Ju);for(let l=0,c=Ju.length;l<c;l++){const f=Ju[l];f.instanceId=o,f.object=this,t.push(f)}Ju.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new jA(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class X_ extends gr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new et(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 K_=new j,J_=new j,$_=new lt,YA=new Hl,$u=new Ji;class qA extends tn{constructor(e=new xi,t=new X_){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 r=1,o=t.count;r<o;r++)K_.fromBufferAttribute(t,r-1),J_.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=K_.distanceTo(J_);e.setAttribute("lineDistance",new er(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,o=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),$u.copy(n.boundingSphere),$u.applyMatrix4(r),$u.radius+=o,e.ray.intersectsSphere($u)===!1)return;$_.copy(r).invert(),YA.copy(e.ray).applyMatrix4($_);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,u=new j,d=new j,p=new j,A=new j,g=this.isLineSegments?2:1,E=n.index,_=n.attributes.position;if(E!==null){const v=Math.max(0,l.start),x=Math.min(E.count,l.start+l.count);for(let y=v,S=x-1;y<S;y+=g){const w=E.getX(y),b=E.getX(y+1);if(u.fromBufferAttribute(_,w),d.fromBufferAttribute(_,b),YA.distanceSqToSegment(u,d,A,p)>f)continue;A.applyMatrix4(this.matrixWorld);const L=e.ray.origin.distanceTo(A);L<e.near||L>e.far||t.push({distance:L,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,l.start),x=Math.min(_.count,l.start+l.count);for(let y=v,S=x-1;y<S;y+=g){if(u.fromBufferAttribute(_,y),d.fromBufferAttribute(_,y+1),YA.distanceSqToSegment(u,d,A,p)>f)continue;A.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(A);b<e.near||b>e.far||t.push({distance:b,point:p.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}const Z_=new j,eE=new j;class WR extends qA{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 r=0,o=t.count;r<o;r+=2)Z_.fromBufferAttribute(t,r),eE.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Z_.distanceTo(eE);e.setAttribute("lineDistance",new er(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class jR extends qA{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class tE extends gr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new et(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 nE=new lt,XA=new Hl,Zu=new Ji,ef=new j;class YR extends tn{constructor(e=new xi,t=new tE){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,o=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Zu.copy(n.boundingSphere),Zu.applyMatrix4(r),Zu.radius+=o,e.ray.intersectsSphere(Zu)===!1)return;nE.copy(r).invert(),XA.copy(e.ray).applyMatrix4(nE);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),f=c*c,u=n.index,p=n.attributes.position;if(u!==null){const A=Math.max(0,l.start),g=Math.min(u.count,l.start+l.count);for(let E=A,C=g;E<C;E++){const _=u.getX(E);ef.fromBufferAttribute(p,_),iE(ef,_,f,r,e,t,this)}}else{const A=Math.max(0,l.start),g=Math.min(p.count,l.start+l.count);for(let E=A,C=g;E<C;E++)ef.fromBufferAttribute(p,E),iE(ef,E,f,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o<l;o++){const c=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}function iE(i,e,t,n,r,o,l){const c=XA.distanceSqToPoint(i);if(c<t){const f=new j;XA.closestPointToPoint(i,f),f.applyMatrix4(n);const u=r.ray.origin.distanceTo(f);if(u<r.near||u>r.far)return;o.push({distance:u,distanceToRay:Math.sqrt(c),point:f,index:e,face:null,object:l})}}class tf extends Rn{constructor(e,t,n,r,o,l,c,f,u,d,p,A){super(null,l,c,f,u,d,r,o,p,A),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class qR extends tf{constructor(e,t,n,r,o,l){super(e,t,n,o,l),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Fn}}class XR extends tf{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,so),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class KR extends Si{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class KA extends gr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new et(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 et(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=D1,this.normalScale=new Ke(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class _r extends KA{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 Ke(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return yn(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 et(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 et(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new et(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 nf(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function JR(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function $R(i){function e(r,o){return i[r]-i[o]}const t=i.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort(e),n}function rE(i,e,t){const n=i.length,r=new i.constructor(n);for(let o=0,l=0;l!==n;++o){const c=t[o]*e;for(let f=0;f!==e;++f)r[l++]=i[c+f]}return r}function sE(i,e,t,n){let r=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[r++];if(o===void 0)return;let l=o[n];if(l!==void 0)if(Array.isArray(l))do l=o[n],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=i[r++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[n],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=i[r++];while(o!==void 0);else do l=o[n],l!==void 0&&(e.push(o.time),t.push(l)),o=i[r++];while(o!==void 0)}class Jl{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],o=t[n-1];e:{t:{let l;n:{i:if(!(e<r)){for(let c=n+2;;){if(r===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(o=r,r=t[++n],e<r)break t}l=t.length;break n}if(!(e>=o)){const c=t[1];e<c&&(n=2,o=c);for(let f=n-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===f)break;if(r=o,o=t[--n-1],e>=o)break t}l=n,n=0;break n}break e}for(;n<l;){const c=n+l>>>1;e<t[c]?l=c:n=c+1}if(r=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,o,r)}return this.interpolate_(n,o,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r;for(let l=0;l!==r;++l)t[l]=n[o+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class ZR extends Jl{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:T1,endingEnd:T1}}intervalChanged_(e,t,n){const r=this.parameterPositions;let o=e-2,l=e+1,c=r[o],f=r[l];if(c===void 0)switch(this.getSettings_().endingStart){case B1:o=e,c=2*t-n;break;case R1:o=r.length-2,c=t+r[o]-r[o+1];break;default:o=e,c=n}if(f===void 0)switch(this.getSettings_().endingEnd){case B1:l=e,f=2*n-t;break;case R1:l=1,f=n+r[1]-r[0];break;default:l=e-1,f=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-c),this._weightNext=u/(f-n),this._offsetPrev=o*d,this._offsetNext=l*d}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=e*c,u=f-c,d=this._offsetPrev,p=this._offsetNext,A=this._weightPrev,g=this._weightNext,E=(n-t)/(r-t),C=E*E,_=C*E,v=-A*_+2*A*C-A*E,x=(1+A)*_+(-1.5-2*A)*C+(-.5+A)*E+1,y=(-1-g)*_+(1.5+g)*C+.5*E,S=g*_-g*C;for(let w=0;w!==c;++w)o[w]=v*l[d+w]+x*l[u+w]+y*l[f+w]+S*l[p+w];return o}}class eb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=e*c,u=f-c,d=(n-t)/(r-t),p=1-d;for(let A=0;A!==c;++A)o[A]=l[u+A]*p+l[f+A]*d;return o}}class tb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Er{constructor(e,t,n,r){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=nf(t,this.TimeBufferType),this.values=nf(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:nf(e.times,Array),values:nf(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new tb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new eb(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ZR(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pl:t=this.InterpolantFactoryMethodDiscrete;break;case Jo:t=this.InterpolantFactoryMethodLinear;break;case lA: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 Pl;case this.InterpolantFactoryMethodLinear:return Jo;case this.InterpolantFactoryMethodSmooth:return lA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let o=0,l=r-1;for(;o!==r&&n[o]<e;)++o;for(;l!==-1&&n[l]>t;)--l;if(++l,o!==0||l!==r){o>=l&&(l=Math.max(l,1),o=l-1);const c=this.getValueSize();this.times=n.slice(o,l),this.values=this.values.slice(o*c,l*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,r=this.values,o=n.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==o;c++){const f=n[c];if(typeof f=="number"&&isNaN(f)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,f),e=!1;break}if(l!==null&&l>f){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,f,l),e=!1;break}l=f}if(r!==void 0&&JR(r))for(let c=0,f=r.length;c!==f;++c){const u=r[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(),r=this.getInterpolation()===lA,o=e.length-1;let l=1;for(let c=1;c<o;++c){let f=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(r)f=!0;else{const p=c*n,A=p-n,g=p+n;for(let E=0;E!==n;++E){const C=t[p+E];if(C!==t[A+E]||C!==t[g+E]){f=!0;break}}}if(f){if(c!==l){e[l]=e[c];const p=c*n,A=l*n;for(let g=0;g!==n;++g)t[A+g]=t[p+g]}++l}}if(o>0){e[l]=e[o];for(let c=o*n,f=l*n,u=0;u!==n;++u)t[f+u]=t[c+u];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Er.prototype.TimeBufferType=Float32Array,Er.prototype.ValueBufferType=Float32Array,Er.prototype.DefaultInterpolation=Jo;class ya extends Er{}ya.prototype.ValueTypeName="bool",ya.prototype.ValueBufferType=Array,ya.prototype.DefaultInterpolation=Pl,ya.prototype.InterpolantFactoryMethodLinear=void 0,ya.prototype.InterpolantFactoryMethodSmooth=void 0;class oE extends Er{}oE.prototype.ValueTypeName="color";class Ca extends Er{}Ca.prototype.ValueTypeName="number";class nb extends Jl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=(n-t)/(r-t);let u=e*c;for(let d=u+c;u!==d;u+=4)pr.slerpFlat(o,0,l,u-c,l,u,f);return o}}class _o extends Er{InterpolantFactoryMethodLinear(e){return new nb(this.times,this.values,this.getValueSize(),e)}}_o.prototype.ValueTypeName="quaternion",_o.prototype.DefaultInterpolation=Jo,_o.prototype.InterpolantFactoryMethodSmooth=void 0;class Ia extends Er{}Ia.prototype.ValueTypeName="string",Ia.prototype.ValueBufferType=Array,Ia.prototype.DefaultInterpolation=Pl,Ia.prototype.InterpolantFactoryMethodLinear=void 0,Ia.prototype.InterpolantFactoryMethodSmooth=void 0;class xa extends Er{}xa.prototype.ValueTypeName="vector";class ib{constructor(e,t=-1,n,r=GM){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=qi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let l=0,c=n.length;l!==c;++l)t.push(sb(n[l]).scale(r));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=n.length;o!==l;++o)t.push(Er.toJSON(n[o]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const o=t.length,l=[];for(let c=0;c<o;c++){let f=[],u=[];f.push((c+o-1)%o,c,(c+1)%o),u.push(0,1,0);const d=$R(f);f=rE(f,1,d),u=rE(u,1,d),!r&&f[0]===0&&(f.push(o),u.push(u[0])),l.push(new Ca(".morphTargetInfluences["+t[c].name+"]",f,u).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},o=/^([\w-]*?)([\d]+)$/;for(let c=0,f=e.length;c<f;c++){const u=e[c],d=u.name.match(o);if(d&&d.length>1){const p=d[1];let A=r[p];A||(r[p]=A=[]),A.push(u)}}const l=[];for(const c in r)l.push(this.CreateFromMorphTargetSequence(c,r[c],t,n));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(p,A,g,E,C){if(g.length!==0){const _=[],v=[];sE(g,_,v,E),_.length!==0&&C.push(new p(A,_,v))}},r=[],o=e.name||"default",l=e.fps||30,c=e.blendMode;let f=e.length||-1;const u=e.hierarchy||[];for(let p=0;p<u.length;p++){const A=u[p].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const g={};let E;for(E=0;E<A.length;E++)if(A[E].morphTargets)for(let C=0;C<A[E].morphTargets.length;C++)g[A[E].morphTargets[C]]=-1;for(const C in g){const _=[],v=[];for(let x=0;x!==A[E].morphTargets.length;++x){const y=A[E];_.push(y.time),v.push(y.morphTarget===C?1:0)}r.push(new Ca(".morphTargetInfluence["+C+"]",_,v))}f=g.length*l}else{const g=".bones["+t[p].name+"]";n(xa,g+".position",A,"pos",r),n(_o,g+".quaternion",A,"rot",r),n(xa,g+".scale",A,"scl",r)}}return r.length===0?null:new this(o,f,r,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,r=e.length;n!==r;++n){const o=this.tracks[n];t=Math.max(t,o.times[o.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 rb(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ca;case"vector":case"vector2":case"vector3":case"vector4":return xa;case"color":return oE;case"quaternion":return _o;case"bool":case"boolean":return ya;case"string":return Ia}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function sb(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=rb(i.type);if(i.times===void 0){const t=[],n=[];sE(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Sa={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class aE{constructor(e,t,n){const r=this;let o=!1,l=0,c=0,f;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,o===!1&&r.onStart!==void 0&&r.onStart(d,l,c),o=!0},this.itemEnd=function(d){l++,r.onProgress!==void 0&&r.onProgress(d,l,c),l===c&&(o=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(d){r.onError!==void 0&&r.onError(d)},this.resolveURL=function(d){return f?f(d):d},this.setURLModifier=function(d){return f=d,this},this.addHandler=function(d,p){return u.push(d,p),this},this.removeHandler=function(d){const p=u.indexOf(d);return p!==-1&&u.splice(p,2),this},this.getHandler=function(d){for(let p=0,A=u.length;p<A;p+=2){const g=u[p],E=u[p+1];if(g.global&&(g.lastIndex=0),g.test(d))return E}return null}}}const ob=new aE;class _s{constructor(e){this.manager=e!==void 0?e:ob,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,o){n.load(e,r,t,o)})}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}}_s.DEFAULT_MATERIAL_NAME="__DEFAULT";const Vr={};class ab extends Error{constructor(e,t){super(e),this.response=t}}class wa extends _s{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=Sa.get(e);if(o!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(o),this.manager.itemEnd(e)},0),o;if(Vr[e]!==void 0){Vr[e].push({onLoad:t,onProgress:n,onError:r});return}Vr[e]=[],Vr[e].push({onLoad:t,onProgress:n,onError:r});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,f=this.responseType;fetch(l).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=Vr[e],p=u.body.getReader(),A=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=A?parseInt(A):0,E=g!==0;let C=0;const _=new ReadableStream({start(v){x();function x(){p.read().then(({done:y,value:S})=>{if(y)v.close();else{C+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:E,loaded:C,total:g});for(let b=0,B=d.length;b<B;b++){const L=d[b];L.onProgress&&L.onProgress(w)}v.enqueue(S),x()}})}}});return new Response(_)}else throw new ab(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(f){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 p=/charset="?([^;"\s]*)"?/i.exec(c),A=p&&p[1]?p[1].toLowerCase():void 0,g=new TextDecoder(A);return u.arrayBuffer().then(E=>g.decode(E))}}}).then(u=>{Sa.add(e,u);const d=Vr[e];delete Vr[e];for(let p=0,A=d.length;p<A;p++){const g=d[p];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Vr[e];if(d===void 0)throw this.manager.itemError(e),u;delete Vr[e];for(let p=0,A=d.length;p<A;p++){const g=d[p];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 lb extends _s{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Sa.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const c=Ql("img");function f(){d(),Sa.add(e,this),t&&t(this),o.manager.itemEnd(e)}function u(p){d(),r&&r(p),o.manager.itemError(e),o.manager.itemEnd(e)}function d(){c.removeEventListener("load",f,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",f,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(e),c.src=e,c}}class cb extends _s{constructor(e){super(e)}load(e,t,n,r){const o=this,l=new _a,c=new wa(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(o.withCredentials),c.load(e,function(f){let u;try{u=o.parse(f)}catch(d){if(r!==void 0)r(d);else{console.error(d);return}}u.image!==void 0?l.image=u.image:u.data!==void 0&&(l.image.width=u.width,l.image.height=u.height,l.image.data=u.data),l.wrapS=u.wrapS!==void 0?u.wrapS:Fn,l.wrapT=u.wrapT!==void 0?u.wrapT:Fn,l.magFilter=u.magFilter!==void 0?u.magFilter:un,l.minFilter=u.minFilter!==void 0?u.minFilter:un,l.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0?l.colorSpace=u.colorSpace:u.encoding!==void 0&&(l.encoding=u.encoding),u.flipY!==void 0&&(l.flipY=u.flipY),u.format!==void 0&&(l.format=u.format),u.type!==void 0&&(l.type=u.type),u.mipmaps!==void 0&&(l.mipmaps=u.mipmaps,l.minFilter=Pr),u.mipmapCount===1&&(l.minFilter=un),u.generateMipmaps!==void 0&&(l.generateMipmaps=u.generateMipmaps),l.needsUpdate=!0,t&&t(l,u)},n,r),l}}class lE extends _s{constructor(e){super(e)}load(e,t,n,r){const o=new Rn,l=new lb(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(c){o.image=c,o.needsUpdate=!0,t!==void 0&&t(o)},n,r),o}}class JA extends tn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new et(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}}const $A=new lt,cE=new j,uE=new j;class ZA{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ke(512,512),this.map=null,this.mapPass=null,this.matrix=new lt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new DA,this._frameExtents=new Ke(1,1),this._viewportCount=1,this._viewports=[new Gt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;cE.setFromMatrixPosition(e.matrixWorld),t.position.copy(cE),uE.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(uE),t.updateMatrixWorld(),$A.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix($A),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply($A)}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 ub extends ZA{constructor(){super(new Zn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Zo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;(n!==t.fov||r!==t.aspect||o!==t.far)&&(t.fov=n,t.aspect=r,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class fb extends JA{constructor(e,t,n=0,r=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.distance=n,this.angle=r,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new ub}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 fE=new lt,$l=new j,ep=new j;class hb extends ZA{constructor(){super(new Zn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ke(4,2),this._viewportCount=6,this._viewports=[new Gt(2,1,1,1),new Gt(0,1,1,1),new Gt(3,1,1,1),new Gt(1,1,1,1),new Gt(3,0,1,1),new Gt(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,r=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),$l.setFromMatrixPosition(e.matrixWorld),n.position.copy($l),ep.copy(n.position),ep.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ep),n.updateMatrixWorld(),r.makeTranslation(-$l.x,-$l.y,-$l.z),fE.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fE)}}class db extends JA{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new hb}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 Ab extends ZA{constructor(){super(new Yl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class pb extends JA{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tn.DEFAULT_UP),this.updateMatrix(),this.target=new tn,this.shadow=new Ab}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class tp{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{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 gb extends _s{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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Sa.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader,fetch(e,c).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(f){Sa.add(e,f),t&&t(f),o.manager.itemEnd(e)}).catch(function(f){r&&r(f),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}class mb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=hE(),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=hE();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function hE(){return(typeof performance>"u"?Date:performance).now()}const np="\\[\\]\\.:\\/",vb=new RegExp("["+np+"]","g"),ip="[^"+np+"]",_b="[^"+np.replace("\\.","")+"]",Eb=/((?:WC+[\/:])*)/.source.replace("WC",ip),yb=/(WCOD+)?/.source.replace("WCOD",_b),Cb=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ip),Ib=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ip),xb=new RegExp("^"+Eb+yb+Cb+Ib+"$"),Sb=["material","materials","bones","map"];class wb{constructor(e,t,n){const r=n||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,o=n.length;r!==o;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}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(vb,"")}static parseTrackName(e){const t=xb.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]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const o=n.nodeName.substring(r+1);Sb.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=o)}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(o){for(let l=0;l<o.length;l++){const c=o[l];if(c.name===t||c.uuid===t)return c;const f=n(c.children);if(f)return f}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,o=n.length;r!==o;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let o=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 l=e[r];if(l===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" 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 f=this.BindingType.Direct;if(o!==void 0){if(r==="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[o]!==void 0&&(o=e.morphTargetDictionary[o])}f=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=o}else l.fromArray!==void 0&&l.toArray!==void 0?(f=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(f=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=r;this.getValue=this.GetterByBindingType[f],this.setValue=this.SetterByBindingTypeAndVersioning[f][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=wb,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 dE{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(yn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const AE=new j,rf=new j;class Wr{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){AE.subVectors(e,this.start),rf.subVectors(this.end,this.start);const n=rf.dot(rf);let o=rf.dot(AE)/n;return t&&(o=yn(o,0,1)),o}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:su}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=su);const pE={type:"change"},rp={type:"start"},gE={type:"end"},sf=new Hl,mE=new mr,Mb=Math.cos(70*AA.DEG2RAD);class Tb extends fo{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:Wo.ROTATE,MIDDLE:Wo.DOLLY,RIGHT:Wo.PAN},this.touches={ONE:jo.ROTATE,TWO:jo.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(Y){Y.addEventListener("keydown",Q),this._domElementKeyEvents=Y},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Q),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(pE),n.update(),o=r.NONE},this.update=function(){const Y=new j,Me=new pr().setFromUnitVectors(e.up,new j(0,1,0)),pe=Me.clone().invert(),tt=new j,je=new pr,Je=new j,Ge=2*Math.PI;return function(dt=null){const ee=n.object.position;Y.copy(ee).sub(n.target),Y.applyQuaternion(Me),c.setFromVector3(Y),n.autoRotate&&o===r.NONE&&N(R(dt)),n.enableDamping?(c.theta+=f.theta*n.dampingFactor,c.phi+=f.phi*n.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let Te=n.minAzimuthAngle,ye=n.maxAzimuthAngle;isFinite(Te)&&isFinite(ye)&&(Te<-Math.PI?Te+=Ge:Te>Math.PI&&(Te-=Ge),ye<-Math.PI?ye+=Ge:ye>Math.PI&&(ye-=Ge),Te<=ye?c.theta=Math.max(Te,Math.min(ye,c.theta)):c.theta=c.theta>(Te+ye)/2?Math.max(Te,c.theta):Math.min(ye,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),n.zoomToCursor&&b||n.object.isOrthographicCamera?c.radius=Z(c.radius):c.radius=Z(c.radius*u),Y.setFromSpherical(c),Y.applyQuaternion(pe),ee.copy(n.target).add(Y),n.object.lookAt(n.target),n.enableDamping===!0?(f.theta*=1-n.dampingFactor,f.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let he=!1;if(n.zoomToCursor&&b){let we=null;if(n.object.isPerspectiveCamera){const qe=Y.length();we=Z(qe*u);const pt=qe-we;n.object.position.addScaledVector(S,pt),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const qe=new j(w.x,w.y,0);qe.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),he=!0;const pt=new j(w.x,w.y,0);pt.unproject(n.object),n.object.position.sub(pt).add(qe),n.object.updateMatrixWorld(),we=Y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;we!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(we).add(n.object.position):(sf.origin.copy(n.object.position),sf.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(sf.direction))<Mb?e.lookAt(n.target):(mE.setFromNormalAndCoplanarPoint(n.object.up,n.target),sf.intersectPlane(mE,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),he=!0);return u=1,b=!1,he||tt.distanceToSquared(n.object.position)>l||8*(1-je.dot(n.object.quaternion))>l||Je.distanceToSquared(n.target)>0?(n.dispatchEvent(pE),tt.copy(n.object.position),je.copy(n.object.quaternion),Je.copy(n.target),he=!1,!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",me),n.domElement.removeEventListener("pointerdown",Ue),n.domElement.removeEventListener("pointercancel",ot),n.domElement.removeEventListener("wheel",H),n.domElement.removeEventListener("pointermove",He),n.domElement.removeEventListener("pointerup",ot),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Q),n._domElementKeyEvents=null)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=r.NONE;const l=1e-6,c=new dE,f=new dE;let u=1;const d=new j,p=new Ke,A=new Ke,g=new Ke,E=new Ke,C=new Ke,_=new Ke,v=new Ke,x=new Ke,y=new Ke,S=new j,w=new Ke;let b=!1;const B=[],L={};function R(Y){return Y!==null?2*Math.PI/60*n.autoRotateSpeed*Y:2*Math.PI/60/60*n.autoRotateSpeed}function T(){return Math.pow(.95,n.zoomSpeed)}function N(Y){f.theta-=Y}function k(Y){f.phi-=Y}const O=function(){const Y=new j;return function(pe,tt){Y.setFromMatrixColumn(tt,0),Y.multiplyScalar(-pe),d.add(Y)}}(),F=function(){const Y=new j;return function(pe,tt){n.screenSpacePanning===!0?Y.setFromMatrixColumn(tt,1):(Y.setFromMatrixColumn(tt,0),Y.crossVectors(n.object.up,Y)),Y.multiplyScalar(pe),d.add(Y)}}(),V=function(){const Y=new j;return function(pe,tt){const je=n.domElement;if(n.object.isPerspectiveCamera){const Je=n.object.position;Y.copy(Je).sub(n.target);let Ge=Y.length();Ge*=Math.tan(n.object.fov/2*Math.PI/180),O(2*pe*Ge/je.clientHeight,n.object.matrix),F(2*tt*Ge/je.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(O(pe*(n.object.right-n.object.left)/n.object.zoom/je.clientWidth,n.object.matrix),F(tt*(n.object.top-n.object.bottom)/n.object.zoom/je.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function X(Y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=Y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function te(Y){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=Y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function q(Y){if(!n.zoomToCursor)return;b=!0;const Me=n.domElement.getBoundingClientRect(),pe=Y.clientX-Me.left,tt=Y.clientY-Me.top,je=Me.width,Je=Me.height;w.x=pe/je*2-1,w.y=-(tt/Je)*2+1,S.set(w.x,w.y,1).unproject(n.object).sub(n.object.position).normalize()}function Z(Y){return Math.max(n.minDistance,Math.min(n.maxDistance,Y))}function U(Y){p.set(Y.clientX,Y.clientY)}function D(Y){q(Y),v.set(Y.clientX,Y.clientY)}function G(Y){E.set(Y.clientX,Y.clientY)}function K(Y){A.set(Y.clientX,Y.clientY),g.subVectors(A,p).multiplyScalar(n.rotateSpeed);const Me=n.domElement;N(2*Math.PI*g.x/Me.clientHeight),k(2*Math.PI*g.y/Me.clientHeight),p.copy(A),n.update()}function J(Y){x.set(Y.clientX,Y.clientY),y.subVectors(x,v),y.y>0?X(T()):y.y<0&&te(T()),v.copy(x),n.update()}function Ae(Y){C.set(Y.clientX,Y.clientY),_.subVectors(C,E).multiplyScalar(n.panSpeed),V(_.x,_.y),E.copy(C),n.update()}function ge(Y){q(Y),Y.deltaY<0?te(T()):Y.deltaY>0&&X(T()),n.update()}function be(Y){let Me=!1;switch(Y.code){case n.keys.UP:Y.ctrlKey||Y.metaKey||Y.shiftKey?k(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(0,n.keyPanSpeed),Me=!0;break;case n.keys.BOTTOM:Y.ctrlKey||Y.metaKey||Y.shiftKey?k(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(0,-n.keyPanSpeed),Me=!0;break;case n.keys.LEFT:Y.ctrlKey||Y.metaKey||Y.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(n.keyPanSpeed,0),Me=!0;break;case n.keys.RIGHT:Y.ctrlKey||Y.metaKey||Y.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):V(-n.keyPanSpeed,0),Me=!0;break}Me&&(Y.preventDefault(),n.update())}function de(){if(B.length===1)p.set(B[0].pageX,B[0].pageY);else{const Y=.5*(B[0].pageX+B[1].pageX),Me=.5*(B[0].pageY+B[1].pageY);p.set(Y,Me)}}function Oe(){if(B.length===1)E.set(B[0].pageX,B[0].pageY);else{const Y=.5*(B[0].pageX+B[1].pageX),Me=.5*(B[0].pageY+B[1].pageY);E.set(Y,Me)}}function It(){const Y=B[0].pageX-B[1].pageX,Me=B[0].pageY-B[1].pageY,pe=Math.sqrt(Y*Y+Me*Me);v.set(0,pe)}function st(){n.enableZoom&&It(),n.enablePan&&Oe()}function oe(){n.enableZoom&&It(),n.enableRotate&&de()}function Mt(Y){if(B.length==1)A.set(Y.pageX,Y.pageY);else{const pe=Re(Y),tt=.5*(Y.pageX+pe.x),je=.5*(Y.pageY+pe.y);A.set(tt,je)}g.subVectors(A,p).multiplyScalar(n.rotateSpeed);const Me=n.domElement;N(2*Math.PI*g.x/Me.clientHeight),k(2*Math.PI*g.y/Me.clientHeight),p.copy(A)}function Ne(Y){if(B.length===1)C.set(Y.pageX,Y.pageY);else{const Me=Re(Y),pe=.5*(Y.pageX+Me.x),tt=.5*(Y.pageY+Me.y);C.set(pe,tt)}_.subVectors(C,E).multiplyScalar(n.panSpeed),V(_.x,_.y),E.copy(C)}function $e(Y){const Me=Re(Y),pe=Y.pageX-Me.x,tt=Y.pageY-Me.y,je=Math.sqrt(pe*pe+tt*tt);x.set(0,je),y.set(0,Math.pow(x.y/v.y,n.zoomSpeed)),X(y.y),v.copy(x)}function Ee(Y){n.enableZoom&&$e(Y),n.enablePan&&Ne(Y)}function nt(Y){n.enableZoom&&$e(Y),n.enableRotate&&Mt(Y)}function Ue(Y){n.enabled!==!1&&(B.length===0&&(n.domElement.setPointerCapture(Y.pointerId),n.domElement.addEventListener("pointermove",He),n.domElement.addEventListener("pointerup",ot)),xe(Y),Y.pointerType==="touch"?se(Y):ut(Y))}function He(Y){n.enabled!==!1&&(Y.pointerType==="touch"?Ce(Y):At(Y))}function ot(Y){We(Y),B.length===0&&(n.domElement.releasePointerCapture(Y.pointerId),n.domElement.removeEventListener("pointermove",He),n.domElement.removeEventListener("pointerup",ot)),n.dispatchEvent(gE),o=r.NONE}function ut(Y){let Me;switch(Y.button){case 0:Me=n.mouseButtons.LEFT;break;case 1:Me=n.mouseButtons.MIDDLE;break;case 2:Me=n.mouseButtons.RIGHT;break;default:Me=-1}switch(Me){case Wo.DOLLY:if(n.enableZoom===!1)return;D(Y),o=r.DOLLY;break;case Wo.ROTATE:if(Y.ctrlKey||Y.metaKey||Y.shiftKey){if(n.enablePan===!1)return;G(Y),o=r.PAN}else{if(n.enableRotate===!1)return;U(Y),o=r.ROTATE}break;case Wo.PAN:if(Y.ctrlKey||Y.metaKey||Y.shiftKey){if(n.enableRotate===!1)return;U(Y),o=r.ROTATE}else{if(n.enablePan===!1)return;G(Y),o=r.PAN}break;default:o=r.NONE}o!==r.NONE&&n.dispatchEvent(rp)}function At(Y){switch(o){case r.ROTATE:if(n.enableRotate===!1)return;K(Y);break;case r.DOLLY:if(n.enableZoom===!1)return;J(Y);break;case r.PAN:if(n.enablePan===!1)return;Ae(Y);break}}function H(Y){n.enabled===!1||n.enableZoom===!1||o!==r.NONE||(Y.preventDefault(),n.dispatchEvent(rp),ge(Y),n.dispatchEvent(gE))}function Q(Y){n.enabled===!1||n.enablePan===!1||be(Y)}function se(Y){switch(Se(Y),B.length){case 1:switch(n.touches.ONE){case jo.ROTATE:if(n.enableRotate===!1)return;de(),o=r.TOUCH_ROTATE;break;case jo.PAN:if(n.enablePan===!1)return;Oe(),o=r.TOUCH_PAN;break;default:o=r.NONE}break;case 2:switch(n.touches.TWO){case jo.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;st(),o=r.TOUCH_DOLLY_PAN;break;case jo.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;oe(),o=r.TOUCH_DOLLY_ROTATE;break;default:o=r.NONE}break;default:o=r.NONE}o!==r.NONE&&n.dispatchEvent(rp)}function Ce(Y){switch(Se(Y),o){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;Mt(Y),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;Ne(Y),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Ee(Y),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;nt(Y),n.update();break;default:o=r.NONE}}function me(Y){n.enabled!==!1&&Y.preventDefault()}function xe(Y){B.push(Y)}function We(Y){delete L[Y.pointerId];for(let Me=0;Me<B.length;Me++)if(B[Me].pointerId==Y.pointerId){B.splice(Me,1);return}}function Se(Y){let Me=L[Y.pointerId];Me===void 0&&(Me=new Ke,L[Y.pointerId]=Me),Me.set(Y.pageX,Y.pageY)}function Re(Y){const Me=Y.pointerId===B[0].pointerId?B[1]:B[0];return L[Me.pointerId]}n.domElement.addEventListener("contextmenu",me),n.domElement.addEventListener("pointerdown",Ue),n.domElement.addEventListener("pointercancel",ot),n.domElement.addEventListener("wheel",H,{passive:!1}),this.update()}}function vE(i,e){if(e===HM)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===cA||e===b1){let t=i.getIndex();if(t===null){const l=[],c=i.getAttribute("position");if(c!==void 0){for(let f=0;f<c.count;f++)l.push(f);i.setIndex(l),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(e===cA)for(let l=1;l<=n;l++)r.push(t.getX(0)),r.push(t.getX(l)),r.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(r.push(t.getX(l)),r.push(t.getX(l+1)),r.push(t.getX(l+2))):(r.push(t.getX(l+2)),r.push(t.getX(l+1)),r.push(t.getX(l)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=i.clone();return o.setIndex(r),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}class Bb extends _s{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Nb(t)}),this.register(function(t){return new Gb(t)}),this.register(function(t){return new Hb(t)}),this.register(function(t){return new Vb(t)}),this.register(function(t){return new Ub(t)}),this.register(function(t){return new kb(t)}),this.register(function(t){return new Fb(t)}),this.register(function(t){return new Qb(t)}),this.register(function(t){return new Db(t)}),this.register(function(t){return new Ob(t)}),this.register(function(t){return new Pb(t)}),this.register(function(t){return new zb(t)}),this.register(function(t){return new bb(t)}),this.register(function(t){return new Wb(t)}),this.register(function(t){return new jb(t)})}load(e,t,n,r){const o=this;let l;this.resourcePath!==""?l=this.resourcePath:this.path!==""?l=this.path:l=tp.extractUrlBase(e),this.manager.itemStart(e);const c=function(u){r?r(u):console.error(u),o.manager.itemError(e),o.manager.itemEnd(e)},f=new wa(this.manager);f.setPath(this.path),f.setResponseType("arraybuffer"),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(u){try{o.parse(u,l,function(d){t(d),o.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,r){let o;const l={},c={},f=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(f.decode(new Uint8Array(e,0,4))===_E){try{l[wt.KHR_BINARY_GLTF]=new Yb(e)}catch(p){r&&r(p);return}o=JSON.parse(l[wt.KHR_BINARY_GLTF].content)}else o=JSON.parse(f.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new o5(o,{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 p=this.pluginCallbacks[d](u);p.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),c[p.name]=p,l[p.name]=!0}if(o.extensionsUsed)for(let d=0;d<o.extensionsUsed.length;++d){const p=o.extensionsUsed[d],A=o.extensionsRequired||[];switch(p){case wt.KHR_MATERIALS_UNLIT:l[p]=new Lb;break;case wt.KHR_DRACO_MESH_COMPRESSION:l[p]=new qb(o,this.dracoLoader);break;case wt.KHR_TEXTURE_TRANSFORM:l[p]=new Xb;break;case wt.KHR_MESH_QUANTIZATION:l[p]=new Kb;break;default:A.indexOf(p)>=0&&c[p]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+p+'".')}}u.setExtensions(l),u.setPlugins(c),u.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,o){n.parse(e,t,r,o)})}}function Rb(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const wt={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_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 bb{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const o=t.json,f=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let u;const d=new et(16777215);f.color!==void 0&&d.setRGB(f.color[0],f.color[1],f.color[2],En);const p=f.range!==void 0?f.range:0;switch(f.type){case"directional":u=new pb(d),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new db(d),u.distance=p;break;case"spot":u=new fb(d),u.distance=p,f.spot=f.spot||{},f.spot.innerConeAngle=f.spot.innerConeAngle!==void 0?f.spot.innerConeAngle:0,f.spot.outerConeAngle=f.spot.outerConeAngle!==void 0?f.spot.outerConeAngle:Math.PI/4,u.angle=f.spot.outerConeAngle,u.penumbra=1-f.spot.innerConeAngle/f.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+f.type)}return u.position.set(0,0,0),u.decay=2,ys(u,f),f.intensity!==void 0&&(u.intensity=f.intensity),u.name=t.createUniqueName(f.name||"light_"+e),r=Promise.resolve(u),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],c=(o.extensions&&o.extensions[this.name]||{}).light;return c===void 0?null:this._loadLight(c).then(function(f){return n._getNodeRef(t.cache,c,f)})}}class Lb{constructor(){this.name=wt.KHR_MATERIALS_UNLIT}getMaterialType(){return Gr}extendParams(e,t,n){const r=[];e.color=new et(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],En),e.opacity=l[3]}o.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",o.baseColorTexture,Xt))}return Promise.all(r)}}class Db{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class Nb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const c=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ke(c,c)}return Promise.all(o)}}class Pb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class Ub{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new et(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=r.extensions[this.name];if(l.sheenColorFactor!==void 0){const c=l.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],En)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,Xt)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class kb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class Fb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const c=l.attenuationColor||[1,1,1];return t.attenuationColor=new et().setRGB(c[0],c[1],c[2],En),Promise.all(o)}}class Qb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=r.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class Ob{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const c=l.specularColorFactor||[1,1,1];return t.specularColor=new et().setRGB(c[0],c[1],c[2],En),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,Xt)),Promise.all(o)}}class zb{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:_r}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],l=r.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class Gb{constructor(e){this.parser=e,this.name=wt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const o=r.extensions[this.name],l=t.options.ktx2Loader;if(!l){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,o.source,l)}}class Hb{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],c=r.images[l.source];let f=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(f=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,l.source,f);if(r.extensionsRequired&&r.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 Vb{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,o=r.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],c=r.images[l.source];let f=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.uri);u!==null&&(f=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,l.source,f);if(r.extensionsRequired&&r.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 Wb{constructor(e){this.name=wt.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 r=n.extensions[this.name],o=this.parser.getDependency("buffer",r.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(c){const f=r.byteOffset||0,u=r.byteLength||0,d=r.count,p=r.byteStride,A=new Uint8Array(c,f,u);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(d,p,A,r.mode,r.filter).then(function(g){return g.buffer}):l.ready.then(function(){const g=new ArrayBuffer(d*p);return l.decodeGltfBuffer(new Uint8Array(g),d,p,A,r.mode,r.filter),g})})}else return null}}class jb{constructor(e){this.name=wt.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 r=t.meshes[n.mesh];for(const u of r.primitives)if(u.mode!==Ui.TRIANGLES&&u.mode!==Ui.TRIANGLE_STRIP&&u.mode!==Ui.TRIANGLE_FAN&&u.mode!==void 0)return null;const l=n.extensions[this.name].attributes,c=[],f={};for(const u in l)c.push(this.parser.getDependency("accessor",l[u]).then(d=>(f[u]=d,f[u])));return c.length<1?null:(c.push(this.parser.createNodeMesh(e)),Promise.all(c).then(u=>{const d=u.pop(),p=d.isGroup?d.children:[d],A=u[0].count,g=[];for(const E of p){const C=new lt,_=new j,v=new pr,x=new j(1,1,1),y=new VR(E.geometry,E.material,A);for(let S=0;S<A;S++)f.TRANSLATION&&_.fromBufferAttribute(f.TRANSLATION,S),f.ROTATION&&v.fromBufferAttribute(f.ROTATION,S),f.SCALE&&x.fromBufferAttribute(f.SCALE,S),y.setMatrixAt(S,C.compose(_,v,x));for(const S in f)if(S==="_COLOR_0"){const w=f[S];y.instanceColor=new jA(w.array,w.itemSize,w.normalized)}else S!=="TRANSLATION"&&S!=="ROTATION"&&S!=="SCALE"&&E.geometry.setAttribute(S,f[S]);tn.prototype.copy.call(y,E),this.parser.assignFinalMaterial(y),g.push(y)}return d.isGroup?(d.clear(),d.add(...g),d):g[0]}))}}const _E="glTF",Zl=12,EE={JSON:1313821514,BIN:5130562};class Yb{constructor(e){this.name=wt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Zl),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!==_E)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-Zl,o=new DataView(e,Zl);let l=0;for(;l<r;){const c=o.getUint32(l,!0);l+=4;const f=o.getUint32(l,!0);if(l+=4,f===EE.JSON){const u=new Uint8Array(e,Zl+l,c);this.content=n.decode(u)}else if(f===EE.BIN){const u=Zl+l;this.body=e.slice(u,u+c)}l+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class qb{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=wt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,c={},f={},u={};for(const d in l){const p=op[d]||d.toLowerCase();c[p]=l[d]}for(const d in e.attributes){const p=op[d]||d.toLowerCase();if(l[d]!==void 0){const A=n.accessors[e.attributes[d]],g=Ma[A.componentType];u[p]=g.name,f[p]=A.normalized===!0}}return t.getDependency("bufferView",o).then(function(d){return new Promise(function(p){r.decodeDracoFile(d,function(A){for(const g in A.attributes){const E=A.attributes[g],C=f[g];C!==void 0&&(E.normalized=C)}p(A)},c,u)})})}}class Xb{constructor(){this.name=wt.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 Kb{constructor(){this.name=wt.KHR_MESH_QUANTIZATION}}class yE extends Jl{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,o=e*r*3+r;for(let l=0;l!==r;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,r){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,f=c*2,u=c*3,d=r-t,p=(n-t)/d,A=p*p,g=A*p,E=e*u,C=E-u,_=-2*g+3*A,v=g-A,x=1-_,y=v-A+p;for(let S=0;S!==c;S++){const w=l[C+S+c],b=l[C+S+f]*d,B=l[E+S+c],L=l[E+S]*d;o[S]=x*w+y*b+_*B+v*L}return o}}const Jb=new pr;class $b extends yE{interpolate_(e,t,n,r){const o=super.interpolate_(e,t,n,r);return Jb.fromArray(o).normalize().toArray(o),o}}const Ui={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},Ma={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},CE={9728:qt,9729:un,9984:$d,9985:r1,9986:cu,9987:Pr},IE={33071:Fn,33648:lu,10497:Xo},sp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},op={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"},Es={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Zb={CUBICSPLINE:void 0,LINEAR:Jo,STEP:Pl},ap={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function e5(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new KA({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ji})),i.DefaultMaterial}function Eo(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ys(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function t5(i,e,t){let n=!1,r=!1,o=!1;for(let u=0,d=e.length;u<d;u++){const p=e[u];if(p.POSITION!==void 0&&(n=!0),p.NORMAL!==void 0&&(r=!0),p.COLOR_0!==void 0&&(o=!0),n&&r&&o)break}if(!n&&!r&&!o)return Promise.resolve(i);const l=[],c=[],f=[];for(let u=0,d=e.length;u<d;u++){const p=e[u];if(n){const A=p.POSITION!==void 0?t.getDependency("accessor",p.POSITION):i.attributes.position;l.push(A)}if(r){const A=p.NORMAL!==void 0?t.getDependency("accessor",p.NORMAL):i.attributes.normal;c.push(A)}if(o){const A=p.COLOR_0!==void 0?t.getDependency("accessor",p.COLOR_0):i.attributes.color;f.push(A)}}return Promise.all([Promise.all(l),Promise.all(c),Promise.all(f)]).then(function(u){const d=u[0],p=u[1],A=u[2];return n&&(i.morphAttributes.position=d),r&&(i.morphAttributes.normal=p),o&&(i.morphAttributes.color=A),i.morphTargetsRelative=!0,i})}function n5(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function i5(i){let e;const t=i.extensions&&i.extensions[wt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+lp(t.attributes):e=i.indices+":"+lp(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+lp(i.targets[n]);return e}function lp(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function cp(i){switch(i){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 r5(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const s5=new lt;class o5{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Rb,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,r=!1,o=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,o=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||r&&o<98?this.textureLoader=new lE(this.options.manager):this.textureLoader=new gb(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new wa(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,r=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const c={scene:l[0][r.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:r.asset,parser:n,userData:{}};return Eo(o,c,r),ys(c,r),Promise.all(n._invokeAll(function(f){return f.afterRoot&&f.afterRoot(c)})).then(function(){e(c)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,o=t.length;r<o;r++){const l=t[r].joints;for(let c=0,f=l.length;c<f;c++)e[l[c]].isBone=!0}for(let r=0,o=e.length;r<o;r++){const l=e[r];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.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 r=n.clone(),o=(l,c)=>{const f=this.associations.get(l);f!=null&&this.associations.set(c,f);for(const[u,d]of l.children.entries())o(d,c.children[u])};return o(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const o=e(t[r]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":r=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(o,l){return n.getDependency(e,l)})),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[wt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(o,l){n.load(tp.resolveURL(t.uri,r.path),o,void 0,function(){l(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 r=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const l=sp[r.type],c=Ma[r.componentType],f=r.normalized===!0,u=new c(r.count*l);return Promise.resolve(new bn(u,l,f))}const o=[];return r.bufferView!==void 0?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),r.sparse!==void 0&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then(function(l){const c=l[0],f=sp[r.type],u=Ma[r.componentType],d=u.BYTES_PER_ELEMENT,p=d*f,A=r.byteOffset||0,g=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,E=r.normalized===!0;let C,_;if(g&&g!==p){const v=Math.floor(A/g),x="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let y=t.cache.get(x);y||(C=new u(c,v*g,r.count*g/d),y=new QR(C,g/d),t.cache.add(x,y)),_=new GA(y,f,A%g/d,E)}else c===null?C=new u(r.count*f):C=new u(c,A,r.count*f),_=new bn(C,f,E);if(r.sparse!==void 0){const v=sp.SCALAR,x=Ma[r.sparse.indices.componentType],y=r.sparse.indices.byteOffset||0,S=r.sparse.values.byteOffset||0,w=new x(l[1],y,r.sparse.count*v),b=new u(l[2],S,r.sparse.count*f);c!==null&&(_=new bn(_.array.slice(),_.itemSize,_.normalized));for(let B=0,L=w.length;B<L;B++){const R=w[B];if(_.setX(R,b[B*f]),f>=2&&_.setY(R,b[B*f+1]),f>=3&&_.setZ(R,b[B*f+2]),f>=4&&_.setW(R,b[B*f+3]),f>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let c=this.textureLoader;if(l.uri){const f=n.manager.getHandler(l.uri);f!==null&&(c=f)}return this.loadTextureImage(e,o,c)}loadTextureImage(e,t,n){const r=this,o=this.json,l=o.textures[e],c=o.images[t],f=(c.uri||c.bufferView)+":"+l.sampler;if(this.textureCache[f])return this.textureCache[f];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=l.name||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(o.samplers||{})[l.sampler]||{};return d.magFilter=CE[A.magFilter]||un,d.minFilter=CE[A.minFilter]||Pr,d.wrapS=IE[A.wrapS]||Xo,d.wrapT=IE[A.wrapT]||Xo,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[f]=u,u}loadImageSource(e,t){const n=this,r=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(p=>p.clone());const l=r.images[e],c=self.URL||self.webkitURL;let f=l.uri||"",u=!1;if(l.bufferView!==void 0)f=n.getDependency("bufferView",l.bufferView).then(function(p){u=!0;const A=new Blob([p],{type:l.mimeType});return f=c.createObjectURL(A),f});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(f).then(function(p){return new Promise(function(A,g){let E=A;t.isImageBitmapLoader===!0&&(E=function(C){const _=new Rn(C);_.needsUpdate=!0,A(_)}),t.load(tp.resolveURL(p,o.path),E,void 0,g)})}).then(function(p){return u===!0&&c.revokeObjectURL(f),p.userData.mimeType=l.mimeType||r5(l.uri),p}).catch(function(p){throw console.error("THREE.GLTFLoader: Couldn't load texture",f),p});return this.sourceCache[e]=d,d}assignTexture(e,t,n,r){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[wt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const f=o.associations.get(l);l=o.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(l,c),o.associations.set(l,f)}}return r!==void 0&&(l.colorSpace=r),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const c="PointsMaterial:"+n.uuid;let f=this.cache.get(c);f||(f=new tE,gr.prototype.copy.call(f,n),f.color.copy(n.color),f.map=n.map,f.sizeAttenuation=!1,this.cache.add(c,f)),n=f}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let f=this.cache.get(c);f||(f=new X_,gr.prototype.copy.call(f,n),f.color.copy(n.color),f.map=n.map,this.cache.add(c,f)),n=f}if(r||o||l){let c="ClonedMaterial:"+n.uuid+":";r&&(c+="derivative-tangents:"),o&&(c+="vertex-colors:"),l&&(c+="flat-shading:");let f=this.cache.get(c);f||(f=n.clone(),o&&(f.vertexColors=!0),l&&(f.flatShading=!0),r&&(f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(n))),n=f}e.material=n}getMaterialType(){return KA}loadMaterial(e){const t=this,n=this.json,r=this.extensions,o=n.materials[e];let l;const c={},f=o.extensions||{},u=[];if(f[wt.KHR_MATERIALS_UNLIT]){const p=r[wt.KHR_MATERIALS_UNLIT];l=p.getMaterialType(),u.push(p.extendParams(c,o,t))}else{const p=o.pbrMetallicRoughness||{};if(c.color=new et(1,1,1),c.opacity=1,Array.isArray(p.baseColorFactor)){const A=p.baseColorFactor;c.color.setRGB(A[0],A[1],A[2],En),c.opacity=A[3]}p.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",p.baseColorTexture,Xt)),c.metalness=p.metallicFactor!==void 0?p.metallicFactor:1,c.roughness=p.roughnessFactor!==void 0?p.roughnessFactor:1,p.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",p.metallicRoughnessTexture)),u.push(t.assignTexture(c,"roughnessMap",p.metallicRoughnessTexture))),l=this._invokeOne(function(A){return A.getMaterialType&&A.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(A){return A.extendMaterialParams&&A.extendMaterialParams(e,c)})))}o.doubleSided===!0&&(c.side=Yi);const d=o.alphaMode||ap.OPAQUE;if(d===ap.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===ap.MASK&&(c.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==Gr&&(u.push(t.assignTexture(c,"normalMap",o.normalTexture)),c.normalScale=new Ke(1,1),o.normalTexture.scale!==void 0)){const p=o.normalTexture.scale;c.normalScale.set(p,p)}if(o.occlusionTexture!==void 0&&l!==Gr&&(u.push(t.assignTexture(c,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==Gr){const p=o.emissiveFactor;c.emissive=new et().setRGB(p[0],p[1],p[2],En)}return o.emissiveTexture!==void 0&&l!==Gr&&u.push(t.assignTexture(c,"emissiveMap",o.emissiveTexture,Xt)),Promise.all(u).then(function(){const p=new l(c);return o.name&&(p.name=o.name),ys(p,o),t.associations.set(p,{materials:e}),o.extensions&&Eo(r,p,o),p})}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,r=this.primitiveCache;function o(c){return n[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(f){return xE(f,c,t)})}const l=[];for(let c=0,f=e.length;c<f;c++){const u=e[c],d=i5(u),p=r[d];if(p)l.push(p.promise);else{let A;u.extensions&&u.extensions[wt.KHR_DRACO_MESH_COMPRESSION]?A=o(u):A=xE(new xi,u,t),r[d]={primitive:u,promise:A},l.push(A)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,r=this.extensions,o=n.meshes[e],l=o.primitives,c=[];for(let f=0,u=l.length;f<u;f++){const d=l[f].material===void 0?e5(this.cache):this.getDependency("material",l[f].material);c.push(d)}return c.push(t.loadGeometries(l)),Promise.all(c).then(function(f){const u=f.slice(0,f.length-1),d=f[f.length-1],p=[];for(let g=0,E=d.length;g<E;g++){const C=d[g],_=l[g];let v;const x=u[g];if(_.mode===Ui.TRIANGLES||_.mode===Ui.TRIANGLE_STRIP||_.mode===Ui.TRIANGLE_FAN||_.mode===void 0)v=o.isSkinnedMesh===!0?new zR(C,x):new Wn(C,x),v.isSkinnedMesh===!0&&v.normalizeSkinWeights(),_.mode===Ui.TRIANGLE_STRIP?v.geometry=vE(v.geometry,b1):_.mode===Ui.TRIANGLE_FAN&&(v.geometry=vE(v.geometry,cA));else if(_.mode===Ui.LINES)v=new WR(C,x);else if(_.mode===Ui.LINE_STRIP)v=new qA(C,x);else if(_.mode===Ui.LINE_LOOP)v=new jR(C,x);else if(_.mode===Ui.POINTS)v=new YR(C,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(v.geometry.morphAttributes).length>0&&n5(v,o),v.name=t.createUniqueName(o.name||"mesh_"+e),ys(v,o),_.extensions&&Eo(r,v,_),t.assignFinalMaterial(v),p.push(v)}for(let g=0,E=p.length;g<E;g++)t.associations.set(p[g],{meshes:e,primitives:g});if(p.length===1)return o.extensions&&Eo(r,p[0],o),p[0];const A=new vs;o.extensions&&Eo(r,A,o),t.associations.set(A,{meshes:e});for(let g=0,E=p.length;g<E;g++)A.add(p[g]);return A})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Zn(AA.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new Yl(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ys(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,o=t.joints.length;r<o;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const o=r.pop(),l=r,c=[],f=[];for(let u=0,d=l.length;u<d;u++){const p=l[u];if(p){c.push(p);const A=new lt;o!==null&&A.fromArray(o.array,u*16),f.push(A)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new WA(c,f)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],o=r.name?r.name:"animation_"+e,l=[],c=[],f=[],u=[],d=[];for(let p=0,A=r.channels.length;p<A;p++){const g=r.channels[p],E=r.samplers[g.sampler],C=g.target,_=C.node,v=r.parameters!==void 0?r.parameters[E.input]:E.input,x=r.parameters!==void 0?r.parameters[E.output]:E.output;C.node!==void 0&&(l.push(this.getDependency("node",_)),c.push(this.getDependency("accessor",v)),f.push(this.getDependency("accessor",x)),u.push(E),d.push(C))}return Promise.all([Promise.all(l),Promise.all(c),Promise.all(f),Promise.all(u),Promise.all(d)]).then(function(p){const A=p[0],g=p[1],E=p[2],C=p[3],_=p[4],v=[];for(let x=0,y=A.length;x<y;x++){const S=A[x],w=g[x],b=E[x],B=C[x],L=_[x];if(S===void 0)continue;S.updateMatrix&&S.updateMatrix();const R=n._createAnimationTracks(S,w,b,B,L);if(R)for(let T=0;T<R.length;T++)v.push(R[T])}return new ib(o,void 0,v)})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,r.mesh,o);return r.weights!==void 0&&l.traverse(function(c){if(c.isMesh)for(let f=0,u=r.weights.length;f<u;f++)c.morphTargetInfluences[f]=r.weights[f]}),l})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],o=n._loadNodeShallow(e),l=[],c=r.children||[];for(let u=0,d=c.length;u<d;u++)l.push(n.getDependency("node",c[u]));const f=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([o,Promise.all(l),f]).then(function(u){const d=u[0],p=u[1],A=u[2];A!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(A,s5)});for(let g=0,E=p.length;g<E;g++)d.add(p[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?r.createUniqueName(o.name):"",c=[],f=r._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return f&&c.push(f),o.camera!==void 0&&c.push(r.getDependency("camera",o.camera).then(function(u){return r._getNodeRef(r.cameraCache,o.camera,u)})),r._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(o.isBone===!0?d=new W_:u.length>1?d=new vs:u.length===1?d=u[0]:d=new tn,d!==u[0])for(let p=0,A=u.length;p<A;p++)d.add(u[p]);if(o.name&&(d.userData.name=o.name,d.name=l),ys(d,o),o.extensions&&Eo(n,d,o),o.matrix!==void 0){const p=new lt;p.fromArray(o.matrix),d.applyMatrix4(p)}else o.translation!==void 0&&d.position.fromArray(o.translation),o.rotation!==void 0&&d.quaternion.fromArray(o.rotation),o.scale!==void 0&&d.scale.fromArray(o.scale);return r.associations.has(d)||r.associations.set(d,{}),r.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,o=new vs;n.name&&(o.name=r.createUniqueName(n.name)),ys(o,n),n.extensions&&Eo(t,o,n);const l=n.nodes||[],c=[];for(let f=0,u=l.length;f<u;f++)c.push(r.getDependency("node",l[f]));return Promise.all(c).then(function(f){for(let d=0,p=f.length;d<p;d++)o.add(f[d]);const u=d=>{const p=new Map;for(const[A,g]of r.associations)(A instanceof gr||A instanceof Rn)&&p.set(A,g);return d.traverse(A=>{const g=r.associations.get(A);g!=null&&p.set(A,g)}),p};return r.associations=u(o),o})}_createAnimationTracks(e,t,n,r,o){const l=[],c=e.name?e.name:e.uuid,f=[];Es[o.path]===Es.weights?e.traverse(function(A){A.morphTargetInfluences&&f.push(A.name?A.name:A.uuid)}):f.push(c);let u;switch(Es[o.path]){case Es.weights:u=Ca;break;case Es.rotation:u=_o;break;case Es.position:case Es.scale:u=xa;break;default:switch(n.itemSize){case 1:u=Ca;break;case 2:case 3:default:u=xa;break}break}const d=r.interpolation!==void 0?Zb[r.interpolation]:Jo,p=this._getArrayFromAccessor(n);for(let A=0,g=f.length;A<g;A++){const E=new u(f[A]+"."+Es[o.path],t.array,p,d);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),l.push(E)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=cp(t.constructor),r=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)r[o]=t[o]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof _o?$b:yE;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function a5(i,e,t){const n=e.attributes,r=new gn;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],f=c.min,u=c.max;if(f!==void 0&&u!==void 0){if(r.set(new j(f[0],f[1],f[2]),new j(u[0],u[1],u[2])),c.normalized){const d=cp(Ma[c.componentType]);r.min.multiplyScalar(d),r.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const c=new j,f=new j;for(let u=0,d=o.length;u<d;u++){const p=o[u];if(p.POSITION!==void 0){const A=t.json.accessors[p.POSITION],g=A.min,E=A.max;if(g!==void 0&&E!==void 0){if(f.setX(Math.max(Math.abs(g[0]),Math.abs(E[0]))),f.setY(Math.max(Math.abs(g[1]),Math.abs(E[1]))),f.setZ(Math.max(Math.abs(g[2]),Math.abs(E[2]))),A.normalized){const C=cp(Ma[A.componentType]);f.multiplyScalar(C)}c.max(f)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(c)}i.boundingBox=r;const l=new Ji;r.getCenter(l.center),l.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=l}function xE(i,e,t){const n=e.attributes,r=[];function o(l,c){return t.getDependency("accessor",l).then(function(f){i.setAttribute(c,f)})}for(const l in n){const c=op[l]||l.toLowerCase();c in i.attributes||r.push(o(n[l],c))}if(e.indices!==void 0&&!i.index){const l=t.getDependency("accessor",e.indices).then(function(c){i.setIndex(c)});r.push(l)}return Nt.workingColorSpace!==En&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Nt.workingColorSpace}" not supported.`),ys(i,e),a5(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?t5(i,e.targets,t):i})}class l5{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:r,msg:o,transfer:l}=this.queue.shift();this.workersResolve[e]=r,this.workers[e].postMessage(o,l)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const r=this._getIdleWorker();r!==-1?(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].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 c5=0,SE=2,u5=1,wE=2,f5=0,h5=1,d5=10,A5=0,ME=9,TE=15,BE=16,RE=22,bE=37,LE=43,DE=76,NE=83,PE=97,UE=100,kE=103,FE=109,QE=165,OE=166;class p5{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 ec{constructor(e,t,n,r){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,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 r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}const ti=[171,75,84,88,32,50,48,187,13,10,26,10];function zE(i){return typeof TextDecoder<"u"?new TextDecoder().decode(i):Buffer.from(i).toString("utf8")}function g5(i){const e=new Uint8Array(i.buffer,i.byteOffset,ti.length);if(e[0]!==ti[0]||e[1]!==ti[1]||e[2]!==ti[2]||e[3]!==ti[3]||e[4]!==ti[4]||e[5]!==ti[5]||e[6]!==ti[6]||e[7]!==ti[7]||e[8]!==ti[8]||e[9]!==ti[9]||e[10]!==ti[10]||e[11]!==ti[11])throw new Error("Missing KTX 2.0 identifier.");const t=new p5,n=17*Uint32Array.BYTES_PER_ELEMENT,r=new ec(i,ti.length,n,!0);t.vkFormat=r._nextUint32(),t.typeSize=r._nextUint32(),t.pixelWidth=r._nextUint32(),t.pixelHeight=r._nextUint32(),t.pixelDepth=r._nextUint32(),t.layerCount=r._nextUint32(),t.faceCount=r._nextUint32();const o=r._nextUint32();t.supercompressionScheme=r._nextUint32();const l=r._nextUint32(),c=r._nextUint32(),f=r._nextUint32(),u=r._nextUint32(),d=r._nextUint64(),p=r._nextUint64(),A=new ec(i,ti.length+n,3*o*8,!0);for(let te=0;te<o;te++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+A._nextUint64(),A._nextUint64()),uncompressedByteLength:A._nextUint64()});const g=new ec(i,l,c,!0),E={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:[]},C=(E.descriptorBlockSize/4-6)/4;for(let te=0;te<C;te++){const q={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&q.channelType?(q.sampleLower=g._nextInt32(),q.sampleUpper=g._nextInt32()):(q.sampleLower=g._nextUint32(),q.sampleUpper=g._nextUint32()),E.samples[te]=q}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const _=new ec(i,f,u,!0);for(;_._offset<u;){const te=_._nextUint32(),q=_._scan(te),Z=zE(q),U=_._scan(te-q.byteLength);t.keyValue[Z]=Z.match(/^ktx/i)?zE(U):U,_._offset%4&&_._skip(4-_._offset%4)}if(p<=0)return t;const v=new ec(i,d,p,!0),x=v._nextUint16(),y=v._nextUint16(),S=v._nextUint32(),w=v._nextUint32(),b=v._nextUint32(),B=v._nextUint32(),L=[];for(let te=0;te<o;te++)L.push({imageFlags:v._nextUint32(),rgbSliceByteOffset:v._nextUint32(),rgbSliceByteLength:v._nextUint32(),alphaSliceByteOffset:v._nextUint32(),alphaSliceByteLength:v._nextUint32()});const R=d+v._offset,T=R+S,N=T+w,k=N+b,O=new Uint8Array(i.buffer,i.byteOffset+R,S),F=new Uint8Array(i.buffer,i.byteOffset+T,w),V=new Uint8Array(i.buffer,i.byteOffset+N,b),X=new Uint8Array(i.buffer,i.byteOffset+k,B);return t.globalData={endpointCount:x,selectorCount:y,imageDescs:L,endpointsData:O,selectorsData:F,tablesData:V,extendedData:X},t}let up,jr,fp;const hp={env:{emscripten_notify_memory_growth:function(i){fp=new Uint8Array(jr.exports.memory.buffer)}}};class m5{init(){return up||(up=typeof fetch<"u"?fetch("data:application/wasm;base64,"+GE).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,hp)).then(this._init):WebAssembly.instantiate(Buffer.from(GE,"base64"),hp).then(this._init),up)}_init(e){jr=e.instance,hp.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!jr)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=jr.exports.malloc(n);fp.set(e,r),t=t||Number(jr.exports.ZSTD_findDecompressedSize(r,n));const o=jr.exports.malloc(t),l=jr.exports.ZSTD_decompress(o,t,r,n),c=fp.slice(o,o+l);return jr.exports.free(r),jr.exports.free(o),c}}const GE="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",dp=new WeakMap;let Ap=0,pp;class yr extends _s{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new l5,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}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(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")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const e=new wa(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new wa(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const r=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,r]).then(([o,l])=>{const c=yr.BasisWorker.toString(),f=["/* constants */","let _EngineFormat = "+JSON.stringify(yr.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(yr.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(yr.BasisFormat),"/* basis_transcoder.js */",o,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3621
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([f])),this.transcoderBinary=l,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})}),Ap>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Ap++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const o=new wa(this.manager);o.setResponseType("arraybuffer"),o.setWithCredentials(this.withCredentials),o.load(e,l=>{if(dp.has(l))return dp.get(l).promise.then(t).catch(r);this._createTexture(l).then(c=>t?t(c):null).catch(r)},n,r)}_createTextureFrom(e,t){const{faces:n,width:r,height:o,format:l,type:c,error:f,dfdFlags:u}=e;if(c==="error")return Promise.reject(f);let d;if(t.faceCount===6)d=new XR(n,l,fn);else{const p=n[0].mipmaps;d=t.layerCount>1?new qR(p,r,o,t.layerCount,l,fn):new tf(p,r,o,l,fn)}return d.minFilter=n[0].mipmaps.length===1?un:Pr,d.magFilter=un,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=HE(t),d.premultiplyAlpha=!!(u&u5),d}async _createTexture(e,t={}){const n=g5(new Uint8Array(e));if(n.vkFormat!==A5)return _5(n);const r=t,o=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:r},[e])).then(l=>this._createTextureFrom(l.data,n));return dp.set(e,{promise:o}),o}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Ap--,this}}yr.BasisFormat={ETC1S:0,UASTC_4x4:1},yr.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},yr.EngineFormat={RGBAFormat:on,RGBA_ASTC_4x4_Format:aA,RGBA_BPTC_Format:pu,RGBA_ETC2_EAC_Format:oA,RGBA_PVRTC_4BPPV1_Format:rA,RGBA_S3TC_DXT5_Format:du,RGB_ETC1_Format:u1,RGB_ETC2_Format:sA,RGB_PVRTC_4BPPV1_Format:iA,RGB_S3TC_DXT1_Format:hu},yr.BasisWorker=function(){let i,e,t;const n=_EngineFormat,r=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(E){const C=E.data;switch(C.type){case"init":i=C.config,l(C.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:_,buffers:v,width:x,height:y,hasAlpha:S,format:w,dfdFlags:b}=c(C.buffer);self.postMessage({type:"transcode",id:C.id,faces:_,width:x,height:y,hasAlpha:S,format:w,dfdFlags:b},v)}catch(_){console.error(_),self.postMessage({type:"error",id:C.id,error:_.message})}});break}});function l(E){e=new Promise(C=>{t={wasmBinary:E,onRuntimeInitialized:C},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(E){const C=new t.KTX2File(new Uint8Array(E));function _(){C.close(),C.delete()}if(!C.isValid())throw _(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const v=C.isUASTC()?o.UASTC_4x4:o.ETC1S,x=C.getWidth(),y=C.getHeight(),S=C.getLayers()||1,w=C.getLevels(),b=C.getFaces(),B=C.getHasAlpha(),L=C.getDFDFlags(),{transcoderFormat:R,engineFormat:T}=p(v,x,y,B);if(!x||!y||!w)throw _(),new Error("THREE.KTX2Loader: Invalid texture");if(!C.startTranscoding())throw _(),new Error("THREE.KTX2Loader: .startTranscoding failed");const N=[],k=[];for(let O=0;O<b;O++){const F=[];for(let V=0;V<w;V++){const X=[];let te,q;for(let U=0;U<S;U++){const D=C.getImageLevelInfo(V,U,O);O===0&&V===0&&U===0&&(D.origWidth%4!==0||D.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?(te=D.origWidth,q=D.origHeight):(te=D.width,q=D.height);const G=new Uint8Array(C.getImageTranscodedSizeInBytes(V,U,0,R));if(!C.transcodeImage(G,V,U,O,R,0,-1,-1))throw _(),new Error("THREE.KTX2Loader: .transcodeImage failed.");X.push(G)}const Z=g(X);F.push({data:Z,width:te,height:q}),k.push(Z.buffer)}N.push({mipmaps:F,width:x,height:y,format:T})}return _(),{faces:N,buffers:k,width:x,height:y,hasAlpha:B,format:T,dfdFlags:L}}const f=[{if:"astcSupported",basisFormat:[o.UASTC_4x4],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.BC1,r.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC_4x4],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=f.sort(function(E,C){return E.priorityETC1S-C.priorityETC1S}),d=f.sort(function(E,C){return E.priorityUASTC-C.priorityUASTC});function p(E,C,_,v){let x,y;const S=E===o.ETC1S?u:d;for(let w=0;w<S.length;w++){const b=S[w];if(i[b.if]&&b.basisFormat.includes(E)&&!(v&&b.transcoderFormat.length<2)&&!(b.needsPowerOfTwo&&!(A(C)&&A(_))))return x=b.transcoderFormat[v?1:0],y=b.engineFormat[v?1:0],{transcoderFormat:x,engineFormat:y}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),x=r.RGBA32,y=n.RGBAFormat,{transcoderFormat:x,engineFormat:y}}function A(E){return E<=2?!0:(E&E-1)===0&&E!==0}function g(E){if(E.length===1)return E[0];let C=0;for(let x=0;x<E.length;x++){const y=E[x];C+=y.byteLength}const _=new Uint8Array(C);let v=0;for(let x=0;x<E.length;x++){const y=E[x];_.set(y,v),v+=y.byteLength}return _}};const v5=new Set([on,co,lo]),gp={[FE]:on,[PE]:on,[bE]:on,[LE]:on,[kE]:co,[NE]:co,[BE]:co,[RE]:co,[UE]:lo,[DE]:lo,[TE]:lo,[ME]:lo,[OE]:Au,[QE]:Au},mp={[FE]:hn,[PE]:Jn,[bE]:fn,[LE]:fn,[kE]:hn,[NE]:Jn,[BE]:fn,[RE]:fn,[UE]:hn,[DE]:Jn,[TE]:fn,[ME]:fn,[OE]:fn,[QE]:fn};async function _5(i){const{vkFormat:e}=i;if(gp[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;i.supercompressionScheme===SE&&(pp||(pp=new Promise(async o=>{const l=new m5;await l.init(),o(l)})),t=await pp);const n=[];for(let o=0;o<i.levels.length;o++){const l=Math.max(1,i.pixelWidth>>o),c=Math.max(1,i.pixelHeight>>o),f=i.pixelDepth?Math.max(1,i.pixelDepth>>o):0,u=i.levels[o];let d;if(i.supercompressionScheme===c5)d=u.levelData;else if(i.supercompressionScheme===SE)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let p;mp[e]===hn?p=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):mp[e]===Jn?p=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):p=d,n.push({data:p,width:l,height:c,depth:f})}let r;if(v5.has(gp[e]))r=i.pixelDepth===0?new _a(n[0].data,i.pixelWidth,i.pixelHeight):new W1(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth);else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");r=new tf(n,i.pixelWidth,i.pixelHeight)}return r.mipmaps=n,r.type=mp[e],r.format=gp[e],r.colorSpace=HE(i),r.needsUpdate=!0,Promise.resolve(r)}function HE(i){const e=i.dataFormatDescriptor[0];return e.colorPrimaries===h5?e.transferFunction===wE?Xt:En:e.colorPrimaries===d5?e.transferFunction===wE?gu:Ul:(e.colorPrimaries===f5||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ci)}class E5 extends cb{constructor(e){super(e),this.type=Jn}parse(e){const l=function(L,R){switch(L){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(R||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(R||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(R||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(R||""))}},d=`
3622
3622
  `,p=function(L,R,T){R=R||1024;let k=L.pos,O=-1,F=0,V="",X=String.fromCharCode.apply(null,new Uint16Array(L.subarray(k,k+128)));for(;0>(O=X.indexOf(d))&&F<R&&k<L.byteLength;)V+=X,F+=X.length,k+=128,X+=String.fromCharCode.apply(null,new Uint16Array(L.subarray(k,k+128)));return-1<O?(T!==!1&&(L.pos+=F+O+1),V+X.slice(0,O)):!1},A=function(L){const R=/^#\?(\S+)/,T=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,N=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,k=/^\s*FORMAT=(\S+)\s*$/,O=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,F={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let V,X;for((L.pos>=L.byteLength||!(V=p(L)))&&l(1,"no header found"),(X=V.match(R))||l(3,"bad initial token"),F.valid|=1,F.programtype=X[1],F.string+=V+`
3623
3623
  `;V=p(L),V!==!1;){if(F.string+=V+`
3624
3624
  `,V.charAt(0)==="#"){F.comments+=V+`
3625
- `;continue}if((X=V.match(T))&&(F.gamma=parseFloat(X[1])),(X=V.match(N))&&(F.exposure=parseFloat(X[1])),(X=V.match(k))&&(F.valid|=2,F.format=X[1]),(X=V.match(O))&&(F.valid|=4,F.height=parseInt(X[1],10),F.width=parseInt(X[2],10)),F.valid&2&&F.valid&4)break}return F.valid&2||l(3,"missing format specifier"),F.valid&4||l(3,"missing image size specifier"),F},g=function(L,R,T){const N=R;if(N<8||N>32767||L[0]!==2||L[1]!==2||L[2]&128)return new Uint8Array(L);N!==(L[2]<<8|L[3])&&l(3,"wrong scanline width");const k=new Uint8Array(4*R*T);k.length||l(4,"unable to allocate buffer space");let O=0,F=0;const V=4*N,X=new Uint8Array(4),te=new Uint8Array(V);let Y=T;for(;Y>0&&F<L.byteLength;){F+4>L.byteLength&&l(1),X[0]=L[F++],X[1]=L[F++],X[2]=L[F++],X[3]=L[F++],(X[0]!=2||X[1]!=2||(X[2]<<8|X[3])!=N)&&l(3,"bad rgbe scanline format");let $=0,U;for(;$<V&&F<L.byteLength;){U=L[F++];const G=U>128;if(G&&(U-=128),(U===0||$+U>V)&&l(3,"bad scanline data"),G){const K=L[F++];for(let J=0;J<U;J++)te[$++]=K}else te.set(L.subarray(F,F+U),$),$+=U,F+=U}const D=N;for(let G=0;G<D;G++){let K=0;k[O]=te[G+K],K+=N,k[O+1]=te[G+K],K+=N,k[O+2]=te[G+K],K+=N,k[O+3]=te[G+K],O+=4}Y--}return k},E=function(L,R,T,N){const k=L[R+3],O=Math.pow(2,k-128)/255;T[N+0]=L[R+0]*O,T[N+1]=L[R+1]*O,T[N+2]=L[R+2]*O,T[N+3]=1},C=function(L,R,T,N){const k=L[R+3],O=Math.pow(2,k-128)/255;T[N+0]=Du.toHalfFloat(Math.min(L[R+0]*O,65504)),T[N+1]=Du.toHalfFloat(Math.min(L[R+1]*O,65504)),T[N+2]=Du.toHalfFloat(Math.min(L[R+2]*O,65504)),T[N+3]=Du.toHalfFloat(1)},_=new Uint8Array(e);_.pos=0;const v=A(_),S=v.width,y=v.height,x=g(_.subarray(_.pos),S,y);let w,b,B;switch(this.type){case hn:B=x.length/4;const L=new Float32Array(B*4);for(let T=0;T<B;T++)E(x,T*4,L,T*4);w=L,b=hn;break;case Jn:B=x.length/4;const R=new Uint16Array(B*4);for(let T=0;T<B;T++)C(x,T*4,R,T*4);w=R,b=Jn;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:S,height:y,data:w,header:v.string,gamma:v.gamma,exposure:v.exposure,type:b}}setDataType(e){return this.type=e,this}load(e,t,n,r){function o(l,c){switch(l.type){case hn:case Jn:l.colorSpace=En,l.minFilter=un,l.magFilter=un,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,c)}return super.load(e,o,n,r)}}const y5={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
3625
+ `;continue}if((X=V.match(T))&&(F.gamma=parseFloat(X[1])),(X=V.match(N))&&(F.exposure=parseFloat(X[1])),(X=V.match(k))&&(F.valid|=2,F.format=X[1]),(X=V.match(O))&&(F.valid|=4,F.height=parseInt(X[1],10),F.width=parseInt(X[2],10)),F.valid&2&&F.valid&4)break}return F.valid&2||l(3,"missing format specifier"),F.valid&4||l(3,"missing image size specifier"),F},g=function(L,R,T){const N=R;if(N<8||N>32767||L[0]!==2||L[1]!==2||L[2]&128)return new Uint8Array(L);N!==(L[2]<<8|L[3])&&l(3,"wrong scanline width");const k=new Uint8Array(4*R*T);k.length||l(4,"unable to allocate buffer space");let O=0,F=0;const V=4*N,X=new Uint8Array(4),te=new Uint8Array(V);let q=T;for(;q>0&&F<L.byteLength;){F+4>L.byteLength&&l(1),X[0]=L[F++],X[1]=L[F++],X[2]=L[F++],X[3]=L[F++],(X[0]!=2||X[1]!=2||(X[2]<<8|X[3])!=N)&&l(3,"bad rgbe scanline format");let Z=0,U;for(;Z<V&&F<L.byteLength;){U=L[F++];const G=U>128;if(G&&(U-=128),(U===0||Z+U>V)&&l(3,"bad scanline data"),G){const K=L[F++];for(let J=0;J<U;J++)te[Z++]=K}else te.set(L.subarray(F,F+U),Z),Z+=U,F+=U}const D=N;for(let G=0;G<D;G++){let K=0;k[O]=te[G+K],K+=N,k[O+1]=te[G+K],K+=N,k[O+2]=te[G+K],K+=N,k[O+3]=te[G+K],O+=4}q--}return k},E=function(L,R,T,N){const k=L[R+3],O=Math.pow(2,k-128)/255;T[N+0]=L[R+0]*O,T[N+1]=L[R+1]*O,T[N+2]=L[R+2]*O,T[N+3]=1},C=function(L,R,T,N){const k=L[R+3],O=Math.pow(2,k-128)/255;T[N+0]=Du.toHalfFloat(Math.min(L[R+0]*O,65504)),T[N+1]=Du.toHalfFloat(Math.min(L[R+1]*O,65504)),T[N+2]=Du.toHalfFloat(Math.min(L[R+2]*O,65504)),T[N+3]=Du.toHalfFloat(1)},_=new Uint8Array(e);_.pos=0;const v=A(_),x=v.width,y=v.height,S=g(_.subarray(_.pos),x,y);let w,b,B;switch(this.type){case hn:B=S.length/4;const L=new Float32Array(B*4);for(let T=0;T<B;T++)E(S,T*4,L,T*4);w=L,b=hn;break;case Jn:B=S.length/4;const R=new Uint16Array(B*4);for(let T=0;T<B;T++)C(S,T*4,R,T*4);w=R,b=Jn;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:x,height:y,data:w,header:v.string,gamma:v.gamma,exposure:v.exposure,type:b}}setDataType(e){return this.type=e,this}load(e,t,n,r){function o(l,c){switch(l.type){case hn:case Jn:l.colorSpace=En,l.minFilter=un,l.magFilter=un,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,c)}return super.load(e,o,n,r)}}const y5={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
3626
3626
 
3627
3627
  varying vec2 vUv;
3628
3628
 
@@ -3704,7 +3704,7 @@ void main() {
3704
3704
 
3705
3705
  #endif
3706
3706
 
3707
- }`};class B5 extends tc{constructor(){super();const e=T5;this.uniforms=Hu.clone(e.uniforms),this.material=new KR({name:e.name,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new VE(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={},Nt.getTransfer(this._outputColorSpace)===Vt&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===$v?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===e1?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===t1?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===Kd&&(this.material.defines.ACES_FILMIC_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 R5 extends tc{constructor(e,t,n=null,r=null,o=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=o,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new tt}render(e,t,n){const r=e.autoClear;e.autoClear=!1;let o,l;this.overrideMaterial!==null&&(l=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(o=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(o),this.overrideMaterial!==null&&(this.scene.overrideMaterial=l),e.autoClear=r}}const b5={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
3707
+ }`};class B5 extends tc{constructor(){super();const e=T5;this.uniforms=Hu.clone(e.uniforms),this.material=new KR({name:e.name,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new VE(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={},Nt.getTransfer(this._outputColorSpace)===Vt&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===Zv?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===e1?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===t1?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===Kd&&(this.material.defines.ACES_FILMIC_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 R5 extends tc{constructor(e,t,n=null,r=null,o=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=o,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new et}render(e,t,n){const r=e.autoClear;e.autoClear=!1;let o,l;this.overrideMaterial!==null&&(l=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(o=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(o),this.overrideMaterial!==null&&(this.scene.overrideMaterial=l),e.autoClear=r}}const b5={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
3708
3708
 
3709
3709
  varying vec2 vUv;
3710
3710
 
@@ -3768,7 +3768,7 @@ void main() {
3768
3768
 
3769
3769
  gl_FragColor = sum;
3770
3770
 
3771
- }`},jE=0,D5=1,YE=2,qE=2,vp=1.25,XE=1,yo=6*4+4+4,of=65535,N5=Math.pow(2,-24),_p=Symbol("SKIP_GENERATION");function KE(i){return i.index?i.index.count:i.attributes.position.count}function Ta(i){return KE(i)/3}function JE(i,e=ArrayBuffer){return i>65535?new Uint32Array(new e(4*i)):new Uint16Array(new e(2*i))}function P5(i,e){if(!i.index){const t=i.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=JE(t,n);i.setIndex(new bn(r,1));for(let o=0;o<t;o++)r[o]=o}}function ZE(i){const e=Ta(i),t=i.drawRange,n=t.start/3,r=(t.start+t.count)/3,o=Math.max(0,n),l=Math.min(e,r)-o;return[{offset:Math.floor(o),count:Math.floor(l)}]}function $E(i){if(!i.groups||!i.groups.length)return ZE(i);const e=[],t=new Set,n=i.drawRange,r=n.start/3,o=(n.start+n.count)/3;for(const c of i.groups){const f=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(r,f)),t.add(Math.min(o,u))}const l=Array.from(t.values()).sort((c,f)=>c-f);for(let c=0;c<l.length-1;c++){const f=l[c],u=l[c+1];e.push({offset:Math.floor(f),count:Math.floor(u-f)})}return e}function U5(i){if(i.groups.length===0)return!1;const e=Ta(i),t=$E(i).sort((o,l)=>o.offset-l.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let r=0;return t.forEach(({count:o})=>r+=o),e!==r}function nn(i,e,t){return t.min.x=e[i],t.min.y=e[i+1],t.min.z=e[i+2],t.max.x=e[i+3],t.max.y=e[i+4],t.max.z=e[i+5],t}function k5(i){i[0]=i[1]=i[2]=1/0,i[3]=i[4]=i[5]=-1/0}function ey(i){let e=-1,t=-1/0;for(let n=0;n<3;n++){const r=i[n+3]-i[n];r>t&&(t=r,e=n)}return e}function ty(i,e){e.set(i)}function ny(i,e,t){let n,r;for(let o=0;o<3;o++){const l=o+3;n=i[o],r=e[o],t[o]=n<r?n:r,n=i[l],r=e[l],t[l]=n>r?n:r}}function af(i,e,t){for(let n=0;n<3;n++){const r=e[i+2*n],o=e[i+2*n+1],l=r-o,c=r+o;l<t[n]&&(t[n]=l),c>t[n+3]&&(t[n+3]=c)}}function nc(i){const e=i[3]-i[0],t=i[4]-i[1],n=i[5]-i[2];return 2*(e*t+t*n+n*e)}function Ep(i,e,t,n,r=null){let o=1/0,l=1/0,c=1/0,f=-1/0,u=-1/0,d=-1/0,p=1/0,A=1/0,g=1/0,E=-1/0,C=-1/0,_=-1/0;const v=r!==null;for(let S=e*6,y=(e+t)*6;S<y;S+=6){const x=i[S+0],w=i[S+1],b=x-w,B=x+w;b<o&&(o=b),B>f&&(f=B),v&&x<p&&(p=x),v&&x>E&&(E=x);const L=i[S+2],R=i[S+3],T=L-R,N=L+R;T<l&&(l=T),N>u&&(u=N),v&&L<A&&(A=L),v&&L>C&&(C=L);const k=i[S+4],O=i[S+5],F=k-O,V=k+O;F<c&&(c=F),V>d&&(d=V),v&&k<g&&(g=k),v&&k>_&&(_=k)}n[0]=o,n[1]=l,n[2]=c,n[3]=f,n[4]=u,n[5]=d,v&&(r[0]=p,r[1]=A,r[2]=g,r[3]=E,r[4]=C,r[5]=_)}function F5(i,e,t,n){let r=1/0,o=1/0,l=1/0,c=-1/0,f=-1/0,u=-1/0;for(let d=e*6,p=(e+t)*6;d<p;d+=6){const A=i[d+0];A<r&&(r=A),A>c&&(c=A);const g=i[d+2];g<o&&(o=g),g>f&&(f=g);const E=i[d+4];E<l&&(l=E),E>u&&(u=E)}n[0]=r,n[1]=o,n[2]=l,n[3]=c,n[4]=f,n[5]=u}function Q5(i,e){k5(e);const t=i.attributes.position,n=i.index?i.index.array:null,r=Ta(i),o=new Float32Array(r*6),l=t.normalized,c=t.array,f=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let p=0;p<r;p++){const A=p*3,g=p*6;let E=A+0,C=A+1,_=A+2;n&&(E=n[E],C=n[C],_=n[_]),l||(E=E*u+f,C=C*u+f,_=_*u+f);for(let v=0;v<3;v++){let S,y,x;l?(S=t[d[v]](E),y=t[d[v]](C),x=t[d[v]](_)):(S=c[E+v],y=c[C+v],x=c[_+v]);let w=S;y<w&&(w=y),x<w&&(w=x);let b=S;y>b&&(b=y),x>b&&(b=x);const B=(b-w)/2,L=v*2;o[g+L+0]=w+B,o[g+L+1]=B+(Math.abs(w)+B)*N5,w<e[v]&&(e[v]=w),b>e[v+3]&&(e[v+3]=b)}}return o}const Yr=32,O5=(i,e)=>i.candidate-e.candidate,Cs=new Array(Yr).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),lf=new Float32Array(6);function z5(i,e,t,n,r,o){let l=-1,c=0;if(o===jE)l=ey(e),l!==-1&&(c=(e[l]+e[l+3])/2);else if(o===D5)l=ey(i),l!==-1&&(c=G5(t,n,r,l));else if(o===YE){const f=nc(i);let u=vp*r;const d=n*6,p=(n+r)*6;for(let A=0;A<3;A++){const g=e[A],_=(e[A+3]-g)/Yr;if(r<Yr/4){const v=[...Cs];v.length=r;let S=0;for(let x=d;x<p;x+=6,S++){const w=v[S];w.candidate=t[x+2*A],w.count=0;const{bounds:b,leftCacheBounds:B,rightCacheBounds:L}=w;for(let R=0;R<3;R++)L[R]=1/0,L[R+3]=-1/0,B[R]=1/0,B[R+3]=-1/0,b[R]=1/0,b[R+3]=-1/0;af(x,t,b)}v.sort(O5);let y=r;for(let x=0;x<y;x++){const w=v[x];for(;x+1<y&&v[x+1].candidate===w.candidate;)v.splice(x+1,1),y--}for(let x=d;x<p;x+=6){const w=t[x+2*A];for(let b=0;b<y;b++){const B=v[b];w>=B.candidate?af(x,t,B.rightCacheBounds):(af(x,t,B.leftCacheBounds),B.count++)}}for(let x=0;x<y;x++){const w=v[x],b=w.count,B=r-w.count,L=w.leftCacheBounds,R=w.rightCacheBounds;let T=0;b!==0&&(T=nc(L)/f);let N=0;B!==0&&(N=nc(R)/f);const k=XE+vp*(T*b+N*B);k<u&&(l=A,u=k,c=w.candidate)}}else{for(let y=0;y<Yr;y++){const x=Cs[y];x.count=0,x.candidate=g+_+y*_;const w=x.bounds;for(let b=0;b<3;b++)w[b]=1/0,w[b+3]=-1/0}for(let y=d;y<p;y+=6){let b=~~((t[y+2*A]-g)/_);b>=Yr&&(b=Yr-1);const B=Cs[b];B.count++,af(y,t,B.bounds)}const v=Cs[Yr-1];ty(v.bounds,v.rightCacheBounds);for(let y=Yr-2;y>=0;y--){const x=Cs[y],w=Cs[y+1];ny(x.bounds,w.rightCacheBounds,x.rightCacheBounds)}let S=0;for(let y=0;y<Yr-1;y++){const x=Cs[y],w=x.count,b=x.bounds,L=Cs[y+1].rightCacheBounds;w!==0&&(S===0?ty(b,lf):ny(b,lf,lf)),S+=w;let R=0,T=0;S!==0&&(R=nc(lf)/f);const N=r-S;N!==0&&(T=nc(L)/f);const k=XE+vp*(R*S+T*N);k<u&&(l=A,u=k,c=x.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);return{axis:l,pos:c}}function G5(i,e,t,n){let r=0;for(let o=e,l=e+t;o<l;o++)r+=i[o*6+n*2];return r/t}class cf{constructor(){}}function H5(i,e,t,n,r,o){let l=n,c=n+r-1;const f=o.pos,u=o.axis*2;for(;;){for(;l<=c&&t[l*6+u]<f;)l++;for(;l<=c&&t[c*6+u]>=f;)c--;if(l<c){for(let d=0;d<3;d++){let p=e[l*3+d];e[l*3+d]=e[c*3+d],e[c*3+d]=p}for(let d=0;d<6;d++){let p=t[l*6+d];t[l*6+d]=t[c*6+d],t[c*6+d]=p}l++,c--}else return l}}function V5(i,e,t,n,r,o){let l=n,c=n+r-1;const f=o.pos,u=o.axis*2;for(;;){for(;l<=c&&t[l*6+u]<f;)l++;for(;l<=c&&t[c*6+u]>=f;)c--;if(l<c){let d=i[l];i[l]=i[c],i[c]=d;for(let p=0;p<6;p++){let A=t[l*6+p];t[l*6+p]=t[c*6+p],t[c*6+p]=A}l++,c--}else return l}}function W5(i,e){const t=(i.index?i.index.count:i.attributes.position.count)/3,n=t>2**16,r=n?4:2,o=e?new SharedArrayBuffer(t*r):new ArrayBuffer(t*r),l=n?new Uint32Array(o):new Uint16Array(o);for(let c=0,f=l.length;c<f;c++)l[c]=c;return l}function j5(i,e){const t=i.geometry,n=t.index?t.index.array:null,r=e.maxDepth,o=e.verbose,l=e.maxLeafTris,c=e.strategy,f=e.onProgress,u=Ta(t),d=i._indirectBuffer;let p=!1;const A=new Float32Array(6),g=new Float32Array(6),E=Q5(t,A),C=e.indirect?V5:H5,_=[],v=e.indirect?ZE(t):$E(t);if(v.length===1){const x=v[0],w=new cf;w.boundingData=A,F5(E,x.offset,x.count,g),y(w,x.offset,x.count,g),_.push(w)}else for(let x of v){const w=new cf;w.boundingData=new Float32Array(6),Ep(E,x.offset,x.count,w.boundingData,g),y(w,x.offset,x.count,g),_.push(w)}return _;function S(x){f&&f(x/u)}function y(x,w,b,B=null,L=0){if(!p&&L>=r&&(p=!0,o&&(console.warn(`MeshBVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),b<=l||L>=r)return S(w+b),x.offset=w,x.count=b,x;const R=z5(x.boundingData,B,E,w,b,c);if(R.axis===-1)return S(w+b),x.offset=w,x.count=b,x;const T=C(d,n,E,w,b,R);if(T===w||T===w+b)S(w+b),x.offset=w,x.count=b;else{x.splitAxis=R.axis;const N=new cf,k=w,O=T-w;x.left=N,N.boundingData=new Float32Array(6),Ep(E,k,O,N.boundingData,g),y(N,k,O,g,L+1);const F=new cf,V=T,X=b-O;x.right=F,F.boundingData=new Float32Array(6),Ep(E,V,X,F.boundingData,g),y(F,V,X,g,L+1)}return x}}function Y5(i,e){const t=i.geometry;e.indirect&&(i._indirectBuffer=W5(t,e.useSharedArrayBuffer),U5(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.')),i._indirectBuffer||P5(t,e);const n=j5(i,e);let r,o,l;const c=[],f=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let p=0;p<n.length;p++){const A=n[p];let g=u(A);const E=new f(yo*g);r=new Float32Array(E),o=new Uint32Array(E),l=new Uint16Array(E),d(0,A),c.push(E)}i._roots=c;return;function u(p){return p.count?1:1+u(p.left)+u(p.right)}function d(p,A){const g=p/4,E=p/2,C=!!A.count,_=A.boundingData;for(let v=0;v<6;v++)r[g+v]=_[v];if(C){const v=A.offset,S=A.count;return o[g+6]=v,l[E+14]=S,l[E+15]=of,p+yo}else{const v=A.left,S=A.right,y=A.splitAxis;let x;if(x=d(p+yo,v),x/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return o[g+6]=x/4,x=d(x,S),o[g+7]=y,x}}}class qr{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,r=-1/0;for(let o=0,l=e.length;o<l;o++){const f=e[o][t];n=f<n?f:n,r=f>r?f:r}this.min=n,this.max=r}setFromPoints(e,t){let n=1/0,r=-1/0;for(let o=0,l=t.length;o<l;o++){const c=t[o],f=e.dot(c);n=f<n?f:n,r=f>r?f:r}this.min=n,this.max=r}isSeparated(e){return this.min>e.max||e.min>this.max}}qr.prototype.setFromBox=function(){const i=new j;return function(t,n){const r=n.min,o=n.max;let l=1/0,c=-1/0;for(let f=0;f<=1;f++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){i.x=r.x*f+o.x*(1-f),i.y=r.y*u+o.y*(1-u),i.z=r.z*d+o.z*(1-d);const p=t.dot(i);l=Math.min(p,l),c=Math.max(p,c)}this.min=l,this.max=c}}();const q5=function(){const i=new j,e=new j,t=new j;return function(r,o,l){const c=r.start,f=i,u=o.start,d=e;t.subVectors(c,u),i.subVectors(r.end,r.start),e.subVectors(o.end,o.start);const p=t.dot(d),A=d.dot(f),g=d.dot(d),E=t.dot(f),_=f.dot(f)*g-A*A;let v,S;_!==0?v=(p*A-E*g)/_:v=0,S=(p+v*A)/g,l.x=v,l.y=S}}(),yp=function(){const i=new Ke,e=new j,t=new j;return function(r,o,l,c){q5(r,o,i);let f=i.x,u=i.y;if(f>=0&&f<=1&&u>=0&&u<=1){r.at(f,l),o.at(u,c);return}else if(f>=0&&f<=1){u<0?o.at(0,c):o.at(1,c),r.closestPointToPoint(c,!0,l);return}else if(u>=0&&u<=1){f<0?r.at(0,l):r.at(1,l),o.closestPointToPoint(l,!0,c);return}else{let d;f<0?d=r.start:d=r.end;let p;u<0?p=o.start:p=o.end;const A=e,g=t;if(r.closestPointToPoint(p,!0,e),o.closestPointToPoint(d,!0,t),A.distanceToSquared(p)<=g.distanceToSquared(d)){l.copy(A),c.copy(p);return}else{l.copy(d),c.copy(g);return}}}}(),X5=function(){const i=new j,e=new j,t=new mr,n=new Wr;return function(o,l){const{radius:c,center:f}=o,{a:u,b:d,c:p}=l;if(n.start=u,n.end=d,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c||(n.start=u,n.end=p,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c)||(n.start=d,n.end=p,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c))return!0;const C=l.getPlane(t);if(Math.abs(C.distanceToPoint(f))<=c){const v=C.projectPoint(f,e);if(l.containsPoint(v))return!0}return!1}}(),K5=1e-15;function Cp(i){return Math.abs(i)<K5}class tr extends Hn{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new j),this.satBounds=new Array(4).fill().map(()=>new qr),this.points=[this.a,this.b,this.c],this.sphere=new Ji,this.plane=new mr,this.needsUpdate=!0}intersectsSphere(e){return X5(e,this)}update(){const e=this.a,t=this.b,n=this.c,r=this.points,o=this.satAxes,l=this.satBounds,c=o[0],f=l[0];this.getNormal(c),f.setFromPoints(c,r);const u=o[1],d=l[1];u.subVectors(e,t),d.setFromPoints(u,r);const p=o[2],A=l[2];p.subVectors(t,n),A.setFromPoints(p,r);const g=o[3],E=l[3];g.subVectors(n,e),E.setFromPoints(g,r),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}tr.prototype.closestPointToSegment=function(){const i=new j,e=new j,t=new Wr;return function(r,o=null,l=null){const{start:c,end:f}=r,u=this.points;let d,p=1/0;for(let A=0;A<3;A++){const g=(A+1)%3;t.start.copy(u[A]),t.end.copy(u[g]),yp(t,r,i,e),d=i.distanceToSquared(e),d<p&&(p=d,o&&o.copy(i),l&&l.copy(e))}return this.closestPointToPoint(c,i),d=c.distanceToSquared(i),d<p&&(p=d,o&&o.copy(i),l&&l.copy(c)),this.closestPointToPoint(f,i),d=f.distanceToSquared(i),d<p&&(p=d,o&&o.copy(i),l&&l.copy(f)),Math.sqrt(p)}}(),tr.prototype.intersectsTriangle=function(){const i=new tr,e=new Array(3),t=new Array(3),n=new qr,r=new qr,o=new j,l=new j,c=new j,f=new j,u=new j,d=new Wr,p=new Wr,A=new Wr,g=new j;function E(C,_,v){const S=C.points;let y=0,x=-1;for(let w=0;w<3;w++){const{start:b,end:B}=d;b.copy(S[w]),B.copy(S[(w+1)%3]),d.delta(l);const L=Cp(_.distanceToPoint(b));if(Cp(_.normal.dot(l))&&L){v.copy(d),y=2;break}const R=_.intersectLine(d,g);if(!R&&L&&g.copy(b),(R||L)&&!Cp(g.distanceTo(B))){if(y<=1)(y===1?v.start:v.end).copy(g),L&&(x=y);else if(y>=2){(x===1?v.start:v.end).copy(g),y=2;break}if(y++,y===2&&x===-1)break}}return y}return function(_,v=null,S=!1){this.needsUpdate&&this.update(),_.isExtendedTriangle?_.needsUpdate&&_.update():(i.copy(_),i.update(),_=i);const y=this.plane,x=_.plane;if(Math.abs(y.normal.dot(x.normal))>1-1e-10){const w=this.satBounds,b=this.satAxes;t[0]=_.a,t[1]=_.b,t[2]=_.c;for(let R=0;R<4;R++){const T=w[R],N=b[R];if(n.setFromPoints(N,t),T.isSeparated(n))return!1}const B=_.satBounds,L=_.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let R=0;R<4;R++){const T=B[R],N=L[R];if(n.setFromPoints(N,e),T.isSeparated(n))return!1}for(let R=0;R<4;R++){const T=b[R];for(let N=0;N<4;N++){const k=L[N];if(o.crossVectors(T,k),n.setFromPoints(o,e),r.setFromPoints(o,t),n.isSeparated(r))return!1}}return v&&(S||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),v.start.set(0,0,0),v.end.set(0,0,0)),!0}else{const w=E(this,x,p);if(w===1&&_.containsPoint(p.end))return v&&(v.start.copy(p.end),v.end.copy(p.end)),!0;if(w!==2)return!1;const b=E(_,y,A);if(b===1&&this.containsPoint(A.end))return v&&(v.start.copy(A.end),v.end.copy(A.end)),!0;if(b!==2)return!1;if(p.delta(c),A.delta(f),c.dot(f)<0){let O=A.start;A.start=A.end,A.end=O}const B=p.start.dot(c),L=p.end.dot(c),R=A.start.dot(c),T=A.end.dot(c),N=L<R,k=B<T;return B!==T&&R!==L&&N===k?!1:(v&&(u.subVectors(p.start,A.start),u.dot(c)>0?v.start.copy(p.start):v.start.copy(A.start),u.subVectors(p.end,A.end),u.dot(c)<0?v.end.copy(p.end):v.end.copy(A.end)),!0)}}}(),tr.prototype.distanceToPoint=function(){const i=new j;return function(t){return this.closestPointToPoint(t,i),t.distanceTo(i)}}(),tr.prototype.distanceToTriangle=function(){const i=new j,e=new j,t=["a","b","c"],n=new Wr,r=new Wr;return function(l,c=null,f=null){const u=c||f?n:null;if(this.intersectsTriangle(l,u))return(c||f)&&(c&&u.getCenter(c),f&&u.getCenter(f)),0;let d=1/0;for(let p=0;p<3;p++){let A;const g=t[p],E=l[g];this.closestPointToPoint(E,i),A=E.distanceToSquared(i),A<d&&(d=A,c&&c.copy(i),f&&f.copy(E));const C=this[g];l.closestPointToPoint(C,i),A=C.distanceToSquared(i),A<d&&(d=A,c&&c.copy(C),f&&f.copy(i))}for(let p=0;p<3;p++){const A=t[p],g=t[(p+1)%3];n.set(this[A],this[g]);for(let E=0;E<3;E++){const C=t[E],_=t[(E+1)%3];r.set(l[C],l[_]),yp(n,r,i,e);const v=i.distanceToSquared(e);v<d&&(d=v,c&&c.copy(i),f&&f.copy(e))}}return Math.sqrt(d)}}();class ni{constructor(e,t,n){this.isOrientedBox=!0,this.min=new j,this.max=new j,this.matrix=new ct,this.invMatrix=new ct,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 qr),this.alignedSatBounds=new Array(3).fill().map(()=>new qr),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}}ni.prototype.update=function(){return function(){const e=this.matrix,t=this.min,n=this.max,r=this.points;for(let u=0;u<=1;u++)for(let d=0;d<=1;d++)for(let p=0;p<=1;p++){const A=1*u|2*d|4*p,g=r[A];g.x=u?n.x:t.x,g.y=d?n.y:t.y,g.z=p?n.z:t.z,g.applyMatrix4(e)}const o=this.satBounds,l=this.satAxes,c=r[0];for(let u=0;u<3;u++){const d=l[u],p=o[u],A=1<<u,g=r[A];d.subVectors(c,g),p.setFromPoints(d,r)}const f=this.alignedSatBounds;f[0].setFromPointsField(r,"x"),f[1].setFromPointsField(r,"y"),f[2].setFromPointsField(r,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),ni.prototype.intersectsBox=function(){const i=new qr;return function(t){this.needsUpdate&&this.update();const n=t.min,r=t.max,o=this.satBounds,l=this.satAxes,c=this.alignedSatBounds;if(i.min=n.x,i.max=r.x,c[0].isSeparated(i)||(i.min=n.y,i.max=r.y,c[1].isSeparated(i))||(i.min=n.z,i.max=r.z,c[2].isSeparated(i)))return!1;for(let f=0;f<3;f++){const u=l[f],d=o[f];if(i.setFromBox(u,t),d.isSeparated(i))return!1}return!0}}(),ni.prototype.intersectsTriangle=function(){const i=new tr,e=new Array(3),t=new qr,n=new qr,r=new j;return function(l){this.needsUpdate&&this.update(),l.isExtendedTriangle?l.needsUpdate&&l.update():(i.copy(l),i.update(),l=i);const c=this.satBounds,f=this.satAxes;e[0]=l.a,e[1]=l.b,e[2]=l.c;for(let A=0;A<3;A++){const g=c[A],E=f[A];if(t.setFromPoints(E,e),g.isSeparated(t))return!1}const u=l.satBounds,d=l.satAxes,p=this.points;for(let A=0;A<3;A++){const g=u[A],E=d[A];if(t.setFromPoints(E,p),g.isSeparated(t))return!1}for(let A=0;A<3;A++){const g=f[A];for(let E=0;E<4;E++){const C=d[E];if(r.crossVectors(g,C),t.setFromPoints(r,e),n.setFromPoints(r,p),t.isSeparated(n))return!1}}return!0}}(),ni.prototype.closestPointToPoint=function(){return function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}(),ni.prototype.distanceToPoint=function(){const i=new j;return function(t){return this.closestPointToPoint(t,i),t.distanceTo(i)}}(),ni.prototype.distanceToBox=function(){const i=["x","y","z"],e=new Array(12).fill().map(()=>new Wr),t=new Array(12).fill().map(()=>new Wr),n=new j,r=new j;return function(l,c=0,f=null,u=null){if(this.needsUpdate&&this.update(),this.intersectsBox(l))return(f||u)&&(l.getCenter(r),this.closestPointToPoint(r,n),l.closestPointToPoint(n,r),f&&f.copy(n),u&&u.copy(r)),0;const d=c*c,p=l.min,A=l.max,g=this.points;let E=1/0;for(let _=0;_<8;_++){const v=g[_];r.copy(v).clamp(p,A);const S=v.distanceToSquared(r);if(S<E&&(E=S,f&&f.copy(v),u&&u.copy(r),S<d))return Math.sqrt(S)}let C=0;for(let _=0;_<3;_++)for(let v=0;v<=1;v++)for(let S=0;S<=1;S++){const y=(_+1)%3,x=(_+2)%3,w=v<<y|S<<x,b=1<<_|v<<y|S<<x,B=g[w],L=g[b];e[C].set(B,L);const T=i[_],N=i[y],k=i[x],O=t[C],F=O.start,V=O.end;F[T]=p[T],F[N]=v?p[N]:A[N],F[k]=S?p[k]:A[N],V[T]=A[T],V[N]=v?p[N]:A[N],V[k]=S?p[k]:A[N],C++}for(let _=0;_<=1;_++)for(let v=0;v<=1;v++)for(let S=0;S<=1;S++){r.x=_?A.x:p.x,r.y=v?A.y:p.y,r.z=S?A.z:p.z,this.closestPointToPoint(r,n);const y=r.distanceToSquared(n);if(y<E&&(E=y,f&&f.copy(n),u&&u.copy(r),y<d))return Math.sqrt(y)}for(let _=0;_<12;_++){const v=e[_];for(let S=0;S<12;S++){const y=t[S];yp(v,y,n,r);const x=n.distanceToSquared(r);if(x<E&&(E=x,f&&f.copy(n),u&&u.copy(r),x<d))return Math.sqrt(x)}}return Math.sqrt(E)}}();class Ip{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 J5 extends Ip{constructor(){super(()=>new tr)}}const ki=new J5;function ui(i,e){return e[i+15]===65535}function fi(i,e){return e[i+6]}function wi(i,e){return e[i+14]}function Fi(i){return i+8}function Mi(i,e){return e[i+6]}function xp(i,e){return e[i+7]}function qN(i){return i}class Z5{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 Kt=new Z5;let Is,Ba;const Ra=[],uf=new Ip(()=>new gn);function $5(i,e,t,n,r,o){Is=uf.getPrimitive(),Ba=uf.getPrimitive(),Ra.push(Is,Ba),Kt.setBuffer(i._roots[e]);const l=Sp(0,i.geometry,t,n,r,o);Kt.clearBuffer(),uf.releasePrimitive(Is),uf.releasePrimitive(Ba),Ra.pop(),Ra.pop();const c=Ra.length;return c>0&&(Ba=Ra[c-1],Is=Ra[c-2]),l}function Sp(i,e,t,n,r=null,o=0,l=0){const{float32Array:c,uint16Array:f,uint32Array:u}=Kt;let d=i*2;if(ui(d,f)){const A=fi(i,u),g=wi(d,f);return nn(i,c,Is),n(A,g,!1,l,o+i,Is)}else{let A=function(k){const{uint16Array:O,uint32Array:F}=Kt;let V=k*2;for(;!ui(V,O);)k=Fi(k),V=k*2;return fi(k,F)},g=function(k){const{uint16Array:O,uint32Array:F}=Kt;let V=k*2;for(;!ui(V,O);)k=Mi(k,F),V=k*2;return fi(k,F)+wi(V,O)};const E=Fi(i),C=Mi(i,u);let _=E,v=C,S,y,x,w;if(r&&(x=Is,w=Ba,nn(_,c,x),nn(v,c,w),S=r(x),y=r(w),y<S)){_=C,v=E;const k=S;S=y,y=k,x=w}x||(x=Is,nn(_,c,x));const b=ui(_*2,f),B=t(x,b,S,l+1,o+_);let L;if(B===qE){const k=A(_),F=g(_)-k;L=n(k,F,!0,l+1,o+_,x)}else L=B&&Sp(_,e,t,n,r,o,l+1);if(L)return!0;w=Ba,nn(v,c,w);const R=ui(v*2,f),T=t(w,R,y,l+1,o+v);let N;if(T===qE){const k=A(v),F=g(v)-k;N=n(k,F,!0,l+1,o+v,w)}else N=T&&Sp(v,e,t,n,r,o,l+1);return!!N}}const ic=new j,wp=new j;function eL(i,e,t={},n=0,r=1/0){const o=n*n,l=r*r;let c=1/0,f=null;if(i.shapecast({boundsTraverseOrder:d=>(ic.copy(e).clamp(d.min,d.max),ic.distanceToSquared(e)),intersectsBounds:(d,p,A)=>A<c&&A<l,intersectsTriangle:(d,p)=>{d.closestPointToPoint(e,ic);const A=e.distanceToSquared(ic);return A<c&&(wp.copy(ic),c=A,f=p),A<o}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(wp):t.point=wp.clone(),t.distance=u,t.faceIndex=f,t}const ba=new j,La=new j,Da=new j,ff=new Ke,hf=new Ke,df=new Ke,iy=new j,ry=new j,sy=new j,Af=new j;function tL(i,e,t,n,r,o){let l;return o===Bn?l=i.intersectTriangle(n,t,e,!0,r):l=i.intersectTriangle(e,t,n,o!==Yi,r),l===null?null:{distance:i.origin.distanceTo(r),point:r.clone()}}function nL(i,e,t,n,r,o,l,c,f){ba.fromBufferAttribute(e,o),La.fromBufferAttribute(e,l),Da.fromBufferAttribute(e,c);const u=tL(i,ba,La,Da,Af,f);if(u){n&&(ff.fromBufferAttribute(n,o),hf.fromBufferAttribute(n,l),df.fromBufferAttribute(n,c),u.uv=Hn.getInterpolation(Af,ba,La,Da,ff,hf,df,new Ke)),r&&(ff.fromBufferAttribute(r,o),hf.fromBufferAttribute(r,l),df.fromBufferAttribute(r,c),u.uv1=Hn.getInterpolation(Af,ba,La,Da,ff,hf,df,new Ke)),t&&(iy.fromBufferAttribute(t,o),ry.fromBufferAttribute(t,l),sy.fromBufferAttribute(t,c),u.normal=Hn.getInterpolation(Af,ba,La,Da,iy,ry,sy,new j),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new j,materialIndex:0};Hn.getNormal(ba,La,Da,d.normal),u.face=d,u.faceIndex=o}return u}function pf(i,e,t,n,r){const o=n*3;let l=o+0,c=o+1,f=o+2;const u=i.index;i.index&&(l=u.getX(l),c=u.getX(c),f=u.getX(f));const{position:d,normal:p,uv:A,uv1:g}=i.attributes,E=nL(t,d,p,A,g,l,c,f,e);return E?(E.faceIndex=n,r&&r.push(E),E):null}function vn(i,e,t,n){const r=i.a,o=i.b,l=i.c;let c=e,f=e+1,u=e+2;t&&(c=t.getX(c),f=t.getX(f),u=t.getX(u)),r.x=n.getX(c),r.y=n.getY(c),r.z=n.getZ(c),o.x=n.getX(f),o.y=n.getY(f),o.z=n.getZ(f),l.x=n.getX(u),l.y=n.getY(u),l.z=n.getZ(u)}function iL(i,e,t,n,r,o){const{geometry:l,_indirectBuffer:c}=i;for(let f=n,u=n+r;f<u;f++)pf(l,e,t,f,o)}function rL(i,e,t,n,r){const{geometry:o,_indirectBuffer:l}=i;let c=1/0,f=null;for(let u=n,d=n+r;u<d;u++){let p;p=pf(o,e,t,u),p&&p.distance<c&&(f=p,c=p.distance)}return f}function sL(i,e,t,n,r,o,l){const{geometry:c}=t,{index:f}=c,u=c.attributes.position;for(let d=i,p=e+i;d<p;d++){let A;if(A=d,vn(l,A*3,f,u),l.needsUpdate=!0,n(l,A,r,o))return!0}return!1}function oL(i,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=i.geometry,n=t.index?t.index.array:null,r=t.attributes.position;let o,l,c,f,u=0;const d=i._roots;for(let A=0,g=d.length;A<g;A++)o=d[A],l=new Uint32Array(o),c=new Uint16Array(o),f=new Float32Array(o),p(0,u),u+=o.byteLength;function p(A,g,E=!1){const C=A*2;if(c[C+15]===of){const v=l[A+6],S=c[C+14];let y=1/0,x=1/0,w=1/0,b=-1/0,B=-1/0,L=-1/0;for(let R=3*v,T=3*(v+S);R<T;R++){let N=n[R];const k=r.getX(N),O=r.getY(N),F=r.getZ(N);k<y&&(y=k),k>b&&(b=k),O<x&&(x=O),O>B&&(B=O),F<w&&(w=F),F>L&&(L=F)}return f[A+0]!==y||f[A+1]!==x||f[A+2]!==w||f[A+3]!==b||f[A+4]!==B||f[A+5]!==L?(f[A+0]=y,f[A+1]=x,f[A+2]=w,f[A+3]=b,f[A+4]=B,f[A+5]=L,!0):!1}else{const v=A+8,S=l[A+6],y=v+g,x=S+g;let w=E,b=!1,B=!1;e?w||(b=e.has(y),B=e.has(x),w=!b&&!B):(b=!0,B=!0);const L=w||b,R=w||B;let T=!1;L&&(T=p(v,g,w));let N=!1;R&&(N=p(S,g,w));const k=T||N;if(k)for(let O=0;O<3;O++){const F=v+O,V=S+O,X=f[F],te=f[F+3],Y=f[V],$=f[V+3];f[A+O]=X<Y?X:Y,f[A+O+3]=te>$?te:$}return k}}}const oy=new gn;function xs(i,e,t,n){return nn(i,e,oy),t.intersectBox(oy,n)}function aL(i,e,t,n,r,o){const{geometry:l,_indirectBuffer:c}=i;for(let f=n,u=n+r;f<u;f++){let d=c?c[f]:f;pf(l,e,t,d,o)}}function lL(i,e,t,n,r){const{geometry:o,_indirectBuffer:l}=i;let c=1/0,f=null;for(let u=n,d=n+r;u<d;u++){let p;p=pf(o,e,t,l?l[u]:u),p&&p.distance<c&&(f=p,c=p.distance)}return f}function cL(i,e,t,n,r,o,l){const{geometry:c}=t,{index:f}=c,u=c.attributes.position;for(let d=i,p=e+i;d<p;d++){let A;if(A=t.resolveTriangleIndex(d),vn(l,A*3,f,u),l.needsUpdate=!0,n(l,A,r,o))return!0}return!1}const ay=new j;function uL(i,e,t,n,r){Kt.setBuffer(i._roots[e]),Mp(0,i,t,n,r),Kt.clearBuffer()}function Mp(i,e,t,n,r){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt,f=i*2;if(ui(f,l)){const d=fi(i,c),p=wi(f,l);iL(e,t,n,d,p,r)}else{const d=Fi(i);xs(d,o,n,ay)&&Mp(d,e,t,n,r);const p=Mi(i,c);xs(p,o,n,ay)&&Mp(p,e,t,n,r)}}const ly=new j,fL=["x","y","z"];function hL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Tp(0,i,t,n);return Kt.clearBuffer(),r}function Tp(i,e,t,n){const{float32Array:r,uint16Array:o,uint32Array:l}=Kt;let c=i*2;if(ui(c,o)){const u=fi(i,l),d=wi(c,o);return rL(e,t,n,u,d)}else{const u=xp(i,l),d=fL[u],A=n.direction[d]>=0;let g,E;A?(g=Fi(i),E=Mi(i,l)):(g=Mi(i,l),E=Fi(i));const _=xs(g,r,n,ly)?Tp(g,e,t,n):null;if(_){const y=_.point[d];if(A?y<=r[E+u]:y>=r[E+u+3])return _}const S=xs(E,r,n,ly)?Tp(E,e,t,n):null;return _&&S?_.distance<=S.distance?_:S:_||S||null}}const gf=new gn,Na=new tr,Pa=new tr,rc=new ct,cy=new ni,mf=new ni;function dL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Bp(0,i,t,n);return Kt.clearBuffer(),r}function Bp(i,e,t,n,r=null){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt;let f=i*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),cy.set(t.boundingBox.min,t.boundingBox.max,n),r=cy),ui(f,l)){const d=e.geometry,p=d.index,A=d.attributes.position,g=t.index,E=t.attributes.position,C=fi(i,c),_=wi(f,l);if(rc.copy(n).invert(),t.boundsTree)return nn(i,o,mf),mf.matrix.copy(rc),mf.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:S=>mf.intersectsBox(S),intersectsTriangle:S=>{S.a.applyMatrix4(n),S.b.applyMatrix4(n),S.c.applyMatrix4(n),S.needsUpdate=!0;for(let y=C*3,x=(_+C)*3;y<x;y+=3)if(vn(Pa,y,p,A),Pa.needsUpdate=!0,S.intersectsTriangle(Pa))return!0;return!1}});for(let v=C*3,S=(_+C)*3;v<S;v+=3){vn(Na,v,p,A),Na.a.applyMatrix4(rc),Na.b.applyMatrix4(rc),Na.c.applyMatrix4(rc),Na.needsUpdate=!0;for(let y=0,x=g.count;y<x;y+=3)if(vn(Pa,y,g,E),Pa.needsUpdate=!0,Na.intersectsTriangle(Pa))return!0}}else{const d=i+8,p=c[i+6];return nn(d,o,gf),!!(r.intersectsBox(gf)&&Bp(d,e,t,n,r)||(nn(p,o,gf),r.intersectsBox(gf)&&Bp(p,e,t,n,r)))}}const vf=new ct,Rp=new ni,sc=new ni,AL=new j,pL=new j,gL=new j,mL=new j;function vL(i,e,t,n={},r={},o=0,l=1/0){e.boundingBox||e.computeBoundingBox(),Rp.set(e.boundingBox.min,e.boundingBox.max,t),Rp.needsUpdate=!0;const c=i.geometry,f=c.attributes.position,u=c.index,d=e.attributes.position,p=e.index,A=ki.getPrimitive(),g=ki.getPrimitive();let E=AL,C=pL,_=null,v=null;r&&(_=gL,v=mL);let S=1/0,y=null,x=null;return vf.copy(t).invert(),sc.matrix.copy(vf),i.shapecast({boundsTraverseOrder:w=>Rp.distanceToBox(w),intersectsBounds:(w,b,B)=>B<S&&B<l?(b&&(sc.min.copy(w.min),sc.max.copy(w.max),sc.needsUpdate=!0),!0):!1,intersectsRange:(w,b)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:L=>sc.distanceToBox(L),intersectsBounds:(L,R,T)=>T<S&&T<l,intersectsRange:(L,R)=>{for(let T=L,N=L+R;T<N;T++){vn(g,3*T,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let k=w,O=w+b;k<O;k++){vn(A,3*k,u,f),A.needsUpdate=!0;const F=A.distanceToTriangle(g,E,_);if(F<S&&(C.copy(E),v&&v.copy(_),S=F,y=k,x=T),F<o)return!0}}}});{const B=Ta(e);for(let L=0,R=B;L<R;L++){vn(g,3*L,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let T=w,N=w+b;T<N;T++){vn(A,3*T,u,f),A.needsUpdate=!0;const k=A.distanceToTriangle(g,E,_);if(k<S&&(C.copy(E),v&&v.copy(_),S=k,y=T,x=L),k<o)return!0}}}}}),ki.releasePrimitive(A),ki.releasePrimitive(g),S===1/0?null:(n.point?n.point.copy(C):n.point=C.clone(),n.distance=S,n.faceIndex=y,r&&(r.point?r.point.copy(v):r.point=v.clone(),r.point.applyMatrix4(vf),C.applyMatrix4(vf),r.distance=C.sub(r.point).length(),r.faceIndex=x),n)}function _L(i,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=i.geometry,n=t.index?t.index.array:null,r=t.attributes.position;let o,l,c,f,u=0;const d=i._roots;for(let A=0,g=d.length;A<g;A++)o=d[A],l=new Uint32Array(o),c=new Uint16Array(o),f=new Float32Array(o),p(0,u),u+=o.byteLength;function p(A,g,E=!1){const C=A*2;if(c[C+15]===of){const v=l[A+6],S=c[C+14];let y=1/0,x=1/0,w=1/0,b=-1/0,B=-1/0,L=-1/0;for(let R=v,T=v+S;R<T;R++){const N=3*i.resolveTriangleIndex(R);for(let k=0;k<3;k++){let O=N+k;O=n?n[O]:O;const F=r.getX(O),V=r.getY(O),X=r.getZ(O);F<y&&(y=F),F>b&&(b=F),V<x&&(x=V),V>B&&(B=V),X<w&&(w=X),X>L&&(L=X)}}return f[A+0]!==y||f[A+1]!==x||f[A+2]!==w||f[A+3]!==b||f[A+4]!==B||f[A+5]!==L?(f[A+0]=y,f[A+1]=x,f[A+2]=w,f[A+3]=b,f[A+4]=B,f[A+5]=L,!0):!1}else{const v=A+8,S=l[A+6],y=v+g,x=S+g;let w=E,b=!1,B=!1;e?w||(b=e.has(y),B=e.has(x),w=!b&&!B):(b=!0,B=!0);const L=w||b,R=w||B;let T=!1;L&&(T=p(v,g,w));let N=!1;R&&(N=p(S,g,w));const k=T||N;if(k)for(let O=0;O<3;O++){const F=v+O,V=S+O,X=f[F],te=f[F+3],Y=f[V],$=f[V+3];f[A+O]=X<Y?X:Y,f[A+O+3]=te>$?te:$}return k}}}const uy=new j;function EL(i,e,t,n,r){Kt.setBuffer(i._roots[e]),bp(0,i,t,n,r),Kt.clearBuffer()}function bp(i,e,t,n,r){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt,f=i*2;if(ui(f,l)){const d=fi(i,c),p=wi(f,l);aL(e,t,n,d,p,r)}else{const d=Fi(i);xs(d,o,n,uy)&&bp(d,e,t,n,r);const p=Mi(i,c);xs(p,o,n,uy)&&bp(p,e,t,n,r)}}const fy=new j,yL=["x","y","z"];function CL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Lp(0,i,t,n);return Kt.clearBuffer(),r}function Lp(i,e,t,n){const{float32Array:r,uint16Array:o,uint32Array:l}=Kt;let c=i*2;if(ui(c,o)){const u=fi(i,l),d=wi(c,o);return lL(e,t,n,u,d)}else{const u=xp(i,l),d=yL[u],A=n.direction[d]>=0;let g,E;A?(g=Fi(i),E=Mi(i,l)):(g=Mi(i,l),E=Fi(i));const _=xs(g,r,n,fy)?Lp(g,e,t,n):null;if(_){const y=_.point[d];if(A?y<=r[E+u]:y>=r[E+u+3])return _}const S=xs(E,r,n,fy)?Lp(E,e,t,n):null;return _&&S?_.distance<=S.distance?_:S:_||S||null}}const _f=new gn,Ua=new tr,ka=new tr,oc=new ct,hy=new ni,Ef=new ni;function IL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Dp(0,i,t,n);return Kt.clearBuffer(),r}function Dp(i,e,t,n,r=null){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt;let f=i*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),hy.set(t.boundingBox.min,t.boundingBox.max,n),r=hy),ui(f,l)){const d=e.geometry,p=d.index,A=d.attributes.position,g=t.index,E=t.attributes.position,C=fi(i,c),_=wi(f,l);if(oc.copy(n).invert(),t.boundsTree)return nn(i,o,Ef),Ef.matrix.copy(oc),Ef.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:S=>Ef.intersectsBox(S),intersectsTriangle:S=>{S.a.applyMatrix4(n),S.b.applyMatrix4(n),S.c.applyMatrix4(n),S.needsUpdate=!0;for(let y=C,x=_+C;y<x;y++)if(vn(ka,3*e.resolveTriangleIndex(y),p,A),ka.needsUpdate=!0,S.intersectsTriangle(ka))return!0;return!1}});for(let v=C,S=_+C;v<S;v++){const y=e.resolveTriangleIndex(v);vn(Ua,3*y,p,A),Ua.a.applyMatrix4(oc),Ua.b.applyMatrix4(oc),Ua.c.applyMatrix4(oc),Ua.needsUpdate=!0;for(let x=0,w=g.count;x<w;x+=3)if(vn(ka,x,g,E),ka.needsUpdate=!0,Ua.intersectsTriangle(ka))return!0}}else{const d=i+8,p=c[i+6];return nn(d,o,_f),!!(r.intersectsBox(_f)&&Dp(d,e,t,n,r)||(nn(p,o,_f),r.intersectsBox(_f)&&Dp(p,e,t,n,r)))}}const yf=new ct,Np=new ni,ac=new ni,xL=new j,SL=new j,wL=new j,ML=new j;function TL(i,e,t,n={},r={},o=0,l=1/0){e.boundingBox||e.computeBoundingBox(),Np.set(e.boundingBox.min,e.boundingBox.max,t),Np.needsUpdate=!0;const c=i.geometry,f=c.attributes.position,u=c.index,d=e.attributes.position,p=e.index,A=ki.getPrimitive(),g=ki.getPrimitive();let E=xL,C=SL,_=null,v=null;r&&(_=wL,v=ML);let S=1/0,y=null,x=null;return yf.copy(t).invert(),ac.matrix.copy(yf),i.shapecast({boundsTraverseOrder:w=>Np.distanceToBox(w),intersectsBounds:(w,b,B)=>B<S&&B<l?(b&&(ac.min.copy(w.min),ac.max.copy(w.max),ac.needsUpdate=!0),!0):!1,intersectsRange:(w,b)=>{if(e.boundsTree){const B=e.boundsTree;return B.shapecast({boundsTraverseOrder:L=>ac.distanceToBox(L),intersectsBounds:(L,R,T)=>T<S&&T<l,intersectsRange:(L,R)=>{for(let T=L,N=L+R;T<N;T++){const k=B.resolveTriangleIndex(T);vn(g,3*k,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let O=w,F=w+b;O<F;O++){const V=i.resolveTriangleIndex(O);vn(A,3*V,u,f),A.needsUpdate=!0;const X=A.distanceToTriangle(g,E,_);if(X<S&&(C.copy(E),v&&v.copy(_),S=X,y=O,x=T),X<o)return!0}}}})}else{const B=Ta(e);for(let L=0,R=B;L<R;L++){vn(g,3*L,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let T=w,N=w+b;T<N;T++){const k=i.resolveTriangleIndex(T);vn(A,3*k,u,f),A.needsUpdate=!0;const O=A.distanceToTriangle(g,E,_);if(O<S&&(C.copy(E),v&&v.copy(_),S=O,y=T,x=L),O<o)return!0}}}}}),ki.releasePrimitive(A),ki.releasePrimitive(g),S===1/0?null:(n.point?n.point.copy(C):n.point=C.clone(),n.distance=S,n.faceIndex=y,r&&(r.point?r.point.copy(v):r.point=v.clone(),r.point.applyMatrix4(yf),C.applyMatrix4(yf),r.distance=C.sub(r.point).length(),r.faceIndex=x),n)}function BL(){return typeof SharedArrayBuffer<"u"}const lc=new Kt.constructor,Cf=new Kt.constructor,Ss=new Ip(()=>new gn),Fa=new gn,Qa=new gn,Pp=new gn,Up=new gn;let kp=!1;function RL(i,e,t,n){if(kp)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");kp=!0;const r=i._roots,o=e._roots;let l,c=0,f=0;const u=new ct().copy(t).invert();for(let d=0,p=r.length;d<p;d++){lc.setBuffer(r[d]),f=0;const A=Ss.getPrimitive();nn(0,lc.float32Array,A),A.applyMatrix4(u);for(let g=0,E=o.length;g<E&&(Cf.setBuffer(o[d]),l=nr(0,0,t,u,n,c,f,0,0,A),Cf.clearBuffer(),f+=o[g].length,!l);g++);if(Ss.releasePrimitive(A),lc.clearBuffer(),c+=r[d].length,l)break}return kp=!1,l}function nr(i,e,t,n,r,o=0,l=0,c=0,f=0,u=null,d=!1){let p,A;d?(p=Cf,A=lc):(p=lc,A=Cf);const g=p.float32Array,E=p.uint32Array,C=p.uint16Array,_=A.float32Array,v=A.uint32Array,S=A.uint16Array,y=i*2,x=e*2,w=ui(y,C),b=ui(x,S);let B=!1;if(b&&w)d?B=r(fi(e,v),wi(e*2,S),fi(i,E),wi(i*2,C),f,l+e,c,o+i):B=r(fi(i,E),wi(i*2,C),fi(e,v),wi(e*2,S),c,o+i,f,l+e);else if(b){const L=Ss.getPrimitive();nn(e,_,L),L.applyMatrix4(t);const R=Fi(i),T=Mi(i,E);nn(R,g,Fa),nn(T,g,Qa);const N=L.intersectsBox(Fa),k=L.intersectsBox(Qa);B=N&&nr(e,R,n,t,r,l,o,f,c+1,L,!d)||k&&nr(e,T,n,t,r,l,o,f,c+1,L,!d),Ss.releasePrimitive(L)}else{const L=Fi(e),R=Mi(e,v);nn(L,_,Pp),nn(R,_,Up);const T=u.intersectsBox(Pp),N=u.intersectsBox(Up);if(T&&N)B=nr(i,L,t,n,r,o,l,c,f+1,u,d)||nr(i,R,t,n,r,o,l,c,f+1,u,d);else if(T)if(w)B=nr(i,L,t,n,r,o,l,c,f+1,u,d);else{const k=Ss.getPrimitive();k.copy(Pp).applyMatrix4(t);const O=Fi(i),F=Mi(i,E);nn(O,g,Fa),nn(F,g,Qa);const V=k.intersectsBox(Fa),X=k.intersectsBox(Qa);B=V&&nr(L,O,n,t,r,l,o,f,c+1,k,!d)||X&&nr(L,F,n,t,r,l,o,f,c+1,k,!d),Ss.releasePrimitive(k)}else if(N)if(w)B=nr(i,R,t,n,r,o,l,c,f+1,u,d);else{const k=Ss.getPrimitive();k.copy(Up).applyMatrix4(t);const O=Fi(i),F=Mi(i,E);nn(O,g,Fa),nn(F,g,Qa);const V=k.intersectsBox(Fa),X=k.intersectsBox(Qa);B=V&&nr(R,O,n,t,r,l,o,f,c+1,k,!d)||X&&nr(R,F,n,t,r,l,o,f,c+1,k,!d),Ss.releasePrimitive(k)}}return B}const If=new ni,dy=new gn;class Fp{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,r=e._roots,o=e._indirectBuffer,l=n.getIndex();let c;return t.cloneBuffers?c={roots:r.map(f=>f.slice()),index:l.array.slice(),indirectBuffer:o?o.slice():null}:c={roots:r,index:l.array,indirectBuffer:o},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:r,roots:o,indirectBuffer:l}=e,c=new Fp(t,{...n,[_p]:!0});if(c._roots=o,c._indirectBuffer=l||null,n.setIndex){const f=t.getIndex();if(f===null){const u=new bn(e.index,1,!1);t.setIndex(u)}else f.array!==r&&(f.array.set(r),f.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:jE,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[_p]:!1},t),t.useSharedArrayBuffer&&!BL())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[_p]||(Y5(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new gn)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?r=>n[r]:r=>r}refit(e=null){return(this.indirect?_L:oL)(this,e)}traverse(e,t=0){const n=this._roots[t],r=new Uint32Array(n),o=new Uint16Array(n);l(0);function l(c,f=0){const u=c*2,d=o[u+15]===of;if(d){const p=r[c+6],A=o[u+14];e(f,d,new Float32Array(n,c*4,6),p,A)}else{const p=c+yo/4,A=r[c+6],g=r[c+7];e(f,d,new Float32Array(n,c*4,6),g)||(l(p,f+1),l(A,f+1))}}}raycast(e,t=ji){const n=this._roots,r=this.geometry,o=[],l=t.isMaterial,c=Array.isArray(t),f=r.groups,u=l?t.side:t,d=this.indirect?EL:uL;for(let p=0,A=n.length;p<A;p++){const g=c?t[f[p].materialIndex].side:u,E=o.length;if(d(this,p,g,e,o),c){const C=f[p].materialIndex;for(let _=E,v=o.length;_<v;_++)o[_].face.materialIndex=C}}return o}raycastFirst(e,t=ji){const n=this._roots,r=this.geometry,o=t.isMaterial,l=Array.isArray(t);let c=null;const f=r.groups,u=o?t.side:t,d=this.indirect?CL:hL;for(let p=0,A=n.length;p<A;p++){const g=l?t[f[p].materialIndex].side:u,E=d(this,p,g,e);E!=null&&(c==null||E.distance<c.distance)&&(c=E,l&&(E.face.materialIndex=f[p].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const r=this._roots,o=this.indirect?IL:dL;for(let l=0,c=r.length;l<c&&(n=o(this,l,e,t),!n);l++);return n}shapecast(e){const t=ki.getPrimitive(),n=this.indirect?cL:sL;let{boundsTraverseOrder:r,intersectsBounds:o,intersectsRange:l,intersectsTriangle:c}=e;if(l&&c){const p=l;l=(A,g,E,C,_)=>p(A,g,E,C,_)?!0:n(A,g,this,c,E,C,t)}else l||(c?l=(p,A,g,E)=>n(p,A,this,c,g,E,t):l=(p,A,g)=>g);let f=!1,u=0;const d=this._roots;for(let p=0,A=d.length;p<A;p++){const g=d[p];if(f=$5(this,p,o,l,r,u),f)break;u+=g.byteLength}return ki.releasePrimitive(t),f}bvhcast(e,t,n){let{intersectsRanges:r,intersectsTriangles:o}=n;const l=ki.getPrimitive(),c=this.geometry.index,f=this.geometry.attributes.position,u=this.indirect?E=>{const C=this.resolveTriangleIndex(E);vn(l,C*3,c,f)}:E=>{vn(l,E*3,c,f)},d=ki.getPrimitive(),p=e.geometry.index,A=e.geometry.attributes.position,g=e.indirect?E=>{const C=e.resolveTriangleIndex(E);vn(d,C*3,p,A)}:E=>{vn(d,E*3,p,A)};if(o){const E=(C,_,v,S,y,x,w,b)=>{for(let B=v,L=v+S;B<L;B++){g(B),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let R=C,T=C+_;R<T;R++)if(u(R),l.needsUpdate=!0,o(l,d,R,B,y,x,w,b))return!0}return!1};if(r){const C=r;r=function(_,v,S,y,x,w,b,B){return C(_,v,S,y,x,w,b,B)?!0:E(_,v,S,y,x,w,b,B)}}else r=E}return RL(this,e,t,r)}intersectsBox(e,t){return If.set(e.min,e.max,t),If.needsUpdate=!0,this.shapecast({intersectsBounds:n=>If.intersectsBox(n),intersectsTriangle:n=>If.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},r={},o=0,l=1/0){return(this.indirect?TL:vL)(this,e,t,n,r,o,l)}closestPointToPoint(e,t={},n=0,r=1/0){return eL(this,e,t,n,r)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(n=>{nn(0,new Float32Array(n),dy),e.union(dy)}),e}}function bL(i){switch(i){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function LL(i){switch(i){case 1:return lo;case 2:return co;case 3:return on;case 4:return on}}function Ay(i){switch(i){case 1:return eA;case 2:return fu;case 3:return Nl;case 4:return Nl}}class py extends _a{constructor(){super(),this.minFilter=qt,this.magFilter=qt,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,r=e.count;if(t!==null){if(n*r%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=r*n/t}const o=e.itemSize,l=e.count,c=e.normalized,f=e.array.constructor,u=f.BYTES_PER_ELEMENT;let d=this._forcedType,p=o;if(d===null)switch(f){case Float32Array:d=hn;break;case Uint8Array:case Uint16Array:case Uint32Array:d=yi;break;case Int8Array:case Int16Array:case Int32Array:d=Dl;break}let A,g,E,C,_=bL(o);switch(d){case hn:E=1,g=LL(o),c&&u===1?(C=f,_+="8",f===Uint8Array?A=fn:(A=$d,_+="_SNORM")):(C=Float32Array,_+="32F",A=hn);break;case Dl:_+=u*8+"I",E=c?Math.pow(2,f.BYTES_PER_ELEMENT*8-1):1,g=Ay(o),u===1?(C=Int8Array,A=$d):u===2?(C=Int16Array,A=s1):(C=Int32Array,A=Dl);break;case yi:_+=u*8+"UI",E=c?Math.pow(2,f.BYTES_PER_ELEMENT*8-1):1,g=Ay(o),u===1?(C=Uint8Array,A=fn):u===2?(C=Uint16Array,A=uu):(C=Uint32Array,A=yi);break}p===3&&(g===on||g===Nl)&&(p=4);const v=Math.ceil(Math.sqrt(l)),S=p*v*v,y=new C(S),x=e.normalized;e.normalized=!1;for(let w=0;w<l;w++){const b=p*w;y[b]=e.getX(w)/E,o>=2&&(y[b+1]=e.getY(w)/E),o>=3&&(y[b+2]=e.getZ(w)/E,p===4&&(y[b+3]=1)),o>=4&&(y[b+3]=e.getW(w)/E)}e.normalized=x,this.internalFormat=_,this.format=g,this.type=A,this.image.width=v,this.image.height=v,this.image.data=y,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=r}}class DL extends py{constructor(){super(),this._forcedType=yi}}class NL extends py{constructor(){super(),this._forcedType=hn}}class gy{constructor(){this.index=new DL,this.position=new NL,this.bvhBounds=new _a,this.bvhContents=new _a,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(UL(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 r=JE(KE(t));this._cachedIndexAttr=new bn(r,1,!1)}PL(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:r}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),r&&r.dispose()}}function PL(i,e,t){const n=t.array,r=i.index?i.index.array:null;for(let o=0,l=e.length;o<l;o++){const c=3*o,f=3*e[o];for(let u=0;u<3;u++)n[c+u]=r?r[f+u]:f+u}}function UL(i,e,t){const n=i._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const r=n[0],o=new Uint16Array(r),l=new Uint32Array(r),c=new Float32Array(r),f=r.byteLength/yo,u=2*Math.ceil(Math.sqrt(f/2)),d=new Float32Array(4*u*u),p=Math.ceil(Math.sqrt(f)),A=new Uint32Array(2*p*p);for(let g=0;g<f;g++){const E=g*yo/4,C=E*2,_=E;for(let v=0;v<3;v++)d[8*g+0+v]=c[_+0+v],d[8*g+4+v]=c[_+3+v];if(ui(C,o)){const v=wi(C,o),S=fi(E,l),y=4294901760|v;A[g*2+0]=y,A[g*2+1]=S}else{const v=4*Mi(E,l)/yo,S=xp(E,l);A[g*2+0]=S,A[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=on,e.type=hn,e.internalFormat="RGBA32F",e.minFilter=qt,e.magFilter=qt,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=A,t.image.width=p,t.image.height=p,t.format=fu,t.type=yi,t.internalFormat="RG32UI",t.minFilter=qt,t.magFilter=qt,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const kL=`
3771
+ }`},jE=0,D5=1,YE=2,qE=2,vp=1.25,XE=1,yo=6*4+4+4,of=65535,N5=Math.pow(2,-24),_p=Symbol("SKIP_GENERATION");function KE(i){return i.index?i.index.count:i.attributes.position.count}function Ta(i){return KE(i)/3}function JE(i,e=ArrayBuffer){return i>65535?new Uint32Array(new e(4*i)):new Uint16Array(new e(2*i))}function P5(i,e){if(!i.index){const t=i.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,r=JE(t,n);i.setIndex(new bn(r,1));for(let o=0;o<t;o++)r[o]=o}}function $E(i){const e=Ta(i),t=i.drawRange,n=t.start/3,r=(t.start+t.count)/3,o=Math.max(0,n),l=Math.min(e,r)-o;return[{offset:Math.floor(o),count:Math.floor(l)}]}function ZE(i){if(!i.groups||!i.groups.length)return $E(i);const e=[],t=new Set,n=i.drawRange,r=n.start/3,o=(n.start+n.count)/3;for(const c of i.groups){const f=c.start/3,u=(c.start+c.count)/3;t.add(Math.max(r,f)),t.add(Math.min(o,u))}const l=Array.from(t.values()).sort((c,f)=>c-f);for(let c=0;c<l.length-1;c++){const f=l[c],u=l[c+1];e.push({offset:Math.floor(f),count:Math.floor(u-f)})}return e}function U5(i){if(i.groups.length===0)return!1;const e=Ta(i),t=ZE(i).sort((o,l)=>o.offset-l.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let r=0;return t.forEach(({count:o})=>r+=o),e!==r}function nn(i,e,t){return t.min.x=e[i],t.min.y=e[i+1],t.min.z=e[i+2],t.max.x=e[i+3],t.max.y=e[i+4],t.max.z=e[i+5],t}function k5(i){i[0]=i[1]=i[2]=1/0,i[3]=i[4]=i[5]=-1/0}function ey(i){let e=-1,t=-1/0;for(let n=0;n<3;n++){const r=i[n+3]-i[n];r>t&&(t=r,e=n)}return e}function ty(i,e){e.set(i)}function ny(i,e,t){let n,r;for(let o=0;o<3;o++){const l=o+3;n=i[o],r=e[o],t[o]=n<r?n:r,n=i[l],r=e[l],t[l]=n>r?n:r}}function af(i,e,t){for(let n=0;n<3;n++){const r=e[i+2*n],o=e[i+2*n+1],l=r-o,c=r+o;l<t[n]&&(t[n]=l),c>t[n+3]&&(t[n+3]=c)}}function nc(i){const e=i[3]-i[0],t=i[4]-i[1],n=i[5]-i[2];return 2*(e*t+t*n+n*e)}function Ep(i,e,t,n,r=null){let o=1/0,l=1/0,c=1/0,f=-1/0,u=-1/0,d=-1/0,p=1/0,A=1/0,g=1/0,E=-1/0,C=-1/0,_=-1/0;const v=r!==null;for(let x=e*6,y=(e+t)*6;x<y;x+=6){const S=i[x+0],w=i[x+1],b=S-w,B=S+w;b<o&&(o=b),B>f&&(f=B),v&&S<p&&(p=S),v&&S>E&&(E=S);const L=i[x+2],R=i[x+3],T=L-R,N=L+R;T<l&&(l=T),N>u&&(u=N),v&&L<A&&(A=L),v&&L>C&&(C=L);const k=i[x+4],O=i[x+5],F=k-O,V=k+O;F<c&&(c=F),V>d&&(d=V),v&&k<g&&(g=k),v&&k>_&&(_=k)}n[0]=o,n[1]=l,n[2]=c,n[3]=f,n[4]=u,n[5]=d,v&&(r[0]=p,r[1]=A,r[2]=g,r[3]=E,r[4]=C,r[5]=_)}function F5(i,e,t,n){let r=1/0,o=1/0,l=1/0,c=-1/0,f=-1/0,u=-1/0;for(let d=e*6,p=(e+t)*6;d<p;d+=6){const A=i[d+0];A<r&&(r=A),A>c&&(c=A);const g=i[d+2];g<o&&(o=g),g>f&&(f=g);const E=i[d+4];E<l&&(l=E),E>u&&(u=E)}n[0]=r,n[1]=o,n[2]=l,n[3]=c,n[4]=f,n[5]=u}function Q5(i,e){k5(e);const t=i.attributes.position,n=i.index?i.index.array:null,r=Ta(i),o=new Float32Array(r*6),l=t.normalized,c=t.array,f=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let p=0;p<r;p++){const A=p*3,g=p*6;let E=A+0,C=A+1,_=A+2;n&&(E=n[E],C=n[C],_=n[_]),l||(E=E*u+f,C=C*u+f,_=_*u+f);for(let v=0;v<3;v++){let x,y,S;l?(x=t[d[v]](E),y=t[d[v]](C),S=t[d[v]](_)):(x=c[E+v],y=c[C+v],S=c[_+v]);let w=x;y<w&&(w=y),S<w&&(w=S);let b=x;y>b&&(b=y),S>b&&(b=S);const B=(b-w)/2,L=v*2;o[g+L+0]=w+B,o[g+L+1]=B+(Math.abs(w)+B)*N5,w<e[v]&&(e[v]=w),b>e[v+3]&&(e[v+3]=b)}}return o}const Yr=32,O5=(i,e)=>i.candidate-e.candidate,Cs=new Array(Yr).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),lf=new Float32Array(6);function z5(i,e,t,n,r,o){let l=-1,c=0;if(o===jE)l=ey(e),l!==-1&&(c=(e[l]+e[l+3])/2);else if(o===D5)l=ey(i),l!==-1&&(c=G5(t,n,r,l));else if(o===YE){const f=nc(i);let u=vp*r;const d=n*6,p=(n+r)*6;for(let A=0;A<3;A++){const g=e[A],_=(e[A+3]-g)/Yr;if(r<Yr/4){const v=[...Cs];v.length=r;let x=0;for(let S=d;S<p;S+=6,x++){const w=v[x];w.candidate=t[S+2*A],w.count=0;const{bounds:b,leftCacheBounds:B,rightCacheBounds:L}=w;for(let R=0;R<3;R++)L[R]=1/0,L[R+3]=-1/0,B[R]=1/0,B[R+3]=-1/0,b[R]=1/0,b[R+3]=-1/0;af(S,t,b)}v.sort(O5);let y=r;for(let S=0;S<y;S++){const w=v[S];for(;S+1<y&&v[S+1].candidate===w.candidate;)v.splice(S+1,1),y--}for(let S=d;S<p;S+=6){const w=t[S+2*A];for(let b=0;b<y;b++){const B=v[b];w>=B.candidate?af(S,t,B.rightCacheBounds):(af(S,t,B.leftCacheBounds),B.count++)}}for(let S=0;S<y;S++){const w=v[S],b=w.count,B=r-w.count,L=w.leftCacheBounds,R=w.rightCacheBounds;let T=0;b!==0&&(T=nc(L)/f);let N=0;B!==0&&(N=nc(R)/f);const k=XE+vp*(T*b+N*B);k<u&&(l=A,u=k,c=w.candidate)}}else{for(let y=0;y<Yr;y++){const S=Cs[y];S.count=0,S.candidate=g+_+y*_;const w=S.bounds;for(let b=0;b<3;b++)w[b]=1/0,w[b+3]=-1/0}for(let y=d;y<p;y+=6){let b=~~((t[y+2*A]-g)/_);b>=Yr&&(b=Yr-1);const B=Cs[b];B.count++,af(y,t,B.bounds)}const v=Cs[Yr-1];ty(v.bounds,v.rightCacheBounds);for(let y=Yr-2;y>=0;y--){const S=Cs[y],w=Cs[y+1];ny(S.bounds,w.rightCacheBounds,S.rightCacheBounds)}let x=0;for(let y=0;y<Yr-1;y++){const S=Cs[y],w=S.count,b=S.bounds,L=Cs[y+1].rightCacheBounds;w!==0&&(x===0?ty(b,lf):ny(b,lf,lf)),x+=w;let R=0,T=0;x!==0&&(R=nc(lf)/f);const N=r-x;N!==0&&(T=nc(L)/f);const k=XE+vp*(R*x+T*N);k<u&&(l=A,u=k,c=S.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);return{axis:l,pos:c}}function G5(i,e,t,n){let r=0;for(let o=e,l=e+t;o<l;o++)r+=i[o*6+n*2];return r/t}class cf{constructor(){}}function H5(i,e,t,n,r,o){let l=n,c=n+r-1;const f=o.pos,u=o.axis*2;for(;;){for(;l<=c&&t[l*6+u]<f;)l++;for(;l<=c&&t[c*6+u]>=f;)c--;if(l<c){for(let d=0;d<3;d++){let p=e[l*3+d];e[l*3+d]=e[c*3+d],e[c*3+d]=p}for(let d=0;d<6;d++){let p=t[l*6+d];t[l*6+d]=t[c*6+d],t[c*6+d]=p}l++,c--}else return l}}function V5(i,e,t,n,r,o){let l=n,c=n+r-1;const f=o.pos,u=o.axis*2;for(;;){for(;l<=c&&t[l*6+u]<f;)l++;for(;l<=c&&t[c*6+u]>=f;)c--;if(l<c){let d=i[l];i[l]=i[c],i[c]=d;for(let p=0;p<6;p++){let A=t[l*6+p];t[l*6+p]=t[c*6+p],t[c*6+p]=A}l++,c--}else return l}}function W5(i,e){const t=(i.index?i.index.count:i.attributes.position.count)/3,n=t>2**16,r=n?4:2,o=e?new SharedArrayBuffer(t*r):new ArrayBuffer(t*r),l=n?new Uint32Array(o):new Uint16Array(o);for(let c=0,f=l.length;c<f;c++)l[c]=c;return l}function j5(i,e){const t=i.geometry,n=t.index?t.index.array:null,r=e.maxDepth,o=e.verbose,l=e.maxLeafTris,c=e.strategy,f=e.onProgress,u=Ta(t),d=i._indirectBuffer;let p=!1;const A=new Float32Array(6),g=new Float32Array(6),E=Q5(t,A),C=e.indirect?V5:H5,_=[],v=e.indirect?$E(t):ZE(t);if(v.length===1){const S=v[0],w=new cf;w.boundingData=A,F5(E,S.offset,S.count,g),y(w,S.offset,S.count,g),_.push(w)}else for(let S of v){const w=new cf;w.boundingData=new Float32Array(6),Ep(E,S.offset,S.count,w.boundingData,g),y(w,S.offset,S.count,g),_.push(w)}return _;function x(S){f&&f(S/u)}function y(S,w,b,B=null,L=0){if(!p&&L>=r&&(p=!0,o&&(console.warn(`MeshBVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),b<=l||L>=r)return x(w+b),S.offset=w,S.count=b,S;const R=z5(S.boundingData,B,E,w,b,c);if(R.axis===-1)return x(w+b),S.offset=w,S.count=b,S;const T=C(d,n,E,w,b,R);if(T===w||T===w+b)x(w+b),S.offset=w,S.count=b;else{S.splitAxis=R.axis;const N=new cf,k=w,O=T-w;S.left=N,N.boundingData=new Float32Array(6),Ep(E,k,O,N.boundingData,g),y(N,k,O,g,L+1);const F=new cf,V=T,X=b-O;S.right=F,F.boundingData=new Float32Array(6),Ep(E,V,X,F.boundingData,g),y(F,V,X,g,L+1)}return S}}function Y5(i,e){const t=i.geometry;e.indirect&&(i._indirectBuffer=W5(t,e.useSharedArrayBuffer),U5(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.')),i._indirectBuffer||P5(t,e);const n=j5(i,e);let r,o,l;const c=[],f=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let p=0;p<n.length;p++){const A=n[p];let g=u(A);const E=new f(yo*g);r=new Float32Array(E),o=new Uint32Array(E),l=new Uint16Array(E),d(0,A),c.push(E)}i._roots=c;return;function u(p){return p.count?1:1+u(p.left)+u(p.right)}function d(p,A){const g=p/4,E=p/2,C=!!A.count,_=A.boundingData;for(let v=0;v<6;v++)r[g+v]=_[v];if(C){const v=A.offset,x=A.count;return o[g+6]=v,l[E+14]=x,l[E+15]=of,p+yo}else{const v=A.left,x=A.right,y=A.splitAxis;let S;if(S=d(p+yo,v),S/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return o[g+6]=S/4,S=d(S,x),o[g+7]=y,S}}}class qr{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,r=-1/0;for(let o=0,l=e.length;o<l;o++){const f=e[o][t];n=f<n?f:n,r=f>r?f:r}this.min=n,this.max=r}setFromPoints(e,t){let n=1/0,r=-1/0;for(let o=0,l=t.length;o<l;o++){const c=t[o],f=e.dot(c);n=f<n?f:n,r=f>r?f:r}this.min=n,this.max=r}isSeparated(e){return this.min>e.max||e.min>this.max}}qr.prototype.setFromBox=function(){const i=new j;return function(t,n){const r=n.min,o=n.max;let l=1/0,c=-1/0;for(let f=0;f<=1;f++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){i.x=r.x*f+o.x*(1-f),i.y=r.y*u+o.y*(1-u),i.z=r.z*d+o.z*(1-d);const p=t.dot(i);l=Math.min(p,l),c=Math.max(p,c)}this.min=l,this.max=c}}();const q5=function(){const i=new j,e=new j,t=new j;return function(r,o,l){const c=r.start,f=i,u=o.start,d=e;t.subVectors(c,u),i.subVectors(r.end,r.start),e.subVectors(o.end,o.start);const p=t.dot(d),A=d.dot(f),g=d.dot(d),E=t.dot(f),_=f.dot(f)*g-A*A;let v,x;_!==0?v=(p*A-E*g)/_:v=0,x=(p+v*A)/g,l.x=v,l.y=x}}(),yp=function(){const i=new Ke,e=new j,t=new j;return function(r,o,l,c){q5(r,o,i);let f=i.x,u=i.y;if(f>=0&&f<=1&&u>=0&&u<=1){r.at(f,l),o.at(u,c);return}else if(f>=0&&f<=1){u<0?o.at(0,c):o.at(1,c),r.closestPointToPoint(c,!0,l);return}else if(u>=0&&u<=1){f<0?r.at(0,l):r.at(1,l),o.closestPointToPoint(l,!0,c);return}else{let d;f<0?d=r.start:d=r.end;let p;u<0?p=o.start:p=o.end;const A=e,g=t;if(r.closestPointToPoint(p,!0,e),o.closestPointToPoint(d,!0,t),A.distanceToSquared(p)<=g.distanceToSquared(d)){l.copy(A),c.copy(p);return}else{l.copy(d),c.copy(g);return}}}}(),X5=function(){const i=new j,e=new j,t=new mr,n=new Wr;return function(o,l){const{radius:c,center:f}=o,{a:u,b:d,c:p}=l;if(n.start=u,n.end=d,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c||(n.start=u,n.end=p,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c)||(n.start=d,n.end=p,n.closestPointToPoint(f,!0,i).distanceTo(f)<=c))return!0;const C=l.getPlane(t);if(Math.abs(C.distanceToPoint(f))<=c){const v=C.projectPoint(f,e);if(l.containsPoint(v))return!0}return!1}}(),K5=1e-15;function Cp(i){return Math.abs(i)<K5}class tr extends Hn{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new j),this.satBounds=new Array(4).fill().map(()=>new qr),this.points=[this.a,this.b,this.c],this.sphere=new Ji,this.plane=new mr,this.needsUpdate=!0}intersectsSphere(e){return X5(e,this)}update(){const e=this.a,t=this.b,n=this.c,r=this.points,o=this.satAxes,l=this.satBounds,c=o[0],f=l[0];this.getNormal(c),f.setFromPoints(c,r);const u=o[1],d=l[1];u.subVectors(e,t),d.setFromPoints(u,r);const p=o[2],A=l[2];p.subVectors(t,n),A.setFromPoints(p,r);const g=o[3],E=l[3];g.subVectors(n,e),E.setFromPoints(g,r),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(c,e),this.needsUpdate=!1}}tr.prototype.closestPointToSegment=function(){const i=new j,e=new j,t=new Wr;return function(r,o=null,l=null){const{start:c,end:f}=r,u=this.points;let d,p=1/0;for(let A=0;A<3;A++){const g=(A+1)%3;t.start.copy(u[A]),t.end.copy(u[g]),yp(t,r,i,e),d=i.distanceToSquared(e),d<p&&(p=d,o&&o.copy(i),l&&l.copy(e))}return this.closestPointToPoint(c,i),d=c.distanceToSquared(i),d<p&&(p=d,o&&o.copy(i),l&&l.copy(c)),this.closestPointToPoint(f,i),d=f.distanceToSquared(i),d<p&&(p=d,o&&o.copy(i),l&&l.copy(f)),Math.sqrt(p)}}(),tr.prototype.intersectsTriangle=function(){const i=new tr,e=new Array(3),t=new Array(3),n=new qr,r=new qr,o=new j,l=new j,c=new j,f=new j,u=new j,d=new Wr,p=new Wr,A=new Wr,g=new j;function E(C,_,v){const x=C.points;let y=0,S=-1;for(let w=0;w<3;w++){const{start:b,end:B}=d;b.copy(x[w]),B.copy(x[(w+1)%3]),d.delta(l);const L=Cp(_.distanceToPoint(b));if(Cp(_.normal.dot(l))&&L){v.copy(d),y=2;break}const R=_.intersectLine(d,g);if(!R&&L&&g.copy(b),(R||L)&&!Cp(g.distanceTo(B))){if(y<=1)(y===1?v.start:v.end).copy(g),L&&(S=y);else if(y>=2){(S===1?v.start:v.end).copy(g),y=2;break}if(y++,y===2&&S===-1)break}}return y}return function(_,v=null,x=!1){this.needsUpdate&&this.update(),_.isExtendedTriangle?_.needsUpdate&&_.update():(i.copy(_),i.update(),_=i);const y=this.plane,S=_.plane;if(Math.abs(y.normal.dot(S.normal))>1-1e-10){const w=this.satBounds,b=this.satAxes;t[0]=_.a,t[1]=_.b,t[2]=_.c;for(let R=0;R<4;R++){const T=w[R],N=b[R];if(n.setFromPoints(N,t),T.isSeparated(n))return!1}const B=_.satBounds,L=_.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let R=0;R<4;R++){const T=B[R],N=L[R];if(n.setFromPoints(N,e),T.isSeparated(n))return!1}for(let R=0;R<4;R++){const T=b[R];for(let N=0;N<4;N++){const k=L[N];if(o.crossVectors(T,k),n.setFromPoints(o,e),r.setFromPoints(o,t),n.isSeparated(r))return!1}}return v&&(x||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),v.start.set(0,0,0),v.end.set(0,0,0)),!0}else{const w=E(this,S,p);if(w===1&&_.containsPoint(p.end))return v&&(v.start.copy(p.end),v.end.copy(p.end)),!0;if(w!==2)return!1;const b=E(_,y,A);if(b===1&&this.containsPoint(A.end))return v&&(v.start.copy(A.end),v.end.copy(A.end)),!0;if(b!==2)return!1;if(p.delta(c),A.delta(f),c.dot(f)<0){let O=A.start;A.start=A.end,A.end=O}const B=p.start.dot(c),L=p.end.dot(c),R=A.start.dot(c),T=A.end.dot(c),N=L<R,k=B<T;return B!==T&&R!==L&&N===k?!1:(v&&(u.subVectors(p.start,A.start),u.dot(c)>0?v.start.copy(p.start):v.start.copy(A.start),u.subVectors(p.end,A.end),u.dot(c)<0?v.end.copy(p.end):v.end.copy(A.end)),!0)}}}(),tr.prototype.distanceToPoint=function(){const i=new j;return function(t){return this.closestPointToPoint(t,i),t.distanceTo(i)}}(),tr.prototype.distanceToTriangle=function(){const i=new j,e=new j,t=["a","b","c"],n=new Wr,r=new Wr;return function(l,c=null,f=null){const u=c||f?n:null;if(this.intersectsTriangle(l,u))return(c||f)&&(c&&u.getCenter(c),f&&u.getCenter(f)),0;let d=1/0;for(let p=0;p<3;p++){let A;const g=t[p],E=l[g];this.closestPointToPoint(E,i),A=E.distanceToSquared(i),A<d&&(d=A,c&&c.copy(i),f&&f.copy(E));const C=this[g];l.closestPointToPoint(C,i),A=C.distanceToSquared(i),A<d&&(d=A,c&&c.copy(C),f&&f.copy(i))}for(let p=0;p<3;p++){const A=t[p],g=t[(p+1)%3];n.set(this[A],this[g]);for(let E=0;E<3;E++){const C=t[E],_=t[(E+1)%3];r.set(l[C],l[_]),yp(n,r,i,e);const v=i.distanceToSquared(e);v<d&&(d=v,c&&c.copy(i),f&&f.copy(e))}}return Math.sqrt(d)}}();class ni{constructor(e,t,n){this.isOrientedBox=!0,this.min=new j,this.max=new j,this.matrix=new lt,this.invMatrix=new lt,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 qr),this.alignedSatBounds=new Array(3).fill().map(()=>new qr),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}}ni.prototype.update=function(){return function(){const e=this.matrix,t=this.min,n=this.max,r=this.points;for(let u=0;u<=1;u++)for(let d=0;d<=1;d++)for(let p=0;p<=1;p++){const A=1*u|2*d|4*p,g=r[A];g.x=u?n.x:t.x,g.y=d?n.y:t.y,g.z=p?n.z:t.z,g.applyMatrix4(e)}const o=this.satBounds,l=this.satAxes,c=r[0];for(let u=0;u<3;u++){const d=l[u],p=o[u],A=1<<u,g=r[A];d.subVectors(c,g),p.setFromPoints(d,r)}const f=this.alignedSatBounds;f[0].setFromPointsField(r,"x"),f[1].setFromPointsField(r,"y"),f[2].setFromPointsField(r,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),ni.prototype.intersectsBox=function(){const i=new qr;return function(t){this.needsUpdate&&this.update();const n=t.min,r=t.max,o=this.satBounds,l=this.satAxes,c=this.alignedSatBounds;if(i.min=n.x,i.max=r.x,c[0].isSeparated(i)||(i.min=n.y,i.max=r.y,c[1].isSeparated(i))||(i.min=n.z,i.max=r.z,c[2].isSeparated(i)))return!1;for(let f=0;f<3;f++){const u=l[f],d=o[f];if(i.setFromBox(u,t),d.isSeparated(i))return!1}return!0}}(),ni.prototype.intersectsTriangle=function(){const i=new tr,e=new Array(3),t=new qr,n=new qr,r=new j;return function(l){this.needsUpdate&&this.update(),l.isExtendedTriangle?l.needsUpdate&&l.update():(i.copy(l),i.update(),l=i);const c=this.satBounds,f=this.satAxes;e[0]=l.a,e[1]=l.b,e[2]=l.c;for(let A=0;A<3;A++){const g=c[A],E=f[A];if(t.setFromPoints(E,e),g.isSeparated(t))return!1}const u=l.satBounds,d=l.satAxes,p=this.points;for(let A=0;A<3;A++){const g=u[A],E=d[A];if(t.setFromPoints(E,p),g.isSeparated(t))return!1}for(let A=0;A<3;A++){const g=f[A];for(let E=0;E<4;E++){const C=d[E];if(r.crossVectors(g,C),t.setFromPoints(r,e),n.setFromPoints(r,p),t.isSeparated(n))return!1}}return!0}}(),ni.prototype.closestPointToPoint=function(){return function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t}}(),ni.prototype.distanceToPoint=function(){const i=new j;return function(t){return this.closestPointToPoint(t,i),t.distanceTo(i)}}(),ni.prototype.distanceToBox=function(){const i=["x","y","z"],e=new Array(12).fill().map(()=>new Wr),t=new Array(12).fill().map(()=>new Wr),n=new j,r=new j;return function(l,c=0,f=null,u=null){if(this.needsUpdate&&this.update(),this.intersectsBox(l))return(f||u)&&(l.getCenter(r),this.closestPointToPoint(r,n),l.closestPointToPoint(n,r),f&&f.copy(n),u&&u.copy(r)),0;const d=c*c,p=l.min,A=l.max,g=this.points;let E=1/0;for(let _=0;_<8;_++){const v=g[_];r.copy(v).clamp(p,A);const x=v.distanceToSquared(r);if(x<E&&(E=x,f&&f.copy(v),u&&u.copy(r),x<d))return Math.sqrt(x)}let C=0;for(let _=0;_<3;_++)for(let v=0;v<=1;v++)for(let x=0;x<=1;x++){const y=(_+1)%3,S=(_+2)%3,w=v<<y|x<<S,b=1<<_|v<<y|x<<S,B=g[w],L=g[b];e[C].set(B,L);const T=i[_],N=i[y],k=i[S],O=t[C],F=O.start,V=O.end;F[T]=p[T],F[N]=v?p[N]:A[N],F[k]=x?p[k]:A[N],V[T]=A[T],V[N]=v?p[N]:A[N],V[k]=x?p[k]:A[N],C++}for(let _=0;_<=1;_++)for(let v=0;v<=1;v++)for(let x=0;x<=1;x++){r.x=_?A.x:p.x,r.y=v?A.y:p.y,r.z=x?A.z:p.z,this.closestPointToPoint(r,n);const y=r.distanceToSquared(n);if(y<E&&(E=y,f&&f.copy(n),u&&u.copy(r),y<d))return Math.sqrt(y)}for(let _=0;_<12;_++){const v=e[_];for(let x=0;x<12;x++){const y=t[x];yp(v,y,n,r);const S=n.distanceToSquared(r);if(S<E&&(E=S,f&&f.copy(n),u&&u.copy(r),S<d))return Math.sqrt(S)}}return Math.sqrt(E)}}();class Ip{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 J5 extends Ip{constructor(){super(()=>new tr)}}const ki=new J5;function ui(i,e){return e[i+15]===65535}function fi(i,e){return e[i+6]}function wi(i,e){return e[i+14]}function Fi(i){return i+8}function Mi(i,e){return e[i+6]}function xp(i,e){return e[i+7]}function qN(i){return i}class $5{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 Kt=new $5;let Is,Ba;const Ra=[],uf=new Ip(()=>new gn);function Z5(i,e,t,n,r,o){Is=uf.getPrimitive(),Ba=uf.getPrimitive(),Ra.push(Is,Ba),Kt.setBuffer(i._roots[e]);const l=Sp(0,i.geometry,t,n,r,o);Kt.clearBuffer(),uf.releasePrimitive(Is),uf.releasePrimitive(Ba),Ra.pop(),Ra.pop();const c=Ra.length;return c>0&&(Ba=Ra[c-1],Is=Ra[c-2]),l}function Sp(i,e,t,n,r=null,o=0,l=0){const{float32Array:c,uint16Array:f,uint32Array:u}=Kt;let d=i*2;if(ui(d,f)){const A=fi(i,u),g=wi(d,f);return nn(i,c,Is),n(A,g,!1,l,o+i,Is)}else{let A=function(k){const{uint16Array:O,uint32Array:F}=Kt;let V=k*2;for(;!ui(V,O);)k=Fi(k),V=k*2;return fi(k,F)},g=function(k){const{uint16Array:O,uint32Array:F}=Kt;let V=k*2;for(;!ui(V,O);)k=Mi(k,F),V=k*2;return fi(k,F)+wi(V,O)};const E=Fi(i),C=Mi(i,u);let _=E,v=C,x,y,S,w;if(r&&(S=Is,w=Ba,nn(_,c,S),nn(v,c,w),x=r(S),y=r(w),y<x)){_=C,v=E;const k=x;x=y,y=k,S=w}S||(S=Is,nn(_,c,S));const b=ui(_*2,f),B=t(S,b,x,l+1,o+_);let L;if(B===qE){const k=A(_),F=g(_)-k;L=n(k,F,!0,l+1,o+_,S)}else L=B&&Sp(_,e,t,n,r,o,l+1);if(L)return!0;w=Ba,nn(v,c,w);const R=ui(v*2,f),T=t(w,R,y,l+1,o+v);let N;if(T===qE){const k=A(v),F=g(v)-k;N=n(k,F,!0,l+1,o+v,w)}else N=T&&Sp(v,e,t,n,r,o,l+1);return!!N}}const ic=new j,wp=new j;function eL(i,e,t={},n=0,r=1/0){const o=n*n,l=r*r;let c=1/0,f=null;if(i.shapecast({boundsTraverseOrder:d=>(ic.copy(e).clamp(d.min,d.max),ic.distanceToSquared(e)),intersectsBounds:(d,p,A)=>A<c&&A<l,intersectsTriangle:(d,p)=>{d.closestPointToPoint(e,ic);const A=e.distanceToSquared(ic);return A<c&&(wp.copy(ic),c=A,f=p),A<o}}),c===1/0)return null;const u=Math.sqrt(c);return t.point?t.point.copy(wp):t.point=wp.clone(),t.distance=u,t.faceIndex=f,t}const ba=new j,La=new j,Da=new j,ff=new Ke,hf=new Ke,df=new Ke,iy=new j,ry=new j,sy=new j,Af=new j;function tL(i,e,t,n,r,o){let l;return o===Bn?l=i.intersectTriangle(n,t,e,!0,r):l=i.intersectTriangle(e,t,n,o!==Yi,r),l===null?null:{distance:i.origin.distanceTo(r),point:r.clone()}}function nL(i,e,t,n,r,o,l,c,f){ba.fromBufferAttribute(e,o),La.fromBufferAttribute(e,l),Da.fromBufferAttribute(e,c);const u=tL(i,ba,La,Da,Af,f);if(u){n&&(ff.fromBufferAttribute(n,o),hf.fromBufferAttribute(n,l),df.fromBufferAttribute(n,c),u.uv=Hn.getInterpolation(Af,ba,La,Da,ff,hf,df,new Ke)),r&&(ff.fromBufferAttribute(r,o),hf.fromBufferAttribute(r,l),df.fromBufferAttribute(r,c),u.uv1=Hn.getInterpolation(Af,ba,La,Da,ff,hf,df,new Ke)),t&&(iy.fromBufferAttribute(t,o),ry.fromBufferAttribute(t,l),sy.fromBufferAttribute(t,c),u.normal=Hn.getInterpolation(Af,ba,La,Da,iy,ry,sy,new j),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new j,materialIndex:0};Hn.getNormal(ba,La,Da,d.normal),u.face=d,u.faceIndex=o}return u}function pf(i,e,t,n,r){const o=n*3;let l=o+0,c=o+1,f=o+2;const u=i.index;i.index&&(l=u.getX(l),c=u.getX(c),f=u.getX(f));const{position:d,normal:p,uv:A,uv1:g}=i.attributes,E=nL(t,d,p,A,g,l,c,f,e);return E?(E.faceIndex=n,r&&r.push(E),E):null}function vn(i,e,t,n){const r=i.a,o=i.b,l=i.c;let c=e,f=e+1,u=e+2;t&&(c=t.getX(c),f=t.getX(f),u=t.getX(u)),r.x=n.getX(c),r.y=n.getY(c),r.z=n.getZ(c),o.x=n.getX(f),o.y=n.getY(f),o.z=n.getZ(f),l.x=n.getX(u),l.y=n.getY(u),l.z=n.getZ(u)}function iL(i,e,t,n,r,o){const{geometry:l,_indirectBuffer:c}=i;for(let f=n,u=n+r;f<u;f++)pf(l,e,t,f,o)}function rL(i,e,t,n,r){const{geometry:o,_indirectBuffer:l}=i;let c=1/0,f=null;for(let u=n,d=n+r;u<d;u++){let p;p=pf(o,e,t,u),p&&p.distance<c&&(f=p,c=p.distance)}return f}function sL(i,e,t,n,r,o,l){const{geometry:c}=t,{index:f}=c,u=c.attributes.position;for(let d=i,p=e+i;d<p;d++){let A;if(A=d,vn(l,A*3,f,u),l.needsUpdate=!0,n(l,A,r,o))return!0}return!1}function oL(i,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=i.geometry,n=t.index?t.index.array:null,r=t.attributes.position;let o,l,c,f,u=0;const d=i._roots;for(let A=0,g=d.length;A<g;A++)o=d[A],l=new Uint32Array(o),c=new Uint16Array(o),f=new Float32Array(o),p(0,u),u+=o.byteLength;function p(A,g,E=!1){const C=A*2;if(c[C+15]===of){const v=l[A+6],x=c[C+14];let y=1/0,S=1/0,w=1/0,b=-1/0,B=-1/0,L=-1/0;for(let R=3*v,T=3*(v+x);R<T;R++){let N=n[R];const k=r.getX(N),O=r.getY(N),F=r.getZ(N);k<y&&(y=k),k>b&&(b=k),O<S&&(S=O),O>B&&(B=O),F<w&&(w=F),F>L&&(L=F)}return f[A+0]!==y||f[A+1]!==S||f[A+2]!==w||f[A+3]!==b||f[A+4]!==B||f[A+5]!==L?(f[A+0]=y,f[A+1]=S,f[A+2]=w,f[A+3]=b,f[A+4]=B,f[A+5]=L,!0):!1}else{const v=A+8,x=l[A+6],y=v+g,S=x+g;let w=E,b=!1,B=!1;e?w||(b=e.has(y),B=e.has(S),w=!b&&!B):(b=!0,B=!0);const L=w||b,R=w||B;let T=!1;L&&(T=p(v,g,w));let N=!1;R&&(N=p(x,g,w));const k=T||N;if(k)for(let O=0;O<3;O++){const F=v+O,V=x+O,X=f[F],te=f[F+3],q=f[V],Z=f[V+3];f[A+O]=X<q?X:q,f[A+O+3]=te>Z?te:Z}return k}}}const oy=new gn;function xs(i,e,t,n){return nn(i,e,oy),t.intersectBox(oy,n)}function aL(i,e,t,n,r,o){const{geometry:l,_indirectBuffer:c}=i;for(let f=n,u=n+r;f<u;f++){let d=c?c[f]:f;pf(l,e,t,d,o)}}function lL(i,e,t,n,r){const{geometry:o,_indirectBuffer:l}=i;let c=1/0,f=null;for(let u=n,d=n+r;u<d;u++){let p;p=pf(o,e,t,l?l[u]:u),p&&p.distance<c&&(f=p,c=p.distance)}return f}function cL(i,e,t,n,r,o,l){const{geometry:c}=t,{index:f}=c,u=c.attributes.position;for(let d=i,p=e+i;d<p;d++){let A;if(A=t.resolveTriangleIndex(d),vn(l,A*3,f,u),l.needsUpdate=!0,n(l,A,r,o))return!0}return!1}const ay=new j;function uL(i,e,t,n,r){Kt.setBuffer(i._roots[e]),Mp(0,i,t,n,r),Kt.clearBuffer()}function Mp(i,e,t,n,r){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt,f=i*2;if(ui(f,l)){const d=fi(i,c),p=wi(f,l);iL(e,t,n,d,p,r)}else{const d=Fi(i);xs(d,o,n,ay)&&Mp(d,e,t,n,r);const p=Mi(i,c);xs(p,o,n,ay)&&Mp(p,e,t,n,r)}}const ly=new j,fL=["x","y","z"];function hL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Tp(0,i,t,n);return Kt.clearBuffer(),r}function Tp(i,e,t,n){const{float32Array:r,uint16Array:o,uint32Array:l}=Kt;let c=i*2;if(ui(c,o)){const u=fi(i,l),d=wi(c,o);return rL(e,t,n,u,d)}else{const u=xp(i,l),d=fL[u],A=n.direction[d]>=0;let g,E;A?(g=Fi(i),E=Mi(i,l)):(g=Mi(i,l),E=Fi(i));const _=xs(g,r,n,ly)?Tp(g,e,t,n):null;if(_){const y=_.point[d];if(A?y<=r[E+u]:y>=r[E+u+3])return _}const x=xs(E,r,n,ly)?Tp(E,e,t,n):null;return _&&x?_.distance<=x.distance?_:x:_||x||null}}const gf=new gn,Na=new tr,Pa=new tr,rc=new lt,cy=new ni,mf=new ni;function dL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Bp(0,i,t,n);return Kt.clearBuffer(),r}function Bp(i,e,t,n,r=null){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt;let f=i*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),cy.set(t.boundingBox.min,t.boundingBox.max,n),r=cy),ui(f,l)){const d=e.geometry,p=d.index,A=d.attributes.position,g=t.index,E=t.attributes.position,C=fi(i,c),_=wi(f,l);if(rc.copy(n).invert(),t.boundsTree)return nn(i,o,mf),mf.matrix.copy(rc),mf.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:x=>mf.intersectsBox(x),intersectsTriangle:x=>{x.a.applyMatrix4(n),x.b.applyMatrix4(n),x.c.applyMatrix4(n),x.needsUpdate=!0;for(let y=C*3,S=(_+C)*3;y<S;y+=3)if(vn(Pa,y,p,A),Pa.needsUpdate=!0,x.intersectsTriangle(Pa))return!0;return!1}});for(let v=C*3,x=(_+C)*3;v<x;v+=3){vn(Na,v,p,A),Na.a.applyMatrix4(rc),Na.b.applyMatrix4(rc),Na.c.applyMatrix4(rc),Na.needsUpdate=!0;for(let y=0,S=g.count;y<S;y+=3)if(vn(Pa,y,g,E),Pa.needsUpdate=!0,Na.intersectsTriangle(Pa))return!0}}else{const d=i+8,p=c[i+6];return nn(d,o,gf),!!(r.intersectsBox(gf)&&Bp(d,e,t,n,r)||(nn(p,o,gf),r.intersectsBox(gf)&&Bp(p,e,t,n,r)))}}const vf=new lt,Rp=new ni,sc=new ni,AL=new j,pL=new j,gL=new j,mL=new j;function vL(i,e,t,n={},r={},o=0,l=1/0){e.boundingBox||e.computeBoundingBox(),Rp.set(e.boundingBox.min,e.boundingBox.max,t),Rp.needsUpdate=!0;const c=i.geometry,f=c.attributes.position,u=c.index,d=e.attributes.position,p=e.index,A=ki.getPrimitive(),g=ki.getPrimitive();let E=AL,C=pL,_=null,v=null;r&&(_=gL,v=mL);let x=1/0,y=null,S=null;return vf.copy(t).invert(),sc.matrix.copy(vf),i.shapecast({boundsTraverseOrder:w=>Rp.distanceToBox(w),intersectsBounds:(w,b,B)=>B<x&&B<l?(b&&(sc.min.copy(w.min),sc.max.copy(w.max),sc.needsUpdate=!0),!0):!1,intersectsRange:(w,b)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:L=>sc.distanceToBox(L),intersectsBounds:(L,R,T)=>T<x&&T<l,intersectsRange:(L,R)=>{for(let T=L,N=L+R;T<N;T++){vn(g,3*T,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let k=w,O=w+b;k<O;k++){vn(A,3*k,u,f),A.needsUpdate=!0;const F=A.distanceToTriangle(g,E,_);if(F<x&&(C.copy(E),v&&v.copy(_),x=F,y=k,S=T),F<o)return!0}}}});{const B=Ta(e);for(let L=0,R=B;L<R;L++){vn(g,3*L,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let T=w,N=w+b;T<N;T++){vn(A,3*T,u,f),A.needsUpdate=!0;const k=A.distanceToTriangle(g,E,_);if(k<x&&(C.copy(E),v&&v.copy(_),x=k,y=T,S=L),k<o)return!0}}}}}),ki.releasePrimitive(A),ki.releasePrimitive(g),x===1/0?null:(n.point?n.point.copy(C):n.point=C.clone(),n.distance=x,n.faceIndex=y,r&&(r.point?r.point.copy(v):r.point=v.clone(),r.point.applyMatrix4(vf),C.applyMatrix4(vf),r.distance=C.sub(r.point).length(),r.faceIndex=S),n)}function _L(i,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=i.geometry,n=t.index?t.index.array:null,r=t.attributes.position;let o,l,c,f,u=0;const d=i._roots;for(let A=0,g=d.length;A<g;A++)o=d[A],l=new Uint32Array(o),c=new Uint16Array(o),f=new Float32Array(o),p(0,u),u+=o.byteLength;function p(A,g,E=!1){const C=A*2;if(c[C+15]===of){const v=l[A+6],x=c[C+14];let y=1/0,S=1/0,w=1/0,b=-1/0,B=-1/0,L=-1/0;for(let R=v,T=v+x;R<T;R++){const N=3*i.resolveTriangleIndex(R);for(let k=0;k<3;k++){let O=N+k;O=n?n[O]:O;const F=r.getX(O),V=r.getY(O),X=r.getZ(O);F<y&&(y=F),F>b&&(b=F),V<S&&(S=V),V>B&&(B=V),X<w&&(w=X),X>L&&(L=X)}}return f[A+0]!==y||f[A+1]!==S||f[A+2]!==w||f[A+3]!==b||f[A+4]!==B||f[A+5]!==L?(f[A+0]=y,f[A+1]=S,f[A+2]=w,f[A+3]=b,f[A+4]=B,f[A+5]=L,!0):!1}else{const v=A+8,x=l[A+6],y=v+g,S=x+g;let w=E,b=!1,B=!1;e?w||(b=e.has(y),B=e.has(S),w=!b&&!B):(b=!0,B=!0);const L=w||b,R=w||B;let T=!1;L&&(T=p(v,g,w));let N=!1;R&&(N=p(x,g,w));const k=T||N;if(k)for(let O=0;O<3;O++){const F=v+O,V=x+O,X=f[F],te=f[F+3],q=f[V],Z=f[V+3];f[A+O]=X<q?X:q,f[A+O+3]=te>Z?te:Z}return k}}}const uy=new j;function EL(i,e,t,n,r){Kt.setBuffer(i._roots[e]),bp(0,i,t,n,r),Kt.clearBuffer()}function bp(i,e,t,n,r){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt,f=i*2;if(ui(f,l)){const d=fi(i,c),p=wi(f,l);aL(e,t,n,d,p,r)}else{const d=Fi(i);xs(d,o,n,uy)&&bp(d,e,t,n,r);const p=Mi(i,c);xs(p,o,n,uy)&&bp(p,e,t,n,r)}}const fy=new j,yL=["x","y","z"];function CL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Lp(0,i,t,n);return Kt.clearBuffer(),r}function Lp(i,e,t,n){const{float32Array:r,uint16Array:o,uint32Array:l}=Kt;let c=i*2;if(ui(c,o)){const u=fi(i,l),d=wi(c,o);return lL(e,t,n,u,d)}else{const u=xp(i,l),d=yL[u],A=n.direction[d]>=0;let g,E;A?(g=Fi(i),E=Mi(i,l)):(g=Mi(i,l),E=Fi(i));const _=xs(g,r,n,fy)?Lp(g,e,t,n):null;if(_){const y=_.point[d];if(A?y<=r[E+u]:y>=r[E+u+3])return _}const x=xs(E,r,n,fy)?Lp(E,e,t,n):null;return _&&x?_.distance<=x.distance?_:x:_||x||null}}const _f=new gn,Ua=new tr,ka=new tr,oc=new lt,hy=new ni,Ef=new ni;function IL(i,e,t,n){Kt.setBuffer(i._roots[e]);const r=Dp(0,i,t,n);return Kt.clearBuffer(),r}function Dp(i,e,t,n,r=null){const{float32Array:o,uint16Array:l,uint32Array:c}=Kt;let f=i*2;if(r===null&&(t.boundingBox||t.computeBoundingBox(),hy.set(t.boundingBox.min,t.boundingBox.max,n),r=hy),ui(f,l)){const d=e.geometry,p=d.index,A=d.attributes.position,g=t.index,E=t.attributes.position,C=fi(i,c),_=wi(f,l);if(oc.copy(n).invert(),t.boundsTree)return nn(i,o,Ef),Ef.matrix.copy(oc),Ef.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:x=>Ef.intersectsBox(x),intersectsTriangle:x=>{x.a.applyMatrix4(n),x.b.applyMatrix4(n),x.c.applyMatrix4(n),x.needsUpdate=!0;for(let y=C,S=_+C;y<S;y++)if(vn(ka,3*e.resolveTriangleIndex(y),p,A),ka.needsUpdate=!0,x.intersectsTriangle(ka))return!0;return!1}});for(let v=C,x=_+C;v<x;v++){const y=e.resolveTriangleIndex(v);vn(Ua,3*y,p,A),Ua.a.applyMatrix4(oc),Ua.b.applyMatrix4(oc),Ua.c.applyMatrix4(oc),Ua.needsUpdate=!0;for(let S=0,w=g.count;S<w;S+=3)if(vn(ka,S,g,E),ka.needsUpdate=!0,Ua.intersectsTriangle(ka))return!0}}else{const d=i+8,p=c[i+6];return nn(d,o,_f),!!(r.intersectsBox(_f)&&Dp(d,e,t,n,r)||(nn(p,o,_f),r.intersectsBox(_f)&&Dp(p,e,t,n,r)))}}const yf=new lt,Np=new ni,ac=new ni,xL=new j,SL=new j,wL=new j,ML=new j;function TL(i,e,t,n={},r={},o=0,l=1/0){e.boundingBox||e.computeBoundingBox(),Np.set(e.boundingBox.min,e.boundingBox.max,t),Np.needsUpdate=!0;const c=i.geometry,f=c.attributes.position,u=c.index,d=e.attributes.position,p=e.index,A=ki.getPrimitive(),g=ki.getPrimitive();let E=xL,C=SL,_=null,v=null;r&&(_=wL,v=ML);let x=1/0,y=null,S=null;return yf.copy(t).invert(),ac.matrix.copy(yf),i.shapecast({boundsTraverseOrder:w=>Np.distanceToBox(w),intersectsBounds:(w,b,B)=>B<x&&B<l?(b&&(ac.min.copy(w.min),ac.max.copy(w.max),ac.needsUpdate=!0),!0):!1,intersectsRange:(w,b)=>{if(e.boundsTree){const B=e.boundsTree;return B.shapecast({boundsTraverseOrder:L=>ac.distanceToBox(L),intersectsBounds:(L,R,T)=>T<x&&T<l,intersectsRange:(L,R)=>{for(let T=L,N=L+R;T<N;T++){const k=B.resolveTriangleIndex(T);vn(g,3*k,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let O=w,F=w+b;O<F;O++){const V=i.resolveTriangleIndex(O);vn(A,3*V,u,f),A.needsUpdate=!0;const X=A.distanceToTriangle(g,E,_);if(X<x&&(C.copy(E),v&&v.copy(_),x=X,y=O,S=T),X<o)return!0}}}})}else{const B=Ta(e);for(let L=0,R=B;L<R;L++){vn(g,3*L,p,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let T=w,N=w+b;T<N;T++){const k=i.resolveTriangleIndex(T);vn(A,3*k,u,f),A.needsUpdate=!0;const O=A.distanceToTriangle(g,E,_);if(O<x&&(C.copy(E),v&&v.copy(_),x=O,y=T,S=L),O<o)return!0}}}}}),ki.releasePrimitive(A),ki.releasePrimitive(g),x===1/0?null:(n.point?n.point.copy(C):n.point=C.clone(),n.distance=x,n.faceIndex=y,r&&(r.point?r.point.copy(v):r.point=v.clone(),r.point.applyMatrix4(yf),C.applyMatrix4(yf),r.distance=C.sub(r.point).length(),r.faceIndex=S),n)}function BL(){return typeof SharedArrayBuffer<"u"}const lc=new Kt.constructor,Cf=new Kt.constructor,Ss=new Ip(()=>new gn),Fa=new gn,Qa=new gn,Pp=new gn,Up=new gn;let kp=!1;function RL(i,e,t,n){if(kp)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");kp=!0;const r=i._roots,o=e._roots;let l,c=0,f=0;const u=new lt().copy(t).invert();for(let d=0,p=r.length;d<p;d++){lc.setBuffer(r[d]),f=0;const A=Ss.getPrimitive();nn(0,lc.float32Array,A),A.applyMatrix4(u);for(let g=0,E=o.length;g<E&&(Cf.setBuffer(o[d]),l=nr(0,0,t,u,n,c,f,0,0,A),Cf.clearBuffer(),f+=o[g].length,!l);g++);if(Ss.releasePrimitive(A),lc.clearBuffer(),c+=r[d].length,l)break}return kp=!1,l}function nr(i,e,t,n,r,o=0,l=0,c=0,f=0,u=null,d=!1){let p,A;d?(p=Cf,A=lc):(p=lc,A=Cf);const g=p.float32Array,E=p.uint32Array,C=p.uint16Array,_=A.float32Array,v=A.uint32Array,x=A.uint16Array,y=i*2,S=e*2,w=ui(y,C),b=ui(S,x);let B=!1;if(b&&w)d?B=r(fi(e,v),wi(e*2,x),fi(i,E),wi(i*2,C),f,l+e,c,o+i):B=r(fi(i,E),wi(i*2,C),fi(e,v),wi(e*2,x),c,o+i,f,l+e);else if(b){const L=Ss.getPrimitive();nn(e,_,L),L.applyMatrix4(t);const R=Fi(i),T=Mi(i,E);nn(R,g,Fa),nn(T,g,Qa);const N=L.intersectsBox(Fa),k=L.intersectsBox(Qa);B=N&&nr(e,R,n,t,r,l,o,f,c+1,L,!d)||k&&nr(e,T,n,t,r,l,o,f,c+1,L,!d),Ss.releasePrimitive(L)}else{const L=Fi(e),R=Mi(e,v);nn(L,_,Pp),nn(R,_,Up);const T=u.intersectsBox(Pp),N=u.intersectsBox(Up);if(T&&N)B=nr(i,L,t,n,r,o,l,c,f+1,u,d)||nr(i,R,t,n,r,o,l,c,f+1,u,d);else if(T)if(w)B=nr(i,L,t,n,r,o,l,c,f+1,u,d);else{const k=Ss.getPrimitive();k.copy(Pp).applyMatrix4(t);const O=Fi(i),F=Mi(i,E);nn(O,g,Fa),nn(F,g,Qa);const V=k.intersectsBox(Fa),X=k.intersectsBox(Qa);B=V&&nr(L,O,n,t,r,l,o,f,c+1,k,!d)||X&&nr(L,F,n,t,r,l,o,f,c+1,k,!d),Ss.releasePrimitive(k)}else if(N)if(w)B=nr(i,R,t,n,r,o,l,c,f+1,u,d);else{const k=Ss.getPrimitive();k.copy(Up).applyMatrix4(t);const O=Fi(i),F=Mi(i,E);nn(O,g,Fa),nn(F,g,Qa);const V=k.intersectsBox(Fa),X=k.intersectsBox(Qa);B=V&&nr(R,O,n,t,r,l,o,f,c+1,k,!d)||X&&nr(R,F,n,t,r,l,o,f,c+1,k,!d),Ss.releasePrimitive(k)}}return B}const If=new ni,dy=new gn;class Fp{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,r=e._roots,o=e._indirectBuffer,l=n.getIndex();let c;return t.cloneBuffers?c={roots:r.map(f=>f.slice()),index:l.array.slice(),indirectBuffer:o?o.slice():null}:c={roots:r,index:l.array,indirectBuffer:o},c}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:r,roots:o,indirectBuffer:l}=e,c=new Fp(t,{...n,[_p]:!0});if(c._roots=o,c._indirectBuffer=l||null,n.setIndex){const f=t.getIndex();if(f===null){const u=new bn(e.index,1,!1);t.setIndex(u)}else f.array!==r&&(f.array.set(r),f.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:jE,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[_p]:!1},t),t.useSharedArrayBuffer&&!BL())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[_p]||(Y5(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new gn)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?r=>n[r]:r=>r}refit(e=null){return(this.indirect?_L:oL)(this,e)}traverse(e,t=0){const n=this._roots[t],r=new Uint32Array(n),o=new Uint16Array(n);l(0);function l(c,f=0){const u=c*2,d=o[u+15]===of;if(d){const p=r[c+6],A=o[u+14];e(f,d,new Float32Array(n,c*4,6),p,A)}else{const p=c+yo/4,A=r[c+6],g=r[c+7];e(f,d,new Float32Array(n,c*4,6),g)||(l(p,f+1),l(A,f+1))}}}raycast(e,t=ji){const n=this._roots,r=this.geometry,o=[],l=t.isMaterial,c=Array.isArray(t),f=r.groups,u=l?t.side:t,d=this.indirect?EL:uL;for(let p=0,A=n.length;p<A;p++){const g=c?t[f[p].materialIndex].side:u,E=o.length;if(d(this,p,g,e,o),c){const C=f[p].materialIndex;for(let _=E,v=o.length;_<v;_++)o[_].face.materialIndex=C}}return o}raycastFirst(e,t=ji){const n=this._roots,r=this.geometry,o=t.isMaterial,l=Array.isArray(t);let c=null;const f=r.groups,u=o?t.side:t,d=this.indirect?CL:hL;for(let p=0,A=n.length;p<A;p++){const g=l?t[f[p].materialIndex].side:u,E=d(this,p,g,e);E!=null&&(c==null||E.distance<c.distance)&&(c=E,l&&(E.face.materialIndex=f[p].materialIndex))}return c}intersectsGeometry(e,t){let n=!1;const r=this._roots,o=this.indirect?IL:dL;for(let l=0,c=r.length;l<c&&(n=o(this,l,e,t),!n);l++);return n}shapecast(e){const t=ki.getPrimitive(),n=this.indirect?cL:sL;let{boundsTraverseOrder:r,intersectsBounds:o,intersectsRange:l,intersectsTriangle:c}=e;if(l&&c){const p=l;l=(A,g,E,C,_)=>p(A,g,E,C,_)?!0:n(A,g,this,c,E,C,t)}else l||(c?l=(p,A,g,E)=>n(p,A,this,c,g,E,t):l=(p,A,g)=>g);let f=!1,u=0;const d=this._roots;for(let p=0,A=d.length;p<A;p++){const g=d[p];if(f=Z5(this,p,o,l,r,u),f)break;u+=g.byteLength}return ki.releasePrimitive(t),f}bvhcast(e,t,n){let{intersectsRanges:r,intersectsTriangles:o}=n;const l=ki.getPrimitive(),c=this.geometry.index,f=this.geometry.attributes.position,u=this.indirect?E=>{const C=this.resolveTriangleIndex(E);vn(l,C*3,c,f)}:E=>{vn(l,E*3,c,f)},d=ki.getPrimitive(),p=e.geometry.index,A=e.geometry.attributes.position,g=e.indirect?E=>{const C=e.resolveTriangleIndex(E);vn(d,C*3,p,A)}:E=>{vn(d,E*3,p,A)};if(o){const E=(C,_,v,x,y,S,w,b)=>{for(let B=v,L=v+x;B<L;B++){g(B),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let R=C,T=C+_;R<T;R++)if(u(R),l.needsUpdate=!0,o(l,d,R,B,y,S,w,b))return!0}return!1};if(r){const C=r;r=function(_,v,x,y,S,w,b,B){return C(_,v,x,y,S,w,b,B)?!0:E(_,v,x,y,S,w,b,B)}}else r=E}return RL(this,e,t,r)}intersectsBox(e,t){return If.set(e.min,e.max,t),If.needsUpdate=!0,this.shapecast({intersectsBounds:n=>If.intersectsBox(n),intersectsTriangle:n=>If.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},r={},o=0,l=1/0){return(this.indirect?TL:vL)(this,e,t,n,r,o,l)}closestPointToPoint(e,t={},n=0,r=1/0){return eL(this,e,t,n,r)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(n=>{nn(0,new Float32Array(n),dy),e.union(dy)}),e}}function bL(i){switch(i){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function LL(i){switch(i){case 1:return lo;case 2:return co;case 3:return on;case 4:return on}}function Ay(i){switch(i){case 1:return eA;case 2:return fu;case 3:return Nl;case 4:return Nl}}class py extends _a{constructor(){super(),this.minFilter=qt,this.magFilter=qt,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,r=e.count;if(t!==null){if(n*r%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=r*n/t}const o=e.itemSize,l=e.count,c=e.normalized,f=e.array.constructor,u=f.BYTES_PER_ELEMENT;let d=this._forcedType,p=o;if(d===null)switch(f){case Float32Array:d=hn;break;case Uint8Array:case Uint16Array:case Uint32Array:d=yi;break;case Int8Array:case Int16Array:case Int32Array:d=Dl;break}let A,g,E,C,_=bL(o);switch(d){case hn:E=1,g=LL(o),c&&u===1?(C=f,_+="8",f===Uint8Array?A=fn:(A=Zd,_+="_SNORM")):(C=Float32Array,_+="32F",A=hn);break;case Dl:_+=u*8+"I",E=c?Math.pow(2,f.BYTES_PER_ELEMENT*8-1):1,g=Ay(o),u===1?(C=Int8Array,A=Zd):u===2?(C=Int16Array,A=s1):(C=Int32Array,A=Dl);break;case yi:_+=u*8+"UI",E=c?Math.pow(2,f.BYTES_PER_ELEMENT*8-1):1,g=Ay(o),u===1?(C=Uint8Array,A=fn):u===2?(C=Uint16Array,A=uu):(C=Uint32Array,A=yi);break}p===3&&(g===on||g===Nl)&&(p=4);const v=Math.ceil(Math.sqrt(l)),x=p*v*v,y=new C(x),S=e.normalized;e.normalized=!1;for(let w=0;w<l;w++){const b=p*w;y[b]=e.getX(w)/E,o>=2&&(y[b+1]=e.getY(w)/E),o>=3&&(y[b+2]=e.getZ(w)/E,p===4&&(y[b+3]=1)),o>=4&&(y[b+3]=e.getW(w)/E)}e.normalized=S,this.internalFormat=_,this.format=g,this.type=A,this.image.width=v,this.image.height=v,this.image.data=y,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=r}}class DL extends py{constructor(){super(),this._forcedType=yi}}class NL extends py{constructor(){super(),this._forcedType=hn}}class gy{constructor(){this.index=new DL,this.position=new NL,this.bvhBounds=new _a,this.bvhContents=new _a,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(UL(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 r=JE(KE(t));this._cachedIndexAttr=new bn(r,1,!1)}PL(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:r}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),r&&r.dispose()}}function PL(i,e,t){const n=t.array,r=i.index?i.index.array:null;for(let o=0,l=e.length;o<l;o++){const c=3*o,f=3*e[o];for(let u=0;u<3;u++)n[c+u]=r?r[f+u]:f+u}}function UL(i,e,t){const n=i._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const r=n[0],o=new Uint16Array(r),l=new Uint32Array(r),c=new Float32Array(r),f=r.byteLength/yo,u=2*Math.ceil(Math.sqrt(f/2)),d=new Float32Array(4*u*u),p=Math.ceil(Math.sqrt(f)),A=new Uint32Array(2*p*p);for(let g=0;g<f;g++){const E=g*yo/4,C=E*2,_=E;for(let v=0;v<3;v++)d[8*g+0+v]=c[_+0+v],d[8*g+4+v]=c[_+3+v];if(ui(C,o)){const v=wi(C,o),x=fi(E,l),y=4294901760|v;A[g*2+0]=y,A[g*2+1]=x}else{const v=4*Mi(E,l)/yo,x=xp(E,l);A[g*2+0]=x,A[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=on,e.type=hn,e.internalFormat="RGBA32F",e.minFilter=qt,e.magFilter=qt,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=A,t.image.width=p,t.image.height=p,t.format=fu,t.type=yi,t.internalFormat="RG32UI",t.minFilter=qt,t.magFilter=qt,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const kL=`
3772
3772
  #ifndef TRI_INTERSECT_EPSILON
3773
3773
  #define TRI_INTERSECT_EPSILON 1e-5
3774
3774
  #endif
@@ -4035,7 +4035,7 @@ bool bvhIntersectFirstHit(
4035
4035
  return found;
4036
4036
 
4037
4037
  }
4038
- `;function QL(i,e,t,n){const r=class extends Si{constructor(l={}){const c=Object.entries(i);super({uniforms:c.reduce((f,[u,d])=>{const p=Hu.clone({[u]:{value:d}});return{...f,...p}},{}),vertexShader:e,fragmentShader:t}),this.key="",c.forEach(([f])=>Object.defineProperty(this,f,{get:()=>this.uniforms[f].value,set:u=>this.uniforms[f].value=u})),Object.assign(this,l),n&&n(this)}};return r.key=AA.generateUUID(),r}const OL=QL({envMap:null,bounces:2,ior:2.5,correctMips:!0,aberrationStrength:.01,fresnel:.4,bvh:new gy,color:new tt("white"),resolution:new Ke,viewMatrixInverse:new ct,projectionMatrixInverse:new ct},`
4038
+ `;function QL(i,e,t,n){const r=class extends Si{constructor(l={}){const c=Object.entries(i);super({uniforms:c.reduce((f,[u,d])=>{const p=Hu.clone({[u]:{value:d}});return{...f,...p}},{}),vertexShader:e,fragmentShader:t}),this.key="",c.forEach(([f])=>Object.defineProperty(this,f,{get:()=>this.uniforms[f].value,set:u=>this.uniforms[f].value=u})),Object.assign(this,l),n&&n(this)}};return r.key=AA.generateUUID(),r}const OL=QL({envMap:null,bounces:2,ior:2.5,correctMips:!0,aberrationStrength:.01,fresnel:.4,bvh:new gy,color:new et("white"),resolution:new Ke,viewMatrixInverse:new lt,projectionMatrixInverse:new lt},`
4039
4039
  uniform mat4 viewMatrixInverse;
4040
4040
 
4041
4041
  varying vec3 vWorldPosition;
@@ -4182,7 +4182,7 @@ bool bvhIntersectFirstHit(
4182
4182
  gl_FragColor = vec4(mix(finalColor, vec3(1.0), nFresnel), 1.0);
4183
4183
  #include <tonemapping_fragment>
4184
4184
  #include <${(()=>parseInt(su.replace(/\D+/g,"")))()>=154?"colorspace_fragment":"encodings_fragment"}>
4185
- }`);let Qn,Ht;const zL=new _r({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:0,color:new tt(16777215),transparent:!0,shadowSide:Bn,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let Oa;const Qp=[0,.4,.7,1],my=[.85,.62,.3,0],vy=[new tt(16777215),new tt(16777215),new tt(16777215),new tt(16777215)],xn={resolution:{value:new Ke(0,0)},color:{value:new tt(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:vy},positions:{value:Qp},opacities:{value:my}},_y=new E5;document.getElementById("gui-container");const Xr=new OL,GL=1;new xA().set(GL),new Gr({color:"black"});class HL{constructor(){Ft(this,"scene"),Ft(this,"camera"),Ft(this,"renderer"),Ft(this,"canvas"),Ft(this,"canvasSize"),Ft(this,"isInitialised"),Ft(this,"orgId"),Ft(this,"textureLoader"),this.scene=new FR,this.canvasSize=new Ke,this.isInitialised=!1,this.textureLoader=new lE,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 $n(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new Q_({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),_y.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Ll,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),r=Math.floor(this.canvas.clientHeight*t),o=this.canvas.width!==n||this.canvas.height!==r;return o&&((e=this.renderer)==null||e.setSize(n,r,!1)),o}initGemstoneDependencies(){var e;_y.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Ll,Xr.uniforms.envMap.value=A,Oa=A});const t=.01,n=A=>A&&A.isCubeTexture;Xr.uniforms.aberrationStrength.value=t,Xr.uniforms.resolution.value=this.canvasSize;const r={},o=n(Oa),c=((o?(e=Oa==null?void 0:Oa.image[0])==null?void 0:e.width:Oa==null?void 0:Oa.image.width)??1024)/4,f=Math.floor(Math.log2(c)),u=Math.pow(2,f),d=3*Math.max(u,16*7),p=4*u;o&&(r.ENVMAP_TYPE_CUBEM=""),r.CUBEUV_TEXEL_WIDTH=`${1/d}`,r.CUBEUV_TEXEL_HEIGHT=`${1/p}`,r.CUBEUV_MAX_MIP=`${f}.0`,r.CHROMATIC_ABERRATIONS="",r.FAST_CHROMA="",Xr.defines=r}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const r=await aM(t,n);if(!r||!r.decodedData)throw new Error("Asset auth error.");return new Promise(o=>{e.parse(r.decodedData,"",l=>{o({result:l})})})}async downloadModel(e,t){return await Lh.DownloadMA({orgId:e,assetsId:t})}async loadFirstFrame(e,t){if(t&&e){const n=await this.downloadModel(e,t._id),r=t.customisation.find(l=>l.type=="Lens"),o=t.customisation.find(l=>l.type=="Orbital");await this.renderModel(n.asset.cloudfrontUrl,!1,n.decryptionKey).then(async()=>new Promise(async(l,c)=>{r&&this.setupLensMaterial(r),l(),o?await this.setupOrbitalMaterial(o).then(()=>{l()}):l()}))}else return}async changeFrame(e,t,n){if(t&&e){const r=await this.downloadModel(e,t._id),o=n.find(d=>d.type=="Lens"),l=n.find(d=>d.type=="Orbital"),c=t.customisation.find(d=>d.type=="Lens"),f=t.customisation.find(d=>d.type=="Orbital"),u=c==null&&o.sku=="lens-default";await this.renderModel(r.asset.cloudfrontUrl,u,r.decryptionKey).then(async()=>new Promise(async(d,p)=>{o.sku=="lens-default"?(c&&this.setupLensMaterial(c),d()):(this.setupLensMaterial(o),d()),(l==null?void 0:l.sku)=="orbital-default"?f&&await this.setupOrbitalMaterial(f).then(()=>{d()}):await this.setupOrbitalMaterial(l).then(()=>{d()})}))}}async changeLens(e,t,n,r){return new Promise((o,l)=>{if(n)this.changeFrame(t,r,e).then(()=>{o()});else{const c=e.find(f=>f.type=="Lens");this.setupLensMaterial(c),o()}})}async changeOrbital(e){return new Promise(async(t,n)=>{await this.setupOrbitalMaterial(e).then(()=>{t()})})}async renderModel(e,t,n){const r=new Bb;e&&await this.loadEyewearFromGLTF(r,e,this.renderer,t,n)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof xi){const n=e.geometry.getAttribute("position");if(n){const r=n.array;for(let o=0;o<r.length;o+=3){const l=new j(r[o],r[o+1],r[o+2]),c=e.localToWorld(l.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}updateMaterials(e){this.updateScene(e);let t=Number.POSITIVE_INFINITY,n=-.313;e.scene.traverse(o=>{if(o.isMesh){if(t=Math.min(t,this.getMinY(o)),o.material&&o.material.name=="Lenses"){let l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(o.geometry instanceof xi){const f=o.geometry.getAttribute("position");if(f){const u=f.array;for(let d=0;d<u.length;d+=3){const p=new j(u[d],u[d+1],u[d+2]),A=o.localToWorld(p.clone());l=Math.min(l,A.y),c=Math.max(c,A.y)}}}xn.minY.value=l,xn.maxY.value=c,Qn=new _r({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new tt(16777215),transparent:!0,shadowSide:Bn,depthWrite:!1}),o.material=Qn,Qn&&(Qn.onBeforeCompile=function(f){f.uniforms.resolution=xn.resolution,f.uniforms.color=xn.color,f.uniforms.uAlpha=xn.uAlpha,f.uniforms.colors=xn.colors,f.uniforms.positions=xn.positions,f.uniforms.opacities=xn.opacities,f.uniforms.minX=xn.minX,f.uniforms.maxX=xn.maxX,f.uniforms.minY=xn.minY,f.uniforms.maxY=xn.maxY,f.vertexShader=`
4185
+ }`);let Qn,Ht;const zL=new _r({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:0,color:new et(16777215),transparent:!0,shadowSide:Bn,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let Oa;const Qp=[0,.4,.7,1],my=[.85,.62,.3,0],vy=[new et(16777215),new et(16777215),new et(16777215),new et(16777215)],xn={resolution:{value:new Ke(0,0)},color:{value:new et(16777215)},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},colors:{value:vy},positions:{value:Qp},opacities:{value:my}},_y=new E5;document.getElementById("gui-container");const Xr=new OL,GL=1;new xA().set(GL),new Gr({color:"black"});class HL{constructor(){Ft(this,"scene"),Ft(this,"camera"),Ft(this,"renderer"),Ft(this,"canvas"),Ft(this,"canvasSize"),Ft(this,"isInitialised"),Ft(this,"orgId"),Ft(this,"textureLoader"),this.scene=new FR,this.canvasSize=new Ke,this.isInitialised=!1,this.textureLoader=new lE,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 Zn(12,e/t,.1,1e4),this.camera.lookAt(0,0,0),this.renderer=new Q_({canvas:this.canvas,alpha:!0,antialias:!0}),this.resizeRenderer(),_y.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",n=>{n.mapping=Ll,this.scene.environment=n}),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),r=Math.floor(this.canvas.clientHeight*t),o=this.canvas.width!==n||this.canvas.height!==r;return o&&((e=this.renderer)==null||e.setSize(n,r,!1)),o}initGemstoneDependencies(){var e;_y.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",A=>{A.mapping=Ll,Xr.uniforms.envMap.value=A,Oa=A});const t=.01,n=A=>A&&A.isCubeTexture;Xr.uniforms.aberrationStrength.value=t,Xr.uniforms.resolution.value=this.canvasSize;const r={},o=n(Oa),c=((o?(e=Oa==null?void 0:Oa.image[0])==null?void 0:e.width:Oa==null?void 0:Oa.image.width)??1024)/4,f=Math.floor(Math.log2(c)),u=Math.pow(2,f),d=3*Math.max(u,16*7),p=4*u;o&&(r.ENVMAP_TYPE_CUBEM=""),r.CUBEUV_TEXEL_WIDTH=`${1/d}`,r.CUBEUV_TEXEL_HEIGHT=`${1/p}`,r.CUBEUV_MAX_MIP=`${f}.0`,r.CHROMATIC_ABERRATIONS="",r.FAST_CHROMA="",Xr.defines=r}cleanUp(){this.renderer&&this.renderer.dispose()}async LoadEncryptedGlb(e,t,n){const r=await aM(t,n);if(!r||!r.decodedData)throw new Error("Asset auth error.");return new Promise(o=>{e.parse(r.decodedData,"",l=>{o({result:l})})})}async downloadModel(e,t){return await Lh.DownloadMA({orgId:e,assetsId:t})}async loadFirstFrame(e,t){if(t&&e){const n=await this.downloadModel(e,t._id),r=t.customisation.find(l=>l.type=="Lens"),o=t.customisation.find(l=>l.type=="Orbital");await this.renderModel(n.asset.cloudfrontUrl,!1,n.decryptionKey).then(async()=>new Promise(async(l,c)=>{r&&this.setupLensMaterial(r),l(),o?await this.setupOrbitalMaterial(o).then(()=>{l()}):l()}))}else return}async changeFrame(e,t,n){if(t&&e){const r=await this.downloadModel(e,t._id),o=n.find(d=>d.type=="Lens"),l=n.find(d=>d.type=="Orbital"),c=t.customisation.find(d=>d.type=="Lens"),f=t.customisation.find(d=>d.type=="Orbital"),u=c==null&&o.sku=="lens-default";await this.renderModel(r.asset.cloudfrontUrl,u,r.decryptionKey).then(async()=>new Promise(async(d,p)=>{o.sku=="lens-default"?(c&&this.setupLensMaterial(c),d()):(this.setupLensMaterial(o),d()),(l==null?void 0:l.sku)=="orbital-default"?f&&await this.setupOrbitalMaterial(f).then(()=>{d()}):await this.setupOrbitalMaterial(l).then(()=>{d()})}))}}async changeLens(e,t,n,r){return new Promise((o,l)=>{if(n)this.changeFrame(t,r,e).then(()=>{o()});else{const c=e.find(f=>f.type=="Lens");this.setupLensMaterial(c),o()}})}async changeOrbital(e){return new Promise(async(t,n)=>{await this.setupOrbitalMaterial(e).then(()=>{t()})})}async renderModel(e,t,n){const r=new Bb;e&&await this.loadEyewearFromGLTF(r,e,this.renderer,t,n)}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof xi){const n=e.geometry.getAttribute("position");if(n){const r=n.array;for(let o=0;o<r.length;o+=3){const l=new j(r[o],r[o+1],r[o+2]),c=e.localToWorld(l.clone());t=Math.min(t,c.y)}}}return t}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}updateMaterials(e){this.updateScene(e);let t=Number.POSITIVE_INFINITY,n=-.313;e.scene.traverse(o=>{if(o.isMesh){if(t=Math.min(t,this.getMinY(o)),o.material&&o.material.name=="Lenses"){let l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(o.geometry instanceof xi){const f=o.geometry.getAttribute("position");if(f){const u=f.array;for(let d=0;d<u.length;d+=3){const p=new j(u[d],u[d+1],u[d+2]),A=o.localToWorld(p.clone());l=Math.min(l,A.y),c=Math.max(c,A.y)}}}xn.minY.value=l,xn.maxY.value=c,Qn=new _r({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new et(16777215),transparent:!0,shadowSide:Bn,depthWrite:!1}),o.material=Qn,Qn&&(Qn.onBeforeCompile=function(f){f.uniforms.resolution=xn.resolution,f.uniforms.color=xn.color,f.uniforms.uAlpha=xn.uAlpha,f.uniforms.colors=xn.colors,f.uniforms.positions=xn.positions,f.uniforms.opacities=xn.opacities,f.uniforms.minX=xn.minX,f.uniforms.maxX=xn.maxX,f.uniforms.minY=xn.minY,f.uniforms.maxY=xn.maxY,f.vertexShader=`
4186
4186
  varying vec3 vPosition;
4187
4187
  varying vec3 localPosition;
4188
4188
  varying vec2 vUv;
@@ -4227,10 +4227,10 @@ bool bvhIntersectFirstHit(
4227
4227
  diffuseColor.a = alpha;
4228
4228
  }
4229
4229
 
4230
- `)},o.matrixAutoUpdate=!0,Qn.matrixAutoUpdate=!0,Qn.needsUpdate=!0)}o.material&&o.material.name.toLowerCase()=="frame-stems"&&(Ht=zL,Ht.envMap=this.scene.environment,o.material=Ht,o.matrixAutoUpdate=!0,Ht.matrixAutoUpdate=!0,Ht.needsUpdate=!0),o.material&&o.name==="Diamonds"&&(this.initGemstoneDependencies(),Xr.uniforms.bvh.value=new gy,Xr.uniforms.bvh.value.updateFrom(new Fp(o.geometry.clone().toNonIndexed(),{strategy:YE})),o.material=Xr)}});let r=n-t;e.scene.position.y+=r,xn.minY.value+=r,xn.maxY.value+=r}async loadEyewearFromGLTF(e,t,n,r,o){const l=new aE,c=new yr(l).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(c.detectSupport(n));const f=o,u=t.includes(".glb");let d;return u?d=await e.loadAsync(t):d=await this.LoadEncryptedGlb(e,t,f).then(p=>{r?this.updateScene(p.result):this.updateMaterials(p.result),this.loadModelInsideScene(p.result.scene)}),d==null?void 0:d.scene}setupLensMaterial(e){if(Qn){if(e.direction=="u")Qn.color=new tt(e.color),Qn.opacity=e.opacity,xn.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;xn.uAlpha.value=!0;let n=0;t.forEach(()=>{xn.colors.value[n]=new tt(t[n].color),xn.positions.value[n]=t[n].position,xn.opacities.value[n]=t[n].alpha,n++})}e.finish=="MIRBLKHMC"?(Qn.clearcoat=1,Qn.clearcoatRoughness=0):e.finish=="HMCCR"?(Qn.clearcoat=0,Qn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(Qn.clearcoat=1,Qn.clearcoatRoughness=0),Qn.roughness=e.roughness,Qn.metalness=e.metalness}}async downloadTexture(e){let t;return await this.textureLoader.loadAsync(e).then(n=>{n.colorSpace=Xt,n.flipY=!1,n.magFilter=qt,n.wrapS=Fn,n.wrapT=Fn,t=n}).then(()=>t)}resetOrbitalMaterial(e){e.metalness=0,e.roughness=.05,e.ior=1,e.opacity=1,e.clearcoat=0,e.color=new tt(16777215),e.transparent=!1,e.shadowSide=Bn,e.depthWrite=!0,e.map=null,e.alphaMap=null,e.aoMap=null,e.roughnessMap=null,e.metalnessMap=null,e.normalMap=null,e.transmission=0}async setupOrbitalMaterial(e){Ht&&(this.resetOrbitalMaterial(Ht),e.texture?(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{Ht.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{Ht.alphaMap=t}),e.texture.thickness&&await this.downloadTexture(e.texture.thickness).then(t=>{Ht.thicknessMap=t}),e.texture.orm?await this.downloadTexture(e.texture.orm).then(t=>{Ht.aoMap=t,Ht.roughnessMap=t,Ht.metalnessMap=t}):(Ht.roughness=e.roughness,Ht.metalness=e.metalness)):(Ht.color=new tt(e.color),Ht.roughness=e.roughness,Ht.metalness=e.metalness),e.ior>1?(Ht.ior=e.ior,Ht.transmission=1,Ht.transparent=!0,Ht.thickness=.05):(Ht.ior=1,Ht.transmission=0,Ht.transparent=!1,Ht.opacity=e.opacity),Ht.clearcoat=0)}setupAndRenderScene(){if(!this.camera||!this.renderer)return;this.scene.add(this.camera);const e=new Tb(this.camera,this.canvas);e.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),this.renderer.getSize(new Ke),/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?(this.camera.position.set(4.2,5.2,12),e.minDistance=3,e.maxDistance=14,e.rotateSpeed=.8):(this.camera.position.set(2.2,2.2,4),e.minDistance=2,e.maxDistance=7,e.rotateSpeed=.5),e.enableDamping=!0,e.dampingFactor=.2,e.enablePan=!0,e.minPolarAngle=-Math.PI*5/36,e.maxPolarAngle=Math.PI*3/5,e.update(),this.renderer.toneMapping=Kd,this.renderer.toneMappingExposure=1.2,this.renderer.setClearColor(15724527),this.renderer.outputColorSpace=Xt;const n=2.5,r=2.5,o=.4,l={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},c=new vs;c.position.y=-.315,this.scene.add(c);const f=new Xi(256,256);f.texture.generateMipmaps=!1;const u=new Xi(256,256);u.texture.generateMipmaps=!1;const d=new Wu(n,r).rotateX(Math.PI/2),p=new Gr({map:f.texture,opacity:l.shadow.opacity,transparent:!0,depthWrite:!1}),A=new Wn(d,p);A.renderOrder=1,c.add(A),A.scale.y=-1;const g=new Wn(d);g.visible=!1,c.add(g);const E=new Yl(-n/2,n/2,r/2,-r/2,0,o);E.rotation.x=Math.PI/2,c.add(E);const C=new F_;C.userData.darkness={value:l.shadow.darkness},C.onBeforeCompile=T=>{const N=T;N.uniforms.darkness=C.userData.darkness,N.fragmentShader=`
4230
+ `)},o.matrixAutoUpdate=!0,Qn.matrixAutoUpdate=!0,Qn.needsUpdate=!0)}o.material&&o.material.name.toLowerCase()=="frame-stems"&&(Ht=zL,Ht.envMap=this.scene.environment,o.material=Ht,o.matrixAutoUpdate=!0,Ht.matrixAutoUpdate=!0,Ht.needsUpdate=!0),o.material&&o.name==="Diamonds"&&(this.initGemstoneDependencies(),Xr.uniforms.bvh.value=new gy,Xr.uniforms.bvh.value.updateFrom(new Fp(o.geometry.clone().toNonIndexed(),{strategy:YE})),o.material=Xr)}});let r=n-t;e.scene.position.y+=r,xn.minY.value+=r,xn.maxY.value+=r}async loadEyewearFromGLTF(e,t,n,r,o){const l=new aE,c=new yr(l).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(c.detectSupport(n));const f=o,u=t.includes(".glb");let d;return u?d=await e.loadAsync(t):d=await this.LoadEncryptedGlb(e,t,f).then(p=>{r?this.updateScene(p.result):this.updateMaterials(p.result),this.loadModelInsideScene(p.result.scene)}),d==null?void 0:d.scene}setupLensMaterial(e){if(Qn){if(e.direction=="u")Qn.color=new et(e.color),Qn.opacity=e.opacity,xn.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;xn.uAlpha.value=!0;let n=0;t.forEach(()=>{xn.colors.value[n]=new et(t[n].color),xn.positions.value[n]=t[n].position,xn.opacities.value[n]=t[n].alpha,n++})}e.finish=="MIRBLKHMC"?(Qn.clearcoat=1,Qn.clearcoatRoughness=0):e.finish=="HMCCR"?(Qn.clearcoat=0,Qn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(Qn.clearcoat=1,Qn.clearcoatRoughness=0),Qn.roughness=e.roughness,Qn.metalness=e.metalness}}async downloadTexture(e){let t;return await this.textureLoader.loadAsync(e).then(n=>{n.colorSpace=Xt,n.flipY=!1,n.magFilter=qt,n.wrapS=Fn,n.wrapT=Fn,t=n}).then(()=>t)}resetOrbitalMaterial(e){e.metalness=0,e.roughness=.05,e.ior=1,e.opacity=1,e.clearcoat=0,e.color=new et(16777215),e.transparent=!1,e.shadowSide=Bn,e.depthWrite=!0,e.map=null,e.alphaMap=null,e.aoMap=null,e.roughnessMap=null,e.metalnessMap=null,e.normalMap=null,e.transmission=0}async setupOrbitalMaterial(e){Ht&&(this.resetOrbitalMaterial(Ht),e.texture?(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{Ht.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{Ht.alphaMap=t}),e.texture.thickness&&await this.downloadTexture(e.texture.thickness).then(t=>{Ht.thicknessMap=t}),e.texture.orm?await this.downloadTexture(e.texture.orm).then(t=>{Ht.aoMap=t,Ht.roughnessMap=t,Ht.metalnessMap=t}):(Ht.roughness=e.roughness,Ht.metalness=e.metalness)):(Ht.color=new et(e.color),Ht.roughness=e.roughness,Ht.metalness=e.metalness),e.ior>1?(Ht.ior=e.ior,Ht.transmission=1,Ht.transparent=!0,Ht.thickness=.05):(Ht.ior=1,Ht.transmission=0,Ht.transparent=!1,Ht.opacity=e.opacity),Ht.clearcoat=0)}setupAndRenderScene(){if(!this.camera||!this.renderer)return;this.scene.add(this.camera);const e=new Tb(this.camera,this.canvas);e.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),this.renderer.getSize(new Ke),/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?(this.camera.position.set(4.2,5.2,12),e.minDistance=3,e.maxDistance=14,e.rotateSpeed=.8):(this.camera.position.set(2.2,2.2,4),e.minDistance=2,e.maxDistance=7,e.rotateSpeed=.5),e.enableDamping=!0,e.dampingFactor=.2,e.enablePan=!0,e.minPolarAngle=-Math.PI*5/36,e.maxPolarAngle=Math.PI*3/5,e.update(),this.renderer.toneMapping=Kd,this.renderer.toneMappingExposure=1.2,this.renderer.setClearColor(15724527),this.renderer.outputColorSpace=Xt;const n=2.5,r=2.5,o=.4,l={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},c=new vs;c.position.y=-.315,this.scene.add(c);const f=new Xi(256,256);f.texture.generateMipmaps=!1;const u=new Xi(256,256);u.texture.generateMipmaps=!1;const d=new Wu(n,r).rotateX(Math.PI/2),p=new Gr({map:f.texture,opacity:l.shadow.opacity,transparent:!0,depthWrite:!1}),A=new Wn(d,p);A.renderOrder=1,c.add(A),A.scale.y=-1;const g=new Wn(d);g.visible=!1,c.add(g);const E=new Yl(-n/2,n/2,r/2,-r/2,0,o);E.rotation.x=Math.PI/2,c.add(E);const C=new F_;C.userData.darkness={value:l.shadow.darkness},C.onBeforeCompile=T=>{const N=T;N.uniforms.darkness=C.userData.darkness,N.fragmentShader=`
4231
4231
  uniform float darkness;
4232
4232
  ${T.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
4233
- `},C.depthTest=!1,C.depthWrite=!1;const _=new Si(b5);_.depthTest=!1;const v=new Si(L5);v.depthTest=!1;function S(T,N){g.visible=!0,g.material=_,g.material.uniforms.tDiffuse.value=f.texture,_.uniforms.h.value=T*1/256,N.setRenderTarget(u),N.render(g,E),g.material=v,g.material.uniforms.tDiffuse.value=u.texture,v.uniforms.v.value=T*1/256,N.setRenderTarget(f),N.render(g,E),g.visible=!1}E.far=.125,y();function y(){E.updateProjectionMatrix()}const x=new B5,w=new R5(this.scene,this.camera);w.clearAlpha=0;const b=this.renderer.getDrawingBufferSize(new Ke),B=new Xi(b.width,b.height,{samples:4,type:Jn}),L=new M5(this.renderer,B);L.addPass(w),L.addPass(x);const R=()=>{var T;e.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(T=this.camera)==null||T.updateProjectionMatrix());const N=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=C,!this.renderer||!this.camera)return;const k=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(f),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,S(l.shadow.blur,this.renderer),S(l.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(k),this.scene.background=N,Xr.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Xr.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(R),L.render()};R()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Wn&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class VL{constructor(){Ft(this,"customRenderer"),this.customRenderer=new HL}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((r,o)=>{this.customRenderer.loadFirstFrame(e,t).then(()=>{r(1)}).catch(l=>{o(l)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,r){return this.customRenderer.changeLens(e,t,n,r)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}}class WL{constructor(e){Ft(this,"orgId"),Ft(this,"rendererService"),Ft(this,"isLoading",!1),Ft(this,"userContainerId"),Ft(this,"containerElement",null),Ft(this,"defaultSelectorId","dita-3dconfig-element"),Ft(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),Ft(this,"customisationArr",[]),Ft(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new VL,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}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 Ey{constructor(){Ft(this,"events"),Ft(this,"authService"),Ft(this,"instanceArr"),this.authService=new xx,this.events=new Nx,this.instanceArr=[]}async Init(e){await this.authService.Init(e),hl.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Lh.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new WL({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}}window.ThreeDConfigurator=Ey;const ZN="",$N="";function jL({frameList:i,selectedFrame:e,modelLoading:t,onChangeFrame:n}){const r=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 4rem 1.6rem 4rem",marginTop:r?"1rem":"0"},children:i==null?void 0:i.map(o=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",opacity:(e==null?void 0:e._id)===o._id?"1":".6",width:r?45:60,height:r?45:60},onClick:()=>n(o),disabled:t,children:De.jsx("img",{src:o.variantImage,alt:o.name+"image",className:`sprie-config-image ${r?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===o._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===o._id&&De.jsx("p",{className:"sprie-config-palette-img-text",children:De.jsx("span",{className:"sprie-config-palette-imgName",children:o.name})})]},o._id))})}function YL({lensList:i,selectedLens:e,modelLoading:t,onChangeLens:n}){const r=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:r?"1rem":"0",gap:r?".3rem":"1rem"},children:i==null?void 0:i.map(o=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",opacity:(e==null?void 0:e._id)===o._id?"1":".6",width:r?45:60,height:r?45:60},onClick:()=>n(o),disabled:t,children:De.jsx("img",{src:o.thumbnail,alt:o.name+"image",className:`sprie-config-image ${r?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===o._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===o._id&&De.jsx("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem"},children:De.jsx("span",{className:"sprie-config-palette-imgName",children:o.name})})]},o._id))})}const e8="";function qL({heading:i,onChecked:e,onTextAdded:t}){const[n,r]=Ct.useState(""),[o,l]=Ct.useState(!1),[c,f]=Ct.useState(!1),u=Ct.useRef(null);return Ct.useEffect(()=>{e(o),o&&u.current?(u.current.style.backgroundColor="#ffffff",u.current.focus()):!o&&u.current&&(u.current.style.backgroundColor="transparent",u.current.blur(),r(""))}),Ct.useEffect(()=>{c&&n!=""&&t(n)},[c]),De.jsxs("div",{className:"sprie-config-engraving-block",style:{marginTop:".5rem"},children:[De.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[De.jsx("input",{type:"checkbox",className:"sprie-config-engraving-checkbox",onChange:d=>{l(d.target.checked)},checked:o}),De.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",De.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),De.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[De.jsx("input",{type:"text",ref:u,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:n,onChange:d=>r(d.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!o,onBlur:d=>f(!0),onFocus:d=>f(!1)}),De.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${n.length}/15 characters`}),De.jsx("a",{href:"#",className:"sprie-config-engraving-link",children:"About Custom Laser Engraving"})]})]})}const t8="";function XL({totalSteps:i,currentStep:e}){const t=window.innerWidth<=576;return De.jsx("div",{className:"step-tracker-block",style:{margin:t?"1rem 0":".7rem 0 1rem 0",paddingBottom:"1.5rem"},children:De.jsx("div",{className:"step-tracker",children:Array.from({length:i}).map((n,r)=>De.jsx("div",{className:`step-circle ${r+1===e?"active":""}`},r))})})}function KL({nextSlide:i,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:r}){return De.jsxs("div",{className:"carousel-header",children:[De.jsx("button",{className:"carousel-btn prev",onClick:e,style:{visibility:t!==0?"visible":"hidden"},children:De.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),De.jsxs("p",{children:[De.jsx("span",{className:"step-syntax",children:`STEP ${t+1}: `}),De.jsx("span",{className:"select-syntax",children:n[t]})]}),De.jsx("button",{className:"carousel-btn next",onClick:i,style:{visibility:r?"hidden":"visible"},children:De.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function JL({setShowAddToCart:i,children:e}){var u;const[t,n]=Ct.useState(0),r=Hc.Children.toArray(e),o=t===r.length-1,l=(u=r.map(d=>d))==null?void 0:u.map(d=>d.props.heading),c=()=>{n(d=>d===0?Hc.Children.count(e)-1:d-1)},f=()=>{n(d=>d===Hc.Children.count(e)-1?0:d+1)};return Ct.useEffect(()=>{i(!!o)},[o,i]),De.jsxs("div",{className:"carousel",children:[De.jsx(KL,{nextSlide:f,previousSlide:c,currentIndex:t,stepsName:l,isLastStep:o}),De.jsx(XL,{totalSteps:l==null?void 0:l.length,currentStep:t+1}),De.jsx("div",{className:"carousel-container",children:r.map((d,p)=>De.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${t*100}%)`},children:d},p))})]})}const n8="";function yy({conditionRequired:i,onButtonClick:e}){const[t,n]=Ct.useState(!1),r=Ct.useRef(null),o=Ct.useRef(null);return Ct.useEffect(()=>{r.current&&(r.current.style.display=i?"flex":"none"),o.current&&(o.current.disabled=i)},[i]),Ct.useEffect(()=>{o.current&&(o.current.disabled=!t)},[t]),De.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[De.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:r,style:{display:"none"},children:[De.jsx("input",{type:"checkbox",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:l=>n(l.target.checked),checked:t}),De.jsxs("p",{children:["I agree this customized Item cannot be returned or exchanged.",De.jsx("span",{style:{color:"red"},children:"*"})]})]}),De.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:o,onClick:e,children:"ADD TO CART"})]})}function ZL({orbitalList:i,selectedOrbital:e,modelLoading:t,onChangeOrbital:n}){const r=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:r?"1rem":"0",gap:r?".3rem":"1rem"},children:i==null?void 0:i.map(o=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",opacity:(e==null?void 0:e._id)===o._id?"1":".6",width:r?45:60,height:r?45:60},onClick:()=>n(o),disabled:t,children:De.jsx("img",{src:o.thumbnail,alt:o.name+"image",className:`sprie-config-image ${r?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===o._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===o._id&&De.jsx("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem"},children:De.jsx("span",{className:"sprie-config-palette-imgName",children:o.name})})]},o._id))})}const $L="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",eD="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K";function tD({orgName:i,customEvent:e,apiService:t,frameList:n,lensList:r,orbitalList:o,showOrbitalList:l,viewerOnly:c,domService:f,ThreeDConfigurator:u,dataVariants:d,dataLenses:p,dataOrbitals:A,firstDitaVariant:g}){var Ze;const[E,C]=Ct.useState(),[_,v]=Ct.useState(),[S,y]=Ct.useState(),[x,w]=Ct.useState(!1),[b,B]=Ct.useState(!1),[L,R]=Ct.useState(),[T,N]=Ct.useState(),[k,O]=Ct.useState(),[F,V]=Ct.useState(),[X,te]=Ct.useState(!1),[Y,$]=Ct.useState("placeholder"),U=Ct.useRef(null);(Ze=U.current)==null||Ze.clientHeight;const D=Ct.useRef();D.current=f;const G=window.innerWidth<=576,K={variantId:"defaultId",variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"},J={variantId:"defaultId",variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"orbital-default"},Ae=async(_e,it)=>{_e._id===(E==null?void 0:E._id)&&!it||D.current&&(w(!0),D.current.changeFrame(_e,[_,S]).then(()=>{w(!1)}),C(_e),N(d==null?void 0:d.find(Ue=>Ue.varinatSku==_e.sku)))},ge=_e=>(_e==null?void 0:_e.customisation.length)==0?null:_e==null?void 0:_e.customisation.find(He=>He.type=="Lens"),be=_e=>_e==null?void 0:_e.customisation.find(Ue=>Ue.type=="Orbital"),de=async _e=>{if(!D.current||_e==_)return;const it=_e.sku=="lens-default",Ue=ge(E),He=ot();!Ue&&it?(w(!0),D.current.changeLens([_e,S],!0,E).then(()=>{w(!1)})):!Ue&&!it?(_==null?void 0:_.sku)=="lens-default"?(w(!0),D.current.changeLens([_e,S],!0,E).then(()=>{w(!1)})):D.current.changeLens([_e,S],!1,E):Ue&&it?D.current.changeLens([Ue,S],!1,E):D.current.changeLens([_e,S],!1,E),_e.sku=="lens-default"?O(K):O(p==null?void 0:p.find($e=>{var lt;return $e.variantId==((lt=_e.metadata.find(mt=>mt.key==He))==null?void 0:lt.value)?$e:null})),v(_e)},Oe=async _e=>{if(!D.current||_e==S)return;const it=_e.sku=="orbital-default",Ue=be(E);w(!0),it?await D.current.changeOrbital(Ue).then(()=>{V(A==null?void 0:A.find(He=>{var $e;return He.variantId==(($e=Ue.metadata.find(lt=>lt.key=="variantId"))==null?void 0:$e.value)})),w(!1)}):await D.current.changeOrbital(_e).then(()=>{V(A==null?void 0:A.find(He=>{var $e;return He.variantId==(($e=_e.metadata.find(lt=>lt.key=="variantId"))==null?void 0:$e.value)})),w(!1)}),y(_e)},It=()=>(T==null?void 0:T.variantPrice)+((k==null?void 0:k.varinatSku)!=="lens-default"?k==null?void 0:k.variantPrice:0),ot=()=>{var Ue;const _e=(Ue=E.metadata.find(He=>He.key=="baseCurve"))==null?void 0:Ue.value;let it="variantId";return _e=="2B"?it="2bVariantId":_e=="6B"&&(it="6bVariantId"),it},oe=_e=>{te(_e)},Mt=_e=>{$(_e)},Ne=()=>{if(E&&_&&F){const _e=E.metadata.find(se=>se.key=="variantId"),it=E.metadata.find(se=>se.key=="baseCurve");let Ue="variantId";it&&it.value=="2B"?Ue="2bVariantId":it&&it.value=="6B"&&(Ue="6bVariantId");const He=_.metadata.find(se=>se.key==Ue),$e=_e?Number(_e.value):null,lt=He?Number(He.value):null,mt=F.variantId?Number(F.variantId):null,H={frameIdentifier:$e,lensIdentifier:lt,orbitalIdentifier:mt};e.emitEvent("onAddToCart",H);const Q=[];if(He){const se={id:lt,quantity:1,properties:null};Q.push(se)}if(F.variantId){const se={id:mt,quantity:1,properties:null};Q.push(se)}if(X&&Y!=""&&Y!="placeholder"){const se={id:44745490890985,quantity:1,properties:{customText:Y}};Q.push(se)}if(_e){const se={id:$e,quantity:1,properties:null};Q.push(se)}t.HandleShopifyAddToCart(Q)}};return Ct.useEffect(()=>{if(U.current){const _e=G?b?367.5:318.5:286;R((U.current.clientHeight-(_e+1))/14)}},[G,U,b]),Ct.useEffect(()=>{n&&C(n[0]),r&&v(r[0]),o&&y(o[0])},[n,r,o]),Ct.useEffect(()=>{N(g),O(K),V(J)},[g]),Ct.useEffect(()=>{},[X,Y]),De.jsxs("section",{id:"Sprie-config-Main-Container",ref:U,children:[De.jsxs("header",{id:"Sprie-config-Header",children:[De.jsx("img",{src:$L,alt:"dita-logo",width:97,height:20}),De.jsxs("p",{style:{margin:"0"},className:"sprie-config-Header-groupName",children:[i," CUSTOMIZER"]})]}),De.jsxs("section",{id:"Sprie-config-Viewer-Container",style:{height:`${L}rem`},children:[De.jsx("img",{src:eD,alt:"360deg-logo",width:44,height:34}),x&&De.jsx("div",{className:"sprie-config-loadingFrame",children:De.jsx("div",{className:"sprie-config-loader"})}),De.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),De.jsxs("section",{id:"Sprie-config-Customisation-block",style:{paddingTop:"1.5rem",height:G?b?"21rem":"17.5rem":"15.42rem"},children:[De.jsxs("div",{className:"sprie-config-price-block",style:{top:G||!b?"-3rem":"-8.5rem"},children:[De.jsx("p",{style:{margin:"0 0.8rem 0 0"},children:`${It()}.00 ${T==null?void 0:T.priceCurrency} `}),!G&&b&&De.jsx(yy,{conditionRequired:X&&Y!="",onButtonClick:Ne}),b&&De.jsx("p",{style:{marginRight:".8rem",fontSize:".6rem",textAlign:"right"},children:"Please Allow 7-10 Days for Customization Process."})]}),De.jsxs(JL,{setShowAddToCart:B,children:[De.jsx(jL,{modelLoading:x,frameList:n,selectedFrame:E,onChangeFrame:Ae,heading:"SELECT FRAME"}),l&&De.jsx(ZL,{orbitalList:o,selectedOrbital:S,modelLoading:x,onChangeOrbital:Oe,heading:"SELECT ORBITAL"}),De.jsx(YL,{modelLoading:x,lensList:r,selectedLens:_,onChangeLens:de,heading:"SELECT LENS COLOR"}),De.jsx(qL,{heading:"LASER ENGRAVING",onChecked:oe,onTextAdded:Mt})]}),G&&b&&De.jsx("div",{style:{position:"absolute",bottom:"0",width:"100%"},children:De.jsx(yy,{conditionRequired:X&&Y!="",onButtonClick:Ne})})]})]})}function nD({apiService:i,sku:e,events:t,viewerOnly:n=!1}){var p;const r=Ct.useRef(),[o,l]=Ct.useState(null),c=(o==null?void 0:o.orgName)||"",f=(o==null?void 0:o.frameList)||null,u=(o==null?void 0:o.lensList)||null,d=(o==null?void 0:o.orbitalList)||null;return o!=null&&o.dataVariants,o!=null&&o.dataLenses,o!=null&&o.dataOrbitals,Ct.useEffect(()=>((async()=>{var _;r.current=new Ey,await((_=r.current)==null?void 0:_.Init(i.apiKey));const A=await i.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=await i.FetchCustomisationList("Lens"),E=await i.FetchCustomisationList("Orbital"),C=await r.current.renderAsset({containerId:"holder-canvas",data:{assetDetails:A,customisation:A==null?void 0:A.customisation}});l({frameList:A==null?void 0:A.variants,lensList:g==null?void 0:g.data,orbitalList:E==null?void 0:E.data,orgName:A==null?void 0:A.group.name,showOrbitals:(A==null?void 0:A.customisation).filter(v=>v.type==="Orbital").length>0,domService:C,dataVariants:await i.PopulateDataList("data-variants"),dataLenses:await i.PopulateDataList("data-lenses"),dataOrbitals:await i.PopulateDataList("data-orbital")})})(),()=>{r.current=void 0}),[i,e]),De.jsxs(De.Fragment,{children:[(!f||!u)&&De.jsx("div",{className:"sprie-config-loadingBox",children:"Loading..."}),De.jsx(tD,{customEvent:t,orgName:c,apiService:i,frameList:f,lensList:u,orbitalList:d,showOrbitalList:(o==null?void 0:o.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:r.current,domService:o==null?void 0:o.domService,dataVariants:o==null?void 0:o.dataVariants,dataLenses:o==null?void 0:o.dataLenses,dataOrbitals:o==null?void 0:o.dataOrbitals,firstDitaVariant:(p=o==null?void 0:o.dataVariants)==null?void 0:p.find(A=>A.varinatSku==e)})]})}var Op={},Cy={exports:{}},hi={},zp={exports:{}},Gp={};/**
4233
+ `},C.depthTest=!1,C.depthWrite=!1;const _=new Si(b5);_.depthTest=!1;const v=new Si(L5);v.depthTest=!1;function x(T,N){g.visible=!0,g.material=_,g.material.uniforms.tDiffuse.value=f.texture,_.uniforms.h.value=T*1/256,N.setRenderTarget(u),N.render(g,E),g.material=v,g.material.uniforms.tDiffuse.value=u.texture,v.uniforms.v.value=T*1/256,N.setRenderTarget(f),N.render(g,E),g.visible=!1}E.far=.125,y();function y(){E.updateProjectionMatrix()}const S=new B5,w=new R5(this.scene,this.camera);w.clearAlpha=0;const b=this.renderer.getDrawingBufferSize(new Ke),B=new Xi(b.width,b.height,{samples:4,type:Jn}),L=new M5(this.renderer,B);L.addPass(w),L.addPass(S);const R=()=>{var T;e.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(T=this.camera)==null||T.updateProjectionMatrix());const N=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=C,!this.renderer||!this.camera)return;const k=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(f),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(l.shadow.blur,this.renderer),x(l.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(k),this.scene.background=N,Xr.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Xr.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(R),L.render()};R()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Wn&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class VL{constructor(){Ft(this,"customRenderer"),this.customRenderer=new HL}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}loadFirstFrame(e,t,n){return new Promise((r,o)=>{this.customRenderer.loadFirstFrame(e,t).then(()=>{r(1)}).catch(l=>{o(l)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,r){return this.customRenderer.changeLens(e,t,n,r)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}}class WL{constructor(e){Ft(this,"orgId"),Ft(this,"rendererService"),Ft(this,"isLoading",!1),Ft(this,"userContainerId"),Ft(this,"containerElement",null),Ft(this,"defaultSelectorId","dita-3dconfig-element"),Ft(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),Ft(this,"customisationArr",[]),Ft(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new VL,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}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 Ey{constructor(){Ft(this,"events"),Ft(this,"authService"),Ft(this,"instanceArr"),this.authService=new xx,this.events=new Nx,this.instanceArr=[]}async Init(e){await this.authService.Init(e),hl.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Lh.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new WL({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}}window.ThreeDConfigurator=Ey;const $N="",ZN="";function jL({frameList:i,selectedFrame:e,modelLoading:t,onChangeFrame:n}){const r=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 4rem 1.6rem 4rem",marginTop:r?"1rem":"0"},children:i==null?void 0:i.map(o=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",opacity:(e==null?void 0:e._id)===o._id?"1":".6",width:r?45:60,height:r?45:60},onClick:()=>n(o),disabled:t,children:De.jsx("img",{src:o.variantImage,alt:o.name+"image",className:`sprie-config-image ${r?"mobile-view":""}`,style:{transform:(e==null?void 0:e._id)===o._id?"scale(1.2,1.2)":"scale(1,1)"}})}),(e==null?void 0:e._id)===o._id&&De.jsx("p",{className:"sprie-config-palette-img-text",children:De.jsx("span",{className:"sprie-config-palette-imgName",children:o.name})})]},o._id))})}function YL({lensList:i,selectedLens:e,selectedDitaLens:t,modelLoading:n,onChangeLens:r}){const o=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:o?"1rem":"0",gap:o?".3rem":"1rem"},children:i==null?void 0:i.map(l=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:n?"default":"pointer",opacity:(e==null?void 0:e._id)===l._id?"1":".6",width:o?45:60,height:o?45:60},onClick:()=>r(l),disabled:n,children:De.jsx("img",{src:l.thumbnail,alt:l.name+"image",className:`sprie-config-image ${o?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===l._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===l._id&&De.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[De.jsx("span",{className:"sprie-config-palette-imgName",children:`${l.name}`}),De.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":` (+ ${t==null?void 0:t.variantPrice} ${t==null?void 0:t.priceCurrency})`})]})]},l._id))})}const e8="";function qL({heading:i,onChecked:e,onTextAdded:t}){const[n,r]=Ct.useState(""),[o,l]=Ct.useState(!1),[c,f]=Ct.useState(!1),u=Ct.useRef(null);return Ct.useEffect(()=>{e(o),o&&u.current?(u.current.style.backgroundColor="#ffffff",u.current.focus()):!o&&u.current&&(u.current.style.backgroundColor="transparent",u.current.blur(),r(""))}),Ct.useEffect(()=>{c&&n!=""&&t(n)},[c]),De.jsxs("div",{className:"sprie-config-engraving-block",style:{marginTop:".5rem"},children:[De.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[De.jsx("input",{type:"checkbox",className:"sprie-config-engraving-checkbox",onChange:d=>{l(d.target.checked)},checked:o}),De.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",De.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),De.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[De.jsx("input",{type:"text",ref:u,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:n,onChange:d=>r(d.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!o,onBlur:d=>f(!0),onFocus:d=>f(!1)}),De.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${n.length}/15 characters`}),De.jsx("a",{href:"#",className:"sprie-config-engraving-link",children:"About Custom Laser Engraving"})]})]})}const t8="";function XL({totalSteps:i,currentStep:e}){const t=window.innerWidth<=576;return De.jsx("div",{className:"step-tracker-block",style:{margin:t?"1rem 0":".7rem 0 1rem 0",paddingBottom:"1.5rem"},children:De.jsx("div",{className:"step-tracker",children:Array.from({length:i}).map((n,r)=>De.jsx("div",{className:`step-circle ${r+1===e?"active":""}`},r))})})}function KL({nextSlide:i,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:r}){return De.jsxs("div",{className:"carousel-header",children:[De.jsx("button",{className:"carousel-btn prev",onClick:e,style:{visibility:t!==0?"visible":"hidden"},children:De.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),De.jsxs("p",{children:[De.jsx("span",{className:"step-syntax",children:`STEP ${t+1}: `}),De.jsx("span",{className:"select-syntax",children:n[t]})]}),De.jsx("button",{className:"carousel-btn next",onClick:i,style:{visibility:r?"hidden":"visible"},children:De.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function JL({setShowAddToCart:i,children:e}){var u;const[t,n]=Ct.useState(0),r=Hc.Children.toArray(e),o=t===r.length-1,l=(u=r.map(d=>d))==null?void 0:u.map(d=>d.props.heading),c=()=>{n(d=>d===0?Hc.Children.count(e)-1:d-1)},f=()=>{n(d=>d===Hc.Children.count(e)-1?0:d+1)};return Ct.useEffect(()=>{i(!!o)},[o,i]),De.jsxs("div",{className:"carousel",children:[De.jsx(KL,{nextSlide:f,previousSlide:c,currentIndex:t,stepsName:l,isLastStep:o}),De.jsx(XL,{totalSteps:l==null?void 0:l.length,currentStep:t+1}),De.jsx("div",{className:"carousel-container",children:r.map((d,p)=>De.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${t*100}%)`},children:d},p))})]})}const n8="";function yy({conditionRequired:i,onButtonClick:e}){const[t,n]=Ct.useState(!1),r=Ct.useRef(null),o=Ct.useRef(null);return Ct.useEffect(()=>{o.current&&(o.current.disabled=!t)},[t]),Ct.useEffect(()=>{r.current&&(r.current.style.display=i?"flex":"none"),o.current&&(o.current.disabled=i)},[i]),De.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[De.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:r,style:{display:"none"},children:[De.jsx("input",{type:"checkbox",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:l=>n(l.target.checked),checked:t}),De.jsxs("p",{children:["I agree this customized Item cannot be returned or exchanged.",De.jsx("span",{style:{color:"red"},children:"*"})]})]}),De.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:o,onClick:e,children:"ADD TO CART"})]})}function $L({orbitalList:i,selectedOrbital:e,modelLoading:t,onChangeOrbital:n}){const r=window.innerWidth<=576;return De.jsx("div",{className:"sprie-config-palette",style:{padding:"0 1.2rem 1.6rem 1.2rem",marginTop:r?"1rem":"0",gap:r?".3rem":"1rem"},children:i==null?void 0:i.map(o=>De.jsxs("div",{className:"sprie-config-palette-img-box",children:[De.jsx("button",{style:{border:"0",cursor:t?"default":"pointer",width:r?45:60,height:r?45:60},onClick:()=>n(o),disabled:t,children:De.jsx("img",{src:o.thumbnail,alt:o.name+"image",className:`sprie-config-image ${r?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===o._id?"1px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),(e==null?void 0:e._id)===o._id&&De.jsx("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem"},children:De.jsx("span",{className:"sprie-config-palette-imgName",children:o.name})})]},o._id))})}const ZL="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",eD="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K";function tD({orgName:i,customEvent:e,apiService:t,frameList:n,lensList:r,orbitalList:o,showOrbitalList:l,viewerOnly:c,domService:f,ThreeDConfigurator:u,dataVariants:d,dataLenses:p,dataOrbitals:A,firstDitaVariant:g}){var $e;const[E,C]=Ct.useState(),[_,v]=Ct.useState(),[x,y]=Ct.useState(),[S,w]=Ct.useState(!1),[b,B]=Ct.useState(!1),[L,R]=Ct.useState(),[T,N]=Ct.useState(),[k,O]=Ct.useState(),[F,V]=Ct.useState(),[X,te]=Ct.useState(!1),[q,Z]=Ct.useState("placeholder"),U=Ct.useRef(null);($e=U.current)==null||$e.clientHeight;const D=Ct.useRef();D.current=f;const G=window.innerWidth<=576,K={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"},J={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"orbital-default"},Ae=async(Ee,nt)=>{if(!(Ee._id===(E==null?void 0:E._id)&&!nt)&&D.current){w(!0);var Ue=(x==null?void 0:x.sku)=="orbital-default"?be(Ee):x;D.current.changeFrame(Ee,[_,Ue]).then(()=>{w(!1)}),C(Ee),N(d==null?void 0:d.find(He=>He.varinatSku==Ee.sku))}},ge=Ee=>Ee==null?void 0:Ee.customisation.find(Ue=>Ue.type=="Lens"),be=Ee=>Ee==null?void 0:Ee.customisation.find(Ue=>Ue.type=="Orbital"),de=async Ee=>{if(!D.current||Ee==_)return;const nt=Ee.sku=="lens-default",Ue=ge(E),He=st();!Ue&&nt?(w(!0),D.current.changeLens([Ee,x],!0,E).then(()=>{w(!1)})):!Ue&&!nt?(_==null?void 0:_.sku)=="lens-default"?(w(!0),D.current.changeLens([Ee,x],!0,E).then(()=>{w(!1)})):D.current.changeLens([Ee,x],!1,E):Ue&&nt?D.current.changeLens([Ue,x],!1,E):D.current.changeLens([Ee,x],!1,E),Ee.sku=="lens-default"?O(K):O(p==null?void 0:p.find(ot=>{var ut;return ot.variantId==Number((ut=Ee.metadata.find(At=>At.key==He))==null?void 0:ut.value)?ot:null})),v(Ee)},Oe=async Ee=>{if(!D.current||Ee==x)return;const nt=Ee.sku=="orbital-default",Ue=be(E);w(!0),nt?await D.current.changeOrbital(Ue).then(()=>{V(A==null?void 0:A.find(He=>He.variantId==Number(Ue.sku))),w(!1)}):await D.current.changeOrbital(Ee).then(()=>{V(A==null?void 0:A.find(He=>He.variantId==Number(Ee.sku))),w(!1)}),y(Ee)},It=()=>(T==null?void 0:T.variantPrice)+((k==null?void 0:k.varinatSku)!=="lens-default"?k==null?void 0:k.variantPrice:0),st=()=>{var Ue;const Ee=(Ue=E.metadata.find(He=>He.key=="baseCurve"))==null?void 0:Ue.value;let nt="variantId";return Ee=="2B"?nt="2bVariantId":Ee=="6B"&&(nt="6bVariantId"),nt},oe=Ee=>{te(Ee)},Mt=Ee=>{Z(Ee)},Ne=()=>{if(console.log(F),E&&_&&F){const Ee=E.metadata.find(se=>se.key=="variantId"),nt=E.metadata.find(se=>se.key=="baseCurve");let Ue="variantId";nt&&nt.value=="2B"?Ue="2bVariantId":nt&&nt.value=="6B"&&(Ue="6bVariantId");const He=_.metadata.find(se=>se.key==Ue),ot=Ee?Number(Ee.value):null,ut=He?Number(He.value):null,At=F!=null&&F.variantId?Number(F.variantId):null,H={frameIdentifier:ot,lensIdentifier:ut,orbitalIdentifier:At};e.emitEvent("onAddToCart",H);const Q=[];if(ut&&He){const se={id:ut,quantity:1,properties:null};Q.push(se)}if(At&&(F!=null&&F.variantId)){const se={id:At,quantity:1,properties:null};Q.push(se)}if(X){const se={id:44745490890985,quantity:1,properties:null};Q.push(se)}if(Ee){const se={id:ot,quantity:1,properties:X?{customText:q}:null};Q.push(se)}t.HandleShopifyAddToCart(Q)}};return Ct.useEffect(()=>{if(U.current){const Ee=G?b?367.5:318.5:286;R((U.current.clientHeight-(Ee+1))/14)}},[G,U,b]),Ct.useEffect(()=>{n&&C(n[0]),r&&v(r[0]),o&&y(o[0])},[n,r,o]),Ct.useEffect(()=>{N(g),O(K),V(J)},[g]),Ct.useEffect(()=>{},[X,q]),De.jsxs("section",{id:"Sprie-config-Main-Container",ref:U,children:[De.jsxs("header",{id:"Sprie-config-Header",children:[De.jsx("img",{src:ZL,alt:"dita-logo",width:97,height:20}),De.jsxs("p",{style:{margin:"0"},className:"sprie-config-Header-groupName",children:[i," CUSTOMIZER"]})]}),De.jsxs("section",{id:"Sprie-config-Viewer-Container",style:{height:`${L}rem`},children:[De.jsx("img",{src:eD,alt:"360deg-logo",width:44,height:34}),S&&De.jsx("div",{className:"sprie-config-loadingFrame",children:De.jsx("div",{className:"sprie-config-loader"})}),De.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),De.jsxs("section",{id:"Sprie-config-Customisation-block",style:{paddingTop:"1.5rem",height:G?b?"21rem":"17.5rem":"15.42rem"},children:[De.jsxs("div",{className:"sprie-config-price-block",style:{top:G||!b?"-3rem":"-8.5rem"},children:[De.jsx("p",{style:{margin:"0 0.8rem 0 0"},children:`${It()}.00 ${T==null?void 0:T.priceCurrency} `}),!G&&b&&De.jsx(yy,{conditionRequired:X&&q!="",onButtonClick:Ne}),b&&De.jsx("p",{style:{marginRight:".8rem",fontSize:".6rem",textAlign:"right"},children:"Please Allow 7-10 Days for Customization Process."})]}),De.jsxs(JL,{setShowAddToCart:B,children:[De.jsx(jL,{modelLoading:S,frameList:n,selectedFrame:E,onChangeFrame:Ae,heading:"SELECT FRAME"}),l&&De.jsx($L,{orbitalList:o,selectedOrbital:x,modelLoading:S,onChangeOrbital:Oe,heading:"SELECT ORBITAL"}),De.jsx(YL,{modelLoading:S,lensList:r,selectedLens:_,selectedDitaLens:k,onChangeLens:de,heading:"SELECT LENS COLOR"}),De.jsx(qL,{heading:"LASER ENGRAVING",onChecked:oe,onTextAdded:Mt})]}),G&&b&&De.jsx("div",{style:{position:"absolute",bottom:"0",width:"100%"},children:De.jsx(yy,{conditionRequired:X&&q!="",onButtonClick:Ne})})]})]})}function nD({apiService:i,sku:e,events:t,viewerOnly:n=!1}){var p;const r=Ct.useRef(),[o,l]=Ct.useState(null),c=(o==null?void 0:o.orgName)||"",f=(o==null?void 0:o.frameList)||null,u=(o==null?void 0:o.lensList)||null,d=(o==null?void 0:o.orbitalList)||null;return o!=null&&o.dataVariants,o!=null&&o.dataLenses,o!=null&&o.dataOrbitals,Ct.useEffect(()=>((async()=>{var _;r.current=new Ey,await((_=r.current)==null?void 0:_.Init(i.apiKey));const A=await i.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=await i.FetchCustomisationList("Lens"),E=await i.FetchCustomisationList("Orbital"),C=await r.current.renderAsset({containerId:"holder-canvas",data:{assetDetails:A,customisation:A==null?void 0:A.customisation}});l({frameList:A==null?void 0:A.variants,lensList:g==null?void 0:g.data,orbitalList:E==null?void 0:E.data,orgName:A==null?void 0:A.group.name,showOrbitals:(A==null?void 0:A.customisation).filter(v=>v.type==="Orbital").length>0,domService:C,dataVariants:await i.PopulateDataList("data-variants"),dataLenses:await i.PopulateDataList("data-lenses"),dataOrbitals:await i.PopulateDataList("data-orbital")})})(),()=>{r.current=void 0}),[i,e]),De.jsxs(De.Fragment,{children:[(!f||!u)&&De.jsx("div",{className:"sprie-config-loadingBox",children:"Loading..."}),De.jsx(tD,{customEvent:t,orgName:c,apiService:i,frameList:f,lensList:u,orbitalList:d,showOrbitalList:(o==null?void 0:o.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:r.current,domService:o==null?void 0:o.domService,dataVariants:o==null?void 0:o.dataVariants,dataLenses:o==null?void 0:o.dataLenses,dataOrbitals:o==null?void 0:o.dataOrbitals,firstDitaVariant:(p=o==null?void 0:o.dataVariants)==null?void 0:p.find(A=>A.varinatSku==e)})]})}var Op={},Cy={exports:{}},hi={},zp={exports:{}},Gp={};/**
4234
4234
  * @license React
4235
4235
  * scheduler.production.min.js
4236
4236
  *
@@ -4238,7 +4238,7 @@ bool bvhIntersectFirstHit(
4238
4238
  *
4239
4239
  * This source code is licensed under the MIT license found in the
4240
4240
  * LICENSE file in the root directory of this source tree.
4241
- */var Iy;function iD(){return Iy||(Iy=1,function(i){function e(Y,$){var U=Y.length;Y.push($);e:for(;0<U;){var D=U-1>>>1,G=Y[D];if(0<r(G,$))Y[D]=$,Y[U]=G,U=D;else break e}}function t(Y){return Y.length===0?null:Y[0]}function n(Y){if(Y.length===0)return null;var $=Y[0],U=Y.pop();if(U!==$){Y[0]=U;e:for(var D=0,G=Y.length,K=G>>>1;D<K;){var J=2*(D+1)-1,Ae=Y[J],ge=J+1,be=Y[ge];if(0>r(Ae,U))ge<G&&0>r(be,Ae)?(Y[D]=be,Y[ge]=U,D=ge):(Y[D]=Ae,Y[J]=U,D=J);else if(ge<G&&0>r(be,U))Y[D]=be,Y[ge]=U,D=ge;else break e}}return $}function r(Y,$){var U=Y.sortIndex-$.sortIndex;return U!==0?U:Y.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();i.unstable_now=function(){return l.now()-c}}var f=[],u=[],d=1,p=null,A=3,g=!1,E=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(Y){for(var $=t(u);$!==null;){if($.callback===null)n(u);else if($.startTime<=Y)n(u),$.sortIndex=$.expirationTime,e(f,$);else break;$=t(u)}}function x(Y){if(C=!1,y(Y),!E)if(t(f)!==null)E=!0,X(w);else{var $=t(u);$!==null&&te(x,$.startTime-Y)}}function w(Y,$){E=!1,C&&(C=!1,v(L),L=-1),g=!0;var U=A;try{for(y($),p=t(f);p!==null&&(!(p.expirationTime>$)||Y&&!N());){var D=p.callback;if(typeof D=="function"){p.callback=null,A=p.priorityLevel;var G=D(p.expirationTime<=$);$=i.unstable_now(),typeof G=="function"?p.callback=G:p===t(f)&&n(f),y($)}else n(f);p=t(f)}if(p!==null)var K=!0;else{var J=t(u);J!==null&&te(x,J.startTime-$),K=!1}return K}finally{p=null,A=U,g=!1}}var b=!1,B=null,L=-1,R=5,T=-1;function N(){return!(i.unstable_now()-T<R)}function k(){if(B!==null){var Y=i.unstable_now();T=Y;var $=!0;try{$=B(!0,Y)}finally{$?O():(b=!1,B=null)}}else b=!1}var O;if(typeof S=="function")O=function(){S(k)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,V=F.port2;F.port1.onmessage=k,O=function(){V.postMessage(null)}}else O=function(){_(k,0)};function X(Y){B=Y,b||(b=!0,O())}function te(Y,$){L=_(function(){Y(i.unstable_now())},$)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(Y){Y.callback=null},i.unstable_continueExecution=function(){E||g||(E=!0,X(w))},i.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<Y?Math.floor(1e3/Y):5},i.unstable_getCurrentPriorityLevel=function(){return A},i.unstable_getFirstCallbackNode=function(){return t(f)},i.unstable_next=function(Y){switch(A){case 1:case 2:case 3:var $=3;break;default:$=A}var U=A;A=$;try{return Y()}finally{A=U}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var U=A;A=Y;try{return $()}finally{A=U}},i.unstable_scheduleCallback=function(Y,$,U){var D=i.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?D+U:D):U=D,Y){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,Y={id:d++,callback:$,priorityLevel:Y,startTime:U,expirationTime:G,sortIndex:-1},U>D?(Y.sortIndex=U,e(u,Y),t(f)===null&&Y===t(u)&&(C?(v(L),L=-1):C=!0,te(x,U-D))):(Y.sortIndex=G,e(f,Y),E||g||(E=!0,X(w))),Y},i.unstable_shouldYield=N,i.unstable_wrapCallback=function(Y){var $=A;return function(){var U=A;A=$;try{return Y.apply(this,arguments)}finally{A=U}}}}(Gp)),Gp}var xy;function rD(){return xy||(xy=1,zp.exports=iD()),zp.exports}/**
4241
+ */var Iy;function iD(){return Iy||(Iy=1,function(i){function e(q,Z){var U=q.length;q.push(Z);e:for(;0<U;){var D=U-1>>>1,G=q[D];if(0<r(G,Z))q[D]=Z,q[U]=G,U=D;else break e}}function t(q){return q.length===0?null:q[0]}function n(q){if(q.length===0)return null;var Z=q[0],U=q.pop();if(U!==Z){q[0]=U;e:for(var D=0,G=q.length,K=G>>>1;D<K;){var J=2*(D+1)-1,Ae=q[J],ge=J+1,be=q[ge];if(0>r(Ae,U))ge<G&&0>r(be,Ae)?(q[D]=be,q[ge]=U,D=ge):(q[D]=Ae,q[J]=U,D=J);else if(ge<G&&0>r(be,U))q[D]=be,q[ge]=U,D=ge;else break e}}return Z}function r(q,Z){var U=q.sortIndex-Z.sortIndex;return U!==0?U:q.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();i.unstable_now=function(){return l.now()-c}}var f=[],u=[],d=1,p=null,A=3,g=!1,E=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(q){for(var Z=t(u);Z!==null;){if(Z.callback===null)n(u);else if(Z.startTime<=q)n(u),Z.sortIndex=Z.expirationTime,e(f,Z);else break;Z=t(u)}}function S(q){if(C=!1,y(q),!E)if(t(f)!==null)E=!0,X(w);else{var Z=t(u);Z!==null&&te(S,Z.startTime-q)}}function w(q,Z){E=!1,C&&(C=!1,v(L),L=-1),g=!0;var U=A;try{for(y(Z),p=t(f);p!==null&&(!(p.expirationTime>Z)||q&&!N());){var D=p.callback;if(typeof D=="function"){p.callback=null,A=p.priorityLevel;var G=D(p.expirationTime<=Z);Z=i.unstable_now(),typeof G=="function"?p.callback=G:p===t(f)&&n(f),y(Z)}else n(f);p=t(f)}if(p!==null)var K=!0;else{var J=t(u);J!==null&&te(S,J.startTime-Z),K=!1}return K}finally{p=null,A=U,g=!1}}var b=!1,B=null,L=-1,R=5,T=-1;function N(){return!(i.unstable_now()-T<R)}function k(){if(B!==null){var q=i.unstable_now();T=q;var Z=!0;try{Z=B(!0,q)}finally{Z?O():(b=!1,B=null)}}else b=!1}var O;if(typeof x=="function")O=function(){x(k)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,V=F.port2;F.port1.onmessage=k,O=function(){V.postMessage(null)}}else O=function(){_(k,0)};function X(q){B=q,b||(b=!0,O())}function te(q,Z){L=_(function(){q(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(q){q.callback=null},i.unstable_continueExecution=function(){E||g||(E=!0,X(w))},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return A},i.unstable_getFirstCallbackNode=function(){return t(f)},i.unstable_next=function(q){switch(A){case 1:case 2:case 3:var Z=3;break;default:Z=A}var U=A;A=Z;try{return q()}finally{A=U}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(q,Z){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var U=A;A=q;try{return Z()}finally{A=U}},i.unstable_scheduleCallback=function(q,Z,U){var D=i.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?D+U:D):U=D,q){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,q={id:d++,callback:Z,priorityLevel:q,startTime:U,expirationTime:G,sortIndex:-1},U>D?(q.sortIndex=U,e(u,q),t(f)===null&&q===t(u)&&(C?(v(L),L=-1):C=!0,te(S,U-D))):(q.sortIndex=G,e(f,q),E||g||(E=!0,X(w))),q},i.unstable_shouldYield=N,i.unstable_wrapCallback=function(q){var Z=A;return function(){var U=A;A=Z;try{return q.apply(this,arguments)}finally{A=U}}}}(Gp)),Gp}var xy;function rD(){return xy||(xy=1,zp.exports=iD()),zp.exports}/**
4242
4242
  * @license React
4243
4243
  * react-dom.production.min.js
4244
4244
  *
@@ -4246,11 +4246,11 @@ bool bvhIntersectFirstHit(
4246
4246
  *
4247
4247
  * This source code is licensed under the MIT license found in the
4248
4248
  * LICENSE file in the root directory of this source tree.
4249
- */var Sy;function sD(){if(Sy)return hi;Sy=1;var i=Ct,e=rD();function t(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,h=1;h<arguments.length;h++)a+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,r={};function o(s,a){l(s,a),l(s+"Capture",a)}function l(s,a){for(r[s]=a,s=0;s<a.length;s++)n.add(a[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function A(s){return f.call(p,s)?!0:f.call(d,s)?!1:u.test(s)?p[s]=!0:(d[s]=!0,!1)}function g(s,a,h,m){if(h!==null&&h.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function E(s,a,h,m){if(a===null||typeof a>"u"||g(s,a,h,m))return!0;if(m)return!1;if(h!==null)switch(h.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function C(s,a,h,m,I,M,P){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=I,this.mustUseProperty=h,this.propertyName=s,this.type=a,this.sanitizeURL=M,this.removeEmptyString=P}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){_[s]=new C(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];_[a]=new C(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){_[s]=new C(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){_[s]=new C(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){_[s]=new C(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){_[s]=new C(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){_[s]=new C(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){_[s]=new C(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){_[s]=new C(s,5,!1,s.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function S(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(v,S);_[a]=new C(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(v,S);_[a]=new C(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(v,S);_[a]=new C(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){_[s]=new C(s,1,!1,s.toLowerCase(),null,!1,!1)}),_.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){_[s]=new C(s,1,!1,s.toLowerCase(),null,!0,!0)});function y(s,a,h,m){var I=_.hasOwnProperty(a)?_[a]:null;(I!==null?I.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(E(a,h,I,m)&&(h=null),m||I===null?A(a)&&(h===null?s.removeAttribute(a):s.setAttribute(a,""+h)):I.mustUseProperty?s[I.propertyName]=h===null?I.type===3?!1:"":h:(a=I.attributeName,m=I.attributeNamespace,h===null?s.removeAttribute(a):(I=I.type,h=I===3||I===4&&h===!0?"":""+h,m?s.setAttributeNS(m,a,h):s.setAttribute(a,h))))}var x=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),b=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),N=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),Y=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=Y&&s[Y]||s["@@iterator"],typeof s=="function"?s:null)}var U=Object.assign,D;function G(s){if(D===void 0)try{throw Error()}catch(h){var a=h.stack.trim().match(/\n( *(at )?)/);D=a&&a[1]||""}return`
4249
+ */var Sy;function sD(){if(Sy)return hi;Sy=1;var i=Ct,e=rD();function t(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,h=1;h<arguments.length;h++)a+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,r={};function o(s,a){l(s,a),l(s+"Capture",a)}function l(s,a){for(r[s]=a,s=0;s<a.length;s++)n.add(a[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function A(s){return f.call(p,s)?!0:f.call(d,s)?!1:u.test(s)?p[s]=!0:(d[s]=!0,!1)}function g(s,a,h,m){if(h!==null&&h.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function E(s,a,h,m){if(a===null||typeof a>"u"||g(s,a,h,m))return!0;if(m)return!1;if(h!==null)switch(h.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function C(s,a,h,m,I,M,P){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=I,this.mustUseProperty=h,this.propertyName=s,this.type=a,this.sanitizeURL=M,this.removeEmptyString=P}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){_[s]=new C(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];_[a]=new C(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){_[s]=new C(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){_[s]=new C(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){_[s]=new C(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){_[s]=new C(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){_[s]=new C(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){_[s]=new C(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){_[s]=new C(s,5,!1,s.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function x(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(v,x);_[a]=new C(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(v,x);_[a]=new C(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(v,x);_[a]=new C(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){_[s]=new C(s,1,!1,s.toLowerCase(),null,!1,!1)}),_.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){_[s]=new C(s,1,!1,s.toLowerCase(),null,!0,!0)});function y(s,a,h,m){var I=_.hasOwnProperty(a)?_[a]:null;(I!==null?I.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(E(a,h,I,m)&&(h=null),m||I===null?A(a)&&(h===null?s.removeAttribute(a):s.setAttribute(a,""+h)):I.mustUseProperty?s[I.propertyName]=h===null?I.type===3?!1:"":h:(a=I.attributeName,m=I.attributeNamespace,h===null?s.removeAttribute(a):(I=I.type,h=I===3||I===4&&h===!0?"":""+h,m?s.setAttributeNS(m,a,h):s.setAttribute(a,h))))}var S=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),b=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),N=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),q=Symbol.iterator;function Z(s){return s===null||typeof s!="object"?null:(s=q&&s[q]||s["@@iterator"],typeof s=="function"?s:null)}var U=Object.assign,D;function G(s){if(D===void 0)try{throw Error()}catch(h){var a=h.stack.trim().match(/\n( *(at )?)/);D=a&&a[1]||""}return`
4250
4250
  `+D+s}var K=!1;function J(s,a){if(!s||K)return"";K=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(le){var m=le}Reflect.construct(s,[],a)}else{try{a.call()}catch(le){m=le}s.call(a.prototype)}else{try{throw Error()}catch(le){m=le}s()}}catch(le){if(le&&m&&typeof le.stack=="string"){for(var I=le.stack.split(`
4251
4251
  `),M=m.stack.split(`
4252
- `),P=I.length-1,W=M.length-1;1<=P&&0<=W&&I[P]!==M[W];)W--;for(;1<=P&&0<=W;P--,W--)if(I[P]!==M[W]){if(P!==1||W!==1)do if(P--,W--,0>W||I[P]!==M[W]){var Z=`
4253
- `+I[P].replace(" at new "," at ");return s.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",s.displayName)),Z}while(1<=P&&0<=W);break}}}finally{K=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?G(s):""}function Ae(s){switch(s.tag){case 5:return G(s.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return s=J(s.type,!1),s;case 11:return s=J(s.type.render,!1),s;case 1:return s=J(s.type,!0),s;default:return""}}function ge(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case B:return"Fragment";case b:return"Portal";case R:return"Profiler";case L:return"StrictMode";case O:return"Suspense";case F:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case N:return(s.displayName||"Context")+".Consumer";case T:return(s._context.displayName||"Context")+".Provider";case k:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case V:return a=s.displayName||null,a!==null?a:ge(s.type)||"Memo";case X:a=s._payload,s=s._init;try{return ge(s(a))}catch{}}return null}function be(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(a);case 8:return a===L?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function de(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Oe(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function It(s){var a=Oe(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),m=""+s[a];if(!s.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var I=h.get,M=h.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return I.call(this)},set:function(P){m=""+P,M.call(this,P)}}),Object.defineProperty(s,a,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(P){m=""+P},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function ot(s){s._valueTracker||(s._valueTracker=It(s))}function oe(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var h=a.getValue(),m="";return s&&(m=Oe(s)?s.checked?"true":"false":s.value),s=m,s!==h?(a.setValue(s),!0):!1}function Mt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ne(s,a){var h=a.checked;return U({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function Ze(s,a){var h=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;h=de(a.value!=null?a.value:h),s._wrapperState={initialChecked:m,initialValue:h,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function _e(s,a){a=a.checked,a!=null&&y(s,"checked",a,!1)}function it(s,a){_e(s,a);var h=de(a.value),m=a.type;if(h!=null)m==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?He(s,a.type,h):a.hasOwnProperty("defaultValue")&&He(s,a.type,de(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function Ue(s,a,h){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var m=a.type;if(!(m!=="submit"&&m!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,h||a===s.value||(s.value=a),s.defaultValue=a}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function He(s,a,h){(a!=="number"||Mt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var $e=Array.isArray;function lt(s,a,h,m){if(s=s.options,a){a={};for(var I=0;I<h.length;I++)a["$"+h[I]]=!0;for(h=0;h<s.length;h++)I=a.hasOwnProperty("$"+s[h].value),s[h].selected!==I&&(s[h].selected=I),I&&m&&(s[h].defaultSelected=!0)}else{for(h=""+de(h),a=null,I=0;I<s.length;I++){if(s[I].value===h){s[I].selected=!0,m&&(s[I].defaultSelected=!0);return}a!==null||s[I].disabled||(a=s[I])}a!==null&&(a.selected=!0)}}function mt(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(t(91));return U({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function H(s,a){var h=a.value;if(h==null){if(h=a.children,a=a.defaultValue,h!=null){if(a!=null)throw Error(t(92));if($e(h)){if(1<h.length)throw Error(t(93));h=h[0]}a=h}a==null&&(a=""),h=a}s._wrapperState={initialValue:de(h)}}function Q(s,a){var h=de(a.value),m=de(a.defaultValue);h!=null&&(h=""+h,h!==s.value&&(s.value=h),a.defaultValue==null&&s.defaultValue!==h&&(s.defaultValue=h)),m!=null&&(s.defaultValue=""+m)}function se(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function Ce(s){switch(s){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 me(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?Ce(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var xe,We=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,h,m,I){MSApp.execUnsafeLocalFunction(function(){return s(a,h,m,I)})}:s}(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(xe=xe||document.createElement("div"),xe.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=xe.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function Se(s,a){if(a){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=a;return}}s.textContent=a}var Re={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},q=["Webkit","ms","Moz","O"];Object.keys(Re).forEach(function(s){q.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Re[a]=Re[s]})});function Me(s,a,h){return a==null||typeof a=="boolean"||a===""?"":h||typeof a!="number"||a===0||Re.hasOwnProperty(s)&&Re[s]?(""+a).trim():a+"px"}function pe(s,a){s=s.style;for(var h in a)if(a.hasOwnProperty(h)){var m=h.indexOf("--")===0,I=Me(h,a[h],m);h==="float"&&(h="cssFloat"),m?s.setProperty(h,I):s[h]=I}}var nt=U({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 je(s,a){if(a){if(nt[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(t(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(t(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(t(61))}if(a.style!=null&&typeof a.style!="object")throw Error(t(62))}}function Je(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){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 Ge=null;function Pe(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var dt=null,ee=null,Te=null;function ye(s){if(s=Tc(s)){if(typeof dt!="function")throw Error(t(280));var a=s.stateNode;a&&(a=jf(a),dt(s.stateNode,s.type,a))}}function he(s){ee?Te?Te.push(s):Te=[s]:ee=s}function we(){if(ee){var s=ee,a=Te;if(Te=ee=null,ye(s),a)for(s=0;s<a.length;s++)ye(a[s])}}function qe(s,a){return s(a)}function At(){}var Wt=!1;function Dn(s,a,h){if(Wt)return s(a,h);Wt=!0;try{return qe(s,a,h)}finally{Wt=!1,(ee!==null||Te!==null)&&(At(),we())}}function Tt(s,a){var h=s.stateNode;if(h===null)return null;var m=jf(h);if(m===null)return null;h=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(t(231,a,typeof h));return h}var an=!1;if(c)try{var Pt={};Object.defineProperty(Pt,"passive",{get:function(){an=!0}}),window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{an=!1}function Ti(s,a,h,m,I,M,P,W,Z){var le=Array.prototype.slice.call(arguments,3);try{a.apply(h,le)}catch(Ee){this.onError(Ee)}}var Cr=!1,ir=null,Co=!1,ws=null,wf={onError:function(s){Cr=!0,ir=s}};function Mf(s,a,h,m,I,M,P,W,Z){Cr=!1,ir=null,Ti.apply(wf,arguments)}function Wp(s,a,h,m,I,M,P,W,Z){if(Mf.apply(this,arguments),Cr){if(Cr){var le=ir;Cr=!1,ir=null}else throw Error(t(198));Co||(Co=!0,ws=le)}}function Kr(s){var a=s,h=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,a.flags&4098&&(h=a.return),s=a.return;while(s)}return a.tag===3?h:null}function Tf(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function z(s){if(Kr(s)!==s)throw Error(t(188))}function re(s){var a=s.alternate;if(!a){if(a=Kr(s),a===null)throw Error(t(188));return a!==s?null:s}for(var h=s,m=a;;){var I=h.return;if(I===null)break;var M=I.alternate;if(M===null){if(m=I.return,m!==null){h=m;continue}break}if(I.child===M.child){for(M=I.child;M;){if(M===h)return z(I),s;if(M===m)return z(I),a;M=M.sibling}throw Error(t(188))}if(h.return!==m.return)h=I,m=M;else{for(var P=!1,W=I.child;W;){if(W===h){P=!0,h=I,m=M;break}if(W===m){P=!0,m=I,h=M;break}W=W.sibling}if(!P){for(W=M.child;W;){if(W===h){P=!0,h=M,m=I;break}if(W===m){P=!0,m=M,h=I;break}W=W.sibling}if(!P)throw Error(t(189))}}if(h.alternate!==m)throw Error(t(190))}if(h.tag!==3)throw Error(t(188));return h.stateNode.current===h?s:a}function ce(s){return s=re(s),s!==null?ue(s):null}function ue(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=ue(s);if(a!==null)return a;s=s.sibling}return null}var fe=e.unstable_scheduleCallback,ke=e.unstable_cancelCallback,et=e.unstable_shouldYield,at=e.unstable_requestPaint,Qe=e.unstable_now,pt=e.unstable_getCurrentPriorityLevel,ft=e.unstable_ImmediatePriority,ht=e.unstable_UserBlockingPriority,jt=e.unstable_NormalPriority,ii=e.unstable_LowPriority,dn=e.unstable_IdlePriority,di=null,Bt=null;function Et(s){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(di,s,void 0,(s.current.flags&128)===128)}catch{}}var ri=Math.clz32?Math.clz32:Bf,ln=Math.log,Jr=Math.LN2;function Bf(s){return s>>>=0,s===0?32:31-(ln(s)/Jr|0)|0}var Ir=64,Ms=4194304;function An(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Qi(s,a){var h=s.pendingLanes;if(h===0)return 0;var m=0,I=s.suspendedLanes,M=s.pingedLanes,P=h&268435455;if(P!==0){var W=P&~I;W!==0?m=An(W):(M&=P,M!==0&&(m=An(M)))}else P=h&~I,P!==0?m=An(P):M!==0&&(m=An(M));if(m===0)return 0;if(a!==0&&a!==m&&!(a&I)&&(I=m&-m,M=a&-a,I>=M||I===16&&(M&4194240)!==0))return a;if(m&4&&(m|=h&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=m;0<a;)h=31-ri(a),I=1<<h,m|=s[h],a&=~I;return m}function uc(s,a){switch(s){case 1:case 2:case 4:return a+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 a+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 si(s,a){for(var h=s.suspendedLanes,m=s.pingedLanes,I=s.expirationTimes,M=s.pendingLanes;0<M;){var P=31-ri(M),W=1<<P,Z=I[P];Z===-1?(!(W&h)||W&m)&&(I[P]=uc(W,a)):Z<=a&&(s.expiredLanes|=W),M&=~W}}function Io(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Rf(){var s=Ir;return Ir<<=1,!(Ir&4194240)&&(Ir=64),s}function Ga(s){for(var a=[],h=0;31>h;h++)a.push(s);return a}function fc(s,a,h){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-ri(a),s[a]=h}function xD(s,a){var h=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<h;){var I=31-ri(h),M=1<<I;a[I]=0,m[I]=-1,s[I]=-1,h&=~M}}function jp(s,a){var h=s.entangledLanes|=a;for(s=s.entanglements;h;){var m=31-ri(h),I=1<<m;I&a|s[m]&a&&(s[m]|=a),h&=~I}}var kt=0;function zy(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Gy,Yp,Hy,Vy,Wy,qp=!1,bf=[],Ts=null,Bs=null,Rs=null,hc=new Map,dc=new Map,bs=[],SD="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 jy(s,a){switch(s){case"focusin":case"focusout":Ts=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":hc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":dc.delete(a.pointerId)}}function Ac(s,a,h,m,I,M){return s===null||s.nativeEvent!==M?(s={blockedOn:a,domEventName:h,eventSystemFlags:m,nativeEvent:M,targetContainers:[I]},a!==null&&(a=Tc(a),a!==null&&Yp(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,I!==null&&a.indexOf(I)===-1&&a.push(I),s)}function wD(s,a,h,m,I){switch(a){case"focusin":return Ts=Ac(Ts,s,a,h,m,I),!0;case"dragenter":return Bs=Ac(Bs,s,a,h,m,I),!0;case"mouseover":return Rs=Ac(Rs,s,a,h,m,I),!0;case"pointerover":var M=I.pointerId;return hc.set(M,Ac(hc.get(M)||null,s,a,h,m,I)),!0;case"gotpointercapture":return M=I.pointerId,dc.set(M,Ac(dc.get(M)||null,s,a,h,m,I)),!0}return!1}function Yy(s){var a=xo(s.target);if(a!==null){var h=Kr(a);if(h!==null){if(a=h.tag,a===13){if(a=Tf(h),a!==null){s.blockedOn=a,Wy(s.priority,function(){Hy(h)});return}}else if(a===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Lf(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var h=Kp(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(h===null){h=s.nativeEvent;var m=new h.constructor(h.type,h);Ge=m,h.target.dispatchEvent(m),Ge=null}else return a=Tc(h),a!==null&&Yp(a),s.blockedOn=h,!1;a.shift()}return!0}function qy(s,a,h){Lf(s)&&h.delete(a)}function MD(){qp=!1,Ts!==null&&Lf(Ts)&&(Ts=null),Bs!==null&&Lf(Bs)&&(Bs=null),Rs!==null&&Lf(Rs)&&(Rs=null),hc.forEach(qy),dc.forEach(qy)}function pc(s,a){s.blockedOn===a&&(s.blockedOn=null,qp||(qp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MD)))}function gc(s){function a(I){return pc(I,s)}if(0<bf.length){pc(bf[0],s);for(var h=1;h<bf.length;h++){var m=bf[h];m.blockedOn===s&&(m.blockedOn=null)}}for(Ts!==null&&pc(Ts,s),Bs!==null&&pc(Bs,s),Rs!==null&&pc(Rs,s),hc.forEach(a),dc.forEach(a),h=0;h<bs.length;h++)m=bs[h],m.blockedOn===s&&(m.blockedOn=null);for(;0<bs.length&&(h=bs[0],h.blockedOn===null);)Yy(h),h.blockedOn===null&&bs.shift()}var Ha=x.ReactCurrentBatchConfig,Df=!0;function TD(s,a,h,m){var I=kt,M=Ha.transition;Ha.transition=null;try{kt=1,Xp(s,a,h,m)}finally{kt=I,Ha.transition=M}}function BD(s,a,h,m){var I=kt,M=Ha.transition;Ha.transition=null;try{kt=4,Xp(s,a,h,m)}finally{kt=I,Ha.transition=M}}function Xp(s,a,h,m){if(Df){var I=Kp(s,a,h,m);if(I===null)dg(s,a,m,Nf,h),jy(s,m);else if(wD(I,s,a,h,m))m.stopPropagation();else if(jy(s,m),a&4&&-1<SD.indexOf(s)){for(;I!==null;){var M=Tc(I);if(M!==null&&Gy(M),M=Kp(s,a,h,m),M===null&&dg(s,a,m,Nf,h),M===I)break;I=M}I!==null&&m.stopPropagation()}else dg(s,a,m,null,h)}}var Nf=null;function Kp(s,a,h,m){if(Nf=null,s=Pe(m),s=xo(s),s!==null)if(a=Kr(s),a===null)s=null;else if(h=a.tag,h===13){if(s=Tf(a),s!==null)return s;s=null}else if(h===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return Nf=s,null}function Xy(s){switch(s){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(pt()){case ft:return 1;case ht:return 4;case jt:case ii:return 16;case dn:return 536870912;default:return 16}default:return 16}}var Ls=null,Jp=null,Pf=null;function Ky(){if(Pf)return Pf;var s,a=Jp,h=a.length,m,I="value"in Ls?Ls.value:Ls.textContent,M=I.length;for(s=0;s<h&&a[s]===I[s];s++);var P=h-s;for(m=1;m<=P&&a[h-m]===I[M-m];m++);return Pf=I.slice(s,1<m?1-m:void 0)}function Uf(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function kf(){return!0}function Jy(){return!1}function Bi(s){function a(h,m,I,M,P){this._reactName=h,this._targetInst=I,this.type=m,this.nativeEvent=M,this.target=P,this.currentTarget=null;for(var W in s)s.hasOwnProperty(W)&&(h=s[W],this[W]=h?h(M):M[W]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?kf:Jy,this.isPropagationStopped=Jy,this}return U(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=kf)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=kf)},persist:function(){},isPersistent:kf}),a}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zp=Bi(Va),mc=U({},Va,{view:0,detail:0}),RD=Bi(mc),$p,eg,vc,Ff=U({},mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ng,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==vc&&(vc&&s.type==="mousemove"?($p=s.screenX-vc.screenX,eg=s.screenY-vc.screenY):eg=$p=0,vc=s),$p)},movementY:function(s){return"movementY"in s?s.movementY:eg}}),Zy=Bi(Ff),bD=U({},Ff,{dataTransfer:0}),LD=Bi(bD),DD=U({},mc,{relatedTarget:0}),tg=Bi(DD),ND=U({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),PD=Bi(ND),UD=U({},Va,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),kD=Bi(UD),FD=U({},Va,{data:0}),$y=Bi(FD),QD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OD={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"},zD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GD(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=zD[s])?!!a[s]:!1}function ng(){return GD}var HD=U({},mc,{key:function(s){if(s.key){var a=QD[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=Uf(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?OD[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ng,charCode:function(s){return s.type==="keypress"?Uf(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Uf(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),VD=Bi(HD),WD=U({},Ff,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eC=Bi(WD),jD=U({},mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ng}),YD=Bi(jD),qD=U({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),XD=Bi(qD),KD=U({},Ff,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),JD=Bi(KD),ZD=[9,13,27,32],ig=c&&"CompositionEvent"in window,_c=null;c&&"documentMode"in document&&(_c=document.documentMode);var $D=c&&"TextEvent"in window&&!_c,tC=c&&(!ig||_c&&8<_c&&11>=_c),nC=String.fromCharCode(32),iC=!1;function rC(s,a){switch(s){case"keyup":return ZD.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Wa=!1;function e6(s,a){switch(s){case"compositionend":return sC(a);case"keypress":return a.which!==32?null:(iC=!0,nC);case"textInput":return s=a.data,s===nC&&iC?null:s;default:return null}}function t6(s,a){if(Wa)return s==="compositionend"||!ig&&rC(s,a)?(s=Ky(),Pf=Jp=Ls=null,Wa=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return tC&&a.locale!=="ko"?null:a.data;default:return null}}var n6={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 oC(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!n6[s.type]:a==="textarea"}function aC(s,a,h,m){he(m),a=Hf(a,"onChange"),0<a.length&&(h=new Zp("onChange","change",null,h,m),s.push({event:h,listeners:a}))}var Ec=null,yc=null;function i6(s){SC(s,0)}function Qf(s){var a=Ka(s);if(oe(a))return s}function r6(s,a){if(s==="change")return a}var lC=!1;if(c){var rg;if(c){var sg="oninput"in document;if(!sg){var cC=document.createElement("div");cC.setAttribute("oninput","return;"),sg=typeof cC.oninput=="function"}rg=sg}else rg=!1;lC=rg&&(!document.documentMode||9<document.documentMode)}function uC(){Ec&&(Ec.detachEvent("onpropertychange",fC),yc=Ec=null)}function fC(s){if(s.propertyName==="value"&&Qf(yc)){var a=[];aC(a,yc,s,Pe(s)),Dn(i6,a)}}function s6(s,a,h){s==="focusin"?(uC(),Ec=a,yc=h,Ec.attachEvent("onpropertychange",fC)):s==="focusout"&&uC()}function o6(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Qf(yc)}function a6(s,a){if(s==="click")return Qf(a)}function l6(s,a){if(s==="input"||s==="change")return Qf(a)}function c6(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var rr=typeof Object.is=="function"?Object.is:c6;function Cc(s,a){if(rr(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var h=Object.keys(s),m=Object.keys(a);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var I=h[m];if(!f.call(a,I)||!rr(s[I],a[I]))return!1}return!0}function hC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function dC(s,a){var h=hC(s);s=0;for(var m;h;){if(h.nodeType===3){if(m=s+h.textContent.length,s<=a&&m>=a)return{node:h,offset:a-s};s=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=hC(h)}}function AC(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?AC(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function pC(){for(var s=window,a=Mt();a instanceof s.HTMLIFrameElement;){try{var h=typeof a.contentWindow.location.href=="string"}catch{h=!1}if(h)s=a.contentWindow;else break;a=Mt(s.document)}return a}function og(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function u6(s){var a=pC(),h=s.focusedElem,m=s.selectionRange;if(a!==h&&h&&h.ownerDocument&&AC(h.ownerDocument.documentElement,h)){if(m!==null&&og(h)){if(a=m.start,s=m.end,s===void 0&&(s=a),"selectionStart"in h)h.selectionStart=a,h.selectionEnd=Math.min(s,h.value.length);else if(s=(a=h.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var I=h.textContent.length,M=Math.min(m.start,I);m=m.end===void 0?M:Math.min(m.end,I),!s.extend&&M>m&&(I=m,m=M,M=I),I=dC(h,M);var P=dC(h,m);I&&P&&(s.rangeCount!==1||s.anchorNode!==I.node||s.anchorOffset!==I.offset||s.focusNode!==P.node||s.focusOffset!==P.offset)&&(a=a.createRange(),a.setStart(I.node,I.offset),s.removeAllRanges(),M>m?(s.addRange(a),s.extend(P.node,P.offset)):(a.setEnd(P.node,P.offset),s.addRange(a)))}}for(a=[],s=h;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<a.length;h++)s=a[h],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var f6=c&&"documentMode"in document&&11>=document.documentMode,ja=null,ag=null,Ic=null,lg=!1;function gC(s,a,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;lg||ja==null||ja!==Mt(m)||(m=ja,"selectionStart"in m&&og(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Ic&&Cc(Ic,m)||(Ic=m,m=Hf(ag,"onSelect"),0<m.length&&(a=new Zp("onSelect","select",null,a,h),s.push({event:a,listeners:m}),a.target=ja)))}function Of(s,a){var h={};return h[s.toLowerCase()]=a.toLowerCase(),h["Webkit"+s]="webkit"+a,h["Moz"+s]="moz"+a,h}var Ya={animationend:Of("Animation","AnimationEnd"),animationiteration:Of("Animation","AnimationIteration"),animationstart:Of("Animation","AnimationStart"),transitionend:Of("Transition","TransitionEnd")},cg={},mC={};c&&(mC=document.createElement("div").style,"AnimationEvent"in window||(delete Ya.animationend.animation,delete Ya.animationiteration.animation,delete Ya.animationstart.animation),"TransitionEvent"in window||delete Ya.transitionend.transition);function zf(s){if(cg[s])return cg[s];if(!Ya[s])return s;var a=Ya[s],h;for(h in a)if(a.hasOwnProperty(h)&&h in mC)return cg[s]=a[h];return s}var vC=zf("animationend"),_C=zf("animationiteration"),EC=zf("animationstart"),yC=zf("transitionend"),CC=new Map,IC="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 Ds(s,a){CC.set(s,a),o(a,[s])}for(var ug=0;ug<IC.length;ug++){var fg=IC[ug],h6=fg.toLowerCase(),d6=fg[0].toUpperCase()+fg.slice(1);Ds(h6,"on"+d6)}Ds(vC,"onAnimationEnd"),Ds(_C,"onAnimationIteration"),Ds(EC,"onAnimationStart"),Ds("dblclick","onDoubleClick"),Ds("focusin","onFocus"),Ds("focusout","onBlur"),Ds(yC,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xc="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(" "),A6=new Set("cancel close invalid load scroll toggle".split(" ").concat(xc));function xC(s,a,h){var m=s.type||"unknown-event";s.currentTarget=h,Wp(m,a,void 0,s),s.currentTarget=null}function SC(s,a){a=(a&4)!==0;for(var h=0;h<s.length;h++){var m=s[h],I=m.event;m=m.listeners;e:{var M=void 0;if(a)for(var P=m.length-1;0<=P;P--){var W=m[P],Z=W.instance,le=W.currentTarget;if(W=W.listener,Z!==M&&I.isPropagationStopped())break e;xC(I,W,le),M=Z}else for(P=0;P<m.length;P++){if(W=m[P],Z=W.instance,le=W.currentTarget,W=W.listener,Z!==M&&I.isPropagationStopped())break e;xC(I,W,le),M=Z}}}if(Co)throw s=ws,Co=!1,ws=null,s}function Jt(s,a){var h=a[_g];h===void 0&&(h=a[_g]=new Set);var m=s+"__bubble";h.has(m)||(wC(a,s,2,!1),h.add(m))}function hg(s,a,h){var m=0;a&&(m|=4),wC(h,s,m,a)}var Gf="_reactListening"+Math.random().toString(36).slice(2);function Sc(s){if(!s[Gf]){s[Gf]=!0,n.forEach(function(h){h!=="selectionchange"&&(A6.has(h)||hg(h,!1,s),hg(h,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Gf]||(a[Gf]=!0,hg("selectionchange",!1,a))}}function wC(s,a,h,m){switch(Xy(a)){case 1:var I=TD;break;case 4:I=BD;break;default:I=Xp}h=I.bind(null,a,h,s),I=void 0,!an||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(I=!0),m?I!==void 0?s.addEventListener(a,h,{capture:!0,passive:I}):s.addEventListener(a,h,!0):I!==void 0?s.addEventListener(a,h,{passive:I}):s.addEventListener(a,h,!1)}function dg(s,a,h,m,I){var M=m;if(!(a&1)&&!(a&2)&&m!==null)e:for(;;){if(m===null)return;var P=m.tag;if(P===3||P===4){var W=m.stateNode.containerInfo;if(W===I||W.nodeType===8&&W.parentNode===I)break;if(P===4)for(P=m.return;P!==null;){var Z=P.tag;if((Z===3||Z===4)&&(Z=P.stateNode.containerInfo,Z===I||Z.nodeType===8&&Z.parentNode===I))return;P=P.return}for(;W!==null;){if(P=xo(W),P===null)return;if(Z=P.tag,Z===5||Z===6){m=M=P;continue e}W=W.parentNode}}m=m.return}Dn(function(){var le=M,Ee=Pe(h),Ie=[];e:{var ve=CC.get(s);if(ve!==void 0){var Fe=Zp,Ve=s;switch(s){case"keypress":if(Uf(h)===0)break e;case"keydown":case"keyup":Fe=VD;break;case"focusin":Ve="focus",Fe=tg;break;case"focusout":Ve="blur",Fe=tg;break;case"beforeblur":case"afterblur":Fe=tg;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=Zy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=LD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=YD;break;case vC:case _C:case EC:Fe=PD;break;case yC:Fe=XD;break;case"scroll":Fe=RD;break;case"wheel":Fe=JD;break;case"copy":case"cut":case"paste":Fe=kD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=eC}var Ye=(a&4)!==0,pn=!Ye&&s==="scroll",ie=Ye?ve!==null?ve+"Capture":null:ve;Ye=[];for(var ne=le,ae;ne!==null;){ae=ne;var Be=ae.stateNode;if(ae.tag===5&&Be!==null&&(ae=Be,ie!==null&&(Be=Tt(ne,ie),Be!=null&&Ye.push(wc(ne,Be,ae)))),pn)break;ne=ne.return}0<Ye.length&&(ve=new Fe(ve,Ve,null,h,Ee),Ie.push({event:ve,listeners:Ye}))}}if(!(a&7)){e:{if(ve=s==="mouseover"||s==="pointerover",Fe=s==="mouseout"||s==="pointerout",ve&&h!==Ge&&(Ve=h.relatedTarget||h.fromElement)&&(xo(Ve)||Ve[Zr]))break e;if((Fe||ve)&&(ve=Ee.window===Ee?Ee:(ve=Ee.ownerDocument)?ve.defaultView||ve.parentWindow:window,Fe?(Ve=h.relatedTarget||h.toElement,Fe=le,Ve=Ve?xo(Ve):null,Ve!==null&&(pn=Kr(Ve),Ve!==pn||Ve.tag!==5&&Ve.tag!==6)&&(Ve=null)):(Fe=null,Ve=le),Fe!==Ve)){if(Ye=Zy,Be="onMouseLeave",ie="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=eC,Be="onPointerLeave",ie="onPointerEnter",ne="pointer"),pn=Fe==null?ve:Ka(Fe),ae=Ve==null?ve:Ka(Ve),ve=new Ye(Be,ne+"leave",Fe,h,Ee),ve.target=pn,ve.relatedTarget=ae,Be=null,xo(Ee)===le&&(Ye=new Ye(ie,ne+"enter",Ve,h,Ee),Ye.target=ae,Ye.relatedTarget=pn,Be=Ye),pn=Be,Fe&&Ve)t:{for(Ye=Fe,ie=Ve,ne=0,ae=Ye;ae;ae=qa(ae))ne++;for(ae=0,Be=ie;Be;Be=qa(Be))ae++;for(;0<ne-ae;)Ye=qa(Ye),ne--;for(;0<ae-ne;)ie=qa(ie),ae--;for(;ne--;){if(Ye===ie||ie!==null&&Ye===ie.alternate)break t;Ye=qa(Ye),ie=qa(ie)}Ye=null}else Ye=null;Fe!==null&&MC(Ie,ve,Fe,Ye,!1),Ve!==null&&pn!==null&&MC(Ie,pn,Ve,Ye,!0)}}e:{if(ve=le?Ka(le):window,Fe=ve.nodeName&&ve.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ve.type==="file")var Xe=r6;else if(oC(ve))if(lC)Xe=l6;else{Xe=o6;var rt=s6}else(Fe=ve.nodeName)&&Fe.toLowerCase()==="input"&&(ve.type==="checkbox"||ve.type==="radio")&&(Xe=a6);if(Xe&&(Xe=Xe(s,le))){aC(Ie,Xe,h,Ee);break e}rt&&rt(s,ve,le),s==="focusout"&&(rt=ve._wrapperState)&&rt.controlled&&ve.type==="number"&&He(ve,"number",ve.value)}switch(rt=le?Ka(le):window,s){case"focusin":(oC(rt)||rt.contentEditable==="true")&&(ja=rt,ag=le,Ic=null);break;case"focusout":Ic=ag=ja=null;break;case"mousedown":lg=!0;break;case"contextmenu":case"mouseup":case"dragend":lg=!1,gC(Ie,h,Ee);break;case"selectionchange":if(f6)break;case"keydown":case"keyup":gC(Ie,h,Ee)}var st;if(ig)e:{switch(s){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Wa?rC(s,h)&&(ut="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(ut="onCompositionStart");ut&&(tC&&h.locale!=="ko"&&(Wa||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Wa&&(st=Ky()):(Ls=Ee,Jp="value"in Ls?Ls.value:Ls.textContent,Wa=!0)),rt=Hf(le,ut),0<rt.length&&(ut=new $y(ut,s,null,h,Ee),Ie.push({event:ut,listeners:rt}),st?ut.data=st:(st=sC(h),st!==null&&(ut.data=st)))),(st=$D?e6(s,h):t6(s,h))&&(le=Hf(le,"onBeforeInput"),0<le.length&&(Ee=new $y("onBeforeInput","beforeinput",null,h,Ee),Ie.push({event:Ee,listeners:le}),Ee.data=st))}SC(Ie,a)})}function wc(s,a,h){return{instance:s,listener:a,currentTarget:h}}function Hf(s,a){for(var h=a+"Capture",m=[];s!==null;){var I=s,M=I.stateNode;I.tag===5&&M!==null&&(I=M,M=Tt(s,h),M!=null&&m.unshift(wc(s,M,I)),M=Tt(s,a),M!=null&&m.push(wc(s,M,I))),s=s.return}return m}function qa(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function MC(s,a,h,m,I){for(var M=a._reactName,P=[];h!==null&&h!==m;){var W=h,Z=W.alternate,le=W.stateNode;if(Z!==null&&Z===m)break;W.tag===5&&le!==null&&(W=le,I?(Z=Tt(h,M),Z!=null&&P.unshift(wc(h,Z,W))):I||(Z=Tt(h,M),Z!=null&&P.push(wc(h,Z,W)))),h=h.return}P.length!==0&&s.push({event:a,listeners:P})}var p6=/\r\n?/g,g6=/\u0000|\uFFFD/g;function TC(s){return(typeof s=="string"?s:""+s).replace(p6,`
4254
- `).replace(g6,"")}function Vf(s,a,h){if(a=TC(a),TC(s)!==a&&h)throw Error(t(425))}function Wf(){}var Ag=null,pg=null;function gg(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var mg=typeof setTimeout=="function"?setTimeout:void 0,m6=typeof clearTimeout=="function"?clearTimeout:void 0,BC=typeof Promise=="function"?Promise:void 0,v6=typeof queueMicrotask=="function"?queueMicrotask:typeof BC<"u"?function(s){return BC.resolve(null).then(s).catch(_6)}:mg;function _6(s){setTimeout(function(){throw s})}function vg(s,a){var h=a,m=0;do{var I=h.nextSibling;if(s.removeChild(h),I&&I.nodeType===8)if(h=I.data,h==="/$"){if(m===0){s.removeChild(I),gc(a);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=I}while(h);gc(a)}function Ns(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function RC(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"){if(a===0)return s;a--}else h==="/$"&&a++}s=s.previousSibling}return null}var Xa=Math.random().toString(36).slice(2),xr="__reactFiber$"+Xa,Mc="__reactProps$"+Xa,Zr="__reactContainer$"+Xa,_g="__reactEvents$"+Xa,E6="__reactListeners$"+Xa,y6="__reactHandles$"+Xa;function xo(s){var a=s[xr];if(a)return a;for(var h=s.parentNode;h;){if(a=h[Zr]||h[xr]){if(h=a.alternate,a.child!==null||h!==null&&h.child!==null)for(s=RC(s);s!==null;){if(h=s[xr])return h;s=RC(s)}return a}s=h,h=s.parentNode}return null}function Tc(s){return s=s[xr]||s[Zr],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Ka(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(t(33))}function jf(s){return s[Mc]||null}var Eg=[],Ja=-1;function Ps(s){return{current:s}}function Zt(s){0>Ja||(s.current=Eg[Ja],Eg[Ja]=null,Ja--)}function Yt(s,a){Ja++,Eg[Ja]=s.current,s.current=a}var Us={},jn=Ps(Us),Ai=Ps(!1),So=Us;function Za(s,a){var h=s.type.contextTypes;if(!h)return Us;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var I={},M;for(M in h)I[M]=a[M];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=I),I}function pi(s){return s=s.childContextTypes,s!=null}function Yf(){Zt(Ai),Zt(jn)}function bC(s,a,h){if(jn.current!==Us)throw Error(t(168));Yt(jn,a),Yt(Ai,h)}function LC(s,a,h){var m=s.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var I in m)if(!(I in a))throw Error(t(108,be(s)||"Unknown",I));return U({},h,m)}function qf(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Us,So=jn.current,Yt(jn,s),Yt(Ai,Ai.current),!0}function DC(s,a,h){var m=s.stateNode;if(!m)throw Error(t(169));h?(s=LC(s,a,So),m.__reactInternalMemoizedMergedChildContext=s,Zt(Ai),Zt(jn),Yt(jn,s)):Zt(Ai),Yt(Ai,h)}var $r=null,Xf=!1,yg=!1;function NC(s){$r===null?$r=[s]:$r.push(s)}function C6(s){Xf=!0,NC(s)}function ks(){if(!yg&&$r!==null){yg=!0;var s=0,a=kt;try{var h=$r;for(kt=1;s<h.length;s++){var m=h[s];do m=m(!0);while(m!==null)}$r=null,Xf=!1}catch(I){throw $r!==null&&($r=$r.slice(s+1)),fe(ft,ks),I}finally{kt=a,yg=!1}}return null}var $a=[],el=0,Kf=null,Jf=0,Oi=[],zi=0,wo=null,es=1,ts="";function Mo(s,a){$a[el++]=Jf,$a[el++]=Kf,Kf=s,Jf=a}function PC(s,a,h){Oi[zi++]=es,Oi[zi++]=ts,Oi[zi++]=wo,wo=s;var m=es;s=ts;var I=32-ri(m)-1;m&=~(1<<I),h+=1;var M=32-ri(a)+I;if(30<M){var P=I-I%5;M=(m&(1<<P)-1).toString(32),m>>=P,I-=P,es=1<<32-ri(a)+I|h<<I|m,ts=M+s}else es=1<<M|h<<I|m,ts=s}function Cg(s){s.return!==null&&(Mo(s,1),PC(s,1,0))}function Ig(s){for(;s===Kf;)Kf=$a[--el],$a[el]=null,Jf=$a[--el],$a[el]=null;for(;s===wo;)wo=Oi[--zi],Oi[zi]=null,ts=Oi[--zi],Oi[zi]=null,es=Oi[--zi],Oi[zi]=null}var Ri=null,bi=null,en=!1,sr=null;function UC(s,a){var h=Wi(5,null,null,0);h.elementType="DELETED",h.stateNode=a,h.return=s,a=s.deletions,a===null?(s.deletions=[h],s.flags|=16):a.push(h)}function kC(s,a){switch(s.tag){case 5:var h=s.type;return a=a.nodeType!==1||h.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,Ri=s,bi=Ns(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,Ri=s,bi=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(h=wo!==null?{id:es,overflow:ts}:null,s.memoizedState={dehydrated:a,treeContext:h,retryLane:1073741824},h=Wi(18,null,null,0),h.stateNode=a,h.return=s,s.child=h,Ri=s,bi=null,!0):!1;default:return!1}}function xg(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Sg(s){if(en){var a=bi;if(a){var h=a;if(!kC(s,a)){if(xg(s))throw Error(t(418));a=Ns(h.nextSibling);var m=Ri;a&&kC(s,a)?UC(m,h):(s.flags=s.flags&-4097|2,en=!1,Ri=s)}}else{if(xg(s))throw Error(t(418));s.flags=s.flags&-4097|2,en=!1,Ri=s}}}function FC(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Ri=s}function Zf(s){if(s!==Ri)return!1;if(!en)return FC(s),en=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!gg(s.type,s.memoizedProps)),a&&(a=bi)){if(xg(s))throw QC(),Error(t(418));for(;a;)UC(s,a),a=Ns(a.nextSibling)}if(FC(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(t(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"){if(a===0){bi=Ns(s.nextSibling);break e}a--}else h!=="$"&&h!=="$!"&&h!=="$?"||a++}s=s.nextSibling}bi=null}}else bi=Ri?Ns(s.stateNode.nextSibling):null;return!0}function QC(){for(var s=bi;s;)s=Ns(s.nextSibling)}function tl(){bi=Ri=null,en=!1}function wg(s){sr===null?sr=[s]:sr.push(s)}var I6=x.ReactCurrentBatchConfig;function or(s,a){if(s&&s.defaultProps){a=U({},a),s=s.defaultProps;for(var h in s)a[h]===void 0&&(a[h]=s[h]);return a}return a}var $f=Ps(null),eh=null,nl=null,Mg=null;function Tg(){Mg=nl=eh=null}function Bg(s){var a=$f.current;Zt($f),s._currentValue=a}function Rg(s,a,h){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===h)break;s=s.return}}function il(s,a){eh=s,Mg=nl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&a&&(gi=!0),s.firstContext=null)}function Gi(s){var a=s._currentValue;if(Mg!==s)if(s={context:s,memoizedValue:a,next:null},nl===null){if(eh===null)throw Error(t(308));nl=s,eh.dependencies={lanes:0,firstContext:s}}else nl=nl.next=s;return a}var To=null;function bg(s){To===null?To=[s]:To.push(s)}function OC(s,a,h,m){var I=a.interleaved;return I===null?(h.next=h,bg(a)):(h.next=I.next,I.next=h),a.interleaved=h,ns(s,m)}function ns(s,a){s.lanes|=a;var h=s.alternate;for(h!==null&&(h.lanes|=a),h=s,s=s.return;s!==null;)s.childLanes|=a,h=s.alternate,h!==null&&(h.childLanes|=a),h=s,s=s.return;return h.tag===3?h.stateNode:null}var Fs=!1;function Lg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zC(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function is(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Qs(s,a,h){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,Rt&2){var I=m.pending;return I===null?a.next=a:(a.next=I.next,I.next=a),m.pending=a,ns(s,h)}return I=m.interleaved,I===null?(a.next=a,bg(m)):(a.next=I.next,I.next=a),m.interleaved=a,ns(s,h)}function th(s,a,h){if(a=a.updateQueue,a!==null&&(a=a.shared,(h&4194240)!==0)){var m=a.lanes;m&=s.pendingLanes,h|=m,a.lanes=h,jp(s,h)}}function GC(s,a){var h=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var I=null,M=null;if(h=h.firstBaseUpdate,h!==null){do{var P={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};M===null?I=M=P:M=M.next=P,h=h.next}while(h!==null);M===null?I=M=a:M=M.next=a}else I=M=a;h={baseState:m.baseState,firstBaseUpdate:I,lastBaseUpdate:M,shared:m.shared,effects:m.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=a:s.next=a,h.lastBaseUpdate=a}function nh(s,a,h,m){var I=s.updateQueue;Fs=!1;var M=I.firstBaseUpdate,P=I.lastBaseUpdate,W=I.shared.pending;if(W!==null){I.shared.pending=null;var Z=W,le=Z.next;Z.next=null,P===null?M=le:P.next=le,P=Z;var Ee=s.alternate;Ee!==null&&(Ee=Ee.updateQueue,W=Ee.lastBaseUpdate,W!==P&&(W===null?Ee.firstBaseUpdate=le:W.next=le,Ee.lastBaseUpdate=Z))}if(M!==null){var Ie=I.baseState;P=0,Ee=le=Z=null,W=M;do{var ve=W.lane,Fe=W.eventTime;if((m&ve)===ve){Ee!==null&&(Ee=Ee.next={eventTime:Fe,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Ve=s,Ye=W;switch(ve=a,Fe=h,Ye.tag){case 1:if(Ve=Ye.payload,typeof Ve=="function"){Ie=Ve.call(Fe,Ie,ve);break e}Ie=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=Ye.payload,ve=typeof Ve=="function"?Ve.call(Fe,Ie,ve):Ve,ve==null)break e;Ie=U({},Ie,ve);break e;case 2:Fs=!0}}W.callback!==null&&W.lane!==0&&(s.flags|=64,ve=I.effects,ve===null?I.effects=[W]:ve.push(W))}else Fe={eventTime:Fe,lane:ve,tag:W.tag,payload:W.payload,callback:W.callback,next:null},Ee===null?(le=Ee=Fe,Z=Ie):Ee=Ee.next=Fe,P|=ve;if(W=W.next,W===null){if(W=I.shared.pending,W===null)break;ve=W,W=ve.next,ve.next=null,I.lastBaseUpdate=ve,I.shared.pending=null}}while(1);if(Ee===null&&(Z=Ie),I.baseState=Z,I.firstBaseUpdate=le,I.lastBaseUpdate=Ee,a=I.shared.interleaved,a!==null){I=a;do P|=I.lane,I=I.next;while(I!==a)}else M===null&&(I.shared.lanes=0);bo|=P,s.lanes=P,s.memoizedState=Ie}}function HC(s,a,h){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var m=s[a],I=m.callback;if(I!==null){if(m.callback=null,m=h,typeof I!="function")throw Error(t(191,I));I.call(m)}}}var VC=new i.Component().refs;function Dg(s,a,h,m){a=s.memoizedState,h=h(m,a),h=h==null?a:U({},a,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var ih={isMounted:function(s){return(s=s._reactInternals)?Kr(s)===s:!1},enqueueSetState:function(s,a,h){s=s._reactInternals;var m=ai(),I=Hs(s),M=is(m,I);M.payload=a,h!=null&&(M.callback=h),a=Qs(s,M,I),a!==null&&(cr(a,s,I,m),th(a,s,I))},enqueueReplaceState:function(s,a,h){s=s._reactInternals;var m=ai(),I=Hs(s),M=is(m,I);M.tag=1,M.payload=a,h!=null&&(M.callback=h),a=Qs(s,M,I),a!==null&&(cr(a,s,I,m),th(a,s,I))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var h=ai(),m=Hs(s),I=is(h,m);I.tag=2,a!=null&&(I.callback=a),a=Qs(s,I,m),a!==null&&(cr(a,s,m,h),th(a,s,m))}};function WC(s,a,h,m,I,M,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,M,P):a.prototype&&a.prototype.isPureReactComponent?!Cc(h,m)||!Cc(I,M):!0}function jC(s,a,h){var m=!1,I=Us,M=a.contextType;return typeof M=="object"&&M!==null?M=Gi(M):(I=pi(a)?So:jn.current,m=a.contextTypes,M=(m=m!=null)?Za(s,I):Us),a=new a(h,M),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ih,s.stateNode=a,a._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=I,s.__reactInternalMemoizedMaskedChildContext=M),a}function YC(s,a,h,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(h,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(h,m),a.state!==s&&ih.enqueueReplaceState(a,a.state,null)}function Ng(s,a,h,m){var I=s.stateNode;I.props=h,I.state=s.memoizedState,I.refs=VC,Lg(s);var M=a.contextType;typeof M=="object"&&M!==null?I.context=Gi(M):(M=pi(a)?So:jn.current,I.context=Za(s,M)),I.state=s.memoizedState,M=a.getDerivedStateFromProps,typeof M=="function"&&(Dg(s,a,M,h),I.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(a=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),a!==I.state&&ih.enqueueReplaceState(I,I.state,null),nh(s,h,I,m),I.state=s.memoizedState),typeof I.componentDidMount=="function"&&(s.flags|=4194308)}function Bc(s,a,h){if(s=h.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(t(309));var m=h.stateNode}if(!m)throw Error(t(147,s));var I=m,M=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===M?a.ref:(a=function(P){var W=I.refs;W===VC&&(W=I.refs={}),P===null?delete W[M]:W[M]=P},a._stringRef=M,a)}if(typeof s!="string")throw Error(t(284));if(!h._owner)throw Error(t(290,s))}return s}function rh(s,a){throw s=Object.prototype.toString.call(a),Error(t(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function qC(s){var a=s._init;return a(s._payload)}function XC(s){function a(ie,ne){if(s){var ae=ie.deletions;ae===null?(ie.deletions=[ne],ie.flags|=16):ae.push(ne)}}function h(ie,ne){if(!s)return null;for(;ne!==null;)a(ie,ne),ne=ne.sibling;return null}function m(ie,ne){for(ie=new Map;ne!==null;)ne.key!==null?ie.set(ne.key,ne):ie.set(ne.index,ne),ne=ne.sibling;return ie}function I(ie,ne){return ie=Ws(ie,ne),ie.index=0,ie.sibling=null,ie}function M(ie,ne,ae){return ie.index=ae,s?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<ne?(ie.flags|=2,ne):ae):(ie.flags|=2,ne)):(ie.flags|=1048576,ne)}function P(ie){return s&&ie.alternate===null&&(ie.flags|=2),ie}function W(ie,ne,ae,Be){return ne===null||ne.tag!==6?(ne=mm(ae,ie.mode,Be),ne.return=ie,ne):(ne=I(ne,ae),ne.return=ie,ne)}function Z(ie,ne,ae,Be){var Xe=ae.type;return Xe===B?Ee(ie,ne,ae.props.children,Be,ae.key):ne!==null&&(ne.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&qC(Xe)===ne.type)?(Be=I(ne,ae.props),Be.ref=Bc(ie,ne,ae),Be.return=ie,Be):(Be=Ih(ae.type,ae.key,ae.props,null,ie.mode,Be),Be.ref=Bc(ie,ne,ae),Be.return=ie,Be)}function le(ie,ne,ae,Be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ae.containerInfo||ne.stateNode.implementation!==ae.implementation?(ne=vm(ae,ie.mode,Be),ne.return=ie,ne):(ne=I(ne,ae.children||[]),ne.return=ie,ne)}function Ee(ie,ne,ae,Be,Xe){return ne===null||ne.tag!==7?(ne=Po(ae,ie.mode,Be,Xe),ne.return=ie,ne):(ne=I(ne,ae),ne.return=ie,ne)}function Ie(ie,ne,ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=mm(""+ne,ie.mode,ae),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ae=Ih(ne.type,ne.key,ne.props,null,ie.mode,ae),ae.ref=Bc(ie,null,ne),ae.return=ie,ae;case b:return ne=vm(ne,ie.mode,ae),ne.return=ie,ne;case X:var Be=ne._init;return Ie(ie,Be(ne._payload),ae)}if($e(ne)||$(ne))return ne=Po(ne,ie.mode,ae,null),ne.return=ie,ne;rh(ie,ne)}return null}function ve(ie,ne,ae,Be){var Xe=ne!==null?ne.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return Xe!==null?null:W(ie,ne,""+ae,Be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return ae.key===Xe?Z(ie,ne,ae,Be):null;case b:return ae.key===Xe?le(ie,ne,ae,Be):null;case X:return Xe=ae._init,ve(ie,ne,Xe(ae._payload),Be)}if($e(ae)||$(ae))return Xe!==null?null:Ee(ie,ne,ae,Be,null);rh(ie,ae)}return null}function Fe(ie,ne,ae,Be,Xe){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return ie=ie.get(ae)||null,W(ne,ie,""+Be,Xe);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case w:return ie=ie.get(Be.key===null?ae:Be.key)||null,Z(ne,ie,Be,Xe);case b:return ie=ie.get(Be.key===null?ae:Be.key)||null,le(ne,ie,Be,Xe);case X:var rt=Be._init;return Fe(ie,ne,ae,rt(Be._payload),Xe)}if($e(Be)||$(Be))return ie=ie.get(ae)||null,Ee(ne,ie,Be,Xe,null);rh(ne,Be)}return null}function Ve(ie,ne,ae,Be){for(var Xe=null,rt=null,st=ne,ut=ne=0,Un=null;st!==null&&ut<ae.length;ut++){st.index>ut?(Un=st,st=null):Un=st.sibling;var bt=ve(ie,st,ae[ut],Be);if(bt===null){st===null&&(st=Un);break}s&&st&&bt.alternate===null&&a(ie,st),ne=M(bt,ne,ut),rt===null?Xe=bt:rt.sibling=bt,rt=bt,st=Un}if(ut===ae.length)return h(ie,st),en&&Mo(ie,ut),Xe;if(st===null){for(;ut<ae.length;ut++)st=Ie(ie,ae[ut],Be),st!==null&&(ne=M(st,ne,ut),rt===null?Xe=st:rt.sibling=st,rt=st);return en&&Mo(ie,ut),Xe}for(st=m(ie,st);ut<ae.length;ut++)Un=Fe(st,ie,ut,ae[ut],Be),Un!==null&&(s&&Un.alternate!==null&&st.delete(Un.key===null?ut:Un.key),ne=M(Un,ne,ut),rt===null?Xe=Un:rt.sibling=Un,rt=Un);return s&&st.forEach(function(js){return a(ie,js)}),en&&Mo(ie,ut),Xe}function Ye(ie,ne,ae,Be){var Xe=$(ae);if(typeof Xe!="function")throw Error(t(150));if(ae=Xe.call(ae),ae==null)throw Error(t(151));for(var rt=Xe=null,st=ne,ut=ne=0,Un=null,bt=ae.next();st!==null&&!bt.done;ut++,bt=ae.next()){st.index>ut?(Un=st,st=null):Un=st.sibling;var js=ve(ie,st,bt.value,Be);if(js===null){st===null&&(st=Un);break}s&&st&&js.alternate===null&&a(ie,st),ne=M(js,ne,ut),rt===null?Xe=js:rt.sibling=js,rt=js,st=Un}if(bt.done)return h(ie,st),en&&Mo(ie,ut),Xe;if(st===null){for(;!bt.done;ut++,bt=ae.next())bt=Ie(ie,bt.value,Be),bt!==null&&(ne=M(bt,ne,ut),rt===null?Xe=bt:rt.sibling=bt,rt=bt);return en&&Mo(ie,ut),Xe}for(st=m(ie,st);!bt.done;ut++,bt=ae.next())bt=Fe(st,ie,ut,bt.value,Be),bt!==null&&(s&&bt.alternate!==null&&st.delete(bt.key===null?ut:bt.key),ne=M(bt,ne,ut),rt===null?Xe=bt:rt.sibling=bt,rt=bt);return s&&st.forEach(function(nN){return a(ie,nN)}),en&&Mo(ie,ut),Xe}function pn(ie,ne,ae,Be){if(typeof ae=="object"&&ae!==null&&ae.type===B&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:e:{for(var Xe=ae.key,rt=ne;rt!==null;){if(rt.key===Xe){if(Xe=ae.type,Xe===B){if(rt.tag===7){h(ie,rt.sibling),ne=I(rt,ae.props.children),ne.return=ie,ie=ne;break e}}else if(rt.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&qC(Xe)===rt.type){h(ie,rt.sibling),ne=I(rt,ae.props),ne.ref=Bc(ie,rt,ae),ne.return=ie,ie=ne;break e}h(ie,rt);break}else a(ie,rt);rt=rt.sibling}ae.type===B?(ne=Po(ae.props.children,ie.mode,Be,ae.key),ne.return=ie,ie=ne):(Be=Ih(ae.type,ae.key,ae.props,null,ie.mode,Be),Be.ref=Bc(ie,ne,ae),Be.return=ie,ie=Be)}return P(ie);case b:e:{for(rt=ae.key;ne!==null;){if(ne.key===rt)if(ne.tag===4&&ne.stateNode.containerInfo===ae.containerInfo&&ne.stateNode.implementation===ae.implementation){h(ie,ne.sibling),ne=I(ne,ae.children||[]),ne.return=ie,ie=ne;break e}else{h(ie,ne);break}else a(ie,ne);ne=ne.sibling}ne=vm(ae,ie.mode,Be),ne.return=ie,ie=ne}return P(ie);case X:return rt=ae._init,pn(ie,ne,rt(ae._payload),Be)}if($e(ae))return Ve(ie,ne,ae,Be);if($(ae))return Ye(ie,ne,ae,Be);rh(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,ne!==null&&ne.tag===6?(h(ie,ne.sibling),ne=I(ne,ae),ne.return=ie,ie=ne):(h(ie,ne),ne=mm(ae,ie.mode,Be),ne.return=ie,ie=ne),P(ie)):h(ie,ne)}return pn}var rl=XC(!0),KC=XC(!1),Rc={},Sr=Ps(Rc),bc=Ps(Rc),Lc=Ps(Rc);function Bo(s){if(s===Rc)throw Error(t(174));return s}function Pg(s,a){switch(Yt(Lc,a),Yt(bc,s),Yt(Sr,Rc),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:me(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=me(a,s)}Zt(Sr),Yt(Sr,a)}function sl(){Zt(Sr),Zt(bc),Zt(Lc)}function JC(s){Bo(Lc.current);var a=Bo(Sr.current),h=me(a,s.type);a!==h&&(Yt(bc,s),Yt(Sr,h))}function Ug(s){bc.current===s&&(Zt(Sr),Zt(bc))}var rn=Ps(0);function sh(s){for(var a=s;a!==null;){if(a.tag===13){var h=a.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var kg=[];function Fg(){for(var s=0;s<kg.length;s++)kg[s]._workInProgressVersionPrimary=null;kg.length=0}var oh=x.ReactCurrentDispatcher,Qg=x.ReactCurrentBatchConfig,Ro=0,sn=null,Sn=null,Nn=null,ah=!1,Dc=!1,Nc=0,x6=0;function Yn(){throw Error(t(321))}function Og(s,a){if(a===null)return!1;for(var h=0;h<a.length&&h<s.length;h++)if(!rr(s[h],a[h]))return!1;return!0}function zg(s,a,h,m,I,M){if(Ro=M,sn=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,oh.current=s===null||s.memoizedState===null?T6:B6,s=h(m,I),Dc){M=0;do{if(Dc=!1,Nc=0,25<=M)throw Error(t(301));M+=1,Nn=Sn=null,a.updateQueue=null,oh.current=R6,s=h(m,I)}while(Dc)}if(oh.current=uh,a=Sn!==null&&Sn.next!==null,Ro=0,Nn=Sn=sn=null,ah=!1,a)throw Error(t(300));return s}function Gg(){var s=Nc!==0;return Nc=0,s}function wr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?sn.memoizedState=Nn=s:Nn=Nn.next=s,Nn}function Hi(){if(Sn===null){var s=sn.alternate;s=s!==null?s.memoizedState:null}else s=Sn.next;var a=Nn===null?sn.memoizedState:Nn.next;if(a!==null)Nn=a,Sn=s;else{if(s===null)throw Error(t(310));Sn=s,s={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},Nn===null?sn.memoizedState=Nn=s:Nn=Nn.next=s}return Nn}function Pc(s,a){return typeof a=="function"?a(s):a}function Hg(s){var a=Hi(),h=a.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=s;var m=Sn,I=m.baseQueue,M=h.pending;if(M!==null){if(I!==null){var P=I.next;I.next=M.next,M.next=P}m.baseQueue=I=M,h.pending=null}if(I!==null){M=I.next,m=m.baseState;var W=P=null,Z=null,le=M;do{var Ee=le.lane;if((Ro&Ee)===Ee)Z!==null&&(Z=Z.next={lane:0,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),m=le.hasEagerState?le.eagerState:s(m,le.action);else{var Ie={lane:Ee,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null};Z===null?(W=Z=Ie,P=m):Z=Z.next=Ie,sn.lanes|=Ee,bo|=Ee}le=le.next}while(le!==null&&le!==M);Z===null?P=m:Z.next=W,rr(m,a.memoizedState)||(gi=!0),a.memoizedState=m,a.baseState=P,a.baseQueue=Z,h.lastRenderedState=m}if(s=h.interleaved,s!==null){I=s;do M=I.lane,sn.lanes|=M,bo|=M,I=I.next;while(I!==s)}else I===null&&(h.lanes=0);return[a.memoizedState,h.dispatch]}function Vg(s){var a=Hi(),h=a.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=s;var m=h.dispatch,I=h.pending,M=a.memoizedState;if(I!==null){h.pending=null;var P=I=I.next;do M=s(M,P.action),P=P.next;while(P!==I);rr(M,a.memoizedState)||(gi=!0),a.memoizedState=M,a.baseQueue===null&&(a.baseState=M),h.lastRenderedState=M}return[M,m]}function ZC(){}function $C(s,a){var h=sn,m=Hi(),I=a(),M=!rr(m.memoizedState,I);if(M&&(m.memoizedState=I,gi=!0),m=m.queue,Wg(nI.bind(null,h,m,s),[s]),m.getSnapshot!==a||M||Nn!==null&&Nn.memoizedState.tag&1){if(h.flags|=2048,Uc(9,tI.bind(null,h,m,I,a),void 0,null),Pn===null)throw Error(t(349));Ro&30||eI(h,a,I)}return I}function eI(s,a,h){s.flags|=16384,s={getSnapshot:a,value:h},a=sn.updateQueue,a===null?(a={lastEffect:null,stores:null},sn.updateQueue=a,a.stores=[s]):(h=a.stores,h===null?a.stores=[s]:h.push(s))}function tI(s,a,h,m){a.value=h,a.getSnapshot=m,iI(a)&&rI(s)}function nI(s,a,h){return h(function(){iI(a)&&rI(s)})}function iI(s){var a=s.getSnapshot;s=s.value;try{var h=a();return!rr(s,h)}catch{return!0}}function rI(s){var a=ns(s,1);a!==null&&cr(a,s,1,-1)}function sI(s){var a=wr();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pc,lastRenderedState:s},a.queue=s,s=s.dispatch=M6.bind(null,sn,s),[a.memoizedState,s]}function Uc(s,a,h,m){return s={tag:s,create:a,destroy:h,deps:m,next:null},a=sn.updateQueue,a===null?(a={lastEffect:null,stores:null},sn.updateQueue=a,a.lastEffect=s.next=s):(h=a.lastEffect,h===null?a.lastEffect=s.next=s:(m=h.next,h.next=s,s.next=m,a.lastEffect=s)),s}function oI(){return Hi().memoizedState}function lh(s,a,h,m){var I=wr();sn.flags|=s,I.memoizedState=Uc(1|a,h,void 0,m===void 0?null:m)}function ch(s,a,h,m){var I=Hi();m=m===void 0?null:m;var M=void 0;if(Sn!==null){var P=Sn.memoizedState;if(M=P.destroy,m!==null&&Og(m,P.deps)){I.memoizedState=Uc(a,h,M,m);return}}sn.flags|=s,I.memoizedState=Uc(1|a,h,M,m)}function aI(s,a){return lh(8390656,8,s,a)}function Wg(s,a){return ch(2048,8,s,a)}function lI(s,a){return ch(4,2,s,a)}function cI(s,a){return ch(4,4,s,a)}function uI(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function fI(s,a,h){return h=h!=null?h.concat([s]):null,ch(4,4,uI.bind(null,a,s),h)}function jg(){}function hI(s,a){var h=Hi();a=a===void 0?null:a;var m=h.memoizedState;return m!==null&&a!==null&&Og(a,m[1])?m[0]:(h.memoizedState=[s,a],s)}function dI(s,a){var h=Hi();a=a===void 0?null:a;var m=h.memoizedState;return m!==null&&a!==null&&Og(a,m[1])?m[0]:(s=s(),h.memoizedState=[s,a],s)}function AI(s,a,h){return Ro&21?(rr(h,a)||(h=Rf(),sn.lanes|=h,bo|=h,s.baseState=!0),a):(s.baseState&&(s.baseState=!1,gi=!0),s.memoizedState=h)}function S6(s,a){var h=kt;kt=h!==0&&4>h?h:4,s(!0);var m=Qg.transition;Qg.transition={};try{s(!1),a()}finally{kt=h,Qg.transition=m}}function pI(){return Hi().memoizedState}function w6(s,a,h){var m=Hs(s);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},gI(s))mI(a,h);else if(h=OC(s,a,h,m),h!==null){var I=ai();cr(h,s,m,I),vI(h,a,m)}}function M6(s,a,h){var m=Hs(s),I={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(gI(s))mI(a,I);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=a.lastRenderedReducer,M!==null))try{var P=a.lastRenderedState,W=M(P,h);if(I.hasEagerState=!0,I.eagerState=W,rr(W,P)){var Z=a.interleaved;Z===null?(I.next=I,bg(a)):(I.next=Z.next,Z.next=I),a.interleaved=I;return}}catch{}finally{}h=OC(s,a,I,m),h!==null&&(I=ai(),cr(h,s,m,I),vI(h,a,m))}}function gI(s){var a=s.alternate;return s===sn||a!==null&&a===sn}function mI(s,a){Dc=ah=!0;var h=s.pending;h===null?a.next=a:(a.next=h.next,h.next=a),s.pending=a}function vI(s,a,h){if(h&4194240){var m=a.lanes;m&=s.pendingLanes,h|=m,a.lanes=h,jp(s,h)}}var uh={readContext:Gi,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},T6={readContext:Gi,useCallback:function(s,a){return wr().memoizedState=[s,a===void 0?null:a],s},useContext:Gi,useEffect:aI,useImperativeHandle:function(s,a,h){return h=h!=null?h.concat([s]):null,lh(4194308,4,uI.bind(null,a,s),h)},useLayoutEffect:function(s,a){return lh(4194308,4,s,a)},useInsertionEffect:function(s,a){return lh(4,2,s,a)},useMemo:function(s,a){var h=wr();return a=a===void 0?null:a,s=s(),h.memoizedState=[s,a],s},useReducer:function(s,a,h){var m=wr();return a=h!==void 0?h(a):a,m.memoizedState=m.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},m.queue=s,s=s.dispatch=w6.bind(null,sn,s),[m.memoizedState,s]},useRef:function(s){var a=wr();return s={current:s},a.memoizedState=s},useState:sI,useDebugValue:jg,useDeferredValue:function(s){return wr().memoizedState=s},useTransition:function(){var s=sI(!1),a=s[0];return s=S6.bind(null,s[1]),wr().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,h){var m=sn,I=wr();if(en){if(h===void 0)throw Error(t(407));h=h()}else{if(h=a(),Pn===null)throw Error(t(349));Ro&30||eI(m,a,h)}I.memoizedState=h;var M={value:h,getSnapshot:a};return I.queue=M,aI(nI.bind(null,m,M,s),[s]),m.flags|=2048,Uc(9,tI.bind(null,m,M,h,a),void 0,null),h},useId:function(){var s=wr(),a=Pn.identifierPrefix;if(en){var h=ts,m=es;h=(m&~(1<<32-ri(m)-1)).toString(32)+h,a=":"+a+"R"+h,h=Nc++,0<h&&(a+="H"+h.toString(32)),a+=":"}else h=x6++,a=":"+a+"r"+h.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},B6={readContext:Gi,useCallback:hI,useContext:Gi,useEffect:Wg,useImperativeHandle:fI,useInsertionEffect:lI,useLayoutEffect:cI,useMemo:dI,useReducer:Hg,useRef:oI,useState:function(){return Hg(Pc)},useDebugValue:jg,useDeferredValue:function(s){var a=Hi();return AI(a,Sn.memoizedState,s)},useTransition:function(){var s=Hg(Pc)[0],a=Hi().memoizedState;return[s,a]},useMutableSource:ZC,useSyncExternalStore:$C,useId:pI,unstable_isNewReconciler:!1},R6={readContext:Gi,useCallback:hI,useContext:Gi,useEffect:Wg,useImperativeHandle:fI,useInsertionEffect:lI,useLayoutEffect:cI,useMemo:dI,useReducer:Vg,useRef:oI,useState:function(){return Vg(Pc)},useDebugValue:jg,useDeferredValue:function(s){var a=Hi();return Sn===null?a.memoizedState=s:AI(a,Sn.memoizedState,s)},useTransition:function(){var s=Vg(Pc)[0],a=Hi().memoizedState;return[s,a]},useMutableSource:ZC,useSyncExternalStore:$C,useId:pI,unstable_isNewReconciler:!1};function ol(s,a){try{var h="",m=a;do h+=Ae(m),m=m.return;while(m);var I=h}catch(M){I=`
4252
+ `),P=I.length-1,W=M.length-1;1<=P&&0<=W&&I[P]!==M[W];)W--;for(;1<=P&&0<=W;P--,W--)if(I[P]!==M[W]){if(P!==1||W!==1)do if(P--,W--,0>W||I[P]!==M[W]){var $=`
4253
+ `+I[P].replace(" at new "," at ");return s.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",s.displayName)),$}while(1<=P&&0<=W);break}}}finally{K=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?G(s):""}function Ae(s){switch(s.tag){case 5:return G(s.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return s=J(s.type,!1),s;case 11:return s=J(s.type.render,!1),s;case 1:return s=J(s.type,!0),s;default:return""}}function ge(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case B:return"Fragment";case b:return"Portal";case R:return"Profiler";case L:return"StrictMode";case O:return"Suspense";case F:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case N:return(s.displayName||"Context")+".Consumer";case T:return(s._context.displayName||"Context")+".Provider";case k:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case V:return a=s.displayName||null,a!==null?a:ge(s.type)||"Memo";case X:a=s._payload,s=s._init;try{return ge(s(a))}catch{}}return null}function be(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(a);case 8:return a===L?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function de(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Oe(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function It(s){var a=Oe(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),m=""+s[a];if(!s.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var I=h.get,M=h.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return I.call(this)},set:function(P){m=""+P,M.call(this,P)}}),Object.defineProperty(s,a,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(P){m=""+P},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function st(s){s._valueTracker||(s._valueTracker=It(s))}function oe(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var h=a.getValue(),m="";return s&&(m=Oe(s)?s.checked?"true":"false":s.value),s=m,s!==h?(a.setValue(s),!0):!1}function Mt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ne(s,a){var h=a.checked;return U({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function $e(s,a){var h=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;h=de(a.value!=null?a.value:h),s._wrapperState={initialChecked:m,initialValue:h,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function Ee(s,a){a=a.checked,a!=null&&y(s,"checked",a,!1)}function nt(s,a){Ee(s,a);var h=de(a.value),m=a.type;if(h!=null)m==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?He(s,a.type,h):a.hasOwnProperty("defaultValue")&&He(s,a.type,de(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function Ue(s,a,h){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var m=a.type;if(!(m!=="submit"&&m!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,h||a===s.value||(s.value=a),s.defaultValue=a}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function He(s,a,h){(a!=="number"||Mt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var ot=Array.isArray;function ut(s,a,h,m){if(s=s.options,a){a={};for(var I=0;I<h.length;I++)a["$"+h[I]]=!0;for(h=0;h<s.length;h++)I=a.hasOwnProperty("$"+s[h].value),s[h].selected!==I&&(s[h].selected=I),I&&m&&(s[h].defaultSelected=!0)}else{for(h=""+de(h),a=null,I=0;I<s.length;I++){if(s[I].value===h){s[I].selected=!0,m&&(s[I].defaultSelected=!0);return}a!==null||s[I].disabled||(a=s[I])}a!==null&&(a.selected=!0)}}function At(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(t(91));return U({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function H(s,a){var h=a.value;if(h==null){if(h=a.children,a=a.defaultValue,h!=null){if(a!=null)throw Error(t(92));if(ot(h)){if(1<h.length)throw Error(t(93));h=h[0]}a=h}a==null&&(a=""),h=a}s._wrapperState={initialValue:de(h)}}function Q(s,a){var h=de(a.value),m=de(a.defaultValue);h!=null&&(h=""+h,h!==s.value&&(s.value=h),a.defaultValue==null&&s.defaultValue!==h&&(s.defaultValue=h)),m!=null&&(s.defaultValue=""+m)}function se(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function Ce(s){switch(s){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 me(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?Ce(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var xe,We=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,h,m,I){MSApp.execUnsafeLocalFunction(function(){return s(a,h,m,I)})}:s}(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(xe=xe||document.createElement("div"),xe.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=xe.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function Se(s,a){if(a){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=a;return}}s.textContent=a}var Re={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},Y=["Webkit","ms","Moz","O"];Object.keys(Re).forEach(function(s){Y.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Re[a]=Re[s]})});function Me(s,a,h){return a==null||typeof a=="boolean"||a===""?"":h||typeof a!="number"||a===0||Re.hasOwnProperty(s)&&Re[s]?(""+a).trim():a+"px"}function pe(s,a){s=s.style;for(var h in a)if(a.hasOwnProperty(h)){var m=h.indexOf("--")===0,I=Me(h,a[h],m);h==="float"&&(h="cssFloat"),m?s.setProperty(h,I):s[h]=I}}var tt=U({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 je(s,a){if(a){if(tt[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(t(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(t(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(t(61))}if(a.style!=null&&typeof a.style!="object")throw Error(t(62))}}function Je(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){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 Ge=null;function Pe(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var dt=null,ee=null,Te=null;function ye(s){if(s=Tc(s)){if(typeof dt!="function")throw Error(t(280));var a=s.stateNode;a&&(a=jf(a),dt(s.stateNode,s.type,a))}}function he(s){ee?Te?Te.push(s):Te=[s]:ee=s}function we(){if(ee){var s=ee,a=Te;if(Te=ee=null,ye(s),a)for(s=0;s<a.length;s++)ye(a[s])}}function qe(s,a){return s(a)}function pt(){}var Wt=!1;function Dn(s,a,h){if(Wt)return s(a,h);Wt=!0;try{return qe(s,a,h)}finally{Wt=!1,(ee!==null||Te!==null)&&(pt(),we())}}function Tt(s,a){var h=s.stateNode;if(h===null)return null;var m=jf(h);if(m===null)return null;h=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(t(231,a,typeof h));return h}var an=!1;if(c)try{var Pt={};Object.defineProperty(Pt,"passive",{get:function(){an=!0}}),window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{an=!1}function Ti(s,a,h,m,I,M,P,W,$){var le=Array.prototype.slice.call(arguments,3);try{a.apply(h,le)}catch(_e){this.onError(_e)}}var Cr=!1,ir=null,Co=!1,ws=null,wf={onError:function(s){Cr=!0,ir=s}};function Mf(s,a,h,m,I,M,P,W,$){Cr=!1,ir=null,Ti.apply(wf,arguments)}function Wp(s,a,h,m,I,M,P,W,$){if(Mf.apply(this,arguments),Cr){if(Cr){var le=ir;Cr=!1,ir=null}else throw Error(t(198));Co||(Co=!0,ws=le)}}function Kr(s){var a=s,h=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,a.flags&4098&&(h=a.return),s=a.return;while(s)}return a.tag===3?h:null}function Tf(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function z(s){if(Kr(s)!==s)throw Error(t(188))}function re(s){var a=s.alternate;if(!a){if(a=Kr(s),a===null)throw Error(t(188));return a!==s?null:s}for(var h=s,m=a;;){var I=h.return;if(I===null)break;var M=I.alternate;if(M===null){if(m=I.return,m!==null){h=m;continue}break}if(I.child===M.child){for(M=I.child;M;){if(M===h)return z(I),s;if(M===m)return z(I),a;M=M.sibling}throw Error(t(188))}if(h.return!==m.return)h=I,m=M;else{for(var P=!1,W=I.child;W;){if(W===h){P=!0,h=I,m=M;break}if(W===m){P=!0,m=I,h=M;break}W=W.sibling}if(!P){for(W=M.child;W;){if(W===h){P=!0,h=M,m=I;break}if(W===m){P=!0,m=M,h=I;break}W=W.sibling}if(!P)throw Error(t(189))}}if(h.alternate!==m)throw Error(t(190))}if(h.tag!==3)throw Error(t(188));return h.stateNode.current===h?s:a}function ce(s){return s=re(s),s!==null?ue(s):null}function ue(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=ue(s);if(a!==null)return a;s=s.sibling}return null}var fe=e.unstable_scheduleCallback,ke=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,at=e.unstable_requestPaint,Qe=e.unstable_now,gt=e.unstable_getCurrentPriorityLevel,ft=e.unstable_ImmediatePriority,ht=e.unstable_UserBlockingPriority,jt=e.unstable_NormalPriority,ii=e.unstable_LowPriority,dn=e.unstable_IdlePriority,di=null,Bt=null;function Et(s){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(di,s,void 0,(s.current.flags&128)===128)}catch{}}var ri=Math.clz32?Math.clz32:Bf,ln=Math.log,Jr=Math.LN2;function Bf(s){return s>>>=0,s===0?32:31-(ln(s)/Jr|0)|0}var Ir=64,Ms=4194304;function An(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Qi(s,a){var h=s.pendingLanes;if(h===0)return 0;var m=0,I=s.suspendedLanes,M=s.pingedLanes,P=h&268435455;if(P!==0){var W=P&~I;W!==0?m=An(W):(M&=P,M!==0&&(m=An(M)))}else P=h&~I,P!==0?m=An(P):M!==0&&(m=An(M));if(m===0)return 0;if(a!==0&&a!==m&&!(a&I)&&(I=m&-m,M=a&-a,I>=M||I===16&&(M&4194240)!==0))return a;if(m&4&&(m|=h&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=m;0<a;)h=31-ri(a),I=1<<h,m|=s[h],a&=~I;return m}function uc(s,a){switch(s){case 1:case 2:case 4:return a+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 a+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 si(s,a){for(var h=s.suspendedLanes,m=s.pingedLanes,I=s.expirationTimes,M=s.pendingLanes;0<M;){var P=31-ri(M),W=1<<P,$=I[P];$===-1?(!(W&h)||W&m)&&(I[P]=uc(W,a)):$<=a&&(s.expiredLanes|=W),M&=~W}}function Io(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Rf(){var s=Ir;return Ir<<=1,!(Ir&4194240)&&(Ir=64),s}function Ga(s){for(var a=[],h=0;31>h;h++)a.push(s);return a}function fc(s,a,h){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-ri(a),s[a]=h}function xD(s,a){var h=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<h;){var I=31-ri(h),M=1<<I;a[I]=0,m[I]=-1,s[I]=-1,h&=~M}}function jp(s,a){var h=s.entangledLanes|=a;for(s=s.entanglements;h;){var m=31-ri(h),I=1<<m;I&a|s[m]&a&&(s[m]|=a),h&=~I}}var kt=0;function zy(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Gy,Yp,Hy,Vy,Wy,qp=!1,bf=[],Ts=null,Bs=null,Rs=null,hc=new Map,dc=new Map,bs=[],SD="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 jy(s,a){switch(s){case"focusin":case"focusout":Ts=null;break;case"dragenter":case"dragleave":Bs=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":hc.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":dc.delete(a.pointerId)}}function Ac(s,a,h,m,I,M){return s===null||s.nativeEvent!==M?(s={blockedOn:a,domEventName:h,eventSystemFlags:m,nativeEvent:M,targetContainers:[I]},a!==null&&(a=Tc(a),a!==null&&Yp(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,I!==null&&a.indexOf(I)===-1&&a.push(I),s)}function wD(s,a,h,m,I){switch(a){case"focusin":return Ts=Ac(Ts,s,a,h,m,I),!0;case"dragenter":return Bs=Ac(Bs,s,a,h,m,I),!0;case"mouseover":return Rs=Ac(Rs,s,a,h,m,I),!0;case"pointerover":var M=I.pointerId;return hc.set(M,Ac(hc.get(M)||null,s,a,h,m,I)),!0;case"gotpointercapture":return M=I.pointerId,dc.set(M,Ac(dc.get(M)||null,s,a,h,m,I)),!0}return!1}function Yy(s){var a=xo(s.target);if(a!==null){var h=Kr(a);if(h!==null){if(a=h.tag,a===13){if(a=Tf(h),a!==null){s.blockedOn=a,Wy(s.priority,function(){Hy(h)});return}}else if(a===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Lf(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var h=Kp(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(h===null){h=s.nativeEvent;var m=new h.constructor(h.type,h);Ge=m,h.target.dispatchEvent(m),Ge=null}else return a=Tc(h),a!==null&&Yp(a),s.blockedOn=h,!1;a.shift()}return!0}function qy(s,a,h){Lf(s)&&h.delete(a)}function MD(){qp=!1,Ts!==null&&Lf(Ts)&&(Ts=null),Bs!==null&&Lf(Bs)&&(Bs=null),Rs!==null&&Lf(Rs)&&(Rs=null),hc.forEach(qy),dc.forEach(qy)}function pc(s,a){s.blockedOn===a&&(s.blockedOn=null,qp||(qp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MD)))}function gc(s){function a(I){return pc(I,s)}if(0<bf.length){pc(bf[0],s);for(var h=1;h<bf.length;h++){var m=bf[h];m.blockedOn===s&&(m.blockedOn=null)}}for(Ts!==null&&pc(Ts,s),Bs!==null&&pc(Bs,s),Rs!==null&&pc(Rs,s),hc.forEach(a),dc.forEach(a),h=0;h<bs.length;h++)m=bs[h],m.blockedOn===s&&(m.blockedOn=null);for(;0<bs.length&&(h=bs[0],h.blockedOn===null);)Yy(h),h.blockedOn===null&&bs.shift()}var Ha=S.ReactCurrentBatchConfig,Df=!0;function TD(s,a,h,m){var I=kt,M=Ha.transition;Ha.transition=null;try{kt=1,Xp(s,a,h,m)}finally{kt=I,Ha.transition=M}}function BD(s,a,h,m){var I=kt,M=Ha.transition;Ha.transition=null;try{kt=4,Xp(s,a,h,m)}finally{kt=I,Ha.transition=M}}function Xp(s,a,h,m){if(Df){var I=Kp(s,a,h,m);if(I===null)dg(s,a,m,Nf,h),jy(s,m);else if(wD(I,s,a,h,m))m.stopPropagation();else if(jy(s,m),a&4&&-1<SD.indexOf(s)){for(;I!==null;){var M=Tc(I);if(M!==null&&Gy(M),M=Kp(s,a,h,m),M===null&&dg(s,a,m,Nf,h),M===I)break;I=M}I!==null&&m.stopPropagation()}else dg(s,a,m,null,h)}}var Nf=null;function Kp(s,a,h,m){if(Nf=null,s=Pe(m),s=xo(s),s!==null)if(a=Kr(s),a===null)s=null;else if(h=a.tag,h===13){if(s=Tf(a),s!==null)return s;s=null}else if(h===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return Nf=s,null}function Xy(s){switch(s){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(gt()){case ft:return 1;case ht:return 4;case jt:case ii:return 16;case dn:return 536870912;default:return 16}default:return 16}}var Ls=null,Jp=null,Pf=null;function Ky(){if(Pf)return Pf;var s,a=Jp,h=a.length,m,I="value"in Ls?Ls.value:Ls.textContent,M=I.length;for(s=0;s<h&&a[s]===I[s];s++);var P=h-s;for(m=1;m<=P&&a[h-m]===I[M-m];m++);return Pf=I.slice(s,1<m?1-m:void 0)}function Uf(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function kf(){return!0}function Jy(){return!1}function Bi(s){function a(h,m,I,M,P){this._reactName=h,this._targetInst=I,this.type=m,this.nativeEvent=M,this.target=P,this.currentTarget=null;for(var W in s)s.hasOwnProperty(W)&&(h=s[W],this[W]=h?h(M):M[W]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?kf:Jy,this.isPropagationStopped=Jy,this}return U(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=kf)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=kf)},persist:function(){},isPersistent:kf}),a}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$p=Bi(Va),mc=U({},Va,{view:0,detail:0}),RD=Bi(mc),Zp,eg,vc,Ff=U({},mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ng,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==vc&&(vc&&s.type==="mousemove"?(Zp=s.screenX-vc.screenX,eg=s.screenY-vc.screenY):eg=Zp=0,vc=s),Zp)},movementY:function(s){return"movementY"in s?s.movementY:eg}}),$y=Bi(Ff),bD=U({},Ff,{dataTransfer:0}),LD=Bi(bD),DD=U({},mc,{relatedTarget:0}),tg=Bi(DD),ND=U({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),PD=Bi(ND),UD=U({},Va,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),kD=Bi(UD),FD=U({},Va,{data:0}),Zy=Bi(FD),QD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OD={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"},zD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GD(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=zD[s])?!!a[s]:!1}function ng(){return GD}var HD=U({},mc,{key:function(s){if(s.key){var a=QD[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=Uf(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?OD[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ng,charCode:function(s){return s.type==="keypress"?Uf(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Uf(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),VD=Bi(HD),WD=U({},Ff,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eC=Bi(WD),jD=U({},mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ng}),YD=Bi(jD),qD=U({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),XD=Bi(qD),KD=U({},Ff,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),JD=Bi(KD),$D=[9,13,27,32],ig=c&&"CompositionEvent"in window,_c=null;c&&"documentMode"in document&&(_c=document.documentMode);var ZD=c&&"TextEvent"in window&&!_c,tC=c&&(!ig||_c&&8<_c&&11>=_c),nC=String.fromCharCode(32),iC=!1;function rC(s,a){switch(s){case"keyup":return $D.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Wa=!1;function e6(s,a){switch(s){case"compositionend":return sC(a);case"keypress":return a.which!==32?null:(iC=!0,nC);case"textInput":return s=a.data,s===nC&&iC?null:s;default:return null}}function t6(s,a){if(Wa)return s==="compositionend"||!ig&&rC(s,a)?(s=Ky(),Pf=Jp=Ls=null,Wa=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return tC&&a.locale!=="ko"?null:a.data;default:return null}}var n6={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 oC(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!n6[s.type]:a==="textarea"}function aC(s,a,h,m){he(m),a=Hf(a,"onChange"),0<a.length&&(h=new $p("onChange","change",null,h,m),s.push({event:h,listeners:a}))}var Ec=null,yc=null;function i6(s){SC(s,0)}function Qf(s){var a=Ka(s);if(oe(a))return s}function r6(s,a){if(s==="change")return a}var lC=!1;if(c){var rg;if(c){var sg="oninput"in document;if(!sg){var cC=document.createElement("div");cC.setAttribute("oninput","return;"),sg=typeof cC.oninput=="function"}rg=sg}else rg=!1;lC=rg&&(!document.documentMode||9<document.documentMode)}function uC(){Ec&&(Ec.detachEvent("onpropertychange",fC),yc=Ec=null)}function fC(s){if(s.propertyName==="value"&&Qf(yc)){var a=[];aC(a,yc,s,Pe(s)),Dn(i6,a)}}function s6(s,a,h){s==="focusin"?(uC(),Ec=a,yc=h,Ec.attachEvent("onpropertychange",fC)):s==="focusout"&&uC()}function o6(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Qf(yc)}function a6(s,a){if(s==="click")return Qf(a)}function l6(s,a){if(s==="input"||s==="change")return Qf(a)}function c6(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var rr=typeof Object.is=="function"?Object.is:c6;function Cc(s,a){if(rr(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var h=Object.keys(s),m=Object.keys(a);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var I=h[m];if(!f.call(a,I)||!rr(s[I],a[I]))return!1}return!0}function hC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function dC(s,a){var h=hC(s);s=0;for(var m;h;){if(h.nodeType===3){if(m=s+h.textContent.length,s<=a&&m>=a)return{node:h,offset:a-s};s=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=hC(h)}}function AC(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?AC(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function pC(){for(var s=window,a=Mt();a instanceof s.HTMLIFrameElement;){try{var h=typeof a.contentWindow.location.href=="string"}catch{h=!1}if(h)s=a.contentWindow;else break;a=Mt(s.document)}return a}function og(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function u6(s){var a=pC(),h=s.focusedElem,m=s.selectionRange;if(a!==h&&h&&h.ownerDocument&&AC(h.ownerDocument.documentElement,h)){if(m!==null&&og(h)){if(a=m.start,s=m.end,s===void 0&&(s=a),"selectionStart"in h)h.selectionStart=a,h.selectionEnd=Math.min(s,h.value.length);else if(s=(a=h.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var I=h.textContent.length,M=Math.min(m.start,I);m=m.end===void 0?M:Math.min(m.end,I),!s.extend&&M>m&&(I=m,m=M,M=I),I=dC(h,M);var P=dC(h,m);I&&P&&(s.rangeCount!==1||s.anchorNode!==I.node||s.anchorOffset!==I.offset||s.focusNode!==P.node||s.focusOffset!==P.offset)&&(a=a.createRange(),a.setStart(I.node,I.offset),s.removeAllRanges(),M>m?(s.addRange(a),s.extend(P.node,P.offset)):(a.setEnd(P.node,P.offset),s.addRange(a)))}}for(a=[],s=h;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<a.length;h++)s=a[h],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var f6=c&&"documentMode"in document&&11>=document.documentMode,ja=null,ag=null,Ic=null,lg=!1;function gC(s,a,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;lg||ja==null||ja!==Mt(m)||(m=ja,"selectionStart"in m&&og(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Ic&&Cc(Ic,m)||(Ic=m,m=Hf(ag,"onSelect"),0<m.length&&(a=new $p("onSelect","select",null,a,h),s.push({event:a,listeners:m}),a.target=ja)))}function Of(s,a){var h={};return h[s.toLowerCase()]=a.toLowerCase(),h["Webkit"+s]="webkit"+a,h["Moz"+s]="moz"+a,h}var Ya={animationend:Of("Animation","AnimationEnd"),animationiteration:Of("Animation","AnimationIteration"),animationstart:Of("Animation","AnimationStart"),transitionend:Of("Transition","TransitionEnd")},cg={},mC={};c&&(mC=document.createElement("div").style,"AnimationEvent"in window||(delete Ya.animationend.animation,delete Ya.animationiteration.animation,delete Ya.animationstart.animation),"TransitionEvent"in window||delete Ya.transitionend.transition);function zf(s){if(cg[s])return cg[s];if(!Ya[s])return s;var a=Ya[s],h;for(h in a)if(a.hasOwnProperty(h)&&h in mC)return cg[s]=a[h];return s}var vC=zf("animationend"),_C=zf("animationiteration"),EC=zf("animationstart"),yC=zf("transitionend"),CC=new Map,IC="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 Ds(s,a){CC.set(s,a),o(a,[s])}for(var ug=0;ug<IC.length;ug++){var fg=IC[ug],h6=fg.toLowerCase(),d6=fg[0].toUpperCase()+fg.slice(1);Ds(h6,"on"+d6)}Ds(vC,"onAnimationEnd"),Ds(_C,"onAnimationIteration"),Ds(EC,"onAnimationStart"),Ds("dblclick","onDoubleClick"),Ds("focusin","onFocus"),Ds("focusout","onBlur"),Ds(yC,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xc="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(" "),A6=new Set("cancel close invalid load scroll toggle".split(" ").concat(xc));function xC(s,a,h){var m=s.type||"unknown-event";s.currentTarget=h,Wp(m,a,void 0,s),s.currentTarget=null}function SC(s,a){a=(a&4)!==0;for(var h=0;h<s.length;h++){var m=s[h],I=m.event;m=m.listeners;e:{var M=void 0;if(a)for(var P=m.length-1;0<=P;P--){var W=m[P],$=W.instance,le=W.currentTarget;if(W=W.listener,$!==M&&I.isPropagationStopped())break e;xC(I,W,le),M=$}else for(P=0;P<m.length;P++){if(W=m[P],$=W.instance,le=W.currentTarget,W=W.listener,$!==M&&I.isPropagationStopped())break e;xC(I,W,le),M=$}}}if(Co)throw s=ws,Co=!1,ws=null,s}function Jt(s,a){var h=a[_g];h===void 0&&(h=a[_g]=new Set);var m=s+"__bubble";h.has(m)||(wC(a,s,2,!1),h.add(m))}function hg(s,a,h){var m=0;a&&(m|=4),wC(h,s,m,a)}var Gf="_reactListening"+Math.random().toString(36).slice(2);function Sc(s){if(!s[Gf]){s[Gf]=!0,n.forEach(function(h){h!=="selectionchange"&&(A6.has(h)||hg(h,!1,s),hg(h,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Gf]||(a[Gf]=!0,hg("selectionchange",!1,a))}}function wC(s,a,h,m){switch(Xy(a)){case 1:var I=TD;break;case 4:I=BD;break;default:I=Xp}h=I.bind(null,a,h,s),I=void 0,!an||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(I=!0),m?I!==void 0?s.addEventListener(a,h,{capture:!0,passive:I}):s.addEventListener(a,h,!0):I!==void 0?s.addEventListener(a,h,{passive:I}):s.addEventListener(a,h,!1)}function dg(s,a,h,m,I){var M=m;if(!(a&1)&&!(a&2)&&m!==null)e:for(;;){if(m===null)return;var P=m.tag;if(P===3||P===4){var W=m.stateNode.containerInfo;if(W===I||W.nodeType===8&&W.parentNode===I)break;if(P===4)for(P=m.return;P!==null;){var $=P.tag;if(($===3||$===4)&&($=P.stateNode.containerInfo,$===I||$.nodeType===8&&$.parentNode===I))return;P=P.return}for(;W!==null;){if(P=xo(W),P===null)return;if($=P.tag,$===5||$===6){m=M=P;continue e}W=W.parentNode}}m=m.return}Dn(function(){var le=M,_e=Pe(h),Ie=[];e:{var ve=CC.get(s);if(ve!==void 0){var Fe=$p,Ve=s;switch(s){case"keypress":if(Uf(h)===0)break e;case"keydown":case"keyup":Fe=VD;break;case"focusin":Ve="focus",Fe=tg;break;case"focusout":Ve="blur",Fe=tg;break;case"beforeblur":case"afterblur":Fe=tg;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=$y;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=LD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=YD;break;case vC:case _C:case EC:Fe=PD;break;case yC:Fe=XD;break;case"scroll":Fe=RD;break;case"wheel":Fe=JD;break;case"copy":case"cut":case"paste":Fe=kD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=eC}var Ye=(a&4)!==0,pn=!Ye&&s==="scroll",ie=Ye?ve!==null?ve+"Capture":null:ve;Ye=[];for(var ne=le,ae;ne!==null;){ae=ne;var Be=ae.stateNode;if(ae.tag===5&&Be!==null&&(ae=Be,ie!==null&&(Be=Tt(ne,ie),Be!=null&&Ye.push(wc(ne,Be,ae)))),pn)break;ne=ne.return}0<Ye.length&&(ve=new Fe(ve,Ve,null,h,_e),Ie.push({event:ve,listeners:Ye}))}}if(!(a&7)){e:{if(ve=s==="mouseover"||s==="pointerover",Fe=s==="mouseout"||s==="pointerout",ve&&h!==Ge&&(Ve=h.relatedTarget||h.fromElement)&&(xo(Ve)||Ve[$r]))break e;if((Fe||ve)&&(ve=_e.window===_e?_e:(ve=_e.ownerDocument)?ve.defaultView||ve.parentWindow:window,Fe?(Ve=h.relatedTarget||h.toElement,Fe=le,Ve=Ve?xo(Ve):null,Ve!==null&&(pn=Kr(Ve),Ve!==pn||Ve.tag!==5&&Ve.tag!==6)&&(Ve=null)):(Fe=null,Ve=le),Fe!==Ve)){if(Ye=$y,Be="onMouseLeave",ie="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=eC,Be="onPointerLeave",ie="onPointerEnter",ne="pointer"),pn=Fe==null?ve:Ka(Fe),ae=Ve==null?ve:Ka(Ve),ve=new Ye(Be,ne+"leave",Fe,h,_e),ve.target=pn,ve.relatedTarget=ae,Be=null,xo(_e)===le&&(Ye=new Ye(ie,ne+"enter",Ve,h,_e),Ye.target=ae,Ye.relatedTarget=pn,Be=Ye),pn=Be,Fe&&Ve)t:{for(Ye=Fe,ie=Ve,ne=0,ae=Ye;ae;ae=qa(ae))ne++;for(ae=0,Be=ie;Be;Be=qa(Be))ae++;for(;0<ne-ae;)Ye=qa(Ye),ne--;for(;0<ae-ne;)ie=qa(ie),ae--;for(;ne--;){if(Ye===ie||ie!==null&&Ye===ie.alternate)break t;Ye=qa(Ye),ie=qa(ie)}Ye=null}else Ye=null;Fe!==null&&MC(Ie,ve,Fe,Ye,!1),Ve!==null&&pn!==null&&MC(Ie,pn,Ve,Ye,!0)}}e:{if(ve=le?Ka(le):window,Fe=ve.nodeName&&ve.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ve.type==="file")var Xe=r6;else if(oC(ve))if(lC)Xe=l6;else{Xe=o6;var it=s6}else(Fe=ve.nodeName)&&Fe.toLowerCase()==="input"&&(ve.type==="checkbox"||ve.type==="radio")&&(Xe=a6);if(Xe&&(Xe=Xe(s,le))){aC(Ie,Xe,h,_e);break e}it&&it(s,ve,le),s==="focusout"&&(it=ve._wrapperState)&&it.controlled&&ve.type==="number"&&He(ve,"number",ve.value)}switch(it=le?Ka(le):window,s){case"focusin":(oC(it)||it.contentEditable==="true")&&(ja=it,ag=le,Ic=null);break;case"focusout":Ic=ag=ja=null;break;case"mousedown":lg=!0;break;case"contextmenu":case"mouseup":case"dragend":lg=!1,gC(Ie,h,_e);break;case"selectionchange":if(f6)break;case"keydown":case"keyup":gC(Ie,h,_e)}var rt;if(ig)e:{switch(s){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Wa?rC(s,h)&&(ct="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(ct="onCompositionStart");ct&&(tC&&h.locale!=="ko"&&(Wa||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Wa&&(rt=Ky()):(Ls=_e,Jp="value"in Ls?Ls.value:Ls.textContent,Wa=!0)),it=Hf(le,ct),0<it.length&&(ct=new Zy(ct,s,null,h,_e),Ie.push({event:ct,listeners:it}),rt?ct.data=rt:(rt=sC(h),rt!==null&&(ct.data=rt)))),(rt=ZD?e6(s,h):t6(s,h))&&(le=Hf(le,"onBeforeInput"),0<le.length&&(_e=new Zy("onBeforeInput","beforeinput",null,h,_e),Ie.push({event:_e,listeners:le}),_e.data=rt))}SC(Ie,a)})}function wc(s,a,h){return{instance:s,listener:a,currentTarget:h}}function Hf(s,a){for(var h=a+"Capture",m=[];s!==null;){var I=s,M=I.stateNode;I.tag===5&&M!==null&&(I=M,M=Tt(s,h),M!=null&&m.unshift(wc(s,M,I)),M=Tt(s,a),M!=null&&m.push(wc(s,M,I))),s=s.return}return m}function qa(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function MC(s,a,h,m,I){for(var M=a._reactName,P=[];h!==null&&h!==m;){var W=h,$=W.alternate,le=W.stateNode;if($!==null&&$===m)break;W.tag===5&&le!==null&&(W=le,I?($=Tt(h,M),$!=null&&P.unshift(wc(h,$,W))):I||($=Tt(h,M),$!=null&&P.push(wc(h,$,W)))),h=h.return}P.length!==0&&s.push({event:a,listeners:P})}var p6=/\r\n?/g,g6=/\u0000|\uFFFD/g;function TC(s){return(typeof s=="string"?s:""+s).replace(p6,`
4254
+ `).replace(g6,"")}function Vf(s,a,h){if(a=TC(a),TC(s)!==a&&h)throw Error(t(425))}function Wf(){}var Ag=null,pg=null;function gg(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var mg=typeof setTimeout=="function"?setTimeout:void 0,m6=typeof clearTimeout=="function"?clearTimeout:void 0,BC=typeof Promise=="function"?Promise:void 0,v6=typeof queueMicrotask=="function"?queueMicrotask:typeof BC<"u"?function(s){return BC.resolve(null).then(s).catch(_6)}:mg;function _6(s){setTimeout(function(){throw s})}function vg(s,a){var h=a,m=0;do{var I=h.nextSibling;if(s.removeChild(h),I&&I.nodeType===8)if(h=I.data,h==="/$"){if(m===0){s.removeChild(I),gc(a);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=I}while(h);gc(a)}function Ns(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function RC(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"){if(a===0)return s;a--}else h==="/$"&&a++}s=s.previousSibling}return null}var Xa=Math.random().toString(36).slice(2),xr="__reactFiber$"+Xa,Mc="__reactProps$"+Xa,$r="__reactContainer$"+Xa,_g="__reactEvents$"+Xa,E6="__reactListeners$"+Xa,y6="__reactHandles$"+Xa;function xo(s){var a=s[xr];if(a)return a;for(var h=s.parentNode;h;){if(a=h[$r]||h[xr]){if(h=a.alternate,a.child!==null||h!==null&&h.child!==null)for(s=RC(s);s!==null;){if(h=s[xr])return h;s=RC(s)}return a}s=h,h=s.parentNode}return null}function Tc(s){return s=s[xr]||s[$r],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Ka(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(t(33))}function jf(s){return s[Mc]||null}var Eg=[],Ja=-1;function Ps(s){return{current:s}}function $t(s){0>Ja||(s.current=Eg[Ja],Eg[Ja]=null,Ja--)}function Yt(s,a){Ja++,Eg[Ja]=s.current,s.current=a}var Us={},jn=Ps(Us),Ai=Ps(!1),So=Us;function $a(s,a){var h=s.type.contextTypes;if(!h)return Us;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var I={},M;for(M in h)I[M]=a[M];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=I),I}function pi(s){return s=s.childContextTypes,s!=null}function Yf(){$t(Ai),$t(jn)}function bC(s,a,h){if(jn.current!==Us)throw Error(t(168));Yt(jn,a),Yt(Ai,h)}function LC(s,a,h){var m=s.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var I in m)if(!(I in a))throw Error(t(108,be(s)||"Unknown",I));return U({},h,m)}function qf(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Us,So=jn.current,Yt(jn,s),Yt(Ai,Ai.current),!0}function DC(s,a,h){var m=s.stateNode;if(!m)throw Error(t(169));h?(s=LC(s,a,So),m.__reactInternalMemoizedMergedChildContext=s,$t(Ai),$t(jn),Yt(jn,s)):$t(Ai),Yt(Ai,h)}var Zr=null,Xf=!1,yg=!1;function NC(s){Zr===null?Zr=[s]:Zr.push(s)}function C6(s){Xf=!0,NC(s)}function ks(){if(!yg&&Zr!==null){yg=!0;var s=0,a=kt;try{var h=Zr;for(kt=1;s<h.length;s++){var m=h[s];do m=m(!0);while(m!==null)}Zr=null,Xf=!1}catch(I){throw Zr!==null&&(Zr=Zr.slice(s+1)),fe(ft,ks),I}finally{kt=a,yg=!1}}return null}var Za=[],el=0,Kf=null,Jf=0,Oi=[],zi=0,wo=null,es=1,ts="";function Mo(s,a){Za[el++]=Jf,Za[el++]=Kf,Kf=s,Jf=a}function PC(s,a,h){Oi[zi++]=es,Oi[zi++]=ts,Oi[zi++]=wo,wo=s;var m=es;s=ts;var I=32-ri(m)-1;m&=~(1<<I),h+=1;var M=32-ri(a)+I;if(30<M){var P=I-I%5;M=(m&(1<<P)-1).toString(32),m>>=P,I-=P,es=1<<32-ri(a)+I|h<<I|m,ts=M+s}else es=1<<M|h<<I|m,ts=s}function Cg(s){s.return!==null&&(Mo(s,1),PC(s,1,0))}function Ig(s){for(;s===Kf;)Kf=Za[--el],Za[el]=null,Jf=Za[--el],Za[el]=null;for(;s===wo;)wo=Oi[--zi],Oi[zi]=null,ts=Oi[--zi],Oi[zi]=null,es=Oi[--zi],Oi[zi]=null}var Ri=null,bi=null,en=!1,sr=null;function UC(s,a){var h=Wi(5,null,null,0);h.elementType="DELETED",h.stateNode=a,h.return=s,a=s.deletions,a===null?(s.deletions=[h],s.flags|=16):a.push(h)}function kC(s,a){switch(s.tag){case 5:var h=s.type;return a=a.nodeType!==1||h.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,Ri=s,bi=Ns(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,Ri=s,bi=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(h=wo!==null?{id:es,overflow:ts}:null,s.memoizedState={dehydrated:a,treeContext:h,retryLane:1073741824},h=Wi(18,null,null,0),h.stateNode=a,h.return=s,s.child=h,Ri=s,bi=null,!0):!1;default:return!1}}function xg(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Sg(s){if(en){var a=bi;if(a){var h=a;if(!kC(s,a)){if(xg(s))throw Error(t(418));a=Ns(h.nextSibling);var m=Ri;a&&kC(s,a)?UC(m,h):(s.flags=s.flags&-4097|2,en=!1,Ri=s)}}else{if(xg(s))throw Error(t(418));s.flags=s.flags&-4097|2,en=!1,Ri=s}}}function FC(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Ri=s}function $f(s){if(s!==Ri)return!1;if(!en)return FC(s),en=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!gg(s.type,s.memoizedProps)),a&&(a=bi)){if(xg(s))throw QC(),Error(t(418));for(;a;)UC(s,a),a=Ns(a.nextSibling)}if(FC(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(t(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"){if(a===0){bi=Ns(s.nextSibling);break e}a--}else h!=="$"&&h!=="$!"&&h!=="$?"||a++}s=s.nextSibling}bi=null}}else bi=Ri?Ns(s.stateNode.nextSibling):null;return!0}function QC(){for(var s=bi;s;)s=Ns(s.nextSibling)}function tl(){bi=Ri=null,en=!1}function wg(s){sr===null?sr=[s]:sr.push(s)}var I6=S.ReactCurrentBatchConfig;function or(s,a){if(s&&s.defaultProps){a=U({},a),s=s.defaultProps;for(var h in s)a[h]===void 0&&(a[h]=s[h]);return a}return a}var Zf=Ps(null),eh=null,nl=null,Mg=null;function Tg(){Mg=nl=eh=null}function Bg(s){var a=Zf.current;$t(Zf),s._currentValue=a}function Rg(s,a,h){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===h)break;s=s.return}}function il(s,a){eh=s,Mg=nl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&a&&(gi=!0),s.firstContext=null)}function Gi(s){var a=s._currentValue;if(Mg!==s)if(s={context:s,memoizedValue:a,next:null},nl===null){if(eh===null)throw Error(t(308));nl=s,eh.dependencies={lanes:0,firstContext:s}}else nl=nl.next=s;return a}var To=null;function bg(s){To===null?To=[s]:To.push(s)}function OC(s,a,h,m){var I=a.interleaved;return I===null?(h.next=h,bg(a)):(h.next=I.next,I.next=h),a.interleaved=h,ns(s,m)}function ns(s,a){s.lanes|=a;var h=s.alternate;for(h!==null&&(h.lanes|=a),h=s,s=s.return;s!==null;)s.childLanes|=a,h=s.alternate,h!==null&&(h.childLanes|=a),h=s,s=s.return;return h.tag===3?h.stateNode:null}var Fs=!1;function Lg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zC(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function is(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Qs(s,a,h){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,Rt&2){var I=m.pending;return I===null?a.next=a:(a.next=I.next,I.next=a),m.pending=a,ns(s,h)}return I=m.interleaved,I===null?(a.next=a,bg(m)):(a.next=I.next,I.next=a),m.interleaved=a,ns(s,h)}function th(s,a,h){if(a=a.updateQueue,a!==null&&(a=a.shared,(h&4194240)!==0)){var m=a.lanes;m&=s.pendingLanes,h|=m,a.lanes=h,jp(s,h)}}function GC(s,a){var h=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var I=null,M=null;if(h=h.firstBaseUpdate,h!==null){do{var P={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};M===null?I=M=P:M=M.next=P,h=h.next}while(h!==null);M===null?I=M=a:M=M.next=a}else I=M=a;h={baseState:m.baseState,firstBaseUpdate:I,lastBaseUpdate:M,shared:m.shared,effects:m.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=a:s.next=a,h.lastBaseUpdate=a}function nh(s,a,h,m){var I=s.updateQueue;Fs=!1;var M=I.firstBaseUpdate,P=I.lastBaseUpdate,W=I.shared.pending;if(W!==null){I.shared.pending=null;var $=W,le=$.next;$.next=null,P===null?M=le:P.next=le,P=$;var _e=s.alternate;_e!==null&&(_e=_e.updateQueue,W=_e.lastBaseUpdate,W!==P&&(W===null?_e.firstBaseUpdate=le:W.next=le,_e.lastBaseUpdate=$))}if(M!==null){var Ie=I.baseState;P=0,_e=le=$=null,W=M;do{var ve=W.lane,Fe=W.eventTime;if((m&ve)===ve){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Ve=s,Ye=W;switch(ve=a,Fe=h,Ye.tag){case 1:if(Ve=Ye.payload,typeof Ve=="function"){Ie=Ve.call(Fe,Ie,ve);break e}Ie=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=Ye.payload,ve=typeof Ve=="function"?Ve.call(Fe,Ie,ve):Ve,ve==null)break e;Ie=U({},Ie,ve);break e;case 2:Fs=!0}}W.callback!==null&&W.lane!==0&&(s.flags|=64,ve=I.effects,ve===null?I.effects=[W]:ve.push(W))}else Fe={eventTime:Fe,lane:ve,tag:W.tag,payload:W.payload,callback:W.callback,next:null},_e===null?(le=_e=Fe,$=Ie):_e=_e.next=Fe,P|=ve;if(W=W.next,W===null){if(W=I.shared.pending,W===null)break;ve=W,W=ve.next,ve.next=null,I.lastBaseUpdate=ve,I.shared.pending=null}}while(1);if(_e===null&&($=Ie),I.baseState=$,I.firstBaseUpdate=le,I.lastBaseUpdate=_e,a=I.shared.interleaved,a!==null){I=a;do P|=I.lane,I=I.next;while(I!==a)}else M===null&&(I.shared.lanes=0);bo|=P,s.lanes=P,s.memoizedState=Ie}}function HC(s,a,h){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var m=s[a],I=m.callback;if(I!==null){if(m.callback=null,m=h,typeof I!="function")throw Error(t(191,I));I.call(m)}}}var VC=new i.Component().refs;function Dg(s,a,h,m){a=s.memoizedState,h=h(m,a),h=h==null?a:U({},a,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var ih={isMounted:function(s){return(s=s._reactInternals)?Kr(s)===s:!1},enqueueSetState:function(s,a,h){s=s._reactInternals;var m=ai(),I=Hs(s),M=is(m,I);M.payload=a,h!=null&&(M.callback=h),a=Qs(s,M,I),a!==null&&(cr(a,s,I,m),th(a,s,I))},enqueueReplaceState:function(s,a,h){s=s._reactInternals;var m=ai(),I=Hs(s),M=is(m,I);M.tag=1,M.payload=a,h!=null&&(M.callback=h),a=Qs(s,M,I),a!==null&&(cr(a,s,I,m),th(a,s,I))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var h=ai(),m=Hs(s),I=is(h,m);I.tag=2,a!=null&&(I.callback=a),a=Qs(s,I,m),a!==null&&(cr(a,s,m,h),th(a,s,m))}};function WC(s,a,h,m,I,M,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,M,P):a.prototype&&a.prototype.isPureReactComponent?!Cc(h,m)||!Cc(I,M):!0}function jC(s,a,h){var m=!1,I=Us,M=a.contextType;return typeof M=="object"&&M!==null?M=Gi(M):(I=pi(a)?So:jn.current,m=a.contextTypes,M=(m=m!=null)?$a(s,I):Us),a=new a(h,M),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ih,s.stateNode=a,a._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=I,s.__reactInternalMemoizedMaskedChildContext=M),a}function YC(s,a,h,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(h,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(h,m),a.state!==s&&ih.enqueueReplaceState(a,a.state,null)}function Ng(s,a,h,m){var I=s.stateNode;I.props=h,I.state=s.memoizedState,I.refs=VC,Lg(s);var M=a.contextType;typeof M=="object"&&M!==null?I.context=Gi(M):(M=pi(a)?So:jn.current,I.context=$a(s,M)),I.state=s.memoizedState,M=a.getDerivedStateFromProps,typeof M=="function"&&(Dg(s,a,M,h),I.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(a=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),a!==I.state&&ih.enqueueReplaceState(I,I.state,null),nh(s,h,I,m),I.state=s.memoizedState),typeof I.componentDidMount=="function"&&(s.flags|=4194308)}function Bc(s,a,h){if(s=h.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(t(309));var m=h.stateNode}if(!m)throw Error(t(147,s));var I=m,M=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===M?a.ref:(a=function(P){var W=I.refs;W===VC&&(W=I.refs={}),P===null?delete W[M]:W[M]=P},a._stringRef=M,a)}if(typeof s!="string")throw Error(t(284));if(!h._owner)throw Error(t(290,s))}return s}function rh(s,a){throw s=Object.prototype.toString.call(a),Error(t(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function qC(s){var a=s._init;return a(s._payload)}function XC(s){function a(ie,ne){if(s){var ae=ie.deletions;ae===null?(ie.deletions=[ne],ie.flags|=16):ae.push(ne)}}function h(ie,ne){if(!s)return null;for(;ne!==null;)a(ie,ne),ne=ne.sibling;return null}function m(ie,ne){for(ie=new Map;ne!==null;)ne.key!==null?ie.set(ne.key,ne):ie.set(ne.index,ne),ne=ne.sibling;return ie}function I(ie,ne){return ie=Ws(ie,ne),ie.index=0,ie.sibling=null,ie}function M(ie,ne,ae){return ie.index=ae,s?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<ne?(ie.flags|=2,ne):ae):(ie.flags|=2,ne)):(ie.flags|=1048576,ne)}function P(ie){return s&&ie.alternate===null&&(ie.flags|=2),ie}function W(ie,ne,ae,Be){return ne===null||ne.tag!==6?(ne=mm(ae,ie.mode,Be),ne.return=ie,ne):(ne=I(ne,ae),ne.return=ie,ne)}function $(ie,ne,ae,Be){var Xe=ae.type;return Xe===B?_e(ie,ne,ae.props.children,Be,ae.key):ne!==null&&(ne.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&qC(Xe)===ne.type)?(Be=I(ne,ae.props),Be.ref=Bc(ie,ne,ae),Be.return=ie,Be):(Be=Ih(ae.type,ae.key,ae.props,null,ie.mode,Be),Be.ref=Bc(ie,ne,ae),Be.return=ie,Be)}function le(ie,ne,ae,Be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ae.containerInfo||ne.stateNode.implementation!==ae.implementation?(ne=vm(ae,ie.mode,Be),ne.return=ie,ne):(ne=I(ne,ae.children||[]),ne.return=ie,ne)}function _e(ie,ne,ae,Be,Xe){return ne===null||ne.tag!==7?(ne=Po(ae,ie.mode,Be,Xe),ne.return=ie,ne):(ne=I(ne,ae),ne.return=ie,ne)}function Ie(ie,ne,ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=mm(""+ne,ie.mode,ae),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ae=Ih(ne.type,ne.key,ne.props,null,ie.mode,ae),ae.ref=Bc(ie,null,ne),ae.return=ie,ae;case b:return ne=vm(ne,ie.mode,ae),ne.return=ie,ne;case X:var Be=ne._init;return Ie(ie,Be(ne._payload),ae)}if(ot(ne)||Z(ne))return ne=Po(ne,ie.mode,ae,null),ne.return=ie,ne;rh(ie,ne)}return null}function ve(ie,ne,ae,Be){var Xe=ne!==null?ne.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return Xe!==null?null:W(ie,ne,""+ae,Be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return ae.key===Xe?$(ie,ne,ae,Be):null;case b:return ae.key===Xe?le(ie,ne,ae,Be):null;case X:return Xe=ae._init,ve(ie,ne,Xe(ae._payload),Be)}if(ot(ae)||Z(ae))return Xe!==null?null:_e(ie,ne,ae,Be,null);rh(ie,ae)}return null}function Fe(ie,ne,ae,Be,Xe){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return ie=ie.get(ae)||null,W(ne,ie,""+Be,Xe);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case w:return ie=ie.get(Be.key===null?ae:Be.key)||null,$(ne,ie,Be,Xe);case b:return ie=ie.get(Be.key===null?ae:Be.key)||null,le(ne,ie,Be,Xe);case X:var it=Be._init;return Fe(ie,ne,ae,it(Be._payload),Xe)}if(ot(Be)||Z(Be))return ie=ie.get(ae)||null,_e(ne,ie,Be,Xe,null);rh(ne,Be)}return null}function Ve(ie,ne,ae,Be){for(var Xe=null,it=null,rt=ne,ct=ne=0,Un=null;rt!==null&&ct<ae.length;ct++){rt.index>ct?(Un=rt,rt=null):Un=rt.sibling;var bt=ve(ie,rt,ae[ct],Be);if(bt===null){rt===null&&(rt=Un);break}s&&rt&&bt.alternate===null&&a(ie,rt),ne=M(bt,ne,ct),it===null?Xe=bt:it.sibling=bt,it=bt,rt=Un}if(ct===ae.length)return h(ie,rt),en&&Mo(ie,ct),Xe;if(rt===null){for(;ct<ae.length;ct++)rt=Ie(ie,ae[ct],Be),rt!==null&&(ne=M(rt,ne,ct),it===null?Xe=rt:it.sibling=rt,it=rt);return en&&Mo(ie,ct),Xe}for(rt=m(ie,rt);ct<ae.length;ct++)Un=Fe(rt,ie,ct,ae[ct],Be),Un!==null&&(s&&Un.alternate!==null&&rt.delete(Un.key===null?ct:Un.key),ne=M(Un,ne,ct),it===null?Xe=Un:it.sibling=Un,it=Un);return s&&rt.forEach(function(js){return a(ie,js)}),en&&Mo(ie,ct),Xe}function Ye(ie,ne,ae,Be){var Xe=Z(ae);if(typeof Xe!="function")throw Error(t(150));if(ae=Xe.call(ae),ae==null)throw Error(t(151));for(var it=Xe=null,rt=ne,ct=ne=0,Un=null,bt=ae.next();rt!==null&&!bt.done;ct++,bt=ae.next()){rt.index>ct?(Un=rt,rt=null):Un=rt.sibling;var js=ve(ie,rt,bt.value,Be);if(js===null){rt===null&&(rt=Un);break}s&&rt&&js.alternate===null&&a(ie,rt),ne=M(js,ne,ct),it===null?Xe=js:it.sibling=js,it=js,rt=Un}if(bt.done)return h(ie,rt),en&&Mo(ie,ct),Xe;if(rt===null){for(;!bt.done;ct++,bt=ae.next())bt=Ie(ie,bt.value,Be),bt!==null&&(ne=M(bt,ne,ct),it===null?Xe=bt:it.sibling=bt,it=bt);return en&&Mo(ie,ct),Xe}for(rt=m(ie,rt);!bt.done;ct++,bt=ae.next())bt=Fe(rt,ie,ct,bt.value,Be),bt!==null&&(s&&bt.alternate!==null&&rt.delete(bt.key===null?ct:bt.key),ne=M(bt,ne,ct),it===null?Xe=bt:it.sibling=bt,it=bt);return s&&rt.forEach(function(nN){return a(ie,nN)}),en&&Mo(ie,ct),Xe}function pn(ie,ne,ae,Be){if(typeof ae=="object"&&ae!==null&&ae.type===B&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:e:{for(var Xe=ae.key,it=ne;it!==null;){if(it.key===Xe){if(Xe=ae.type,Xe===B){if(it.tag===7){h(ie,it.sibling),ne=I(it,ae.props.children),ne.return=ie,ie=ne;break e}}else if(it.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===X&&qC(Xe)===it.type){h(ie,it.sibling),ne=I(it,ae.props),ne.ref=Bc(ie,it,ae),ne.return=ie,ie=ne;break e}h(ie,it);break}else a(ie,it);it=it.sibling}ae.type===B?(ne=Po(ae.props.children,ie.mode,Be,ae.key),ne.return=ie,ie=ne):(Be=Ih(ae.type,ae.key,ae.props,null,ie.mode,Be),Be.ref=Bc(ie,ne,ae),Be.return=ie,ie=Be)}return P(ie);case b:e:{for(it=ae.key;ne!==null;){if(ne.key===it)if(ne.tag===4&&ne.stateNode.containerInfo===ae.containerInfo&&ne.stateNode.implementation===ae.implementation){h(ie,ne.sibling),ne=I(ne,ae.children||[]),ne.return=ie,ie=ne;break e}else{h(ie,ne);break}else a(ie,ne);ne=ne.sibling}ne=vm(ae,ie.mode,Be),ne.return=ie,ie=ne}return P(ie);case X:return it=ae._init,pn(ie,ne,it(ae._payload),Be)}if(ot(ae))return Ve(ie,ne,ae,Be);if(Z(ae))return Ye(ie,ne,ae,Be);rh(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,ne!==null&&ne.tag===6?(h(ie,ne.sibling),ne=I(ne,ae),ne.return=ie,ie=ne):(h(ie,ne),ne=mm(ae,ie.mode,Be),ne.return=ie,ie=ne),P(ie)):h(ie,ne)}return pn}var rl=XC(!0),KC=XC(!1),Rc={},Sr=Ps(Rc),bc=Ps(Rc),Lc=Ps(Rc);function Bo(s){if(s===Rc)throw Error(t(174));return s}function Pg(s,a){switch(Yt(Lc,a),Yt(bc,s),Yt(Sr,Rc),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:me(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=me(a,s)}$t(Sr),Yt(Sr,a)}function sl(){$t(Sr),$t(bc),$t(Lc)}function JC(s){Bo(Lc.current);var a=Bo(Sr.current),h=me(a,s.type);a!==h&&(Yt(bc,s),Yt(Sr,h))}function Ug(s){bc.current===s&&($t(Sr),$t(bc))}var rn=Ps(0);function sh(s){for(var a=s;a!==null;){if(a.tag===13){var h=a.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var kg=[];function Fg(){for(var s=0;s<kg.length;s++)kg[s]._workInProgressVersionPrimary=null;kg.length=0}var oh=S.ReactCurrentDispatcher,Qg=S.ReactCurrentBatchConfig,Ro=0,sn=null,Sn=null,Nn=null,ah=!1,Dc=!1,Nc=0,x6=0;function Yn(){throw Error(t(321))}function Og(s,a){if(a===null)return!1;for(var h=0;h<a.length&&h<s.length;h++)if(!rr(s[h],a[h]))return!1;return!0}function zg(s,a,h,m,I,M){if(Ro=M,sn=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,oh.current=s===null||s.memoizedState===null?T6:B6,s=h(m,I),Dc){M=0;do{if(Dc=!1,Nc=0,25<=M)throw Error(t(301));M+=1,Nn=Sn=null,a.updateQueue=null,oh.current=R6,s=h(m,I)}while(Dc)}if(oh.current=uh,a=Sn!==null&&Sn.next!==null,Ro=0,Nn=Sn=sn=null,ah=!1,a)throw Error(t(300));return s}function Gg(){var s=Nc!==0;return Nc=0,s}function wr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?sn.memoizedState=Nn=s:Nn=Nn.next=s,Nn}function Hi(){if(Sn===null){var s=sn.alternate;s=s!==null?s.memoizedState:null}else s=Sn.next;var a=Nn===null?sn.memoizedState:Nn.next;if(a!==null)Nn=a,Sn=s;else{if(s===null)throw Error(t(310));Sn=s,s={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},Nn===null?sn.memoizedState=Nn=s:Nn=Nn.next=s}return Nn}function Pc(s,a){return typeof a=="function"?a(s):a}function Hg(s){var a=Hi(),h=a.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=s;var m=Sn,I=m.baseQueue,M=h.pending;if(M!==null){if(I!==null){var P=I.next;I.next=M.next,M.next=P}m.baseQueue=I=M,h.pending=null}if(I!==null){M=I.next,m=m.baseState;var W=P=null,$=null,le=M;do{var _e=le.lane;if((Ro&_e)===_e)$!==null&&($=$.next={lane:0,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),m=le.hasEagerState?le.eagerState:s(m,le.action);else{var Ie={lane:_e,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null};$===null?(W=$=Ie,P=m):$=$.next=Ie,sn.lanes|=_e,bo|=_e}le=le.next}while(le!==null&&le!==M);$===null?P=m:$.next=W,rr(m,a.memoizedState)||(gi=!0),a.memoizedState=m,a.baseState=P,a.baseQueue=$,h.lastRenderedState=m}if(s=h.interleaved,s!==null){I=s;do M=I.lane,sn.lanes|=M,bo|=M,I=I.next;while(I!==s)}else I===null&&(h.lanes=0);return[a.memoizedState,h.dispatch]}function Vg(s){var a=Hi(),h=a.queue;if(h===null)throw Error(t(311));h.lastRenderedReducer=s;var m=h.dispatch,I=h.pending,M=a.memoizedState;if(I!==null){h.pending=null;var P=I=I.next;do M=s(M,P.action),P=P.next;while(P!==I);rr(M,a.memoizedState)||(gi=!0),a.memoizedState=M,a.baseQueue===null&&(a.baseState=M),h.lastRenderedState=M}return[M,m]}function $C(){}function ZC(s,a){var h=sn,m=Hi(),I=a(),M=!rr(m.memoizedState,I);if(M&&(m.memoizedState=I,gi=!0),m=m.queue,Wg(nI.bind(null,h,m,s),[s]),m.getSnapshot!==a||M||Nn!==null&&Nn.memoizedState.tag&1){if(h.flags|=2048,Uc(9,tI.bind(null,h,m,I,a),void 0,null),Pn===null)throw Error(t(349));Ro&30||eI(h,a,I)}return I}function eI(s,a,h){s.flags|=16384,s={getSnapshot:a,value:h},a=sn.updateQueue,a===null?(a={lastEffect:null,stores:null},sn.updateQueue=a,a.stores=[s]):(h=a.stores,h===null?a.stores=[s]:h.push(s))}function tI(s,a,h,m){a.value=h,a.getSnapshot=m,iI(a)&&rI(s)}function nI(s,a,h){return h(function(){iI(a)&&rI(s)})}function iI(s){var a=s.getSnapshot;s=s.value;try{var h=a();return!rr(s,h)}catch{return!0}}function rI(s){var a=ns(s,1);a!==null&&cr(a,s,1,-1)}function sI(s){var a=wr();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pc,lastRenderedState:s},a.queue=s,s=s.dispatch=M6.bind(null,sn,s),[a.memoizedState,s]}function Uc(s,a,h,m){return s={tag:s,create:a,destroy:h,deps:m,next:null},a=sn.updateQueue,a===null?(a={lastEffect:null,stores:null},sn.updateQueue=a,a.lastEffect=s.next=s):(h=a.lastEffect,h===null?a.lastEffect=s.next=s:(m=h.next,h.next=s,s.next=m,a.lastEffect=s)),s}function oI(){return Hi().memoizedState}function lh(s,a,h,m){var I=wr();sn.flags|=s,I.memoizedState=Uc(1|a,h,void 0,m===void 0?null:m)}function ch(s,a,h,m){var I=Hi();m=m===void 0?null:m;var M=void 0;if(Sn!==null){var P=Sn.memoizedState;if(M=P.destroy,m!==null&&Og(m,P.deps)){I.memoizedState=Uc(a,h,M,m);return}}sn.flags|=s,I.memoizedState=Uc(1|a,h,M,m)}function aI(s,a){return lh(8390656,8,s,a)}function Wg(s,a){return ch(2048,8,s,a)}function lI(s,a){return ch(4,2,s,a)}function cI(s,a){return ch(4,4,s,a)}function uI(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function fI(s,a,h){return h=h!=null?h.concat([s]):null,ch(4,4,uI.bind(null,a,s),h)}function jg(){}function hI(s,a){var h=Hi();a=a===void 0?null:a;var m=h.memoizedState;return m!==null&&a!==null&&Og(a,m[1])?m[0]:(h.memoizedState=[s,a],s)}function dI(s,a){var h=Hi();a=a===void 0?null:a;var m=h.memoizedState;return m!==null&&a!==null&&Og(a,m[1])?m[0]:(s=s(),h.memoizedState=[s,a],s)}function AI(s,a,h){return Ro&21?(rr(h,a)||(h=Rf(),sn.lanes|=h,bo|=h,s.baseState=!0),a):(s.baseState&&(s.baseState=!1,gi=!0),s.memoizedState=h)}function S6(s,a){var h=kt;kt=h!==0&&4>h?h:4,s(!0);var m=Qg.transition;Qg.transition={};try{s(!1),a()}finally{kt=h,Qg.transition=m}}function pI(){return Hi().memoizedState}function w6(s,a,h){var m=Hs(s);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},gI(s))mI(a,h);else if(h=OC(s,a,h,m),h!==null){var I=ai();cr(h,s,m,I),vI(h,a,m)}}function M6(s,a,h){var m=Hs(s),I={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(gI(s))mI(a,I);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=a.lastRenderedReducer,M!==null))try{var P=a.lastRenderedState,W=M(P,h);if(I.hasEagerState=!0,I.eagerState=W,rr(W,P)){var $=a.interleaved;$===null?(I.next=I,bg(a)):(I.next=$.next,$.next=I),a.interleaved=I;return}}catch{}finally{}h=OC(s,a,I,m),h!==null&&(I=ai(),cr(h,s,m,I),vI(h,a,m))}}function gI(s){var a=s.alternate;return s===sn||a!==null&&a===sn}function mI(s,a){Dc=ah=!0;var h=s.pending;h===null?a.next=a:(a.next=h.next,h.next=a),s.pending=a}function vI(s,a,h){if(h&4194240){var m=a.lanes;m&=s.pendingLanes,h|=m,a.lanes=h,jp(s,h)}}var uh={readContext:Gi,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},T6={readContext:Gi,useCallback:function(s,a){return wr().memoizedState=[s,a===void 0?null:a],s},useContext:Gi,useEffect:aI,useImperativeHandle:function(s,a,h){return h=h!=null?h.concat([s]):null,lh(4194308,4,uI.bind(null,a,s),h)},useLayoutEffect:function(s,a){return lh(4194308,4,s,a)},useInsertionEffect:function(s,a){return lh(4,2,s,a)},useMemo:function(s,a){var h=wr();return a=a===void 0?null:a,s=s(),h.memoizedState=[s,a],s},useReducer:function(s,a,h){var m=wr();return a=h!==void 0?h(a):a,m.memoizedState=m.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},m.queue=s,s=s.dispatch=w6.bind(null,sn,s),[m.memoizedState,s]},useRef:function(s){var a=wr();return s={current:s},a.memoizedState=s},useState:sI,useDebugValue:jg,useDeferredValue:function(s){return wr().memoizedState=s},useTransition:function(){var s=sI(!1),a=s[0];return s=S6.bind(null,s[1]),wr().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,h){var m=sn,I=wr();if(en){if(h===void 0)throw Error(t(407));h=h()}else{if(h=a(),Pn===null)throw Error(t(349));Ro&30||eI(m,a,h)}I.memoizedState=h;var M={value:h,getSnapshot:a};return I.queue=M,aI(nI.bind(null,m,M,s),[s]),m.flags|=2048,Uc(9,tI.bind(null,m,M,h,a),void 0,null),h},useId:function(){var s=wr(),a=Pn.identifierPrefix;if(en){var h=ts,m=es;h=(m&~(1<<32-ri(m)-1)).toString(32)+h,a=":"+a+"R"+h,h=Nc++,0<h&&(a+="H"+h.toString(32)),a+=":"}else h=x6++,a=":"+a+"r"+h.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},B6={readContext:Gi,useCallback:hI,useContext:Gi,useEffect:Wg,useImperativeHandle:fI,useInsertionEffect:lI,useLayoutEffect:cI,useMemo:dI,useReducer:Hg,useRef:oI,useState:function(){return Hg(Pc)},useDebugValue:jg,useDeferredValue:function(s){var a=Hi();return AI(a,Sn.memoizedState,s)},useTransition:function(){var s=Hg(Pc)[0],a=Hi().memoizedState;return[s,a]},useMutableSource:$C,useSyncExternalStore:ZC,useId:pI,unstable_isNewReconciler:!1},R6={readContext:Gi,useCallback:hI,useContext:Gi,useEffect:Wg,useImperativeHandle:fI,useInsertionEffect:lI,useLayoutEffect:cI,useMemo:dI,useReducer:Vg,useRef:oI,useState:function(){return Vg(Pc)},useDebugValue:jg,useDeferredValue:function(s){var a=Hi();return Sn===null?a.memoizedState=s:AI(a,Sn.memoizedState,s)},useTransition:function(){var s=Vg(Pc)[0],a=Hi().memoizedState;return[s,a]},useMutableSource:$C,useSyncExternalStore:ZC,useId:pI,unstable_isNewReconciler:!1};function ol(s,a){try{var h="",m=a;do h+=Ae(m),m=m.return;while(m);var I=h}catch(M){I=`
4255
4255
  Error generating stack: `+M.message+`
4256
- `+M.stack}return{value:s,source:a,stack:I,digest:null}}function Yg(s,a,h){return{value:s,source:null,stack:h??null,digest:a??null}}function qg(s,a){try{console.error(a.value)}catch(h){setTimeout(function(){throw h})}}var b6=typeof WeakMap=="function"?WeakMap:Map;function _I(s,a,h){h=is(-1,h),h.tag=3,h.payload={element:null};var m=a.value;return h.callback=function(){mh||(mh=!0,cm=m),qg(s,a)},h}function EI(s,a,h){h=is(-1,h),h.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var I=a.value;h.payload=function(){return m(I)},h.callback=function(){qg(s,a)}}var M=s.stateNode;return M!==null&&typeof M.componentDidCatch=="function"&&(h.callback=function(){qg(s,a),typeof m!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var P=a.stack;this.componentDidCatch(a.value,{componentStack:P!==null?P:""})}),h}function yI(s,a,h){var m=s.pingCache;if(m===null){m=s.pingCache=new b6;var I=new Set;m.set(a,I)}else I=m.get(a),I===void 0&&(I=new Set,m.set(a,I));I.has(h)||(I.add(h),s=W6.bind(null,s,a,h),a.then(s,s))}function CI(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function II(s,a,h,m,I){return s.mode&1?(s.flags|=65536,s.lanes=I,s):(s===a?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(a=is(-1,1),a.tag=2,Qs(h,a,1))),h.lanes|=1),s)}var L6=x.ReactCurrentOwner,gi=!1;function oi(s,a,h,m){a.child=s===null?KC(a,null,h,m):rl(a,s.child,h,m)}function xI(s,a,h,m,I){h=h.render;var M=a.ref;return il(a,I),m=zg(s,a,h,m,M,I),h=Gg(),s!==null&&!gi?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~I,rs(s,a,I)):(en&&h&&Cg(a),a.flags|=1,oi(s,a,m,I),a.child)}function SI(s,a,h,m,I){if(s===null){var M=h.type;return typeof M=="function"&&!gm(M)&&M.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(a.tag=15,a.type=M,wI(s,a,M,m,I)):(s=Ih(h.type,null,m,a,a.mode,I),s.ref=a.ref,s.return=a,a.child=s)}if(M=s.child,!(s.lanes&I)){var P=M.memoizedProps;if(h=h.compare,h=h!==null?h:Cc,h(P,m)&&s.ref===a.ref)return rs(s,a,I)}return a.flags|=1,s=Ws(M,m),s.ref=a.ref,s.return=a,a.child=s}function wI(s,a,h,m,I){if(s!==null){var M=s.memoizedProps;if(Cc(M,m)&&s.ref===a.ref)if(gi=!1,a.pendingProps=m=M,(s.lanes&I)!==0)s.flags&131072&&(gi=!0);else return a.lanes=s.lanes,rs(s,a,I)}return Xg(s,a,h,m,I)}function MI(s,a,h){var m=a.pendingProps,I=m.children,M=s!==null?s.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yt(ll,Li),Li|=h;else{if(!(h&1073741824))return s=M!==null?M.baseLanes|h:h,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,Yt(ll,Li),Li|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=M!==null?M.baseLanes:h,Yt(ll,Li),Li|=m}else M!==null?(m=M.baseLanes|h,a.memoizedState=null):m=h,Yt(ll,Li),Li|=m;return oi(s,a,I,h),a.child}function TI(s,a){var h=a.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(a.flags|=512,a.flags|=2097152)}function Xg(s,a,h,m,I){var M=pi(h)?So:jn.current;return M=Za(a,M),il(a,I),h=zg(s,a,h,m,M,I),m=Gg(),s!==null&&!gi?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~I,rs(s,a,I)):(en&&m&&Cg(a),a.flags|=1,oi(s,a,h,I),a.child)}function BI(s,a,h,m,I){if(pi(h)){var M=!0;qf(a)}else M=!1;if(il(a,I),a.stateNode===null)hh(s,a),jC(a,h,m),Ng(a,h,m,I),m=!0;else if(s===null){var P=a.stateNode,W=a.memoizedProps;P.props=W;var Z=P.context,le=h.contextType;typeof le=="object"&&le!==null?le=Gi(le):(le=pi(h)?So:jn.current,le=Za(a,le));var Ee=h.getDerivedStateFromProps,Ie=typeof Ee=="function"||typeof P.getSnapshotBeforeUpdate=="function";Ie||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==m||Z!==le)&&YC(a,P,m,le),Fs=!1;var ve=a.memoizedState;P.state=ve,nh(a,m,P,I),Z=a.memoizedState,W!==m||ve!==Z||Ai.current||Fs?(typeof Ee=="function"&&(Dg(a,h,Ee,m),Z=a.memoizedState),(W=Fs||WC(a,h,W,m,ve,Z,le))?(Ie||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(a.flags|=4194308)):(typeof P.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=Z),P.props=m,P.state=Z,P.context=le,m=W):(typeof P.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{P=a.stateNode,zC(s,a),W=a.memoizedProps,le=a.type===a.elementType?W:or(a.type,W),P.props=le,Ie=a.pendingProps,ve=P.context,Z=h.contextType,typeof Z=="object"&&Z!==null?Z=Gi(Z):(Z=pi(h)?So:jn.current,Z=Za(a,Z));var Fe=h.getDerivedStateFromProps;(Ee=typeof Fe=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==Ie||ve!==Z)&&YC(a,P,m,Z),Fs=!1,ve=a.memoizedState,P.state=ve,nh(a,m,P,I);var Ve=a.memoizedState;W!==Ie||ve!==Ve||Ai.current||Fs?(typeof Fe=="function"&&(Dg(a,h,Fe,m),Ve=a.memoizedState),(le=Fs||WC(a,h,le,m,ve,Ve,Z)||!1)?(Ee||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(m,Ve,Z),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(m,Ve,Z)),typeof P.componentDidUpdate=="function"&&(a.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof P.componentDidUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=Ve),P.props=m,P.state=Ve,P.context=Z,m=le):(typeof P.componentDidUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),m=!1)}return Kg(s,a,h,m,M,I)}function Kg(s,a,h,m,I,M){TI(s,a);var P=(a.flags&128)!==0;if(!m&&!P)return I&&DC(a,h,!1),rs(s,a,M);m=a.stateNode,L6.current=a;var W=P&&typeof h.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,s!==null&&P?(a.child=rl(a,s.child,null,M),a.child=rl(a,null,W,M)):oi(s,a,W,M),a.memoizedState=m.state,I&&DC(a,h,!0),a.child}function RI(s){var a=s.stateNode;a.pendingContext?bC(s,a.pendingContext,a.pendingContext!==a.context):a.context&&bC(s,a.context,!1),Pg(s,a.containerInfo)}function bI(s,a,h,m,I){return tl(),wg(I),a.flags|=256,oi(s,a,h,m),a.child}var Jg={dehydrated:null,treeContext:null,retryLane:0};function Zg(s){return{baseLanes:s,cachePool:null,transitions:null}}function LI(s,a,h){var m=a.pendingProps,I=rn.current,M=!1,P=(a.flags&128)!==0,W;if((W=P)||(W=s!==null&&s.memoizedState===null?!1:(I&2)!==0),W?(M=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(I|=1),Yt(rn,I&1),s===null)return Sg(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(a.mode&1?s.data==="$!"?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(P=m.children,s=m.fallback,M?(m=a.mode,M=a.child,P={mode:"hidden",children:P},!(m&1)&&M!==null?(M.childLanes=0,M.pendingProps=P):M=xh(P,m,0,null),s=Po(s,m,h,null),M.return=a,s.return=a,M.sibling=s,a.child=M,a.child.memoizedState=Zg(h),a.memoizedState=Jg,s):$g(a,P));if(I=s.memoizedState,I!==null&&(W=I.dehydrated,W!==null))return D6(s,a,P,m,W,I,h);if(M){M=m.fallback,P=a.mode,I=s.child,W=I.sibling;var Z={mode:"hidden",children:m.children};return!(P&1)&&a.child!==I?(m=a.child,m.childLanes=0,m.pendingProps=Z,a.deletions=null):(m=Ws(I,Z),m.subtreeFlags=I.subtreeFlags&14680064),W!==null?M=Ws(W,M):(M=Po(M,P,h,null),M.flags|=2),M.return=a,m.return=a,m.sibling=M,a.child=m,m=M,M=a.child,P=s.child.memoizedState,P=P===null?Zg(h):{baseLanes:P.baseLanes|h,cachePool:null,transitions:P.transitions},M.memoizedState=P,M.childLanes=s.childLanes&~h,a.memoizedState=Jg,m}return M=s.child,s=M.sibling,m=Ws(M,{mode:"visible",children:m.children}),!(a.mode&1)&&(m.lanes=h),m.return=a,m.sibling=null,s!==null&&(h=a.deletions,h===null?(a.deletions=[s],a.flags|=16):h.push(s)),a.child=m,a.memoizedState=null,m}function $g(s,a){return a=xh({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function fh(s,a,h,m){return m!==null&&wg(m),rl(a,s.child,null,h),s=$g(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function D6(s,a,h,m,I,M,P){if(h)return a.flags&256?(a.flags&=-257,m=Yg(Error(t(422))),fh(s,a,P,m)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(M=m.fallback,I=a.mode,m=xh({mode:"visible",children:m.children},I,0,null),M=Po(M,I,P,null),M.flags|=2,m.return=a,M.return=a,m.sibling=M,a.child=m,a.mode&1&&rl(a,s.child,null,P),a.child.memoizedState=Zg(P),a.memoizedState=Jg,M);if(!(a.mode&1))return fh(s,a,P,null);if(I.data==="$!"){if(m=I.nextSibling&&I.nextSibling.dataset,m)var W=m.dgst;return m=W,M=Error(t(419)),m=Yg(M,m,void 0),fh(s,a,P,m)}if(W=(P&s.childLanes)!==0,gi||W){if(m=Pn,m!==null){switch(P&-P){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(m.suspendedLanes|P)?0:I,I!==0&&I!==M.retryLane&&(M.retryLane=I,ns(s,I),cr(m,s,I,-1))}return pm(),m=Yg(Error(t(421))),fh(s,a,P,m)}return I.data==="$?"?(a.flags|=128,a.child=s.child,a=j6.bind(null,s),I._reactRetry=a,null):(s=M.treeContext,bi=Ns(I.nextSibling),Ri=a,en=!0,sr=null,s!==null&&(Oi[zi++]=es,Oi[zi++]=ts,Oi[zi++]=wo,es=s.id,ts=s.overflow,wo=a),a=$g(a,m.children),a.flags|=4096,a)}function DI(s,a,h){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),Rg(s.return,a,h)}function em(s,a,h,m,I){var M=s.memoizedState;M===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:I}:(M.isBackwards=a,M.rendering=null,M.renderingStartTime=0,M.last=m,M.tail=h,M.tailMode=I)}function NI(s,a,h){var m=a.pendingProps,I=m.revealOrder,M=m.tail;if(oi(s,a,m.children,h),m=rn.current,m&2)m=m&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&DI(s,h,a);else if(s.tag===19)DI(s,h,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Yt(rn,m),!(a.mode&1))a.memoizedState=null;else switch(I){case"forwards":for(h=a.child,I=null;h!==null;)s=h.alternate,s!==null&&sh(s)===null&&(I=h),h=h.sibling;h=I,h===null?(I=a.child,a.child=null):(I=h.sibling,h.sibling=null),em(a,!1,I,h,M);break;case"backwards":for(h=null,I=a.child,a.child=null;I!==null;){if(s=I.alternate,s!==null&&sh(s)===null){a.child=I;break}s=I.sibling,I.sibling=h,h=I,I=s}em(a,!0,h,null,M);break;case"together":em(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function hh(s,a){!(a.mode&1)&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function rs(s,a,h){if(s!==null&&(a.dependencies=s.dependencies),bo|=a.lanes,!(h&a.childLanes))return null;if(s!==null&&a.child!==s.child)throw Error(t(153));if(a.child!==null){for(s=a.child,h=Ws(s,s.pendingProps),a.child=h,h.return=a;s.sibling!==null;)s=s.sibling,h=h.sibling=Ws(s,s.pendingProps),h.return=a;h.sibling=null}return a.child}function N6(s,a,h){switch(a.tag){case 3:RI(a),tl();break;case 5:JC(a);break;case 1:pi(a.type)&&qf(a);break;case 4:Pg(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,I=a.memoizedProps.value;Yt($f,m._currentValue),m._currentValue=I;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?(Yt(rn,rn.current&1),a.flags|=128,null):h&a.child.childLanes?LI(s,a,h):(Yt(rn,rn.current&1),s=rs(s,a,h),s!==null?s.sibling:null);Yt(rn,rn.current&1);break;case 19:if(m=(h&a.childLanes)!==0,s.flags&128){if(m)return NI(s,a,h);a.flags|=128}if(I=a.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Yt(rn,rn.current),m)break;return null;case 22:case 23:return a.lanes=0,MI(s,a,h)}return rs(s,a,h)}var PI,tm,UI,kI;PI=function(s,a){for(var h=a.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},tm=function(){},UI=function(s,a,h,m){var I=s.memoizedProps;if(I!==m){s=a.stateNode,Bo(Sr.current);var M=null;switch(h){case"input":I=Ne(s,I),m=Ne(s,m),M=[];break;case"select":I=U({},I,{value:void 0}),m=U({},m,{value:void 0}),M=[];break;case"textarea":I=mt(s,I),m=mt(s,m),M=[];break;default:typeof I.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=Wf)}je(h,m);var P;h=null;for(le in I)if(!m.hasOwnProperty(le)&&I.hasOwnProperty(le)&&I[le]!=null)if(le==="style"){var W=I[le];for(P in W)W.hasOwnProperty(P)&&(h||(h={}),h[P]="")}else le!=="dangerouslySetInnerHTML"&&le!=="children"&&le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&le!=="autoFocus"&&(r.hasOwnProperty(le)?M||(M=[]):(M=M||[]).push(le,null));for(le in m){var Z=m[le];if(W=I!=null?I[le]:void 0,m.hasOwnProperty(le)&&Z!==W&&(Z!=null||W!=null))if(le==="style")if(W){for(P in W)!W.hasOwnProperty(P)||Z&&Z.hasOwnProperty(P)||(h||(h={}),h[P]="");for(P in Z)Z.hasOwnProperty(P)&&W[P]!==Z[P]&&(h||(h={}),h[P]=Z[P])}else h||(M||(M=[]),M.push(le,h)),h=Z;else le==="dangerouslySetInnerHTML"?(Z=Z?Z.__html:void 0,W=W?W.__html:void 0,Z!=null&&W!==Z&&(M=M||[]).push(le,Z)):le==="children"?typeof Z!="string"&&typeof Z!="number"||(M=M||[]).push(le,""+Z):le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&(r.hasOwnProperty(le)?(Z!=null&&le==="onScroll"&&Jt("scroll",s),M||W===Z||(M=[])):(M=M||[]).push(le,Z))}h&&(M=M||[]).push("style",h);var le=M;(a.updateQueue=le)&&(a.flags|=4)}},kI=function(s,a,h,m){h!==m&&(a.flags|=4)};function kc(s,a){if(!en)switch(s.tailMode){case"hidden":a=s.tail;for(var h=null;a!==null;)a.alternate!==null&&(h=a),a=a.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function qn(s){var a=s.alternate!==null&&s.alternate.child===s.child,h=0,m=0;if(a)for(var I=s.child;I!==null;)h|=I.lanes|I.childLanes,m|=I.subtreeFlags&14680064,m|=I.flags&14680064,I.return=s,I=I.sibling;else for(I=s.child;I!==null;)h|=I.lanes|I.childLanes,m|=I.subtreeFlags,m|=I.flags,I.return=s,I=I.sibling;return s.subtreeFlags|=m,s.childLanes=h,a}function P6(s,a,h){var m=a.pendingProps;switch(Ig(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qn(a),null;case 1:return pi(a.type)&&Yf(),qn(a),null;case 3:return m=a.stateNode,sl(),Zt(Ai),Zt(jn),Fg(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(Zf(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,sr!==null&&(hm(sr),sr=null))),tm(s,a),qn(a),null;case 5:Ug(a);var I=Bo(Lc.current);if(h=a.type,s!==null&&a.stateNode!=null)UI(s,a,h,m,I),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(t(166));return qn(a),null}if(s=Bo(Sr.current),Zf(a)){m=a.stateNode,h=a.type;var M=a.memoizedProps;switch(m[xr]=a,m[Mc]=M,s=(a.mode&1)!==0,h){case"dialog":Jt("cancel",m),Jt("close",m);break;case"iframe":case"object":case"embed":Jt("load",m);break;case"video":case"audio":for(I=0;I<xc.length;I++)Jt(xc[I],m);break;case"source":Jt("error",m);break;case"img":case"image":case"link":Jt("error",m),Jt("load",m);break;case"details":Jt("toggle",m);break;case"input":Ze(m,M),Jt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!M.multiple},Jt("invalid",m);break;case"textarea":H(m,M),Jt("invalid",m)}je(h,M),I=null;for(var P in M)if(M.hasOwnProperty(P)){var W=M[P];P==="children"?typeof W=="string"?m.textContent!==W&&(M.suppressHydrationWarning!==!0&&Vf(m.textContent,W,s),I=["children",W]):typeof W=="number"&&m.textContent!==""+W&&(M.suppressHydrationWarning!==!0&&Vf(m.textContent,W,s),I=["children",""+W]):r.hasOwnProperty(P)&&W!=null&&P==="onScroll"&&Jt("scroll",m)}switch(h){case"input":ot(m),Ue(m,M,!0);break;case"textarea":ot(m),se(m);break;case"select":case"option":break;default:typeof M.onClick=="function"&&(m.onclick=Wf)}m=I,a.updateQueue=m,m!==null&&(a.flags|=4)}else{P=I.nodeType===9?I:I.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ce(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=P.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=P.createElement(h,{is:m.is}):(s=P.createElement(h),h==="select"&&(P=s,m.multiple?P.multiple=!0:m.size&&(P.size=m.size))):s=P.createElementNS(s,h),s[xr]=a,s[Mc]=m,PI(s,a,!1,!1),a.stateNode=s;e:{switch(P=Je(h,m),h){case"dialog":Jt("cancel",s),Jt("close",s),I=m;break;case"iframe":case"object":case"embed":Jt("load",s),I=m;break;case"video":case"audio":for(I=0;I<xc.length;I++)Jt(xc[I],s);I=m;break;case"source":Jt("error",s),I=m;break;case"img":case"image":case"link":Jt("error",s),Jt("load",s),I=m;break;case"details":Jt("toggle",s),I=m;break;case"input":Ze(s,m),I=Ne(s,m),Jt("invalid",s);break;case"option":I=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},I=U({},m,{value:void 0}),Jt("invalid",s);break;case"textarea":H(s,m),I=mt(s,m),Jt("invalid",s);break;default:I=m}je(h,I),W=I;for(M in W)if(W.hasOwnProperty(M)){var Z=W[M];M==="style"?pe(s,Z):M==="dangerouslySetInnerHTML"?(Z=Z?Z.__html:void 0,Z!=null&&We(s,Z)):M==="children"?typeof Z=="string"?(h!=="textarea"||Z!=="")&&Se(s,Z):typeof Z=="number"&&Se(s,""+Z):M!=="suppressContentEditableWarning"&&M!=="suppressHydrationWarning"&&M!=="autoFocus"&&(r.hasOwnProperty(M)?Z!=null&&M==="onScroll"&&Jt("scroll",s):Z!=null&&y(s,M,Z,P))}switch(h){case"input":ot(s),Ue(s,m,!1);break;case"textarea":ot(s),se(s);break;case"option":m.value!=null&&s.setAttribute("value",""+de(m.value));break;case"select":s.multiple=!!m.multiple,M=m.value,M!=null?lt(s,!!m.multiple,M,!1):m.defaultValue!=null&&lt(s,!!m.multiple,m.defaultValue,!0);break;default:typeof I.onClick=="function"&&(s.onclick=Wf)}switch(h){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return qn(a),null;case 6:if(s&&a.stateNode!=null)kI(s,a,s.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(t(166));if(h=Bo(Lc.current),Bo(Sr.current),Zf(a)){if(m=a.stateNode,h=a.memoizedProps,m[xr]=a,(M=m.nodeValue!==h)&&(s=Ri,s!==null))switch(s.tag){case 3:Vf(m.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Vf(m.nodeValue,h,(s.mode&1)!==0)}M&&(a.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[xr]=a,a.stateNode=m}return qn(a),null;case 13:if(Zt(rn),m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(en&&bi!==null&&a.mode&1&&!(a.flags&128))QC(),tl(),a.flags|=98560,M=!1;else if(M=Zf(a),m!==null&&m.dehydrated!==null){if(s===null){if(!M)throw Error(t(318));if(M=a.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(t(317));M[xr]=a}else tl(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;qn(a),M=!1}else sr!==null&&(hm(sr),sr=null),M=!0;if(!M)return a.flags&65536?a:null}return a.flags&128?(a.lanes=h,a):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(a.child.flags|=8192,a.mode&1&&(s===null||rn.current&1?wn===0&&(wn=3):pm())),a.updateQueue!==null&&(a.flags|=4),qn(a),null);case 4:return sl(),tm(s,a),s===null&&Sc(a.stateNode.containerInfo),qn(a),null;case 10:return Bg(a.type._context),qn(a),null;case 17:return pi(a.type)&&Yf(),qn(a),null;case 19:if(Zt(rn),M=a.memoizedState,M===null)return qn(a),null;if(m=(a.flags&128)!==0,P=M.rendering,P===null)if(m)kc(M,!1);else{if(wn!==0||s!==null&&s.flags&128)for(s=a.child;s!==null;){if(P=sh(s),P!==null){for(a.flags|=128,kc(M,!1),m=P.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=h,h=a.child;h!==null;)M=h,s=m,M.flags&=14680066,P=M.alternate,P===null?(M.childLanes=0,M.lanes=s,M.child=null,M.subtreeFlags=0,M.memoizedProps=null,M.memoizedState=null,M.updateQueue=null,M.dependencies=null,M.stateNode=null):(M.childLanes=P.childLanes,M.lanes=P.lanes,M.child=P.child,M.subtreeFlags=0,M.deletions=null,M.memoizedProps=P.memoizedProps,M.memoizedState=P.memoizedState,M.updateQueue=P.updateQueue,M.type=P.type,s=P.dependencies,M.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return Yt(rn,rn.current&1|2),a.child}s=s.sibling}M.tail!==null&&Qe()>cl&&(a.flags|=128,m=!0,kc(M,!1),a.lanes=4194304)}else{if(!m)if(s=sh(P),s!==null){if(a.flags|=128,m=!0,h=s.updateQueue,h!==null&&(a.updateQueue=h,a.flags|=4),kc(M,!0),M.tail===null&&M.tailMode==="hidden"&&!P.alternate&&!en)return qn(a),null}else 2*Qe()-M.renderingStartTime>cl&&h!==1073741824&&(a.flags|=128,m=!0,kc(M,!1),a.lanes=4194304);M.isBackwards?(P.sibling=a.child,a.child=P):(h=M.last,h!==null?h.sibling=P:a.child=P,M.last=P)}return M.tail!==null?(a=M.tail,M.rendering=a,M.tail=a.sibling,M.renderingStartTime=Qe(),a.sibling=null,h=rn.current,Yt(rn,m?h&1|2:h&1),a):(qn(a),null);case 22:case 23:return Am(),m=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(a.flags|=8192),m&&a.mode&1?Li&1073741824&&(qn(a),a.subtreeFlags&6&&(a.flags|=8192)):qn(a),null;case 24:return null;case 25:return null}throw Error(t(156,a.tag))}function U6(s,a){switch(Ig(a),a.tag){case 1:return pi(a.type)&&Yf(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return sl(),Zt(Ai),Zt(jn),Fg(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return Ug(a),null;case 13:if(Zt(rn),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(t(340));tl()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return Zt(rn),null;case 4:return sl(),null;case 10:return Bg(a.type._context),null;case 22:case 23:return Am(),null;case 24:return null;default:return null}}var dh=!1,Xn=!1,k6=typeof WeakSet=="function"?WeakSet:Set,ze=null;function al(s,a){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){cn(s,a,m)}else h.current=null}function nm(s,a,h){try{h()}catch(m){cn(s,a,m)}}var FI=!1;function F6(s,a){if(Ag=Df,s=pC(),og(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var I=m.anchorOffset,M=m.focusNode;m=m.focusOffset;try{h.nodeType,M.nodeType}catch{h=null;break e}var P=0,W=-1,Z=-1,le=0,Ee=0,Ie=s,ve=null;t:for(;;){for(var Fe;Ie!==h||I!==0&&Ie.nodeType!==3||(W=P+I),Ie!==M||m!==0&&Ie.nodeType!==3||(Z=P+m),Ie.nodeType===3&&(P+=Ie.nodeValue.length),(Fe=Ie.firstChild)!==null;)ve=Ie,Ie=Fe;for(;;){if(Ie===s)break t;if(ve===h&&++le===I&&(W=P),ve===M&&++Ee===m&&(Z=P),(Fe=Ie.nextSibling)!==null)break;Ie=ve,ve=Ie.parentNode}Ie=Fe}h=W===-1||Z===-1?null:{start:W,end:Z}}else h=null}h=h||{start:0,end:0}}else h=null;for(pg={focusedElem:s,selectionRange:h},Df=!1,ze=a;ze!==null;)if(a=ze,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,ze=s;else for(;ze!==null;){a=ze;try{var Ve=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Ve!==null){var Ye=Ve.memoizedProps,pn=Ve.memoizedState,ie=a.stateNode,ne=ie.getSnapshotBeforeUpdate(a.elementType===a.type?Ye:or(a.type,Ye),pn);ie.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var ae=a.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(Be){cn(a,a.return,Be)}if(s=a.sibling,s!==null){s.return=a.return,ze=s;break}ze=a.return}return Ve=FI,FI=!1,Ve}function Fc(s,a,h){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var I=m=m.next;do{if((I.tag&s)===s){var M=I.destroy;I.destroy=void 0,M!==void 0&&nm(a,h,M)}I=I.next}while(I!==m)}}function Ah(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var h=a=a.next;do{if((h.tag&s)===s){var m=h.create;h.destroy=m()}h=h.next}while(h!==a)}}function im(s){var a=s.ref;if(a!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof a=="function"?a(s):a.current=s}}function QI(s){var a=s.alternate;a!==null&&(s.alternate=null,QI(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[xr],delete a[Mc],delete a[_g],delete a[E6],delete a[y6])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function OI(s){return s.tag===5||s.tag===3||s.tag===4}function zI(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||OI(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function rm(s,a,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?h.nodeType===8?h.parentNode.insertBefore(s,a):h.insertBefore(s,a):(h.nodeType===8?(a=h.parentNode,a.insertBefore(s,h)):(a=h,a.appendChild(s)),h=h._reactRootContainer,h!=null||a.onclick!==null||(a.onclick=Wf));else if(m!==4&&(s=s.child,s!==null))for(rm(s,a,h),s=s.sibling;s!==null;)rm(s,a,h),s=s.sibling}function sm(s,a,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?h.insertBefore(s,a):h.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(sm(s,a,h),s=s.sibling;s!==null;)sm(s,a,h),s=s.sibling}var On=null,ar=!1;function Os(s,a,h){for(h=h.child;h!==null;)GI(s,a,h),h=h.sibling}function GI(s,a,h){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(di,h)}catch{}switch(h.tag){case 5:Xn||al(h,a);case 6:var m=On,I=ar;On=null,Os(s,a,h),On=m,ar=I,On!==null&&(ar?(s=On,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):On.removeChild(h.stateNode));break;case 18:On!==null&&(ar?(s=On,h=h.stateNode,s.nodeType===8?vg(s.parentNode,h):s.nodeType===1&&vg(s,h),gc(s)):vg(On,h.stateNode));break;case 4:m=On,I=ar,On=h.stateNode.containerInfo,ar=!0,Os(s,a,h),On=m,ar=I;break;case 0:case 11:case 14:case 15:if(!Xn&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){I=m=m.next;do{var M=I,P=M.destroy;M=M.tag,P!==void 0&&(M&2||M&4)&&nm(h,a,P),I=I.next}while(I!==m)}Os(s,a,h);break;case 1:if(!Xn&&(al(h,a),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(W){cn(h,a,W)}Os(s,a,h);break;case 21:Os(s,a,h);break;case 22:h.mode&1?(Xn=(m=Xn)||h.memoizedState!==null,Os(s,a,h),Xn=m):Os(s,a,h);break;default:Os(s,a,h)}}function HI(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new k6),a.forEach(function(m){var I=Y6.bind(null,s,m);h.has(m)||(h.add(m),m.then(I,I))})}}function lr(s,a){var h=a.deletions;if(h!==null)for(var m=0;m<h.length;m++){var I=h[m];try{var M=s,P=a,W=P;e:for(;W!==null;){switch(W.tag){case 5:On=W.stateNode,ar=!1;break e;case 3:On=W.stateNode.containerInfo,ar=!0;break e;case 4:On=W.stateNode.containerInfo,ar=!0;break e}W=W.return}if(On===null)throw Error(t(160));GI(M,P,I),On=null,ar=!1;var Z=I.alternate;Z!==null&&(Z.return=null),I.return=null}catch(le){cn(I,a,le)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)VI(a,s),a=a.sibling}function VI(s,a){var h=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(lr(a,s),Mr(s),m&4){try{Fc(3,s,s.return),Ah(3,s)}catch(Ye){cn(s,s.return,Ye)}try{Fc(5,s,s.return)}catch(Ye){cn(s,s.return,Ye)}}break;case 1:lr(a,s),Mr(s),m&512&&h!==null&&al(h,h.return);break;case 5:if(lr(a,s),Mr(s),m&512&&h!==null&&al(h,h.return),s.flags&32){var I=s.stateNode;try{Se(I,"")}catch(Ye){cn(s,s.return,Ye)}}if(m&4&&(I=s.stateNode,I!=null)){var M=s.memoizedProps,P=h!==null?h.memoizedProps:M,W=s.type,Z=s.updateQueue;if(s.updateQueue=null,Z!==null)try{W==="input"&&M.type==="radio"&&M.name!=null&&_e(I,M),Je(W,P);var le=Je(W,M);for(P=0;P<Z.length;P+=2){var Ee=Z[P],Ie=Z[P+1];Ee==="style"?pe(I,Ie):Ee==="dangerouslySetInnerHTML"?We(I,Ie):Ee==="children"?Se(I,Ie):y(I,Ee,Ie,le)}switch(W){case"input":it(I,M);break;case"textarea":Q(I,M);break;case"select":var ve=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!M.multiple;var Fe=M.value;Fe!=null?lt(I,!!M.multiple,Fe,!1):ve!==!!M.multiple&&(M.defaultValue!=null?lt(I,!!M.multiple,M.defaultValue,!0):lt(I,!!M.multiple,M.multiple?[]:"",!1))}I[Mc]=M}catch(Ye){cn(s,s.return,Ye)}}break;case 6:if(lr(a,s),Mr(s),m&4){if(s.stateNode===null)throw Error(t(162));I=s.stateNode,M=s.memoizedProps;try{I.nodeValue=M}catch(Ye){cn(s,s.return,Ye)}}break;case 3:if(lr(a,s),Mr(s),m&4&&h!==null&&h.memoizedState.isDehydrated)try{gc(a.containerInfo)}catch(Ye){cn(s,s.return,Ye)}break;case 4:lr(a,s),Mr(s);break;case 13:lr(a,s),Mr(s),I=s.child,I.flags&8192&&(M=I.memoizedState!==null,I.stateNode.isHidden=M,!M||I.alternate!==null&&I.alternate.memoizedState!==null||(lm=Qe())),m&4&&HI(s);break;case 22:if(Ee=h!==null&&h.memoizedState!==null,s.mode&1?(Xn=(le=Xn)||Ee,lr(a,s),Xn=le):lr(a,s),Mr(s),m&8192){if(le=s.memoizedState!==null,(s.stateNode.isHidden=le)&&!Ee&&s.mode&1)for(ze=s,Ee=s.child;Ee!==null;){for(Ie=ze=Ee;ze!==null;){switch(ve=ze,Fe=ve.child,ve.tag){case 0:case 11:case 14:case 15:Fc(4,ve,ve.return);break;case 1:al(ve,ve.return);var Ve=ve.stateNode;if(typeof Ve.componentWillUnmount=="function"){m=ve,h=ve.return;try{a=m,Ve.props=a.memoizedProps,Ve.state=a.memoizedState,Ve.componentWillUnmount()}catch(Ye){cn(m,h,Ye)}}break;case 5:al(ve,ve.return);break;case 22:if(ve.memoizedState!==null){YI(Ie);continue}}Fe!==null?(Fe.return=ve,ze=Fe):YI(Ie)}Ee=Ee.sibling}e:for(Ee=null,Ie=s;;){if(Ie.tag===5){if(Ee===null){Ee=Ie;try{I=Ie.stateNode,le?(M=I.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none"):(W=Ie.stateNode,Z=Ie.memoizedProps.style,P=Z!=null&&Z.hasOwnProperty("display")?Z.display:null,W.style.display=Me("display",P))}catch(Ye){cn(s,s.return,Ye)}}}else if(Ie.tag===6){if(Ee===null)try{Ie.stateNode.nodeValue=le?"":Ie.memoizedProps}catch(Ye){cn(s,s.return,Ye)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===s)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===s)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===s)break e;Ee===Ie&&(Ee=null),Ie=Ie.return}Ee===Ie&&(Ee=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:lr(a,s),Mr(s),m&4&&HI(s);break;case 21:break;default:lr(a,s),Mr(s)}}function Mr(s){var a=s.flags;if(a&2){try{e:{for(var h=s.return;h!==null;){if(OI(h)){var m=h;break e}h=h.return}throw Error(t(160))}switch(m.tag){case 5:var I=m.stateNode;m.flags&32&&(Se(I,""),m.flags&=-33);var M=zI(s);sm(s,M,I);break;case 3:case 4:var P=m.stateNode.containerInfo,W=zI(s);rm(s,W,P);break;default:throw Error(t(161))}}catch(Z){cn(s,s.return,Z)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function Q6(s,a,h){ze=s,WI(s)}function WI(s,a,h){for(var m=(s.mode&1)!==0;ze!==null;){var I=ze,M=I.child;if(I.tag===22&&m){var P=I.memoizedState!==null||dh;if(!P){var W=I.alternate,Z=W!==null&&W.memoizedState!==null||Xn;W=dh;var le=Xn;if(dh=P,(Xn=Z)&&!le)for(ze=I;ze!==null;)P=ze,Z=P.child,P.tag===22&&P.memoizedState!==null?qI(I):Z!==null?(Z.return=P,ze=Z):qI(I);for(;M!==null;)ze=M,WI(M),M=M.sibling;ze=I,dh=W,Xn=le}jI(s)}else I.subtreeFlags&8772&&M!==null?(M.return=I,ze=M):jI(s)}}function jI(s){for(;ze!==null;){var a=ze;if(a.flags&8772){var h=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:Xn||Ah(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Xn)if(h===null)m.componentDidMount();else{var I=a.elementType===a.type?h.memoizedProps:or(a.type,h.memoizedProps);m.componentDidUpdate(I,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var M=a.updateQueue;M!==null&&HC(a,M,m);break;case 3:var P=a.updateQueue;if(P!==null){if(h=null,a.child!==null)switch(a.child.tag){case 5:h=a.child.stateNode;break;case 1:h=a.child.stateNode}HC(a,P,h)}break;case 5:var W=a.stateNode;if(h===null&&a.flags&4){h=W;var Z=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":Z.autoFocus&&h.focus();break;case"img":Z.src&&(h.src=Z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var le=a.alternate;if(le!==null){var Ee=le.memoizedState;if(Ee!==null){var Ie=Ee.dehydrated;Ie!==null&&gc(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Xn||a.flags&512&&im(a)}catch(ve){cn(a,a.return,ve)}}if(a===s){ze=null;break}if(h=a.sibling,h!==null){h.return=a.return,ze=h;break}ze=a.return}}function YI(s){for(;ze!==null;){var a=ze;if(a===s){ze=null;break}var h=a.sibling;if(h!==null){h.return=a.return,ze=h;break}ze=a.return}}function qI(s){for(;ze!==null;){var a=ze;try{switch(a.tag){case 0:case 11:case 15:var h=a.return;try{Ah(4,a)}catch(Z){cn(a,h,Z)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var I=a.return;try{m.componentDidMount()}catch(Z){cn(a,I,Z)}}var M=a.return;try{im(a)}catch(Z){cn(a,M,Z)}break;case 5:var P=a.return;try{im(a)}catch(Z){cn(a,P,Z)}}}catch(Z){cn(a,a.return,Z)}if(a===s){ze=null;break}var W=a.sibling;if(W!==null){W.return=a.return,ze=W;break}ze=a.return}}var O6=Math.ceil,ph=x.ReactCurrentDispatcher,om=x.ReactCurrentOwner,Vi=x.ReactCurrentBatchConfig,Rt=0,Pn=null,_n=null,zn=0,Li=0,ll=Ps(0),wn=0,Qc=null,bo=0,gh=0,am=0,Oc=null,mi=null,lm=0,cl=1/0,ss=null,mh=!1,cm=null,zs=null,vh=!1,Gs=null,_h=0,zc=0,um=null,Eh=-1,yh=0;function ai(){return Rt&6?Qe():Eh!==-1?Eh:Eh=Qe()}function Hs(s){return s.mode&1?Rt&2&&zn!==0?zn&-zn:I6.transition!==null?(yh===0&&(yh=Rf()),yh):(s=kt,s!==0||(s=window.event,s=s===void 0?16:Xy(s.type)),s):1}function cr(s,a,h,m){if(50<zc)throw zc=0,um=null,Error(t(185));fc(s,h,m),(!(Rt&2)||s!==Pn)&&(s===Pn&&(!(Rt&2)&&(gh|=h),wn===4&&Vs(s,zn)),vi(s,m),h===1&&Rt===0&&!(a.mode&1)&&(cl=Qe()+500,Xf&&ks()))}function vi(s,a){var h=s.callbackNode;si(s,a);var m=Qi(s,s===Pn?zn:0);if(m===0)h!==null&&ke(h),s.callbackNode=null,s.callbackPriority=0;else if(a=m&-m,s.callbackPriority!==a){if(h!=null&&ke(h),a===1)s.tag===0?C6(KI.bind(null,s)):NC(KI.bind(null,s)),v6(function(){!(Rt&6)&&ks()}),h=null;else{switch(zy(m)){case 1:h=ft;break;case 4:h=ht;break;case 16:h=jt;break;case 536870912:h=dn;break;default:h=jt}h=rx(h,XI.bind(null,s))}s.callbackPriority=a,s.callbackNode=h}}function XI(s,a){if(Eh=-1,yh=0,Rt&6)throw Error(t(327));var h=s.callbackNode;if(ul()&&s.callbackNode!==h)return null;var m=Qi(s,s===Pn?zn:0);if(m===0)return null;if(m&30||m&s.expiredLanes||a)a=Ch(s,m);else{a=m;var I=Rt;Rt|=2;var M=ZI();(Pn!==s||zn!==a)&&(ss=null,cl=Qe()+500,Do(s,a));do try{H6();break}catch(W){JI(s,W)}while(1);Tg(),ph.current=M,Rt=I,_n!==null?a=0:(Pn=null,zn=0,a=wn)}if(a!==0){if(a===2&&(I=Io(s),I!==0&&(m=I,a=fm(s,I))),a===1)throw h=Qc,Do(s,0),Vs(s,m),vi(s,Qe()),h;if(a===6)Vs(s,m);else{if(I=s.current.alternate,!(m&30)&&!z6(I)&&(a=Ch(s,m),a===2&&(M=Io(s),M!==0&&(m=M,a=fm(s,M))),a===1))throw h=Qc,Do(s,0),Vs(s,m),vi(s,Qe()),h;switch(s.finishedWork=I,s.finishedLanes=m,a){case 0:case 1:throw Error(t(345));case 2:No(s,mi,ss);break;case 3:if(Vs(s,m),(m&130023424)===m&&(a=lm+500-Qe(),10<a)){if(Qi(s,0)!==0)break;if(I=s.suspendedLanes,(I&m)!==m){ai(),s.pingedLanes|=s.suspendedLanes&I;break}s.timeoutHandle=mg(No.bind(null,s,mi,ss),a);break}No(s,mi,ss);break;case 4:if(Vs(s,m),(m&4194240)===m)break;for(a=s.eventTimes,I=-1;0<m;){var P=31-ri(m);M=1<<P,P=a[P],P>I&&(I=P),m&=~M}if(m=I,m=Qe()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*O6(m/1960))-m,10<m){s.timeoutHandle=mg(No.bind(null,s,mi,ss),m);break}No(s,mi,ss);break;case 5:No(s,mi,ss);break;default:throw Error(t(329))}}}return vi(s,Qe()),s.callbackNode===h?XI.bind(null,s):null}function fm(s,a){var h=Oc;return s.current.memoizedState.isDehydrated&&(Do(s,a).flags|=256),s=Ch(s,a),s!==2&&(a=mi,mi=h,a!==null&&hm(a)),s}function hm(s){mi===null?mi=s:mi.push.apply(mi,s)}function z6(s){for(var a=s;;){if(a.flags&16384){var h=a.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var I=h[m],M=I.getSnapshot;I=I.value;try{if(!rr(M(),I))return!1}catch{return!1}}}if(h=a.child,a.subtreeFlags&16384&&h!==null)h.return=a,a=h;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Vs(s,a){for(a&=~am,a&=~gh,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var h=31-ri(a),m=1<<h;s[h]=-1,a&=~m}}function KI(s){if(Rt&6)throw Error(t(327));ul();var a=Qi(s,0);if(!(a&1))return vi(s,Qe()),null;var h=Ch(s,a);if(s.tag!==0&&h===2){var m=Io(s);m!==0&&(a=m,h=fm(s,m))}if(h===1)throw h=Qc,Do(s,0),Vs(s,a),vi(s,Qe()),h;if(h===6)throw Error(t(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,No(s,mi,ss),vi(s,Qe()),null}function dm(s,a){var h=Rt;Rt|=1;try{return s(a)}finally{Rt=h,Rt===0&&(cl=Qe()+500,Xf&&ks())}}function Lo(s){Gs!==null&&Gs.tag===0&&!(Rt&6)&&ul();var a=Rt;Rt|=1;var h=Vi.transition,m=kt;try{if(Vi.transition=null,kt=1,s)return s()}finally{kt=m,Vi.transition=h,Rt=a,!(Rt&6)&&ks()}}function Am(){Li=ll.current,Zt(ll)}function Do(s,a){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,m6(h)),_n!==null)for(h=_n.return;h!==null;){var m=h;switch(Ig(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Yf();break;case 3:sl(),Zt(Ai),Zt(jn),Fg();break;case 5:Ug(m);break;case 4:sl();break;case 13:Zt(rn);break;case 19:Zt(rn);break;case 10:Bg(m.type._context);break;case 22:case 23:Am()}h=h.return}if(Pn=s,_n=s=Ws(s.current,null),zn=Li=a,wn=0,Qc=null,am=gh=bo=0,mi=Oc=null,To!==null){for(a=0;a<To.length;a++)if(h=To[a],m=h.interleaved,m!==null){h.interleaved=null;var I=m.next,M=h.pending;if(M!==null){var P=M.next;M.next=I,m.next=P}h.pending=m}To=null}return s}function JI(s,a){do{var h=_n;try{if(Tg(),oh.current=uh,ah){for(var m=sn.memoizedState;m!==null;){var I=m.queue;I!==null&&(I.pending=null),m=m.next}ah=!1}if(Ro=0,Nn=Sn=sn=null,Dc=!1,Nc=0,om.current=null,h===null||h.return===null){wn=1,Qc=a,_n=null;break}e:{var M=s,P=h.return,W=h,Z=a;if(a=zn,W.flags|=32768,Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=Z,Ee=W,Ie=Ee.tag;if(!(Ee.mode&1)&&(Ie===0||Ie===11||Ie===15)){var ve=Ee.alternate;ve?(Ee.updateQueue=ve.updateQueue,Ee.memoizedState=ve.memoizedState,Ee.lanes=ve.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Fe=CI(P);if(Fe!==null){Fe.flags&=-257,II(Fe,P,W,M,a),Fe.mode&1&&yI(M,le,a),a=Fe,Z=le;var Ve=a.updateQueue;if(Ve===null){var Ye=new Set;Ye.add(Z),a.updateQueue=Ye}else Ve.add(Z);break e}else{if(!(a&1)){yI(M,le,a),pm();break e}Z=Error(t(426))}}else if(en&&W.mode&1){var pn=CI(P);if(pn!==null){!(pn.flags&65536)&&(pn.flags|=256),II(pn,P,W,M,a),wg(ol(Z,W));break e}}M=Z=ol(Z,W),wn!==4&&(wn=2),Oc===null?Oc=[M]:Oc.push(M),M=P;do{switch(M.tag){case 3:M.flags|=65536,a&=-a,M.lanes|=a;var ie=_I(M,Z,a);GC(M,ie);break e;case 1:W=Z;var ne=M.type,ae=M.stateNode;if(!(M.flags&128)&&(typeof ne.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(zs===null||!zs.has(ae)))){M.flags|=65536,a&=-a,M.lanes|=a;var Be=EI(M,W,a);GC(M,Be);break e}}M=M.return}while(M!==null)}ex(h)}catch(Xe){a=Xe,_n===h&&h!==null&&(_n=h=h.return);continue}break}while(1)}function ZI(){var s=ph.current;return ph.current=uh,s===null?uh:s}function pm(){(wn===0||wn===3||wn===2)&&(wn=4),Pn===null||!(bo&268435455)&&!(gh&268435455)||Vs(Pn,zn)}function Ch(s,a){var h=Rt;Rt|=2;var m=ZI();(Pn!==s||zn!==a)&&(ss=null,Do(s,a));do try{G6();break}catch(I){JI(s,I)}while(1);if(Tg(),Rt=h,ph.current=m,_n!==null)throw Error(t(261));return Pn=null,zn=0,wn}function G6(){for(;_n!==null;)$I(_n)}function H6(){for(;_n!==null&&!et();)$I(_n)}function $I(s){var a=ix(s.alternate,s,Li);s.memoizedProps=s.pendingProps,a===null?ex(s):_n=a,om.current=null}function ex(s){var a=s;do{var h=a.alternate;if(s=a.return,a.flags&32768){if(h=U6(h,a),h!==null){h.flags&=32767,_n=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{wn=6,_n=null;return}}else if(h=P6(h,a,Li),h!==null){_n=h;return}if(a=a.sibling,a!==null){_n=a;return}_n=a=s}while(a!==null);wn===0&&(wn=5)}function No(s,a,h){var m=kt,I=Vi.transition;try{Vi.transition=null,kt=1,V6(s,a,h,m)}finally{Vi.transition=I,kt=m}return null}function V6(s,a,h,m){do ul();while(Gs!==null);if(Rt&6)throw Error(t(327));h=s.finishedWork;var I=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(t(177));s.callbackNode=null,s.callbackPriority=0;var M=h.lanes|h.childLanes;if(xD(s,M),s===Pn&&(_n=Pn=null,zn=0),!(h.subtreeFlags&2064)&&!(h.flags&2064)||vh||(vh=!0,rx(jt,function(){return ul(),null})),M=(h.flags&15990)!==0,h.subtreeFlags&15990||M){M=Vi.transition,Vi.transition=null;var P=kt;kt=1;var W=Rt;Rt|=4,om.current=null,F6(s,h),VI(h,s),u6(pg),Df=!!Ag,pg=Ag=null,s.current=h,Q6(h),at(),Rt=W,kt=P,Vi.transition=M}else s.current=h;if(vh&&(vh=!1,Gs=s,_h=I),M=s.pendingLanes,M===0&&(zs=null),Et(h.stateNode),vi(s,Qe()),a!==null)for(m=s.onRecoverableError,h=0;h<a.length;h++)I=a[h],m(I.value,{componentStack:I.stack,digest:I.digest});if(mh)throw mh=!1,s=cm,cm=null,s;return _h&1&&s.tag!==0&&ul(),M=s.pendingLanes,M&1?s===um?zc++:(zc=0,um=s):zc=0,ks(),null}function ul(){if(Gs!==null){var s=zy(_h),a=Vi.transition,h=kt;try{if(Vi.transition=null,kt=16>s?16:s,Gs===null)var m=!1;else{if(s=Gs,Gs=null,_h=0,Rt&6)throw Error(t(331));var I=Rt;for(Rt|=4,ze=s.current;ze!==null;){var M=ze,P=M.child;if(ze.flags&16){var W=M.deletions;if(W!==null){for(var Z=0;Z<W.length;Z++){var le=W[Z];for(ze=le;ze!==null;){var Ee=ze;switch(Ee.tag){case 0:case 11:case 15:Fc(8,Ee,M)}var Ie=Ee.child;if(Ie!==null)Ie.return=Ee,ze=Ie;else for(;ze!==null;){Ee=ze;var ve=Ee.sibling,Fe=Ee.return;if(QI(Ee),Ee===le){ze=null;break}if(ve!==null){ve.return=Fe,ze=ve;break}ze=Fe}}}var Ve=M.alternate;if(Ve!==null){var Ye=Ve.child;if(Ye!==null){Ve.child=null;do{var pn=Ye.sibling;Ye.sibling=null,Ye=pn}while(Ye!==null)}}ze=M}}if(M.subtreeFlags&2064&&P!==null)P.return=M,ze=P;else e:for(;ze!==null;){if(M=ze,M.flags&2048)switch(M.tag){case 0:case 11:case 15:Fc(9,M,M.return)}var ie=M.sibling;if(ie!==null){ie.return=M.return,ze=ie;break e}ze=M.return}}var ne=s.current;for(ze=ne;ze!==null;){P=ze;var ae=P.child;if(P.subtreeFlags&2064&&ae!==null)ae.return=P,ze=ae;else e:for(P=ne;ze!==null;){if(W=ze,W.flags&2048)try{switch(W.tag){case 0:case 11:case 15:Ah(9,W)}}catch(Xe){cn(W,W.return,Xe)}if(W===P){ze=null;break e}var Be=W.sibling;if(Be!==null){Be.return=W.return,ze=Be;break e}ze=W.return}}if(Rt=I,ks(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(di,s)}catch{}m=!0}return m}finally{kt=h,Vi.transition=a}}return!1}function tx(s,a,h){a=ol(h,a),a=_I(s,a,1),s=Qs(s,a,1),a=ai(),s!==null&&(fc(s,1,a),vi(s,a))}function cn(s,a,h){if(s.tag===3)tx(s,s,h);else for(;a!==null;){if(a.tag===3){tx(a,s,h);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(zs===null||!zs.has(m))){s=ol(h,s),s=EI(a,s,1),a=Qs(a,s,1),s=ai(),a!==null&&(fc(a,1,s),vi(a,s));break}}a=a.return}}function W6(s,a,h){var m=s.pingCache;m!==null&&m.delete(a),a=ai(),s.pingedLanes|=s.suspendedLanes&h,Pn===s&&(zn&h)===h&&(wn===4||wn===3&&(zn&130023424)===zn&&500>Qe()-lm?Do(s,0):am|=h),vi(s,a)}function nx(s,a){a===0&&(s.mode&1?(a=Ms,Ms<<=1,!(Ms&130023424)&&(Ms=4194304)):a=1);var h=ai();s=ns(s,a),s!==null&&(fc(s,a,h),vi(s,h))}function j6(s){var a=s.memoizedState,h=0;a!==null&&(h=a.retryLane),nx(s,h)}function Y6(s,a){var h=0;switch(s.tag){case 13:var m=s.stateNode,I=s.memoizedState;I!==null&&(h=I.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(t(314))}m!==null&&m.delete(a),nx(s,h)}var ix;ix=function(s,a,h){if(s!==null)if(s.memoizedProps!==a.pendingProps||Ai.current)gi=!0;else{if(!(s.lanes&h)&&!(a.flags&128))return gi=!1,N6(s,a,h);gi=!!(s.flags&131072)}else gi=!1,en&&a.flags&1048576&&PC(a,Jf,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;hh(s,a),s=a.pendingProps;var I=Za(a,jn.current);il(a,h),I=zg(null,a,m,s,I,h);var M=Gg();return a.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,pi(m)?(M=!0,qf(a)):M=!1,a.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,Lg(a),I.updater=ih,a.stateNode=I,I._reactInternals=a,Ng(a,m,s,h),a=Kg(null,a,m,!0,M,h)):(a.tag=0,en&&M&&Cg(a),oi(null,a,I,h),a=a.child),a;case 16:m=a.elementType;e:{switch(hh(s,a),s=a.pendingProps,I=m._init,m=I(m._payload),a.type=m,I=a.tag=X6(m),s=or(m,s),I){case 0:a=Xg(null,a,m,s,h);break e;case 1:a=BI(null,a,m,s,h);break e;case 11:a=xI(null,a,m,s,h);break e;case 14:a=SI(null,a,m,or(m.type,s),h);break e}throw Error(t(306,m,""))}return a;case 0:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),Xg(s,a,m,I,h);case 1:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),BI(s,a,m,I,h);case 3:e:{if(RI(a),s===null)throw Error(t(387));m=a.pendingProps,M=a.memoizedState,I=M.element,zC(s,a),nh(a,m,null,h);var P=a.memoizedState;if(m=P.element,M.isDehydrated)if(M={element:m,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},a.updateQueue.baseState=M,a.memoizedState=M,a.flags&256){I=ol(Error(t(423)),a),a=bI(s,a,m,h,I);break e}else if(m!==I){I=ol(Error(t(424)),a),a=bI(s,a,m,h,I);break e}else for(bi=Ns(a.stateNode.containerInfo.firstChild),Ri=a,en=!0,sr=null,h=KC(a,null,m,h),a.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(tl(),m===I){a=rs(s,a,h);break e}oi(s,a,m,h)}a=a.child}return a;case 5:return JC(a),s===null&&Sg(a),m=a.type,I=a.pendingProps,M=s!==null?s.memoizedProps:null,P=I.children,gg(m,I)?P=null:M!==null&&gg(m,M)&&(a.flags|=32),TI(s,a),oi(s,a,P,h),a.child;case 6:return s===null&&Sg(a),null;case 13:return LI(s,a,h);case 4:return Pg(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=rl(a,null,m,h):oi(s,a,m,h),a.child;case 11:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),xI(s,a,m,I,h);case 7:return oi(s,a,a.pendingProps,h),a.child;case 8:return oi(s,a,a.pendingProps.children,h),a.child;case 12:return oi(s,a,a.pendingProps.children,h),a.child;case 10:e:{if(m=a.type._context,I=a.pendingProps,M=a.memoizedProps,P=I.value,Yt($f,m._currentValue),m._currentValue=P,M!==null)if(rr(M.value,P)){if(M.children===I.children&&!Ai.current){a=rs(s,a,h);break e}}else for(M=a.child,M!==null&&(M.return=a);M!==null;){var W=M.dependencies;if(W!==null){P=M.child;for(var Z=W.firstContext;Z!==null;){if(Z.context===m){if(M.tag===1){Z=is(-1,h&-h),Z.tag=2;var le=M.updateQueue;if(le!==null){le=le.shared;var Ee=le.pending;Ee===null?Z.next=Z:(Z.next=Ee.next,Ee.next=Z),le.pending=Z}}M.lanes|=h,Z=M.alternate,Z!==null&&(Z.lanes|=h),Rg(M.return,h,a),W.lanes|=h;break}Z=Z.next}}else if(M.tag===10)P=M.type===a.type?null:M.child;else if(M.tag===18){if(P=M.return,P===null)throw Error(t(341));P.lanes|=h,W=P.alternate,W!==null&&(W.lanes|=h),Rg(P,h,a),P=M.sibling}else P=M.child;if(P!==null)P.return=M;else for(P=M;P!==null;){if(P===a){P=null;break}if(M=P.sibling,M!==null){M.return=P.return,P=M;break}P=P.return}M=P}oi(s,a,I.children,h),a=a.child}return a;case 9:return I=a.type,m=a.pendingProps.children,il(a,h),I=Gi(I),m=m(I),a.flags|=1,oi(s,a,m,h),a.child;case 14:return m=a.type,I=or(m,a.pendingProps),I=or(m.type,I),SI(s,a,m,I,h);case 15:return wI(s,a,a.type,a.pendingProps,h);case 17:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),hh(s,a),a.tag=1,pi(m)?(s=!0,qf(a)):s=!1,il(a,h),jC(a,m,I),Ng(a,m,I,h),Kg(null,a,m,!0,s,h);case 19:return NI(s,a,h);case 22:return MI(s,a,h)}throw Error(t(156,a.tag))};function rx(s,a){return fe(s,a)}function q6(s,a,h,m){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(s,a,h,m){return new q6(s,a,h,m)}function gm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function X6(s){if(typeof s=="function")return gm(s)?1:0;if(s!=null){if(s=s.$$typeof,s===k)return 11;if(s===V)return 14}return 2}function Ws(s,a){var h=s.alternate;return h===null?(h=Wi(s.tag,a,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=a,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,a=s.dependencies,h.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Ih(s,a,h,m,I,M){var P=2;if(m=s,typeof s=="function")gm(s)&&(P=1);else if(typeof s=="string")P=5;else e:switch(s){case B:return Po(h.children,I,M,a);case L:P=8,I|=8;break;case R:return s=Wi(12,h,a,I|2),s.elementType=R,s.lanes=M,s;case O:return s=Wi(13,h,a,I),s.elementType=O,s.lanes=M,s;case F:return s=Wi(19,h,a,I),s.elementType=F,s.lanes=M,s;case te:return xh(h,I,M,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:P=10;break e;case N:P=9;break e;case k:P=11;break e;case V:P=14;break e;case X:P=16,m=null;break e}throw Error(t(130,s==null?s:typeof s,""))}return a=Wi(P,h,a,I),a.elementType=s,a.type=m,a.lanes=M,a}function Po(s,a,h,m){return s=Wi(7,s,m,a),s.lanes=h,s}function xh(s,a,h,m){return s=Wi(22,s,m,a),s.elementType=te,s.lanes=h,s.stateNode={isHidden:!1},s}function mm(s,a,h){return s=Wi(6,s,null,a),s.lanes=h,s}function vm(s,a,h){return a=Wi(4,s.children!==null?s.children:[],s.key,a),a.lanes=h,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function K6(s,a,h,m,I){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ga(0),this.expirationTimes=Ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ga(0),this.identifierPrefix=m,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function _m(s,a,h,m,I,M,P,W,Z){return s=new K6(s,a,h,W,Z),a===1?(a=1,M===!0&&(a|=8)):a=0,M=Wi(3,null,null,a),s.current=M,M.stateNode=s,M.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lg(M),s}function J6(s,a,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:m==null?null:""+m,children:s,containerInfo:a,implementation:h}}function sx(s){if(!s)return Us;s=s._reactInternals;e:{if(Kr(s)!==s||s.tag!==1)throw Error(t(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(pi(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(t(171))}if(s.tag===1){var h=s.type;if(pi(h))return LC(s,h,a)}return a}function ox(s,a,h,m,I,M,P,W,Z){return s=_m(h,m,!0,s,I,M,P,W,Z),s.context=sx(null),h=s.current,m=ai(),I=Hs(h),M=is(m,I),M.callback=a??null,Qs(h,M,I),s.current.lanes=I,fc(s,I,m),vi(s,m),s}function Sh(s,a,h,m){var I=a.current,M=ai(),P=Hs(I);return h=sx(h),a.context===null?a.context=h:a.pendingContext=h,a=is(M,P),a.payload={element:s},m=m===void 0?null:m,m!==null&&(a.callback=m),s=Qs(I,a,P),s!==null&&(cr(s,I,P,M),th(s,I,P)),P}function wh(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function ax(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<a?h:a}}function Em(s,a){ax(s,a),(s=s.alternate)&&ax(s,a)}function Z6(){return null}var lx=typeof reportError=="function"?reportError:function(s){console.error(s)};function ym(s){this._internalRoot=s}Mh.prototype.render=ym.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(t(409));Sh(s,a,null,null)},Mh.prototype.unmount=ym.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;Lo(function(){Sh(null,s,null,null)}),a[Zr]=null}};function Mh(s){this._internalRoot=s}Mh.prototype.unstable_scheduleHydration=function(s){if(s){var a=Vy();s={blockedOn:null,target:s,priority:a};for(var h=0;h<bs.length&&a!==0&&a<bs[h].priority;h++);bs.splice(h,0,s),h===0&&Yy(s)}};function Cm(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Th(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function cx(){}function $6(s,a,h,m,I){if(I){if(typeof m=="function"){var M=m;m=function(){var le=wh(P);M.call(le)}}var P=ox(a,m,s,0,null,!1,!1,"",cx);return s._reactRootContainer=P,s[Zr]=P.current,Sc(s.nodeType===8?s.parentNode:s),Lo(),P}for(;I=s.lastChild;)s.removeChild(I);if(typeof m=="function"){var W=m;m=function(){var le=wh(Z);W.call(le)}}var Z=_m(s,0,!1,null,null,!1,!1,"",cx);return s._reactRootContainer=Z,s[Zr]=Z.current,Sc(s.nodeType===8?s.parentNode:s),Lo(function(){Sh(a,Z,h,m)}),Z}function Bh(s,a,h,m,I){var M=h._reactRootContainer;if(M){var P=M;if(typeof I=="function"){var W=I;I=function(){var Z=wh(P);W.call(Z)}}Sh(a,P,s,I)}else P=$6(h,a,s,I,m);return wh(P)}Gy=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var h=An(a.pendingLanes);h!==0&&(jp(a,h|1),vi(a,Qe()),!(Rt&6)&&(cl=Qe()+500,ks()))}break;case 13:Lo(function(){var m=ns(s,1);if(m!==null){var I=ai();cr(m,s,1,I)}}),Em(s,1)}},Yp=function(s){if(s.tag===13){var a=ns(s,134217728);if(a!==null){var h=ai();cr(a,s,134217728,h)}Em(s,134217728)}},Hy=function(s){if(s.tag===13){var a=Hs(s),h=ns(s,a);if(h!==null){var m=ai();cr(h,s,a,m)}Em(s,a)}},Vy=function(){return kt},Wy=function(s,a){var h=kt;try{return kt=s,a()}finally{kt=h}},dt=function(s,a,h){switch(a){case"input":if(it(s,h),a=h.name,h.type==="radio"&&a!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<h.length;a++){var m=h[a];if(m!==s&&m.form===s.form){var I=jf(m);if(!I)throw Error(t(90));oe(m),it(m,I)}}}break;case"textarea":Q(s,h);break;case"select":a=h.value,a!=null&&lt(s,!!h.multiple,a,!1)}},qe=dm,At=Lo;var eN={usingClientEntryPoint:!1,Events:[Tc,Ka,jf,he,we,dm]},Gc={findFiberByHostInstance:xo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tN={bundleType:Gc.bundleType,version:Gc.version,rendererPackageName:Gc.rendererPackageName,rendererConfig:Gc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=ce(s),s===null?null:s.stateNode},findFiberByHostInstance:Gc.findFiberByHostInstance||Z6,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 Rh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rh.isDisabled&&Rh.supportsFiber)try{di=Rh.inject(tN),Bt=Rh}catch{}}return hi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eN,hi.createPortal=function(s,a){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cm(a))throw Error(t(200));return J6(s,a,null,h)},hi.createRoot=function(s,a){if(!Cm(s))throw Error(t(299));var h=!1,m="",I=lx;return a!=null&&(a.unstable_strictMode===!0&&(h=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(I=a.onRecoverableError)),a=_m(s,1,!1,null,null,h,!1,m,I),s[Zr]=a.current,Sc(s.nodeType===8?s.parentNode:s),new ym(a)},hi.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(t(188)):(s=Object.keys(s).join(","),Error(t(268,s)));return s=ce(a),s=s===null?null:s.stateNode,s},hi.flushSync=function(s){return Lo(s)},hi.hydrate=function(s,a,h){if(!Th(a))throw Error(t(200));return Bh(null,s,a,!0,h)},hi.hydrateRoot=function(s,a,h){if(!Cm(s))throw Error(t(405));var m=h!=null&&h.hydratedSources||null,I=!1,M="",P=lx;if(h!=null&&(h.unstable_strictMode===!0&&(I=!0),h.identifierPrefix!==void 0&&(M=h.identifierPrefix),h.onRecoverableError!==void 0&&(P=h.onRecoverableError)),a=ox(a,null,s,1,h??null,I,!1,M,P),s[Zr]=a.current,Sc(s),m)for(s=0;s<m.length;s++)h=m[s],I=h._getVersion,I=I(h._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[h,I]:a.mutableSourceEagerHydrationData.push(h,I);return new Mh(a)},hi.render=function(s,a,h){if(!Th(a))throw Error(t(200));return Bh(null,s,a,!1,h)},hi.unmountComponentAtNode=function(s){if(!Th(s))throw Error(t(40));return s._reactRootContainer?(Lo(function(){Bh(null,null,s,!1,function(){s._reactRootContainer=null,s[Zr]=null})}),!0):!1},hi.unstable_batchedUpdates=dm,hi.unstable_renderSubtreeIntoContainer=function(s,a,h,m){if(!Th(h))throw Error(t(200));if(s==null||s._reactInternals===void 0)throw Error(t(38));return Bh(s,a,h,!1,m)},hi.version="18.2.0-next-9e3b772b8-20220608",hi}function wy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wy)}catch(i){console.error(i)}}wy(),Cy.exports=sD();var oD=Cy.exports,My=oD;Op.createRoot=My.createRoot,Op.hydrateRoot=My.hydrateRoot;class aD{constructor({apiService:e,events:t}){Lt(this,"targetElement");Lt(this,"apiService");Lt(this,"events");Lt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",r=document.getElementById(n);if(!r)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=r,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Op.createRoot(document.getElementById(n))}this.targetElement.render(Hc.createElement(nD,{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 Hp={exports:{}},za=typeof Reflect=="object"?Reflect:null,Ty=za&&typeof za.apply=="function"?za.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},xf;za&&typeof za.ownKeys=="function"?xf=za.ownKeys:Object.getOwnPropertySymbols?xf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:xf=function(e){return Object.getOwnPropertyNames(e)};function lD(i){console&&console.warn&&console.warn(i)}var By=Number.isNaN||function(e){return e!==e};function zt(){zt.init.call(this)}Hp.exports=zt,Hp.exports.once=hD,zt.EventEmitter=zt,zt.prototype._events=void 0,zt.prototype._eventsCount=0,zt.prototype._maxListeners=void 0;var Ry=10;function Sf(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(zt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ry},set:function(i){if(typeof i!="number"||i<0||By(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Ry=i}}),zt.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},zt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||By(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 by(i){return i._maxListeners===void 0?zt.defaultMaxListeners:i._maxListeners}zt.prototype.getMaxListeners=function(){return by(this)},zt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var c=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw c.context=l,c}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Ty(f,this,t);else for(var u=f.length,d=Uy(f,u),n=0;n<u;++n)Ty(d[n],this,t);return!0};function Ly(i,e,t,n){var r,o,l;if(Sf(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=n?[t,l]:[l,t]:n?l.unshift(t):l.push(t),r=by(i),r>0&&l.length>r&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=i,c.type=e,c.count=l.length,lD(c)}return i}zt.prototype.addListener=function(e,t){return Ly(this,e,t,!1)},zt.prototype.on=zt.prototype.addListener,zt.prototype.prependListener=function(e,t){return Ly(this,e,t,!0)};function cD(){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 Dy(i,e,t){var n={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},r=cD.bind(n);return r.listener=t,n.wrapFn=r,r}zt.prototype.once=function(e,t){return Sf(t),this.on(e,Dy(this,e,t)),this},zt.prototype.prependOnceListener=function(e,t){return Sf(t),this.prependListener(e,Dy(this,e,t)),this},zt.prototype.removeListener=function(e,t){var n,r,o,l,c;if(Sf(t),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===t||n[l].listener===t){c=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():uD(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},zt.prototype.off=zt.prototype.removeListener,zt.prototype.removeAllListeners=function(e){var t,n,r;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 o=Object.keys(n),l;for(r=0;r<o.length;++r)l=o[r],l!=="removeListener"&&this.removeAllListeners(l);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(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function Ny(i,e,t){var n=i._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?fD(r):Uy(r,r.length)}zt.prototype.listeners=function(e){return Ny(this,e,!0)},zt.prototype.rawListeners=function(e){return Ny(this,e,!1)},zt.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):Py.call(i,e)},zt.prototype.listenerCount=Py;function Py(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}zt.prototype.eventNames=function(){return this._eventsCount>0?xf(this._events):[]};function Uy(i,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=i[n];return t}function uD(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function fD(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function hD(i,e){return new Promise(function(t,n){function r(l){i.removeListener(e,o),n(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",r),t([].slice.call(arguments))}ky(i,e,o,{once:!0}),e!=="error"&&dD(i,r,{once:!0})})}function dD(i,e,t){typeof i.on=="function"&&ky(i,"error",e,t)}function ky(i,e,t,n){if(typeof i.on=="function")n.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function r(o){n.once&&i.removeEventListener(e,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var AD=Hp.exports;const cc=class cc extends AD.EventEmitter{emitEvent(e,t){Object.keys(cc.EVENTS).includes(e)&&this.emit(cc.EVENTS[e],t)}};Lt(cc,"EVENTS",{onAddToCart:"add-to-cart"});let Vp=cc;const pD={getCartUrl:((Qy=window.Shopify)==null?void 0:Qy.routes.root)+"cart.js",addToCartUrl:((Oy=window.Shopify)==null?void 0:Oy.routes.root)+"cart/add.js"},Fy=Object.freeze(pD);class gD{constructor(e){Lt(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:mD,error:vD}=console,_D=(...i)=>{vD("❌ Sprie Error:",...i)},ED="&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&",yD={HOST:Br.host,STORE_PREFIX:Br.storePrefix},CD={addToCartUrl:Fy.addToCartUrl,getCartUrl:Fy.getCartUrl};class ID{constructor(){Lt(this,"sdkService");Lt(this,"apiService");Lt(this,"uiService");Lt(this,"events");this.events=new Vp,this.apiService=new hx(new Ys(yD),new gD(CD)),this.uiService=new aD({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:Br,log:mD,logErr:_D,metaData:{appVersion:ux,previewUrlPrams:ED,targetClassName:"sprie-embed-element"}};this.sdkService=new dx(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 ID})();
4256
+ `+M.stack}return{value:s,source:a,stack:I,digest:null}}function Yg(s,a,h){return{value:s,source:null,stack:h??null,digest:a??null}}function qg(s,a){try{console.error(a.value)}catch(h){setTimeout(function(){throw h})}}var b6=typeof WeakMap=="function"?WeakMap:Map;function _I(s,a,h){h=is(-1,h),h.tag=3,h.payload={element:null};var m=a.value;return h.callback=function(){mh||(mh=!0,cm=m),qg(s,a)},h}function EI(s,a,h){h=is(-1,h),h.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var I=a.value;h.payload=function(){return m(I)},h.callback=function(){qg(s,a)}}var M=s.stateNode;return M!==null&&typeof M.componentDidCatch=="function"&&(h.callback=function(){qg(s,a),typeof m!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var P=a.stack;this.componentDidCatch(a.value,{componentStack:P!==null?P:""})}),h}function yI(s,a,h){var m=s.pingCache;if(m===null){m=s.pingCache=new b6;var I=new Set;m.set(a,I)}else I=m.get(a),I===void 0&&(I=new Set,m.set(a,I));I.has(h)||(I.add(h),s=W6.bind(null,s,a,h),a.then(s,s))}function CI(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function II(s,a,h,m,I){return s.mode&1?(s.flags|=65536,s.lanes=I,s):(s===a?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(a=is(-1,1),a.tag=2,Qs(h,a,1))),h.lanes|=1),s)}var L6=S.ReactCurrentOwner,gi=!1;function oi(s,a,h,m){a.child=s===null?KC(a,null,h,m):rl(a,s.child,h,m)}function xI(s,a,h,m,I){h=h.render;var M=a.ref;return il(a,I),m=zg(s,a,h,m,M,I),h=Gg(),s!==null&&!gi?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~I,rs(s,a,I)):(en&&h&&Cg(a),a.flags|=1,oi(s,a,m,I),a.child)}function SI(s,a,h,m,I){if(s===null){var M=h.type;return typeof M=="function"&&!gm(M)&&M.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(a.tag=15,a.type=M,wI(s,a,M,m,I)):(s=Ih(h.type,null,m,a,a.mode,I),s.ref=a.ref,s.return=a,a.child=s)}if(M=s.child,!(s.lanes&I)){var P=M.memoizedProps;if(h=h.compare,h=h!==null?h:Cc,h(P,m)&&s.ref===a.ref)return rs(s,a,I)}return a.flags|=1,s=Ws(M,m),s.ref=a.ref,s.return=a,a.child=s}function wI(s,a,h,m,I){if(s!==null){var M=s.memoizedProps;if(Cc(M,m)&&s.ref===a.ref)if(gi=!1,a.pendingProps=m=M,(s.lanes&I)!==0)s.flags&131072&&(gi=!0);else return a.lanes=s.lanes,rs(s,a,I)}return Xg(s,a,h,m,I)}function MI(s,a,h){var m=a.pendingProps,I=m.children,M=s!==null?s.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yt(ll,Li),Li|=h;else{if(!(h&1073741824))return s=M!==null?M.baseLanes|h:h,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,Yt(ll,Li),Li|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=M!==null?M.baseLanes:h,Yt(ll,Li),Li|=m}else M!==null?(m=M.baseLanes|h,a.memoizedState=null):m=h,Yt(ll,Li),Li|=m;return oi(s,a,I,h),a.child}function TI(s,a){var h=a.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(a.flags|=512,a.flags|=2097152)}function Xg(s,a,h,m,I){var M=pi(h)?So:jn.current;return M=$a(a,M),il(a,I),h=zg(s,a,h,m,M,I),m=Gg(),s!==null&&!gi?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~I,rs(s,a,I)):(en&&m&&Cg(a),a.flags|=1,oi(s,a,h,I),a.child)}function BI(s,a,h,m,I){if(pi(h)){var M=!0;qf(a)}else M=!1;if(il(a,I),a.stateNode===null)hh(s,a),jC(a,h,m),Ng(a,h,m,I),m=!0;else if(s===null){var P=a.stateNode,W=a.memoizedProps;P.props=W;var $=P.context,le=h.contextType;typeof le=="object"&&le!==null?le=Gi(le):(le=pi(h)?So:jn.current,le=$a(a,le));var _e=h.getDerivedStateFromProps,Ie=typeof _e=="function"||typeof P.getSnapshotBeforeUpdate=="function";Ie||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==m||$!==le)&&YC(a,P,m,le),Fs=!1;var ve=a.memoizedState;P.state=ve,nh(a,m,P,I),$=a.memoizedState,W!==m||ve!==$||Ai.current||Fs?(typeof _e=="function"&&(Dg(a,h,_e,m),$=a.memoizedState),(W=Fs||WC(a,h,W,m,ve,$,le))?(Ie||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(a.flags|=4194308)):(typeof P.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=$),P.props=m,P.state=$,P.context=le,m=W):(typeof P.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{P=a.stateNode,zC(s,a),W=a.memoizedProps,le=a.type===a.elementType?W:or(a.type,W),P.props=le,Ie=a.pendingProps,ve=P.context,$=h.contextType,typeof $=="object"&&$!==null?$=Gi($):($=pi(h)?So:jn.current,$=$a(a,$));var Fe=h.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==Ie||ve!==$)&&YC(a,P,m,$),Fs=!1,ve=a.memoizedState,P.state=ve,nh(a,m,P,I);var Ve=a.memoizedState;W!==Ie||ve!==Ve||Ai.current||Fs?(typeof Fe=="function"&&(Dg(a,h,Fe,m),Ve=a.memoizedState),(le=Fs||WC(a,h,le,m,ve,Ve,$)||!1)?(_e||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(m,Ve,$),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(m,Ve,$)),typeof P.componentDidUpdate=="function"&&(a.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof P.componentDidUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=Ve),P.props=m,P.state=Ve,P.context=$,m=le):(typeof P.componentDidUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),m=!1)}return Kg(s,a,h,m,M,I)}function Kg(s,a,h,m,I,M){TI(s,a);var P=(a.flags&128)!==0;if(!m&&!P)return I&&DC(a,h,!1),rs(s,a,M);m=a.stateNode,L6.current=a;var W=P&&typeof h.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,s!==null&&P?(a.child=rl(a,s.child,null,M),a.child=rl(a,null,W,M)):oi(s,a,W,M),a.memoizedState=m.state,I&&DC(a,h,!0),a.child}function RI(s){var a=s.stateNode;a.pendingContext?bC(s,a.pendingContext,a.pendingContext!==a.context):a.context&&bC(s,a.context,!1),Pg(s,a.containerInfo)}function bI(s,a,h,m,I){return tl(),wg(I),a.flags|=256,oi(s,a,h,m),a.child}var Jg={dehydrated:null,treeContext:null,retryLane:0};function $g(s){return{baseLanes:s,cachePool:null,transitions:null}}function LI(s,a,h){var m=a.pendingProps,I=rn.current,M=!1,P=(a.flags&128)!==0,W;if((W=P)||(W=s!==null&&s.memoizedState===null?!1:(I&2)!==0),W?(M=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(I|=1),Yt(rn,I&1),s===null)return Sg(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(a.mode&1?s.data==="$!"?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(P=m.children,s=m.fallback,M?(m=a.mode,M=a.child,P={mode:"hidden",children:P},!(m&1)&&M!==null?(M.childLanes=0,M.pendingProps=P):M=xh(P,m,0,null),s=Po(s,m,h,null),M.return=a,s.return=a,M.sibling=s,a.child=M,a.child.memoizedState=$g(h),a.memoizedState=Jg,s):Zg(a,P));if(I=s.memoizedState,I!==null&&(W=I.dehydrated,W!==null))return D6(s,a,P,m,W,I,h);if(M){M=m.fallback,P=a.mode,I=s.child,W=I.sibling;var $={mode:"hidden",children:m.children};return!(P&1)&&a.child!==I?(m=a.child,m.childLanes=0,m.pendingProps=$,a.deletions=null):(m=Ws(I,$),m.subtreeFlags=I.subtreeFlags&14680064),W!==null?M=Ws(W,M):(M=Po(M,P,h,null),M.flags|=2),M.return=a,m.return=a,m.sibling=M,a.child=m,m=M,M=a.child,P=s.child.memoizedState,P=P===null?$g(h):{baseLanes:P.baseLanes|h,cachePool:null,transitions:P.transitions},M.memoizedState=P,M.childLanes=s.childLanes&~h,a.memoizedState=Jg,m}return M=s.child,s=M.sibling,m=Ws(M,{mode:"visible",children:m.children}),!(a.mode&1)&&(m.lanes=h),m.return=a,m.sibling=null,s!==null&&(h=a.deletions,h===null?(a.deletions=[s],a.flags|=16):h.push(s)),a.child=m,a.memoizedState=null,m}function Zg(s,a){return a=xh({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function fh(s,a,h,m){return m!==null&&wg(m),rl(a,s.child,null,h),s=Zg(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function D6(s,a,h,m,I,M,P){if(h)return a.flags&256?(a.flags&=-257,m=Yg(Error(t(422))),fh(s,a,P,m)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(M=m.fallback,I=a.mode,m=xh({mode:"visible",children:m.children},I,0,null),M=Po(M,I,P,null),M.flags|=2,m.return=a,M.return=a,m.sibling=M,a.child=m,a.mode&1&&rl(a,s.child,null,P),a.child.memoizedState=$g(P),a.memoizedState=Jg,M);if(!(a.mode&1))return fh(s,a,P,null);if(I.data==="$!"){if(m=I.nextSibling&&I.nextSibling.dataset,m)var W=m.dgst;return m=W,M=Error(t(419)),m=Yg(M,m,void 0),fh(s,a,P,m)}if(W=(P&s.childLanes)!==0,gi||W){if(m=Pn,m!==null){switch(P&-P){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(m.suspendedLanes|P)?0:I,I!==0&&I!==M.retryLane&&(M.retryLane=I,ns(s,I),cr(m,s,I,-1))}return pm(),m=Yg(Error(t(421))),fh(s,a,P,m)}return I.data==="$?"?(a.flags|=128,a.child=s.child,a=j6.bind(null,s),I._reactRetry=a,null):(s=M.treeContext,bi=Ns(I.nextSibling),Ri=a,en=!0,sr=null,s!==null&&(Oi[zi++]=es,Oi[zi++]=ts,Oi[zi++]=wo,es=s.id,ts=s.overflow,wo=a),a=Zg(a,m.children),a.flags|=4096,a)}function DI(s,a,h){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),Rg(s.return,a,h)}function em(s,a,h,m,I){var M=s.memoizedState;M===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:I}:(M.isBackwards=a,M.rendering=null,M.renderingStartTime=0,M.last=m,M.tail=h,M.tailMode=I)}function NI(s,a,h){var m=a.pendingProps,I=m.revealOrder,M=m.tail;if(oi(s,a,m.children,h),m=rn.current,m&2)m=m&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&DI(s,h,a);else if(s.tag===19)DI(s,h,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Yt(rn,m),!(a.mode&1))a.memoizedState=null;else switch(I){case"forwards":for(h=a.child,I=null;h!==null;)s=h.alternate,s!==null&&sh(s)===null&&(I=h),h=h.sibling;h=I,h===null?(I=a.child,a.child=null):(I=h.sibling,h.sibling=null),em(a,!1,I,h,M);break;case"backwards":for(h=null,I=a.child,a.child=null;I!==null;){if(s=I.alternate,s!==null&&sh(s)===null){a.child=I;break}s=I.sibling,I.sibling=h,h=I,I=s}em(a,!0,h,null,M);break;case"together":em(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function hh(s,a){!(a.mode&1)&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function rs(s,a,h){if(s!==null&&(a.dependencies=s.dependencies),bo|=a.lanes,!(h&a.childLanes))return null;if(s!==null&&a.child!==s.child)throw Error(t(153));if(a.child!==null){for(s=a.child,h=Ws(s,s.pendingProps),a.child=h,h.return=a;s.sibling!==null;)s=s.sibling,h=h.sibling=Ws(s,s.pendingProps),h.return=a;h.sibling=null}return a.child}function N6(s,a,h){switch(a.tag){case 3:RI(a),tl();break;case 5:JC(a);break;case 1:pi(a.type)&&qf(a);break;case 4:Pg(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,I=a.memoizedProps.value;Yt(Zf,m._currentValue),m._currentValue=I;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?(Yt(rn,rn.current&1),a.flags|=128,null):h&a.child.childLanes?LI(s,a,h):(Yt(rn,rn.current&1),s=rs(s,a,h),s!==null?s.sibling:null);Yt(rn,rn.current&1);break;case 19:if(m=(h&a.childLanes)!==0,s.flags&128){if(m)return NI(s,a,h);a.flags|=128}if(I=a.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Yt(rn,rn.current),m)break;return null;case 22:case 23:return a.lanes=0,MI(s,a,h)}return rs(s,a,h)}var PI,tm,UI,kI;PI=function(s,a){for(var h=a.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},tm=function(){},UI=function(s,a,h,m){var I=s.memoizedProps;if(I!==m){s=a.stateNode,Bo(Sr.current);var M=null;switch(h){case"input":I=Ne(s,I),m=Ne(s,m),M=[];break;case"select":I=U({},I,{value:void 0}),m=U({},m,{value:void 0}),M=[];break;case"textarea":I=At(s,I),m=At(s,m),M=[];break;default:typeof I.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=Wf)}je(h,m);var P;h=null;for(le in I)if(!m.hasOwnProperty(le)&&I.hasOwnProperty(le)&&I[le]!=null)if(le==="style"){var W=I[le];for(P in W)W.hasOwnProperty(P)&&(h||(h={}),h[P]="")}else le!=="dangerouslySetInnerHTML"&&le!=="children"&&le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&le!=="autoFocus"&&(r.hasOwnProperty(le)?M||(M=[]):(M=M||[]).push(le,null));for(le in m){var $=m[le];if(W=I!=null?I[le]:void 0,m.hasOwnProperty(le)&&$!==W&&($!=null||W!=null))if(le==="style")if(W){for(P in W)!W.hasOwnProperty(P)||$&&$.hasOwnProperty(P)||(h||(h={}),h[P]="");for(P in $)$.hasOwnProperty(P)&&W[P]!==$[P]&&(h||(h={}),h[P]=$[P])}else h||(M||(M=[]),M.push(le,h)),h=$;else le==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,W=W?W.__html:void 0,$!=null&&W!==$&&(M=M||[]).push(le,$)):le==="children"?typeof $!="string"&&typeof $!="number"||(M=M||[]).push(le,""+$):le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&(r.hasOwnProperty(le)?($!=null&&le==="onScroll"&&Jt("scroll",s),M||W===$||(M=[])):(M=M||[]).push(le,$))}h&&(M=M||[]).push("style",h);var le=M;(a.updateQueue=le)&&(a.flags|=4)}},kI=function(s,a,h,m){h!==m&&(a.flags|=4)};function kc(s,a){if(!en)switch(s.tailMode){case"hidden":a=s.tail;for(var h=null;a!==null;)a.alternate!==null&&(h=a),a=a.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function qn(s){var a=s.alternate!==null&&s.alternate.child===s.child,h=0,m=0;if(a)for(var I=s.child;I!==null;)h|=I.lanes|I.childLanes,m|=I.subtreeFlags&14680064,m|=I.flags&14680064,I.return=s,I=I.sibling;else for(I=s.child;I!==null;)h|=I.lanes|I.childLanes,m|=I.subtreeFlags,m|=I.flags,I.return=s,I=I.sibling;return s.subtreeFlags|=m,s.childLanes=h,a}function P6(s,a,h){var m=a.pendingProps;switch(Ig(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qn(a),null;case 1:return pi(a.type)&&Yf(),qn(a),null;case 3:return m=a.stateNode,sl(),$t(Ai),$t(jn),Fg(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&($f(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,sr!==null&&(hm(sr),sr=null))),tm(s,a),qn(a),null;case 5:Ug(a);var I=Bo(Lc.current);if(h=a.type,s!==null&&a.stateNode!=null)UI(s,a,h,m,I),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(t(166));return qn(a),null}if(s=Bo(Sr.current),$f(a)){m=a.stateNode,h=a.type;var M=a.memoizedProps;switch(m[xr]=a,m[Mc]=M,s=(a.mode&1)!==0,h){case"dialog":Jt("cancel",m),Jt("close",m);break;case"iframe":case"object":case"embed":Jt("load",m);break;case"video":case"audio":for(I=0;I<xc.length;I++)Jt(xc[I],m);break;case"source":Jt("error",m);break;case"img":case"image":case"link":Jt("error",m),Jt("load",m);break;case"details":Jt("toggle",m);break;case"input":$e(m,M),Jt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!M.multiple},Jt("invalid",m);break;case"textarea":H(m,M),Jt("invalid",m)}je(h,M),I=null;for(var P in M)if(M.hasOwnProperty(P)){var W=M[P];P==="children"?typeof W=="string"?m.textContent!==W&&(M.suppressHydrationWarning!==!0&&Vf(m.textContent,W,s),I=["children",W]):typeof W=="number"&&m.textContent!==""+W&&(M.suppressHydrationWarning!==!0&&Vf(m.textContent,W,s),I=["children",""+W]):r.hasOwnProperty(P)&&W!=null&&P==="onScroll"&&Jt("scroll",m)}switch(h){case"input":st(m),Ue(m,M,!0);break;case"textarea":st(m),se(m);break;case"select":case"option":break;default:typeof M.onClick=="function"&&(m.onclick=Wf)}m=I,a.updateQueue=m,m!==null&&(a.flags|=4)}else{P=I.nodeType===9?I:I.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ce(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=P.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=P.createElement(h,{is:m.is}):(s=P.createElement(h),h==="select"&&(P=s,m.multiple?P.multiple=!0:m.size&&(P.size=m.size))):s=P.createElementNS(s,h),s[xr]=a,s[Mc]=m,PI(s,a,!1,!1),a.stateNode=s;e:{switch(P=Je(h,m),h){case"dialog":Jt("cancel",s),Jt("close",s),I=m;break;case"iframe":case"object":case"embed":Jt("load",s),I=m;break;case"video":case"audio":for(I=0;I<xc.length;I++)Jt(xc[I],s);I=m;break;case"source":Jt("error",s),I=m;break;case"img":case"image":case"link":Jt("error",s),Jt("load",s),I=m;break;case"details":Jt("toggle",s),I=m;break;case"input":$e(s,m),I=Ne(s,m),Jt("invalid",s);break;case"option":I=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},I=U({},m,{value:void 0}),Jt("invalid",s);break;case"textarea":H(s,m),I=At(s,m),Jt("invalid",s);break;default:I=m}je(h,I),W=I;for(M in W)if(W.hasOwnProperty(M)){var $=W[M];M==="style"?pe(s,$):M==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&We(s,$)):M==="children"?typeof $=="string"?(h!=="textarea"||$!=="")&&Se(s,$):typeof $=="number"&&Se(s,""+$):M!=="suppressContentEditableWarning"&&M!=="suppressHydrationWarning"&&M!=="autoFocus"&&(r.hasOwnProperty(M)?$!=null&&M==="onScroll"&&Jt("scroll",s):$!=null&&y(s,M,$,P))}switch(h){case"input":st(s),Ue(s,m,!1);break;case"textarea":st(s),se(s);break;case"option":m.value!=null&&s.setAttribute("value",""+de(m.value));break;case"select":s.multiple=!!m.multiple,M=m.value,M!=null?ut(s,!!m.multiple,M,!1):m.defaultValue!=null&&ut(s,!!m.multiple,m.defaultValue,!0);break;default:typeof I.onClick=="function"&&(s.onclick=Wf)}switch(h){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return qn(a),null;case 6:if(s&&a.stateNode!=null)kI(s,a,s.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(t(166));if(h=Bo(Lc.current),Bo(Sr.current),$f(a)){if(m=a.stateNode,h=a.memoizedProps,m[xr]=a,(M=m.nodeValue!==h)&&(s=Ri,s!==null))switch(s.tag){case 3:Vf(m.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Vf(m.nodeValue,h,(s.mode&1)!==0)}M&&(a.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[xr]=a,a.stateNode=m}return qn(a),null;case 13:if($t(rn),m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(en&&bi!==null&&a.mode&1&&!(a.flags&128))QC(),tl(),a.flags|=98560,M=!1;else if(M=$f(a),m!==null&&m.dehydrated!==null){if(s===null){if(!M)throw Error(t(318));if(M=a.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(t(317));M[xr]=a}else tl(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;qn(a),M=!1}else sr!==null&&(hm(sr),sr=null),M=!0;if(!M)return a.flags&65536?a:null}return a.flags&128?(a.lanes=h,a):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(a.child.flags|=8192,a.mode&1&&(s===null||rn.current&1?wn===0&&(wn=3):pm())),a.updateQueue!==null&&(a.flags|=4),qn(a),null);case 4:return sl(),tm(s,a),s===null&&Sc(a.stateNode.containerInfo),qn(a),null;case 10:return Bg(a.type._context),qn(a),null;case 17:return pi(a.type)&&Yf(),qn(a),null;case 19:if($t(rn),M=a.memoizedState,M===null)return qn(a),null;if(m=(a.flags&128)!==0,P=M.rendering,P===null)if(m)kc(M,!1);else{if(wn!==0||s!==null&&s.flags&128)for(s=a.child;s!==null;){if(P=sh(s),P!==null){for(a.flags|=128,kc(M,!1),m=P.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=h,h=a.child;h!==null;)M=h,s=m,M.flags&=14680066,P=M.alternate,P===null?(M.childLanes=0,M.lanes=s,M.child=null,M.subtreeFlags=0,M.memoizedProps=null,M.memoizedState=null,M.updateQueue=null,M.dependencies=null,M.stateNode=null):(M.childLanes=P.childLanes,M.lanes=P.lanes,M.child=P.child,M.subtreeFlags=0,M.deletions=null,M.memoizedProps=P.memoizedProps,M.memoizedState=P.memoizedState,M.updateQueue=P.updateQueue,M.type=P.type,s=P.dependencies,M.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return Yt(rn,rn.current&1|2),a.child}s=s.sibling}M.tail!==null&&Qe()>cl&&(a.flags|=128,m=!0,kc(M,!1),a.lanes=4194304)}else{if(!m)if(s=sh(P),s!==null){if(a.flags|=128,m=!0,h=s.updateQueue,h!==null&&(a.updateQueue=h,a.flags|=4),kc(M,!0),M.tail===null&&M.tailMode==="hidden"&&!P.alternate&&!en)return qn(a),null}else 2*Qe()-M.renderingStartTime>cl&&h!==1073741824&&(a.flags|=128,m=!0,kc(M,!1),a.lanes=4194304);M.isBackwards?(P.sibling=a.child,a.child=P):(h=M.last,h!==null?h.sibling=P:a.child=P,M.last=P)}return M.tail!==null?(a=M.tail,M.rendering=a,M.tail=a.sibling,M.renderingStartTime=Qe(),a.sibling=null,h=rn.current,Yt(rn,m?h&1|2:h&1),a):(qn(a),null);case 22:case 23:return Am(),m=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(a.flags|=8192),m&&a.mode&1?Li&1073741824&&(qn(a),a.subtreeFlags&6&&(a.flags|=8192)):qn(a),null;case 24:return null;case 25:return null}throw Error(t(156,a.tag))}function U6(s,a){switch(Ig(a),a.tag){case 1:return pi(a.type)&&Yf(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return sl(),$t(Ai),$t(jn),Fg(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return Ug(a),null;case 13:if($t(rn),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(t(340));tl()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return $t(rn),null;case 4:return sl(),null;case 10:return Bg(a.type._context),null;case 22:case 23:return Am(),null;case 24:return null;default:return null}}var dh=!1,Xn=!1,k6=typeof WeakSet=="function"?WeakSet:Set,ze=null;function al(s,a){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){cn(s,a,m)}else h.current=null}function nm(s,a,h){try{h()}catch(m){cn(s,a,m)}}var FI=!1;function F6(s,a){if(Ag=Df,s=pC(),og(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var I=m.anchorOffset,M=m.focusNode;m=m.focusOffset;try{h.nodeType,M.nodeType}catch{h=null;break e}var P=0,W=-1,$=-1,le=0,_e=0,Ie=s,ve=null;t:for(;;){for(var Fe;Ie!==h||I!==0&&Ie.nodeType!==3||(W=P+I),Ie!==M||m!==0&&Ie.nodeType!==3||($=P+m),Ie.nodeType===3&&(P+=Ie.nodeValue.length),(Fe=Ie.firstChild)!==null;)ve=Ie,Ie=Fe;for(;;){if(Ie===s)break t;if(ve===h&&++le===I&&(W=P),ve===M&&++_e===m&&($=P),(Fe=Ie.nextSibling)!==null)break;Ie=ve,ve=Ie.parentNode}Ie=Fe}h=W===-1||$===-1?null:{start:W,end:$}}else h=null}h=h||{start:0,end:0}}else h=null;for(pg={focusedElem:s,selectionRange:h},Df=!1,ze=a;ze!==null;)if(a=ze,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,ze=s;else for(;ze!==null;){a=ze;try{var Ve=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Ve!==null){var Ye=Ve.memoizedProps,pn=Ve.memoizedState,ie=a.stateNode,ne=ie.getSnapshotBeforeUpdate(a.elementType===a.type?Ye:or(a.type,Ye),pn);ie.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var ae=a.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(Be){cn(a,a.return,Be)}if(s=a.sibling,s!==null){s.return=a.return,ze=s;break}ze=a.return}return Ve=FI,FI=!1,Ve}function Fc(s,a,h){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var I=m=m.next;do{if((I.tag&s)===s){var M=I.destroy;I.destroy=void 0,M!==void 0&&nm(a,h,M)}I=I.next}while(I!==m)}}function Ah(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var h=a=a.next;do{if((h.tag&s)===s){var m=h.create;h.destroy=m()}h=h.next}while(h!==a)}}function im(s){var a=s.ref;if(a!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof a=="function"?a(s):a.current=s}}function QI(s){var a=s.alternate;a!==null&&(s.alternate=null,QI(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[xr],delete a[Mc],delete a[_g],delete a[E6],delete a[y6])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function OI(s){return s.tag===5||s.tag===3||s.tag===4}function zI(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||OI(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function rm(s,a,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?h.nodeType===8?h.parentNode.insertBefore(s,a):h.insertBefore(s,a):(h.nodeType===8?(a=h.parentNode,a.insertBefore(s,h)):(a=h,a.appendChild(s)),h=h._reactRootContainer,h!=null||a.onclick!==null||(a.onclick=Wf));else if(m!==4&&(s=s.child,s!==null))for(rm(s,a,h),s=s.sibling;s!==null;)rm(s,a,h),s=s.sibling}function sm(s,a,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?h.insertBefore(s,a):h.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(sm(s,a,h),s=s.sibling;s!==null;)sm(s,a,h),s=s.sibling}var On=null,ar=!1;function Os(s,a,h){for(h=h.child;h!==null;)GI(s,a,h),h=h.sibling}function GI(s,a,h){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(di,h)}catch{}switch(h.tag){case 5:Xn||al(h,a);case 6:var m=On,I=ar;On=null,Os(s,a,h),On=m,ar=I,On!==null&&(ar?(s=On,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):On.removeChild(h.stateNode));break;case 18:On!==null&&(ar?(s=On,h=h.stateNode,s.nodeType===8?vg(s.parentNode,h):s.nodeType===1&&vg(s,h),gc(s)):vg(On,h.stateNode));break;case 4:m=On,I=ar,On=h.stateNode.containerInfo,ar=!0,Os(s,a,h),On=m,ar=I;break;case 0:case 11:case 14:case 15:if(!Xn&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){I=m=m.next;do{var M=I,P=M.destroy;M=M.tag,P!==void 0&&(M&2||M&4)&&nm(h,a,P),I=I.next}while(I!==m)}Os(s,a,h);break;case 1:if(!Xn&&(al(h,a),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(W){cn(h,a,W)}Os(s,a,h);break;case 21:Os(s,a,h);break;case 22:h.mode&1?(Xn=(m=Xn)||h.memoizedState!==null,Os(s,a,h),Xn=m):Os(s,a,h);break;default:Os(s,a,h)}}function HI(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new k6),a.forEach(function(m){var I=Y6.bind(null,s,m);h.has(m)||(h.add(m),m.then(I,I))})}}function lr(s,a){var h=a.deletions;if(h!==null)for(var m=0;m<h.length;m++){var I=h[m];try{var M=s,P=a,W=P;e:for(;W!==null;){switch(W.tag){case 5:On=W.stateNode,ar=!1;break e;case 3:On=W.stateNode.containerInfo,ar=!0;break e;case 4:On=W.stateNode.containerInfo,ar=!0;break e}W=W.return}if(On===null)throw Error(t(160));GI(M,P,I),On=null,ar=!1;var $=I.alternate;$!==null&&($.return=null),I.return=null}catch(le){cn(I,a,le)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)VI(a,s),a=a.sibling}function VI(s,a){var h=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(lr(a,s),Mr(s),m&4){try{Fc(3,s,s.return),Ah(3,s)}catch(Ye){cn(s,s.return,Ye)}try{Fc(5,s,s.return)}catch(Ye){cn(s,s.return,Ye)}}break;case 1:lr(a,s),Mr(s),m&512&&h!==null&&al(h,h.return);break;case 5:if(lr(a,s),Mr(s),m&512&&h!==null&&al(h,h.return),s.flags&32){var I=s.stateNode;try{Se(I,"")}catch(Ye){cn(s,s.return,Ye)}}if(m&4&&(I=s.stateNode,I!=null)){var M=s.memoizedProps,P=h!==null?h.memoizedProps:M,W=s.type,$=s.updateQueue;if(s.updateQueue=null,$!==null)try{W==="input"&&M.type==="radio"&&M.name!=null&&Ee(I,M),Je(W,P);var le=Je(W,M);for(P=0;P<$.length;P+=2){var _e=$[P],Ie=$[P+1];_e==="style"?pe(I,Ie):_e==="dangerouslySetInnerHTML"?We(I,Ie):_e==="children"?Se(I,Ie):y(I,_e,Ie,le)}switch(W){case"input":nt(I,M);break;case"textarea":Q(I,M);break;case"select":var ve=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!M.multiple;var Fe=M.value;Fe!=null?ut(I,!!M.multiple,Fe,!1):ve!==!!M.multiple&&(M.defaultValue!=null?ut(I,!!M.multiple,M.defaultValue,!0):ut(I,!!M.multiple,M.multiple?[]:"",!1))}I[Mc]=M}catch(Ye){cn(s,s.return,Ye)}}break;case 6:if(lr(a,s),Mr(s),m&4){if(s.stateNode===null)throw Error(t(162));I=s.stateNode,M=s.memoizedProps;try{I.nodeValue=M}catch(Ye){cn(s,s.return,Ye)}}break;case 3:if(lr(a,s),Mr(s),m&4&&h!==null&&h.memoizedState.isDehydrated)try{gc(a.containerInfo)}catch(Ye){cn(s,s.return,Ye)}break;case 4:lr(a,s),Mr(s);break;case 13:lr(a,s),Mr(s),I=s.child,I.flags&8192&&(M=I.memoizedState!==null,I.stateNode.isHidden=M,!M||I.alternate!==null&&I.alternate.memoizedState!==null||(lm=Qe())),m&4&&HI(s);break;case 22:if(_e=h!==null&&h.memoizedState!==null,s.mode&1?(Xn=(le=Xn)||_e,lr(a,s),Xn=le):lr(a,s),Mr(s),m&8192){if(le=s.memoizedState!==null,(s.stateNode.isHidden=le)&&!_e&&s.mode&1)for(ze=s,_e=s.child;_e!==null;){for(Ie=ze=_e;ze!==null;){switch(ve=ze,Fe=ve.child,ve.tag){case 0:case 11:case 14:case 15:Fc(4,ve,ve.return);break;case 1:al(ve,ve.return);var Ve=ve.stateNode;if(typeof Ve.componentWillUnmount=="function"){m=ve,h=ve.return;try{a=m,Ve.props=a.memoizedProps,Ve.state=a.memoizedState,Ve.componentWillUnmount()}catch(Ye){cn(m,h,Ye)}}break;case 5:al(ve,ve.return);break;case 22:if(ve.memoizedState!==null){YI(Ie);continue}}Fe!==null?(Fe.return=ve,ze=Fe):YI(Ie)}_e=_e.sibling}e:for(_e=null,Ie=s;;){if(Ie.tag===5){if(_e===null){_e=Ie;try{I=Ie.stateNode,le?(M=I.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none"):(W=Ie.stateNode,$=Ie.memoizedProps.style,P=$!=null&&$.hasOwnProperty("display")?$.display:null,W.style.display=Me("display",P))}catch(Ye){cn(s,s.return,Ye)}}}else if(Ie.tag===6){if(_e===null)try{Ie.stateNode.nodeValue=le?"":Ie.memoizedProps}catch(Ye){cn(s,s.return,Ye)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===s)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===s)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===s)break e;_e===Ie&&(_e=null),Ie=Ie.return}_e===Ie&&(_e=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:lr(a,s),Mr(s),m&4&&HI(s);break;case 21:break;default:lr(a,s),Mr(s)}}function Mr(s){var a=s.flags;if(a&2){try{e:{for(var h=s.return;h!==null;){if(OI(h)){var m=h;break e}h=h.return}throw Error(t(160))}switch(m.tag){case 5:var I=m.stateNode;m.flags&32&&(Se(I,""),m.flags&=-33);var M=zI(s);sm(s,M,I);break;case 3:case 4:var P=m.stateNode.containerInfo,W=zI(s);rm(s,W,P);break;default:throw Error(t(161))}}catch($){cn(s,s.return,$)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function Q6(s,a,h){ze=s,WI(s)}function WI(s,a,h){for(var m=(s.mode&1)!==0;ze!==null;){var I=ze,M=I.child;if(I.tag===22&&m){var P=I.memoizedState!==null||dh;if(!P){var W=I.alternate,$=W!==null&&W.memoizedState!==null||Xn;W=dh;var le=Xn;if(dh=P,(Xn=$)&&!le)for(ze=I;ze!==null;)P=ze,$=P.child,P.tag===22&&P.memoizedState!==null?qI(I):$!==null?($.return=P,ze=$):qI(I);for(;M!==null;)ze=M,WI(M),M=M.sibling;ze=I,dh=W,Xn=le}jI(s)}else I.subtreeFlags&8772&&M!==null?(M.return=I,ze=M):jI(s)}}function jI(s){for(;ze!==null;){var a=ze;if(a.flags&8772){var h=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:Xn||Ah(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Xn)if(h===null)m.componentDidMount();else{var I=a.elementType===a.type?h.memoizedProps:or(a.type,h.memoizedProps);m.componentDidUpdate(I,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var M=a.updateQueue;M!==null&&HC(a,M,m);break;case 3:var P=a.updateQueue;if(P!==null){if(h=null,a.child!==null)switch(a.child.tag){case 5:h=a.child.stateNode;break;case 1:h=a.child.stateNode}HC(a,P,h)}break;case 5:var W=a.stateNode;if(h===null&&a.flags&4){h=W;var $=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&h.focus();break;case"img":$.src&&(h.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var le=a.alternate;if(le!==null){var _e=le.memoizedState;if(_e!==null){var Ie=_e.dehydrated;Ie!==null&&gc(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Xn||a.flags&512&&im(a)}catch(ve){cn(a,a.return,ve)}}if(a===s){ze=null;break}if(h=a.sibling,h!==null){h.return=a.return,ze=h;break}ze=a.return}}function YI(s){for(;ze!==null;){var a=ze;if(a===s){ze=null;break}var h=a.sibling;if(h!==null){h.return=a.return,ze=h;break}ze=a.return}}function qI(s){for(;ze!==null;){var a=ze;try{switch(a.tag){case 0:case 11:case 15:var h=a.return;try{Ah(4,a)}catch($){cn(a,h,$)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var I=a.return;try{m.componentDidMount()}catch($){cn(a,I,$)}}var M=a.return;try{im(a)}catch($){cn(a,M,$)}break;case 5:var P=a.return;try{im(a)}catch($){cn(a,P,$)}}}catch($){cn(a,a.return,$)}if(a===s){ze=null;break}var W=a.sibling;if(W!==null){W.return=a.return,ze=W;break}ze=a.return}}var O6=Math.ceil,ph=S.ReactCurrentDispatcher,om=S.ReactCurrentOwner,Vi=S.ReactCurrentBatchConfig,Rt=0,Pn=null,_n=null,zn=0,Li=0,ll=Ps(0),wn=0,Qc=null,bo=0,gh=0,am=0,Oc=null,mi=null,lm=0,cl=1/0,ss=null,mh=!1,cm=null,zs=null,vh=!1,Gs=null,_h=0,zc=0,um=null,Eh=-1,yh=0;function ai(){return Rt&6?Qe():Eh!==-1?Eh:Eh=Qe()}function Hs(s){return s.mode&1?Rt&2&&zn!==0?zn&-zn:I6.transition!==null?(yh===0&&(yh=Rf()),yh):(s=kt,s!==0||(s=window.event,s=s===void 0?16:Xy(s.type)),s):1}function cr(s,a,h,m){if(50<zc)throw zc=0,um=null,Error(t(185));fc(s,h,m),(!(Rt&2)||s!==Pn)&&(s===Pn&&(!(Rt&2)&&(gh|=h),wn===4&&Vs(s,zn)),vi(s,m),h===1&&Rt===0&&!(a.mode&1)&&(cl=Qe()+500,Xf&&ks()))}function vi(s,a){var h=s.callbackNode;si(s,a);var m=Qi(s,s===Pn?zn:0);if(m===0)h!==null&&ke(h),s.callbackNode=null,s.callbackPriority=0;else if(a=m&-m,s.callbackPriority!==a){if(h!=null&&ke(h),a===1)s.tag===0?C6(KI.bind(null,s)):NC(KI.bind(null,s)),v6(function(){!(Rt&6)&&ks()}),h=null;else{switch(zy(m)){case 1:h=ft;break;case 4:h=ht;break;case 16:h=jt;break;case 536870912:h=dn;break;default:h=jt}h=rx(h,XI.bind(null,s))}s.callbackPriority=a,s.callbackNode=h}}function XI(s,a){if(Eh=-1,yh=0,Rt&6)throw Error(t(327));var h=s.callbackNode;if(ul()&&s.callbackNode!==h)return null;var m=Qi(s,s===Pn?zn:0);if(m===0)return null;if(m&30||m&s.expiredLanes||a)a=Ch(s,m);else{a=m;var I=Rt;Rt|=2;var M=$I();(Pn!==s||zn!==a)&&(ss=null,cl=Qe()+500,Do(s,a));do try{H6();break}catch(W){JI(s,W)}while(1);Tg(),ph.current=M,Rt=I,_n!==null?a=0:(Pn=null,zn=0,a=wn)}if(a!==0){if(a===2&&(I=Io(s),I!==0&&(m=I,a=fm(s,I))),a===1)throw h=Qc,Do(s,0),Vs(s,m),vi(s,Qe()),h;if(a===6)Vs(s,m);else{if(I=s.current.alternate,!(m&30)&&!z6(I)&&(a=Ch(s,m),a===2&&(M=Io(s),M!==0&&(m=M,a=fm(s,M))),a===1))throw h=Qc,Do(s,0),Vs(s,m),vi(s,Qe()),h;switch(s.finishedWork=I,s.finishedLanes=m,a){case 0:case 1:throw Error(t(345));case 2:No(s,mi,ss);break;case 3:if(Vs(s,m),(m&130023424)===m&&(a=lm+500-Qe(),10<a)){if(Qi(s,0)!==0)break;if(I=s.suspendedLanes,(I&m)!==m){ai(),s.pingedLanes|=s.suspendedLanes&I;break}s.timeoutHandle=mg(No.bind(null,s,mi,ss),a);break}No(s,mi,ss);break;case 4:if(Vs(s,m),(m&4194240)===m)break;for(a=s.eventTimes,I=-1;0<m;){var P=31-ri(m);M=1<<P,P=a[P],P>I&&(I=P),m&=~M}if(m=I,m=Qe()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*O6(m/1960))-m,10<m){s.timeoutHandle=mg(No.bind(null,s,mi,ss),m);break}No(s,mi,ss);break;case 5:No(s,mi,ss);break;default:throw Error(t(329))}}}return vi(s,Qe()),s.callbackNode===h?XI.bind(null,s):null}function fm(s,a){var h=Oc;return s.current.memoizedState.isDehydrated&&(Do(s,a).flags|=256),s=Ch(s,a),s!==2&&(a=mi,mi=h,a!==null&&hm(a)),s}function hm(s){mi===null?mi=s:mi.push.apply(mi,s)}function z6(s){for(var a=s;;){if(a.flags&16384){var h=a.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var I=h[m],M=I.getSnapshot;I=I.value;try{if(!rr(M(),I))return!1}catch{return!1}}}if(h=a.child,a.subtreeFlags&16384&&h!==null)h.return=a,a=h;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Vs(s,a){for(a&=~am,a&=~gh,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var h=31-ri(a),m=1<<h;s[h]=-1,a&=~m}}function KI(s){if(Rt&6)throw Error(t(327));ul();var a=Qi(s,0);if(!(a&1))return vi(s,Qe()),null;var h=Ch(s,a);if(s.tag!==0&&h===2){var m=Io(s);m!==0&&(a=m,h=fm(s,m))}if(h===1)throw h=Qc,Do(s,0),Vs(s,a),vi(s,Qe()),h;if(h===6)throw Error(t(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,No(s,mi,ss),vi(s,Qe()),null}function dm(s,a){var h=Rt;Rt|=1;try{return s(a)}finally{Rt=h,Rt===0&&(cl=Qe()+500,Xf&&ks())}}function Lo(s){Gs!==null&&Gs.tag===0&&!(Rt&6)&&ul();var a=Rt;Rt|=1;var h=Vi.transition,m=kt;try{if(Vi.transition=null,kt=1,s)return s()}finally{kt=m,Vi.transition=h,Rt=a,!(Rt&6)&&ks()}}function Am(){Li=ll.current,$t(ll)}function Do(s,a){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,m6(h)),_n!==null)for(h=_n.return;h!==null;){var m=h;switch(Ig(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Yf();break;case 3:sl(),$t(Ai),$t(jn),Fg();break;case 5:Ug(m);break;case 4:sl();break;case 13:$t(rn);break;case 19:$t(rn);break;case 10:Bg(m.type._context);break;case 22:case 23:Am()}h=h.return}if(Pn=s,_n=s=Ws(s.current,null),zn=Li=a,wn=0,Qc=null,am=gh=bo=0,mi=Oc=null,To!==null){for(a=0;a<To.length;a++)if(h=To[a],m=h.interleaved,m!==null){h.interleaved=null;var I=m.next,M=h.pending;if(M!==null){var P=M.next;M.next=I,m.next=P}h.pending=m}To=null}return s}function JI(s,a){do{var h=_n;try{if(Tg(),oh.current=uh,ah){for(var m=sn.memoizedState;m!==null;){var I=m.queue;I!==null&&(I.pending=null),m=m.next}ah=!1}if(Ro=0,Nn=Sn=sn=null,Dc=!1,Nc=0,om.current=null,h===null||h.return===null){wn=1,Qc=a,_n=null;break}e:{var M=s,P=h.return,W=h,$=a;if(a=zn,W.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var le=$,_e=W,Ie=_e.tag;if(!(_e.mode&1)&&(Ie===0||Ie===11||Ie===15)){var ve=_e.alternate;ve?(_e.updateQueue=ve.updateQueue,_e.memoizedState=ve.memoizedState,_e.lanes=ve.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Fe=CI(P);if(Fe!==null){Fe.flags&=-257,II(Fe,P,W,M,a),Fe.mode&1&&yI(M,le,a),a=Fe,$=le;var Ve=a.updateQueue;if(Ve===null){var Ye=new Set;Ye.add($),a.updateQueue=Ye}else Ve.add($);break e}else{if(!(a&1)){yI(M,le,a),pm();break e}$=Error(t(426))}}else if(en&&W.mode&1){var pn=CI(P);if(pn!==null){!(pn.flags&65536)&&(pn.flags|=256),II(pn,P,W,M,a),wg(ol($,W));break e}}M=$=ol($,W),wn!==4&&(wn=2),Oc===null?Oc=[M]:Oc.push(M),M=P;do{switch(M.tag){case 3:M.flags|=65536,a&=-a,M.lanes|=a;var ie=_I(M,$,a);GC(M,ie);break e;case 1:W=$;var ne=M.type,ae=M.stateNode;if(!(M.flags&128)&&(typeof ne.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(zs===null||!zs.has(ae)))){M.flags|=65536,a&=-a,M.lanes|=a;var Be=EI(M,W,a);GC(M,Be);break e}}M=M.return}while(M!==null)}ex(h)}catch(Xe){a=Xe,_n===h&&h!==null&&(_n=h=h.return);continue}break}while(1)}function $I(){var s=ph.current;return ph.current=uh,s===null?uh:s}function pm(){(wn===0||wn===3||wn===2)&&(wn=4),Pn===null||!(bo&268435455)&&!(gh&268435455)||Vs(Pn,zn)}function Ch(s,a){var h=Rt;Rt|=2;var m=$I();(Pn!==s||zn!==a)&&(ss=null,Do(s,a));do try{G6();break}catch(I){JI(s,I)}while(1);if(Tg(),Rt=h,ph.current=m,_n!==null)throw Error(t(261));return Pn=null,zn=0,wn}function G6(){for(;_n!==null;)ZI(_n)}function H6(){for(;_n!==null&&!Ze();)ZI(_n)}function ZI(s){var a=ix(s.alternate,s,Li);s.memoizedProps=s.pendingProps,a===null?ex(s):_n=a,om.current=null}function ex(s){var a=s;do{var h=a.alternate;if(s=a.return,a.flags&32768){if(h=U6(h,a),h!==null){h.flags&=32767,_n=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{wn=6,_n=null;return}}else if(h=P6(h,a,Li),h!==null){_n=h;return}if(a=a.sibling,a!==null){_n=a;return}_n=a=s}while(a!==null);wn===0&&(wn=5)}function No(s,a,h){var m=kt,I=Vi.transition;try{Vi.transition=null,kt=1,V6(s,a,h,m)}finally{Vi.transition=I,kt=m}return null}function V6(s,a,h,m){do ul();while(Gs!==null);if(Rt&6)throw Error(t(327));h=s.finishedWork;var I=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(t(177));s.callbackNode=null,s.callbackPriority=0;var M=h.lanes|h.childLanes;if(xD(s,M),s===Pn&&(_n=Pn=null,zn=0),!(h.subtreeFlags&2064)&&!(h.flags&2064)||vh||(vh=!0,rx(jt,function(){return ul(),null})),M=(h.flags&15990)!==0,h.subtreeFlags&15990||M){M=Vi.transition,Vi.transition=null;var P=kt;kt=1;var W=Rt;Rt|=4,om.current=null,F6(s,h),VI(h,s),u6(pg),Df=!!Ag,pg=Ag=null,s.current=h,Q6(h),at(),Rt=W,kt=P,Vi.transition=M}else s.current=h;if(vh&&(vh=!1,Gs=s,_h=I),M=s.pendingLanes,M===0&&(zs=null),Et(h.stateNode),vi(s,Qe()),a!==null)for(m=s.onRecoverableError,h=0;h<a.length;h++)I=a[h],m(I.value,{componentStack:I.stack,digest:I.digest});if(mh)throw mh=!1,s=cm,cm=null,s;return _h&1&&s.tag!==0&&ul(),M=s.pendingLanes,M&1?s===um?zc++:(zc=0,um=s):zc=0,ks(),null}function ul(){if(Gs!==null){var s=zy(_h),a=Vi.transition,h=kt;try{if(Vi.transition=null,kt=16>s?16:s,Gs===null)var m=!1;else{if(s=Gs,Gs=null,_h=0,Rt&6)throw Error(t(331));var I=Rt;for(Rt|=4,ze=s.current;ze!==null;){var M=ze,P=M.child;if(ze.flags&16){var W=M.deletions;if(W!==null){for(var $=0;$<W.length;$++){var le=W[$];for(ze=le;ze!==null;){var _e=ze;switch(_e.tag){case 0:case 11:case 15:Fc(8,_e,M)}var Ie=_e.child;if(Ie!==null)Ie.return=_e,ze=Ie;else for(;ze!==null;){_e=ze;var ve=_e.sibling,Fe=_e.return;if(QI(_e),_e===le){ze=null;break}if(ve!==null){ve.return=Fe,ze=ve;break}ze=Fe}}}var Ve=M.alternate;if(Ve!==null){var Ye=Ve.child;if(Ye!==null){Ve.child=null;do{var pn=Ye.sibling;Ye.sibling=null,Ye=pn}while(Ye!==null)}}ze=M}}if(M.subtreeFlags&2064&&P!==null)P.return=M,ze=P;else e:for(;ze!==null;){if(M=ze,M.flags&2048)switch(M.tag){case 0:case 11:case 15:Fc(9,M,M.return)}var ie=M.sibling;if(ie!==null){ie.return=M.return,ze=ie;break e}ze=M.return}}var ne=s.current;for(ze=ne;ze!==null;){P=ze;var ae=P.child;if(P.subtreeFlags&2064&&ae!==null)ae.return=P,ze=ae;else e:for(P=ne;ze!==null;){if(W=ze,W.flags&2048)try{switch(W.tag){case 0:case 11:case 15:Ah(9,W)}}catch(Xe){cn(W,W.return,Xe)}if(W===P){ze=null;break e}var Be=W.sibling;if(Be!==null){Be.return=W.return,ze=Be;break e}ze=W.return}}if(Rt=I,ks(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(di,s)}catch{}m=!0}return m}finally{kt=h,Vi.transition=a}}return!1}function tx(s,a,h){a=ol(h,a),a=_I(s,a,1),s=Qs(s,a,1),a=ai(),s!==null&&(fc(s,1,a),vi(s,a))}function cn(s,a,h){if(s.tag===3)tx(s,s,h);else for(;a!==null;){if(a.tag===3){tx(a,s,h);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(zs===null||!zs.has(m))){s=ol(h,s),s=EI(a,s,1),a=Qs(a,s,1),s=ai(),a!==null&&(fc(a,1,s),vi(a,s));break}}a=a.return}}function W6(s,a,h){var m=s.pingCache;m!==null&&m.delete(a),a=ai(),s.pingedLanes|=s.suspendedLanes&h,Pn===s&&(zn&h)===h&&(wn===4||wn===3&&(zn&130023424)===zn&&500>Qe()-lm?Do(s,0):am|=h),vi(s,a)}function nx(s,a){a===0&&(s.mode&1?(a=Ms,Ms<<=1,!(Ms&130023424)&&(Ms=4194304)):a=1);var h=ai();s=ns(s,a),s!==null&&(fc(s,a,h),vi(s,h))}function j6(s){var a=s.memoizedState,h=0;a!==null&&(h=a.retryLane),nx(s,h)}function Y6(s,a){var h=0;switch(s.tag){case 13:var m=s.stateNode,I=s.memoizedState;I!==null&&(h=I.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(t(314))}m!==null&&m.delete(a),nx(s,h)}var ix;ix=function(s,a,h){if(s!==null)if(s.memoizedProps!==a.pendingProps||Ai.current)gi=!0;else{if(!(s.lanes&h)&&!(a.flags&128))return gi=!1,N6(s,a,h);gi=!!(s.flags&131072)}else gi=!1,en&&a.flags&1048576&&PC(a,Jf,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;hh(s,a),s=a.pendingProps;var I=$a(a,jn.current);il(a,h),I=zg(null,a,m,s,I,h);var M=Gg();return a.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,pi(m)?(M=!0,qf(a)):M=!1,a.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,Lg(a),I.updater=ih,a.stateNode=I,I._reactInternals=a,Ng(a,m,s,h),a=Kg(null,a,m,!0,M,h)):(a.tag=0,en&&M&&Cg(a),oi(null,a,I,h),a=a.child),a;case 16:m=a.elementType;e:{switch(hh(s,a),s=a.pendingProps,I=m._init,m=I(m._payload),a.type=m,I=a.tag=X6(m),s=or(m,s),I){case 0:a=Xg(null,a,m,s,h);break e;case 1:a=BI(null,a,m,s,h);break e;case 11:a=xI(null,a,m,s,h);break e;case 14:a=SI(null,a,m,or(m.type,s),h);break e}throw Error(t(306,m,""))}return a;case 0:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),Xg(s,a,m,I,h);case 1:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),BI(s,a,m,I,h);case 3:e:{if(RI(a),s===null)throw Error(t(387));m=a.pendingProps,M=a.memoizedState,I=M.element,zC(s,a),nh(a,m,null,h);var P=a.memoizedState;if(m=P.element,M.isDehydrated)if(M={element:m,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},a.updateQueue.baseState=M,a.memoizedState=M,a.flags&256){I=ol(Error(t(423)),a),a=bI(s,a,m,h,I);break e}else if(m!==I){I=ol(Error(t(424)),a),a=bI(s,a,m,h,I);break e}else for(bi=Ns(a.stateNode.containerInfo.firstChild),Ri=a,en=!0,sr=null,h=KC(a,null,m,h),a.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(tl(),m===I){a=rs(s,a,h);break e}oi(s,a,m,h)}a=a.child}return a;case 5:return JC(a),s===null&&Sg(a),m=a.type,I=a.pendingProps,M=s!==null?s.memoizedProps:null,P=I.children,gg(m,I)?P=null:M!==null&&gg(m,M)&&(a.flags|=32),TI(s,a),oi(s,a,P,h),a.child;case 6:return s===null&&Sg(a),null;case 13:return LI(s,a,h);case 4:return Pg(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=rl(a,null,m,h):oi(s,a,m,h),a.child;case 11:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),xI(s,a,m,I,h);case 7:return oi(s,a,a.pendingProps,h),a.child;case 8:return oi(s,a,a.pendingProps.children,h),a.child;case 12:return oi(s,a,a.pendingProps.children,h),a.child;case 10:e:{if(m=a.type._context,I=a.pendingProps,M=a.memoizedProps,P=I.value,Yt(Zf,m._currentValue),m._currentValue=P,M!==null)if(rr(M.value,P)){if(M.children===I.children&&!Ai.current){a=rs(s,a,h);break e}}else for(M=a.child,M!==null&&(M.return=a);M!==null;){var W=M.dependencies;if(W!==null){P=M.child;for(var $=W.firstContext;$!==null;){if($.context===m){if(M.tag===1){$=is(-1,h&-h),$.tag=2;var le=M.updateQueue;if(le!==null){le=le.shared;var _e=le.pending;_e===null?$.next=$:($.next=_e.next,_e.next=$),le.pending=$}}M.lanes|=h,$=M.alternate,$!==null&&($.lanes|=h),Rg(M.return,h,a),W.lanes|=h;break}$=$.next}}else if(M.tag===10)P=M.type===a.type?null:M.child;else if(M.tag===18){if(P=M.return,P===null)throw Error(t(341));P.lanes|=h,W=P.alternate,W!==null&&(W.lanes|=h),Rg(P,h,a),P=M.sibling}else P=M.child;if(P!==null)P.return=M;else for(P=M;P!==null;){if(P===a){P=null;break}if(M=P.sibling,M!==null){M.return=P.return,P=M;break}P=P.return}M=P}oi(s,a,I.children,h),a=a.child}return a;case 9:return I=a.type,m=a.pendingProps.children,il(a,h),I=Gi(I),m=m(I),a.flags|=1,oi(s,a,m,h),a.child;case 14:return m=a.type,I=or(m,a.pendingProps),I=or(m.type,I),SI(s,a,m,I,h);case 15:return wI(s,a,a.type,a.pendingProps,h);case 17:return m=a.type,I=a.pendingProps,I=a.elementType===m?I:or(m,I),hh(s,a),a.tag=1,pi(m)?(s=!0,qf(a)):s=!1,il(a,h),jC(a,m,I),Ng(a,m,I,h),Kg(null,a,m,!0,s,h);case 19:return NI(s,a,h);case 22:return MI(s,a,h)}throw Error(t(156,a.tag))};function rx(s,a){return fe(s,a)}function q6(s,a,h,m){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(s,a,h,m){return new q6(s,a,h,m)}function gm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function X6(s){if(typeof s=="function")return gm(s)?1:0;if(s!=null){if(s=s.$$typeof,s===k)return 11;if(s===V)return 14}return 2}function Ws(s,a){var h=s.alternate;return h===null?(h=Wi(s.tag,a,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=a,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,a=s.dependencies,h.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Ih(s,a,h,m,I,M){var P=2;if(m=s,typeof s=="function")gm(s)&&(P=1);else if(typeof s=="string")P=5;else e:switch(s){case B:return Po(h.children,I,M,a);case L:P=8,I|=8;break;case R:return s=Wi(12,h,a,I|2),s.elementType=R,s.lanes=M,s;case O:return s=Wi(13,h,a,I),s.elementType=O,s.lanes=M,s;case F:return s=Wi(19,h,a,I),s.elementType=F,s.lanes=M,s;case te:return xh(h,I,M,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:P=10;break e;case N:P=9;break e;case k:P=11;break e;case V:P=14;break e;case X:P=16,m=null;break e}throw Error(t(130,s==null?s:typeof s,""))}return a=Wi(P,h,a,I),a.elementType=s,a.type=m,a.lanes=M,a}function Po(s,a,h,m){return s=Wi(7,s,m,a),s.lanes=h,s}function xh(s,a,h,m){return s=Wi(22,s,m,a),s.elementType=te,s.lanes=h,s.stateNode={isHidden:!1},s}function mm(s,a,h){return s=Wi(6,s,null,a),s.lanes=h,s}function vm(s,a,h){return a=Wi(4,s.children!==null?s.children:[],s.key,a),a.lanes=h,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function K6(s,a,h,m,I){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ga(0),this.expirationTimes=Ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ga(0),this.identifierPrefix=m,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function _m(s,a,h,m,I,M,P,W,$){return s=new K6(s,a,h,W,$),a===1?(a=1,M===!0&&(a|=8)):a=0,M=Wi(3,null,null,a),s.current=M,M.stateNode=s,M.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lg(M),s}function J6(s,a,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:m==null?null:""+m,children:s,containerInfo:a,implementation:h}}function sx(s){if(!s)return Us;s=s._reactInternals;e:{if(Kr(s)!==s||s.tag!==1)throw Error(t(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(pi(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(t(171))}if(s.tag===1){var h=s.type;if(pi(h))return LC(s,h,a)}return a}function ox(s,a,h,m,I,M,P,W,$){return s=_m(h,m,!0,s,I,M,P,W,$),s.context=sx(null),h=s.current,m=ai(),I=Hs(h),M=is(m,I),M.callback=a??null,Qs(h,M,I),s.current.lanes=I,fc(s,I,m),vi(s,m),s}function Sh(s,a,h,m){var I=a.current,M=ai(),P=Hs(I);return h=sx(h),a.context===null?a.context=h:a.pendingContext=h,a=is(M,P),a.payload={element:s},m=m===void 0?null:m,m!==null&&(a.callback=m),s=Qs(I,a,P),s!==null&&(cr(s,I,P,M),th(s,I,P)),P}function wh(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function ax(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<a?h:a}}function Em(s,a){ax(s,a),(s=s.alternate)&&ax(s,a)}function $6(){return null}var lx=typeof reportError=="function"?reportError:function(s){console.error(s)};function ym(s){this._internalRoot=s}Mh.prototype.render=ym.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(t(409));Sh(s,a,null,null)},Mh.prototype.unmount=ym.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;Lo(function(){Sh(null,s,null,null)}),a[$r]=null}};function Mh(s){this._internalRoot=s}Mh.prototype.unstable_scheduleHydration=function(s){if(s){var a=Vy();s={blockedOn:null,target:s,priority:a};for(var h=0;h<bs.length&&a!==0&&a<bs[h].priority;h++);bs.splice(h,0,s),h===0&&Yy(s)}};function Cm(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Th(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function cx(){}function Z6(s,a,h,m,I){if(I){if(typeof m=="function"){var M=m;m=function(){var le=wh(P);M.call(le)}}var P=ox(a,m,s,0,null,!1,!1,"",cx);return s._reactRootContainer=P,s[$r]=P.current,Sc(s.nodeType===8?s.parentNode:s),Lo(),P}for(;I=s.lastChild;)s.removeChild(I);if(typeof m=="function"){var W=m;m=function(){var le=wh($);W.call(le)}}var $=_m(s,0,!1,null,null,!1,!1,"",cx);return s._reactRootContainer=$,s[$r]=$.current,Sc(s.nodeType===8?s.parentNode:s),Lo(function(){Sh(a,$,h,m)}),$}function Bh(s,a,h,m,I){var M=h._reactRootContainer;if(M){var P=M;if(typeof I=="function"){var W=I;I=function(){var $=wh(P);W.call($)}}Sh(a,P,s,I)}else P=Z6(h,a,s,I,m);return wh(P)}Gy=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var h=An(a.pendingLanes);h!==0&&(jp(a,h|1),vi(a,Qe()),!(Rt&6)&&(cl=Qe()+500,ks()))}break;case 13:Lo(function(){var m=ns(s,1);if(m!==null){var I=ai();cr(m,s,1,I)}}),Em(s,1)}},Yp=function(s){if(s.tag===13){var a=ns(s,134217728);if(a!==null){var h=ai();cr(a,s,134217728,h)}Em(s,134217728)}},Hy=function(s){if(s.tag===13){var a=Hs(s),h=ns(s,a);if(h!==null){var m=ai();cr(h,s,a,m)}Em(s,a)}},Vy=function(){return kt},Wy=function(s,a){var h=kt;try{return kt=s,a()}finally{kt=h}},dt=function(s,a,h){switch(a){case"input":if(nt(s,h),a=h.name,h.type==="radio"&&a!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<h.length;a++){var m=h[a];if(m!==s&&m.form===s.form){var I=jf(m);if(!I)throw Error(t(90));oe(m),nt(m,I)}}}break;case"textarea":Q(s,h);break;case"select":a=h.value,a!=null&&ut(s,!!h.multiple,a,!1)}},qe=dm,pt=Lo;var eN={usingClientEntryPoint:!1,Events:[Tc,Ka,jf,he,we,dm]},Gc={findFiberByHostInstance:xo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tN={bundleType:Gc.bundleType,version:Gc.version,rendererPackageName:Gc.rendererPackageName,rendererConfig:Gc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=ce(s),s===null?null:s.stateNode},findFiberByHostInstance:Gc.findFiberByHostInstance||$6,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 Rh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rh.isDisabled&&Rh.supportsFiber)try{di=Rh.inject(tN),Bt=Rh}catch{}}return hi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eN,hi.createPortal=function(s,a){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cm(a))throw Error(t(200));return J6(s,a,null,h)},hi.createRoot=function(s,a){if(!Cm(s))throw Error(t(299));var h=!1,m="",I=lx;return a!=null&&(a.unstable_strictMode===!0&&(h=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(I=a.onRecoverableError)),a=_m(s,1,!1,null,null,h,!1,m,I),s[$r]=a.current,Sc(s.nodeType===8?s.parentNode:s),new ym(a)},hi.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(t(188)):(s=Object.keys(s).join(","),Error(t(268,s)));return s=ce(a),s=s===null?null:s.stateNode,s},hi.flushSync=function(s){return Lo(s)},hi.hydrate=function(s,a,h){if(!Th(a))throw Error(t(200));return Bh(null,s,a,!0,h)},hi.hydrateRoot=function(s,a,h){if(!Cm(s))throw Error(t(405));var m=h!=null&&h.hydratedSources||null,I=!1,M="",P=lx;if(h!=null&&(h.unstable_strictMode===!0&&(I=!0),h.identifierPrefix!==void 0&&(M=h.identifierPrefix),h.onRecoverableError!==void 0&&(P=h.onRecoverableError)),a=ox(a,null,s,1,h??null,I,!1,M,P),s[$r]=a.current,Sc(s),m)for(s=0;s<m.length;s++)h=m[s],I=h._getVersion,I=I(h._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[h,I]:a.mutableSourceEagerHydrationData.push(h,I);return new Mh(a)},hi.render=function(s,a,h){if(!Th(a))throw Error(t(200));return Bh(null,s,a,!1,h)},hi.unmountComponentAtNode=function(s){if(!Th(s))throw Error(t(40));return s._reactRootContainer?(Lo(function(){Bh(null,null,s,!1,function(){s._reactRootContainer=null,s[$r]=null})}),!0):!1},hi.unstable_batchedUpdates=dm,hi.unstable_renderSubtreeIntoContainer=function(s,a,h,m){if(!Th(h))throw Error(t(200));if(s==null||s._reactInternals===void 0)throw Error(t(38));return Bh(s,a,h,!1,m)},hi.version="18.2.0-next-9e3b772b8-20220608",hi}function wy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wy)}catch(i){console.error(i)}}wy(),Cy.exports=sD();var oD=Cy.exports,My=oD;Op.createRoot=My.createRoot,Op.hydrateRoot=My.hydrateRoot;class aD{constructor({apiService:e,events:t}){Lt(this,"targetElement");Lt(this,"apiService");Lt(this,"events");Lt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",r=document.getElementById(n);if(!r)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=r,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Op.createRoot(document.getElementById(n))}this.targetElement.render(Hc.createElement(nD,{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 Hp={exports:{}},za=typeof Reflect=="object"?Reflect:null,Ty=za&&typeof za.apply=="function"?za.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},xf;za&&typeof za.ownKeys=="function"?xf=za.ownKeys:Object.getOwnPropertySymbols?xf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:xf=function(e){return Object.getOwnPropertyNames(e)};function lD(i){console&&console.warn&&console.warn(i)}var By=Number.isNaN||function(e){return e!==e};function zt(){zt.init.call(this)}Hp.exports=zt,Hp.exports.once=hD,zt.EventEmitter=zt,zt.prototype._events=void 0,zt.prototype._eventsCount=0,zt.prototype._maxListeners=void 0;var Ry=10;function Sf(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(zt,"defaultMaxListeners",{enumerable:!0,get:function(){return Ry},set:function(i){if(typeof i!="number"||i<0||By(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Ry=i}}),zt.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},zt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||By(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 by(i){return i._maxListeners===void 0?zt.defaultMaxListeners:i._maxListeners}zt.prototype.getMaxListeners=function(){return by(this)},zt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r=e==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var c=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw c.context=l,c}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Ty(f,this,t);else for(var u=f.length,d=Uy(f,u),n=0;n<u;++n)Ty(d[n],this,t);return!0};function Ly(i,e,t,n){var r,o,l;if(Sf(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=n?[t,l]:[l,t]:n?l.unshift(t):l.push(t),r=by(i),r>0&&l.length>r&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=i,c.type=e,c.count=l.length,lD(c)}return i}zt.prototype.addListener=function(e,t){return Ly(this,e,t,!1)},zt.prototype.on=zt.prototype.addListener,zt.prototype.prependListener=function(e,t){return Ly(this,e,t,!0)};function cD(){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 Dy(i,e,t){var n={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},r=cD.bind(n);return r.listener=t,n.wrapFn=r,r}zt.prototype.once=function(e,t){return Sf(t),this.on(e,Dy(this,e,t)),this},zt.prototype.prependOnceListener=function(e,t){return Sf(t),this.prependListener(e,Dy(this,e,t)),this},zt.prototype.removeListener=function(e,t){var n,r,o,l,c;if(Sf(t),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===t||n[l].listener===t){c=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():uD(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},zt.prototype.off=zt.prototype.removeListener,zt.prototype.removeAllListeners=function(e){var t,n,r;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 o=Object.keys(n),l;for(r=0;r<o.length;++r)l=o[r],l!=="removeListener"&&this.removeAllListeners(l);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(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function Ny(i,e,t){var n=i._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?fD(r):Uy(r,r.length)}zt.prototype.listeners=function(e){return Ny(this,e,!0)},zt.prototype.rawListeners=function(e){return Ny(this,e,!1)},zt.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):Py.call(i,e)},zt.prototype.listenerCount=Py;function Py(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}zt.prototype.eventNames=function(){return this._eventsCount>0?xf(this._events):[]};function Uy(i,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=i[n];return t}function uD(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function fD(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function hD(i,e){return new Promise(function(t,n){function r(l){i.removeListener(e,o),n(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",r),t([].slice.call(arguments))}ky(i,e,o,{once:!0}),e!=="error"&&dD(i,r,{once:!0})})}function dD(i,e,t){typeof i.on=="function"&&ky(i,"error",e,t)}function ky(i,e,t,n){if(typeof i.on=="function")n.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function r(o){n.once&&i.removeEventListener(e,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var AD=Hp.exports;const cc=class cc extends AD.EventEmitter{emitEvent(e,t){Object.keys(cc.EVENTS).includes(e)&&this.emit(cc.EVENTS[e],t)}};Lt(cc,"EVENTS",{onAddToCart:"add-to-cart"});let Vp=cc;const pD={getCartUrl:((Qy=window.Shopify)==null?void 0:Qy.routes.root)+"cart.js",addToCartUrl:((Oy=window.Shopify)==null?void 0:Oy.routes.root)+"cart/add.js"},Fy=Object.freeze(pD);class gD{constructor(e){Lt(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:mD,error:vD}=console,_D=(...i)=>{vD("❌ Sprie Error:",...i)},ED="&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&",yD={HOST:Br.host,STORE_PREFIX:Br.storePrefix},CD={addToCartUrl:Fy.addToCartUrl,getCartUrl:Fy.getCartUrl};class ID{constructor(){Lt(this,"sdkService");Lt(this,"apiService");Lt(this,"uiService");Lt(this,"events");this.events=new Vp,this.apiService=new hx(new Ys(yD),new gD(CD)),this.uiService=new aD({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:Br,log:mD,logErr:_D,metaData:{appVersion:ux,previewUrlPrams:ED,targetClassName:"sprie-embed-element"}};this.sdkService=new dx(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 ID})();