window.SYNDI=window.SYNDI||[];window.SYNDI.push({"root":"https://content.syndigo.com/site/common/1.0.569/","uriDataRoot":"https://content.syndigo.com/page/70033404-530a-43b6-9954-296955d5d9f1/","siteid":"70033404-530a-43b6-9954-296955d5d9f1","trackingRoot":"https://event.syndigo.cloud/event/","contentDomain":"https://content.syndigo.com/","customModules":["specific/microcenter/anchor/producthero","site/anchor/inline","tracking/storage/local","site/tracking/addtocart"],"environment":"PRODUCTION","pageIdModule":"site/pageid","locale":"en-US","waitForReadyState":2,"loadTimeout":30000,"abTestingExperiments":{"holdout":{"bucketDuration":3600000,"experimentDuration":31536000000,"threshold":0.05,"applyToHero":true,"applyToPowerPage":true,"isExperimentEnabled":false},"general":{"applyToHero":false,"applyToPowerPage":false,"isExperimentEnabled":false}},"moduleParameters":{"site/tracking/addtocart":{"config":"{\"mutationObserver\":{\"enabled\":false,\"selector\":\"body\"},\"rules\":[{\"name\":\"price\",\"type\":\"domElement\",\"selector\":\"span#pricing\",\"location\":{\"name\":\"content\",\"type\":\"attribute\"},\"locale\":\"\"},{\"name\":\"addToCartButtons\",\"selector\":\"[name='ADDtoCART']\"}]}"}},"hasCustomCss":false,"domainAllowList":[]});var KR=Object.create;var $u=Object.defineProperty;var $R=Object.getOwnPropertyDescriptor;var XR=Object.getOwnPropertyNames;var YR=Object.getPrototypeOf,jR=Object.prototype.hasOwnProperty;var JR=(i,e,t)=>e in i?$u(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var oe=(i,e)=>()=>(i&&(e=i(i=0)),e);var Gs=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),ZR=(i,e)=>{for(var t in e)$u(i,t,{get:e[t],enumerable:!0})},e1=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of XR(e))!jR.call(i,s)&&s!==t&&$u(i,s,{get:()=>e[s],enumerable:!(n=$R(e,s))||n.enumerable});return i};var mo=(i,e,t)=>(t=i!=null?KR(YR(i)):{},e1(e||!i||!i.__esModule?$u(t,"default",{value:i,enumerable:!0}):t,i));var Vt=(i,e,t)=>JR(i,typeof e!="symbol"?e+"":e,t);var vx=Gs((FQ,_x)=>{_x.exports=t1;function t1(i,e,t){return e<t?i<e?e:i>t?t:i:i<t?t:i>e?e:i}});var Yx=Gs((Cz,Xx)=>{Xx.exports=q1;var $x={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};function q1(i){return function(e,t,n){for(var s in t)s in $x&&(t[$x[s]]=t[s],delete t[s]);return i(e,t,n)}}});var Jx=Gs((Mz,jx)=>{var K1=Yx(),Ha=0,Ki=1,ni=2,nd=3,Bi=4,qt=5,Qm=6,xo=7,gn=8,Wa=9,qa=10,Fl=11,_o=12,Va=13;jx.exports=function(i,e){e||(e={});var t=e.concat||function(s,r){return String(s)+String(r)};return e.attrToProp!==!1&&(i=K1(i)),function(s){for(var r=Ki,o="",a=!1,c=arguments.length,l=[],h=0;h<s.length;h++)if(h<c-1){var u=arguments[h+1],d=S(s[h]),f=r;f===qa&&(f=gn),f===Wa&&(f=gn),f===xo&&(f=gn),f===Bi&&(f=qt),f===ni?o==="/"?(d.push([ni,"/",u]),o=""):d.push([ni,u]):f===Va&&e.comments?o+=String(u):f!==Va&&d.push([Ha,f,u]),l.push.apply(l,d)}else l.push.apply(l,S(s[h]));for(var p=[null,{},[]],g=[[p,-1]],h=0;h<l.length;h++){var A=g[g.length-1][0],d=l[h],r=d[0];if(r===ni&&/^\//.test(d[1])){var m=g[g.length-1][1];g.length>1&&(g.pop(),g[g.length-1][0][2][m]=i(A[0],A[1],A[2].length?A[2]:void 0))}else if(r===ni){var b=[d[1],{},[]];A[2].push(b),g.push([b,A[2].length-1])}else if(r===qt||r===Ha&&d[1]===qt){for(var x="",y;h<l.length;h++)if(l[h][0]===qt)x=t(x,l[h][1]);else if(l[h][0]===Ha&&l[h][1]===qt)if(typeof l[h][2]=="object"&&!x)for(y in l[h][2])l[h][2].hasOwnProperty(y)&&!A[1][y]&&(A[1][y]=l[h][2][y]);else x=t(x,l[h][2]);else break;l[h][0]===Fl&&h++;for(var _=h;h<l.length;h++)if(l[h][0]===gn||l[h][0]===qt)A[1][x]?l[h][1]===""||(A[1][x]=t(A[1][x],l[h][1])):A[1][x]=n(l[h][1]);else if(l[h][0]===Ha&&(l[h][1]===gn||l[h][1]===qt))A[1][x]?l[h][2]===""||(A[1][x]=t(A[1][x],l[h][2])):A[1][x]=n(l[h][2]);else{x.length&&!A[1][x]&&h===_&&(l[h][0]===nd||l[h][0]===_o)&&(A[1][x]=x.toLowerCase()),l[h][0]===nd&&h--;break}}else if(r===qt)A[1][d[1]]=!0;else if(r===Ha&&d[1]===qt)A[1][d[2]]=!0;else if(r===nd){if((d[1]||Y1(A[0]))&&g.length){var m=g[g.length-1][1];g.pop(),g[g.length-1][0][2][m]=i(A[0],A[1],A[2].length?A[2]:void 0)}}else if(r===Ha&&d[1]===Ki)d[2]===void 0||d[2]===null?d[2]="":d[2]||(d[2]=t("",d[2])),Array.isArray(d[2][0])?A[2].push.apply(A[2],d[2]):A[2].push(d[2]);else if(r===Ki)A[2].push(d[1]);else if(!(r===Fl||r===_o))throw new Error("unhandled: "+r)}if(p[2].length>1&&/^\s*$/.test(p[2][0])&&p[2].shift(),p[2].length>2||p[2].length===2&&/\S/.test(p[2][1])){if(e.createFragment)return e.createFragment(p[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}return Array.isArray(p[2][0])&&typeof p[2][0][0]=="string"&&Array.isArray(p[2][0][2])&&(p[2][0]=i(p[2][0][0],p[2][0][1],p[2][0][2])),p[2][0];function S(C){var w=[],v=!1;r===xo&&(r=Bi);for(var E=0;E<C.length;E++){var R=C.charAt(E);r===Ki&&R==="<"?(o.length&&w.push([Ki,o]),o="",r=ni,v=!1):R===">"&&!$1(r)&&r!==Va?(r===ni&&o.length?(w.push([ni,o]),o==="style"?v=!0:o==="/style"&&(v=!1)):r===qt?w.push([qt,o]):r===gn&&o.length&&w.push([gn,o]),r===Ki&&v?o+=R:(w.push([nd,a]),a=!1,o=""),r=Ki):r===Va&&/-$/.test(o)&&R==="-"?(e.comments&&w.push([gn,o.substr(0,o.length-1)]),o="",a=!0,r=Ki):r===ni&&/^!--$/.test(o)?(e.comments&&w.push([ni,o],[qt,"comment"],[Fl]),o=R,r=Va):r===Ki||r===Va?o+=R:r===ni&&R==="/"&&o.length?a=!0:r===ni&&/\s/.test(R)?(o.length&&w.push([ni,o]),o==="style"?v=!0:o==="/style"&&(v=!1),o="",r=Bi):r===ni?o+=R:r===Bi&&/[^\s"'=/]/.test(R)?(r=qt,o=R):r===Bi&&/\s/.test(R)?(o.length&&w.push([qt,o]),w.push([_o])):r===qt&&/\s/.test(R)?(w.push([qt,o]),o="",r=Qm):r===qt&&R==="="?(w.push([qt,o],[Fl]),o="",r=xo):r===qt&&R==="/"?(a=!0,o="",r=Bi):r===qt?o+=R:(r===Qm||r===Bi)&&R==="="?(w.push([Fl]),r=xo):(r===Qm||r===Bi)&&!/\s/.test(R)?(w.push([_o]),/[\w-]/.test(R)?(o+=R,r=qt):R==="/"?a=!0:r=Bi):r===xo&&R==='"'?r=qa:r===xo&&R==="'"?r=Wa:r===qa&&R==='"'?(w.push([gn,o],[_o]),o="",r=Bi):r===Wa&&R==="'"?(w.push([gn,o],[_o]),o="",r=Bi):r===xo&&!/\s/.test(R)?(r=gn,E--):r===gn&&/\s/.test(R)?(w.push([gn,o],[_o]),o="",r=Bi):(r===gn||r===Wa||r===qa)&&(o+=R)}return r===Ki&&o.length?(w.push([Ki,o]),o=""):r===gn&&o.length?(w.push([gn,o]),o=""):r===qa&&o.length?(w.push([gn,o]),o=""):r===Wa&&o.length?(w.push([gn,o]),o=""):r===qt&&(w.push([qt,o]),o=""),w}};function n(s){return typeof s=="function"||typeof s=="string"||s&&typeof s=="object"||s==null?s:t("",s)}};function $1(i){return i===Wa||i===qa}var X1=RegExp("^("+["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"].join("|")+")(?:[.#][a-zA-Z0-9\x7F-\uFFFF_:-]+)*$");function Y1(i){return X1.test(i)}});var e_=Gs((Tz,Zx)=>{var j1=["allowfullscreen","async","autofocus","checked","compact","declare","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","multiple","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","readonly","required","reversed","seamless","selected","sortable","truespeed","typemustmatch","contenteditable","spellcheck"];Zx.exports=function(i){return j1.indexOf(i)>-1}});var Xm=Gs((hH,b_)=>{var y_="Expected a function",A_=NaN,FB="[object Symbol]",OB=/^\s+|\s+$/g,NB=/^[-+]0x[0-9a-f]+$/i,UB=/^0b[01]+$/i,kB=/^0o[0-7]+$/i,GB=parseInt,QB=typeof global=="object"&&global&&global.Object===Object&&global,zB=typeof self=="object"&&self&&self.Object===Object&&self,HB=QB||zB||Function("return this")(),VB=Object.prototype,WB=VB.toString,qB=Math.max,KB=Math.min,$m=function(){return HB.Date.now()};function $B(i,e,t){var n,s,r,o,a,c,l=0,h=!1,u=!1,d=!0;if(typeof i!="function")throw new TypeError(y_);e=g_(e)||0,rd(t)&&(h=!!t.leading,u="maxWait"in t,r=u?qB(g_(t.maxWait)||0,e):r,d="trailing"in t?!!t.trailing:d);function f(S){var C=n,w=s;return n=s=void 0,l=S,o=i.apply(w,C),o}function p(S){return l=S,a=setTimeout(m,e),h?f(S):o}function g(S){var C=S-c,w=S-l,v=e-C;return u?KB(v,r-w):v}function A(S){var C=S-c,w=S-l;return c===void 0||C>=e||C<0||u&&w>=r}function m(){var S=$m();if(A(S))return b(S);a=setTimeout(m,g(S))}function b(S){return a=void 0,d&&n?f(S):(n=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),l=0,n=c=s=a=void 0}function y(){return a===void 0?o:b($m())}function _(){var S=$m(),C=A(S);if(n=arguments,s=this,c=S,C){if(a===void 0)return p(c);if(u)return a=setTimeout(m,e),f(c)}return a===void 0&&(a=setTimeout(m,e)),o}return _.cancel=x,_.flush=y,_}function XB(i,e,t){var n=!0,s=!0;if(typeof i!="function")throw new TypeError(y_);return rd(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),$B(i,e,{leading:n,maxWait:e,trailing:s})}function rd(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function YB(i){return!!i&&typeof i=="object"}function jB(i){return typeof i=="symbol"||YB(i)&&WB.call(i)==FB}function g_(i){if(typeof i=="number")return i;if(jB(i))return A_;if(rd(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=rd(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(OB,"");var t=UB.test(i);return t||kB.test(i)?GB(i.slice(2),t?2:8):NB.test(i)?A_:+i}b_.exports=XB});var D_=oe(()=>{});var hd,dd,P_,L_,ud,F_,O_,eA,tA=oe(()=>{hd=globalThis,dd=hd.ShadowRoot&&(hd.ShadyCSS===void 0||hd.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,P_=Symbol(),L_=new WeakMap,ud=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==P_)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(dd&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=L_.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&L_.set(t,e))}return e}toString(){return this.cssText}},F_=i=>new ud(typeof i=="string"?i:i+"",void 0,P_),O_=(i,e)=>{if(dd)i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(let t of e){let n=document.createElement("style"),s=hd.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=t.cssText,i.appendChild(n)}},eA=dd?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return F_(t)})(i):i});var ED,SD,wD,CD,MD,TD,kr,N_,ID,RD,kl,Gl,fd,U_,$i,Ql=oe(()=>{tA();tA();({is:ED,defineProperty:SD,getOwnPropertyDescriptor:wD,getOwnPropertyNames:CD,getOwnPropertySymbols:MD,getPrototypeOf:TD}=Object),kr=globalThis,N_=kr.trustedTypes,ID=N_?N_.emptyScript:"",RD=kr.reactiveElementPolyfillSupport,kl=(i,e)=>i,Gl={toAttribute(i,e){switch(e){case Boolean:i=i?ID:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},fd=(i,e)=>!ED(i,e),U_={attribute:!0,type:String,converter:Gl,reflect:!1,useDefault:!1,hasChanged:fd};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),kr.litPropertyMetadata??(kr.litPropertyMetadata=new WeakMap);$i=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=U_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),s=this.getPropertyDescriptor(e,n,t);s!==void 0&&SD(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){let{get:s,set:r}=wD(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){let a=s?.call(this);r?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??U_}static _$Ei(){if(this.hasOwnProperty(kl("elementProperties")))return;let e=TD(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(kl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kl("properties"))){let t=this.properties,n=[...CD(t),...MD(t)];for(let s of n)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,s]of t)this.elementProperties.set(n,s)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let s=this._$Eu(t,n);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let s of n)t.unshift(eA(s))}else e!==void 0&&t.push(eA(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return O_(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){let r=(n.converter?.toAttribute!==void 0?n.converter:Gl).toAttribute(t,n.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){let n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=n.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Gl;this._$Em=s;let a=o.fromAttribute(t,r.type);this[s]=a??this._$Ej?.get(s)??a,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let s=this.constructor,r=this[e];if(n??(n=s.getPropertyOptions(e)),!((n.hasChanged??fd)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},o){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[s,r]of n){let{wrapped:o}=r,a=this[s];o!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,r,a)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};$i.elementStyles=[],$i.shadowRootOptions={mode:"open"},$i[kl("elementProperties")]=new Map,$i[kl("finalized")]=new Map,RD?.({ReactiveElement:$i}),(kr.reactiveElementVersions??(kr.reactiveElementVersions=[])).push("2.1.1")});function Be(i){return(e,t)=>typeof t=="object"?DD(i,e,t):((n,s,r)=>{let o=s.hasOwnProperty(r);return s.constructor.createProperty(r,n),o?Object.getOwnPropertyDescriptor(s,r):void 0})(i,e,t)}var BD,DD,nA=oe(()=>{Ql();BD={attribute:!0,type:String,converter:Gl,reflect:!1,hasChanged:fd},DD=(i=BD,e,t)=>{let{kind:n,metadata:s}=t,r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),n==="setter"&&((i=Object.create(i)).wrapped=!0),r.set(t.name,i),n==="accessor"){let{name:o}=t;return{set(a){let c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,i)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(n==="setter"){let{name:o}=t;return function(a){let c=this[o];e.call(this,a),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+n)}});var k_=oe(()=>{nA();});var G_=oe(()=>{});var $a=oe(()=>{});var Q_=oe(()=>{$a();});var z_=oe(()=>{$a();});var H_=oe(()=>{$a();});var V_=oe(()=>{$a();});var W_=oe(()=>{$a();});var Vs=oe(()=>{D_();nA();k_();G_();Q_();z_();H_();V_();W_()});function Zi(){let i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Rn[i&255]+Rn[i>>8&255]+Rn[i>>16&255]+Rn[i>>24&255]+"-"+Rn[e&255]+Rn[e>>8&255]+"-"+Rn[e>>16&15|64]+Rn[e>>24&255]+"-"+Rn[t&63|128]+Rn[t>>8&255]+"-"+Rn[t>>16&255]+Rn[t>>24&255]+Rn[n&255]+Rn[n>>8&255]+Rn[n>>16&255]+Rn[n>>24&255]).toLowerCase()}function Ze(i,e,t){return Math.max(e,Math.min(t,i))}function ZA(i,e){return(i%e+e)%e}function LD(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function PD(i,e,t){return i!==e?(t-i)/(e-i):0}function jl(i,e,t){return(1-t)*i+t*e}function FD(i,e,t,n){return jl(i,e,1-Math.exp(-t*n))}function OD(i,e=1){return e-Math.abs(ZA(i,e*2)-e)}function ND(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function UD(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function kD(i,e){return i+Math.floor(Math.random()*(e-i+1))}function GD(i,e){return i+Math.random()*(e-i)}function QD(i){return i*(.5-Math.random())}function zD(i){i!==void 0&&(q_=i);let e=q_+=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 HD(i){return i*Yl}function VD(i){return i*No}function WD(i){return(i&i-1)===0&&i!==0}function qD(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function KD(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function $D(i,e,t,n,s){let r=Math.cos,o=Math.sin,a=r(t/2),c=o(t/2),l=r((e+n)/2),h=o((e+n)/2),u=r((e-n)/2),d=o((e-n)/2),f=r((n-e)/2),p=o((n-e)/2);switch(s){case"XYX":i.set(a*h,c*u,c*d,a*l);break;case"YZY":i.set(c*d,a*h,c*u,a*l);break;case"ZXZ":i.set(c*u,c*d,a*h,a*l);break;case"XZX":i.set(a*h,c*p,c*f,a*l);break;case"YXY":i.set(c*f,a*h,c*p,a*l);break;case"ZYZ":i.set(c*p,c*f,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Ji(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 Tt(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.")}}function eg(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function lc(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function dE(){let i=lc("canvas");return i.style.display="block",i}function ta(i){i in K_||(K_[i]=!0,console.warn(i))}function fE(i,e,t){return new Promise(function(n,s){function r(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function pE(i){let e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function mE(i){let e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}function XD(){let i={enabled:!0,workingColorSpace:st,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===It&&(s.r=Zs(s.r),s.g=Zs(s.g),s.b=Zs(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===It&&(s.r=cc(s.r),s.g=cc(s.g),s.b=cc(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Fn?Zl:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[st]:{primaries:e,whitePoint:n,transfer:Zl,toXYZ:$_,fromXYZ:X_,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:at},outputColorSpaceConfig:{drawingBufferColorSpace:at}},[at]:{primaries:e,whitePoint:n,transfer:It,toXYZ:$_,fromXYZ:X_,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:at}}}),i}function Zs(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function cc(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}function sA(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?Hd.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."),{})}function oA(i,e,t,n,s){for(let r=0,o=i.length-3;r<=o;r+=3){Mo.fromArray(i,r);let a=s.x*Math.abs(Mo.x)+s.y*Math.abs(Mo.y)+s.z*Math.abs(Mo.z),c=e.dot(Mo),l=t.dot(Mo),h=n.dot(Mo);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>a)return!1}return!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}function oL(){let i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let c=0;c<256;++c){let l=c-127;l<-27?(n[c]=0,n[c|256]=32768,s[c]=24,s[c|256]=24):l<-14?(n[c]=1024>>-l-14,n[c|256]=1024>>-l-14|32768,s[c]=-l-1,s[c|256]=-l-1):l<=15?(n[c]=l+15<<10,n[c|256]=l+15<<10|32768,s[c]=13,s[c|256]=13):l<128?(n[c]=31744,n[c|256]=64512,s[c]=24,s[c|256]=24):(n[c]=31744,n[c|256]=64512,s[c]=13,s[c|256]=13)}let r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let c=1;c<1024;++c){let l=c<<13,h=0;for(;(l&8388608)===0;)l<<=1,h-=8388608;l&=-8388609,h+=947912704,r[c]=l|h}for(let c=1024;c<2048;++c)r[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(a[c]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function aL(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=Ze(i,-65504,65504),js.floatView[0]=i;let e=js.uint32View[0],t=e>>23&511;return js.baseTable[t]+((e&8388607)>>js.shiftTable[t])}function cL(i){let e=i>>10;return js.uint32View[0]=js.mantissaTable[js.offsetTable[e]+(i&1023)]+js.exponentTable[e],js.floatView[0]}function hL(i,e,t,n,s,r,o,a){let c;if(e.side===en?c=n.intersectTriangle(o,r,s,!0,a):c=n.intersectTriangle(s,r,o,e.side===qn,a),c===null)return null;Id.copy(a),Id.applyMatrix4(i.matrixWorld);let l=t.ray.origin.distanceTo(Id);return l<t.near||l>t.far?null:{distance:l,point:Id.clone(),object:i}}function Rd(i,e,t,n,s,r,o,a,c,l){i.getVertexPosition(a,wd),i.getVertexPosition(c,Cd),i.getVertexPosition(l,Md);let h=hL(i,e,t,n,wd,Cd,Md,av);if(h){let u=new D;Pi.getBarycoord(av,wd,Cd,Md,u),s&&(h.uv=Pi.getInterpolatedAttribute(s,a,c,l,u,new Fe)),r&&(h.uv1=Pi.getInterpolatedAttribute(r,a,c,l,u,new Fe)),o&&(h.normal=Pi.getInterpolatedAttribute(o,a,c,l,u,new D),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let d={a,b:c,c:l,normal:new D,materialIndex:0};Pi.getNormal(wd,Cd,Md,d.normal),h.face=d,h.barycoord=u}return h}function na(i){let e={};for(let t in i){e[t]={};for(let n in i[t]){let s=i[t][n];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone():Array.isArray(s)?e[t][n]=s.slice():e[t][n]=s}}return e}function On(i){let e={};for(let t=0;t<i.length;t++){let n=na(i[t]);for(let s in n)e[s]=n[s]}return e}function uL(i){let e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function tg(i){let e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:it.workingColorSpace}function Fd(i,e,t,n,s,r){let o=i.geometry.attributes.position;if(Wd.fromBufferAttribute(o,s),qd.fromBufferAttribute(o,r),t.distanceSqToSegment(Wd,qd,wA,bv)>n)return;wA.applyMatrix4(i.matrixWorld);let c=e.ray.origin.distanceTo(wA);if(!(c<e.near||c>e.far))return{distance:c,point:bv.clone().applyMatrix4(i.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:i}}function Ev(i,e,t,n,s,r,o){let a=RA.distanceSqToPoint(i);if(a<t){let c=new D;RA.closestPointToPoint(i,c),c.applyMatrix4(n);let l=s.ray.origin.distanceTo(c);if(l<s.near||l>s.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}function Ud(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 bL(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function xL(i){function e(s,r){return i[s]-i[r]}let t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function Sv(i,e,t){let n=i.length,s=new i.constructor(n);for(let r=0,o=0;o!==n;++r){let a=t[r]*e;for(let c=0;c!==e;++c)s[o++]=i[a+c]}return s}function yE(i,e,t,n){let s=1,r=i[0];for(;r!==void 0&&r[n]===void 0;)r=i[s++];if(r===void 0)return;let o=r[n];if(o!==void 0)if(Array.isArray(o))do o=r[n],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=i[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[n],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=i[s++];while(r!==void 0);else do o=r[n],o!==void 0&&(e.push(r.time),t.push(o)),r=i[s++];while(r!==void 0)}function _L(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return vs;case"vector":case"vector2":case"vector3":case"vector4":return Ss;case"color":return yh;case"quaternion":return Es;case"bool":case"boolean":return ir;case"string":return sr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function vL(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=_L(i.type);if(i.times===void 0){let t=[],n=[];yE(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)}function Iv(i,e){return i.distance-e.distance}function OA(i,e,t,n){let s=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(s=!1),s===!0&&n===!0){let r=i.children;for(let o=0,a=r.length;o<a;o++)OA(r[o],e,t,!0)}}function sg(i,e,t,n){let s=DL(n);switch(t){case VA:return i*e;case qA:return i*e;case KA:return i*e*2;case Ms:return i*e/s.components*s.byteLength;case bf:return i*e/s.components*s.byteLength;case hr:return i*e*2/s.components*s.byteLength;case xf:return i*e*2/s.components*s.byteLength;case WA:return i*e*3/s.components*s.byteLength;case vt:return i*e*4/s.components*s.byteLength;case _f:return i*e*4/s.components*s.byteLength;case Ih:case $o:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Rh:case Xo:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case vf:case Ef:return Math.max(i,16)*Math.max(e,8)/4;case Ec:case Sc:return Math.max(i,8)*Math.max(e,8)/2;case wc:case Cc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Mc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Yo:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Sf:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case wf:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Cf:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case jo:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Mf:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Tf:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case If:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case Rf:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Bf:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Df:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case Lf:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case Pf:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case Ff:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case Jo:case Of:case Tc:return Math.ceil(i/4)*Math.ceil(e/4)*16;case $A:case Nf:return Math.ceil(i/4)*Math.ceil(e/4)*8;case Uf:case kf:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function DL(i){switch(i){case kt:case Mh:return{byteLength:1,components:1};case _c:case Th:case Lt:return{byteLength:2,components:1};case gf:case yf:return{byteLength:2,components:4};case Cs:case vc:case Ot:return{byteLength:4,components:1};case HA:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}var Rv,NA,Bv,UA,Dv,ws,qn,en,Ut,bi,Po,kA,GA,QA,Lv,qr,Pv,Fv,Ov,Nv,Uv,kv,Gv,Qv,Gd,Qd,zv,Hv,Vv,Wv,qv,Kv,$v,Xv,Yv,nf,sf,rf,Fo,of,af,cf,lf,zA,jv,Jv,xi,hf,uf,df,ff,Zv,pf,ar,TA,eE,cr,Yr,qo,xc,mf,Ch,Dn,Bt,es,Ft,lr,Oi,qe,ts,rn,Af,kt,Mh,Th,_c,vc,Cs,Ot,Lt,gf,yf,Ko,HA,VA,WA,vt,qA,KA,Lo,Oo,Ms,bf,hr,xf,_f,Ih,$o,Rh,Xo,Ec,vf,Sc,Ef,wc,Cc,Mc,Yo,Sf,wf,Cf,jo,Mf,Tf,If,Rf,Bf,Df,Lf,Pf,Ff,Jo,Of,Tc,$A,Nf,Uf,kf,jr,ur,Zo,er,tr,kd,Bo,Do,Jl,Gf,tE,XA,Bh,Ic,nE,iE,YA,sE,Fn,at,st,Zl,It,Ro,IA,rE,oE,aE,jA,cE,lE,hE,uE,zd,JA,ys,eh,xn,Rn,q_,Yl,No,ea,Fe,Qe,iA,K_,$_,X_,it,Xa,Hd,YD,Uo,jD,bt,_t,Vd,_n,th,hc,$t,D,rA,Y_,jt,Ws,Xi,md,Ya,ja,Ja,Gr,Qr,Co,zl,Ad,gd,Mo,JD,Hl,aA,vn,qs,cA,yd,zr,lA,bd,hA,Kr,Oe,Za,Yi,ZD,eL,Hr,xd,mi,j_,J_,Kn,uc,tL,Z_,ec,Ks,_d,Vl,nL,iL,ev,tv,nv,iv,sL,tc,uA,Ct,ji,$s,dA,Xs,nc,ic,sv,fA,pA,mA,AA,gA,yA,Pi,AE,Vr,vd,Ce,Bn,rL,Ln,Jt,js,Rc,nn,Ed,yt,nh,ih,bn,lL,Li,xA,sc,Ai,Wl,yn,Zt,rv,To,Sd,ov,wd,Cd,Md,_A,Td,av,Id,Ke,ii,gE,dL,fL,sn,sh,Wr,cv,lv,Kt,rc,oc,ko,rh,$r,Pn,dc,Wn,fc,hv,uv,dv,pL,fv,Bd,vA,pv,EA,oh,pc,bs,mv,mL,ah,Xr,ac,Av,Dd,gv,AL,ql,Kl,ch,SA,gL,yL,gs,Io,Ld,mc,Ac,Wd,qd,yv,$l,Pd,wA,bv,xs,xv,_v,lh,hh,gc,vv,RA,Od,Nd,uh,si,dh,Fi,fh,ph,Go,mh,ri,Ah,_s,oi,yc,Kd,nr,$d,gh,Xd,gi,ir,yh,vs,Yd,Es,sr,Ss,Qo,Js,bc,bE,ln,Ys,BA,En,jd,bh,zo,Ho,CA,wv,Cv,xh,DA,_h,Mv,Xl,MA,LA,Vo,yi,PA,Wo,Jd,vh,rr,Eh,Zd,ef,ng,EL,ig,SL,wL,CL,ML,TL,IL,RL,FA,gt,tf,BL,Sh,Tv,wh,or,rg=oe(()=>{Rv=0,NA=1,Bv=2,UA=1,Dv=2,ws=3,qn=0,en=1,Ut=2,bi=0,Po=1,kA=2,GA=3,QA=4,Lv=5,qr=100,Pv=101,Fv=102,Ov=103,Nv=104,Uv=200,kv=201,Gv=202,Qv=203,Gd=204,Qd=205,zv=206,Hv=207,Vv=208,Wv=209,qv=210,Kv=211,$v=212,Xv=213,Yv=214,nf=0,sf=1,rf=2,Fo=3,of=4,af=5,cf=6,lf=7,zA=0,jv=1,Jv=2,xi=0,hf=1,uf=2,df=3,ff=4,Zv=5,pf=6,ar=7,TA="attached",eE="detached",cr=300,Yr=301,qo=302,xc=303,mf=304,Ch=306,Dn=1e3,Bt=1001,es=1002,Ft=1003,lr=1004,Oi=1005,qe=1006,ts=1007,rn=1008,Af=1008,kt=1009,Mh=1010,Th=1011,_c=1012,vc=1013,Cs=1014,Ot=1015,Lt=1016,gf=1017,yf=1018,Ko=1020,HA=35902,VA=1021,WA=1022,vt=1023,qA=1024,KA=1025,Lo=1026,Oo=1027,Ms=1028,bf=1029,hr=1030,xf=1031,_f=1033,Ih=33776,$o=33777,Rh=33778,Xo=33779,Ec=35840,vf=35841,Sc=35842,Ef=35843,wc=36196,Cc=37492,Mc=37496,Yo=37808,Sf=37809,wf=37810,Cf=37811,jo=37812,Mf=37813,Tf=37814,If=37815,Rf=37816,Bf=37817,Df=37818,Lf=37819,Pf=37820,Ff=37821,Jo=36492,Of=36494,Tc=36495,$A=36283,Nf=36284,Uf=36285,kf=36286,jr=2200,ur=2201,Zo=2202,er=2300,tr=2301,kd=2302,Bo=2400,Do=2401,Jl=2402,Gf=2500,tE=2501,XA=0,Bh=1,Ic=2,nE=3200,iE=3201,YA=0,sE=1,Fn="",at="srgb",st="srgb-linear",Zl="linear",It="srgb",Ro=7680,IA=519,rE=512,oE=513,aE=514,jA=515,cE=516,lE=517,hE=518,uE=519,zd=35044,JA="300 es",ys=2e3,eh=2001,xn=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let 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;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let s=this._listeners[e];if(s!==void 0){let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let n=this._listeners[e.type];if(n!==void 0){e.target=this;let s=n.slice(0);for(let r=0,o=s.length;r<o;r++)s[r].call(this,e);e.target=null}}},Rn=["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"],q_=1234567,Yl=Math.PI/180,No=180/Math.PI;ea={DEG2RAD:Yl,RAD2DEG:No,generateUUID:Zi,clamp:Ze,euclideanModulo:ZA,mapLinear:LD,inverseLerp:PD,lerp:jl,damp:FD,pingpong:OD,smoothstep:ND,smootherstep:UD,randInt:kD,randFloat:GD,randFloatSpread:QD,seededRandom:zD,degToRad:HD,radToDeg:VD,isPowerOfTwo:WD,ceilPowerOfTwo:qD,floorPowerOfTwo:KD,setQuaternionFromProperEuler:$D,normalize:Tt,denormalize:Ji},Fe=class i{constructor(e=0,t=0){i.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[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=Ze(this.x,e.x,t.x),this.y=Ze(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ze(this.x,e,t),this.y=Ze(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ze(n,e,t))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ze(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*n-o*s+e.x,this.y=r*s+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Qe=class i{constructor(e,t,n,s,r,o,a,c,l){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,r,o,a,c,l)}set(e,t,n,s,r,o,a,c,l){let h=this.elements;return h[0]=e,h[1]=s,h[2]=a,h[3]=t,h[4]=r,h[5]=c,h[6]=n,h[7]=o,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,s=t.elements,r=this.elements,o=n[0],a=n[3],c=n[6],l=n[1],h=n[4],u=n[7],d=n[2],f=n[5],p=n[8],g=s[0],A=s[3],m=s[6],b=s[1],x=s[4],y=s[7],_=s[2],S=s[5],C=s[8];return r[0]=o*g+a*b+c*_,r[3]=o*A+a*x+c*S,r[6]=o*m+a*y+c*C,r[1]=l*g+h*b+u*_,r[4]=l*A+h*x+u*S,r[7]=l*m+h*y+u*C,r[2]=d*g+f*b+p*_,r[5]=d*A+f*x+p*S,r[8]=d*m+f*y+p*C,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8];return t*o*h-t*a*l-n*r*h+n*a*c+s*r*l-s*o*c}invert(){let e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8],u=h*o-a*l,d=a*c-h*r,f=l*r-o*c,p=t*u+n*d+s*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/p;return e[0]=u*g,e[1]=(s*l-h*n)*g,e[2]=(a*n-s*o)*g,e[3]=d*g,e[4]=(h*t-s*c)*g,e[5]=(s*r-a*t)*g,e[6]=f*g,e[7]=(n*c-l*t)*g,e[8]=(o*t-n*r)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,o,a){let c=Math.cos(r),l=Math.sin(r);return this.set(n*c,n*l,-n*(c*o+l*a)+o+e,-s*l,s*c,-s*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(iA.makeScale(e,t)),this}rotate(e){return this.premultiply(iA.makeRotation(-e)),this}translate(e,t){return this.premultiply(iA.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){let 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){let t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},iA=new Qe;K_={};$_=new Qe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),X_=new Qe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);it=XD();Hd=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Xa===void 0&&(Xa=lc("canvas")),Xa.width=e.width,Xa.height=e.height;let n=Xa.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Xa}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){let t=lc("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let s=n.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o<r.length;o++)r[o]=Zs(r[o]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Zs(t[n]/255)*255):t[n]=Zs(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}},YD=0,Uo=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:YD++}),this.uuid=Zi(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let r;if(Array.isArray(s)){r=[];for(let o=0,a=s.length;o<a;o++)s[o].isDataTexture?r.push(sA(s[o].image)):r.push(sA(s[o]))}else r=sA(s);n.url=r}return t||(e.images[this.uuid]=n),n}};jD=0,bt=class i extends xn{constructor(e=i.DEFAULT_IMAGE,t=i.DEFAULT_MAPPING,n=Bt,s=Bt,r=qe,o=rn,a=vt,c=kt,l=i.DEFAULT_ANISOTROPY,h=Fn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:jD++}),this.uuid=Zi(),this.name="",this.source=new Uo(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new Fe(0,0),this.repeat=new Fe(1,1),this.center=new Fe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Qe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let 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!==cr)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Dn:e.x=e.x-Math.floor(e.x);break;case Bt:e.x=e.x<0?0:1;break;case es: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 Dn:e.y=e.y-Math.floor(e.y);break;case Bt:e.y=e.y<0?0:1;break;case es:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};bt.DEFAULT_IMAGE=null;bt.DEFAULT_MAPPING=cr;bt.DEFAULT_ANISOTROPY=1;_t=class i{constructor(e=0,t=0,n=0,s=1){i.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}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,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*n+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*n+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*n+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,r,c=e.elements,l=c[0],h=c[4],u=c[8],d=c[1],f=c[5],p=c[9],g=c[2],A=c[6],m=c[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-A)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+A)<.1&&Math.abs(l+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let x=(l+1)/2,y=(f+1)/2,_=(m+1)/2,S=(h+d)/4,C=(u+g)/4,w=(p+A)/4;return x>y&&x>_?x<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(x),s=S/n,r=C/n):y>_?y<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(y),n=S/s,r=w/s):_<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(_),n=C/r,s=w/r),this.set(n,s,r,t),this}let b=Math.sqrt((A-p)*(A-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(b)<.001&&(b=1),this.x=(A-p)/b,this.y=(u-g)/b,this.z=(d-h)/b,this.w=Math.acos((l+f+m-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],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=Ze(this.x,e.x,t.x),this.y=Ze(this.y,e.y,t.y),this.z=Ze(this.z,e.z,t.z),this.w=Ze(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ze(this.x,e,t),this.y=Ze(this.y,e,t),this.z=Ze(this.z,e,t),this.w=Ze(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ze(n,e,t))}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}},Vd=class extends xn{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new _t(0,0,e,t),this.scissorTest=!1,this.viewport=new _t(0,0,e,t);let s={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:qe,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let r=new bt(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=r.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,s=e.textures.length;n<s;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;let t=Object.assign({},e.texture.image);return this.texture.source=new Uo(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},_n=class extends Vd{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},th=class extends bt{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Ft,this.minFilter=Ft,this.wrapR=Bt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},hc=class extends bt{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Ft,this.minFilter=Ft,this.wrapR=Bt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},$t=class{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,o,a){let c=n[s+0],l=n[s+1],h=n[s+2],u=n[s+3],d=r[o+0],f=r[o+1],p=r[o+2],g=r[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u;return}if(a===1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=g;return}if(u!==g||c!==d||l!==f||h!==p){let A=1-a,m=c*d+l*f+h*p+u*g,b=m>=0?1:-1,x=1-m*m;if(x>Number.EPSILON){let _=Math.sqrt(x),S=Math.atan2(_,m*b);A=Math.sin(A*S)/_,a=Math.sin(a*S)/_}let y=a*b;if(c=c*A+d*y,l=l*A+f*y,h=h*A+p*y,u=u*A+g*y,A===1-a){let _=1/Math.sqrt(c*c+l*l+h*h+u*u);c*=_,l*=_,h*=_,u*=_}}e[t]=c,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,s,r,o){let a=n[s],c=n[s+1],l=n[s+2],h=n[s+3],u=r[o],d=r[o+1],f=r[o+2],p=r[o+3];return e[t]=a*p+h*u+c*f-l*d,e[t+1]=c*p+h*d+l*u-a*f,e[t+2]=l*p+h*f+a*d-c*u,e[t+3]=h*p-a*u-c*d-l*f,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,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(n/2),h=a(s/2),u=a(r/2),d=c(n/2),f=c(s/2),p=c(r/2);switch(o){case"XYZ":this._x=d*h*u+l*f*p,this._y=l*f*u-d*h*p,this._z=l*h*p+d*f*u,this._w=l*h*u-d*f*p;break;case"YXZ":this._x=d*h*u+l*f*p,this._y=l*f*u-d*h*p,this._z=l*h*p-d*f*u,this._w=l*h*u+d*f*p;break;case"ZXY":this._x=d*h*u-l*f*p,this._y=l*f*u+d*h*p,this._z=l*h*p+d*f*u,this._w=l*h*u-d*f*p;break;case"ZYX":this._x=d*h*u-l*f*p,this._y=l*f*u+d*h*p,this._z=l*h*p-d*f*u,this._w=l*h*u+d*f*p;break;case"YZX":this._x=d*h*u+l*f*p,this._y=l*f*u+d*h*p,this._z=l*h*p-d*f*u,this._w=l*h*u-d*f*p;break;case"XZY":this._x=d*h*u-l*f*p,this._y=l*f*u-d*h*p,this._z=l*h*p+d*f*u,this._w=l*h*u+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],s=t[4],r=t[8],o=t[1],a=t[5],c=t[9],l=t[2],h=t[6],u=t[10],d=n+a+u;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-c)*f,this._y=(r-l)*f,this._z=(o-s)*f}else if(n>a&&n>u){let f=2*Math.sqrt(1+n-a-u);this._w=(h-c)/f,this._x=.25*f,this._y=(s+o)/f,this._z=(r+l)/f}else if(a>u){let f=2*Math.sqrt(1+a-n-u);this._w=(r-l)/f,this._x=(s+o)/f,this._y=.25*f,this._z=(c+h)/f}else{let f=2*Math.sqrt(1+u-n-a);this._w=(o-s)/f,this._x=(r+l)/f,this._y=(c+h)/f,this._z=.25*f}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(Ze(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,s=e._y,r=e._z,o=e._w,a=t._x,c=t._y,l=t._z,h=t._w;return this._x=n*h+o*a+s*l-r*c,this._y=s*h+o*c+r*a-n*l,this._z=r*h+o*l+n*c-s*a,this._w=o*h-n*a-s*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,s=this._y,r=this._z,o=this._w,a=o*e._w+n*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=s,this._z=r,this;let c=1-a*a;if(c<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*s+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}let l=Math.sqrt(c),h=Math.atan2(l,a),u=Math.sin((1-t)*h)/l,d=Math.sin(t*h)/l;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=s*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},D=class i{constructor(e=0,t=0,n=0){i.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(Y_.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Y_.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,s=this.z,r=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*s-a*n),h=2*(a*t-r*s),u=2*(r*n-o*t);return this.x=t+c*l+o*u-a*h,this.y=n+c*h+a*l-r*u,this.z=s+c*u+r*h-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,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=Ze(this.x,e.x,t.x),this.y=Ze(this.y,e.y,t.y),this.z=Ze(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ze(this.x,e,t),this.y=Ze(this.y,e,t),this.z=Ze(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ze(n,e,t))}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){let n=e.x,s=e.y,r=e.z,o=t.x,a=t.y,c=t.z;return this.x=s*c-r*a,this.y=r*o-n*c,this.z=n*a-s*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return rA.copy(this).projectOnVector(e),this.sub(rA)}reflect(e){return this.sub(rA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ze(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},rA=new D,Y_=new $t,jt=class{constructor(e=new D(1/0,1/0,1/0),t=new D(-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(Xi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Xi.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){let n=Xi.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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=r.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Xi):Xi.fromBufferAttribute(r,o),Xi.applyMatrix4(e.matrixWorld),this.expandByPoint(Xi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),md.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),md.copy(n.boundingBox)),md.applyMatrix4(e.matrixWorld),this.union(md)}let s=e.children;for(let r=0,o=s.length;r<o;r++)this.expandByObject(s[r],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,Xi),Xi.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),Ad.subVectors(this.max,zl),Ya.subVectors(e.a,zl),ja.subVectors(e.b,zl),Ja.subVectors(e.c,zl),Gr.subVectors(ja,Ya),Qr.subVectors(Ja,ja),Co.subVectors(Ya,Ja);let t=[0,-Gr.z,Gr.y,0,-Qr.z,Qr.y,0,-Co.z,Co.y,Gr.z,0,-Gr.x,Qr.z,0,-Qr.x,Co.z,0,-Co.x,-Gr.y,Gr.x,0,-Qr.y,Qr.x,0,-Co.y,Co.x,0];return!oA(t,Ya,ja,Ja,Ad)||(t=[1,0,0,0,1,0,0,0,1],!oA(t,Ya,ja,Ja,Ad))?!1:(gd.crossVectors(Gr,Qr),t=[gd.x,gd.y,gd.z],oA(t,Ya,ja,Ja,Ad))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Xi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Xi).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:(Ws[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ws[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ws[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ws[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ws[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ws[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ws[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ws[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ws),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)}},Ws=[new D,new D,new D,new D,new D,new D,new D,new D],Xi=new D,md=new jt,Ya=new D,ja=new D,Ja=new D,Gr=new D,Qr=new D,Co=new D,zl=new D,Ad=new D,gd=new D,Mo=new D;JD=new jt,Hl=new D,aA=new D,vn=class{constructor(e=new D,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):JD.setFromPoints(e).getCenter(n);let s=0;for(let r=0,o=e.length;r<o;r++)s=Math.max(s,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(s),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){let 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){let 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;Hl.subVectors(e,this.center);let t=Hl.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(Hl,s/n),this.radius+=s}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):(aA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hl.copy(e.center).add(aA)),this.expandByPoint(Hl.copy(e.center).sub(aA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},qs=new D,cA=new D,yd=new D,zr=new D,lA=new D,bd=new D,hA=new D,Kr=class{constructor(e=new D,t=new D(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,qs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=qs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(qs.copy(this.origin).addScaledVector(this.direction,t),qs.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){cA.copy(e).add(t).multiplyScalar(.5),yd.copy(t).sub(e).normalize(),zr.copy(this.origin).sub(cA);let r=e.distanceTo(t)*.5,o=-this.direction.dot(yd),a=zr.dot(this.direction),c=-zr.dot(yd),l=zr.lengthSq(),h=Math.abs(1-o*o),u,d,f,p;if(h>0)if(u=o*c-a,d=o*a-c,p=r*h,u>=0)if(d>=-p)if(d<=p){let g=1/h;u*=g,d*=g,f=u*(u+o*d+2*a)+d*(o*u+d+2*c)+l}else d=r,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;else d=-r,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;else d<=-p?(u=Math.max(0,-(-o*r+a)),d=u>0?-r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l):d<=p?(u=0,d=Math.min(Math.max(-r,-c),r),f=d*(d+2*c)+l):(u=Math.max(0,-(o*r+a)),d=u>0?r:Math.min(Math.max(-r,-c),r),f=-u*u+d*(d+2*c)+l);else d=o>0?-r:r,u=Math.max(0,-(o*d+a)),f=-u*u+d*(d+2*c)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(cA).addScaledVector(yd,d),f}intersectSphere(e,t){qs.subVectors(e.center,this.origin);let n=qs.dot(this.direction),s=qs.dot(qs)-n*n,r=e.radius*e.radius;if(s>r)return null;let o=Math.sqrt(r-s),a=n-o,c=n+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,r,o,a,c,l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,s=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,s=(e.min.x-d.x)*l),h>=0?(r=(e.min.y-d.y)*h,o=(e.max.y-d.y)*h):(r=(e.max.y-d.y)*h,o=(e.min.y-d.y)*h),n>o||r>s||((r>n||isNaN(n))&&(n=r),(o<s||isNaN(s))&&(s=o),u>=0?(a=(e.min.z-d.z)*u,c=(e.max.z-d.z)*u):(a=(e.max.z-d.z)*u,c=(e.min.z-d.z)*u),n>c||a>s)||((a>n||n!==n)&&(n=a),(c<s||s!==s)&&(s=c),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,qs)!==null}intersectTriangle(e,t,n,s,r){lA.subVectors(t,e),bd.subVectors(n,e),hA.crossVectors(lA,bd);let o=this.direction.dot(hA),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;zr.subVectors(this.origin,e);let c=a*this.direction.dot(bd.crossVectors(zr,bd));if(c<0)return null;let l=a*this.direction.dot(lA.cross(zr));if(l<0||c+l>o)return null;let h=-a*zr.dot(hA);return h<0?null:this.at(h/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Oe=class i{constructor(e,t,n,s,r,o,a,c,l,h,u,d,f,p,g,A){i.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,s,r,o,a,c,l,h,u,d,f,p,g,A)}set(e,t,n,s,r,o,a,c,l,h,u,d,f,p,g,A){let m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=c,m[2]=l,m[6]=h,m[10]=u,m[14]=d,m[3]=f,m[7]=p,m[11]=g,m[15]=A,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 i().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,s=1/Za.setFromMatrixColumn(e,0).length(),r=1/Za.setFromMatrixColumn(e,1).length(),o=1/Za.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,s=e.y,r=e.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(s),l=Math.sin(s),h=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){let d=o*h,f=o*u,p=a*h,g=a*u;t[0]=c*h,t[4]=-c*u,t[8]=l,t[1]=f+p*l,t[5]=d-g*l,t[9]=-a*c,t[2]=g-d*l,t[6]=p+f*l,t[10]=o*c}else if(e.order==="YXZ"){let d=c*h,f=c*u,p=l*h,g=l*u;t[0]=d+g*a,t[4]=p*a-f,t[8]=o*l,t[1]=o*u,t[5]=o*h,t[9]=-a,t[2]=f*a-p,t[6]=g+d*a,t[10]=o*c}else if(e.order==="ZXY"){let d=c*h,f=c*u,p=l*h,g=l*u;t[0]=d-g*a,t[4]=-o*u,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*h,t[9]=g-d*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){let d=o*h,f=o*u,p=a*h,g=a*u;t[0]=c*h,t[4]=p*l-f,t[8]=d*l+g,t[1]=c*u,t[5]=g*l+d,t[9]=f*l-p,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){let d=o*c,f=o*l,p=a*c,g=a*l;t[0]=c*h,t[4]=g-d*u,t[8]=p*u+f,t[1]=u,t[5]=o*h,t[9]=-a*h,t[2]=-l*h,t[6]=f*u+p,t[10]=d-g*u}else if(e.order==="XZY"){let d=o*c,f=o*l,p=a*c,g=a*l;t[0]=c*h,t[4]=-u,t[8]=l*h,t[1]=d*u+g,t[5]=o*h,t[9]=f*u-p,t[2]=p*u-f,t[6]=a*h,t[10]=g*u+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ZD,e,eL)}lookAt(e,t,n){let s=this.elements;return mi.subVectors(e,t),mi.lengthSq()===0&&(mi.z=1),mi.normalize(),Hr.crossVectors(n,mi),Hr.lengthSq()===0&&(Math.abs(n.z)===1?mi.x+=1e-4:mi.z+=1e-4,mi.normalize(),Hr.crossVectors(n,mi)),Hr.normalize(),xd.crossVectors(mi,Hr),s[0]=Hr.x,s[4]=xd.x,s[8]=mi.x,s[1]=Hr.y,s[5]=xd.y,s[9]=mi.y,s[2]=Hr.z,s[6]=xd.z,s[10]=mi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,s=t.elements,r=this.elements,o=n[0],a=n[4],c=n[8],l=n[12],h=n[1],u=n[5],d=n[9],f=n[13],p=n[2],g=n[6],A=n[10],m=n[14],b=n[3],x=n[7],y=n[11],_=n[15],S=s[0],C=s[4],w=s[8],v=s[12],E=s[1],R=s[5],F=s[9],P=s[13],U=s[2],V=s[6],O=s[10],K=s[14],z=s[3],ee=s[7],ae=s[11],he=s[15];return r[0]=o*S+a*E+c*U+l*z,r[4]=o*C+a*R+c*V+l*ee,r[8]=o*w+a*F+c*O+l*ae,r[12]=o*v+a*P+c*K+l*he,r[1]=h*S+u*E+d*U+f*z,r[5]=h*C+u*R+d*V+f*ee,r[9]=h*w+u*F+d*O+f*ae,r[13]=h*v+u*P+d*K+f*he,r[2]=p*S+g*E+A*U+m*z,r[6]=p*C+g*R+A*V+m*ee,r[10]=p*w+g*F+A*O+m*ae,r[14]=p*v+g*P+A*K+m*he,r[3]=b*S+x*E+y*U+_*z,r[7]=b*C+x*R+y*V+_*ee,r[11]=b*w+x*F+y*O+_*ae,r[15]=b*v+x*P+y*K+_*he,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],o=e[1],a=e[5],c=e[9],l=e[13],h=e[2],u=e[6],d=e[10],f=e[14],p=e[3],g=e[7],A=e[11],m=e[15];return p*(+r*c*u-s*l*u-r*a*d+n*l*d+s*a*f-n*c*f)+g*(+t*c*f-t*l*d+r*o*d-s*o*f+s*l*h-r*c*h)+A*(+t*l*u-t*a*f-r*o*u+n*o*f+r*a*h-n*l*h)+m*(-s*a*h-t*c*u+t*a*d+s*o*u-n*o*d+n*c*h)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],f=e[11],p=e[12],g=e[13],A=e[14],m=e[15],b=u*A*l-g*d*l+g*c*f-a*A*f-u*c*m+a*d*m,x=p*d*l-h*A*l-p*c*f+o*A*f+h*c*m-o*d*m,y=h*g*l-p*u*l+p*a*f-o*g*f-h*a*m+o*u*m,_=p*u*c-h*g*c-p*a*d+o*g*d+h*a*A-o*u*A,S=t*b+n*x+s*y+r*_;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let C=1/S;return e[0]=b*C,e[1]=(g*d*r-u*A*r-g*s*f+n*A*f+u*s*m-n*d*m)*C,e[2]=(a*A*r-g*c*r+g*s*l-n*A*l-a*s*m+n*c*m)*C,e[3]=(u*c*r-a*d*r-u*s*l+n*d*l+a*s*f-n*c*f)*C,e[4]=x*C,e[5]=(h*A*r-p*d*r+p*s*f-t*A*f-h*s*m+t*d*m)*C,e[6]=(p*c*r-o*A*r-p*s*l+t*A*l+o*s*m-t*c*m)*C,e[7]=(o*d*r-h*c*r+h*s*l-t*d*l-o*s*f+t*c*f)*C,e[8]=y*C,e[9]=(p*u*r-h*g*r-p*n*f+t*g*f+h*n*m-t*u*m)*C,e[10]=(o*g*r-p*a*r+p*n*l-t*g*l-o*n*m+t*a*m)*C,e[11]=(h*a*r-o*u*r-h*n*l+t*u*l+o*n*f-t*a*f)*C,e[12]=_*C,e[13]=(h*g*s-p*u*s+p*n*d-t*g*d-h*n*A+t*u*A)*C,e[14]=(p*a*s-o*g*s-p*n*c+t*g*c+o*n*A-t*a*A)*C,e[15]=(o*u*s-h*a*s+h*n*c-t*u*c-o*n*d+t*a*d)*C,this}scale(e){let t=this.elements,n=e.x,s=e.y,r=e.z;return t[0]*=n,t[4]*=s,t[8]*=r,t[1]*=n,t[5]*=s,t[9]*=r,t[2]*=n,t[6]*=s,t[10]*=r,t[3]*=n,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}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){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),s=Math.sin(t),r=1-n,o=e.x,a=e.y,c=e.z,l=r*o,h=r*a;return this.set(l*o+n,l*a-s*c,l*c+s*a,0,l*a+s*c,h*a+n,h*c-s*o,0,l*c-s*a,h*c+s*o,r*c*c+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,o){return this.set(1,n,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){let s=this.elements,r=t._x,o=t._y,a=t._z,c=t._w,l=r+r,h=o+o,u=a+a,d=r*l,f=r*h,p=r*u,g=o*h,A=o*u,m=a*u,b=c*l,x=c*h,y=c*u,_=n.x,S=n.y,C=n.z;return s[0]=(1-(g+m))*_,s[1]=(f+y)*_,s[2]=(p-x)*_,s[3]=0,s[4]=(f-y)*S,s[5]=(1-(d+m))*S,s[6]=(A+b)*S,s[7]=0,s[8]=(p+x)*C,s[9]=(A-b)*C,s[10]=(1-(d+g))*C,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){let s=this.elements,r=Za.set(s[0],s[1],s[2]).length(),o=Za.set(s[4],s[5],s[6]).length(),a=Za.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Yi.copy(this);let l=1/r,h=1/o,u=1/a;return Yi.elements[0]*=l,Yi.elements[1]*=l,Yi.elements[2]*=l,Yi.elements[4]*=h,Yi.elements[5]*=h,Yi.elements[6]*=h,Yi.elements[8]*=u,Yi.elements[9]*=u,Yi.elements[10]*=u,t.setFromRotationMatrix(Yi),n.x=r,n.y=o,n.z=a,this}makePerspective(e,t,n,s,r,o,a=ys){let c=this.elements,l=2*r/(t-e),h=2*r/(n-s),u=(t+e)/(t-e),d=(n+s)/(n-s),f,p;if(a===ys)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===eh)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=u,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=p,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,s,r,o,a=ys){let c=this.elements,l=1/(t-e),h=1/(n-s),u=1/(o-r),d=(t+e)*l,f=(n+s)*h,p,g;if(a===ys)p=(o+r)*u,g=-2*u;else if(a===eh)p=r*u,g=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=g,c[14]=-p,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Za=new D,Yi=new Oe,ZD=new D(0,0,0),eL=new D(1,1,1),Hr=new D,xd=new D,mi=new D,j_=new Oe,J_=new $t,Kn=class i{constructor(e=0,t=0,n=0,s=i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}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,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let s=e.elements,r=s[0],o=s[4],a=s[8],c=s[1],l=s[5],h=s[9],u=s[2],d=s[6],f=s[10];switch(t){case"XYZ":this._y=Math.asin(Ze(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ze(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ze(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Ze(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Ze(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ze(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-h,f),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 j_.makeRotationFromQuaternion(e),this.setFromRotationMatrix(j_,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return J_.setFromEuler(this),this.setFromQuaternion(J_,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}};Kn.DEFAULT_ORDER="XYZ";uc=class{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}},tL=0,Z_=new D,ec=new $t,Ks=new Oe,_d=new D,Vl=new D,nL=new D,iL=new $t,ev=new D(1,0,0),tv=new D(0,1,0),nv=new D(0,0,1),iv={type:"added"},sL={type:"removed"},tc={type:"childadded",child:null},uA={type:"childremoved",child:null},Ct=class i extends xn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tL++}),this.uuid=Zi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i.DEFAULT_UP.clone();let e=new D,t=new Kn,n=new $t,s=new D(1,1,1);function r(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new Oe},normalMatrix:{value:new Qe}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=i.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new uc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ec.setFromAxisAngle(e,t),this.quaternion.multiply(ec),this}rotateOnWorldAxis(e,t){return ec.setFromAxisAngle(e,t),this.quaternion.premultiply(ec),this}rotateX(e){return this.rotateOnAxis(ev,e)}rotateY(e){return this.rotateOnAxis(tv,e)}rotateZ(e){return this.rotateOnAxis(nv,e)}translateOnAxis(e,t){return Z_.copy(e).applyQuaternion(this.quaternion),this.position.add(Z_.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ev,e)}translateY(e){return this.translateOnAxis(tv,e)}translateZ(e){return this.translateOnAxis(nv,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ks.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_d.copy(e):_d.set(e,t,n);let s=this.parent;this.updateWorldMatrix(!0,!1),Vl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ks.lookAt(Vl,_d,this.up):Ks.lookAt(_d,Vl,this.up),this.quaternion.setFromRotationMatrix(Ks),s&&(Ks.extractRotation(s.matrixWorld),ec.setFromRotationMatrix(Ks),this.quaternion.premultiply(ec.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(iv),tc.child=e,this.dispatchEvent(tc),tc.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(sL),uA.child=e,this.dispatchEvent(uA),uA.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ks.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ks.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ks),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(iv),tc.child=e,this.dispatchEvent(tc),tc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){let o=this.children[n].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let s=this.children;for(let r=0,o=s.length;r<o;r++)s[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,e,nL),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vl,iL,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){let 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.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let s=this.children;for(let r=0,o=s.length;r<o;r++)s[r].updateWorldMatrix(!1,!0)}}toJSON(e){let 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"});let s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let c=a.shapes;if(Array.isArray(c))for(let l=0,h=c.length;l<h;l++){let u=c[l];r(e.shapes,u)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(r(e.materials,this.material[c]));s.material=a}else s.material=r(e.materials,this.material);if(this.children.length>0){s.children=[];for(let a=0;a<this.children.length;a++)s.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let a=0;a<this.animations.length;a++){let c=this.animations[a];s.animations.push(r(e.animations,c))}}if(t){let a=o(e.geometries),c=o(e.materials),l=o(e.textures),h=o(e.images),u=o(e.shapes),d=o(e.skeletons),f=o(e.animations),p=o(e.nodes);a.length>0&&(n.geometries=a),c.length>0&&(n.materials=c),l.length>0&&(n.textures=l),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),p.length>0&&(n.nodes=p)}return n.object=s,n;function o(a){let c=[];for(let l in a){let h=a[l];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let s=e.children[n];this.add(s.clone())}return this}};Ct.DEFAULT_UP=new D(0,1,0);Ct.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ct.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;ji=new D,$s=new D,dA=new D,Xs=new D,nc=new D,ic=new D,sv=new D,fA=new D,pA=new D,mA=new D,AA=new _t,gA=new _t,yA=new _t,Pi=class i{constructor(e=new D,t=new D,n=new D){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),ji.subVectors(e,t),s.cross(ji);let r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,n,s,r){ji.subVectors(s,t),$s.subVectors(n,t),dA.subVectors(e,t);let o=ji.dot(ji),a=ji.dot($s),c=ji.dot(dA),l=$s.dot($s),h=$s.dot(dA),u=o*l-a*a;if(u===0)return r.set(0,0,0),null;let d=1/u,f=(l*c-a*h)*d,p=(o*h-a*c)*d;return r.set(1-f-p,p,f)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Xs)===null?!1:Xs.x>=0&&Xs.y>=0&&Xs.x+Xs.y<=1}static getInterpolation(e,t,n,s,r,o,a,c){return this.getBarycoord(e,t,n,s,Xs)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(r,Xs.x),c.addScaledVector(o,Xs.y),c.addScaledVector(a,Xs.z),c)}static getInterpolatedAttribute(e,t,n,s,r,o){return AA.setScalar(0),gA.setScalar(0),yA.setScalar(0),AA.fromBufferAttribute(e,t),gA.fromBufferAttribute(e,n),yA.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(AA,r.x),o.addScaledVector(gA,r.y),o.addScaledVector(yA,r.z),o}static isFrontFacing(e,t,n,s){return ji.subVectors(n,t),$s.subVectors(e,t),ji.cross($s).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),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 ji.subVectors(this.c,this.b),$s.subVectors(this.a,this.b),ji.cross($s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return i.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return i.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,r){return i.getInterpolation(e,this.a,this.b,this.c,t,n,s,r)}containsPoint(e){return i.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return i.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,s=this.b,r=this.c,o,a;nc.subVectors(s,n),ic.subVectors(r,n),fA.subVectors(e,n);let c=nc.dot(fA),l=ic.dot(fA);if(c<=0&&l<=0)return t.copy(n);pA.subVectors(e,s);let h=nc.dot(pA),u=ic.dot(pA);if(h>=0&&u<=h)return t.copy(s);let d=c*u-h*l;if(d<=0&&c>=0&&h<=0)return o=c/(c-h),t.copy(n).addScaledVector(nc,o);mA.subVectors(e,r);let f=nc.dot(mA),p=ic.dot(mA);if(p>=0&&f<=p)return t.copy(r);let g=f*l-c*p;if(g<=0&&l>=0&&p<=0)return a=l/(l-p),t.copy(n).addScaledVector(ic,a);let A=h*p-f*u;if(A<=0&&u-h>=0&&f-p>=0)return sv.subVectors(r,s),a=(u-h)/(u-h+(f-p)),t.copy(s).addScaledVector(sv,a);let m=1/(A+g+d);return o=g*m,a=d*m,t.copy(n).addScaledVector(nc,o).addScaledVector(ic,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},AE={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},Vr={h:0,s:0,l:0},vd={h:0,s:0,l:0};Ce=class{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){let s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=at){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,it.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=it.workingColorSpace){return this.r=e,this.g=t,this.b=n,it.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=it.workingColorSpace){if(e=ZA(e,1),t=Ze(t,0,1),n=Ze(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,o=2*n-r;this.r=bA(o,r,e+1/3),this.g=bA(o,r,e),this.b=bA(o,r,e-1/3)}return it.toWorkingColorSpace(this,s),this}setStyle(e,t=at){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,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=at){let n=AE[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=Zs(e.r),this.g=Zs(e.g),this.b=Zs(e.b),this}copyLinearToSRGB(e){return this.r=cc(e.r),this.g=cc(e.g),this.b=cc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=at){return it.fromWorkingColorSpace(Bn.copy(this),e),Math.round(Ze(Bn.r*255,0,255))*65536+Math.round(Ze(Bn.g*255,0,255))*256+Math.round(Ze(Bn.b*255,0,255))}getHexString(e=at){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=it.workingColorSpace){it.fromWorkingColorSpace(Bn.copy(this),t);let n=Bn.r,s=Bn.g,r=Bn.b,o=Math.max(n,s,r),a=Math.min(n,s,r),c,l,h=(a+o)/2;if(a===o)c=0,l=0;else{let u=o-a;switch(l=h<=.5?u/(o+a):u/(2-o-a),o){case n:c=(s-r)/u+(s<r?6:0);break;case s:c=(r-n)/u+2;break;case r:c=(n-s)/u+4;break}c/=6}return e.h=c,e.s=l,e.l=h,e}getRGB(e,t=it.workingColorSpace){return it.fromWorkingColorSpace(Bn.copy(this),t),e.r=Bn.r,e.g=Bn.g,e.b=Bn.b,e}getStyle(e=at){it.fromWorkingColorSpace(Bn.copy(this),e);let t=Bn.r,n=Bn.g,s=Bn.b;return e!==at?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(Vr),this.setHSL(Vr.h+e,Vr.s+t,Vr.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(Vr),e.getHSL(vd);let n=jl(Vr.h,vd.h,t),s=jl(Vr.s,vd.s,t),r=jl(Vr.l,vd.l,t);return this.setHSL(n,s,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,s=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*s,this.g=r[1]*t+r[4]*n+r[7]*s,this.b=r[2]*t+r[5]*n+r[8]*s,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}},Bn=new Ce;Ce.NAMES=AE;rL=0,Ln=class extends xn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rL++}),this.uuid=Zi(),this.name="",this.type="Material",this.blending=Po,this.side=qn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Gd,this.blendDst=Qd,this.blendEquation=qr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ce(0,0,0),this.blendAlpha=0,this.depthFunc=Fo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=IA,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ro,this.stencilZFail=Ro,this.stencilZPass=Ro,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}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Po&&(n.blending=this.blending),this.side!==qn&&(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!==Gd&&(n.blendSrc=this.blendSrc),this.blendDst!==Qd&&(n.blendDst=this.blendDst),this.blendEquation!==qr&&(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!==Fo&&(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!==IA&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ro&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ro&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ro&&(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 s(r){let o=[];for(let a in r){let c=r[a];delete c.metadata,o.push(c)}return o}if(t){let r=s(e.textures),o=s(e.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let s=t.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},Jt=class extends Ln{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Kn,this.combine=zA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},js=oL();Rc={toHalfFloat:aL,fromHalfFloat:cL},nn=new D,Ed=new Fe,yt=class{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=zd,this.updateRanges=[],this.gpuType=Ot,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[e+s]=t.array[n+s];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++)Ed.fromBufferAttribute(this,t),Ed.applyMatrix3(e),this.setXY(t,Ed.x,Ed.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)nn.fromBufferAttribute(this,t),nn.applyMatrix3(e),this.setXYZ(t,nn.x,nn.y,nn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)nn.fromBufferAttribute(this,t),nn.applyMatrix4(e),this.setXYZ(t,nn.x,nn.y,nn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)nn.fromBufferAttribute(this,t),nn.applyNormalMatrix(e),this.setXYZ(t,nn.x,nn.y,nn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)nn.fromBufferAttribute(this,t),nn.transformDirection(e),this.setXYZ(t,nn.x,nn.y,nn.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=Ji(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ji(t,this.array)),t}setX(e,t){return this.normalized&&(t=Tt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ji(t,this.array)),t}setY(e,t){return this.normalized&&(t=Tt(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=Ji(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Tt(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=Ji(t,this.array)),t}setW(e,t){return this.normalized&&(t=Tt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array),s=Tt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e*=this.itemSize,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array),s=Tt(s,this.array),r=Tt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==zd&&(e.usage=this.usage),e}},nh=class extends yt{constructor(e,t,n){super(new Uint16Array(e),t,n)}},ih=class extends yt{constructor(e,t,n){super(new Uint32Array(e),t,n)}},bn=class extends yt{constructor(e,t,n){super(new Float32Array(e),t,n)}},lL=0,Li=new Oe,xA=new Ct,sc=new D,Ai=new jt,Wl=new jt,yn=new D,Zt=class i extends xn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:lL++}),this.uuid=Zi(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(eg(e)?ih:nh)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}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){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let r=new Qe().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}let s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Li.makeRotationFromQuaternion(e),this.applyMatrix4(Li),this}rotateX(e){return Li.makeRotationX(e),this.applyMatrix4(Li),this}rotateY(e){return Li.makeRotationY(e),this.applyMatrix4(Li),this}rotateZ(e){return Li.makeRotationZ(e),this.applyMatrix4(Li),this}translate(e,t,n){return Li.makeTranslation(e,t,n),this.applyMatrix4(Li),this}scale(e,t,n){return Li.makeScale(e,t,n),this.applyMatrix4(Li),this}lookAt(e){return xA.lookAt(e),xA.updateMatrix(),this.applyMatrix4(xA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sc).negate(),this.translate(sc.x,sc.y,sc.z),this}setFromPoints(e){let t=this.getAttribute("position");if(t===void 0){let n=[];for(let s=0,r=e.length;s<r;s++){let o=e[s];n.push(o.x,o.y,o.z||0)}this.setAttribute("position",new bn(n,3))}else{let n=Math.min(e.length,t.count);for(let s=0;s<n;s++){let r=e[s];t.setXYZ(s,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new jt);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++){let r=t[n];Ai.setFromBufferAttribute(r),this.morphTargetsRelative?(yn.addVectors(this.boundingBox.min,Ai.min),this.boundingBox.expandByPoint(yn),yn.addVectors(this.boundingBox.max,Ai.max),this.boundingBox.expandByPoint(yn)):(this.boundingBox.expandByPoint(Ai.min),this.boundingBox.expandByPoint(Ai.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 vn);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new D,1/0);return}if(e){let n=this.boundingSphere.center;if(Ai.setFromBufferAttribute(e),t)for(let r=0,o=t.length;r<o;r++){let a=t[r];Wl.setFromBufferAttribute(a),this.morphTargetsRelative?(yn.addVectors(Ai.min,Wl.min),Ai.expandByPoint(yn),yn.addVectors(Ai.max,Wl.max),Ai.expandByPoint(yn)):(Ai.expandByPoint(Wl.min),Ai.expandByPoint(Wl.max))}Ai.getCenter(n);let s=0;for(let r=0,o=e.count;r<o;r++)yn.fromBufferAttribute(e,r),s=Math.max(s,n.distanceToSquared(yn));if(t)for(let r=0,o=t.length;r<o;r++){let a=t[r],c=this.morphTargetsRelative;for(let l=0,h=a.count;l<h;l++)yn.fromBufferAttribute(a,l),c&&(sc.fromBufferAttribute(e,l),yn.add(sc)),s=Math.max(s,n.distanceToSquared(yn))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let 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}let n=t.position,s=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new yt(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],c=[];for(let w=0;w<n.count;w++)a[w]=new D,c[w]=new D;let l=new D,h=new D,u=new D,d=new Fe,f=new Fe,p=new Fe,g=new D,A=new D;function m(w,v,E){l.fromBufferAttribute(n,w),h.fromBufferAttribute(n,v),u.fromBufferAttribute(n,E),d.fromBufferAttribute(r,w),f.fromBufferAttribute(r,v),p.fromBufferAttribute(r,E),h.sub(l),u.sub(l),f.sub(d),p.sub(d);let R=1/(f.x*p.y-p.x*f.y);isFinite(R)&&(g.copy(h).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(R),A.copy(u).multiplyScalar(f.x).addScaledVector(h,-p.x).multiplyScalar(R),a[w].add(g),a[v].add(g),a[E].add(g),c[w].add(A),c[v].add(A),c[E].add(A))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let w=0,v=b.length;w<v;++w){let E=b[w],R=E.start,F=E.count;for(let P=R,U=R+F;P<U;P+=3)m(e.getX(P+0),e.getX(P+1),e.getX(P+2))}let x=new D,y=new D,_=new D,S=new D;function C(w){_.fromBufferAttribute(s,w),S.copy(_);let v=a[w];x.copy(v),x.sub(_.multiplyScalar(_.dot(v))).normalize(),y.crossVectors(S,v);let R=y.dot(c[w])<0?-1:1;o.setXYZW(w,x.x,x.y,x.z,R)}for(let w=0,v=b.length;w<v;++w){let E=b[w],R=E.start,F=E.count;for(let P=R,U=R+F;P<U;P+=3)C(e.getX(P+0)),C(e.getX(P+1)),C(e.getX(P+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new yt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);let s=new D,r=new D,o=new D,a=new D,c=new D,l=new D,h=new D,u=new D;if(e)for(let d=0,f=e.count;d<f;d+=3){let p=e.getX(d+0),g=e.getX(d+1),A=e.getX(d+2);s.fromBufferAttribute(t,p),r.fromBufferAttribute(t,g),o.fromBufferAttribute(t,A),h.subVectors(o,r),u.subVectors(s,r),h.cross(u),a.fromBufferAttribute(n,p),c.fromBufferAttribute(n,g),l.fromBufferAttribute(n,A),a.add(h),c.add(h),l.add(h),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(g,c.x,c.y,c.z),n.setXYZ(A,l.x,l.y,l.z)}else for(let d=0,f=t.count;d<f;d+=3)s.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),o.fromBufferAttribute(t,d+2),h.subVectors(o,r),u.subVectors(s,r),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)yn.fromBufferAttribute(e,t),yn.normalize(),e.setXYZ(t,yn.x,yn.y,yn.z)}toNonIndexed(){function e(a,c){let l=a.array,h=a.itemSize,u=a.normalized,d=new l.constructor(c.length*h),f=0,p=0;for(let g=0,A=c.length;g<A;g++){a.isInterleavedBufferAttribute?f=c[g]*a.data.stride+a.offset:f=c[g]*h;for(let m=0;m<h;m++)d[p++]=l[f++]}return new yt(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new i,n=this.index.array,s=this.attributes;for(let a in s){let c=s[a],l=e(c,n);t.setAttribute(a,l)}let r=this.morphAttributes;for(let a in r){let c=[],l=r[a];for(let h=0,u=l.length;h<u;h++){let d=l[h],f=e(d,n);c.push(f)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,c=o.length;a<c;a++){let l=o[a];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){let 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){let c=this.parameters;for(let l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let c in n){let l=n[c];e.data.attributes[c]=l.toJSON(e.data)}let s={},r=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],h=[];for(let u=0,d=l.length;u<d;u++){let f=l[u];h.push(f.toJSON(e.data))}h.length>0&&(s[c]=h,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let s=e.attributes;for(let l in s){let h=s[l];this.setAttribute(l,h.clone(t))}let r=e.morphAttributes;for(let l in r){let h=[],u=r[l];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[l]=h}this.morphTargetsRelative=e.morphTargetsRelative;let o=e.groups;for(let l=0,h=o.length;l<h;l++){let u=o[l];this.addGroup(u.start,u.count,u.materialIndex)}let a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());let c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},rv=new Oe,To=new Kr,Sd=new vn,ov=new D,wd=new D,Cd=new D,Md=new D,_A=new D,Td=new D,av=new D,Id=new D,Ke=class extends Ct{constructor(e=new Zt,t=new Jt){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(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){let a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}getVertexPosition(e,t){let n=this.geometry,s=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(s,e);let a=this.morphTargetInfluences;if(r&&a){Td.set(0,0,0);for(let c=0,l=r.length;c<l;c++){let h=a[c],u=r[c];h!==0&&(_A.fromBufferAttribute(u,e),o?Td.addScaledVector(_A,h):Td.addScaledVector(_A.sub(t),h))}t.add(Td)}return t}raycast(e,t){let n=this.geometry,s=this.material,r=this.matrixWorld;s!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Sd.copy(n.boundingSphere),Sd.applyMatrix4(r),To.copy(e.ray).recast(e.near),!(Sd.containsPoint(To.origin)===!1&&(To.intersectSphere(Sd,ov)===null||To.origin.distanceToSquared(ov)>(e.far-e.near)**2))&&(rv.copy(r).invert(),To.copy(e.ray).applyMatrix4(rv),!(n.boundingBox!==null&&To.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,To)))}_computeIntersections(e,t,n){let s,r=this.geometry,o=this.material,a=r.index,c=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,d=r.groups,f=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,g=d.length;p<g;p++){let A=d[p],m=o[A.materialIndex],b=Math.max(A.start,f.start),x=Math.min(a.count,Math.min(A.start+A.count,f.start+f.count));for(let y=b,_=x;y<_;y+=3){let S=a.getX(y),C=a.getX(y+1),w=a.getX(y+2);s=Rd(this,m,e,n,l,h,u,S,C,w),s&&(s.faceIndex=Math.floor(y/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{let p=Math.max(0,f.start),g=Math.min(a.count,f.start+f.count);for(let A=p,m=g;A<m;A+=3){let b=a.getX(A),x=a.getX(A+1),y=a.getX(A+2);s=Rd(this,o,e,n,l,h,u,b,x,y),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}else if(c!==void 0)if(Array.isArray(o))for(let p=0,g=d.length;p<g;p++){let A=d[p],m=o[A.materialIndex],b=Math.max(A.start,f.start),x=Math.min(c.count,Math.min(A.start+A.count,f.start+f.count));for(let y=b,_=x;y<_;y+=3){let S=y,C=y+1,w=y+2;s=Rd(this,m,e,n,l,h,u,S,C,w),s&&(s.faceIndex=Math.floor(y/3),s.face.materialIndex=A.materialIndex,t.push(s))}}else{let p=Math.max(0,f.start),g=Math.min(c.count,f.start+f.count);for(let A=p,m=g;A<m;A+=3){let b=A,x=A+1,y=A+2;s=Rd(this,o,e,n,l,h,u,b,x,y),s&&(s.faceIndex=Math.floor(A/3),t.push(s))}}}};ii=class i extends Zt{constructor(e=1,t=1,n=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:r,depthSegments:o};let a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);let c=[],l=[],h=[],u=[],d=0,f=0;p("z","y","x",-1,-1,n,t,e,o,r,0),p("z","y","x",1,-1,n,t,-e,o,r,1),p("x","z","y",1,1,e,n,t,s,o,2),p("x","z","y",1,-1,e,n,-t,s,o,3),p("x","y","z",1,-1,e,t,n,s,r,4),p("x","y","z",-1,-1,e,t,-n,s,r,5),this.setIndex(c),this.setAttribute("position",new bn(l,3)),this.setAttribute("normal",new bn(h,3)),this.setAttribute("uv",new bn(u,2));function p(g,A,m,b,x,y,_,S,C,w,v){let E=y/C,R=_/w,F=y/2,P=_/2,U=S/2,V=C+1,O=w+1,K=0,z=0,ee=new D;for(let ae=0;ae<O;ae++){let he=ae*R-P;for(let ve=0;ve<V;ve++){let Le=ve*E-F;ee[g]=Le*b,ee[A]=he*x,ee[m]=U,l.push(ee.x,ee.y,ee.z),ee[g]=0,ee[A]=0,ee[m]=S>0?1:-1,h.push(ee.x,ee.y,ee.z),u.push(ve/C),u.push(1-ae/w),K+=1}}for(let ae=0;ae<w;ae++)for(let he=0;he<C;he++){let ve=d+he+V*ae,Le=d+he+V*(ae+1),X=d+(he+1)+V*(ae+1),se=d+(he+1)+V*ae;c.push(ve,Le,se),c.push(Le,X,se),z+=6}a.addGroup(f,z,v),f+=z,d+=K}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new i(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};gE={clone:na,merge:On},dL=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,fL=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`,sn=class extends Ln{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=dL,this.fragmentShader=fL,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=na(e.uniforms),this.uniformsGroups=uL(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){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let s in this.uniforms){let o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}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;let n={};for(let s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},sh=class extends Ct{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=ys}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)}},Wr=new D,cv=new Fe,lv=new Fe,Kt=class extends sh{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=No*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Yl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return No*2*Math.atan(Math.tan(Yl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Wr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Wr.x,Wr.y).multiplyScalar(-e/Wr.z),Wr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Wr.x,Wr.y).multiplyScalar(-e/Wr.z)}getViewSize(e,t){return this.getViewBounds(e,cv,lv),t.subVectors(lv,cv)}setViewOffset(e,t,n,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Yl*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,r=-.5*s,o=this.view;if(this.view!==null&&this.view.enabled){let c=o.fullWidth,l=o.fullHeight;r+=o.offsetX*s/c,t-=o.offsetY*n/l,s*=o.width/c,n*=o.height/l}let a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},rc=-90,oc=1,ko=class extends Ct{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new Kt(rc,oc,e,t);s.layers=this.layers,this.add(s);let r=new Kt(rc,oc,e,t);r.layers=this.layers,this.add(r);let o=new Kt(rc,oc,e,t);o.layers=this.layers,this.add(o);let a=new Kt(rc,oc,e,t);a.layers=this.layers,this.add(a);let c=new Kt(rc,oc,e,t);c.layers=this.layers,this.add(c);let l=new Kt(rc,oc,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,s,r,o,a,c]=t;for(let l of t)this.remove(l);if(e===ys)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===eh)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let l of t)this.add(l),l.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,o,a,c,l,h]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,r),e.setRenderTarget(n,1,s),e.render(t,o),e.setRenderTarget(n,2,s),e.render(t,a),e.setRenderTarget(n,3,s),e.render(t,c),e.setRenderTarget(n,4,s),e.render(t,l),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,s),e.render(t,h),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},rh=class extends bt{constructor(e,t,n,s,r,o,a,c,l,h){e=e!==void 0?e:[],t=t!==void 0?t:Yr,super(e,t,n,s,r,o,a,c,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},$r=class extends _n{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new rh(s,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:qe}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;let n={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},s=new ii(5,5,5),r=new sn({name:"CubemapFromEquirect",uniforms:na(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:en,blending:bi});r.uniforms.tEquirect.value=t;let o=new Ke(s,r),a=t.minFilter;return t.minFilter===rn&&(t.minFilter=qe),new ko(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,s){let r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,s);e.setRenderTarget(r)}},Pn=class extends Ct{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Kn,this.environmentIntensity=1,this.environmentRotation=new Kn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},dc=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=zd,this.updateRanges=[],this.version=0,this.uuid=Zi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,r=this.stride;s<r;s++)this.array[e+s]=t.array[n+s];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=Zi()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let 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=Zi()),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}}},Wn=new D,fc=class i{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}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++)Wn.fromBufferAttribute(this,t),Wn.applyMatrix4(e),this.setXYZ(t,Wn.x,Wn.y,Wn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Wn.fromBufferAttribute(this,t),Wn.applyNormalMatrix(e),this.setXYZ(t,Wn.x,Wn.y,Wn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Wn.fromBufferAttribute(this,t),Wn.transformDirection(e),this.setXYZ(t,Wn.x,Wn.y,Wn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ji(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Tt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Tt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Tt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Tt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Tt(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=Ji(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ji(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ji(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ji(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array),s=Tt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Tt(t,this.array),n=Tt(n,this.array),s=Tt(s,this.array),r=Tt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let n=0;n<this.count;n++){let s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return new yt(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 i(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.");let t=[];for(let n=0;n<this.count;n++){let s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}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}}},hv=new D,uv=new _t,dv=new _t,pL=new D,fv=new Oe,Bd=new D,vA=new vn,pv=new Oe,EA=new Kr,oh=class extends Ke{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=TA,this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new jt),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingBox.expandByPoint(Bd)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new vn),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Bd),this.boundingSphere.expandByPoint(Bd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,s=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),vA.copy(this.boundingSphere),vA.applyMatrix4(s),e.ray.intersectsSphere(vA)!==!1&&(pv.copy(s).invert(),EA.copy(e.ray).applyMatrix4(pv),!(this.boundingBox!==null&&EA.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,EA)))}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(){let e=new _t,t=this.geometry.attributes.skinWeight;for(let n=0,s=t.count;n<s;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===TA?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===eE?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,s=this.geometry;uv.fromBufferAttribute(s.attributes.skinIndex,e),dv.fromBufferAttribute(s.attributes.skinWeight,e),hv.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){let o=dv.getComponent(r);if(o!==0){let a=uv.getComponent(r);fv.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(pL.copy(hv).applyMatrix4(fv),o)}}return t.applyMatrix4(this.bindMatrixInverse)}},pc=class extends Ct{constructor(){super(),this.isBone=!0,this.type="Bone"}},bs=class extends bt{constructor(e=null,t=1,n=1,s,r,o,a,c,l=Ft,h=Ft,u,d){super(null,o,a,c,l,h,s,r,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},mv=new Oe,mL=new Oe,ah=class i{constructor(e=[],t=[]){this.uuid=Zi(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let 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,s=this.bones.length;n<s;n++)this.boneInverses.push(new Oe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let n=new Oe;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++){let n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let 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(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,s=this.boneTexture;for(let r=0,o=e.length;r<o;r++){let a=e[r]?e[r].matrixWorld:mL;mv.multiplyMatrices(a,t[r]),mv.toArray(n,r*16)}s!==null&&(s.needsUpdate=!0)}clone(){return new i(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new bs(t,e,e,vt,Ot);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let s=this.bones[t];if(s.name===e)return s}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,s=e.bones.length;n<s;n++){let r=e.bones[n],o=t[r];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),o=new pc),this.bones.push(o),this.boneInverses.push(new Oe().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let s=0,r=t.length;s<r;s++){let o=t[s];e.bones.push(o.uuid);let a=n[s];e.boneInverses.push(a.toArray())}return e}},Xr=class extends yt{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},ac=new Oe,Av=new Oe,Dd=[],gv=new jt,AL=new Oe,ql=new Ke,Kl=new vn,ch=class extends Ke{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Xr(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s<n;s++)this.setMatrixAt(s,AL)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new jt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ac),gv.copy(e.boundingBox).applyMatrix4(ac),this.boundingBox.union(gv)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new vn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,ac),Kl.copy(e.boundingSphere).applyMatrix4(ac),this.boundingSphere.union(Kl)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,s=this.morphTexture.source.data.data,r=n.length+1,o=e*r+1;for(let a=0;a<n.length;a++)n[a]=s[o+a]}raycast(e,t){let n=this.matrixWorld,s=this.count;if(ql.geometry=this.geometry,ql.material=this.material,ql.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Kl.copy(this.boundingSphere),Kl.applyMatrix4(n),e.ray.intersectsSphere(Kl)!==!1))for(let r=0;r<s;r++){this.getMatrixAt(r,ac),Av.multiplyMatrices(n,ac),ql.matrixWorld=Av,ql.raycast(e,Dd);for(let o=0,a=Dd.length;o<a;o++){let c=Dd[o];c.instanceId=r,c.object=this,t.push(c)}Dd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Xr(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let n=t.morphTargetInfluences,s=n.length+1;this.morphTexture===null&&(this.morphTexture=new bs(new Float32Array(s*this.count),s,this.count,Ms,Ot));let r=this.morphTexture.source.data.data,o=0;for(let l=0;l<n.length;l++)o+=n[l];let a=this.geometry.morphTargetsRelative?1:1-o,c=s*e;r[c]=a,r.set(n,c+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}},SA=new D,gL=new D,yL=new Qe,gs=class{constructor(e=new D(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,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let s=SA.subVectors(n,t).cross(gL.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(SA),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||yL.getNormalMatrix(e),s=this.coplanarPoint(SA).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},Io=new vn,Ld=new D,mc=class{constructor(e=new gs,t=new gs,n=new gs,s=new gs,r=new gs,o=new gs){this.planes=[e,t,n,s,r,o]}set(e,t,n,s,r,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=ys){let n=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],c=s[3],l=s[4],h=s[5],u=s[6],d=s[7],f=s[8],p=s[9],g=s[10],A=s[11],m=s[12],b=s[13],x=s[14],y=s[15];if(n[0].setComponents(c-r,d-l,A-f,y-m).normalize(),n[1].setComponents(c+r,d+l,A+f,y+m).normalize(),n[2].setComponents(c+o,d+h,A+p,y+b).normalize(),n[3].setComponents(c-o,d-h,A-p,y-b).normalize(),n[4].setComponents(c-a,d-u,A-g,y-x).normalize(),t===ys)n[5].setComponents(c+a,d+u,A+g,y+x).normalize();else if(t===eh)n[5].setComponents(a,u,g,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Io.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Io.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Io)}intersectsSprite(e){return Io.center.set(0,0,0),Io.radius=.7071067811865476,Io.applyMatrix4(e.matrixWorld),this.intersectsSphere(Io)}intersectsSphere(e){let t=this.planes,n=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let s=t[n];if(Ld.x=s.normal.x>0?e.max.x:e.min.x,Ld.y=s.normal.y>0?e.max.y:e.min.y,Ld.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Ld)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Ac=class extends Ln{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ce(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}},Wd=new D,qd=new D,yv=new Oe,$l=new Kr,Pd=new vn,wA=new D,bv=new D,xs=class extends Ct{constructor(e=new Zt,t=new Ac){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(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let s=1,r=t.count;s<r;s++)Wd.fromBufferAttribute(t,s-1),qd.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=Wd.distanceTo(qd);e.setAttribute("lineDistance",new bn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let n=this.geometry,s=this.matrixWorld,r=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Pd.copy(n.boundingSphere),Pd.applyMatrix4(s),Pd.radius+=r,e.ray.intersectsSphere(Pd)===!1)return;yv.copy(s).invert(),$l.copy(e.ray).applyMatrix4(yv);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,l=this.isLineSegments?2:1,h=n.index,d=n.attributes.position;if(h!==null){let f=Math.max(0,o.start),p=Math.min(h.count,o.start+o.count);for(let g=f,A=p-1;g<A;g+=l){let m=h.getX(g),b=h.getX(g+1),x=Fd(this,e,$l,c,m,b);x&&t.push(x)}if(this.isLineLoop){let g=h.getX(p-1),A=h.getX(f),m=Fd(this,e,$l,c,g,A);m&&t.push(m)}}else{let f=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=f,A=p-1;g<A;g+=l){let m=Fd(this,e,$l,c,g,g+1);m&&t.push(m)}if(this.isLineLoop){let g=Fd(this,e,$l,c,p-1,f);g&&t.push(g)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){let a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}};xv=new D,_v=new D,lh=class extends xs{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let s=0,r=t.count;s<r;s+=2)xv.fromBufferAttribute(t,s),_v.fromBufferAttribute(t,s+1),n[s]=s===0?0:n[s-1],n[s+1]=n[s]+xv.distanceTo(_v);e.setAttribute("lineDistance",new bn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},hh=class extends xs{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}},gc=class extends Ln{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ce(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}},vv=new Oe,RA=new Kr,Od=new vn,Nd=new D,uh=class extends Ct{constructor(e=new Zt,t=new gc){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){let n=this.geometry,s=this.matrixWorld,r=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Od.copy(n.boundingSphere),Od.applyMatrix4(s),Od.radius+=r,e.ray.intersectsSphere(Od)===!1)return;vv.copy(s).invert(),RA.copy(e.ray).applyMatrix4(vv);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,l=n.index,u=n.attributes.position;if(l!==null){let d=Math.max(0,o.start),f=Math.min(l.count,o.start+o.count);for(let p=d,g=f;p<g;p++){let A=l.getX(p);Nd.fromBufferAttribute(u,A),Ev(Nd,A,c,s,e,t,this)}}else{let d=Math.max(0,o.start),f=Math.min(u.count,o.start+o.count);for(let p=d,g=f;p<g;p++)Nd.fromBufferAttribute(u,p),Ev(Nd,p,c,s,e,t,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){let s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){let a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}};si=class extends Ct{constructor(){super(),this.isGroup=!0,this.type="Group"}},dh=class extends bt{constructor(e,t,n,s,r,o,a,c,l){super(e,t,n,s,r,o,a,c,l),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:qe,this.magFilter=r!==void 0?r:qe,this.generateMipmaps=!1;let h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},Fi=class extends bt{constructor(e,t,n,s,r,o,a,c,l,h,u,d){super(null,o,a,c,l,h,s,r,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},fh=class extends Fi{constructor(e,t,n,s,r,o){super(e,t,n,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Bt,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},ph=class extends Fi{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Yr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Go=class extends bt{constructor(e,t,n,s,r,o,a,c,l){super(e,t,n,s,r,o,a,c,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},mh=class extends bt{constructor(e,t,n,s,r,o,a,c,l,h=Lo){if(h!==Lo&&h!==Oo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Lo&&(n=Cs),n===void 0&&h===Oo&&(n=Ko),super(null,s,r,o,a,c,h,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:Ft,this.minFilter=c!==void 0?c:Ft,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},ri=class i extends Zt{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};let r=e/2,o=t/2,a=Math.floor(n),c=Math.floor(s),l=a+1,h=c+1,u=e/a,d=t/c,f=[],p=[],g=[],A=[];for(let m=0;m<h;m++){let b=m*d-o;for(let x=0;x<l;x++){let y=x*u-r;p.push(y,-b,0),g.push(0,0,1),A.push(x/a),A.push(1-m/c)}}for(let m=0;m<c;m++)for(let b=0;b<a;b++){let x=b+l*m,y=b+l*(m+1),_=b+1+l*(m+1),S=b+1+l*m;f.push(x,y,S),f.push(y,_,S)}this.setIndex(f),this.setAttribute("position",new bn(p,3)),this.setAttribute("normal",new bn(g,3)),this.setAttribute("uv",new bn(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new i(e.width,e.height,e.widthSegments,e.heightSegments)}},Ah=class i extends Zt{constructor(e=1,t=32,n=16,s=0,r=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:s,phiLength:r,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));let c=Math.min(o+a,Math.PI),l=0,h=[],u=new D,d=new D,f=[],p=[],g=[],A=[];for(let m=0;m<=n;m++){let b=[],x=m/n,y=0;m===0&&o===0?y=.5/t:m===n&&c===Math.PI&&(y=-.5/t);for(let _=0;_<=t;_++){let S=_/t;u.x=-e*Math.cos(s+S*r)*Math.sin(o+x*a),u.y=e*Math.cos(o+x*a),u.z=e*Math.sin(s+S*r)*Math.sin(o+x*a),p.push(u.x,u.y,u.z),d.copy(u).normalize(),g.push(d.x,d.y,d.z),A.push(S+y,1-x),b.push(l++)}h.push(b)}for(let m=0;m<n;m++)for(let b=0;b<t;b++){let x=h[m][b+1],y=h[m][b],_=h[m+1][b],S=h[m+1][b+1];(m!==0||o>0)&&f.push(x,y,S),(m!==n-1||c<Math.PI)&&f.push(y,_,S)}this.setIndex(f),this.setAttribute("position",new bn(p,3)),this.setAttribute("normal",new bn(g,3)),this.setAttribute("uv",new bn(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new i(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}},_s=class extends Ln{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ce(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 Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=YA,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Kn,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},oi=class extends _s{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 Fe(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ze(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 Ce(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 Ce(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ce(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=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 dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=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.dispersion=e.dispersion,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}},yc=class extends Ln{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nE,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}},Kd=class extends Ln{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}};nr=class{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,s=t[n],r=t[n-1];e:{t:{let o;n:{i:if(!(e<s)){for(let a=n+2;;){if(s===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=s,s=t[++n],e<s)break t}o=t.length;break n}if(!(e>=r)){let a=t[1];e<a&&(n=2,r=a);for(let c=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===c)break;if(s=r,r=t[--n-1],e>=r)break t}o=n,n=0;break n}break e}for(;n<o;){let a=n+o>>>1;e<t[a]?o=a:n=a+1}if(s=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,s)}return this.interpolate_(n,r,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s;for(let o=0;o!==s;++o)t[o]=n[r+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},$d=class extends nr{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Bo,endingEnd:Bo}}intervalChanged_(e,t,n){let s=this.parameterPositions,r=e-2,o=e+1,a=s[r],c=s[o];if(a===void 0)switch(this.getSettings_().endingStart){case Do:r=e,a=2*t-n;break;case Jl:r=s.length-2,a=t+s[r]-s[r+1];break;default:r=e,a=n}if(c===void 0)switch(this.getSettings_().endingEnd){case Do:o=e,c=2*n-t;break;case Jl:o=1,c=n+s[1]-s[0];break;default:o=e-1,c=t}let l=(n-t)*.5,h=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(c-n),this._offsetPrev=r*h,this._offsetNext=o*h}interpolate_(e,t,n,s){let r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(s-t),g=p*p,A=g*p,m=-d*A+2*d*g-d*p,b=(1+d)*A+(-1.5-2*d)*g+(-.5+d)*p+1,x=(-1-f)*A+(1.5+f)*g+.5*p,y=f*A-f*g;for(let _=0;_!==a;++_)r[_]=m*o[h+_]+b*o[l+_]+x*o[c+_]+y*o[u+_];return r}},gh=class extends nr{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){let r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,h=(n-t)/(s-t),u=1-h;for(let d=0;d!==a;++d)r[d]=o[l+d]*u+o[c+d]*h;return r}},Xd=class extends nr{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}},gi=class{constructor(e,t,n,s){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=Ud(t,this.TimeBufferType),this.values=Ud(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Ud(e.times,Array),values:Ud(e.values,Array)};let s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Xd(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new gh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new $d(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case er:t=this.InterpolantFactoryMethodDiscrete;break;case tr:t=this.InterpolantFactoryMethodLinear;break;case kd:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let 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 er;case this.InterpolantFactoryMethodLinear:return tr;case this.InterpolantFactoryMethodSmooth:return kd}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){let n=this.times,s=n.length,r=0,o=s-1;for(;r!==s&&n[r]<e;)++r;for(;o!==-1&&n[o]>t;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);let a=this.getValueSize();this.times=n.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,s=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){let c=n[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(s!==void 0&&bL(s))for(let a=0,c=s.length;a!==c;++a){let l=s[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===kd,r=e.length-1,o=1;for(let a=1;a<r;++a){let c=!1,l=e[a],h=e[a+1];if(l!==h&&(a!==1||l!==e[0]))if(s)c=!0;else{let u=a*n,d=u-n,f=u+n;for(let p=0;p!==n;++p){let g=t[u+p];if(g!==t[d+p]||g!==t[f+p]){c=!0;break}}}if(c){if(a!==o){e[o]=e[a];let u=a*n,d=o*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++o}}if(r>0){e[o]=e[r];for(let a=r*n,c=o*n,l=0;l!==n;++l)t[c+l]=t[a+l];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}};gi.prototype.TimeBufferType=Float32Array;gi.prototype.ValueBufferType=Float32Array;gi.prototype.DefaultInterpolation=tr;ir=class extends gi{constructor(e,t,n){super(e,t,n)}};ir.prototype.ValueTypeName="bool";ir.prototype.ValueBufferType=Array;ir.prototype.DefaultInterpolation=er;ir.prototype.InterpolantFactoryMethodLinear=void 0;ir.prototype.InterpolantFactoryMethodSmooth=void 0;yh=class extends gi{};yh.prototype.ValueTypeName="color";vs=class extends gi{};vs.prototype.ValueTypeName="number";Yd=class extends nr{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){let r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(n-t)/(s-t),l=e*a;for(let h=l+a;l!==h;l+=4)$t.slerpFlat(r,0,o,l-a,o,l,c);return r}},Es=class extends gi{InterpolantFactoryMethodLinear(e){return new Yd(this.times,this.values,this.getValueSize(),e)}};Es.prototype.ValueTypeName="quaternion";Es.prototype.InterpolantFactoryMethodSmooth=void 0;sr=class extends gi{constructor(e,t,n){super(e,t,n)}};sr.prototype.ValueTypeName="string";sr.prototype.ValueBufferType=Array;sr.prototype.DefaultInterpolation=er;sr.prototype.InterpolantFactoryMethodLinear=void 0;sr.prototype.InterpolantFactoryMethodSmooth=void 0;Ss=class extends gi{};Ss.prototype.ValueTypeName="vector";Qo=class{constructor(e="",t=-1,n=[],s=Gf){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=Zi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,s=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(vL(n[o]).scale(s));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){let t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=n.length;r!==o;++r)t.push(gi.toJSON(n[r]));return s}static CreateFromMorphTargetSequence(e,t,n,s){let r=t.length,o=[];for(let a=0;a<r;a++){let c=[],l=[];c.push((a+r-1)%r,a,(a+1)%r),l.push(0,1,0);let h=xL(c);c=Sv(c,1,h),l=Sv(l,1,h),!s&&c[0]===0&&(c.push(r),l.push(l[0])),o.push(new vs(".morphTargetInfluences["+t[a].name+"]",c,l).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let s=e;n=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<n.length;s++)if(n[s].name===t)return n[s];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let s={},r=/^([\w-]*?)([\d]+)$/;for(let a=0,c=e.length;a<c;a++){let l=e[a],h=l.name.match(r);if(h&&h.length>1){let u=h[1],d=s[u];d||(s[u]=d=[]),d.push(l)}}let o=[];for(let a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(u,d,f,p,g){if(f.length!==0){let A=[],m=[];yE(f,A,m,p),A.length!==0&&g.push(new u(d,A,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode,c=e.length||-1,l=e.hierarchy||[];for(let u=0;u<l.length;u++){let d=l[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){let f={},p;for(p=0;p<d.length;p++)if(d[p].morphTargets)for(let g=0;g<d[p].morphTargets.length;g++)f[d[p].morphTargets[g]]=-1;for(let g in f){let A=[],m=[];for(let b=0;b!==d[p].morphTargets.length;++b){let x=d[p];A.push(x.time),m.push(x.morphTarget===g?1:0)}s.push(new vs(".morphTargetInfluence["+g+"]",A,m))}c=f.length*o}else{let f=".bones["+t[u].name+"]";n(Ss,f+".position",d,"pos",s),n(Es,f+".quaternion",d,"rot",s),n(Ss,f+".scale",d,"scl",s)}}return s.length===0?null:new this(r,c,s,a)}resetDuration(){let e=this.tracks,t=0;for(let n=0,s=e.length;n!==s;++n){let r=this.tracks[n];t=Math.max(t,r.times[r.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(){let 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)}};Js={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={}}},bc=class{constructor(e,t,n){let s=this,r=!1,o=0,a=0,c,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){a++,r===!1&&s.onStart!==void 0&&s.onStart(h,o,a),r=!0},this.itemEnd=function(h){o++,s.onProgress!==void 0&&s.onProgress(h,o,a),o===a&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(h){s.onError!==void 0&&s.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,u){return l.push(h,u),this},this.removeHandler=function(h){let u=l.indexOf(h);return u!==-1&&l.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=l.length;u<d;u+=2){let f=l[u],p=l[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return p}return null}}},bE=new bc,ln=class{constructor(e){this.manager=e!==void 0?e:bE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(s,r){n.load(e,s,t,r)})}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}};ln.DEFAULT_MATERIAL_NAME="__DEFAULT";Ys={},BA=class extends Error{constructor(e,t){super(e),this.response=t}},En=class extends ln{constructor(e){super(e)}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let r=Js.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ys[e]!==void 0){Ys[e].push({onLoad:t,onProgress:n,onError:s});return}Ys[e]=[],Ys[e].push({onLoad:t,onProgress:n,onError:s});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;let h=Ys[e],u=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),f=d?parseInt(d):0,p=f!==0,g=0,A=new ReadableStream({start(m){b();function b(){u.read().then(({done:x,value:y})=>{if(x)m.close();else{g+=y.byteLength;let _=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:f});for(let S=0,C=h.length;S<C;S++){let w=h[S];w.onProgress&&w.onProgress(_)}m.enqueue(y),b()}},x=>{m.error(x)})}}});return new Response(A)}else throw new BA(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(c){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return l.json();default:if(a===void 0)return l.text();{let u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return l.arrayBuffer().then(p=>f.decode(p))}}}).then(l=>{Js.add(e,l);let h=Ys[e];delete Ys[e];for(let u=0,d=h.length;u<d;u++){let f=h[u];f.onLoad&&f.onLoad(l)}}).catch(l=>{let h=Ys[e];if(h===void 0)throw this.manager.itemError(e),l;delete Ys[e];for(let u=0,d=h.length;u<d;u++){let f=h[u];f.onError&&f.onError(l)}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}},jd=class extends ln{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,o=Js.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;let a=lc("img");function c(){h(),Js.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(u){h(),s&&s(u),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){a.removeEventListener("load",c,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",l,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}},bh=class extends ln{constructor(e){super(e)}load(e,t,n,s){let r=this,o=new bs,a=new En(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(r.withCredentials),a.load(e,function(c){let l;try{l=r.parse(c)}catch(h){if(s!==void 0)s(h);else{console.error(h);return}}l.image!==void 0?o.image=l.image:l.data!==void 0&&(o.image.width=l.width,o.image.height=l.height,o.image.data=l.data),o.wrapS=l.wrapS!==void 0?l.wrapS:Bt,o.wrapT=l.wrapT!==void 0?l.wrapT:Bt,o.magFilter=l.magFilter!==void 0?l.magFilter:qe,o.minFilter=l.minFilter!==void 0?l.minFilter:qe,o.anisotropy=l.anisotropy!==void 0?l.anisotropy:1,l.colorSpace!==void 0&&(o.colorSpace=l.colorSpace),l.flipY!==void 0&&(o.flipY=l.flipY),l.format!==void 0&&(o.format=l.format),l.type!==void 0&&(o.type=l.type),l.mipmaps!==void 0&&(o.mipmaps=l.mipmaps,o.minFilter=rn),l.mipmapCount===1&&(o.minFilter=qe),l.generateMipmaps!==void 0&&(o.generateMipmaps=l.generateMipmaps),o.needsUpdate=!0,t&&t(o,l)},n,s),o}},zo=class extends ln{constructor(e){super(e)}load(e,t,n,s){let r=new bt,o=new jd(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},n,s),r}},Ho=class extends Ct{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ce(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){let 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()),this.target!==void 0&&(t.object.target=this.target.uuid),t}},CA=new Oe,wv=new D,Cv=new D,xh=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Fe(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new mc,this._frameExtents=new Fe(1,1),this._viewportCount=1,this._viewports=[new _t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;wv.setFromMatrixPosition(e.matrixWorld),t.position.copy(wv),Cv.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Cv),t.updateMatrixWorld(),CA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(CA),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(CA)}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.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),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}},DA=class extends xh{constructor(){super(new Kt(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,n=No*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(n!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},_h=class extends Ho{constructor(e,t,n=0,s=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ct.DEFAULT_UP),this.updateMatrix(),this.target=new Ct,this.distance=n,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new DA}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}},Mv=new Oe,Xl=new D,MA=new D,LA=class extends xh{constructor(){super(new Kt(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Fe(4,2),this._viewportCount=6,this._viewports=[new _t(2,1,1,1),new _t(0,1,1,1),new _t(3,1,1,1),new _t(1,1,1,1),new _t(3,0,1,1),new _t(1,0,1,1)],this._cubeDirections=[new D(1,0,0),new D(-1,0,0),new D(0,0,1),new D(0,0,-1),new D(0,1,0),new D(0,-1,0)],this._cubeUps=[new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,1,0),new D(0,0,1),new D(0,0,-1)]}updateMatrices(e,t=0){let n=this.camera,s=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Xl.setFromMatrixPosition(e.matrixWorld),n.position.copy(Xl),MA.copy(n.position),MA.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(MA),n.updateMatrixWorld(),s.makeTranslation(-Xl.x,-Xl.y,-Xl.z),Mv.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mv)}},Vo=class extends Ho{constructor(e,t,n=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=s,this.shadow=new LA}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}},yi=class extends sh{constructor(e=-1,t=1,n=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,s,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2,r=n-e,o=n+e,a=s+t,c=s-t;if(this.view!==null&&this.view.enabled){let l=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,o=r+l*this.view.width,a-=h*this.view.offsetY,c=a-h*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},PA=class extends xh{constructor(){super(new yi(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Wo=class extends Ho{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ct.DEFAULT_UP),this.updateMatrix(),this.target=new Ct,this.shadow=new PA}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Jd=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new D)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let n=e.x,s=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*s),t.addScaledVector(o[2],.488603*r),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*s)),t.addScaledVector(o[5],1.092548*(s*r)),t.addScaledVector(o[6],.315392*(3*r*r-1)),t.addScaledVector(o[7],1.092548*(n*r)),t.addScaledVector(o[8],.546274*(n*n-s*s)),t}getIrradianceAt(e,t){let n=e.x,s=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*s),t.addScaledVector(o[2],2*.511664*r),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*s),t.addScaledVector(o[5],2*.429043*s*r),t.addScaledVector(o[6],.743125*r*r-.247708),t.addScaledVector(o[7],2*.429043*n*r),t.addScaledVector(o[8],.429043*(n*n-s*s)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){let n=this.coefficients;for(let s=0;s<9;s++)n[s].fromArray(e,t+s*3);return this}toArray(e=[],t=0){let n=this.coefficients;for(let s=0;s<9;s++)n[s].toArray(e,t+s*3);return e}static getBasisAt(e,t){let n=e.x,s=e.y,r=e.z;t[0]=.282095,t[1]=.488603*s,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*s,t[5]=1.092548*s*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-s*s)}},vh=class extends Ho{constructor(e=new Jd,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},rr=class{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,s=e.length;n<s;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let 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)}},Eh=class extends ln{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,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,o=Js.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(l=>{t&&t(l),r.manager.itemEnd(e)}).catch(l=>{s&&s(l)});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}let a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;let c=fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){return Js.add(e,l),t&&t(l),r.manager.itemEnd(e),l}).catch(function(l){s&&s(l),Js.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Js.add(e,c),r.manager.itemStart(e)}},Zd=class extends Kt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},ef=class{constructor(e,t,n){this.binding=e,this.valueSize=n;let s,r,o;switch(t){case"quaternion":s=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":s=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:s=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let n=this.buffer,s=this.valueSize,r=e*s+s,o=this.cumulativeWeight;if(o===0){for(let a=0;a!==s;++a)n[r+a]=n[a];o=t}else{o+=t;let a=t/o;this._mixBufferRegion(n,r,0,a,s)}this.cumulativeWeight=o}accumulateAdditive(e){let t=this.buffer,n=this.valueSize,s=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,n=this.buffer,s=e*t+t,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let c=t*this._origIndex;this._mixBufferRegion(n,s,c,1-r,t)}o>0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let c=t,l=t+t;c!==l;++c)if(n[c]!==n[c+t]){a.setValue(n,s);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let r=n,o=s;r!==o;++r)t[r]=t[s+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,s,r){if(s>=.5)for(let o=0;o!==r;++o)e[t+o]=e[n+o]}_slerp(e,t,n,s){$t.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,r){let o=this._workIndex*r;$t.multiplyQuaternionsFlat(e,o,e,t,e,n),$t.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,n,s,r){let o=1-s;for(let a=0;a!==r;++a){let c=t+a;e[c]=e[c]*o+e[n+a]*s}}_lerpAdditive(e,t,n,s,r){for(let o=0;o!==r;++o){let a=t+o;e[a]=e[a]+e[n+o]*s}}},ng="\\[\\]\\.:\\/",EL=new RegExp("["+ng+"]","g"),ig="[^"+ng+"]",SL="[^"+ng.replace("\\.","")+"]",wL=/((?:WC+[\/:])*)/.source.replace("WC",ig),CL=/(WCOD+)?/.source.replace("WCOD",SL),ML=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ig),TL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ig),IL=new RegExp("^"+wL+CL+ML+TL+"$"),RL=["material","materials","bones","map"],FA=class{constructor(e,t,n){let s=n||gt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=n.length;s!==r;++s)n[s].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},gt=class i{constructor(e,t,n){this.path=t,this.parsedPath=n||i.parseTrackName(t),this.node=i.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 i.Composite(e,t,n):new i(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(EL,"")}static parseTrackName(e){let t=IL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let r=n.nodeName.substring(s+1);RL.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(r){for(let o=0;o<r.length;o++){let a=r[o];if(a.name===t||a.uuid===t)return a;let c=n(a.children);if(c)return c}return null},s=n(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)e[t++]=n[s]}_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){let n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let s=0,r=n.length;s!==r;++s)n[s]=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,t=this.parsedPath,n=t.objectName,s=t.propertyName,r=t.propertyIndex;if(e||(e=i.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 l=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 h=0;h<e.length;h++)if(e[h].name===l){l=h;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(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}let o=e[s];if(o===void 0){let l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+s+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?a=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(r!==void 0){if(s==="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[r]!==void 0&&(r=e.morphTargetDictionary[r])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=s;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};gt.Composite=FA;gt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};gt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};gt.prototype.GetterByBindingType=[gt.prototype._getValue_direct,gt.prototype._getValue_array,gt.prototype._getValue_arrayElement,gt.prototype._getValue_toArray];gt.prototype.SetterByBindingTypeAndVersioning=[[gt.prototype._setValue_direct,gt.prototype._setValue_direct_setNeedsUpdate,gt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[gt.prototype._setValue_array,gt.prototype._setValue_array_setNeedsUpdate,gt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[gt.prototype._setValue_arrayElement,gt.prototype._setValue_arrayElement_setNeedsUpdate,gt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[gt.prototype._setValue_fromArray,gt.prototype._setValue_fromArray_setNeedsUpdate,gt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];tf=class{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;let r=t.tracks,o=r.length,a=new Array(o),c={endingStart:Bo,endingEnd:Bo};for(let l=0;l!==o;++l){let h=r[l].createInterpolant(null);a[l]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ur,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let s=this._mixer,r=s.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);let c=a.parameterPositions,l=a.sampleValues;return c[0]=r,c[1]=r+n,l[0]=e/o,l[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}let r=this._startTime;if(r!==null){let c=(e-r)*n;c<0||n===0?t=0:(this._startTime=null,t=n*c)}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case tE:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulateAdditive(a);break;case Gf:default:for(let h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,s=this.time+e,r=this._loopCount,o=n===Zo;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(n===jr){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){let a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);let c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){let l=e<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,n){let s=this._interpolantSettings;n?(s.endingStart=Do,s.endingEnd=Do):(e?s.endingStart=this.zeroSlopeAtStart?Do:Bo:s.endingStart=Jl,t?s.endingEnd=this.zeroSlopeAtEnd?Do:Bo:s.endingEnd=Jl)}_scheduleFading(e,t,n){let s=this._mixer,r=s.time,o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,c=o.sampleValues;return a[0]=r,c[0]=t,a[1]=r+e,c[1]=n,this}},BL=new Float32Array(1),Sh=class extends xn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,c=n.uuid,l=this._bindingsByRootAndName,h=l[c];h===void 0&&(h={},l[c]=h);for(let u=0;u!==r;++u){let d=s[u],f=d.name,p=h[f];if(p!==void 0)++p.referenceCount,o[u]=p;else{if(p=o[u],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,c,f));continue}let g=t&&t._propertyBindings[u].binding.parsedPath;p=new ef(gt.create(n,f,g),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,c,f),o[u]=p}a[u].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,n)}let t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){let r=t[n];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){let r=t[n];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){let s=this._actions,r=this._actionsByClip,o=r[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=o;else{let a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=s.length,s.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){let t=this._actions,n=t[t.length-1],s=e._cacheIndex;n._cacheIndex=s,t[s]=n,t.pop(),e._cacheIndex=null;let r=e._clip.uuid,o=this._actionsByClip,a=o[r],c=a.knownActions,l=c[c.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,c[h]=l,c.pop(),e._byClipCacheIndex=null;let u=a.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],c.length===0&&delete o[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){let r=t[n];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){let t=this._actions,n=e._cacheIndex,s=this._nActiveActions++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){let t=this._actions,n=e._cacheIndex,s=--this._nActiveActions,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){let s=this._bindingsByRootAndName,r=this._bindings,o=s[t];o===void 0&&(o={},s[t]=o),o[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){let t=this._bindings,n=e.binding,s=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[s],c=t[t.length-1],l=e._cacheIndex;c._cacheIndex=l,t[l]=c,t.pop(),delete a[r],Object.keys(a).length===0&&delete o[s]}_lendBinding(e){let t=this._bindings,n=e._cacheIndex,s=this._nActiveBindings++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){let t=this._bindings,n=e._cacheIndex,s=--this._nActiveBindings,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(n=new gh(new Float32Array(2),new Float32Array(2),1,BL),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){let t=this._controlInterpolants,n=e.__cacheIndex,s=--this._nActiveControlInterpolants,r=t[s];e.__cacheIndex=s,t[s]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){let s=t||this._root,r=s.uuid,o=typeof e=="string"?Qo.findByName(s,e):e,a=o!==null?o.uuid:e,c=this._actionsByClip[a],l=null;if(n===void 0&&(o!==null?n=o.blendMode:n=Gf),c!==void 0){let u=c.actionByRoot[r];if(u!==void 0&&u.blendMode===n)return u;l=c.knownActions[0],o===null&&(o=l._clip)}if(o===null)return null;let h=new tf(this,o,t,n);return this._bindAction(h,l),this._addInactiveAction(h,a,r),h}existingAction(e,t){let n=t||this._root,s=n.uuid,r=typeof e=="string"?Qo.findByName(n,e):e,o=r?r.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[s]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let l=0;l!==n;++l)t[l]._update(s,e,r,o);let a=this._bindings,c=this._nActiveBindings;for(let l=0;l!==c;++l)a[l].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,n=e.uuid,s=this._actionsByClip,r=s[n];if(r!==void 0){let o=r.knownActions;for(let a=0,c=o.length;a!==c;++a){let l=o[a];this._deactivateAction(l);let h=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete s[n]}}uncacheRoot(e){let t=e.uuid,n=this._actionsByClip;for(let o in n){let a=n[o].actionByRoot,c=a[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}let s=this._bindingsByRootAndName,r=s[t];if(r!==void 0)for(let o in r){let a=r[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){let n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}},Tv=new Oe,wh=class{constructor(e,t,n=0,s=1/0){this.ray=new Kr(e,t),this.near=n,this.far=s,this.camera=null,this.layers=new uc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Tv.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Tv),this}intersectObject(e,t=!0,n=[]){return OA(e,this,n,t),n.sort(Iv),n}intersectObjects(e,t=!0,n=[]){for(let s=0,r=e.length;s<r;s++)OA(e[s],this,n,t);return n.sort(Iv),n}};or=class{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=Ze(this.phi,1e-6,Math.PI-1e-6),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(Ze(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"172"}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="172")});function HE(){let i=null,e=!1,t=null,n=null;function s(r,o){t(r,o),n=i.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){i=r}}}function LL(i){let e=new WeakMap;function t(a,c){let l=a.array,h=a.usage,u=l.byteLength,d=i.createBuffer();i.bindBuffer(c,d),i.bufferData(c,l,h),a.onUploadCallback();let f;if(l instanceof Float32Array)f=i.FLOAT;else if(l instanceof Uint16Array)a.isFloat16BufferAttribute?f=i.HALF_FLOAT:f=i.UNSIGNED_SHORT;else if(l instanceof Int16Array)f=i.SHORT;else if(l instanceof Uint32Array)f=i.UNSIGNED_INT;else if(l instanceof Int32Array)f=i.INT;else if(l instanceof Int8Array)f=i.BYTE;else if(l instanceof Uint8Array)f=i.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)f=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:f,bytesPerElement:l.BYTES_PER_ELEMENT,version:a.version,size:u}}function n(a,c,l){let h=c.array,u=c.updateRanges;if(i.bindBuffer(l,a),u.length===0)i.bufferSubData(l,0,h);else{u.sort((f,p)=>f.start-p.start);let d=0;for(let f=1;f<u.length;f++){let p=u[d],g=u[f];g.start<=p.start+p.count+1?p.count=Math.max(p.count,g.start+g.count-p.start):(++d,u[d]=g)}u.length=d+1;for(let f=0,p=u.length;f<p;f++){let g=u[f];i.bufferSubData(l,g.start*h.BYTES_PER_ELEMENT,h,g.start,g.count)}c.clearUpdateRanges()}c.onUploadCallback()}function s(a){return a.isInterleavedBufferAttribute&&(a=a.data),e.get(a)}function r(a){a.isInterleavedBufferAttribute&&(a=a.data);let c=e.get(a);c&&(i.deleteBuffer(c.buffer),e.delete(a))}function o(a,c){if(a.isInterleavedBufferAttribute&&(a=a.data),a.isGLBufferAttribute){let h=e.get(a);(!h||h.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}let l=e.get(a);if(l===void 0)e.set(a,t(a,c));else if(l.version<a.version){if(l.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(l.buffer,a,c),l.version=a.version}}return{get:s,remove:r,update:o}}function pF(i,e,t,n,s,r,o){let a=new Ce(0),c=r===!0?0:1,l,h,u=null,d=0,f=null;function p(x){let y=x.isScene===!0?x.background:null;return y&&y.isTexture&&(y=(x.backgroundBlurriness>0?t:e).get(y)),y}function g(x){let y=!1,_=p(x);_===null?m(a,c):_&&_.isColor&&(m(_,1),y=!0);let S=i.xr.getEnvironmentBlendMode();S==="additive"?n.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(i.autoClear||y)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function A(x,y){let _=p(y);_&&(_.isCubeTexture||_.mapping===Ch)?(h===void 0&&(h=new Ke(new ii(1,1,1),new sn({name:"BackgroundCubeMaterial",uniforms:na(Ts.backgroundCube.uniforms),vertexShader:Ts.backgroundCube.vertexShader,fragmentShader:Ts.backgroundCube.fragmentShader,side:en,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(S,C,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(h)),ia.copy(y.backgroundRotation),ia.x*=-1,ia.y*=-1,ia.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(ia.y*=-1,ia.z*=-1),h.material.uniforms.envMap.value=_,h.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(fF.makeRotationFromEuler(ia)),h.material.toneMapped=it.getTransfer(_.colorSpace)!==It,(u!==_||d!==_.version||f!==i.toneMapping)&&(h.material.needsUpdate=!0,u=_,d=_.version,f=i.toneMapping),h.layers.enableAll(),x.unshift(h,h.geometry,h.material,0,0,null)):_&&_.isTexture&&(l===void 0&&(l=new Ke(new ri(2,2),new sn({name:"BackgroundMaterial",uniforms:na(Ts.background.uniforms),vertexShader:Ts.background.vertexShader,fragmentShader:Ts.background.fragmentShader,side:qn,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(l)),l.material.uniforms.t2D.value=_,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=it.getTransfer(_.colorSpace)!==It,_.matrixAutoUpdate===!0&&_.updateMatrix(),l.material.uniforms.uvTransform.value.copy(_.matrix),(u!==_||d!==_.version||f!==i.toneMapping)&&(l.material.needsUpdate=!0,u=_,d=_.version,f=i.toneMapping),l.layers.enableAll(),x.unshift(l,l.geometry,l.material,0,0,null))}function m(x,y){x.getRGB(Qf,tg(i)),n.buffers.color.setClear(Qf.r,Qf.g,Qf.b,y,o)}function b(){h!==void 0&&(h.geometry.dispose(),h.material.dispose()),l!==void 0&&(l.geometry.dispose(),l.material.dispose())}return{getClearColor:function(){return a},setClearColor:function(x,y=1){a.set(x),c=y,m(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(x){c=x,m(a,c)},render:g,addToRenderList:A,dispose:b}}function mF(i,e){let t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=d(null),r=s,o=!1;function a(E,R,F,P,U){let V=!1,O=u(P,F,R);r!==O&&(r=O,l(r.object)),V=f(E,P,F,U),V&&p(E,P,F,U),U!==null&&e.update(U,i.ELEMENT_ARRAY_BUFFER),(V||o)&&(o=!1,y(E,R,F,P),U!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(U).buffer))}function c(){return i.createVertexArray()}function l(E){return i.bindVertexArray(E)}function h(E){return i.deleteVertexArray(E)}function u(E,R,F){let P=F.wireframe===!0,U=n[E.id];U===void 0&&(U={},n[E.id]=U);let V=U[R.id];V===void 0&&(V={},U[R.id]=V);let O=V[P];return O===void 0&&(O=d(c()),V[P]=O),O}function d(E){let R=[],F=[],P=[];for(let U=0;U<t;U++)R[U]=0,F[U]=0,P[U]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:F,attributeDivisors:P,object:E,attributes:{},index:null}}function f(E,R,F,P){let U=r.attributes,V=R.attributes,O=0,K=F.getAttributes();for(let z in K)if(K[z].location>=0){let ae=U[z],he=V[z];if(he===void 0&&(z==="instanceMatrix"&&E.instanceMatrix&&(he=E.instanceMatrix),z==="instanceColor"&&E.instanceColor&&(he=E.instanceColor)),ae===void 0||ae.attribute!==he||he&&ae.data!==he.data)return!0;O++}return r.attributesNum!==O||r.index!==P}function p(E,R,F,P){let U={},V=R.attributes,O=0,K=F.getAttributes();for(let z in K)if(K[z].location>=0){let ae=V[z];ae===void 0&&(z==="instanceMatrix"&&E.instanceMatrix&&(ae=E.instanceMatrix),z==="instanceColor"&&E.instanceColor&&(ae=E.instanceColor));let he={};he.attribute=ae,ae&&ae.data&&(he.data=ae.data),U[z]=he,O++}r.attributes=U,r.attributesNum=O,r.index=P}function g(){let E=r.newAttributes;for(let R=0,F=E.length;R<F;R++)E[R]=0}function A(E){m(E,0)}function m(E,R){let F=r.newAttributes,P=r.enabledAttributes,U=r.attributeDivisors;F[E]=1,P[E]===0&&(i.enableVertexAttribArray(E),P[E]=1),U[E]!==R&&(i.vertexAttribDivisor(E,R),U[E]=R)}function b(){let E=r.newAttributes,R=r.enabledAttributes;for(let F=0,P=R.length;F<P;F++)R[F]!==E[F]&&(i.disableVertexAttribArray(F),R[F]=0)}function x(E,R,F,P,U,V,O){O===!0?i.vertexAttribIPointer(E,R,F,U,V):i.vertexAttribPointer(E,R,F,P,U,V)}function y(E,R,F,P){g();let U=P.attributes,V=F.getAttributes(),O=R.defaultAttributeValues;for(let K in V){let z=V[K];if(z.location>=0){let ee=U[K];if(ee===void 0&&(K==="instanceMatrix"&&E.instanceMatrix&&(ee=E.instanceMatrix),K==="instanceColor"&&E.instanceColor&&(ee=E.instanceColor)),ee!==void 0){let ae=ee.normalized,he=ee.itemSize,ve=e.get(ee);if(ve===void 0)continue;let Le=ve.buffer,X=ve.type,se=ve.bytesPerElement,le=X===i.INT||X===i.UNSIGNED_INT||ee.gpuType===vc;if(ee.isInterleavedBufferAttribute){let pe=ee.data,ye=pe.stride,Ue=ee.offset;if(pe.isInstancedInterleavedBuffer){for(let Me=0;Me<z.locationSize;Me++)m(z.location+Me,pe.meshPerAttribute);E.isInstancedMesh!==!0&&P._maxInstanceCount===void 0&&(P._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let Me=0;Me<z.locationSize;Me++)A(z.location+Me);i.bindBuffer(i.ARRAY_BUFFER,Le);for(let Me=0;Me<z.locationSize;Me++)x(z.location+Me,he/z.locationSize,X,ae,ye*se,(Ue+he/z.locationSize*Me)*se,le)}else{if(ee.isInstancedBufferAttribute){for(let pe=0;pe<z.locationSize;pe++)m(z.location+pe,ee.meshPerAttribute);E.isInstancedMesh!==!0&&P._maxInstanceCount===void 0&&(P._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let pe=0;pe<z.locationSize;pe++)A(z.location+pe);i.bindBuffer(i.ARRAY_BUFFER,Le);for(let pe=0;pe<z.locationSize;pe++)x(z.location+pe,he/z.locationSize,X,ae,he*se,he/z.locationSize*pe*se,le)}}else if(O!==void 0){let ae=O[K];if(ae!==void 0)switch(ae.length){case 2:i.vertexAttrib2fv(z.location,ae);break;case 3:i.vertexAttrib3fv(z.location,ae);break;case 4:i.vertexAttrib4fv(z.location,ae);break;default:i.vertexAttrib1fv(z.location,ae)}}}}b()}function _(){w();for(let E in n){let R=n[E];for(let F in R){let P=R[F];for(let U in P)h(P[U].object),delete P[U];delete R[F]}delete n[E]}}function S(E){if(n[E.id]===void 0)return;let R=n[E.id];for(let F in R){let P=R[F];for(let U in P)h(P[U].object),delete P[U];delete R[F]}delete n[E.id]}function C(E){for(let R in n){let F=n[R];if(F[E.id]===void 0)continue;let P=F[E.id];for(let U in P)h(P[U].object),delete P[U];delete F[E.id]}}function w(){v(),o=!0,r!==s&&(r=s,l(r.object))}function v(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:a,reset:w,resetDefaultState:v,dispose:_,releaseStatesOfGeometry:S,releaseStatesOfProgram:C,initAttributes:g,enableAttribute:A,disableUnusedAttributes:b}}function AF(i,e,t){let n;function s(l){n=l}function r(l,h){i.drawArrays(n,l,h),t.update(h,n,1)}function o(l,h,u){u!==0&&(i.drawArraysInstanced(n,l,h,u),t.update(h,n,u))}function a(l,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,h,0,u);let f=0;for(let p=0;p<u;p++)f+=h[p];t.update(f,n,1)}function c(l,h,u,d){if(u===0)return;let f=e.get("WEBGL_multi_draw");if(f===null)for(let p=0;p<l.length;p++)o(l[p],h[p],d[p]);else{f.multiDrawArraysInstancedWEBGL(n,l,0,h,0,d,0,u);let p=0;for(let g=0;g<u;g++)p+=h[g]*d[g];t.update(p,n,1)}}this.setMode=s,this.render=r,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=c}function gF(i,e,t,n){let s;function r(){if(s!==void 0)return s;if(e.has("EXT_texture_filter_anisotropic")===!0){let C=e.get("EXT_texture_filter_anisotropic");s=i.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s}function o(C){return!(C!==vt&&n.convert(C)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(C){let w=C===Lt&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(C!==kt&&n.convert(C)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&C!==Ot&&!w)}function c(C){if(C==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let l=t.precision!==void 0?t.precision:"highp",h=c(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);let u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),p=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),A=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),m=i.getParameter(i.MAX_VERTEX_ATTRIBS),b=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),x=i.getParameter(i.MAX_VARYING_VECTORS),y=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),_=p>0,S=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:a,precision:l,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:p,maxTextureSize:g,maxCubemapSize:A,maxAttributes:m,maxVertexUniforms:b,maxVaryings:x,maxFragmentUniforms:y,vertexTextures:_,maxSamples:S}}function yF(i){let e=this,t=null,n=0,s=!1,r=!1,o=new gs,a=new Qe,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){let f=u.length!==0||d||n!==0||s;return s=d,n=u.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){let p=u.clippingPlanes,g=u.clipIntersection,A=u.clipShadows,m=i.get(u);if(!s||p===null||p.length===0||r&&!A)r?h(null):l();else{let b=r?0:n,x=b*4,y=m.clippingState||null;c.value=y,y=h(p,d,x,f);for(let _=0;_!==x;++_)y[_]=t[_];m.clippingState=y,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=b}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,p){let g=u!==null?u.length:0,A=null;if(g!==0){if(A=c.value,p!==!0||A===null){let m=f+g*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(A===null||A.length<m)&&(A=new Float32Array(m));for(let x=0,y=f;x!==g;++x,y+=4)o.copy(u[x]).applyMatrix4(b,a),o.normal.toArray(A,y),A[y+3]=o.constant}c.value=A,c.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,A}}function bF(i){let e=new WeakMap;function t(o,a){return a===xc?o.mapping=Yr:a===mf&&(o.mapping=qo),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===xc||a===mf)if(e.has(o)){let c=e.get(o).texture;return t(c,o.mapping)}else{let c=o.image;if(c&&c.height>0){let l=new $r(c.height);return l.fromEquirectangularTexture(i,o),e.set(o,l),o.addEventListener("dispose",s),t(l.texture,o.mapping)}else return null}}return o}function s(o){let a=o.target;a.removeEventListener("dispose",s);let c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}function xF(i){let e=[],t=[],n=[],s=i,r=i-Dc+1+xE.length;for(let o=0;o<r;o++){let a=Math.pow(2,s);t.push(a);let c=1/a;o>i-Dc?c=xE[o-i+Dc-1]:o===0&&(c=0),n.push(c);let l=1/(a-2),h=-l,u=1+l,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,p=6,g=3,A=2,m=1,b=new Float32Array(g*p*f),x=new Float32Array(A*p*f),y=new Float32Array(m*p*f);for(let S=0;S<f;S++){let C=S%3*2/3-1,w=S>2?0:-1,v=[C,w,0,C+2/3,w,0,C+2/3,w+1,0,C,w,0,C+2/3,w+1,0,C,w+1,0];b.set(v,g*p*S),x.set(d,A*p*S);let E=[S,S,S,S,S,S];y.set(E,m*p*S)}let _=new Zt;_.setAttribute("position",new yt(b,g)),_.setAttribute("uv",new yt(x,A)),_.setAttribute("faceIndex",new yt(y,m)),e.push(_),s>Dc&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function EE(i,e,t){let n=new _n(i,e,t);return n.texture.mapping=Ch,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function zf(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function _F(i,e,t){let n=new Float32Array(oa),s=new D(0,1,0);return new sn({name:"SphericalGaussianBlur",defines:{n:oa,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:s}},vertexShader:_g(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:bi,depthTest:!1,depthWrite:!1})}function SE(){return new sn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_g(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:bi,depthTest:!1,depthWrite:!1})}function wE(){return new sn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_g(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:bi,depthTest:!1,depthWrite:!1})}function _g(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function vF(i){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){let c=a.mapping,l=c===xc||c===mf,h=c===Yr||c===qo;if(l||h){let u=e.get(a),d=u!==void 0?u.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new Vf(i)),u=l?t.fromEquirectangular(a,u):t.fromCubemap(a,u),u.texture.pmremVersion=a.pmremVersion,e.set(a,u),u.texture;if(u!==void 0)return u.texture;{let f=a.image;return l&&f&&f.height>0||h&&f&&s(f)?(t===null&&(t=new Vf(i)),u=l?t.fromEquirectangular(a):t.fromCubemap(a),u.texture.pmremVersion=a.pmremVersion,e.set(a,u),a.addEventListener("dispose",r),u.texture):null}}}return a}function s(a){let c=0,l=6;for(let h=0;h<l;h++)a[h]!==void 0&&c++;return c===l}function r(a){let c=a.target;c.removeEventListener("dispose",r);let l=e.get(c);l!==void 0&&(e.delete(c),l.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function EF(i){let e={};function t(n){if(e[n]!==void 0)return e[n];let s;switch(n){case"WEBGL_depth_texture":s=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=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":s=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":s=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=i.getExtension(n)}return e[n]=s,s}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){let s=t(n);return s===null&&ta("THREE.WebGLRenderer: "+n+" extension not supported."),s}}}function SF(i,e,t,n){let s={},r=new WeakMap;function o(u){let d=u.target;d.index!==null&&e.remove(d.index);for(let p in d.attributes)e.remove(d.attributes[p]);d.removeEventListener("dispose",o),delete s[d.id];let f=r.get(d);f&&(e.remove(f),r.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function a(u,d){return s[d.id]===!0||(d.addEventListener("dispose",o),s[d.id]=!0,t.memory.geometries++),d}function c(u){let d=u.attributes;for(let f in d)e.update(d[f],i.ARRAY_BUFFER)}function l(u){let d=[],f=u.index,p=u.attributes.position,g=0;if(f!==null){let b=f.array;g=f.version;for(let x=0,y=b.length;x<y;x+=3){let _=b[x+0],S=b[x+1],C=b[x+2];d.push(_,S,S,C,C,_)}}else if(p!==void 0){let b=p.array;g=p.version;for(let x=0,y=b.length/3-1;x<y;x+=3){let _=x+0,S=x+1,C=x+2;d.push(_,S,S,C,C,_)}}else return;let A=new(eg(d)?ih:nh)(d,1);A.version=g;let m=r.get(u);m&&e.remove(m),r.set(u,A)}function h(u){let d=r.get(u);if(d){let f=u.index;f!==null&&d.version<f.version&&l(u)}else l(u);return r.get(u)}return{get:a,update:c,getWireframeAttribute:h}}function wF(i,e,t){let n;function s(d){n=d}let r,o;function a(d){r=d.type,o=d.bytesPerElement}function c(d,f){i.drawElements(n,f,r,d*o),t.update(f,n,1)}function l(d,f,p){p!==0&&(i.drawElementsInstanced(n,f,r,d*o,p),t.update(f,n,p))}function h(d,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,d,0,p);let A=0;for(let m=0;m<p;m++)A+=f[m];t.update(A,n,1)}function u(d,f,p,g){if(p===0)return;let A=e.get("WEBGL_multi_draw");if(A===null)for(let m=0;m<d.length;m++)l(d[m]/o,f[m],g[m]);else{A.multiDrawElementsInstancedWEBGL(n,f,0,r,d,0,g,0,p);let m=0;for(let b=0;b<p;b++)m+=f[b]*g[b];t.update(m,n,1)}}this.setMode=s,this.setIndex=a,this.render=c,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function CF(i){let e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,o,a){switch(t.calls++,o){case i.TRIANGLES:t.triangles+=a*(r/3);break;case i.LINES:t.lines+=a*(r/2);break;case i.LINE_STRIP:t.lines+=a*(r-1);break;case i.LINE_LOOP:t.lines+=a*r;break;case i.POINTS:t.points+=a*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:n}}function MF(i,e,t){let n=new WeakMap,s=new _t;function r(o,a,c){let l=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,u=h!==void 0?h.length:0,d=n.get(a);if(d===void 0||d.count!==u){let v=function(){C.dispose(),n.delete(a),a.removeEventListener("dispose",v)};d!==void 0&&d.texture.dispose();let f=a.morphAttributes.position!==void 0,p=a.morphAttributes.normal!==void 0,g=a.morphAttributes.color!==void 0,A=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],x=0;f===!0&&(x=1),p===!0&&(x=2),g===!0&&(x=3);let y=a.attributes.position.count*x,_=1;y>e.maxTextureSize&&(_=Math.ceil(y/e.maxTextureSize),y=e.maxTextureSize);let S=new Float32Array(y*_*4*u),C=new th(S,y,_,u);C.type=Ot,C.needsUpdate=!0;let w=x*4;for(let E=0;E<u;E++){let R=A[E],F=m[E],P=b[E],U=y*_*4*E;for(let V=0;V<R.count;V++){let O=V*w;f===!0&&(s.fromBufferAttribute(R,V),S[U+O+0]=s.x,S[U+O+1]=s.y,S[U+O+2]=s.z,S[U+O+3]=0),p===!0&&(s.fromBufferAttribute(F,V),S[U+O+4]=s.x,S[U+O+5]=s.y,S[U+O+6]=s.z,S[U+O+7]=0),g===!0&&(s.fromBufferAttribute(P,V),S[U+O+8]=s.x,S[U+O+9]=s.y,S[U+O+10]=s.z,S[U+O+11]=P.itemSize===4?s.w:1)}}d={count:u,texture:C,size:new Fe(y,_)},n.set(a,d),a.addEventListener("dispose",v)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)c.getUniforms().setValue(i,"morphTexture",o.morphTexture,t);else{let f=0;for(let g=0;g<l.length;g++)f+=l[g];let p=a.morphTargetsRelative?1:1-f;c.getUniforms().setValue(i,"morphTargetBaseInfluence",p),c.getUniforms().setValue(i,"morphTargetInfluences",l)}c.getUniforms().setValue(i,"morphTargetsTexture",d.texture,t),c.getUniforms().setValue(i,"morphTargetsTextureSize",d.size)}return{update:r}}function TF(i,e,t,n){let s=new WeakMap;function r(c){let l=n.render.frame,h=c.geometry,u=e.get(c,h);if(s.get(u)!==l&&(e.update(u),s.set(u,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",a)===!1&&c.addEventListener("dispose",a),s.get(c)!==l&&(t.update(c.instanceMatrix,i.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,i.ARRAY_BUFFER),s.set(c,l))),c.isSkinnedMesh){let d=c.skeleton;s.get(d)!==l&&(d.update(),s.set(d,l))}return u}function o(){s=new WeakMap}function a(c){let l=c.target;l.removeEventListener("dispose",a),t.remove(l.instanceMatrix),l.instanceColor!==null&&t.remove(l.instanceColor)}return{update:r,dispose:o}}function Pc(i,e,t){let n=i[0];if(n<=0||n>0)return i;let s=e*t,r=ME[s];if(r===void 0&&(r=new Float32Array(s),ME[s]=r),e!==0){n.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,i[o].toArray(r,a)}return r}function hn(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 un(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function Wf(i,e){let t=TE[e];t===void 0&&(t=new Int32Array(e),TE[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function IF(i,e){let t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function RF(i,e){let 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(hn(t,e))return;i.uniform2fv(this.addr,e),un(t,e)}}function BF(i,e){let 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(hn(t,e))return;i.uniform3fv(this.addr,e),un(t,e)}}function DF(i,e){let 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(hn(t,e))return;i.uniform4fv(this.addr,e),un(t,e)}}function LF(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(hn(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),un(t,e)}else{if(hn(t,n))return;BE.set(n),i.uniformMatrix2fv(this.addr,!1,BE),un(t,n)}}function PF(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(hn(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),un(t,e)}else{if(hn(t,n))return;RE.set(n),i.uniformMatrix3fv(this.addr,!1,RE),un(t,n)}}function FF(i,e){let t=this.cache,n=e.elements;if(n===void 0){if(hn(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),un(t,e)}else{if(hn(t,n))return;IE.set(n),i.uniformMatrix4fv(this.addr,!1,IE),un(t,n)}}function OF(i,e){let t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function NF(i,e){let 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(hn(t,e))return;i.uniform2iv(this.addr,e),un(t,e)}}function UF(i,e){let 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(hn(t,e))return;i.uniform3iv(this.addr,e),un(t,e)}}function kF(i,e){let 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(hn(t,e))return;i.uniform4iv(this.addr,e),un(t,e)}}function GF(i,e){let t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function QF(i,e){let 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(hn(t,e))return;i.uniform2uiv(this.addr,e),un(t,e)}}function zF(i,e){let 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(hn(t,e))return;i.uniform3uiv(this.addr,e),un(t,e)}}function HF(i,e){let 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(hn(t,e))return;i.uniform4uiv(this.addr,e),un(t,e)}}function VF(i,e,t){let n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s);let r;this.type===i.SAMPLER_2D_SHADOW?(CE.compareFunction=jA,r=CE):r=VE,t.setTexture2D(e||r,s)}function WF(i,e,t){let n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||qE,s)}function qF(i,e,t){let n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||KE,s)}function KF(i,e,t){let n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||WE,s)}function $F(i){switch(i){case 5126:return IF;case 35664:return RF;case 35665:return BF;case 35666:return DF;case 35674:return LF;case 35675:return PF;case 35676:return FF;case 5124:case 35670:return OF;case 35667:case 35671:return NF;case 35668:case 35672:return UF;case 35669:case 35673:return kF;case 5125:return GF;case 36294:return QF;case 36295:return zF;case 36296:return HF;case 35678:case 36198:case 36298:case 36306:case 35682:return VF;case 35679:case 36299:case 36307:return WF;case 35680:case 36300:case 36308:case 36293:return qF;case 36289:case 36303:case 36311:case 36292:return KF}}function XF(i,e){i.uniform1fv(this.addr,e)}function YF(i,e){let t=Pc(e,this.size,2);i.uniform2fv(this.addr,t)}function jF(i,e){let t=Pc(e,this.size,3);i.uniform3fv(this.addr,t)}function JF(i,e){let t=Pc(e,this.size,4);i.uniform4fv(this.addr,t)}function ZF(i,e){let t=Pc(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function eO(i,e){let t=Pc(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function tO(i,e){let t=Pc(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function nO(i,e){i.uniform1iv(this.addr,e)}function iO(i,e){i.uniform2iv(this.addr,e)}function sO(i,e){i.uniform3iv(this.addr,e)}function rO(i,e){i.uniform4iv(this.addr,e)}function oO(i,e){i.uniform1uiv(this.addr,e)}function aO(i,e){i.uniform2uiv(this.addr,e)}function cO(i,e){i.uniform3uiv(this.addr,e)}function lO(i,e){i.uniform4uiv(this.addr,e)}function hO(i,e,t){let n=this.cache,s=e.length,r=Wf(t,s);hn(n,r)||(i.uniform1iv(this.addr,r),un(n,r));for(let o=0;o!==s;++o)t.setTexture2D(e[o]||VE,r[o])}function uO(i,e,t){let n=this.cache,s=e.length,r=Wf(t,s);hn(n,r)||(i.uniform1iv(this.addr,r),un(n,r));for(let o=0;o!==s;++o)t.setTexture3D(e[o]||qE,r[o])}function dO(i,e,t){let n=this.cache,s=e.length,r=Wf(t,s);hn(n,r)||(i.uniform1iv(this.addr,r),un(n,r));for(let o=0;o!==s;++o)t.setTextureCube(e[o]||KE,r[o])}function fO(i,e,t){let n=this.cache,s=e.length,r=Wf(t,s);hn(n,r)||(i.uniform1iv(this.addr,r),un(n,r));for(let o=0;o!==s;++o)t.setTexture2DArray(e[o]||WE,r[o])}function pO(i){switch(i){case 5126:return XF;case 35664:return YF;case 35665:return jF;case 35666:return JF;case 35674:return ZF;case 35675:return eO;case 35676:return tO;case 5124:case 35670:return nO;case 35667:case 35671:return iO;case 35668:case 35672:return sO;case 35669:case 35673:return rO;case 5125:return oO;case 36294:return aO;case 36295:return cO;case 36296:return lO;case 35678:case 36198:case 36298:case 36306:case 35682:return hO;case 35679:case 36299:case 36307:return uO;case 35680:case 36300:case 36308:case 36293:return dO;case 36289:case 36303:case 36311:case 36292:return fO}}function DE(i,e){i.seq.push(e),i.map[e.id]=e}function mO(i,e,t){let n=i.name,s=n.length;for(ug.lastIndex=0;;){let r=ug.exec(n),o=ug.lastIndex,a=r[1],c=r[2]==="]",l=r[3];if(c&&(a=a|0),l===void 0||l==="["&&o+2===s){DE(t,l===void 0?new dg(a,i,e):new fg(a,i,e));break}else{let u=t.map[a];u===void 0&&(u=new pg(a),DE(t,u)),t=u}}}function LE(i,e,t){let n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}function yO(i,e){let t=i.split(`
`),n=[],s=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let o=s;o<r;o++){let a=o+1;n.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return n.join(`
`)}function bO(i){it._getMatrix(PE,it.workingColorSpace,i);let e=`mat3( ${PE.elements.map(t=>t.toFixed(4))} )`;switch(it.getTransfer(i)){case Zl:return[e,"LinearTransferOETF"];case It:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function FE(i,e,t){let n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&s==="")return"";let r=/ERROR: 0:(\d+)/.exec(s);if(r){let o=parseInt(r[1]);return t.toUpperCase()+`

`+s+`

`+yO(i.getShaderSource(e),o)}else return s}function xO(i,e){let t=bO(e);return[`vec4 ${i}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
`)}function _O(i,e){let t;switch(e){case hf:t="Linear";break;case uf:t="Reinhard";break;case df:t="Cineon";break;case ff:t="ACESFilmic";break;case pf:t="AgX";break;case ar:t="Neutral";break;case Zv:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function vO(){it.getLuminanceCoefficients(Hf);let i=Hf.x.toFixed(4),e=Hf.y.toFixed(4),t=Hf.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${i}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
`)}function EO(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Dh).join(`
`)}function SO(i){let e=[];for(let t in i){let n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
`)}function wO(i,e){let t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){let r=i.getActiveAttrib(e,s),o=r.name,a=1;r.type===i.FLOAT_MAT2&&(a=2),r.type===i.FLOAT_MAT3&&(a=3),r.type===i.FLOAT_MAT4&&(a=4),t[o]={type:r.type,location:i.getAttribLocation(e,o),locationSize:a}}return t}function Dh(i){return i!==""}function OE(i,e){let 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 NE(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function mg(i){return i.replace(CO,TO)}function TO(i,e){let t=et[e];if(t===void 0){let n=MO.get(e);if(n!==void 0)t=et[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 mg(t)}function UE(i){return i.replace(IO,RO)}function RO(i,e,t,n){let s="";for(let r=parseInt(e);r<parseInt(t);r++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return s}function kE(i){let e=`precision ${i.precision} float;
	precision ${i.precision} int;
	precision ${i.precision} sampler2D;
	precision ${i.precision} samplerCube;
	precision ${i.precision} sampler3D;
	precision ${i.precision} sampler2DArray;
	precision ${i.precision} sampler2DShadow;
	precision ${i.precision} samplerCubeShadow;
	precision ${i.precision} sampler2DArrayShadow;
	precision ${i.precision} isampler2D;
	precision ${i.precision} isampler3D;
	precision ${i.precision} isamplerCube;
	precision ${i.precision} isampler2DArray;
	precision ${i.precision} usampler2D;
	precision ${i.precision} usampler3D;
	precision ${i.precision} usamplerCube;
	precision ${i.precision} usampler2DArray;
	`;return i.precision==="highp"?e+=`
#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function BO(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===UA?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===Dv?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===ws&&(e="SHADOWMAP_TYPE_VSM"),e}function DO(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Yr:case qo:e="ENVMAP_TYPE_CUBE";break;case Ch:e="ENVMAP_TYPE_CUBE_UV";break}return e}function LO(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case qo:e="ENVMAP_MODE_REFRACTION";break}return e}function PO(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case zA:e="ENVMAP_BLENDING_MULTIPLY";break;case jv:e="ENVMAP_BLENDING_MIX";break;case Jv:e="ENVMAP_BLENDING_ADD";break}return e}function FO(i){let e=i.envMapCubeUVHeight;if(e===null)return null;let t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function OO(i,e,t,n){let s=i.getContext(),r=t.defines,o=t.vertexShader,a=t.fragmentShader,c=BO(t),l=DO(t),h=LO(t),u=PO(t),d=FO(t),f=EO(t),p=SO(r),g=s.createProgram(),A,m,b=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(A=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Dh).join(`
`),A.length>0&&(A+=`
`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(Dh).join(`
`),m.length>0&&(m+=`
`)):(A=[kE(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.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?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#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","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(Dh).join(`
`),m=[kE(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.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.dispersion?"#define USE_DISPERSION":"",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||t.batchingColor?"#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 "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==xi?"#define TONE_MAPPING":"",t.toneMapping!==xi?et.tonemapping_pars_fragment:"",t.toneMapping!==xi?_O("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,xO("linearToOutputTexel",t.outputColorSpace),vO(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(Dh).join(`
`)),o=mg(o),o=OE(o,t),o=NE(o,t),a=mg(a),a=OE(a,t),a=NE(a,t),o=UE(o),a=UE(a),t.isRawShaderMaterial!==!0&&(b=`#version 300 es
`,A=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+A,m=["#define varying in",t.glslVersion===JA?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===JA?"":"#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(`
`)+`
`+m);let x=b+A+o,y=b+m+a,_=LE(s,s.VERTEX_SHADER,x),S=LE(s,s.FRAGMENT_SHADER,y);s.attachShader(g,_),s.attachShader(g,S),t.index0AttributeName!==void 0?s.bindAttribLocation(g,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(g,0,"position"),s.linkProgram(g);function C(R){if(i.debug.checkShaderErrors){let F=s.getProgramInfoLog(g).trim(),P=s.getShaderInfoLog(_).trim(),U=s.getShaderInfoLog(S).trim(),V=!0,O=!0;if(s.getProgramParameter(g,s.LINK_STATUS)===!1)if(V=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,g,_,S);else{let K=FE(s,_,"vertex"),z=FE(s,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(g,s.VALIDATE_STATUS)+`

Material Name: `+R.name+`
Material Type: `+R.type+`

Program Info Log: `+F+`
`+K+`
`+z)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(P===""||U==="")&&(O=!1);O&&(R.diagnostics={runnable:V,programLog:F,vertexShader:{log:P,prefix:A},fragmentShader:{log:U,prefix:m}})}s.deleteShader(_),s.deleteShader(S),w=new Lc(s,g),v=wO(s,g)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let v;this.getAttributes=function(){return v===void 0&&C(this),v};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=s.getProgramParameter(g,AO)),E},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=gO++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=_,this.fragmentShader=S,this}function UO(i,e,t,n,s,r,o){let a=new uc,c=new Ag,l=new Set,h=[],u=s.logarithmicDepthBuffer,d=s.vertexTextures,f=s.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){return l.add(v),v===0?"uv":`uv${v}`}function A(v,E,R,F,P){let U=F.fog,V=P.geometry,O=v.isMeshStandardMaterial?F.environment:null,K=(v.isMeshStandardMaterial?t:e).get(v.envMap||O),z=K&&K.mapping===Ch?K.image.height:null,ee=p[v.type];v.precision!==null&&(f=s.getMaxPrecision(v.precision),f!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",f,"instead."));let ae=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,he=ae!==void 0?ae.length:0,ve=0;V.morphAttributes.position!==void 0&&(ve=1),V.morphAttributes.normal!==void 0&&(ve=2),V.morphAttributes.color!==void 0&&(ve=3);let Le,X,se,le;if(ee){let dt=Ts[ee];Le=dt.vertexShader,X=dt.fragmentShader}else Le=v.vertexShader,X=v.fragmentShader,c.update(v),se=c.getVertexShaderID(v),le=c.getFragmentShaderID(v);let pe=i.getRenderTarget(),ye=i.state.buffers.depth.getReversed(),Ue=P.isInstancedMesh===!0,Me=P.isBatchedMesh===!0,xt=!!v.map,$e=!!v.matcap,pt=!!K,L=!!v.aoMap,Tn=!!v.lightMap,rt=!!v.bumpMap,ot=!!v.normalMap,Te=!!v.displacementMap,Et=!!v.emissiveMap,Ie=!!v.metalnessMap,B=!!v.roughnessMap,M=v.anisotropy>0,H=v.clearcoat>0,Z=v.dispersion>0,ie=v.iridescence>0,J=v.sheen>0,Re=v.transmission>0,Ae=M&&!!v.anisotropyMap,Ee=H&&!!v.clearcoatMap,tt=H&&!!v.clearcoatNormalMap,ce=H&&!!v.clearcoatRoughnessMap,ge=ie&&!!v.iridescenceMap,Ne=ie&&!!v.iridescenceThicknessMap,Ge=J&&!!v.sheenColorMap,Se=J&&!!v.sheenRoughnessMap,nt=!!v.specularMap,We=!!v.specularColorMap,St=!!v.specularIntensityMap,N=Re&&!!v.transmissionMap,de=Re&&!!v.thicknessMap,$=!!v.gradientMap,te=!!v.alphaMap,be=v.alphaTest>0,_e=!!v.alphaHash,He=!!v.extensions,Pt=xi;v.toneMapped&&(pe===null||pe.isXRRenderTarget===!0)&&(Pt=i.toneMapping);let mn={shaderID:ee,shaderType:v.type,shaderName:v.name,vertexShader:Le,fragmentShader:X,defines:v.defines,customVertexShaderID:se,customFragmentShaderID:le,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:f,batching:Me,batchingColor:Me&&P._colorsTexture!==null,instancing:Ue,instancingColor:Ue&&P.instanceColor!==null,instancingMorph:Ue&&P.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:pe===null?i.outputColorSpace:pe.isXRRenderTarget===!0?pe.texture.colorSpace:st,alphaToCoverage:!!v.alphaToCoverage,map:xt,matcap:$e,envMap:pt,envMapMode:pt&&K.mapping,envMapCubeUVHeight:z,aoMap:L,lightMap:Tn,bumpMap:rt,normalMap:ot,displacementMap:d&&Te,emissiveMap:Et,normalMapObjectSpace:ot&&v.normalMapType===sE,normalMapTangentSpace:ot&&v.normalMapType===YA,metalnessMap:Ie,roughnessMap:B,anisotropy:M,anisotropyMap:Ae,clearcoat:H,clearcoatMap:Ee,clearcoatNormalMap:tt,clearcoatRoughnessMap:ce,dispersion:Z,iridescence:ie,iridescenceMap:ge,iridescenceThicknessMap:Ne,sheen:J,sheenColorMap:Ge,sheenRoughnessMap:Se,specularMap:nt,specularColorMap:We,specularIntensityMap:St,transmission:Re,transmissionMap:N,thicknessMap:de,gradientMap:$,opaque:v.transparent===!1&&v.blending===Po&&v.alphaToCoverage===!1,alphaMap:te,alphaTest:be,alphaHash:_e,combine:v.combine,mapUv:xt&&g(v.map.channel),aoMapUv:L&&g(v.aoMap.channel),lightMapUv:Tn&&g(v.lightMap.channel),bumpMapUv:rt&&g(v.bumpMap.channel),normalMapUv:ot&&g(v.normalMap.channel),displacementMapUv:Te&&g(v.displacementMap.channel),emissiveMapUv:Et&&g(v.emissiveMap.channel),metalnessMapUv:Ie&&g(v.metalnessMap.channel),roughnessMapUv:B&&g(v.roughnessMap.channel),anisotropyMapUv:Ae&&g(v.anisotropyMap.channel),clearcoatMapUv:Ee&&g(v.clearcoatMap.channel),clearcoatNormalMapUv:tt&&g(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ce&&g(v.clearcoatRoughnessMap.channel),iridescenceMapUv:ge&&g(v.iridescenceMap.channel),iridescenceThicknessMapUv:Ne&&g(v.iridescenceThicknessMap.channel),sheenColorMapUv:Ge&&g(v.sheenColorMap.channel),sheenRoughnessMapUv:Se&&g(v.sheenRoughnessMap.channel),specularMapUv:nt&&g(v.specularMap.channel),specularColorMapUv:We&&g(v.specularColorMap.channel),specularIntensityMapUv:St&&g(v.specularIntensityMap.channel),transmissionMapUv:N&&g(v.transmissionMap.channel),thicknessMapUv:de&&g(v.thicknessMap.channel),alphaMapUv:te&&g(v.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(ot||M),vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,pointsUvs:P.isPoints===!0&&!!V.attributes.uv&&(xt||te),fog:!!U,useFog:v.fog===!0,fogExp2:!!U&&U.isFogExp2,flatShading:v.flatShading===!0,sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:ye,skinning:P.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:he,morphTextureStride:ve,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:i.shadowMap.enabled&&R.length>0,shadowMapType:i.shadowMap.type,toneMapping:Pt,decodeVideoTexture:xt&&v.map.isVideoTexture===!0&&it.getTransfer(v.map.colorSpace)===It,decodeVideoTextureEmissive:Et&&v.emissiveMap.isVideoTexture===!0&&it.getTransfer(v.emissiveMap.colorSpace)===It,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Ut,flipSided:v.side===en,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionClipCullDistance:He&&v.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(He&&v.extensions.multiDraw===!0||Me)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()};return mn.vertexUv1s=l.has(1),mn.vertexUv2s=l.has(2),mn.vertexUv3s=l.has(3),l.clear(),mn}function m(v){let E=[];if(v.shaderID?E.push(v.shaderID):(E.push(v.customVertexShaderID),E.push(v.customFragmentShaderID)),v.defines!==void 0)for(let R in v.defines)E.push(R),E.push(v.defines[R]);return v.isRawShaderMaterial===!1&&(b(E,v),x(E,v),E.push(i.outputColorSpace)),E.push(v.customProgramCacheKey),E.join()}function b(v,E){v.push(E.precision),v.push(E.outputColorSpace),v.push(E.envMapMode),v.push(E.envMapCubeUVHeight),v.push(E.mapUv),v.push(E.alphaMapUv),v.push(E.lightMapUv),v.push(E.aoMapUv),v.push(E.bumpMapUv),v.push(E.normalMapUv),v.push(E.displacementMapUv),v.push(E.emissiveMapUv),v.push(E.metalnessMapUv),v.push(E.roughnessMapUv),v.push(E.anisotropyMapUv),v.push(E.clearcoatMapUv),v.push(E.clearcoatNormalMapUv),v.push(E.clearcoatRoughnessMapUv),v.push(E.iridescenceMapUv),v.push(E.iridescenceThicknessMapUv),v.push(E.sheenColorMapUv),v.push(E.sheenRoughnessMapUv),v.push(E.specularMapUv),v.push(E.specularColorMapUv),v.push(E.specularIntensityMapUv),v.push(E.transmissionMapUv),v.push(E.thicknessMapUv),v.push(E.combine),v.push(E.fogExp2),v.push(E.sizeAttenuation),v.push(E.morphTargetsCount),v.push(E.morphAttributeCount),v.push(E.numDirLights),v.push(E.numPointLights),v.push(E.numSpotLights),v.push(E.numSpotLightMaps),v.push(E.numHemiLights),v.push(E.numRectAreaLights),v.push(E.numDirLightShadows),v.push(E.numPointLightShadows),v.push(E.numSpotLightShadows),v.push(E.numSpotLightShadowsWithMaps),v.push(E.numLightProbes),v.push(E.shadowMapType),v.push(E.toneMapping),v.push(E.numClippingPlanes),v.push(E.numClipIntersection),v.push(E.depthPacking)}function x(v,E){a.disableAll(),E.supportsVertexTextures&&a.enable(0),E.instancing&&a.enable(1),E.instancingColor&&a.enable(2),E.instancingMorph&&a.enable(3),E.matcap&&a.enable(4),E.envMap&&a.enable(5),E.normalMapObjectSpace&&a.enable(6),E.normalMapTangentSpace&&a.enable(7),E.clearcoat&&a.enable(8),E.iridescence&&a.enable(9),E.alphaTest&&a.enable(10),E.vertexColors&&a.enable(11),E.vertexAlphas&&a.enable(12),E.vertexUv1s&&a.enable(13),E.vertexUv2s&&a.enable(14),E.vertexUv3s&&a.enable(15),E.vertexTangents&&a.enable(16),E.anisotropy&&a.enable(17),E.alphaHash&&a.enable(18),E.batching&&a.enable(19),E.dispersion&&a.enable(20),E.batchingColor&&a.enable(21),v.push(a.mask),a.disableAll(),E.fog&&a.enable(0),E.useFog&&a.enable(1),E.flatShading&&a.enable(2),E.logarithmicDepthBuffer&&a.enable(3),E.reverseDepthBuffer&&a.enable(4),E.skinning&&a.enable(5),E.morphTargets&&a.enable(6),E.morphNormals&&a.enable(7),E.morphColors&&a.enable(8),E.premultipliedAlpha&&a.enable(9),E.shadowMapEnabled&&a.enable(10),E.doubleSided&&a.enable(11),E.flipSided&&a.enable(12),E.useDepthPacking&&a.enable(13),E.dithering&&a.enable(14),E.transmission&&a.enable(15),E.sheen&&a.enable(16),E.opaque&&a.enable(17),E.pointsUvs&&a.enable(18),E.decodeVideoTexture&&a.enable(19),E.decodeVideoTextureEmissive&&a.enable(20),E.alphaToCoverage&&a.enable(21),v.push(a.mask)}function y(v){let E=p[v.type],R;if(E){let F=Ts[E];R=gE.clone(F.uniforms)}else R=v.uniforms;return R}function _(v,E){let R;for(let F=0,P=h.length;F<P;F++){let U=h[F];if(U.cacheKey===E){R=U,++R.usedTimes;break}}return R===void 0&&(R=new OO(i,E,v,r),h.push(R)),R}function S(v){if(--v.usedTimes===0){let E=h.indexOf(v);h[E]=h[h.length-1],h.pop(),v.destroy()}}function C(v){c.remove(v)}function w(){c.dispose()}return{getParameters:A,getProgramCacheKey:m,getUniforms:y,acquireProgram:_,releaseProgram:S,releaseShaderCache:C,programs:h,dispose:w}}function kO(){let i=new WeakMap;function e(o){return i.has(o)}function t(o){let a=i.get(o);return a===void 0&&(a={},i.set(o,a)),a}function n(o){i.delete(o)}function s(o,a,c){i.get(o)[a]=c}function r(){i=new WeakMap}return{has:e,get:t,remove:n,update:s,dispose:r}}function GO(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 GE(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 QE(){let i=[],e=0,t=[],n=[],s=[];function r(){e=0,t.length=0,n.length=0,s.length=0}function o(u,d,f,p,g,A){let m=i[e];return m===void 0?(m={id:u.id,object:u,geometry:d,material:f,groupOrder:p,renderOrder:u.renderOrder,z:g,group:A},i[e]=m):(m.id=u.id,m.object=u,m.geometry=d,m.material=f,m.groupOrder=p,m.renderOrder=u.renderOrder,m.z=g,m.group=A),e++,m}function a(u,d,f,p,g,A){let m=o(u,d,f,p,g,A);f.transmission>0?n.push(m):f.transparent===!0?s.push(m):t.push(m)}function c(u,d,f,p,g,A){let m=o(u,d,f,p,g,A);f.transmission>0?n.unshift(m):f.transparent===!0?s.unshift(m):t.unshift(m)}function l(u,d){t.length>1&&t.sort(u||GO),n.length>1&&n.sort(d||GE),s.length>1&&s.sort(d||GE)}function h(){for(let u=e,d=i.length;u<d;u++){let f=i[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:s,init:r,push:a,unshift:c,finish:h,sort:l}}function QO(){let i=new WeakMap;function e(n,s){let r=i.get(n),o;return r===void 0?(o=new QE,i.set(n,[o])):s>=r.length?(o=new QE,r.push(o)):o=r[s],o}function t(){i=new WeakMap}return{get:e,dispose:t}}function zO(){let 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 D,color:new Ce};break;case"SpotLight":t={position:new D,direction:new D,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new D,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":t={direction:new D,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":t={color:new Ce,position:new D,halfWidth:new D,halfHeight:new D};break}return i[e.id]=t,t}}}function HO(){let i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}function WO(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function qO(i){let e=new zO,t=HO(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let l=0;l<9;l++)n.probe.push(new D);let s=new D,r=new Oe,o=new Oe;function a(l){let h=0,u=0,d=0;for(let v=0;v<9;v++)n.probe[v].set(0,0,0);let f=0,p=0,g=0,A=0,m=0,b=0,x=0,y=0,_=0,S=0,C=0;l.sort(WO);for(let v=0,E=l.length;v<E;v++){let R=l[v],F=R.color,P=R.intensity,U=R.distance,V=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=F.r*P,u+=F.g*P,d+=F.b*P;else if(R.isLightProbe){for(let O=0;O<9;O++)n.probe[O].addScaledVector(R.sh.coefficients[O],P);C++}else if(R.isDirectionalLight){let O=e.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){let K=R.shadow,z=t.get(R);z.shadowIntensity=K.intensity,z.shadowBias=K.bias,z.shadowNormalBias=K.normalBias,z.shadowRadius=K.radius,z.shadowMapSize=K.mapSize,n.directionalShadow[f]=z,n.directionalShadowMap[f]=V,n.directionalShadowMatrix[f]=R.shadow.matrix,b++}n.directional[f]=O,f++}else if(R.isSpotLight){let O=e.get(R);O.position.setFromMatrixPosition(R.matrixWorld),O.color.copy(F).multiplyScalar(P),O.distance=U,O.coneCos=Math.cos(R.angle),O.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),O.decay=R.decay,n.spot[g]=O;let K=R.shadow;if(R.map&&(n.spotLightMap[_]=R.map,_++,K.updateMatrices(R),R.castShadow&&S++),n.spotLightMatrix[g]=K.matrix,R.castShadow){let z=t.get(R);z.shadowIntensity=K.intensity,z.shadowBias=K.bias,z.shadowNormalBias=K.normalBias,z.shadowRadius=K.radius,z.shadowMapSize=K.mapSize,n.spotShadow[g]=z,n.spotShadowMap[g]=V,y++}g++}else if(R.isRectAreaLight){let O=e.get(R);O.color.copy(F).multiplyScalar(P),O.halfWidth.set(R.width*.5,0,0),O.halfHeight.set(0,R.height*.5,0),n.rectArea[A]=O,A++}else if(R.isPointLight){let O=e.get(R);if(O.color.copy(R.color).multiplyScalar(R.intensity),O.distance=R.distance,O.decay=R.decay,R.castShadow){let K=R.shadow,z=t.get(R);z.shadowIntensity=K.intensity,z.shadowBias=K.bias,z.shadowNormalBias=K.normalBias,z.shadowRadius=K.radius,z.shadowMapSize=K.mapSize,z.shadowCameraNear=K.camera.near,z.shadowCameraFar=K.camera.far,n.pointShadow[p]=z,n.pointShadowMap[p]=V,n.pointShadowMatrix[p]=R.shadow.matrix,x++}n.point[p]=O,p++}else if(R.isHemisphereLight){let O=e.get(R);O.skyColor.copy(R.color).multiplyScalar(P),O.groundColor.copy(R.groundColor).multiplyScalar(P),n.hemi[m]=O,m++}}A>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=me.LTC_FLOAT_1,n.rectAreaLTC2=me.LTC_FLOAT_2):(n.rectAreaLTC1=me.LTC_HALF_1,n.rectAreaLTC2=me.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;let w=n.hash;(w.directionalLength!==f||w.pointLength!==p||w.spotLength!==g||w.rectAreaLength!==A||w.hemiLength!==m||w.numDirectionalShadows!==b||w.numPointShadows!==x||w.numSpotShadows!==y||w.numSpotMaps!==_||w.numLightProbes!==C)&&(n.directional.length=f,n.spot.length=g,n.rectArea.length=A,n.point.length=p,n.hemi.length=m,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=x,n.pointShadowMap.length=x,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=x,n.spotLightMatrix.length=y+_-S,n.spotLightMap.length=_,n.numSpotLightShadowsWithMaps=S,n.numLightProbes=C,w.directionalLength=f,w.pointLength=p,w.spotLength=g,w.rectAreaLength=A,w.hemiLength=m,w.numDirectionalShadows=b,w.numPointShadows=x,w.numSpotShadows=y,w.numSpotMaps=_,w.numLightProbes=C,n.version=VO++)}function c(l,h){let u=0,d=0,f=0,p=0,g=0,A=h.matrixWorldInverse;for(let m=0,b=l.length;m<b;m++){let x=l[m];if(x.isDirectionalLight){let y=n.directional[u];y.direction.setFromMatrixPosition(x.matrixWorld),s.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(s),y.direction.transformDirection(A),u++}else if(x.isSpotLight){let y=n.spot[f];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(A),y.direction.setFromMatrixPosition(x.matrixWorld),s.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(s),y.direction.transformDirection(A),f++}else if(x.isRectAreaLight){let y=n.rectArea[p];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(A),o.identity(),r.copy(x.matrixWorld),r.premultiply(A),o.extractRotation(r),y.halfWidth.set(x.width*.5,0,0),y.halfHeight.set(0,x.height*.5,0),y.halfWidth.applyMatrix4(o),y.halfHeight.applyMatrix4(o),p++}else if(x.isPointLight){let y=n.point[d];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(A),d++}else if(x.isHemisphereLight){let y=n.hemi[g];y.direction.setFromMatrixPosition(x.matrixWorld),y.direction.transformDirection(A),g++}}}return{setup:a,setupView:c,state:n}}function zE(i){let e=new qO(i),t=[],n=[];function s(h){l.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function o(h){n.push(h)}function a(){e.setup(t)}function c(h){e.setupView(t,h)}let l={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:s,state:l,setupLights:a,setupLightsView:c,pushLight:r,pushShadow:o}}function KO(i){let e=new WeakMap;function t(s,r=0){let o=e.get(s),a;return o===void 0?(a=new zE(i),e.set(s,[a])):r>=o.length?(a=new zE(i),o.push(a)):a=o[r],a}function n(){e=new WeakMap}return{get:t,dispose:n}}function YO(i,e,t){let n=new mc,s=new Fe,r=new Fe,o=new _t,a=new yc({depthPacking:iE}),c=new Kd,l={},h=t.maxTextureSize,u={[qn]:en,[en]:qn,[Ut]:Ut},d=new sn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fe},radius:{value:4}},vertexShader:$O,fragmentShader:XO}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new Zt;p.setAttribute("position",new yt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new Ke(p,d),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=UA;let m=this.type;this.render=function(S,C,w){if(A.enabled===!1||A.autoUpdate===!1&&A.needsUpdate===!1||S.length===0)return;let v=i.getRenderTarget(),E=i.getActiveCubeFace(),R=i.getActiveMipmapLevel(),F=i.state;F.setBlending(bi),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);let P=m!==ws&&this.type===ws,U=m===ws&&this.type!==ws;for(let V=0,O=S.length;V<O;V++){let K=S[V],z=K.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",K,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;s.copy(z.mapSize);let ee=z.getFrameExtents();if(s.multiply(ee),r.copy(z.mapSize),(s.x>h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/ee.x),s.x=r.x*ee.x,z.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/ee.y),s.y=r.y*ee.y,z.mapSize.y=r.y)),z.map===null||P===!0||U===!0){let he=this.type!==ws?{minFilter:Ft,magFilter:Ft}:{};z.map!==null&&z.map.dispose(),z.map=new _n(s.x,s.y,he),z.map.texture.name=K.name+".shadowMap",z.camera.updateProjectionMatrix()}i.setRenderTarget(z.map),i.clear();let ae=z.getViewportCount();for(let he=0;he<ae;he++){let ve=z.getViewport(he);o.set(r.x*ve.x,r.y*ve.y,r.x*ve.z,r.y*ve.w),F.viewport(o),z.updateMatrices(K,he),n=z.getFrustum(),y(C,w,z.camera,K,this.type)}z.isPointLightShadow!==!0&&this.type===ws&&b(z,w),z.needsUpdate=!1}m=this.type,A.needsUpdate=!1,i.setRenderTarget(v,E,R)};function b(S,C){let w=e.update(g);d.defines.VSM_SAMPLES!==S.blurSamples&&(d.defines.VSM_SAMPLES=S.blurSamples,f.defines.VSM_SAMPLES=S.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new _n(s.x,s.y)),d.uniforms.shadow_pass.value=S.map.texture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,i.setRenderTarget(S.mapPass),i.clear(),i.renderBufferDirect(C,null,w,d,g,null),f.uniforms.shadow_pass.value=S.mapPass.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,i.setRenderTarget(S.map),i.clear(),i.renderBufferDirect(C,null,w,f,g,null)}function x(S,C,w,v){let E=null,R=w.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(R!==void 0)E=R;else if(E=w.isPointLight===!0?c:a,i.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0||C.map&&C.alphaTest>0){let F=E.uuid,P=C.uuid,U=l[F];U===void 0&&(U={},l[F]=U);let V=U[P];V===void 0&&(V=E.clone(),U[P]=V,C.addEventListener("dispose",_)),E=V}if(E.visible=C.visible,E.wireframe=C.wireframe,v===ws?E.side=C.shadowSide!==null?C.shadowSide:C.side:E.side=C.shadowSide!==null?C.shadowSide:u[C.side],E.alphaMap=C.alphaMap,E.alphaTest=C.alphaTest,E.map=C.map,E.clipShadows=C.clipShadows,E.clippingPlanes=C.clippingPlanes,E.clipIntersection=C.clipIntersection,E.displacementMap=C.displacementMap,E.displacementScale=C.displacementScale,E.displacementBias=C.displacementBias,E.wireframeLinewidth=C.wireframeLinewidth,E.linewidth=C.linewidth,w.isPointLight===!0&&E.isMeshDistanceMaterial===!0){let F=i.properties.get(E);F.light=w}return E}function y(S,C,w,v,E){if(S.visible===!1)return;if(S.layers.test(C.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&E===ws)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,S.matrixWorld);let P=e.update(S),U=S.material;if(Array.isArray(U)){let V=P.groups;for(let O=0,K=V.length;O<K;O++){let z=V[O],ee=U[z.materialIndex];if(ee&&ee.visible){let ae=x(S,ee,v,E);S.onBeforeShadow(i,S,C,w,P,ae,z),i.renderBufferDirect(w,null,P,ae,S,z),S.onAfterShadow(i,S,C,w,P,ae,z)}}}else if(U.visible){let V=x(S,U,v,E);S.onBeforeShadow(i,S,C,w,P,V,null),i.renderBufferDirect(w,null,P,V,S,null),S.onAfterShadow(i,S,C,w,P,V,null)}}let F=S.children;for(let P=0,U=F.length;P<U;P++)y(F[P],C,w,v,E)}function _(S){S.target.removeEventListener("dispose",_);for(let w in l){let v=l[w],E=S.target.uuid;E in v&&(v[E].dispose(),delete v[E])}}}function JO(i,e){function t(){let N=!1,de=new _t,$=null,te=new _t(0,0,0,0);return{setMask:function(be){$!==be&&!N&&(i.colorMask(be,be,be,be),$=be)},setLocked:function(be){N=be},setClear:function(be,_e,He,Pt,mn){mn===!0&&(be*=Pt,_e*=Pt,He*=Pt),de.set(be,_e,He,Pt),te.equals(de)===!1&&(i.clearColor(be,_e,He,Pt),te.copy(de))},reset:function(){N=!1,$=null,te.set(-1,0,0,0)}}}function n(){let N=!1,de=!1,$=null,te=null,be=null;return{setReversed:function(_e){if(de!==_e){let He=e.get("EXT_clip_control");de?He.clipControlEXT(He.LOWER_LEFT_EXT,He.ZERO_TO_ONE_EXT):He.clipControlEXT(He.LOWER_LEFT_EXT,He.NEGATIVE_ONE_TO_ONE_EXT);let Pt=be;be=null,this.setClear(Pt)}de=_e},getReversed:function(){return de},setTest:function(_e){_e?pe(i.DEPTH_TEST):ye(i.DEPTH_TEST)},setMask:function(_e){$!==_e&&!N&&(i.depthMask(_e),$=_e)},setFunc:function(_e){if(de&&(_e=jO[_e]),te!==_e){switch(_e){case nf:i.depthFunc(i.NEVER);break;case sf:i.depthFunc(i.ALWAYS);break;case rf:i.depthFunc(i.LESS);break;case Fo:i.depthFunc(i.LEQUAL);break;case of:i.depthFunc(i.EQUAL);break;case af:i.depthFunc(i.GEQUAL);break;case cf:i.depthFunc(i.GREATER);break;case lf:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}te=_e}},setLocked:function(_e){N=_e},setClear:function(_e){be!==_e&&(de&&(_e=1-_e),i.clearDepth(_e),be=_e)},reset:function(){N=!1,$=null,te=null,be=null,de=!1}}}function s(){let N=!1,de=null,$=null,te=null,be=null,_e=null,He=null,Pt=null,mn=null;return{setTest:function(dt){N||(dt?pe(i.STENCIL_TEST):ye(i.STENCIL_TEST))},setMask:function(dt){de!==dt&&!N&&(i.stencilMask(dt),de=dt)},setFunc:function(dt,di,Hi){($!==dt||te!==di||be!==Hi)&&(i.stencilFunc(dt,di,Hi),$=dt,te=di,be=Hi)},setOp:function(dt,di,Hi){(_e!==dt||He!==di||Pt!==Hi)&&(i.stencilOp(dt,di,Hi),_e=dt,He=di,Pt=Hi)},setLocked:function(dt){N=dt},setClear:function(dt){mn!==dt&&(i.clearStencil(dt),mn=dt)},reset:function(){N=!1,de=null,$=null,te=null,be=null,_e=null,He=null,Pt=null,mn=null}}}let r=new t,o=new n,a=new s,c=new WeakMap,l=new WeakMap,h={},u={},d=new WeakMap,f=[],p=null,g=!1,A=null,m=null,b=null,x=null,y=null,_=null,S=null,C=new Ce(0,0,0),w=0,v=!1,E=null,R=null,F=null,P=null,U=null,V=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS),O=!1,K=0,z=i.getParameter(i.VERSION);z.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(z)[1]),O=K>=1):z.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),O=K>=2);let ee=null,ae={},he=i.getParameter(i.SCISSOR_BOX),ve=i.getParameter(i.VIEWPORT),Le=new _t().fromArray(he),X=new _t().fromArray(ve);function se(N,de,$,te){let be=new Uint8Array(4),_e=i.createTexture();i.bindTexture(N,_e),i.texParameteri(N,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(N,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let He=0;He<$;He++)N===i.TEXTURE_3D||N===i.TEXTURE_2D_ARRAY?i.texImage3D(de,0,i.RGBA,1,1,te,0,i.RGBA,i.UNSIGNED_BYTE,be):i.texImage2D(de+He,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,be);return _e}let le={};le[i.TEXTURE_2D]=se(i.TEXTURE_2D,i.TEXTURE_2D,1),le[i.TEXTURE_CUBE_MAP]=se(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[i.TEXTURE_2D_ARRAY]=se(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),le[i.TEXTURE_3D]=se(i.TEXTURE_3D,i.TEXTURE_3D,1,1),r.setClear(0,0,0,1),o.setClear(1),a.setClear(0),pe(i.DEPTH_TEST),o.setFunc(Fo),rt(!1),ot(NA),pe(i.CULL_FACE),L(bi);function pe(N){h[N]!==!0&&(i.enable(N),h[N]=!0)}function ye(N){h[N]!==!1&&(i.disable(N),h[N]=!1)}function Ue(N,de){return u[N]!==de?(i.bindFramebuffer(N,de),u[N]=de,N===i.DRAW_FRAMEBUFFER&&(u[i.FRAMEBUFFER]=de),N===i.FRAMEBUFFER&&(u[i.DRAW_FRAMEBUFFER]=de),!0):!1}function Me(N,de){let $=f,te=!1;if(N){$=d.get(de),$===void 0&&($=[],d.set(de,$));let be=N.textures;if($.length!==be.length||$[0]!==i.COLOR_ATTACHMENT0){for(let _e=0,He=be.length;_e<He;_e++)$[_e]=i.COLOR_ATTACHMENT0+_e;$.length=be.length,te=!0}}else $[0]!==i.BACK&&($[0]=i.BACK,te=!0);te&&i.drawBuffers($)}function xt(N){return p!==N?(i.useProgram(N),p=N,!0):!1}let $e={[qr]:i.FUNC_ADD,[Pv]:i.FUNC_SUBTRACT,[Fv]:i.FUNC_REVERSE_SUBTRACT};$e[Ov]=i.MIN,$e[Nv]=i.MAX;let pt={[Uv]:i.ZERO,[kv]:i.ONE,[Gv]:i.SRC_COLOR,[Gd]:i.SRC_ALPHA,[qv]:i.SRC_ALPHA_SATURATE,[Vv]:i.DST_COLOR,[zv]:i.DST_ALPHA,[Qv]:i.ONE_MINUS_SRC_COLOR,[Qd]:i.ONE_MINUS_SRC_ALPHA,[Wv]:i.ONE_MINUS_DST_COLOR,[Hv]:i.ONE_MINUS_DST_ALPHA,[Kv]:i.CONSTANT_COLOR,[$v]:i.ONE_MINUS_CONSTANT_COLOR,[Xv]:i.CONSTANT_ALPHA,[Yv]:i.ONE_MINUS_CONSTANT_ALPHA};function L(N,de,$,te,be,_e,He,Pt,mn,dt){if(N===bi){g===!0&&(ye(i.BLEND),g=!1);return}if(g===!1&&(pe(i.BLEND),g=!0),N!==Lv){if(N!==A||dt!==v){if((m!==qr||y!==qr)&&(i.blendEquation(i.FUNC_ADD),m=qr,y=qr),dt)switch(N){case Po:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case kA:i.blendFunc(i.ONE,i.ONE);break;case GA:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case QA:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",N);break}else switch(N){case Po:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case kA:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case GA:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case QA:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",N);break}b=null,x=null,_=null,S=null,C.set(0,0,0),w=0,A=N,v=dt}return}be=be||de,_e=_e||$,He=He||te,(de!==m||be!==y)&&(i.blendEquationSeparate($e[de],$e[be]),m=de,y=be),($!==b||te!==x||_e!==_||He!==S)&&(i.blendFuncSeparate(pt[$],pt[te],pt[_e],pt[He]),b=$,x=te,_=_e,S=He),(Pt.equals(C)===!1||mn!==w)&&(i.blendColor(Pt.r,Pt.g,Pt.b,mn),C.copy(Pt),w=mn),A=N,v=!1}function Tn(N,de){N.side===Ut?ye(i.CULL_FACE):pe(i.CULL_FACE);let $=N.side===en;de&&($=!$),rt($),N.blending===Po&&N.transparent===!1?L(bi):L(N.blending,N.blendEquation,N.blendSrc,N.blendDst,N.blendEquationAlpha,N.blendSrcAlpha,N.blendDstAlpha,N.blendColor,N.blendAlpha,N.premultipliedAlpha),o.setFunc(N.depthFunc),o.setTest(N.depthTest),o.setMask(N.depthWrite),r.setMask(N.colorWrite);let te=N.stencilWrite;a.setTest(te),te&&(a.setMask(N.stencilWriteMask),a.setFunc(N.stencilFunc,N.stencilRef,N.stencilFuncMask),a.setOp(N.stencilFail,N.stencilZFail,N.stencilZPass)),Et(N.polygonOffset,N.polygonOffsetFactor,N.polygonOffsetUnits),N.alphaToCoverage===!0?pe(i.SAMPLE_ALPHA_TO_COVERAGE):ye(i.SAMPLE_ALPHA_TO_COVERAGE)}function rt(N){E!==N&&(N?i.frontFace(i.CW):i.frontFace(i.CCW),E=N)}function ot(N){N!==Rv?(pe(i.CULL_FACE),N!==R&&(N===NA?i.cullFace(i.BACK):N===Bv?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):ye(i.CULL_FACE),R=N}function Te(N){N!==F&&(O&&i.lineWidth(N),F=N)}function Et(N,de,$){N?(pe(i.POLYGON_OFFSET_FILL),(P!==de||U!==$)&&(i.polygonOffset(de,$),P=de,U=$)):ye(i.POLYGON_OFFSET_FILL)}function Ie(N){N?pe(i.SCISSOR_TEST):ye(i.SCISSOR_TEST)}function B(N){N===void 0&&(N=i.TEXTURE0+V-1),ee!==N&&(i.activeTexture(N),ee=N)}function M(N,de,$){$===void 0&&(ee===null?$=i.TEXTURE0+V-1:$=ee);let te=ae[$];te===void 0&&(te={type:void 0,texture:void 0},ae[$]=te),(te.type!==N||te.texture!==de)&&(ee!==$&&(i.activeTexture($),ee=$),i.bindTexture(N,de||le[N]),te.type=N,te.texture=de)}function H(){let N=ae[ee];N!==void 0&&N.type!==void 0&&(i.bindTexture(N.type,null),N.type=void 0,N.texture=void 0)}function Z(){try{i.compressedTexImage2D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function ie(){try{i.compressedTexImage3D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function J(){try{i.texSubImage2D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Re(){try{i.texSubImage3D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Ae(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Ee(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function tt(){try{i.texStorage2D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function ce(){try{i.texStorage3D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function ge(){try{i.texImage2D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Ne(){try{i.texImage3D.apply(i,arguments)}catch(N){console.error("THREE.WebGLState:",N)}}function Ge(N){Le.equals(N)===!1&&(i.scissor(N.x,N.y,N.z,N.w),Le.copy(N))}function Se(N){X.equals(N)===!1&&(i.viewport(N.x,N.y,N.z,N.w),X.copy(N))}function nt(N,de){let $=l.get(de);$===void 0&&($=new WeakMap,l.set(de,$));let te=$.get(N);te===void 0&&(te=i.getUniformBlockIndex(de,N.name),$.set(N,te))}function We(N,de){let te=l.get(de).get(N);c.get(de)!==te&&(i.uniformBlockBinding(de,te,N.__bindingPointIndex),c.set(de,te))}function St(){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),o.setReversed(!1),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),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),h={},ee=null,ae={},u={},d=new WeakMap,f=[],p=null,g=!1,A=null,m=null,b=null,x=null,y=null,_=null,S=null,C=new Ce(0,0,0),w=0,v=!1,E=null,R=null,F=null,P=null,U=null,Le.set(0,0,i.canvas.width,i.canvas.height),X.set(0,0,i.canvas.width,i.canvas.height),r.reset(),o.reset(),a.reset()}return{buffers:{color:r,depth:o,stencil:a},enable:pe,disable:ye,bindFramebuffer:Ue,drawBuffers:Me,useProgram:xt,setBlending:L,setMaterial:Tn,setFlipSided:rt,setCullFace:ot,setLineWidth:Te,setPolygonOffset:Et,setScissorTest:Ie,activeTexture:B,bindTexture:M,unbindTexture:H,compressedTexImage2D:Z,compressedTexImage3D:ie,texImage2D:ge,texImage3D:Ne,updateUBOMapping:nt,uniformBlockBinding:We,texStorage2D:tt,texStorage3D:ce,texSubImage2D:J,texSubImage3D:Re,compressedTexSubImage2D:Ae,compressedTexSubImage3D:Ee,scissor:Ge,viewport:Se,reset:St}}function ZO(i,e,t,n,s,r,o){let a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Fe,h=new WeakMap,u,d=new WeakMap,f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(B,M){return f?new OffscreenCanvas(B,M):lc("canvas")}function g(B,M,H){let Z=1,ie=Ie(B);if((ie.width>H||ie.height>H)&&(Z=H/Math.max(ie.width,ie.height)),Z<1)if(typeof HTMLImageElement<"u"&&B instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&B instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&B instanceof ImageBitmap||typeof VideoFrame<"u"&&B instanceof VideoFrame){let J=Math.floor(Z*ie.width),Re=Math.floor(Z*ie.height);u===void 0&&(u=p(J,Re));let Ae=M?p(J,Re):u;return Ae.width=J,Ae.height=Re,Ae.getContext("2d").drawImage(B,0,0,J,Re),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ie.width+"x"+ie.height+") to ("+J+"x"+Re+")."),Ae}else return"data"in B&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ie.width+"x"+ie.height+")."),B;return B}function A(B){return B.generateMipmaps}function m(B){i.generateMipmap(B)}function b(B){return B.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:B.isWebGL3DRenderTarget?i.TEXTURE_3D:B.isWebGLArrayRenderTarget||B.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function x(B,M,H,Z,ie=!1){if(B!==null){if(i[B]!==void 0)return i[B];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+B+"'")}let J=M;if(M===i.RED&&(H===i.FLOAT&&(J=i.R32F),H===i.HALF_FLOAT&&(J=i.R16F),H===i.UNSIGNED_BYTE&&(J=i.R8)),M===i.RED_INTEGER&&(H===i.UNSIGNED_BYTE&&(J=i.R8UI),H===i.UNSIGNED_SHORT&&(J=i.R16UI),H===i.UNSIGNED_INT&&(J=i.R32UI),H===i.BYTE&&(J=i.R8I),H===i.SHORT&&(J=i.R16I),H===i.INT&&(J=i.R32I)),M===i.RG&&(H===i.FLOAT&&(J=i.RG32F),H===i.HALF_FLOAT&&(J=i.RG16F),H===i.UNSIGNED_BYTE&&(J=i.RG8)),M===i.RG_INTEGER&&(H===i.UNSIGNED_BYTE&&(J=i.RG8UI),H===i.UNSIGNED_SHORT&&(J=i.RG16UI),H===i.UNSIGNED_INT&&(J=i.RG32UI),H===i.BYTE&&(J=i.RG8I),H===i.SHORT&&(J=i.RG16I),H===i.INT&&(J=i.RG32I)),M===i.RGB_INTEGER&&(H===i.UNSIGNED_BYTE&&(J=i.RGB8UI),H===i.UNSIGNED_SHORT&&(J=i.RGB16UI),H===i.UNSIGNED_INT&&(J=i.RGB32UI),H===i.BYTE&&(J=i.RGB8I),H===i.SHORT&&(J=i.RGB16I),H===i.INT&&(J=i.RGB32I)),M===i.RGBA_INTEGER&&(H===i.UNSIGNED_BYTE&&(J=i.RGBA8UI),H===i.UNSIGNED_SHORT&&(J=i.RGBA16UI),H===i.UNSIGNED_INT&&(J=i.RGBA32UI),H===i.BYTE&&(J=i.RGBA8I),H===i.SHORT&&(J=i.RGBA16I),H===i.INT&&(J=i.RGBA32I)),M===i.RGB&&H===i.UNSIGNED_INT_5_9_9_9_REV&&(J=i.RGB9_E5),M===i.RGBA){let Re=ie?Zl:it.getTransfer(Z);H===i.FLOAT&&(J=i.RGBA32F),H===i.HALF_FLOAT&&(J=i.RGBA16F),H===i.UNSIGNED_BYTE&&(J=Re===It?i.SRGB8_ALPHA8:i.RGBA8),H===i.UNSIGNED_SHORT_4_4_4_4&&(J=i.RGBA4),H===i.UNSIGNED_SHORT_5_5_5_1&&(J=i.RGB5_A1)}return(J===i.R16F||J===i.R32F||J===i.RG16F||J===i.RG32F||J===i.RGBA16F||J===i.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function y(B,M){let H;return B?M===null||M===Cs||M===Ko?H=i.DEPTH24_STENCIL8:M===Ot?H=i.DEPTH32F_STENCIL8:M===_c&&(H=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):M===null||M===Cs||M===Ko?H=i.DEPTH_COMPONENT24:M===Ot?H=i.DEPTH_COMPONENT32F:M===_c&&(H=i.DEPTH_COMPONENT16),H}function _(B,M){return A(B)===!0||B.isFramebufferTexture&&B.minFilter!==Ft&&B.minFilter!==qe?Math.log2(Math.max(M.width,M.height))+1:B.mipmaps!==void 0&&B.mipmaps.length>0?B.mipmaps.length:B.isCompressedTexture&&Array.isArray(B.image)?M.mipmaps.length:1}function S(B){let M=B.target;M.removeEventListener("dispose",S),w(M),M.isVideoTexture&&h.delete(M)}function C(B){let M=B.target;M.removeEventListener("dispose",C),E(M)}function w(B){let M=n.get(B);if(M.__webglInit===void 0)return;let H=B.source,Z=d.get(H);if(Z){let ie=Z[M.__cacheKey];ie.usedTimes--,ie.usedTimes===0&&v(B),Object.keys(Z).length===0&&d.delete(H)}n.remove(B)}function v(B){let M=n.get(B);i.deleteTexture(M.__webglTexture);let H=B.source,Z=d.get(H);delete Z[M.__cacheKey],o.memory.textures--}function E(B){let M=n.get(B);if(B.depthTexture&&(B.depthTexture.dispose(),n.remove(B.depthTexture)),B.isWebGLCubeRenderTarget)for(let Z=0;Z<6;Z++){if(Array.isArray(M.__webglFramebuffer[Z]))for(let ie=0;ie<M.__webglFramebuffer[Z].length;ie++)i.deleteFramebuffer(M.__webglFramebuffer[Z][ie]);else i.deleteFramebuffer(M.__webglFramebuffer[Z]);M.__webglDepthbuffer&&i.deleteRenderbuffer(M.__webglDepthbuffer[Z])}else{if(Array.isArray(M.__webglFramebuffer))for(let Z=0;Z<M.__webglFramebuffer.length;Z++)i.deleteFramebuffer(M.__webglFramebuffer[Z]);else i.deleteFramebuffer(M.__webglFramebuffer);if(M.__webglDepthbuffer&&i.deleteRenderbuffer(M.__webglDepthbuffer),M.__webglMultisampledFramebuffer&&i.deleteFramebuffer(M.__webglMultisampledFramebuffer),M.__webglColorRenderbuffer)for(let Z=0;Z<M.__webglColorRenderbuffer.length;Z++)M.__webglColorRenderbuffer[Z]&&i.deleteRenderbuffer(M.__webglColorRenderbuffer[Z]);M.__webglDepthRenderbuffer&&i.deleteRenderbuffer(M.__webglDepthRenderbuffer)}let H=B.textures;for(let Z=0,ie=H.length;Z<ie;Z++){let J=n.get(H[Z]);J.__webglTexture&&(i.deleteTexture(J.__webglTexture),o.memory.textures--),n.remove(H[Z])}n.remove(B)}let R=0;function F(){R=0}function P(){let B=R;return B>=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+B+" texture units while this GPU supports only "+s.maxTextures),R+=1,B}function U(B){let M=[];return M.push(B.wrapS),M.push(B.wrapT),M.push(B.wrapR||0),M.push(B.magFilter),M.push(B.minFilter),M.push(B.anisotropy),M.push(B.internalFormat),M.push(B.format),M.push(B.type),M.push(B.generateMipmaps),M.push(B.premultiplyAlpha),M.push(B.flipY),M.push(B.unpackAlignment),M.push(B.colorSpace),M.join()}function V(B,M){let H=n.get(B);if(B.isVideoTexture&&Te(B),B.isRenderTargetTexture===!1&&B.version>0&&H.__version!==B.version){let Z=B.image;if(Z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{X(H,B,M);return}}t.bindTexture(i.TEXTURE_2D,H.__webglTexture,i.TEXTURE0+M)}function O(B,M){let H=n.get(B);if(B.version>0&&H.__version!==B.version){X(H,B,M);return}t.bindTexture(i.TEXTURE_2D_ARRAY,H.__webglTexture,i.TEXTURE0+M)}function K(B,M){let H=n.get(B);if(B.version>0&&H.__version!==B.version){X(H,B,M);return}t.bindTexture(i.TEXTURE_3D,H.__webglTexture,i.TEXTURE0+M)}function z(B,M){let H=n.get(B);if(B.version>0&&H.__version!==B.version){se(H,B,M);return}t.bindTexture(i.TEXTURE_CUBE_MAP,H.__webglTexture,i.TEXTURE0+M)}let ee={[Dn]:i.REPEAT,[Bt]:i.CLAMP_TO_EDGE,[es]:i.MIRRORED_REPEAT},ae={[Ft]:i.NEAREST,[lr]:i.NEAREST_MIPMAP_NEAREST,[Oi]:i.NEAREST_MIPMAP_LINEAR,[qe]:i.LINEAR,[ts]:i.LINEAR_MIPMAP_NEAREST,[rn]:i.LINEAR_MIPMAP_LINEAR},he={[rE]:i.NEVER,[uE]:i.ALWAYS,[oE]:i.LESS,[jA]:i.LEQUAL,[aE]:i.EQUAL,[hE]:i.GEQUAL,[cE]:i.GREATER,[lE]:i.NOTEQUAL};function ve(B,M){if(M.type===Ot&&e.has("OES_texture_float_linear")===!1&&(M.magFilter===qe||M.magFilter===ts||M.magFilter===Oi||M.magFilter===rn||M.minFilter===qe||M.minFilter===ts||M.minFilter===Oi||M.minFilter===rn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(B,i.TEXTURE_WRAP_S,ee[M.wrapS]),i.texParameteri(B,i.TEXTURE_WRAP_T,ee[M.wrapT]),(B===i.TEXTURE_3D||B===i.TEXTURE_2D_ARRAY)&&i.texParameteri(B,i.TEXTURE_WRAP_R,ee[M.wrapR]),i.texParameteri(B,i.TEXTURE_MAG_FILTER,ae[M.magFilter]),i.texParameteri(B,i.TEXTURE_MIN_FILTER,ae[M.minFilter]),M.compareFunction&&(i.texParameteri(B,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(B,i.TEXTURE_COMPARE_FUNC,he[M.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(M.magFilter===Ft||M.minFilter!==Oi&&M.minFilter!==rn||M.type===Ot&&e.has("OES_texture_float_linear")===!1)return;if(M.anisotropy>1||n.get(M).__currentAnisotropy){let H=e.get("EXT_texture_filter_anisotropic");i.texParameterf(B,H.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,s.getMaxAnisotropy())),n.get(M).__currentAnisotropy=M.anisotropy}}}function Le(B,M){let H=!1;B.__webglInit===void 0&&(B.__webglInit=!0,M.addEventListener("dispose",S));let Z=M.source,ie=d.get(Z);ie===void 0&&(ie={},d.set(Z,ie));let J=U(M);if(J!==B.__cacheKey){ie[J]===void 0&&(ie[J]={texture:i.createTexture(),usedTimes:0},o.memory.textures++,H=!0),ie[J].usedTimes++;let Re=ie[B.__cacheKey];Re!==void 0&&(ie[B.__cacheKey].usedTimes--,Re.usedTimes===0&&v(M)),B.__cacheKey=J,B.__webglTexture=ie[J].texture}return H}function X(B,M,H){let Z=i.TEXTURE_2D;(M.isDataArrayTexture||M.isCompressedArrayTexture)&&(Z=i.TEXTURE_2D_ARRAY),M.isData3DTexture&&(Z=i.TEXTURE_3D);let ie=Le(B,M),J=M.source;t.bindTexture(Z,B.__webglTexture,i.TEXTURE0+H);let Re=n.get(J);if(J.version!==Re.__version||ie===!0){t.activeTexture(i.TEXTURE0+H);let Ae=it.getPrimaries(it.workingColorSpace),Ee=M.colorSpace===Fn?null:it.getPrimaries(M.colorSpace),tt=M.colorSpace===Fn||Ae===Ee?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,M.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,M.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,tt);let ce=g(M.image,!1,s.maxTextureSize);ce=Et(M,ce);let ge=r.convert(M.format,M.colorSpace),Ne=r.convert(M.type),Ge=x(M.internalFormat,ge,Ne,M.colorSpace,M.isVideoTexture);ve(Z,M);let Se,nt=M.mipmaps,We=M.isVideoTexture!==!0,St=Re.__version===void 0||ie===!0,N=J.dataReady,de=_(M,ce);if(M.isDepthTexture)Ge=y(M.format===Oo,M.type),St&&(We?t.texStorage2D(i.TEXTURE_2D,1,Ge,ce.width,ce.height):t.texImage2D(i.TEXTURE_2D,0,Ge,ce.width,ce.height,0,ge,Ne,null));else if(M.isDataTexture)if(nt.length>0){We&&St&&t.texStorage2D(i.TEXTURE_2D,de,Ge,nt[0].width,nt[0].height);for(let $=0,te=nt.length;$<te;$++)Se=nt[$],We?N&&t.texSubImage2D(i.TEXTURE_2D,$,0,0,Se.width,Se.height,ge,Ne,Se.data):t.texImage2D(i.TEXTURE_2D,$,Ge,Se.width,Se.height,0,ge,Ne,Se.data);M.generateMipmaps=!1}else We?(St&&t.texStorage2D(i.TEXTURE_2D,de,Ge,ce.width,ce.height),N&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,ce.width,ce.height,ge,Ne,ce.data)):t.texImage2D(i.TEXTURE_2D,0,Ge,ce.width,ce.height,0,ge,Ne,ce.data);else if(M.isCompressedTexture)if(M.isCompressedArrayTexture){We&&St&&t.texStorage3D(i.TEXTURE_2D_ARRAY,de,Ge,nt[0].width,nt[0].height,ce.depth);for(let $=0,te=nt.length;$<te;$++)if(Se=nt[$],M.format!==vt)if(ge!==null)if(We){if(N)if(M.layerUpdates.size>0){let be=sg(Se.width,Se.height,M.format,M.type);for(let _e of M.layerUpdates){let He=Se.data.subarray(_e*be/Se.data.BYTES_PER_ELEMENT,(_e+1)*be/Se.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,$,0,0,_e,Se.width,Se.height,1,ge,He)}M.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,$,0,0,0,Se.width,Se.height,ce.depth,ge,Se.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,$,Ge,Se.width,Se.height,ce.depth,0,Se.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else We?N&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,$,0,0,0,Se.width,Se.height,ce.depth,ge,Ne,Se.data):t.texImage3D(i.TEXTURE_2D_ARRAY,$,Ge,Se.width,Se.height,ce.depth,0,ge,Ne,Se.data)}else{We&&St&&t.texStorage2D(i.TEXTURE_2D,de,Ge,nt[0].width,nt[0].height);for(let $=0,te=nt.length;$<te;$++)Se=nt[$],M.format!==vt?ge!==null?We?N&&t.compressedTexSubImage2D(i.TEXTURE_2D,$,0,0,Se.width,Se.height,ge,Se.data):t.compressedTexImage2D(i.TEXTURE_2D,$,Ge,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):We?N&&t.texSubImage2D(i.TEXTURE_2D,$,0,0,Se.width,Se.height,ge,Ne,Se.data):t.texImage2D(i.TEXTURE_2D,$,Ge,Se.width,Se.height,0,ge,Ne,Se.data)}else if(M.isDataArrayTexture)if(We){if(St&&t.texStorage3D(i.TEXTURE_2D_ARRAY,de,Ge,ce.width,ce.height,ce.depth),N)if(M.layerUpdates.size>0){let $=sg(ce.width,ce.height,M.format,M.type);for(let te of M.layerUpdates){let be=ce.data.subarray(te*$/ce.data.BYTES_PER_ELEMENT,(te+1)*$/ce.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,te,ce.width,ce.height,1,ge,Ne,be)}M.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,ce.width,ce.height,ce.depth,ge,Ne,ce.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ge,ce.width,ce.height,ce.depth,0,ge,Ne,ce.data);else if(M.isData3DTexture)We?(St&&t.texStorage3D(i.TEXTURE_3D,de,Ge,ce.width,ce.height,ce.depth),N&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,ce.width,ce.height,ce.depth,ge,Ne,ce.data)):t.texImage3D(i.TEXTURE_3D,0,Ge,ce.width,ce.height,ce.depth,0,ge,Ne,ce.data);else if(M.isFramebufferTexture){if(St)if(We)t.texStorage2D(i.TEXTURE_2D,de,Ge,ce.width,ce.height);else{let $=ce.width,te=ce.height;for(let be=0;be<de;be++)t.texImage2D(i.TEXTURE_2D,be,Ge,$,te,0,ge,Ne,null),$>>=1,te>>=1}}else if(nt.length>0){if(We&&St){let $=Ie(nt[0]);t.texStorage2D(i.TEXTURE_2D,de,Ge,$.width,$.height)}for(let $=0,te=nt.length;$<te;$++)Se=nt[$],We?N&&t.texSubImage2D(i.TEXTURE_2D,$,0,0,ge,Ne,Se):t.texImage2D(i.TEXTURE_2D,$,Ge,ge,Ne,Se);M.generateMipmaps=!1}else if(We){if(St){let $=Ie(ce);t.texStorage2D(i.TEXTURE_2D,de,Ge,$.width,$.height)}N&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,ge,Ne,ce)}else t.texImage2D(i.TEXTURE_2D,0,Ge,ge,Ne,ce);A(M)&&m(Z),Re.__version=J.version,M.onUpdate&&M.onUpdate(M)}B.__version=M.version}function se(B,M,H){if(M.image.length!==6)return;let Z=Le(B,M),ie=M.source;t.bindTexture(i.TEXTURE_CUBE_MAP,B.__webglTexture,i.TEXTURE0+H);let J=n.get(ie);if(ie.version!==J.__version||Z===!0){t.activeTexture(i.TEXTURE0+H);let Re=it.getPrimaries(it.workingColorSpace),Ae=M.colorSpace===Fn?null:it.getPrimaries(M.colorSpace),Ee=M.colorSpace===Fn||Re===Ae?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,M.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,M.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ee);let tt=M.isCompressedTexture||M.image[0].isCompressedTexture,ce=M.image[0]&&M.image[0].isDataTexture,ge=[];for(let te=0;te<6;te++)!tt&&!ce?ge[te]=g(M.image[te],!0,s.maxCubemapSize):ge[te]=ce?M.image[te].image:M.image[te],ge[te]=Et(M,ge[te]);let Ne=ge[0],Ge=r.convert(M.format,M.colorSpace),Se=r.convert(M.type),nt=x(M.internalFormat,Ge,Se,M.colorSpace),We=M.isVideoTexture!==!0,St=J.__version===void 0||Z===!0,N=ie.dataReady,de=_(M,Ne);ve(i.TEXTURE_CUBE_MAP,M);let $;if(tt){We&&St&&t.texStorage2D(i.TEXTURE_CUBE_MAP,de,nt,Ne.width,Ne.height);for(let te=0;te<6;te++){$=ge[te].mipmaps;for(let be=0;be<$.length;be++){let _e=$[be];M.format!==vt?Ge!==null?We?N&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be,0,0,_e.width,_e.height,Ge,_e.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be,nt,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):We?N&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be,0,0,_e.width,_e.height,Ge,Se,_e.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be,nt,_e.width,_e.height,0,Ge,Se,_e.data)}}}else{if($=M.mipmaps,We&&St){$.length>0&&de++;let te=Ie(ge[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,de,nt,te.width,te.height)}for(let te=0;te<6;te++)if(ce){We?N&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,ge[te].width,ge[te].height,Ge,Se,ge[te].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,nt,ge[te].width,ge[te].height,0,Ge,Se,ge[te].data);for(let be=0;be<$.length;be++){let He=$[be].image[te].image;We?N&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be+1,0,0,He.width,He.height,Ge,Se,He.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be+1,nt,He.width,He.height,0,Ge,Se,He.data)}}else{We?N&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,Ge,Se,ge[te]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,nt,Ge,Se,ge[te]);for(let be=0;be<$.length;be++){let _e=$[be];We?N&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be+1,0,0,Ge,Se,_e.image[te]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+te,be+1,nt,Ge,Se,_e.image[te])}}}A(M)&&m(i.TEXTURE_CUBE_MAP),J.__version=ie.version,M.onUpdate&&M.onUpdate(M)}B.__version=M.version}function le(B,M,H,Z,ie,J){let Re=r.convert(H.format,H.colorSpace),Ae=r.convert(H.type),Ee=x(H.internalFormat,Re,Ae,H.colorSpace),tt=n.get(M),ce=n.get(H);if(ce.__renderTarget=M,!tt.__hasExternalTextures){let ge=Math.max(1,M.width>>J),Ne=Math.max(1,M.height>>J);ie===i.TEXTURE_3D||ie===i.TEXTURE_2D_ARRAY?t.texImage3D(ie,J,Ee,ge,Ne,M.depth,0,Re,Ae,null):t.texImage2D(ie,J,Ee,ge,Ne,0,Re,Ae,null)}t.bindFramebuffer(i.FRAMEBUFFER,B),ot(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Z,ie,ce.__webglTexture,0,rt(M)):(ie===i.TEXTURE_2D||ie>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&ie<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Z,ie,ce.__webglTexture,J),t.bindFramebuffer(i.FRAMEBUFFER,null)}function pe(B,M,H){if(i.bindRenderbuffer(i.RENDERBUFFER,B),M.depthBuffer){let Z=M.depthTexture,ie=Z&&Z.isDepthTexture?Z.type:null,J=y(M.stencilBuffer,ie),Re=M.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ae=rt(M);ot(M)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ae,J,M.width,M.height):H?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ae,J,M.width,M.height):i.renderbufferStorage(i.RENDERBUFFER,J,M.width,M.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Re,i.RENDERBUFFER,B)}else{let Z=M.textures;for(let ie=0;ie<Z.length;ie++){let J=Z[ie],Re=r.convert(J.format,J.colorSpace),Ae=r.convert(J.type),Ee=x(J.internalFormat,Re,Ae,J.colorSpace),tt=rt(M);H&&ot(M)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,tt,Ee,M.width,M.height):ot(M)?a.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,tt,Ee,M.width,M.height):i.renderbufferStorage(i.RENDERBUFFER,Ee,M.width,M.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function ye(B,M){if(M&&M.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,B),!(M.depthTexture&&M.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let Z=n.get(M.depthTexture);Z.__renderTarget=M,(!Z.__webglTexture||M.depthTexture.image.width!==M.width||M.depthTexture.image.height!==M.height)&&(M.depthTexture.image.width=M.width,M.depthTexture.image.height=M.height,M.depthTexture.needsUpdate=!0),V(M.depthTexture,0);let ie=Z.__webglTexture,J=rt(M);if(M.depthTexture.format===Lo)ot(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,ie,0,J):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,ie,0);else if(M.depthTexture.format===Oo)ot(M)?a.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,ie,0,J):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,ie,0);else throw new Error("Unknown depthTexture format")}function Ue(B){let M=n.get(B),H=B.isWebGLCubeRenderTarget===!0;if(M.__boundDepthTexture!==B.depthTexture){let Z=B.depthTexture;if(M.__depthDisposeCallback&&M.__depthDisposeCallback(),Z){let ie=()=>{delete M.__boundDepthTexture,delete M.__depthDisposeCallback,Z.removeEventListener("dispose",ie)};Z.addEventListener("dispose",ie),M.__depthDisposeCallback=ie}M.__boundDepthTexture=Z}if(B.depthTexture&&!M.__autoAllocateDepthBuffer){if(H)throw new Error("target.depthTexture not supported in Cube render targets");ye(M.__webglFramebuffer,B)}else if(H){M.__webglDepthbuffer=[];for(let Z=0;Z<6;Z++)if(t.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer[Z]),M.__webglDepthbuffer[Z]===void 0)M.__webglDepthbuffer[Z]=i.createRenderbuffer(),pe(M.__webglDepthbuffer[Z],B,!1);else{let ie=B.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,J=M.__webglDepthbuffer[Z];i.bindRenderbuffer(i.RENDERBUFFER,J),i.framebufferRenderbuffer(i.FRAMEBUFFER,ie,i.RENDERBUFFER,J)}}else if(t.bindFramebuffer(i.FRAMEBUFFER,M.__webglFramebuffer),M.__webglDepthbuffer===void 0)M.__webglDepthbuffer=i.createRenderbuffer(),pe(M.__webglDepthbuffer,B,!1);else{let Z=B.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ie=M.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,ie),i.framebufferRenderbuffer(i.FRAMEBUFFER,Z,i.RENDERBUFFER,ie)}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Me(B,M,H){let Z=n.get(B);M!==void 0&&le(Z.__webglFramebuffer,B,B.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),H!==void 0&&Ue(B)}function xt(B){let M=B.texture,H=n.get(B),Z=n.get(M);B.addEventListener("dispose",C);let ie=B.textures,J=B.isWebGLCubeRenderTarget===!0,Re=ie.length>1;if(Re||(Z.__webglTexture===void 0&&(Z.__webglTexture=i.createTexture()),Z.__version=M.version,o.memory.textures++),J){H.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(M.mipmaps&&M.mipmaps.length>0){H.__webglFramebuffer[Ae]=[];for(let Ee=0;Ee<M.mipmaps.length;Ee++)H.__webglFramebuffer[Ae][Ee]=i.createFramebuffer()}else H.__webglFramebuffer[Ae]=i.createFramebuffer()}else{if(M.mipmaps&&M.mipmaps.length>0){H.__webglFramebuffer=[];for(let Ae=0;Ae<M.mipmaps.length;Ae++)H.__webglFramebuffer[Ae]=i.createFramebuffer()}else H.__webglFramebuffer=i.createFramebuffer();if(Re)for(let Ae=0,Ee=ie.length;Ae<Ee;Ae++){let tt=n.get(ie[Ae]);tt.__webglTexture===void 0&&(tt.__webglTexture=i.createTexture(),o.memory.textures++)}if(B.samples>0&&ot(B)===!1){H.__webglMultisampledFramebuffer=i.createFramebuffer(),H.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,H.__webglMultisampledFramebuffer);for(let Ae=0;Ae<ie.length;Ae++){let Ee=ie[Ae];H.__webglColorRenderbuffer[Ae]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,H.__webglColorRenderbuffer[Ae]);let tt=r.convert(Ee.format,Ee.colorSpace),ce=r.convert(Ee.type),ge=x(Ee.internalFormat,tt,ce,Ee.colorSpace,B.isXRRenderTarget===!0),Ne=rt(B);i.renderbufferStorageMultisample(i.RENDERBUFFER,Ne,ge,B.width,B.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ae,i.RENDERBUFFER,H.__webglColorRenderbuffer[Ae])}i.bindRenderbuffer(i.RENDERBUFFER,null),B.depthBuffer&&(H.__webglDepthRenderbuffer=i.createRenderbuffer(),pe(H.__webglDepthRenderbuffer,B,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(J){t.bindTexture(i.TEXTURE_CUBE_MAP,Z.__webglTexture),ve(i.TEXTURE_CUBE_MAP,M);for(let Ae=0;Ae<6;Ae++)if(M.mipmaps&&M.mipmaps.length>0)for(let Ee=0;Ee<M.mipmaps.length;Ee++)le(H.__webglFramebuffer[Ae][Ee],B,M,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,Ee);else le(H.__webglFramebuffer[Ae],B,M,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0);A(M)&&m(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Re){for(let Ae=0,Ee=ie.length;Ae<Ee;Ae++){let tt=ie[Ae],ce=n.get(tt);t.bindTexture(i.TEXTURE_2D,ce.__webglTexture),ve(i.TEXTURE_2D,tt),le(H.__webglFramebuffer,B,tt,i.COLOR_ATTACHMENT0+Ae,i.TEXTURE_2D,0),A(tt)&&m(i.TEXTURE_2D)}t.unbindTexture()}else{let Ae=i.TEXTURE_2D;if((B.isWebGL3DRenderTarget||B.isWebGLArrayRenderTarget)&&(Ae=B.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(Ae,Z.__webglTexture),ve(Ae,M),M.mipmaps&&M.mipmaps.length>0)for(let Ee=0;Ee<M.mipmaps.length;Ee++)le(H.__webglFramebuffer[Ee],B,M,i.COLOR_ATTACHMENT0,Ae,Ee);else le(H.__webglFramebuffer,B,M,i.COLOR_ATTACHMENT0,Ae,0);A(M)&&m(Ae),t.unbindTexture()}B.depthBuffer&&Ue(B)}function $e(B){let M=B.textures;for(let H=0,Z=M.length;H<Z;H++){let ie=M[H];if(A(ie)){let J=b(B),Re=n.get(ie).__webglTexture;t.bindTexture(J,Re),m(J),t.unbindTexture()}}}let pt=[],L=[];function Tn(B){if(B.samples>0){if(ot(B)===!1){let M=B.textures,H=B.width,Z=B.height,ie=i.COLOR_BUFFER_BIT,J=B.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Re=n.get(B),Ae=M.length>1;if(Ae)for(let Ee=0;Ee<M.length;Ee++)t.bindFramebuffer(i.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ee,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Re.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ee,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Re.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Re.__webglFramebuffer);for(let Ee=0;Ee<M.length;Ee++){if(B.resolveDepthBuffer&&(B.depthBuffer&&(ie|=i.DEPTH_BUFFER_BIT),B.stencilBuffer&&B.resolveStencilBuffer&&(ie|=i.STENCIL_BUFFER_BIT)),Ae){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Re.__webglColorRenderbuffer[Ee]);let tt=n.get(M[Ee]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,tt,0)}i.blitFramebuffer(0,0,H,Z,0,0,H,Z,ie,i.NEAREST),c===!0&&(pt.length=0,L.length=0,pt.push(i.COLOR_ATTACHMENT0+Ee),B.depthBuffer&&B.resolveDepthBuffer===!1&&(pt.push(J),L.push(J),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,L)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,pt))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),Ae)for(let Ee=0;Ee<M.length;Ee++){t.bindFramebuffer(i.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ee,i.RENDERBUFFER,Re.__webglColorRenderbuffer[Ee]);let tt=n.get(M[Ee]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Re.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ee,i.TEXTURE_2D,tt,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Re.__webglMultisampledFramebuffer)}else if(B.depthBuffer&&B.resolveDepthBuffer===!1&&c){let M=B.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[M])}}}function rt(B){return Math.min(s.maxSamples,B.samples)}function ot(B){let M=n.get(B);return B.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function Te(B){let M=o.render.frame;h.get(B)!==M&&(h.set(B,M),B.update())}function Et(B,M){let H=B.colorSpace,Z=B.format,ie=B.type;return B.isCompressedTexture===!0||B.isVideoTexture===!0||H!==st&&H!==Fn&&(it.getTransfer(H)===It?(Z!==vt||ie!==kt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",H)),M}function Ie(B){return typeof HTMLImageElement<"u"&&B instanceof HTMLImageElement?(l.width=B.naturalWidth||B.width,l.height=B.naturalHeight||B.height):typeof VideoFrame<"u"&&B instanceof VideoFrame?(l.width=B.displayWidth,l.height=B.displayHeight):(l.width=B.width,l.height=B.height),l}this.allocateTextureUnit=P,this.resetTextureUnits=F,this.setTexture2D=V,this.setTexture2DArray=O,this.setTexture3D=K,this.setTextureCube=z,this.rebindTextures=Me,this.setupRenderTarget=xt,this.updateRenderTargetMipmap=$e,this.updateMultisampleRenderTarget=Tn,this.setupDepthRenderbuffer=Ue,this.setupFrameBufferTexture=le,this.useMultisampledRTT=ot}function eN(i,e){function t(n,s=Fn){let r,o=it.getTransfer(s);if(n===kt)return i.UNSIGNED_BYTE;if(n===gf)return i.UNSIGNED_SHORT_4_4_4_4;if(n===yf)return i.UNSIGNED_SHORT_5_5_5_1;if(n===HA)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===Mh)return i.BYTE;if(n===Th)return i.SHORT;if(n===_c)return i.UNSIGNED_SHORT;if(n===vc)return i.INT;if(n===Cs)return i.UNSIGNED_INT;if(n===Ot)return i.FLOAT;if(n===Lt)return i.HALF_FLOAT;if(n===VA)return i.ALPHA;if(n===WA)return i.RGB;if(n===vt)return i.RGBA;if(n===qA)return i.LUMINANCE;if(n===KA)return i.LUMINANCE_ALPHA;if(n===Lo)return i.DEPTH_COMPONENT;if(n===Oo)return i.DEPTH_STENCIL;if(n===Ms)return i.RED;if(n===bf)return i.RED_INTEGER;if(n===hr)return i.RG;if(n===xf)return i.RG_INTEGER;if(n===_f)return i.RGBA_INTEGER;if(n===Ih||n===$o||n===Rh||n===Xo)if(o===It)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Ih)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===$o)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Rh)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Xo)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Ih)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===$o)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Rh)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Xo)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Ec||n===vf||n===Sc||n===Ef)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Ec)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===vf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Sc)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Ef)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===wc||n===Cc||n===Mc)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===wc||n===Cc)return o===It?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Mc)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Yo||n===Sf||n===wf||n===Cf||n===jo||n===Mf||n===Tf||n===If||n===Rf||n===Bf||n===Df||n===Lf||n===Pf||n===Ff)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Yo)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Sf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===wf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Cf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===jo)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Mf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Tf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===If)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Rf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Bf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Df)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Lf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Pf)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ff)return o===It?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Jo||n===Of||n===Tc)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===Jo)return o===It?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Of)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Tc)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===$A||n===Nf||n===Uf||n===kf)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===Jo)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Nf)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Uf)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===kf)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ko?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}function rN(i,e){function t(A,m){A.matrixAutoUpdate===!0&&A.updateMatrix(),m.value.copy(A.matrix)}function n(A,m){m.color.getRGB(A.fogColor.value,tg(i)),m.isFog?(A.fogNear.value=m.near,A.fogFar.value=m.far):m.isFogExp2&&(A.fogDensity.value=m.density)}function s(A,m,b,x,y){m.isMeshBasicMaterial||m.isMeshLambertMaterial?r(A,m):m.isMeshToonMaterial?(r(A,m),u(A,m)):m.isMeshPhongMaterial?(r(A,m),h(A,m)):m.isMeshStandardMaterial?(r(A,m),d(A,m),m.isMeshPhysicalMaterial&&f(A,m,y)):m.isMeshMatcapMaterial?(r(A,m),p(A,m)):m.isMeshDepthMaterial?r(A,m):m.isMeshDistanceMaterial?(r(A,m),g(A,m)):m.isMeshNormalMaterial?r(A,m):m.isLineBasicMaterial?(o(A,m),m.isLineDashedMaterial&&a(A,m)):m.isPointsMaterial?c(A,m,b,x):m.isSpriteMaterial?l(A,m):m.isShadowMaterial?(A.color.value.copy(m.color),A.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function r(A,m){A.opacity.value=m.opacity,m.color&&A.diffuse.value.copy(m.color),m.emissive&&A.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(A.map.value=m.map,t(m.map,A.mapTransform)),m.alphaMap&&(A.alphaMap.value=m.alphaMap,t(m.alphaMap,A.alphaMapTransform)),m.bumpMap&&(A.bumpMap.value=m.bumpMap,t(m.bumpMap,A.bumpMapTransform),A.bumpScale.value=m.bumpScale,m.side===en&&(A.bumpScale.value*=-1)),m.normalMap&&(A.normalMap.value=m.normalMap,t(m.normalMap,A.normalMapTransform),A.normalScale.value.copy(m.normalScale),m.side===en&&A.normalScale.value.negate()),m.displacementMap&&(A.displacementMap.value=m.displacementMap,t(m.displacementMap,A.displacementMapTransform),A.displacementScale.value=m.displacementScale,A.displacementBias.value=m.displacementBias),m.emissiveMap&&(A.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,A.emissiveMapTransform)),m.specularMap&&(A.specularMap.value=m.specularMap,t(m.specularMap,A.specularMapTransform)),m.alphaTest>0&&(A.alphaTest.value=m.alphaTest);let b=e.get(m),x=b.envMap,y=b.envMapRotation;x&&(A.envMap.value=x,sa.copy(y),sa.x*=-1,sa.y*=-1,sa.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(sa.y*=-1,sa.z*=-1),A.envMapRotation.value.setFromMatrix4(sN.makeRotationFromEuler(sa)),A.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,A.reflectivity.value=m.reflectivity,A.ior.value=m.ior,A.refractionRatio.value=m.refractionRatio),m.lightMap&&(A.lightMap.value=m.lightMap,A.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,A.lightMapTransform)),m.aoMap&&(A.aoMap.value=m.aoMap,A.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,A.aoMapTransform))}function o(A,m){A.diffuse.value.copy(m.color),A.opacity.value=m.opacity,m.map&&(A.map.value=m.map,t(m.map,A.mapTransform))}function a(A,m){A.dashSize.value=m.dashSize,A.totalSize.value=m.dashSize+m.gapSize,A.scale.value=m.scale}function c(A,m,b,x){A.diffuse.value.copy(m.color),A.opacity.value=m.opacity,A.size.value=m.size*b,A.scale.value=x*.5,m.map&&(A.map.value=m.map,t(m.map,A.uvTransform)),m.alphaMap&&(A.alphaMap.value=m.alphaMap,t(m.alphaMap,A.alphaMapTransform)),m.alphaTest>0&&(A.alphaTest.value=m.alphaTest)}function l(A,m){A.diffuse.value.copy(m.color),A.opacity.value=m.opacity,A.rotation.value=m.rotation,m.map&&(A.map.value=m.map,t(m.map,A.mapTransform)),m.alphaMap&&(A.alphaMap.value=m.alphaMap,t(m.alphaMap,A.alphaMapTransform)),m.alphaTest>0&&(A.alphaTest.value=m.alphaTest)}function h(A,m){A.specular.value.copy(m.specular),A.shininess.value=Math.max(m.shininess,1e-4)}function u(A,m){m.gradientMap&&(A.gradientMap.value=m.gradientMap)}function d(A,m){A.metalness.value=m.metalness,m.metalnessMap&&(A.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,A.metalnessMapTransform)),A.roughness.value=m.roughness,m.roughnessMap&&(A.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,A.roughnessMapTransform)),m.envMap&&(A.envMapIntensity.value=m.envMapIntensity)}function f(A,m,b){A.ior.value=m.ior,m.sheen>0&&(A.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),A.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(A.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,A.sheenColorMapTransform)),m.sheenRoughnessMap&&(A.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,A.sheenRoughnessMapTransform))),m.clearcoat>0&&(A.clearcoat.value=m.clearcoat,A.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(A.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,A.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(A.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,A.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(A.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,A.clearcoatNormalMapTransform),A.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===en&&A.clearcoatNormalScale.value.negate())),m.dispersion>0&&(A.dispersion.value=m.dispersion),m.iridescence>0&&(A.iridescence.value=m.iridescence,A.iridescenceIOR.value=m.iridescenceIOR,A.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],A.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(A.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,A.iridescenceMapTransform)),m.iridescenceThicknessMap&&(A.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,A.iridescenceThicknessMapTransform))),m.transmission>0&&(A.transmission.value=m.transmission,A.transmissionSamplerMap.value=b.texture,A.transmissionSamplerSize.value.set(b.width,b.height),m.transmissionMap&&(A.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,A.transmissionMapTransform)),A.thickness.value=m.thickness,m.thicknessMap&&(A.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,A.thicknessMapTransform)),A.attenuationDistance.value=m.attenuationDistance,A.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(A.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(A.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,A.anisotropyMapTransform))),A.specularIntensity.value=m.specularIntensity,A.specularColor.value.copy(m.specularColor),m.specularColorMap&&(A.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,A.specularColorMapTransform)),m.specularIntensityMap&&(A.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,A.specularIntensityMapTransform))}function p(A,m){m.matcap&&(A.matcap.value=m.matcap)}function g(A,m){let b=e.get(m).light;A.referencePosition.value.setFromMatrixPosition(b.matrixWorld),A.nearDistance.value=b.shadow.camera.near,A.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function oN(i,e,t,n){let s={},r={},o=[],a=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function c(b,x){let y=x.program;n.uniformBlockBinding(b,y)}function l(b,x){let y=s[b.id];y===void 0&&(p(b),y=h(b),s[b.id]=y,b.addEventListener("dispose",A));let _=x.program;n.updateUBOMapping(b,_);let S=e.render.frame;r[b.id]!==S&&(d(b),r[b.id]=S)}function h(b){let x=u();b.__bindingPointIndex=x;let y=i.createBuffer(),_=b.__size,S=b.usage;return i.bindBuffer(i.UNIFORM_BUFFER,y),i.bufferData(i.UNIFORM_BUFFER,_,S),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,x,y),y}function u(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(b){let x=s[b.id],y=b.uniforms,_=b.__cache;i.bindBuffer(i.UNIFORM_BUFFER,x);for(let S=0,C=y.length;S<C;S++){let w=Array.isArray(y[S])?y[S]:[y[S]];for(let v=0,E=w.length;v<E;v++){let R=w[v];if(f(R,S,v,_)===!0){let F=R.__offset,P=Array.isArray(R.value)?R.value:[R.value],U=0;for(let V=0;V<P.length;V++){let O=P[V],K=g(O);typeof O=="number"||typeof O=="boolean"?(R.__data[0]=O,i.bufferSubData(i.UNIFORM_BUFFER,F+U,R.__data)):O.isMatrix3?(R.__data[0]=O.elements[0],R.__data[1]=O.elements[1],R.__data[2]=O.elements[2],R.__data[3]=0,R.__data[4]=O.elements[3],R.__data[5]=O.elements[4],R.__data[6]=O.elements[5],R.__data[7]=0,R.__data[8]=O.elements[6],R.__data[9]=O.elements[7],R.__data[10]=O.elements[8],R.__data[11]=0):(O.toArray(R.__data,U),U+=K.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,F,R.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function f(b,x,y,_){let S=b.value,C=x+"_"+y;if(_[C]===void 0)return typeof S=="number"||typeof S=="boolean"?_[C]=S:_[C]=S.clone(),!0;{let w=_[C];if(typeof S=="number"||typeof S=="boolean"){if(w!==S)return _[C]=S,!0}else if(w.equals(S)===!1)return w.copy(S),!0}return!1}function p(b){let x=b.uniforms,y=0,_=16;for(let C=0,w=x.length;C<w;C++){let v=Array.isArray(x[C])?x[C]:[x[C]];for(let E=0,R=v.length;E<R;E++){let F=v[E],P=Array.isArray(F.value)?F.value:[F.value];for(let U=0,V=P.length;U<V;U++){let O=P[U],K=g(O),z=y%_,ee=z%K.boundary,ae=z+ee;y+=ee,ae!==0&&_-ae<K.storage&&(y+=_-ae),F.__data=new Float32Array(K.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=y,y+=K.storage}}}let S=y%_;return S>0&&(y+=_-S),b.__size=y,b.__cache={},this}function g(b){let x={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(x.boundary=4,x.storage=4):b.isVector2?(x.boundary=8,x.storage=8):b.isVector3||b.isColor?(x.boundary=16,x.storage=12):b.isVector4?(x.boundary=16,x.storage=16):b.isMatrix3?(x.boundary=48,x.storage=48):b.isMatrix4?(x.boundary=64,x.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),x}function A(b){let x=b.target;x.removeEventListener("dispose",A);let y=o.indexOf(x.__bindingPointIndex);o.splice(y,1),i.deleteBuffer(s[x.id]),delete s[x.id],delete r[x.id]}function m(){for(let b in s)i.deleteBuffer(s[b]);o=[],s={},r={}}return{bind:c,update:l,dispose:m}}var PL,FL,OL,NL,UL,kL,GL,QL,zL,HL,VL,WL,qL,KL,$L,XL,YL,jL,JL,ZL,eP,tP,nP,iP,sP,rP,oP,aP,cP,lP,hP,uP,dP,fP,pP,mP,AP,gP,yP,bP,xP,_P,vP,EP,SP,wP,CP,MP,TP,IP,RP,BP,DP,LP,PP,FP,OP,NP,UP,kP,GP,QP,zP,HP,VP,WP,qP,KP,$P,XP,YP,jP,JP,ZP,e2,t2,n2,i2,s2,r2,o2,a2,c2,l2,h2,u2,d2,f2,p2,m2,A2,g2,y2,b2,x2,_2,v2,E2,S2,w2,C2,M2,T2,I2,R2,B2,D2,L2,P2,F2,O2,N2,U2,k2,G2,Q2,z2,H2,V2,W2,q2,K2,$2,X2,Y2,j2,J2,Z2,eF,tF,nF,iF,sF,rF,oF,aF,cF,lF,hF,uF,dF,et,me,Ts,Qf,ia,fF,Dc,xE,oa,og,_E,ag,cg,lg,hg,ra,Bc,vE,Vf,VE,CE,WE,qE,KE,ME,TE,IE,RE,BE,dg,fg,pg,ug,Lc,AO,gO,PE,Hf,CO,MO,IO,NO,Ag,gg,VO,$O,XO,jO,tN,Lh,nN,iN,yg,bg,sa,sN,Jr,Xe=oe(()=>{rg();rg();PL=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,FL=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,OL=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,NL=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,UL=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,kL=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,GL=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,QL=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,zL=`#ifdef USE_BATCHING
	#if ! defined( GL_ANGLE_multi_draw )
	#define gl_DrawID _gl_DrawID
	uniform int _gl_DrawID;
	#endif
	uniform highp sampler2D batchingTexture;
	uniform highp usampler2D batchingIdTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
	float getIndirectIndex( const in int i ) {
		int size = textureSize( batchingIdTexture, 0 ).x;
		int x = i % size;
		int y = i / size;
		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,HL=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,VL=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,WL=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,qL=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,KL=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,$L=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,XL=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,YL=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,jL=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,JL=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,ZL=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,eP=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,tP=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,nP=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
	vColor.xyz *= batchingColor.xyz;
#endif`,iP=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,sP=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,rP=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,oP=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,aP=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,cP=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
		emissiveColor = sRGBTransferEOTF( emissiveColor );
	#endif
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,lP=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,hP="gl_FragColor = linearToOutputTexel( gl_FragColor );",uP=`vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,dP=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,fP=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,pP=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,mP=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,AP=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,gP=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,yP=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,bP=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,xP=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,_P=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,vP=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,EP=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,SP=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,wP=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,CP=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,MP=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,TP=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,IP=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,RP=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,BP=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,DP=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,LP=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,PP=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,FP=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`,OP=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,NP=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,UP=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,kP=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,GP=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,QP=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,zP=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,HP=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,VP=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,WP=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,qP=`#ifdef USE_INSTANCING_MORPH
	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
	}
#endif`,KP=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,$P=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,XP=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,YP=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,jP=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,JP=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,ZP=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,e2=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,t2=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,n2=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,i2=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,s2=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,r2=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,o2=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,a2=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,c2=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
	if( v <= 0.0 )
		return vec4( 0., 0., 0., 0. );
	if( v >= 1.0 )
		return vec4( 1., 1., 1., 1. );
	float vuf;
	float af = modf( v * PackFactors.a, vuf );
	float bf = modf( vuf * ShiftRight8, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
	if( v <= 0.0 )
		return vec3( 0., 0., 0. );
	if( v >= 1.0 )
		return vec3( 1., 1., 1. );
	float vuf;
	float bf = modf( v * PackFactors.b, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
	if( v <= 0.0 )
		return vec2( 0., 0. );
	if( v >= 1.0 )
		return vec2( 1., 1. );
	float vuf;
	float gf = modf( v * 256., vuf );
	return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
	return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( const in vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,l2=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,h2=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,u2=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,d2=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,f2=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,p2=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,m2=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
#endif`,A2=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,g2=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,y2=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,b2=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,x2=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,_2=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,v2=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,E2=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,S2=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,w2=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,C2=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,M2=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,T2=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		#else
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,I2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,R2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,B2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,D2=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`,L2=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,P2=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,F2=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,O2=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,N2=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,U2=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,k2=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,G2=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#elif DEPTH_PACKING == 3202
		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
	#elif DEPTH_PACKING == 3203
		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
	#endif
}`,Q2=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,z2=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,H2=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,V2=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,W2=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,q2=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,K2=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,$2=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,X2=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Y2=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,j2=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,J2=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Z2=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,eF=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,tF=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,nF=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,iF=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,sF=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,rF=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,oF=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,aF=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,cF=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,lF=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,hF=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,uF=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix[ 3 ];
	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,dF=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,et={alphahash_fragment:PL,alphahash_pars_fragment:FL,alphamap_fragment:OL,alphamap_pars_fragment:NL,alphatest_fragment:UL,alphatest_pars_fragment:kL,aomap_fragment:GL,aomap_pars_fragment:QL,batching_pars_vertex:zL,batching_vertex:HL,begin_vertex:VL,beginnormal_vertex:WL,bsdfs:qL,iridescence_fragment:KL,bumpmap_pars_fragment:$L,clipping_planes_fragment:XL,clipping_planes_pars_fragment:YL,clipping_planes_pars_vertex:jL,clipping_planes_vertex:JL,color_fragment:ZL,color_pars_fragment:eP,color_pars_vertex:tP,color_vertex:nP,common:iP,cube_uv_reflection_fragment:sP,defaultnormal_vertex:rP,displacementmap_pars_vertex:oP,displacementmap_vertex:aP,emissivemap_fragment:cP,emissivemap_pars_fragment:lP,colorspace_fragment:hP,colorspace_pars_fragment:uP,envmap_fragment:dP,envmap_common_pars_fragment:fP,envmap_pars_fragment:pP,envmap_pars_vertex:mP,envmap_physical_pars_fragment:CP,envmap_vertex:AP,fog_vertex:gP,fog_pars_vertex:yP,fog_fragment:bP,fog_pars_fragment:xP,gradientmap_pars_fragment:_P,lightmap_pars_fragment:vP,lights_lambert_fragment:EP,lights_lambert_pars_fragment:SP,lights_pars_begin:wP,lights_toon_fragment:MP,lights_toon_pars_fragment:TP,lights_phong_fragment:IP,lights_phong_pars_fragment:RP,lights_physical_fragment:BP,lights_physical_pars_fragment:DP,lights_fragment_begin:LP,lights_fragment_maps:PP,lights_fragment_end:FP,logdepthbuf_fragment:OP,logdepthbuf_pars_fragment:NP,logdepthbuf_pars_vertex:UP,logdepthbuf_vertex:kP,map_fragment:GP,map_pars_fragment:QP,map_particle_fragment:zP,map_particle_pars_fragment:HP,metalnessmap_fragment:VP,metalnessmap_pars_fragment:WP,morphinstance_vertex:qP,morphcolor_vertex:KP,morphnormal_vertex:$P,morphtarget_pars_vertex:XP,morphtarget_vertex:YP,normal_fragment_begin:jP,normal_fragment_maps:JP,normal_pars_fragment:ZP,normal_pars_vertex:e2,normal_vertex:t2,normalmap_pars_fragment:n2,clearcoat_normal_fragment_begin:i2,clearcoat_normal_fragment_maps:s2,clearcoat_pars_fragment:r2,iridescence_pars_fragment:o2,opaque_fragment:a2,packing:c2,premultiplied_alpha_fragment:l2,project_vertex:h2,dithering_fragment:u2,dithering_pars_fragment:d2,roughnessmap_fragment:f2,roughnessmap_pars_fragment:p2,shadowmap_pars_fragment:m2,shadowmap_pars_vertex:A2,shadowmap_vertex:g2,shadowmask_pars_fragment:y2,skinbase_vertex:b2,skinning_pars_vertex:x2,skinning_vertex:_2,skinnormal_vertex:v2,specularmap_fragment:E2,specularmap_pars_fragment:S2,tonemapping_fragment:w2,tonemapping_pars_fragment:C2,transmission_fragment:M2,transmission_pars_fragment:T2,uv_pars_fragment:I2,uv_pars_vertex:R2,uv_vertex:B2,worldpos_vertex:D2,background_vert:L2,background_frag:P2,backgroundCube_vert:F2,backgroundCube_frag:O2,cube_vert:N2,cube_frag:U2,depth_vert:k2,depth_frag:G2,distanceRGBA_vert:Q2,distanceRGBA_frag:z2,equirect_vert:H2,equirect_frag:V2,linedashed_vert:W2,linedashed_frag:q2,meshbasic_vert:K2,meshbasic_frag:$2,meshlambert_vert:X2,meshlambert_frag:Y2,meshmatcap_vert:j2,meshmatcap_frag:J2,meshnormal_vert:Z2,meshnormal_frag:eF,meshphong_vert:tF,meshphong_frag:nF,meshphysical_vert:iF,meshphysical_frag:sF,meshtoon_vert:rF,meshtoon_frag:oF,points_vert:aF,points_frag:cF,shadow_vert:lF,shadow_frag:hF,sprite_vert:uF,sprite_frag:dF},me={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Qe}},envmap:{envMap:{value:null},envMapRotation:{value:new Qe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Qe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Qe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Qe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Qe},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Qe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Qe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Qe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Qe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0},uvTransform:{value:new Qe}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Qe},alphaMap:{value:null},alphaMapTransform:{value:new Qe},alphaTest:{value:0}}},Ts={basic:{uniforms:On([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:On([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.fog,me.lights,{emissive:{value:new Ce(0)}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:On([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.fog,me.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:On([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:On([me.common,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new Ce(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:On([me.common,me.bumpmap,me.normalmap,me.displacementmap,me.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:On([me.points,me.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:On([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:On([me.common,me.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:On([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:On([me.sprite,me.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new Qe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Qe}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distanceRGBA:{uniforms:On([me.common,me.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distanceRGBA_vert,fragmentShader:et.distanceRGBA_frag},shadow:{uniforms:On([me.lights,me.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};Ts.physical={uniforms:On([Ts.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Qe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Qe},clearcoatNormalScale:{value:new Fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Qe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Qe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Qe},sheen:{value:0},sheenColor:{value:new Ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Qe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Qe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Qe},transmissionSamplerSize:{value:new Fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Qe},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)},specularColor:{value:new Ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Qe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Qe},anisotropyVector:{value:new Fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Qe}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};Qf={r:0,b:0,g:0},ia=new Kn,fF=new Oe;Dc=4,xE=[.125,.215,.35,.446,.526,.582],oa=20,og=new yi,_E=new Ce,ag=null,cg=0,lg=0,hg=!1,ra=(1+Math.sqrt(5))/2,Bc=1/ra,vE=[new D(-ra,Bc,0),new D(ra,Bc,0),new D(-Bc,0,ra),new D(Bc,0,ra),new D(0,ra,-Bc),new D(0,ra,Bc),new D(-1,1,-1),new D(1,1,-1),new D(-1,1,1),new D(1,1,1)],Vf=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100){ag=this._renderer.getRenderTarget(),cg=this._renderer.getActiveCubeFace(),lg=this._renderer.getActiveMipmapLevel(),hg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,n,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=wE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=SE(),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(ag,cg,lg),this._renderer.xr.enabled=hg,e.scissorTest=!1,zf(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Yr||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),ag=this._renderer.getRenderTarget(),cg=this._renderer.getActiveCubeFace(),lg=this._renderer.getActiveMipmapLevel(),hg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:qe,minFilter:qe,generateMipmaps:!1,type:Lt,format:vt,colorSpace:st,depthBuffer:!1},s=EE(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=EE(e,t,n);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=xF(r)),this._blurMaterial=_F(r,e,t)}return s}_compileMaterial(e){let t=new Ke(this._lodPlanes[0],e);this._renderer.compile(t,og)}_sceneToCubeUV(e,t,n,s){let a=new Kt(90,1,t,n),c=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor(_E),h.toneMapping=xi,h.autoClear=!1;let f=new Jt({name:"PMREM.Background",side:en,depthWrite:!1,depthTest:!1}),p=new Ke(new ii,f),g=!1,A=e.background;A?A.isColor&&(f.color.copy(A),e.background=null,g=!0):(f.color.copy(_E),g=!0);for(let m=0;m<6;m++){let b=m%3;b===0?(a.up.set(0,c[m],0),a.lookAt(l[m],0,0)):b===1?(a.up.set(0,0,c[m]),a.lookAt(0,l[m],0)):(a.up.set(0,c[m],0),a.lookAt(0,0,l[m]));let x=this._cubeSize;zf(s,b*x,m>2?x:0,x,x),h.setRenderTarget(s),g&&h.render(p,a),h.render(e,a)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=A}_textureToCubeUV(e,t){let n=this._renderer,s=e.mapping===Yr||e.mapping===qo;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=wE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=SE());let r=s?this._cubemapMaterial:this._equirectMaterial,o=new Ke(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;let c=this._cubeSize;zf(t,0,0,3*c,2*c),n.setRenderTarget(t),n.render(o,og)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let s=this._lodPlanes.length;for(let r=1;r<s;r++){let o=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),a=vE[(s-r-1)%vE.length];this._blur(e,r-1,r,o,a)}t.autoClear=n}_blur(e,t,n,s,r){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,s,"latitudinal",r),this._halfBlur(o,e,n,n,s,"longitudinal",r)}_halfBlur(e,t,n,s,r,o,a){let c=this._renderer,l=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,u=new Ke(this._lodPlanes[s],l),d=l.uniforms,f=this._sizeLods[n]-1,p=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*oa-1),g=r/p,A=isFinite(r)?1+Math.floor(h*g):oa;A>oa&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${oa}`);let m=[],b=0;for(let C=0;C<oa;++C){let w=C/g,v=Math.exp(-w*w/2);m.push(v),C===0?b+=v:C<A&&(b+=2*v)}for(let C=0;C<m.length;C++)m[C]=m[C]/b;d.envMap.value=e.texture,d.samples.value=A,d.weights.value=m,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a);let{_lodMax:x}=this;d.dTheta.value=p,d.mipInt.value=x-n;let y=this._sizeLods[s],_=3*y*(s>x-Dc?s-x+Dc:0),S=4*(this._cubeSize-y);zf(t,_,S,3*y,2*y),c.setRenderTarget(t),c.render(u,og)}};VE=new bt,CE=new mh(1,1),WE=new th,qE=new hc,KE=new rh,ME=[],TE=[],IE=new Float32Array(16),RE=new Float32Array(9),BE=new Float32Array(4);dg=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=$F(t.type)}},fg=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=pO(t.type)}},pg=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let s=this.seq;for(let r=0,o=s.length;r!==o;++r){let a=s[r];a.setValue(e,t[a.id],n)}}},ug=/(\w+)(\])?(\[|\.)?/g;Lc=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<n;++s){let r=e.getActiveUniform(t,s),o=e.getUniformLocation(t,r.name);mO(r,o,this)}}setValue(e,t,n,s){let r=this.map[t];r!==void 0&&r.setValue(e,n,s)}setOptional(e,t,n){let s=t[n];s!==void 0&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let r=0,o=t.length;r!==o;++r){let a=t[r],c=n[a.id];c.needsUpdate!==!1&&a.setValue(e,c.value,s)}}static seqWithValue(e,t){let n=[];for(let s=0,r=e.length;s!==r;++s){let o=e[s];o.id in t&&n.push(o)}return n}};AO=37297,gO=0;PE=new Qe;Hf=new D;CO=/^[ \t]*#include +<([\w\d./]+)>/gm;MO=new Map;IO=/#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;NO=0,Ag=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new gg(e),t.set(e,n)),n}},gg=class{constructor(e){this.id=NO++,this.code=e,this.usedTimes=0}};VO=0;$O=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,XO=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;jO={[nf]:sf,[rf]:cf,[of]:lf,[Fo]:af,[sf]:nf,[cf]:rf,[lf]:of,[af]:Fo};tN={type:"move"},Lh=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new si,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 si,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new si,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),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){let t=this._hand;if(t)for(let 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 s=null,r=null,o=null,a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){o=!0;for(let g of e.hand.values()){let A=t.getJointPose(g,n),m=this._getHandJoint(l,g);A!==null&&(m.matrix.fromArray(A.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=A.radius),m.visible=A!==null}let h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,p=.005;l.inputState.pinching&&d>f+p?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=f-p&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),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));a!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(tN)))}return a!==null&&(a.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new si;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},nN=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,iN=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`,yg=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){let s=new bt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new sn({vertexShader:nN,fragmentShader:iN,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ke(new ri(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},bg=class extends xn{constructor(e,t){super();let n=this,s=null,r=1,o=null,a="local-floor",c=1,l=null,h=null,u=null,d=null,f=null,p=null,g=new yg,A=t.getContextAttributes(),m=null,b=null,x=[],y=[],_=new Fe,S=null,C=new Kt;C.viewport=new _t;let w=new Kt;w.viewport=new _t;let v=[C,w],E=new Zd,R=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let se=x[X];return se===void 0&&(se=new Lh,x[X]=se),se.getTargetRaySpace()},this.getControllerGrip=function(X){let se=x[X];return se===void 0&&(se=new Lh,x[X]=se),se.getGripSpace()},this.getHand=function(X){let se=x[X];return se===void 0&&(se=new Lh,x[X]=se),se.getHandSpace()};function P(X){let se=y.indexOf(X.inputSource);if(se===-1)return;let le=x[se];le!==void 0&&(le.update(X.inputSource,X.frame,l||o),le.dispatchEvent({type:X.type,data:X.inputSource}))}function U(){s.removeEventListener("select",P),s.removeEventListener("selectstart",P),s.removeEventListener("selectend",P),s.removeEventListener("squeeze",P),s.removeEventListener("squeezestart",P),s.removeEventListener("squeezeend",P),s.removeEventListener("end",U),s.removeEventListener("inputsourceschange",V);for(let X=0;X<x.length;X++){let se=y[X];se!==null&&(y[X]=null,x[X].disconnect(se))}R=null,F=null,g.reset(),e.setRenderTarget(m),f=null,d=null,u=null,s=null,b=null,Le.stop(),n.isPresenting=!1,e.setPixelRatio(S),e.setSize(_.width,_.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){r=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){a=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(X){l=X},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return p},this.getSession=function(){return s},this.setSession=async function(X){if(s=X,s!==null){if(m=e.getRenderTarget(),s.addEventListener("select",P),s.addEventListener("selectstart",P),s.addEventListener("selectend",P),s.addEventListener("squeeze",P),s.addEventListener("squeezestart",P),s.addEventListener("squeezeend",P),s.addEventListener("end",U),s.addEventListener("inputsourceschange",V),A.xrCompatible!==!0&&await t.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(_),s.enabledFeatures!==void 0&&s.enabledFeatures.includes("layers")){let le=null,pe=null,ye=null;A.depth&&(ye=A.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,le=A.stencil?Oo:Lo,pe=A.stencil?Ko:Cs);let Ue={colorFormat:t.RGBA8,depthFormat:ye,scaleFactor:r};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(Ue),s.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),b=new _n(d.textureWidth,d.textureHeight,{format:vt,type:kt,depthTexture:new mh(d.textureWidth,d.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,le),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}else{let le={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(s,t,le),s.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),b=new _n(f.framebufferWidth,f.framebufferHeight,{format:vt,type:kt,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil})}b.isXRRenderTarget=!0,this.setFoveation(c),l=null,o=await s.requestReferenceSpace(a),Le.setContext(s),Le.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function V(X){for(let se=0;se<X.removed.length;se++){let le=X.removed[se],pe=y.indexOf(le);pe>=0&&(y[pe]=null,x[pe].disconnect(le))}for(let se=0;se<X.added.length;se++){let le=X.added[se],pe=y.indexOf(le);if(pe===-1){for(let Ue=0;Ue<x.length;Ue++)if(Ue>=y.length){y.push(le),pe=Ue;break}else if(y[Ue]===null){y[Ue]=le,pe=Ue;break}if(pe===-1)break}let ye=x[pe];ye&&ye.connect(le)}}let O=new D,K=new D;function z(X,se,le){O.setFromMatrixPosition(se.matrixWorld),K.setFromMatrixPosition(le.matrixWorld);let pe=O.distanceTo(K),ye=se.projectionMatrix.elements,Ue=le.projectionMatrix.elements,Me=ye[14]/(ye[10]-1),xt=ye[14]/(ye[10]+1),$e=(ye[9]+1)/ye[5],pt=(ye[9]-1)/ye[5],L=(ye[8]-1)/ye[0],Tn=(Ue[8]+1)/Ue[0],rt=Me*L,ot=Me*Tn,Te=pe/(-L+Tn),Et=Te*-L;if(se.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(Et),X.translateZ(Te),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert(),ye[10]===-1)X.projectionMatrix.copy(se.projectionMatrix),X.projectionMatrixInverse.copy(se.projectionMatrixInverse);else{let Ie=Me+Te,B=xt+Te,M=rt-Et,H=ot+(pe-Et),Z=$e*xt/B*Ie,ie=pt*xt/B*Ie;X.projectionMatrix.makePerspective(M,H,Z,ie,Ie,B),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}}function ee(X,se){se===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(se.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(s===null)return;let se=X.near,le=X.far;g.texture!==null&&(g.depthNear>0&&(se=g.depthNear),g.depthFar>0&&(le=g.depthFar)),E.near=w.near=C.near=se,E.far=w.far=C.far=le,(R!==E.near||F!==E.far)&&(s.updateRenderState({depthNear:E.near,depthFar:E.far}),R=E.near,F=E.far),C.layers.mask=X.layers.mask|2,w.layers.mask=X.layers.mask|4,E.layers.mask=C.layers.mask|w.layers.mask;let pe=X.parent,ye=E.cameras;ee(E,pe);for(let Ue=0;Ue<ye.length;Ue++)ee(ye[Ue],pe);ye.length===2?z(E,C,w):E.projectionMatrix.copy(C.projectionMatrix),ae(X,E,pe)};function ae(X,se,le){le===null?X.matrix.copy(se.matrixWorld):(X.matrix.copy(le.matrixWorld),X.matrix.invert(),X.matrix.multiply(se.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(se.projectionMatrix),X.projectionMatrixInverse.copy(se.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=No*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return E},this.getFoveation=function(){if(!(d===null&&f===null))return c},this.setFoveation=function(X){c=X,d!==null&&(d.fixedFoveation=X),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=X)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(E)};let he=null;function ve(X,se){if(h=se.getViewerPose(l||o),p=se,h!==null){let le=h.views;f!==null&&(e.setRenderTargetFramebuffer(b,f.framebuffer),e.setRenderTarget(b));let pe=!1;le.length!==E.cameras.length&&(E.cameras.length=0,pe=!0);for(let Ue=0;Ue<le.length;Ue++){let Me=le[Ue],xt=null;if(f!==null)xt=f.getViewport(Me);else{let pt=u.getViewSubImage(d,Me);xt=pt.viewport,Ue===0&&(e.setRenderTargetTextures(b,pt.colorTexture,d.ignoreDepthValues?void 0:pt.depthStencilTexture),e.setRenderTarget(b))}let $e=v[Ue];$e===void 0&&($e=new Kt,$e.layers.enable(Ue),$e.viewport=new _t,v[Ue]=$e),$e.matrix.fromArray(Me.transform.matrix),$e.matrix.decompose($e.position,$e.quaternion,$e.scale),$e.projectionMatrix.fromArray(Me.projectionMatrix),$e.projectionMatrixInverse.copy($e.projectionMatrix).invert(),$e.viewport.set(xt.x,xt.y,xt.width,xt.height),Ue===0&&(E.matrix.copy($e.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),pe===!0&&E.cameras.push($e)}let ye=s.enabledFeatures;if(ye&&ye.includes("depth-sensing")){let Ue=u.getDepthInformation(le[0]);Ue&&Ue.isValid&&Ue.texture&&g.init(e,Ue,s.renderState)}}for(let le=0;le<x.length;le++){let pe=y[le],ye=x[le];pe!==null&&ye!==void 0&&ye.update(pe,se,l||o)}he&&he(X,se),se.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:se}),p=null}let Le=new HE;Le.setAnimationLoop(ve),this.setAnimationLoop=function(X){he=X},this.dispose=function(){}}},sa=new Kn,sN=new Oe;Jr=class{constructor(e={}){let{canvas:t=dE(),context:n=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;let p=new Uint32Array(4),g=new Int32Array(4),A=null,m=null,b=[],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=at,this.toneMapping=xi,this.toneMappingExposure=1;let y=this,_=!1,S=0,C=0,w=null,v=-1,E=null,R=new _t,F=new _t,P=null,U=new Ce(0),V=0,O=t.width,K=t.height,z=1,ee=null,ae=null,he=new _t(0,0,O,K),ve=new _t(0,0,O,K),Le=!1,X=new mc,se=!1,le=!1;this.transmissionResolutionScale=1;let pe=new Oe,ye=new Oe,Ue=new D,Me=new _t,xt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},$e=!1;function pt(){return w===null?z:1}let L=n;function Tn(T,k){return t.getContext(T,k)}try{let T={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${"172"}`),t.addEventListener("webglcontextlost",te,!1),t.addEventListener("webglcontextrestored",be,!1),t.addEventListener("webglcontextcreationerror",_e,!1),L===null){let k="webgl2";if(L=Tn(k,T),L===null)throw Tn(k)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw console.error("THREE.WebGLRenderer: "+T.message),T}let rt,ot,Te,Et,Ie,B,M,H,Z,ie,J,Re,Ae,Ee,tt,ce,ge,Ne,Ge,Se,nt,We,St,N;function de(){rt=new EF(L),rt.init(),We=new eN(L,rt),ot=new gF(L,rt,e,We),Te=new JO(L,rt),ot.reverseDepthBuffer&&d&&Te.buffers.depth.setReversed(!0),Et=new CF(L),Ie=new kO,B=new ZO(L,rt,Te,Ie,ot,We,Et),M=new bF(y),H=new vF(y),Z=new LL(L),St=new mF(L,Z),ie=new SF(L,Z,Et,St),J=new TF(L,ie,Z,Et),Ge=new MF(L,ot,B),ce=new yF(Ie),Re=new UO(y,M,H,rt,ot,St,ce),Ae=new rN(y,Ie),Ee=new QO,tt=new KO(rt),Ne=new pF(y,M,H,Te,J,f,c),ge=new YO(y,J,ot),N=new oN(L,Et,ot,Te),Se=new AF(L,rt,Et),nt=new wF(L,rt,Et),Et.programs=Re.programs,y.capabilities=ot,y.extensions=rt,y.properties=Ie,y.renderLists=Ee,y.shadowMap=ge,y.state=Te,y.info=Et}de();let $=new bg(y,L);this.xr=$,this.getContext=function(){return L},this.getContextAttributes=function(){return L.getContextAttributes()},this.forceContextLoss=function(){let T=rt.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){let T=rt.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return z},this.setPixelRatio=function(T){T!==void 0&&(z=T,this.setSize(O,K,!1))},this.getSize=function(T){return T.set(O,K)},this.setSize=function(T,k,W=!0){if($.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=T,K=k,t.width=Math.floor(T*z),t.height=Math.floor(k*z),W===!0&&(t.style.width=T+"px",t.style.height=k+"px"),this.setViewport(0,0,T,k)},this.getDrawingBufferSize=function(T){return T.set(O*z,K*z).floor()},this.setDrawingBufferSize=function(T,k,W){O=T,K=k,z=W,t.width=Math.floor(T*W),t.height=Math.floor(k*W),this.setViewport(0,0,T,k)},this.getCurrentViewport=function(T){return T.copy(R)},this.getViewport=function(T){return T.copy(he)},this.setViewport=function(T,k,W,q){T.isVector4?he.set(T.x,T.y,T.z,T.w):he.set(T,k,W,q),Te.viewport(R.copy(he).multiplyScalar(z).round())},this.getScissor=function(T){return T.copy(ve)},this.setScissor=function(T,k,W,q){T.isVector4?ve.set(T.x,T.y,T.z,T.w):ve.set(T,k,W,q),Te.scissor(F.copy(ve).multiplyScalar(z).round())},this.getScissorTest=function(){return Le},this.setScissorTest=function(T){Te.setScissorTest(Le=T)},this.setOpaqueSort=function(T){ee=T},this.setTransparentSort=function(T){ae=T},this.getClearColor=function(T){return T.copy(Ne.getClearColor())},this.setClearColor=function(){Ne.setClearColor.apply(Ne,arguments)},this.getClearAlpha=function(){return Ne.getClearAlpha()},this.setClearAlpha=function(){Ne.setClearAlpha.apply(Ne,arguments)},this.clear=function(T=!0,k=!0,W=!0){let q=0;if(T){let G=!1;if(w!==null){let re=w.texture.format;G=re===_f||re===xf||re===bf}if(G){let re=w.texture.type,fe=re===kt||re===Cs||re===_c||re===Ko||re===gf||re===yf,Y=Ne.getClearColor(),I=Ne.getClearAlpha(),Q=Y.r,j=Y.g,ue=Y.b;fe?(p[0]=Q,p[1]=j,p[2]=ue,p[3]=I,L.clearBufferuiv(L.COLOR,0,p)):(g[0]=Q,g[1]=j,g[2]=ue,g[3]=I,L.clearBufferiv(L.COLOR,0,g))}else q|=L.COLOR_BUFFER_BIT}k&&(q|=L.DEPTH_BUFFER_BIT),W&&(q|=L.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),L.clear(q)},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",te,!1),t.removeEventListener("webglcontextrestored",be,!1),t.removeEventListener("webglcontextcreationerror",_e,!1),Ne.dispose(),Ee.dispose(),tt.dispose(),Ie.dispose(),M.dispose(),H.dispose(),J.dispose(),St.dispose(),N.dispose(),Re.dispose(),$.dispose(),$.removeEventListener("sessionstart",zt),$.removeEventListener("sessionend",Us),ks.stop()};function te(T){T.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function be(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;let T=Et.autoReset,k=ge.enabled,W=ge.autoUpdate,q=ge.needsUpdate,G=ge.type;de(),Et.autoReset=T,ge.enabled=k,ge.autoUpdate=W,ge.needsUpdate=q,ge.type=G}function _e(T){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function He(T){let k=T.target;k.removeEventListener("dispose",He),Pt(k)}function Pt(T){mn(T),Ie.remove(T)}function mn(T){let k=Ie.get(T).programs;k!==void 0&&(k.forEach(function(W){Re.releaseProgram(W)}),T.isShaderMaterial&&Re.releaseShaderCache(T))}this.renderBufferDirect=function(T,k,W,q,G,re){k===null&&(k=xt);let fe=G.isMesh&&G.matrixWorld.determinant()<0,Y=Ku(T,k,W,q,G);Te.setMaterial(q,fe);let I=W.index,Q=1;if(q.wireframe===!0){if(I=ie.getWireframeAttribute(W),I===void 0)return;Q=2}let j=W.drawRange,ue=W.attributes.position,xe=j.start*Q,De=(j.start+j.count)*Q;re!==null&&(xe=Math.max(xe,re.start*Q),De=Math.min(De,(re.start+re.count)*Q)),I!==null?(xe=Math.max(xe,0),De=Math.min(De,I.count)):ue!=null&&(xe=Math.max(xe,0),De=Math.min(De,ue.count));let je=De-xe;if(je<0||je===1/0)return;St.setup(G,q,Y,W,I);let ft,Ve=Se;if(I!==null&&(ft=Z.get(I),Ve=nt,Ve.setIndex(ft)),G.isMesh)q.wireframe===!0?(Te.setLineWidth(q.wireframeLinewidth*pt()),Ve.setMode(L.LINES)):Ve.setMode(L.TRIANGLES);else if(G.isLine){let Pe=q.linewidth;Pe===void 0&&(Pe=1),Te.setLineWidth(Pe*pt()),G.isLineSegments?Ve.setMode(L.LINES):G.isLineLoop?Ve.setMode(L.LINE_LOOP):Ve.setMode(L.LINE_STRIP)}else G.isPoints?Ve.setMode(L.POINTS):G.isSprite&&Ve.setMode(L.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)Ve.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(rt.get("WEBGL_multi_draw"))Ve.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{let Pe=G._multiDrawStarts,ht=G._multiDrawCounts,At=G._multiDrawCount,Jn=I?Z.get(I).bytesPerElement:1,Na=Ie.get(q).currentProgram.getUniforms();for(let fi=0;fi<At;fi++)Na.setValue(L,"_gl_DrawID",fi),Ve.render(Pe[fi]/Jn,ht[fi])}else if(G.isInstancedMesh)Ve.renderInstances(xe,je,G.count);else if(W.isInstancedBufferGeometry){let Pe=W._maxInstanceCount!==void 0?W._maxInstanceCount:1/0,ht=Math.min(W.instanceCount,Pe);Ve.renderInstances(xe,je,ht)}else Ve.render(xe,je)};function dt(T,k,W){T.transparent===!0&&T.side===Ut&&T.forceSinglePass===!1?(T.side=en,T.needsUpdate=!0,In(T,k,W),T.side=qn,T.needsUpdate=!0,In(T,k,W),T.side=Ut):In(T,k,W)}this.compile=function(T,k,W=null){W===null&&(W=T),m=tt.get(W),m.init(k),x.push(m),W.traverseVisible(function(G){G.isLight&&G.layers.test(k.layers)&&(m.pushLight(G),G.castShadow&&m.pushShadow(G))}),T!==W&&T.traverseVisible(function(G){G.isLight&&G.layers.test(k.layers)&&(m.pushLight(G),G.castShadow&&m.pushShadow(G))}),m.setupLights();let q=new Set;return T.traverse(function(G){if(!(G.isMesh||G.isPoints||G.isLine||G.isSprite))return;let re=G.material;if(re)if(Array.isArray(re))for(let fe=0;fe<re.length;fe++){let Y=re[fe];dt(Y,W,G),q.add(Y)}else dt(re,W,G),q.add(re)}),x.pop(),m=null,q},this.compileAsync=function(T,k,W=null){let q=this.compile(T,k,W);return new Promise(G=>{function re(){if(q.forEach(function(fe){Ie.get(fe).currentProgram.isReady()&&q.delete(fe)}),q.size===0){G(T);return}setTimeout(re,10)}rt.get("KHR_parallel_shader_compile")!==null?re():setTimeout(re,10)})};let di=null;function Hi(T){di&&di(T)}function zt(){ks.stop()}function Us(){ks.start()}let ks=new HE;ks.setAnimationLoop(Hi),typeof self<"u"&&ks.setContext(self),this.setAnimationLoop=function(T){di=T,$.setAnimationLoop(T),T===null?ks.stop():ks.start()},$.addEventListener("sessionstart",zt),$.addEventListener("sessionend",Us),this.render=function(T,k){if(k!==void 0&&k.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(_===!0)return;if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),k.parent===null&&k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),$.enabled===!0&&$.isPresenting===!0&&($.cameraAutoUpdate===!0&&$.updateCamera(k),k=$.getCamera()),T.isScene===!0&&T.onBeforeRender(y,T,k,w),m=tt.get(T,x.length),m.init(k),x.push(m),ye.multiplyMatrices(k.projectionMatrix,k.matrixWorldInverse),X.setFromProjectionMatrix(ye),le=this.localClippingEnabled,se=ce.init(this.clippingPlanes,le),A=Ee.get(T,b.length),A.init(),b.push(A),$.enabled===!0&&$.isPresenting===!0){let re=y.xr.getDepthSensingMesh();re!==null&&La(re,k,-1/0,y.sortObjects)}La(T,k,0,y.sortObjects),A.finish(),y.sortObjects===!0&&A.sort(ee,ae),$e=$.enabled===!1||$.isPresenting===!1||$.hasDepthSensing()===!1,$e&&Ne.addToRenderList(A,T),this.info.render.frame++,se===!0&&ce.beginShadows();let W=m.state.shadowsArray;ge.render(W,T,k),se===!0&&ce.endShadows(),this.info.autoReset===!0&&this.info.reset();let q=A.opaque,G=A.transmissive;if(m.setupLights(),k.isArrayCamera){let re=k.cameras;if(G.length>0)for(let fe=0,Y=re.length;fe<Y;fe++){let I=re[fe];Tl(q,G,T,I)}$e&&Ne.render(T);for(let fe=0,Y=re.length;fe<Y;fe++){let I=re[fe];Pa(A,T,I,I.viewport)}}else G.length>0&&Tl(q,G,T,k),$e&&Ne.render(T),Pa(A,T,k);w!==null&&C===0&&(B.updateMultisampleRenderTarget(w),B.updateRenderTargetMipmap(w)),T.isScene===!0&&T.onAfterRender(y,T,k),St.resetDefaultState(),v=-1,E=null,x.pop(),x.length>0?(m=x[x.length-1],se===!0&&ce.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,b.pop(),b.length>0?A=b[b.length-1]:A=null};function La(T,k,W,q){if(T.visible===!1)return;if(T.layers.test(k.layers)){if(T.isGroup)W=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(k);else if(T.isLight)m.pushLight(T),T.castShadow&&m.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||X.intersectsSprite(T)){q&&Me.setFromMatrixPosition(T.matrixWorld).applyMatrix4(ye);let fe=J.update(T),Y=T.material;Y.visible&&A.push(T,fe,Y,W,Me.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||X.intersectsObject(T))){let fe=J.update(T),Y=T.material;if(q&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),Me.copy(T.boundingSphere.center)):(fe.boundingSphere===null&&fe.computeBoundingSphere(),Me.copy(fe.boundingSphere.center)),Me.applyMatrix4(T.matrixWorld).applyMatrix4(ye)),Array.isArray(Y)){let I=fe.groups;for(let Q=0,j=I.length;Q<j;Q++){let ue=I[Q],xe=Y[ue.materialIndex];xe&&xe.visible&&A.push(T,fe,xe,W,Me.z,ue)}}else Y.visible&&A.push(T,fe,Y,W,Me.z,null)}}let re=T.children;for(let fe=0,Y=re.length;fe<Y;fe++)La(re[fe],k,W,q)}function Pa(T,k,W,q){let G=T.opaque,re=T.transmissive,fe=T.transparent;m.setupLightsView(W),se===!0&&ce.setGlobalState(y.clippingPlanes,W),q&&Te.viewport(R.copy(q)),G.length>0&&fo(G,k,W),re.length>0&&fo(re,k,W),fe.length>0&&fo(fe,k,W),Te.buffers.depth.setTest(!0),Te.buffers.depth.setMask(!0),Te.buffers.color.setMask(!0),Te.setPolygonOffset(!1)}function Tl(T,k,W,q){if((W.isScene===!0?W.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[q.id]===void 0&&(m.state.transmissionRenderTarget[q.id]=new _n(1,1,{generateMipmaps:!0,type:rt.has("EXT_color_buffer_half_float")||rt.has("EXT_color_buffer_float")?Lt:kt,minFilter:rn,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:it.workingColorSpace}));let re=m.state.transmissionRenderTarget[q.id],fe=q.viewport||R;re.setSize(fe.z*y.transmissionResolutionScale,fe.w*y.transmissionResolutionScale);let Y=y.getRenderTarget();y.setRenderTarget(re),y.getClearColor(U),V=y.getClearAlpha(),V<1&&y.setClearColor(16777215,.5),y.clear(),$e&&Ne.render(W);let I=y.toneMapping;y.toneMapping=xi;let Q=q.viewport;if(q.viewport!==void 0&&(q.viewport=void 0),m.setupLightsView(q),se===!0&&ce.setGlobalState(y.clippingPlanes,q),fo(T,W,q),B.updateMultisampleRenderTarget(re),B.updateRenderTargetMipmap(re),rt.has("WEBGL_multisampled_render_to_texture")===!1){let j=!1;for(let ue=0,xe=k.length;ue<xe;ue++){let De=k[ue],je=De.object,ft=De.geometry,Ve=De.material,Pe=De.group;if(Ve.side===Ut&&je.layers.test(q.layers)){let ht=Ve.side;Ve.side=en,Ve.needsUpdate=!0,qu(je,W,q,ft,Ve,Pe),Ve.side=ht,Ve.needsUpdate=!0,j=!0}}j===!0&&(B.updateMultisampleRenderTarget(re),B.updateRenderTargetMipmap(re))}y.setRenderTarget(Y),y.setClearColor(U,V),Q!==void 0&&(q.viewport=Q),y.toneMapping=I}function fo(T,k,W){let q=k.isScene===!0?k.overrideMaterial:null;for(let G=0,re=T.length;G<re;G++){let fe=T[G],Y=fe.object,I=fe.geometry,Q=q===null?fe.material:q,j=fe.group;Y.layers.test(W.layers)&&qu(Y,k,W,I,Q,j)}}function qu(T,k,W,q,G,re){T.onBeforeRender(y,k,W,q,G,re),T.modelViewMatrix.multiplyMatrices(W.matrixWorldInverse,T.matrixWorld),T.normalMatrix.getNormalMatrix(T.modelViewMatrix),G.onBeforeRender(y,k,W,q,T,re),G.transparent===!0&&G.side===Ut&&G.forceSinglePass===!1?(G.side=en,G.needsUpdate=!0,y.renderBufferDirect(W,k,q,G,T,re),G.side=qn,G.needsUpdate=!0,y.renderBufferDirect(W,k,q,G,T,re),G.side=Ut):y.renderBufferDirect(W,k,q,G,T,re),T.onAfterRender(y,k,W,q,G,re)}function In(T,k,W){k.isScene!==!0&&(k=xt);let q=Ie.get(T),G=m.state.lights,re=m.state.shadowsArray,fe=G.state.version,Y=Re.getParameters(T,G.state,re,k,W),I=Re.getProgramCacheKey(Y),Q=q.programs;q.environment=T.isMeshStandardMaterial?k.environment:null,q.fog=k.fog,q.envMap=(T.isMeshStandardMaterial?H:M).get(T.envMap||q.environment),q.envMapRotation=q.environment!==null&&T.envMap===null?k.environmentRotation:T.envMapRotation,Q===void 0&&(T.addEventListener("dispose",He),Q=new Map,q.programs=Q);let j=Q.get(I);if(j!==void 0){if(q.currentProgram===j&&q.lightsStateVersion===fe)return Il(T,Y),j}else Y.uniforms=Re.getUniforms(T),T.onBeforeCompile(Y,y),j=Re.acquireProgram(Y,I),Q.set(I,j),q.uniforms=Y.uniforms;let ue=q.uniforms;return(!T.isShaderMaterial&&!T.isRawShaderMaterial||T.clipping===!0)&&(ue.clippingPlanes=ce.uniform),Il(T,Y),q.needsLights=Fa(T),q.lightsStateVersion=fe,q.needsLights&&(ue.ambientLightColor.value=G.state.ambient,ue.lightProbe.value=G.state.probe,ue.directionalLights.value=G.state.directional,ue.directionalLightShadows.value=G.state.directionalShadow,ue.spotLights.value=G.state.spot,ue.spotLightShadows.value=G.state.spotShadow,ue.rectAreaLights.value=G.state.rectArea,ue.ltc_1.value=G.state.rectAreaLTC1,ue.ltc_2.value=G.state.rectAreaLTC2,ue.pointLights.value=G.state.point,ue.pointLightShadows.value=G.state.pointShadow,ue.hemisphereLights.value=G.state.hemi,ue.directionalShadowMap.value=G.state.directionalShadowMap,ue.directionalShadowMatrix.value=G.state.directionalShadowMatrix,ue.spotShadowMap.value=G.state.spotShadowMap,ue.spotLightMatrix.value=G.state.spotLightMatrix,ue.spotLightMap.value=G.state.spotLightMap,ue.pointShadowMap.value=G.state.pointShadowMap,ue.pointShadowMatrix.value=G.state.pointShadowMatrix),q.currentProgram=j,q.uniformsList=null,j}function us(T){if(T.uniformsList===null){let k=T.currentProgram.getUniforms();T.uniformsList=Lc.seqWithValue(k.seq,T.uniforms)}return T.uniformsList}function Il(T,k){let W=Ie.get(T);W.outputColorSpace=k.outputColorSpace,W.batching=k.batching,W.batchingColor=k.batchingColor,W.instancing=k.instancing,W.instancingColor=k.instancingColor,W.instancingMorph=k.instancingMorph,W.skinning=k.skinning,W.morphTargets=k.morphTargets,W.morphNormals=k.morphNormals,W.morphColors=k.morphColors,W.morphTargetsCount=k.morphTargetsCount,W.numClippingPlanes=k.numClippingPlanes,W.numIntersection=k.numClipIntersection,W.vertexAlphas=k.vertexAlphas,W.vertexTangents=k.vertexTangents,W.toneMapping=k.toneMapping}function Ku(T,k,W,q,G){k.isScene!==!0&&(k=xt),B.resetTextureUnits();let re=k.fog,fe=q.isMeshStandardMaterial?k.environment:null,Y=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:st,I=(q.isMeshStandardMaterial?H:M).get(q.envMap||fe),Q=q.vertexColors===!0&&!!W.attributes.color&&W.attributes.color.itemSize===4,j=!!W.attributes.tangent&&(!!q.normalMap||q.anisotropy>0),ue=!!W.morphAttributes.position,xe=!!W.morphAttributes.normal,De=!!W.morphAttributes.color,je=xi;q.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(je=y.toneMapping);let ft=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,Ve=ft!==void 0?ft.length:0,Pe=Ie.get(q),ht=m.state.lights;if(se===!0&&(le===!0||T!==E)){let zn=T===E&&q.id===v;ce.setState(q,T,zn)}let At=!1;q.version===Pe.__version?(Pe.needsLights&&Pe.lightsStateVersion!==ht.state.version||Pe.outputColorSpace!==Y||G.isBatchedMesh&&Pe.batching===!1||!G.isBatchedMesh&&Pe.batching===!0||G.isBatchedMesh&&Pe.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Pe.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Pe.instancing===!1||!G.isInstancedMesh&&Pe.instancing===!0||G.isSkinnedMesh&&Pe.skinning===!1||!G.isSkinnedMesh&&Pe.skinning===!0||G.isInstancedMesh&&Pe.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Pe.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Pe.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Pe.instancingMorph===!1&&G.morphTexture!==null||Pe.envMap!==I||q.fog===!0&&Pe.fog!==re||Pe.numClippingPlanes!==void 0&&(Pe.numClippingPlanes!==ce.numPlanes||Pe.numIntersection!==ce.numIntersection)||Pe.vertexAlphas!==Q||Pe.vertexTangents!==j||Pe.morphTargets!==ue||Pe.morphNormals!==xe||Pe.morphColors!==De||Pe.toneMapping!==je||Pe.morphTargetsCount!==Ve)&&(At=!0):(At=!0,Pe.__version=q.version);let Jn=Pe.currentProgram;At===!0&&(Jn=In(q,k,G));let Na=!1,fi=!1,Bl=!1,Ht=Jn.getUniforms(),Mi=Pe.uniforms;if(Te.useProgram(Jn.program)&&(Na=!0,fi=!0,Bl=!0),q.id!==v&&(v=q.id,fi=!0),Na||E!==T){Te.buffers.depth.getReversed()?(pe.copy(T.projectionMatrix),pE(pe),mE(pe),Ht.setValue(L,"projectionMatrix",pe)):Ht.setValue(L,"projectionMatrix",T.projectionMatrix),Ht.setValue(L,"viewMatrix",T.matrixWorldInverse);let Zn=Ht.map.cameraPosition;Zn!==void 0&&Zn.setValue(L,Ue.setFromMatrixPosition(T.matrixWorld)),ot.logarithmicDepthBuffer&&Ht.setValue(L,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(q.isMeshPhongMaterial||q.isMeshToonMaterial||q.isMeshLambertMaterial||q.isMeshBasicMaterial||q.isMeshStandardMaterial||q.isShaderMaterial)&&Ht.setValue(L,"isOrthographic",T.isOrthographicCamera===!0),E!==T&&(E=T,fi=!0,Bl=!0)}if(G.isSkinnedMesh){Ht.setOptional(L,G,"bindMatrix"),Ht.setOptional(L,G,"bindMatrixInverse");let zn=G.skeleton;zn&&(zn.boneTexture===null&&zn.computeBoneTexture(),Ht.setValue(L,"boneTexture",zn.boneTexture,B))}G.isBatchedMesh&&(Ht.setOptional(L,G,"batchingTexture"),Ht.setValue(L,"batchingTexture",G._matricesTexture,B),Ht.setOptional(L,G,"batchingIdTexture"),Ht.setValue(L,"batchingIdTexture",G._indirectTexture,B),Ht.setOptional(L,G,"batchingColorTexture"),G._colorsTexture!==null&&Ht.setValue(L,"batchingColorTexture",G._colorsTexture,B));let Ti=W.morphAttributes;if((Ti.position!==void 0||Ti.normal!==void 0||Ti.color!==void 0)&&Ge.update(G,W,Jn),(fi||Pe.receiveShadow!==G.receiveShadow)&&(Pe.receiveShadow=G.receiveShadow,Ht.setValue(L,"receiveShadow",G.receiveShadow)),q.isMeshGouraudMaterial&&q.envMap!==null&&(Mi.envMap.value=I,Mi.flipEnvMap.value=I.isCubeTexture&&I.isRenderTargetTexture===!1?-1:1),q.isMeshStandardMaterial&&q.envMap===null&&k.environment!==null&&(Mi.envMapIntensity.value=k.environmentIntensity),fi&&(Ht.setValue(L,"toneMappingExposure",y.toneMappingExposure),Pe.needsLights&&Rl(Mi,Bl),re&&q.fog===!0&&Ae.refreshFogUniforms(Mi,re),Ae.refreshMaterialUniforms(Mi,q,z,K,m.state.transmissionRenderTarget[T.id]),Lc.upload(L,us(Pe),Mi,B)),q.isShaderMaterial&&q.uniformsNeedUpdate===!0&&(Lc.upload(L,us(Pe),Mi,B),q.uniformsNeedUpdate=!1),q.isSpriteMaterial&&Ht.setValue(L,"center",G.center),Ht.setValue(L,"modelViewMatrix",G.modelViewMatrix),Ht.setValue(L,"normalMatrix",G.normalMatrix),Ht.setValue(L,"modelMatrix",G.matrixWorld),q.isShaderMaterial||q.isRawShaderMaterial){let zn=q.uniformsGroups;for(let Zn=0,Cm=zn.length;Zn<Cm;Zn++){let po=zn[Zn];N.update(po,Jn),N.bind(po,Jn)}}return Jn}function Rl(T,k){T.ambientLightColor.needsUpdate=k,T.lightProbe.needsUpdate=k,T.directionalLights.needsUpdate=k,T.directionalLightShadows.needsUpdate=k,T.pointLights.needsUpdate=k,T.pointLightShadows.needsUpdate=k,T.spotLights.needsUpdate=k,T.spotLightShadows.needsUpdate=k,T.rectAreaLights.needsUpdate=k,T.hemisphereLights.needsUpdate=k}function Fa(T){return T.isMeshLambertMaterial||T.isMeshToonMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isShadowMaterial||T.isShaderMaterial&&T.lights===!0}this.getActiveCubeFace=function(){return S},this.getActiveMipmapLevel=function(){return C},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(T,k,W){Ie.get(T.texture).__webglTexture=k,Ie.get(T.depthTexture).__webglTexture=W;let q=Ie.get(T);q.__hasExternalTextures=!0,q.__autoAllocateDepthBuffer=W===void 0,q.__autoAllocateDepthBuffer||rt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),q.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(T,k){let W=Ie.get(T);W.__webglFramebuffer=k,W.__useDefaultFramebuffer=k===void 0};let Pr=L.createFramebuffer();this.setRenderTarget=function(T,k=0,W=0){w=T,S=k,C=W;let q=!0,G=null,re=!1,fe=!1;if(T){let I=Ie.get(T);if(I.__useDefaultFramebuffer!==void 0)Te.bindFramebuffer(L.FRAMEBUFFER,null),q=!1;else if(I.__webglFramebuffer===void 0)B.setupRenderTarget(T);else if(I.__hasExternalTextures)B.rebindTextures(T,Ie.get(T.texture).__webglTexture,Ie.get(T.depthTexture).__webglTexture);else if(T.depthBuffer){let ue=T.depthTexture;if(I.__boundDepthTexture!==ue){if(ue!==null&&Ie.has(ue)&&(T.width!==ue.image.width||T.height!==ue.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");B.setupDepthRenderbuffer(T)}}let Q=T.texture;(Q.isData3DTexture||Q.isDataArrayTexture||Q.isCompressedArrayTexture)&&(fe=!0);let j=Ie.get(T).__webglFramebuffer;T.isWebGLCubeRenderTarget?(Array.isArray(j[k])?G=j[k][W]:G=j[k],re=!0):T.samples>0&&B.useMultisampledRTT(T)===!1?G=Ie.get(T).__webglMultisampledFramebuffer:Array.isArray(j)?G=j[W]:G=j,R.copy(T.viewport),F.copy(T.scissor),P=T.scissorTest}else R.copy(he).multiplyScalar(z).floor(),F.copy(ve).multiplyScalar(z).floor(),P=Le;if(W!==0&&(G=Pr),Te.bindFramebuffer(L.FRAMEBUFFER,G)&&q&&Te.drawBuffers(T,G),Te.viewport(R),Te.scissor(F),Te.setScissorTest(P),re){let I=Ie.get(T.texture);L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_CUBE_MAP_POSITIVE_X+k,I.__webglTexture,W)}else if(fe){let I=Ie.get(T.texture),Q=k;L.framebufferTextureLayer(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,I.__webglTexture,W,Q)}else if(T!==null&&W!==0){let I=Ie.get(T.texture);L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,I.__webglTexture,W)}v=-1},this.readRenderTargetPixels=function(T,k,W,q,G,re,fe){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Y=Ie.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&fe!==void 0&&(Y=Y[fe]),Y){Te.bindFramebuffer(L.FRAMEBUFFER,Y);try{let I=T.texture,Q=I.format,j=I.type;if(!ot.textureFormatReadable(Q)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ot.textureTypeReadable(j)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}k>=0&&k<=T.width-q&&W>=0&&W<=T.height-G&&L.readPixels(k,W,q,G,We.convert(Q),We.convert(j),re)}finally{let I=w!==null?Ie.get(w).__webglFramebuffer:null;Te.bindFramebuffer(L.FRAMEBUFFER,I)}}},this.readRenderTargetPixelsAsync=async function(T,k,W,q,G,re,fe){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Y=Ie.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&fe!==void 0&&(Y=Y[fe]),Y){let I=T.texture,Q=I.format,j=I.type;if(!ot.textureFormatReadable(Q))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ot.textureTypeReadable(j))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(k>=0&&k<=T.width-q&&W>=0&&W<=T.height-G){Te.bindFramebuffer(L.FRAMEBUFFER,Y);let ue=L.createBuffer();L.bindBuffer(L.PIXEL_PACK_BUFFER,ue),L.bufferData(L.PIXEL_PACK_BUFFER,re.byteLength,L.STREAM_READ),L.readPixels(k,W,q,G,We.convert(Q),We.convert(j),0);let xe=w!==null?Ie.get(w).__webglFramebuffer:null;Te.bindFramebuffer(L.FRAMEBUFFER,xe);let De=L.fenceSync(L.SYNC_GPU_COMMANDS_COMPLETE,0);return L.flush(),await fE(L,De,4),L.bindBuffer(L.PIXEL_PACK_BUFFER,ue),L.getBufferSubData(L.PIXEL_PACK_BUFFER,0,re),L.deleteBuffer(ue),L.deleteSync(De),re}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(T,k=null,W=0){T.isTexture!==!0&&(ta("WebGLRenderer: copyFramebufferToTexture function signature has changed."),k=arguments[0]||null,T=arguments[1]);let q=Math.pow(2,-W),G=Math.floor(T.image.width*q),re=Math.floor(T.image.height*q),fe=k!==null?k.x:0,Y=k!==null?k.y:0;B.setTexture2D(T,0),L.copyTexSubImage2D(L.TEXTURE_2D,W,0,0,fe,Y,G,re),Te.unbindTexture()};let Oa=L.createFramebuffer(),Vi=L.createFramebuffer();this.copyTextureToTexture=function(T,k,W=null,q=null,G=0,re=null){T.isTexture!==!0&&(ta("WebGLRenderer: copyTextureToTexture function signature has changed."),q=arguments[0]||null,T=arguments[1],k=arguments[2],re=arguments[3]||0,W=null),re===null&&(G!==0?(ta("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),re=G,G=0):re=0);let fe,Y,I,Q,j,ue,xe,De,je,ft=T.isCompressedTexture?T.mipmaps[re]:T.image;if(W!==null)fe=W.max.x-W.min.x,Y=W.max.y-W.min.y,I=W.isBox3?W.max.z-W.min.z:1,Q=W.min.x,j=W.min.y,ue=W.isBox3?W.min.z:0;else{let Ti=Math.pow(2,-G);fe=Math.floor(ft.width*Ti),Y=Math.floor(ft.height*Ti),T.isDataArrayTexture?I=ft.depth:T.isData3DTexture?I=Math.floor(ft.depth*Ti):I=1,Q=0,j=0,ue=0}q!==null?(xe=q.x,De=q.y,je=q.z):(xe=0,De=0,je=0);let Ve=We.convert(k.format),Pe=We.convert(k.type),ht;k.isData3DTexture?(B.setTexture3D(k,0),ht=L.TEXTURE_3D):k.isDataArrayTexture||k.isCompressedArrayTexture?(B.setTexture2DArray(k,0),ht=L.TEXTURE_2D_ARRAY):(B.setTexture2D(k,0),ht=L.TEXTURE_2D),L.pixelStorei(L.UNPACK_FLIP_Y_WEBGL,k.flipY),L.pixelStorei(L.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),L.pixelStorei(L.UNPACK_ALIGNMENT,k.unpackAlignment);let At=L.getParameter(L.UNPACK_ROW_LENGTH),Jn=L.getParameter(L.UNPACK_IMAGE_HEIGHT),Na=L.getParameter(L.UNPACK_SKIP_PIXELS),fi=L.getParameter(L.UNPACK_SKIP_ROWS),Bl=L.getParameter(L.UNPACK_SKIP_IMAGES);L.pixelStorei(L.UNPACK_ROW_LENGTH,ft.width),L.pixelStorei(L.UNPACK_IMAGE_HEIGHT,ft.height),L.pixelStorei(L.UNPACK_SKIP_PIXELS,Q),L.pixelStorei(L.UNPACK_SKIP_ROWS,j),L.pixelStorei(L.UNPACK_SKIP_IMAGES,ue);let Ht=T.isDataArrayTexture||T.isData3DTexture,Mi=k.isDataArrayTexture||k.isData3DTexture;if(T.isDepthTexture){let Ti=Ie.get(T),zn=Ie.get(k),Zn=Ie.get(Ti.__renderTarget),Cm=Ie.get(zn.__renderTarget);Te.bindFramebuffer(L.READ_FRAMEBUFFER,Zn.__webglFramebuffer),Te.bindFramebuffer(L.DRAW_FRAMEBUFFER,Cm.__webglFramebuffer);for(let po=0;po<I;po++)Ht&&(L.framebufferTextureLayer(L.READ_FRAMEBUFFER,L.COLOR_ATTACHMENT0,Ie.get(T).__webglTexture,G,ue+po),L.framebufferTextureLayer(L.DRAW_FRAMEBUFFER,L.COLOR_ATTACHMENT0,Ie.get(k).__webglTexture,re,je+po)),L.blitFramebuffer(Q,j,fe,Y,xe,De,fe,Y,L.DEPTH_BUFFER_BIT,L.NEAREST);Te.bindFramebuffer(L.READ_FRAMEBUFFER,null),Te.bindFramebuffer(L.DRAW_FRAMEBUFFER,null)}else if(G!==0||T.isRenderTargetTexture||Ie.has(T)){let Ti=Ie.get(T),zn=Ie.get(k);Te.bindFramebuffer(L.READ_FRAMEBUFFER,Oa),Te.bindFramebuffer(L.DRAW_FRAMEBUFFER,Vi);for(let Zn=0;Zn<I;Zn++)Ht?L.framebufferTextureLayer(L.READ_FRAMEBUFFER,L.COLOR_ATTACHMENT0,Ti.__webglTexture,G,ue+Zn):L.framebufferTexture2D(L.READ_FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,Ti.__webglTexture,G),Mi?L.framebufferTextureLayer(L.DRAW_FRAMEBUFFER,L.COLOR_ATTACHMENT0,zn.__webglTexture,re,je+Zn):L.framebufferTexture2D(L.DRAW_FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,zn.__webglTexture,re),G!==0?L.blitFramebuffer(Q,j,fe,Y,xe,De,fe,Y,L.COLOR_BUFFER_BIT,L.NEAREST):Mi?L.copyTexSubImage3D(ht,re,xe,De,je+Zn,Q,j,fe,Y):L.copyTexSubImage2D(ht,re,xe,De,Q,j,fe,Y);Te.bindFramebuffer(L.READ_FRAMEBUFFER,null),Te.bindFramebuffer(L.DRAW_FRAMEBUFFER,null)}else Mi?T.isDataTexture||T.isData3DTexture?L.texSubImage3D(ht,re,xe,De,je,fe,Y,I,Ve,Pe,ft.data):k.isCompressedArrayTexture?L.compressedTexSubImage3D(ht,re,xe,De,je,fe,Y,I,Ve,ft.data):L.texSubImage3D(ht,re,xe,De,je,fe,Y,I,Ve,Pe,ft):T.isDataTexture?L.texSubImage2D(L.TEXTURE_2D,re,xe,De,fe,Y,Ve,Pe,ft.data):T.isCompressedTexture?L.compressedTexSubImage2D(L.TEXTURE_2D,re,xe,De,ft.width,ft.height,Ve,ft.data):L.texSubImage2D(L.TEXTURE_2D,re,xe,De,fe,Y,Ve,Pe,ft);L.pixelStorei(L.UNPACK_ROW_LENGTH,At),L.pixelStorei(L.UNPACK_IMAGE_HEIGHT,Jn),L.pixelStorei(L.UNPACK_SKIP_PIXELS,Na),L.pixelStorei(L.UNPACK_SKIP_ROWS,fi),L.pixelStorei(L.UNPACK_SKIP_IMAGES,Bl),re===0&&k.generateMipmaps&&L.generateMipmap(ht),Te.unbindTexture()},this.copyTextureToTexture3D=function(T,k,W=null,q=null,G=0){return T.isTexture!==!0&&(ta("WebGLRenderer: copyTextureToTexture3D function signature has changed."),W=arguments[0]||null,q=arguments[1]||null,T=arguments[2],k=arguments[3],G=arguments[4]||0),ta('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(T,k,W,q,G)},this.initRenderTarget=function(T){Ie.get(T).__webglFramebuffer===void 0&&B.setupRenderTarget(T)},this.initTexture=function(T){T.isCubeTexture?B.setTextureCube(T,0):T.isData3DTexture?B.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?B.setTexture2DArray(T,0):B.setTexture2D(T,0),Te.unbindTexture()},this.resetState=function(){S=0,C=0,w=null,Te.reset(),St.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ys}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorspace=it._getDrawingBufferColorSpace(e),t.unpackColorSpace=it._getUnpackColorSpace()}}});function iS(i,e){if(!Tg(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $E!==void 0?$E.createHTML(e):e}function Fc(i,e,t=i,n){if(e===ha)return e;let s=n!==void 0?t._$Co?.[n]:t._$Cl,r=Nh(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(i),s._$AT(i,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=s:t._$Cl=s),s!==void 0&&(e=Fc(i,s._$AS(i,e.values),s,n)),e}var Fh,qf,$E,eS,Zr,tS,aN,la,Oh,Nh,Tg,cN,vg,Ph,XE,YE,aa,jE,JE,nS,Ig,eo,X8,Y8,ha,Sn,ZE,ca,lN,Uh,Eg,kh,Oc,Sg,wg,Cg,Mg,hN,Kf,$f=oe(()=>{Fh=globalThis,qf=Fh.trustedTypes,$E=qf?qf.createPolicy("lit-html",{createHTML:i=>i}):void 0,eS="$lit$",Zr=`lit$${Math.random().toFixed(9).slice(2)}$`,tS="?"+Zr,aN=`<${tS}>`,la=document,Oh=()=>la.createComment(""),Nh=i=>i===null||typeof i!="object"&&typeof i!="function",Tg=Array.isArray,cN=i=>Tg(i)||typeof i?.[Symbol.iterator]=="function",vg=`[ 	
\f\r]`,Ph=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,XE=/-->/g,YE=/>/g,aa=RegExp(`>|${vg}(?:([^\\s"'>=/]+)(${vg}*=${vg}*(?:[^ 	
\f\r"'\`<>=]|("|')|))|$)`,"g"),jE=/'/g,JE=/"/g,nS=/^(?:script|style|textarea|title)$/i,Ig=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),eo=Ig(1),X8=Ig(2),Y8=Ig(3),ha=Symbol.for("lit-noChange"),Sn=Symbol.for("lit-nothing"),ZE=new WeakMap,ca=la.createTreeWalker(la,129);lN=(i,e)=>{let t=i.length-1,n=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=Ph;for(let a=0;a<t;a++){let c=i[a],l,h,u=-1,d=0;for(;d<c.length&&(o.lastIndex=d,h=o.exec(c),h!==null);)d=o.lastIndex,o===Ph?h[1]==="!--"?o=XE:h[1]!==void 0?o=YE:h[2]!==void 0?(nS.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=aa):h[3]!==void 0&&(o=aa):o===aa?h[0]===">"?(o=s??Ph,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,l=h[1],o=h[3]===void 0?aa:h[3]==='"'?JE:jE):o===JE||o===jE?o=aa:o===XE||o===YE?o=Ph:(o=aa,s=void 0);let f=o===aa&&i[a+1].startsWith("/>")?" ":"";r+=o===Ph?c+aN:u>=0?(n.push(l),c.slice(0,u)+eS+c.slice(u)+Zr+f):c+Zr+(u===-2?a:f)}return[iS(i,r+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},Uh=class i{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,o=0,a=e.length-1,c=this.parts,[l,h]=lN(e,t);if(this.el=i.createElement(l,n),ca.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=ca.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(eS)){let d=h[o++],f=s.getAttribute(u).split(Zr),p=/([.?@])?(.*)/.exec(d);c.push({type:1,index:r,name:p[2],strings:f,ctor:p[1]==="."?Sg:p[1]==="?"?wg:p[1]==="@"?Cg:Oc}),s.removeAttribute(u)}else u.startsWith(Zr)&&(c.push({type:6,index:r}),s.removeAttribute(u));if(nS.test(s.tagName)){let u=s.textContent.split(Zr),d=u.length-1;if(d>0){s.textContent=qf?qf.emptyScript:"";for(let f=0;f<d;f++)s.append(u[f],Oh()),ca.nextNode(),c.push({type:2,index:++r});s.append(u[d],Oh())}}}else if(s.nodeType===8)if(s.data===tS)c.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(Zr,u+1))!==-1;)c.push({type:7,index:r}),u+=Zr.length-1}r++}}static createElement(e,t){let n=la.createElement("template");return n.innerHTML=e,n}};Eg=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??la).importNode(t,!0);ca.currentNode=s;let r=ca.nextNode(),o=0,a=0,c=n[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new kh(r,r.nextSibling,this,e):c.type===1?l=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(l=new Mg(r,this,e)),this._$AV.push(l),c=n[++a]}o!==c?.index&&(r=ca.nextNode(),o++)}return ca.currentNode=la,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},kh=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=Sn,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Fc(this,e,t),Nh(e)?e===Sn||e==null||e===""?(this._$AH!==Sn&&this._$AR(),this._$AH=Sn):e!==this._$AH&&e!==ha&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):cN(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Sn&&Nh(this._$AH)?this._$AA.nextSibling.data=e:this.T(la.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Uh.createElement(iS(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let r=new Eg(s,this),o=r.u(this.options);r.p(t),this.T(o),this._$AH=r}}_$AC(e){let t=ZE.get(e.strings);return t===void 0&&ZE.set(e.strings,t=new Uh(e)),t}k(e){Tg(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let r of e)s===t.length?t.push(n=new i(this.O(Oh()),this.O(Oh()),this,this.options)):n=t[s],n._$AI(r),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Oc=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=Sn,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Sn}_$AI(e,t=this,n,s){let r=this.strings,o=!1;if(r===void 0)e=Fc(this,e,t,0),o=!Nh(e)||e!==this._$AH&&e!==ha,o&&(this._$AH=e);else{let a=e,c,l;for(e=r[0],c=0;c<r.length-1;c++)l=Fc(this,a[n+c],t,c),l===ha&&(l=this._$AH[c]),o||(o=!Nh(l)||l!==this._$AH[c]),l===Sn?e=Sn:e!==Sn&&(e+=(l??"")+r[c+1]),this._$AH[c]=l}o&&!s&&this.j(e)}j(e){e===Sn?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Sg=class extends Oc{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Sn?void 0:e}},wg=class extends Oc{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Sn)}},Cg=class extends Oc{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=Fc(this,e,t,0)??Sn)===ha)return;let n=this._$AH,s=e===Sn&&n!==Sn||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==Sn&&(n===Sn||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Mg=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Fc(this,e)}},hN=Fh.litHtmlPolyfillSupport;hN?.(Uh,kh),(Fh.litHtmlVersions??(Fh.litHtmlVersions=[])).push("3.3.1");Kf=(i,e,t)=>{let n=t?.renderBefore??e,s=n._$litPart$;if(s===void 0){let r=t?.renderBefore??null;n._$litPart$=s=new kh(e.insertBefore(Oh(),r),r,void 0,t??{})}return s._$AI(i),s}});var Gh,Nc,uN,sS=oe(()=>{Ql();Ql();$f();$f();Gh=globalThis,Nc=class extends $i{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Kf(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ha}};Nc._$litElement$=!0,Nc.finalized=!0,Gh.litElementHydrateSupport?.({LitElement:Nc});uN=Gh.litElementPolyfillSupport;uN?.({LitElement:Nc});(Gh.litElementVersions??(Gh.litElementVersions=[])).push("4.2.1")});var rS=oe(()=>{});var Uc=oe(()=>{Ql();$f();sS();rS()});var Rg,Bg,Xf,Yf,jf,l5,h5,dN,oS,u5,fN,pN,d5,aS,mN,Dg,Jf=oe(()=>{Rg=navigator.xr!=null&&self.XRSession!=null&&navigator.xr.isSessionSupported!=null,Bg=Rg&&self.XRSession.prototype.requestHitTestSource!=null,Xf=self.ResizeObserver!=null,Yf=self.IntersectionObserver!=null,jf=Bg,l5=(()=>{let i=navigator.userAgent||navigator.vendor||self.opera,e=!1;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(e=!0),e})(),h5=/\bCrOS\b/.test(navigator.userAgent),dN=/android/i.test(navigator.userAgent),oS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,u5=/Safari\//.test(navigator.userAgent),fN=/firefox/i.test(navigator.userAgent),pN=/OculusBrowser/.test(navigator.userAgent),d5=oS&&/CriOS\//.test(navigator.userAgent),aS=dN&&!fN&&!pN,mN=!!(window.webkit&&window.webkit.messageHandlers),Dg=(()=>{if(oS){if(mN)return!!/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent);{let i=document.createElement("a");return!!(i.relList&&i.relList.supports&&i.relList.supports("ar"))}}else return!1})()});var Zf,Lg,AN,cS,Pg,Nn,Fg,lS,hS,ns=oe(()=>{Jf();Zf=i=>i&&i!=="null"?AN(i):null,Lg=()=>{if(jf)return;let i=[];throw Rg||i.push("WebXR Device API"),Bg||i.push("WebXR Hit Test API"),new Error(`The following APIs are required for AR, but are missing in this browser: ${i.join(", ")}`)},AN=i=>new URL(i,window.location.toString()).toString(),cS=(i,e)=>{let t=null,n=(...s)=>{t==null&&(i(...s),t=self.setTimeout(()=>t=null,e))};return n.flush=()=>{t!=null&&(self.clearTimeout(t),t=null)},n},Pg=(i,e)=>{let t=null;return(...n)=>{t!=null&&self.clearTimeout(t),t=self.setTimeout(()=>{t=null,i(...n)},e)}},Nn=(i,e,t)=>Math.max(e,Math.min(t,i)),Fg=(()=>{let i="model-viewer-debug-mode",e=new RegExp(`[?&]${i}(&|$)`);return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(e)})(),lS=(i=0)=>new Promise(e=>setTimeout(e,i)),hS=(i,e,t=null)=>new Promise(n=>{function s(r){(!t||t(r))&&(n(r),i.removeEventListener(e,s))}i.addEventListener(e,s)})});var ua,gN,yN,bN,xN,kc,Gc,Qc,ep,uS,Qh=oe(()=>{Vs();Xe();ai();ns();ua=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},gN=.5,yN=0,bN=1,xN=1,kc=Symbol("currentEnvironmentMap"),Gc=Symbol("currentBackground"),Qc=Symbol("updateEnvironment"),ep=Symbol("cancelEnvironmentUpdate"),uS=i=>{var e,t,n;class s extends i{constructor(){super(...arguments),this.environmentImage=null,this.skyboxImage=null,this.shadowIntensity=yN,this.shadowSoftness=bN,this.exposure=xN,this.toneMapping="auto",this.skyboxHeight="0",this[e]=null,this[t]=null,this[n]=null}updated(o){super.updated(o),o.has("shadowIntensity")&&(this[ne].setShadowIntensity(this.shadowIntensity*gN),this[Wt]()),o.has("shadowSoftness")&&(this[ne].setShadowSoftness(this.shadowSoftness),this[Wt]()),o.has("exposure")&&(this[ne].exposure=this.exposure,this[Wt]()),o.has("toneMapping")&&(this[ne].toneMapping=this.toneMapping==="aces"?ff:this.toneMapping==="agx"?pf:this.toneMapping==="reinhard"?uf:this.toneMapping==="cineon"?df:this.toneMapping==="linear"?hf:this.toneMapping==="none"?xi:ar,this[Wt]()),(o.has("environmentImage")||o.has("skyboxImage"))&&this[dr]()&&this[Qc](),o.has("skyboxHeight")&&(this[ne].setGroundedSkybox(),this[Wt]())}hasBakedShadow(){return this[ne].bakedShadows.size>0}async[(e=kc,t=Gc,n=ep,Qc)](){let{skyboxImage:o,environmentImage:a}=this;this[ep]!=null&&(this[ep](),this[ep]=null);let{textureUtils:c}=this[ut];if(c==null)return;let l=this[is].beginActivity("environment-update");try{let{environmentMap:h,skybox:u}=await c.generateEnvironmentMapAndSkybox(Zf(o),a,d=>l(Nn(d,0,1)),this.withCredentials);this[kc]!==h&&(this[kc]=h,this.dispatchEvent(new CustomEvent("environment-change"))),u!=null?this[Gc]=u.name===h.name?h:u:this[Gc]=null,this[ne].setEnvironmentAndSkybox(this[kc],this[Gc])}catch(h){if(h instanceof Error)throw this[ne].setEnvironmentAndSkybox(null,null),h}finally{l(1)}}}return ua([Be({type:String,attribute:"environment-image"})],s.prototype,"environmentImage",void 0),ua([Be({type:String,attribute:"skybox-image"})],s.prototype,"skyboxImage",void 0),ua([Be({type:Number,attribute:"shadow-intensity"})],s.prototype,"shadowIntensity",void 0),ua([Be({type:Number,attribute:"shadow-softness"})],s.prototype,"shadowSoftness",void 0),ua([Be({type:Number})],s.prototype,"exposure",void 0),ua([Be({type:String,attribute:"tone-mapping"})],s.prototype,"toneMapping",void 0),ua([Be({type:String,attribute:"skybox-height"})],s.prototype,"skyboxHeight",void 0),s}});var dS,fS=oe(()=>{Uc();dS=eo`
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000">
    <!-- NOTE(cdata): This SVG filter is a stop-gap until we can implement
         support for dynamic re-coloring of UI components -->
    <defs>
      <filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%">
        <feGaussianBlur in="SourceAlpha" stdDeviation="1"/>
        <feOffset dx="0" dy="0" result="offsetblur"/>
        <feFlood flood-color="#000000"/>
        <feComposite in2="offsetblur" operator="in"/>
        <feMerge>
          <feMergeNode/>
          <feMergeNode in="SourceGraphic"/>
        </feMerge>
      </filter>
    </defs>
    <path filter="url(#drop-shadow)" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
    <path d="M0 0h24v24H0z" fill="none"/>
</svg>`});var pS,mS=oe(()=>{Uc();pS=eo`
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="36">
    <defs>
        <path id="A" d="M.001.232h24.997V36H.001z" />
    </defs>
    <g transform="translate(-11 -4)" fill="none" fill-rule="evenodd">
        <path fill-opacity="0" fill="#fff" d="M0 0h44v44H0z" />
        <g transform="translate(11 3)">
            <path d="M8.733 11.165c.04-1.108.766-2.027 1.743-2.307a2.54 2.54 0 0 1 .628-.089c.16 0 .314.017.463.044 1.088.2 1.9 1.092 1.9 2.16v8.88h1.26c2.943-1.39 5-4.45 5-8.025a9.01 9.01 0 0 0-1.9-5.56l-.43-.5c-.765-.838-1.683-1.522-2.712-2-1.057-.49-2.226-.77-3.46-.77s-2.4.278-3.46.77c-1.03.478-1.947 1.162-2.71 2l-.43.5a9.01 9.01 0 0 0-1.9 5.56 9.04 9.04 0 0 0 .094 1.305c.03.21.088.41.13.617l.136.624c.083.286.196.56.305.832l.124.333a8.78 8.78 0 0 0 .509.953l.065.122a8.69 8.69 0 0 0 3.521 3.191l1.11.537v-9.178z" fill-opacity=".5" fill="#e4e4e4" />
            <path d="M22.94 26.218l-2.76 7.74c-.172.485-.676.8-1.253.8H12.24c-1.606 0-3.092-.68-3.98-1.82-1.592-2.048-3.647-3.822-6.11-5.27-.095-.055-.15-.137-.152-.23-.004-.1.046-.196.193-.297.56-.393 1.234-.6 1.926-.6a3.43 3.43 0 0 1 .691.069l4.922.994V10.972c0-.663.615-1.203 1.37-1.203s1.373.54 1.373 1.203v9.882h2.953c.273 0 .533.073.757.21l6.257 3.874c.027.017.045.042.07.06.41.296.586.77.426 1.22M4.1 16.614c-.024-.04-.042-.083-.065-.122a8.69 8.69 0 0 1-.509-.953c-.048-.107-.08-.223-.124-.333l-.305-.832c-.058-.202-.09-.416-.136-.624l-.13-.617a9.03 9.03 0 0 1-.094-1.305c0-2.107.714-4.04 1.9-5.56l.43-.5c.764-.84 1.682-1.523 2.71-2 1.058-.49 2.226-.77 3.46-.77s2.402.28 3.46.77c1.03.477 1.947 1.16 2.712 2l.428.5a9 9 0 0 1 1.901 5.559c0 3.577-2.056 6.636-5 8.026h-1.26v-8.882c0-1.067-.822-1.96-1.9-2.16-.15-.028-.304-.044-.463-.044-.22 0-.427.037-.628.09-.977.28-1.703 1.198-1.743 2.306v9.178l-1.11-.537C6.18 19.098 4.96 18 4.1 16.614M22.97 24.09l-6.256-3.874c-.102-.063-.218-.098-.33-.144 2.683-1.8 4.354-4.855 4.354-8.243 0-.486-.037-.964-.104-1.43a9.97 9.97 0 0 0-1.57-4.128l-.295-.408-.066-.092a10.05 10.05 0 0 0-.949-1.078c-.342-.334-.708-.643-1.094-.922-1.155-.834-2.492-1.412-3.94-1.65l-.732-.088-.748-.03a9.29 9.29 0 0 0-1.482.119c-1.447.238-2.786.816-3.94 1.65a9.33 9.33 0 0 0-.813.686 9.59 9.59 0 0 0-.845.877l-.385.437-.36.5-.288.468-.418.778-.04.09c-.593 1.28-.93 2.71-.93 4.222 0 3.832 2.182 7.342 5.56 8.938l1.437.68v4.946L5 25.64a4.44 4.44 0 0 0-.888-.086c-.017 0-.034.003-.05.003-.252.004-.503.033-.75.08a5.08 5.08 0 0 0-.237.056c-.193.046-.382.107-.568.18-.075.03-.15.057-.225.1-.25.114-.494.244-.723.405a1.31 1.31 0 0 0-.566 1.122 1.28 1.28 0 0 0 .645 1.051C4 29.925 5.96 31.614 7.473 33.563a5.06 5.06 0 0 0 .434.491c1.086 1.082 2.656 1.713 4.326 1.715h6.697c.748-.001 1.43-.333 1.858-.872.142-.18.256-.38.336-.602l2.757-7.74c.094-.26.13-.53.112-.794s-.088-.52-.203-.76a2.19 2.19 0 0 0-.821-.91" fill-opacity=".6" fill="#000" />
            <path d="M22.444 24.94l-6.257-3.874a1.45 1.45 0 0 0-.757-.211h-2.953v-9.88c0-.663-.616-1.203-1.373-1.203s-1.37.54-1.37 1.203v16.643l-4.922-.994a3.44 3.44 0 0 0-.692-.069 3.35 3.35 0 0 0-1.925.598c-.147.102-.198.198-.194.298.004.094.058.176.153.23 2.462 1.448 4.517 3.22 6.11 5.27.887 1.14 2.373 1.82 3.98 1.82h6.686c.577 0 1.08-.326 1.253-.8l2.76-7.74c.16-.448-.017-.923-.426-1.22-.025-.02-.043-.043-.07-.06z" fill="#fff" />
            <g transform="translate(0 .769)">
                <mask id="B" fill="#fff">
                    <use xlink:href="#A" />
                </mask>
                <path d="M23.993 24.992a1.96 1.96 0 0 1-.111.794l-2.758 7.74c-.08.22-.194.423-.336.602-.427.54-1.11.87-1.857.872h-6.698c-1.67-.002-3.24-.633-4.326-1.715-.154-.154-.3-.318-.434-.49C5.96 30.846 4 29.157 1.646 27.773c-.385-.225-.626-.618-.645-1.05a1.31 1.31 0 0 1 .566-1.122 4.56 4.56 0 0 1 .723-.405l.225-.1a4.3 4.3 0 0 1 .568-.18l.237-.056c.248-.046.5-.075.75-.08.018 0 .034-.003.05-.003.303-.001.597.027.89.086l3.722.752V20.68l-1.436-.68c-3.377-1.596-5.56-5.106-5.56-8.938 0-1.51.336-2.94.93-4.222.015-.03.025-.06.04-.09.127-.267.268-.525.418-.778.093-.16.186-.316.288-.468.063-.095.133-.186.2-.277L3.773 5c.118-.155.26-.29.385-.437.266-.3.544-.604.845-.877a9.33 9.33 0 0 1 .813-.686C6.97 2.167 8.31 1.59 9.757 1.35a9.27 9.27 0 0 1 1.481-.119 8.82 8.82 0 0 1 .748.031c.247.02.49.05.733.088 1.448.238 2.786.816 3.94 1.65.387.28.752.588 1.094.922a9.94 9.94 0 0 1 .949 1.078l.066.092c.102.133.203.268.295.408a9.97 9.97 0 0 1 1.571 4.128c.066.467.103.945.103 1.43 0 3.388-1.67 6.453-4.353 8.243.11.046.227.08.33.144l6.256 3.874c.37.23.645.55.82.9.115.24.185.498.203.76m.697-1.195c-.265-.55-.677-1.007-1.194-1.326l-5.323-3.297c2.255-2.037 3.564-4.97 3.564-8.114 0-2.19-.637-4.304-1.84-6.114-.126-.188-.26-.37-.4-.552-.645-.848-1.402-1.6-2.252-2.204C15.472.91 13.393.232 11.238.232A10.21 10.21 0 0 0 5.23 2.19c-.848.614-1.606 1.356-2.253 2.205-.136.18-.272.363-.398.55C1.374 6.756.737 8.87.737 11.06c0 4.218 2.407 8.08 6.133 9.842l.863.41v3.092l-2.525-.51c-.356-.07-.717-.106-1.076-.106a5.45 5.45 0 0 0-3.14.996c-.653.46-1.022 1.202-.99 1.983a2.28 2.28 0 0 0 1.138 1.872c2.24 1.318 4.106 2.923 5.543 4.772 1.26 1.62 3.333 2.59 5.55 2.592h6.698c1.42-.001 2.68-.86 3.134-2.138l2.76-7.74c.272-.757.224-1.584-.134-2.325" fill-opacity=".05" fill="#000" mask="url(#B)" />
            </g>
        </g>
    </g>
</svg>`});var AS,gS=oe(()=>{Uc();AS=eo`
<svg version="1.1" id="view_x5F_in_x5F_AR_x5F_icon"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px"
	 viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
<rect id="Bounding_Box" x="0" y="0" fill="none" width="24" height="24"/>
<g id="Art_layer">
	<path d="M3,4c0-0.55,0.45-1,1-1h2V1H4C2.35,1,1,2.35,1,4v2h2V4z"/>
	<path d="M20,3c0.55,0,1,0.45,1,1v2h2V4c0-1.65-1.35-3-3-3h-2v2H20z"/>
	<path d="M4,21c-0.55,0-1-0.45-1-1v-2H1v2c0,1.65,1.35,3,3,3h2v-2H4z"/>
	<path d="M20,21c0.55,0,1-0.45,1-1v-2h2v2c0,1.65-1.35,3-3,3h-2v-2H20z"/>
	<g>
		<path d="M18.25,7.6l-5.5-3.18c-0.46-0.27-1.04-0.27-1.5,0L5.75,7.6C5.29,7.87,5,8.36,5,8.9v6.35c0,0.54,0.29,1.03,0.75,1.3
			l5.5,3.18c0.46,0.27,1.04,0.27,1.5,0l5.5-3.18c0.46-0.27,0.75-0.76,0.75-1.3V8.9C19,8.36,18.71,7.87,18.25,7.6z M7,14.96v-4.62
			l4,2.32v4.61L7,14.96z M12,10.93L8,8.61l4-2.31l4,2.31L12,10.93z M13,17.27v-4.61l4-2.32v4.62L13,17.27z"/>
	</g>
</g>
</svg>`});var _N,yS,bS=oe(()=>{Uc();fS();mS();gS();_N=eo`
<style>
:host {
  display: block;
  position: relative;
  contain: strict;
  width: 300px;
  height: 150px;
}

.container {
  position: relative;
  overflow: hidden;
}

.userInput {
  width: 100%;
  height: 100%;
  display: none;
  position: relative;
  outline-offset: -1px;
  outline-width: 1px;
}

canvas {
  position: absolute;
  display: none;
  pointer-events: none;
  /* NOTE(cdata): Chrome 76 and below apparently have a bug
   * that causes our canvas not to display pixels unless it is
   * on its own render layer
   * @see https://github.com/google/model-viewer/pull/755#issuecomment-536597893
   */
  transform: translateZ(0);
}

.show {
  display: block;
}

/* Adapted from HTML5 Boilerplate
 *
 * @see https://github.com/h5bp/html5-boilerplate/blob/ceb4620c78fc82e13534fc44202a3f168754873f/dist/css/main.css#L122-L133 */
.screen-reader-only {
  border: 0;
  left: 0;
  top: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  pointer-events: none;
}

.slot {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slot > * {
  pointer-events: initial;
}

.annotation-wrapper ::slotted(*) {
  opacity: var(--max-hotspot-opacity, 1);
  transition: opacity 0.3s;
}

.pointer-tumbling .annotation-wrapper ::slotted(*) {
  pointer-events: none;
}

.annotation-wrapper ::slotted(*) {
  pointer-events: initial;
}

.annotation-wrapper.hide ::slotted(*) {
  opacity: var(--min-hotspot-opacity, 0.25);
}

.slot.poster {
  display: none;
  background-color: inherit;
}

.slot.poster.show {
  display: inherit;
}

.slot.poster > * {
  pointer-events: initial;
}

.slot.poster:not(.show) > * {
  pointer-events: none;
}

#default-poster {
  width: 100%;
  height: 100%;
  /* The default poster is a <button> so we need to set display
   * to prevent it from being affected by text-align: */
  display: block;
  position: absolute;
  border: none;
  padding: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff0;
}

#default-progress-bar {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

#default-progress-bar > .bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--progress-bar-height, 5px);
  background-color: var(--progress-bar-color, rgba(0, 0, 0, 0.4));
  transition: transform 0.09s;
  transform-origin: top left;
  transform: scaleX(0);
  overflow: hidden;
}

#default-progress-bar > .bar.hide {
  transition: opacity 0.3s 1s;
  opacity: 0;
}

.centered {
  align-items: center;
  justify-content: center;
}

.cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.slot.interaction-prompt {
  display: var(--interaction-prompt-display, flex);
  overflow: hidden;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.3s;
}

.slot.interaction-prompt.visible {
  opacity: 1;
}

.animated-container {
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.3s;
}

.slot.interaction-prompt > * {
  pointer-events: none;
}

.slot.ar-button {
  -moz-user-select: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;

  display: var(--ar-button-display, block);
}

.slot.ar-button:not(.enabled) {
  display: none;
}

.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background-color: #fff;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15);
  border-radius: 100px;
}

.fab > * {
  opacity: 0.87;
}

#default-ar-button {
  position: absolute;
  bottom: 16px;
  right: 16px;
  transform: scale(var(--ar-button-scale, 1));
  transform-origin: bottom right;
}

.slot.pan-target {
  display: block;
  position: absolute;
  width: 0;
  height: 0;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  background-color: transparent;
  opacity: 0;
  transition: opacity 0.3s;
}

#default-pan-target {
  width: 6px;
  height: 6px;
  border-radius: 6px;
  border: 1px solid white;
  box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.8);
}

.slot.default {
  pointer-events: none;
}

.slot.progress-bar {
  pointer-events: none;
}

.slot.exit-webxr-ar-button {
  pointer-events: none;
}

.slot.exit-webxr-ar-button:not(.enabled) {
  display: none;
}

#default-exit-webxr-ar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: env(safe-area-inset-top, 16px);
  right: 16px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
}

#default-exit-webxr-ar-button > svg {
  fill: #fff;
}
</style>
<div class="container">
  <div class="userInput" tabindex="0" role="img"
      aria-label="3D model">
      <div class="slot canvas">
        <slot name="canvas">
          <canvas></canvas>
        </slot>
      </div>

  </div>

  <!-- NOTE(cdata): We need to wrap slots because browsers without ShadowDOM
        will have their <slot> elements removed by ShadyCSS -->
  <div class="slot poster">
    <slot name="poster">
      <button type="button" id="default-poster" aria-hidden="true" aria-label="Loading 3D model"></button>
    </slot>
  </div>

  <div class="slot ar-button">
    <slot name="ar-button">
      <a id="default-ar-button" part="default-ar-button" class="fab"
          tabindex="2"
          role="button"
          href="javascript:void(0);"
          aria-label="View in your space">
        ${AS}
      </a>
    </slot>
  </div>

  <div class="slot pan-target">
    <slot name="pan-target">
      <div id="default-pan-target">
      </div>
    </slot>
  </div>

  <div class="slot interaction-prompt cover centered">
    <div id="prompt" class="animated-container">
      <slot name="interaction-prompt" aria-hidden="true">
        ${pS}
      </slot>
    </div>
  </div>

  <div id="finger0" class="animated-container cover">
    <slot name="finger0" aria-hidden="true">
    </slot>
  </div>
  <div id="finger1" class="animated-container cover">
    <slot name="finger1" aria-hidden="true">
    </slot>
  </div>

  <div class="slot default">
    <slot></slot>

    <div class="slot progress-bar">
      <slot name="progress-bar">
        <div id="default-progress-bar" aria-hidden="true">
          <div class="bar" part="default-progress-bar"></div>
        </div>
      </slot>
    </div>

    <div class="slot exit-webxr-ar-button">
      <slot name="exit-webxr-ar-button">
        <a id="default-exit-webxr-ar-button" part="default-exit-webxr-ar-button"
            tabindex="3"
            aria-label="Exit AR"
            aria-hidden="true">
          ${dS}
        </a>
      </slot>
    </div>
  </div>
</div>
<div class="screen-reader-only" role="region" aria-label="Live announcements">
  <span id="status" role="status"></span>
</div>`,yS=i=>{Kf(_N,i)}});var Og,xS=oe(()=>{Og=(function(){"use strict";var i="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:i,r,o=WebAssembly.instantiate(a(s),{}).then(function(m){r=m.instance,r.exports.__wasm_call_ctors()});function a(m){for(var b=new Uint8Array(m.length),x=0;x<m.length;++x){var y=m.charCodeAt(x);b[x]=y>96?y-97:y>64?y-39:y+4}for(var _=0,x=0;x<m.length;++x)b[_++]=b[x]<60?n[b[x]]:(b[x]-60)*64+b[++x];return b.buffer.slice(0,_)}function c(m,b,x,y,_,S){var C=r.exports.sbrk,w=x+3&-4,v=C(w*y),E=C(_.length),R=new Uint8Array(r.exports.memory.buffer);R.set(_,E);var F=m(v,x,y,E,_.length);if(F==0&&S&&S(v,w,y),b.set(R.subarray(v,v+x*y)),C(v-C(0)),F!=0)throw new Error("Malformed buffer data: "+F)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function f(m){var b={object:new Worker(m),pending:0,requests:{}};return b.object.onmessage=function(x){var y=x.data;b.pending-=y.count,b.requests[y.id][y.action](y.value),delete b.requests[y.id]},b}function p(m){for(var b="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+A.toString(),x=new Blob([b],{type:"text/javascript"}),y=URL.createObjectURL(x),_=0;_<m;++_)u[_]=f(y);URL.revokeObjectURL(y)}function g(m,b,x,y,_){for(var S=u[0],C=1;C<u.length;++C)u[C].pending<S.pending&&(S=u[C]);return new Promise(function(w,v){var E=new Uint8Array(x),R=d++;S.pending+=m,S.requests[R]={resolve:w,reject:v},S.object.postMessage({id:R,count:m,size:b,source:E,mode:y,filter:_},[E.buffer])})}function A(m){o.then(function(){var b=m.data;try{var x=new Uint8Array(b.count*b.size);c(r.exports[b.mode],x,b.count,b.size,b.source,r.exports[b.filter]),self.postMessage({id:b.id,count:b.count,action:"resolve",value:x},[x.buffer])}catch(y){self.postMessage({id:b.id,count:b.count,action:"reject",value:y})}})}return{ready:o,supported:!0,useWorkers:function(m){p(m)},decodeVertexBuffer:function(m,b,x,y,_){c(r.exports.meshopt_decodeVertexBuffer,m,b,x,y,r.exports[l[_]])},decodeIndexBuffer:function(m,b,x,y){c(r.exports.meshopt_decodeIndexBuffer,m,b,x,y)},decodeIndexSequence:function(m,b,x,y){c(r.exports.meshopt_decodeIndexSequence,m,b,x,y)},decodeGltfBuffer:function(m,b,x,y,_,S){c(r.exports[h[_]],m,b,x,y,r.exports[l[S]])},decodeGltfBufferAsync:function(m,b,x,y,_){return u.length>0?g(m,b,x,h[y],l[_]):o.then(function(){var S=new Uint8Array(m*b);return c(r.exports[h[y]],S,m,b,x,r.exports[l[_]]),S})}}})()});function vN(){let i,e;onmessage=function(o){let a=o.data;switch(a.type){case"init":i=a.decoderConfig,e=new Promise(function(h){i.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(i)});break;case"decode":let c=a.buffer,l=a.taskConfig;e.then(h=>{let u=h.draco,d=new u.Decoder;try{let f=t(u,d,new Int8Array(c),l),p=f.attributes.map(g=>g.array.buffer);f.index&&p.push(f.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:f},p)}catch(f){console.error(f),self.postMessage({type:"error",id:a.id,error:f.message})}finally{u.destroy(d)}});break}};function t(o,a,c,l){let h=l.attributeIDs,u=l.attributeTypes,d,f,p=a.GetEncodedGeometryType(c);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeArrayToMesh(c,c.byteLength,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeArrayToPointCloud(c,c.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let g={index:null,attributes:[]};for(let A in h){let m=self[u[A]],b,x;if(l.useUniqueIDs)x=h[A],b=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[h[A]]),x===-1)continue;b=a.GetAttribute(d,x)}let y=s(o,a,d,A,m,b);A==="color"&&(y.vertexColorSpace=l.vertexColorSpace),g.attributes.push(y)}return p===o.TRIANGULAR_MESH&&(g.index=n(o,a,d)),o.destroy(d),g}function n(o,a,c){let h=c.num_faces()*3,u=h*4,d=o._malloc(u);a.GetTrianglesUInt32Array(c,u,d);let f=new Uint32Array(o.HEAPF32.buffer,d,h).slice();return o._free(d),{array:f,itemSize:1}}function s(o,a,c,l,h,u){let d=u.num_components(),p=c.num_points()*d,g=p*h.BYTES_PER_ELEMENT,A=r(o,h),m=o._malloc(g);a.GetAttributeDataArrayForAllPoints(c,u,A,g,m);let b=new h(o.HEAPF32.buffer,m,p).slice();return o._free(m),{name:l,array:b,itemSize:d}}function r(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var Ng,tp,_S=oe(()=>{Xe();Ng=new WeakMap,tp=class extends ln{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,s){let r=new En(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,o=>{this.parse(o,t,s)},n,s)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,at,n).catch(n)}decodeDracoFile(e,t,n,s,r=st,o=()=>{}){let a={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:r};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){let n=JSON.stringify(t);if(Ng.has(e)){let c=Ng.get(e);if(c.key===n)return c.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s,r=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(r,o).then(c=>(s=c,new Promise((l,h)=>{s._callbacks[r]={resolve:l,reject:h},s.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return a.catch(()=>!0).then(()=>{s&&r&&this._releaseTask(s,r)}),Ng.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new Zt;e.index&&t.setIndex(new yt(e.index.array,1));for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n],r=s.name,o=s.array,a=s.itemSize,c=new yt(o,a);r==="color"&&(this._assignVertexColorSpace(c,s.vertexColorSpace),c.normalized=!(o instanceof Float32Array)),t.setAttribute(r,c)}return t}_assignVertexColorSpace(e,t){if(t!==at)return;let n=new Ce;for(let s=0,r=e.count;s<r;s++)n.fromBufferAttribute(e,s),it.toWorkingColorSpace(n,at),e.setXYZ(s,n.r,n.g,n.b)}_loadLibrary(e,t){let n=new En(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((s,r)=>{n.load(e,s,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let s=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let r=vN.toString(),o=["/* draco decoder */",s,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(r){let o=r.data;switch(o.type){case"decode":s._callbacks[o.id].resolve(o);break;case"error":s._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,r){return s._taskLoad>r._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}});function Ug(i,e){if(e===XA)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===Ic||e===Bh){let t=i.getIndex();if(t===null){let o=[],a=i.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)o.push(c);i.setIndex(o),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}let n=t.count-2,s=[];if(e===Ic)for(let o=1;o<=n;o++)s.push(t.getX(0)),s.push(t.getX(o)),s.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(s.push(t.getX(o)),s.push(t.getX(o+1)),s.push(t.getX(o+2))):(s.push(t.getX(o+2)),s.push(t.getX(o+1)),s.push(t.getX(o)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let r=i.clone();return r.setIndex(s),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}var vS=oe(()=>{Xe()});function EN(){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={}}}}function CN(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new _s({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:qn})),i.DefaultMaterial}function da(i,e,t){for(let n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function fr(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 MN(i,e,t){let n=!1,s=!1,r=!1;for(let l=0,h=e.length;l<h;l++){let u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(s=!0),u.COLOR_0!==void 0&&(r=!0),n&&s&&r)break}if(!n&&!s&&!r)return Promise.resolve(i);let o=[],a=[],c=[];for(let l=0,h=e.length;l<h;l++){let u=e[l];if(n){let d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):i.attributes.position;o.push(d)}if(s){let d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):i.attributes.normal;a.push(d)}if(r){let d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):i.attributes.color;c.push(d)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c)]).then(function(l){let h=l[0],u=l[1],d=l[2];return n&&(i.morphAttributes.position=h),s&&(i.morphAttributes.normal=u),r&&(i.morphAttributes.color=d),i.morphTargetsRelative=!0,i})}function TN(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)){let t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function IN(i){let e,t=i.extensions&&i.extensions[ct.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Qg(t.attributes):e=i.indices+":"+Qg(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+Qg(i.targets[n]);return e}function Qg(i){let e="",t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function d0(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 RN(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":i.search(/\.ktx2($|\?)/i)>0||i.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}function DN(i,e,t){let n=e.attributes,s=new jt;if(n.POSITION!==void 0){let a=t.json.accessors[n.POSITION],c=a.min,l=a.max;if(c!==void 0&&l!==void 0){if(s.set(new D(c[0],c[1],c[2]),new D(l[0],l[1],l[2])),a.normalized){let h=d0(zc[a.componentType]);s.min.multiplyScalar(h),s.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let r=e.targets;if(r!==void 0){let a=new D,c=new D;for(let l=0,h=r.length;l<h;l++){let u=r[l];if(u.POSITION!==void 0){let d=t.json.accessors[u.POSITION],f=d.min,p=d.max;if(f!==void 0&&p!==void 0){if(c.setX(Math.max(Math.abs(f[0]),Math.abs(p[0]))),c.setY(Math.max(Math.abs(f[1]),Math.abs(p[1]))),c.setZ(Math.max(Math.abs(f[2]),Math.abs(p[2]))),d.normalized){let g=d0(zc[d.componentType]);c.multiplyScalar(g)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(a)}i.boundingBox=s;let o=new vn;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=o}function CS(i,e,t){let n=e.attributes,s=[];function r(o,a){return t.getDependency("accessor",o).then(function(c){i.setAttribute(a,c)})}for(let o in n){let a=u0[o]||o.toLowerCase();a in i.attributes||s.push(r(n[o],a))}if(e.indices!==void 0&&!i.index){let o=t.getDependency("accessor",e.indices).then(function(a){i.setIndex(a)});s.push(o)}return it.workingColorSpace!==st&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${it.workingColorSpace}" not supported.`),fr(i,e),DN(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?MN(i,e.targets,t):i})}var np,ct,zg,Hg,Vg,Wg,qg,Kg,$g,Xg,Yg,jg,Jg,Zg,e0,t0,n0,i0,s0,r0,MS,zh,ES,o0,a0,c0,l0,ip,SN,h0,Ni,zc,SS,wS,kg,u0,to,wN,Gg,BN,f0,TS=oe(()=>{Xe();vS();np=class extends ln{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Wg(t)}),this.register(function(t){return new qg(t)}),this.register(function(t){return new t0(t)}),this.register(function(t){return new n0(t)}),this.register(function(t){return new i0(t)}),this.register(function(t){return new $g(t)}),this.register(function(t){return new Xg(t)}),this.register(function(t){return new Yg(t)}),this.register(function(t){return new jg(t)}),this.register(function(t){return new Vg(t)}),this.register(function(t){return new Jg(t)}),this.register(function(t){return new Kg(t)}),this.register(function(t){return new e0(t)}),this.register(function(t){return new Zg(t)}),this.register(function(t){return new zg(t)}),this.register(function(t){return new s0(t)}),this.register(function(t){return new r0(t)})}load(e,t,n,s){let r=this,o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){let l=rr.extractUrlBase(e);o=rr.resolveURL(l,this.path)}else o=rr.extractUrlBase(e);this.manager.itemStart(e);let a=function(l){s?s(l):console.error(l),r.manager.itemError(e),r.manager.itemEnd(e)},c=new En(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{r.parse(l,o,function(h){t(h),r.manager.itemEnd(e)},a)}catch(h){a(h)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}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,s){let r,o={},a={},c=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===MS){try{o[ct.KHR_BINARY_GLTF]=new o0(e)}catch(u){s&&s(u);return}r=JSON.parse(o[ct.KHR_BINARY_GLTF].content)}else r=JSON.parse(c.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let l=new f0(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){let u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,o[u.name]=!0}if(r.extensionsUsed)for(let h=0;h<r.extensionsUsed.length;++h){let u=r.extensionsUsed[h],d=r.extensionsRequired||[];switch(u){case ct.KHR_MATERIALS_UNLIT:o[u]=new Hg;break;case ct.KHR_DRACO_MESH_COMPRESSION:o[u]=new a0(r,this.dracoLoader);break;case ct.KHR_TEXTURE_TRANSFORM:o[u]=new c0;break;case ct.KHR_MESH_QUANTIZATION:o[u]=new l0;break;default:d.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(n,s)}parseAsync(e,t){let n=this;return new Promise(function(s,r){n.parse(e,t,s,r)})}};ct={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_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},zg=class{constructor(e){this.parser=e,this.name=ct.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n="light:"+e,s=t.cache.get(n);if(s)return s;let r=t.json,c=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e],l,h=new Ce(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],st);let u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new Wo(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new Vo(h),l.distance=u;break;case"spot":l=new _h(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),l.decay=2,fr(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),s=Promise.resolve(l),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(c){return n._getNodeRef(t.cache,a,c)})}},Hg=class{constructor(){this.name=ct.KHR_MATERIALS_UNLIT}getMaterialType(){return Jt}extendParams(e,t,n){let s=[];e.color=new Ce(1,1,1),e.opacity=1;let r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let o=r.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],st),e.opacity=o[3]}r.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",r.baseColorTexture,at))}return Promise.all(s)}},Vg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}},Wg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(r.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){let a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Fe(a,a)}return Promise.all(r)}},qg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_DISPERSION}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}},Kg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&r.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(r)}},$g=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_SHEEN}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[];t.sheenColor=new Ce(0,0,0),t.sheenRoughness=0,t.sheen=1;let o=s.extensions[this.name];if(o.sheenColorFactor!==void 0){let a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],st)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&r.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,at)),o.sheenRoughnessTexture!==void 0&&r.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(r)}},Xg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&r.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(r)}},Yg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_VOLUME}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&r.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;let a=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ce().setRGB(a[0],a[1],a[2],st),Promise.all(r)}},jg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_IOR}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}},Jg=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_SPECULAR}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&r.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));let a=o.specularColorFactor||[1,1,1];return t.specularColor=new Ce().setRGB(a[0],a[1],a[2],st),o.specularColorTexture!==void 0&&r.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,at)),Promise.all(r)}},Zg=class{constructor(e){this.parser=e,this.name=ct.EXT_MATERIALS_BUMP}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&r.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(r)}},e0=class{constructor(e){this.parser=e,this.name=ct.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:oi}extendMaterialParams(e,t){let n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],o=s.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&r.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(r)}},t0=class{constructor(e){this.parser=e,this.name=ct.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;let r=s.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}},n0=class{constructor(e){this.parser=e,this.name=ct.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;let o=r.extensions[t],a=s.images[o.source],c=n.textureLoader;if(a.uri){let l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return this.detectSupport().then(function(l){if(l)return n.loadTextureImage(e,o.source,c);if(s.extensionsRequired&&s.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){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},i0=class{constructor(e){this.parser=e,this.name=ct.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,s=n.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;let o=r.extensions[t],a=s.images[o.source],c=n.textureLoader;if(a.uri){let l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return this.detectSupport().then(function(l){if(l)return n.loadTextureImage(e,o.source,c);if(s.extensionsRequired&&s.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){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},s0=class{constructor(e){this.name=ct.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let s=n.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){let c=s.byteOffset||0,l=s.byteLength||0,h=s.count,u=s.byteStride,d=new Uint8Array(a,c,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,d,s.mode,s.filter).then(function(f){return f.buffer}):o.ready.then(function(){let f=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(f),h,u,d,s.mode,s.filter),f})})}else return null}},r0=class{constructor(e){this.name=ct.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let s=t.meshes[n.mesh];for(let l of s.primitives)if(l.mode!==Ni.TRIANGLES&&l.mode!==Ni.TRIANGLE_STRIP&&l.mode!==Ni.TRIANGLE_FAN&&l.mode!==void 0)return null;let o=n.extensions[this.name].attributes,a=[],c={};for(let l in o)a.push(this.parser.getDependency("accessor",o[l]).then(h=>(c[l]=h,c[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{let h=l.pop(),u=h.isGroup?h.children:[h],d=l[0].count,f=[];for(let p of u){let g=new Oe,A=new D,m=new $t,b=new D(1,1,1),x=new ch(p.geometry,p.material,d);for(let y=0;y<d;y++)c.TRANSLATION&&A.fromBufferAttribute(c.TRANSLATION,y),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,y),c.SCALE&&b.fromBufferAttribute(c.SCALE,y),x.setMatrixAt(y,g.compose(A,m,b));for(let y in c)if(y==="_COLOR_0"){let _=c[y];x.instanceColor=new Xr(_.array,_.itemSize,_.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&p.geometry.setAttribute(y,c[y]);Ct.prototype.copy.call(x,p),this.parser.assignFinalMaterial(x),f.push(x)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}},MS="glTF",zh=12,ES={JSON:1313821514,BIN:5130562},o0=class{constructor(e){this.name=ct.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,zh),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!==MS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let s=this.header.length-zh,r=new DataView(e,zh),o=0;for(;o<s;){let a=r.getUint32(o,!0);o+=4;let c=r.getUint32(o,!0);if(o+=4,c===ES.JSON){let l=new Uint8Array(e,zh+o,a);this.content=n.decode(l)}else if(c===ES.BIN){let l=zh+o;this.body=e.slice(l,l+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}},a0=class{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ct.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},c={},l={};for(let h in o){let u=u0[h]||h.toLowerCase();a[u]=o[h]}for(let h in e.attributes){let u=u0[h]||h.toLowerCase();if(o[h]!==void 0){let d=n.accessors[e.attributes[h]],f=zc[d.componentType];l[u]=f.name,c[u]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(h){return new Promise(function(u,d){s.decodeDracoFile(h,function(f){for(let p in f.attributes){let g=f.attributes[p],A=c[p];A!==void 0&&(g.normalized=A)}u(f)},a,l,st,d)})})}},c0=class{constructor(){this.name=ct.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}},l0=class{constructor(){this.name=ct.KHR_MESH_QUANTIZATION}},ip=class extends nr{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let o=0;o!==s;o++)t[o]=n[r+o];return t}interpolate_(e,t,n,s){let r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=a*2,l=a*3,h=s-t,u=(n-t)/h,d=u*u,f=d*u,p=e*l,g=p-l,A=-2*f+3*d,m=f-d,b=1-A,x=m-d+u;for(let y=0;y!==a;y++){let _=o[g+y+a],S=o[g+y+c]*h,C=o[p+y+a],w=o[p+y]*h;r[y]=b*_+x*S+A*C+m*w}return r}},SN=new $t,h0=class extends ip{interpolate_(e,t,n,s){let r=super.interpolate_(e,t,n,s);return SN.fromArray(r).normalize().toArray(r),r}},Ni={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},zc={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},SS={9728:Ft,9729:qe,9984:lr,9985:ts,9986:Oi,9987:rn},wS={33071:Bt,33648:es,10497:Dn},kg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u0={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"},to={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},wN={CUBICSPLINE:void 0,LINEAR:tr,STEP:er},Gg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};BN=new Oe,f0=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new EN,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,s=-1,r=!1,o=-1;if(typeof navigator<"u"){let a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;let c=a.match(/Version\/(\d+)/);s=n&&c?parseInt(c[1],10):-1,r=a.indexOf("Firefox")>-1,o=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||r&&o<98?this.textureLoader=new zo(this.options.manager):this.textureLoader=new Eh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new En(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){let n=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){let a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:n,userData:{}};return da(r,a,s),fr(a,s),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){for(let c of a.scenes)c.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,r=t.length;s<r;s++){let o=t[s].joints;for(let a=0,c=o.length;a<c;a++)e[o[a]].isBone=!0}for(let s=0,r=e.length;s<r;s++){let o=e[s];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let s=n.clone(),r=(o,a)=>{let c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(let[l,h]of o.children.entries())r(h,a.children[l])};return r(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let s=e(t[n]);if(s)return s}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let s=0;s<t.length;s++){let r=e(t[s]);r&&n.push(r)}return n}getDependency(e,t){let n=e+":"+t,s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":s=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(r,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){let 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[ct.KHR_BINARY_GLTF].body);let s=this.options;return new Promise(function(r,o){n.load(rr.resolveURL(t.uri,s.path),r,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){let s=t.byteLength||0,r=t.byteOffset||0;return n.slice(r,r+s)})}loadAccessor(e){let t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){let o=kg[s.type],a=zc[s.componentType],c=s.normalized===!0,l=new a(s.count*o);return Promise.resolve(new yt(l,o,c))}let r=[];return s.bufferView!==void 0?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),s.sparse!==void 0&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(o){let a=o[0],c=kg[s.type],l=zc[s.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,d=s.byteOffset||0,f=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,p=s.normalized===!0,g,A;if(f&&f!==u){let m=Math.floor(d/f),b="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+m+":"+s.count,x=t.cache.get(b);x||(g=new l(a,m*f,s.count*f/h),x=new dc(g,f/h),t.cache.add(b,x)),A=new fc(x,c,d%f/h,p)}else a===null?g=new l(s.count*c):g=new l(a,d,s.count*c),A=new yt(g,c,p);if(s.sparse!==void 0){let m=kg.SCALAR,b=zc[s.sparse.indices.componentType],x=s.sparse.indices.byteOffset||0,y=s.sparse.values.byteOffset||0,_=new b(o[1],x,s.sparse.count*m),S=new l(o[2],y,s.sparse.count*c);a!==null&&(A=new yt(A.array.slice(),A.itemSize,A.normalized)),A.normalized=!1;for(let C=0,w=_.length;C<w;C++){let v=_[C];if(A.setX(v,S[C*c]),c>=2&&A.setY(v,S[C*c+1]),c>=3&&A.setZ(v,S[C*c+2]),c>=4&&A.setW(v,S[C*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}A.normalized=p}return A})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,o=t.images[r],a=this.textureLoader;if(o.uri){let c=n.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let s=this,r=this.json,o=r.textures[e],a=r.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];let l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);let d=(r.samplers||{})[o.sampler]||{};return h.magFilter=SS[d.magFilter]||qe,h.minFilter=SS[d.minFilter]||rn,h.wrapS=wS[d.wrapS]||Dn,h.wrapT=wS[d.wrapT]||Dn,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Ft&&h.minFilter!==qe,s.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){let n=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());let o=s.images[e],a=self.URL||self.webkitURL,c=o.uri||"",l=!1;if(o.bufferView!==void 0)c=n.getDependency("bufferView",o.bufferView).then(function(u){l=!0;let d=new Blob([u],{type:o.mimeType});return c=a.createObjectURL(d),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let h=Promise.resolve(c).then(function(u){return new Promise(function(d,f){let p=d;t.isImageBitmapLoader===!0&&(p=function(g){let A=new bt(g);A.needsUpdate=!0,d(A)}),t.load(rr.resolveURL(u,r.path),p,void 0,f)})}).then(function(u){return l===!0&&a.revokeObjectURL(c),fr(u,o),u.userData.mimeType=o.mimeType||RN(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,s){let r=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),r.extensions[ct.KHR_TEXTURE_TRANSFORM]){let a=n.extensions!==void 0?n.extensions[ct.KHR_TEXTURE_TRANSFORM]:void 0;if(a){let c=r.associations.get(o);o=r.extensions[ct.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,c)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){let t=e.geometry,n=e.material,s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,c=this.cache.get(a);c||(c=new gc,Ln.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(a,c)),n=c}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,c=this.cache.get(a);c||(c=new Ac,Ln.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(a,c)),n=c}if(s||r||o){let a="ClonedMaterial:"+n.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=n.clone(),r&&(c.vertexColors=!0),o&&(c.flatShading=!0),s&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return _s}loadMaterial(e){let t=this,n=this.json,s=this.extensions,r=n.materials[e],o,a={},c=r.extensions||{},l=[];if(c[ct.KHR_MATERIALS_UNLIT]){let u=s[ct.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(a,r,t))}else{let u=r.pbrMetallicRoughness||{};if(a.color=new Ce(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){let d=u.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],st),a.opacity=d[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",u.baseColorTexture,at)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Ut);let h=r.alphaMode||Gg.OPAQUE;if(h===Gg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===Gg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Jt&&(l.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Fe(1,1),r.normalTexture.scale!==void 0)){let u=r.normalTexture.scale;a.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&o!==Jt&&(l.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Jt){let u=r.emissiveFactor;a.emissive=new Ce().setRGB(u[0],u[1],u[2],st)}return r.emissiveTexture!==void 0&&o!==Jt&&l.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,at)),Promise.all(l).then(function(){let u=new o(a);return r.name&&(u.name=r.name),fr(u,r),t.associations.set(u,{materials:e}),r.extensions&&da(s,u,r),u})}createUniqueName(e){let t=gt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,s=this.primitiveCache;function r(a){return n[ct.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return CS(c,a,t)})}let o=[];for(let a=0,c=e.length;a<c;a++){let l=e[a],h=IN(l),u=s[h];if(u)o.push(u.promise);else{let d;l.extensions&&l.extensions[ct.KHR_DRACO_MESH_COMPRESSION]?d=r(l):d=CS(new Zt,l,t),s[h]={primitive:l,promise:d},o.push(d)}}return Promise.all(o)}loadMesh(e){let t=this,n=this.json,s=this.extensions,r=n.meshes[e],o=r.primitives,a=[];for(let c=0,l=o.length;c<l;c++){let h=o[c].material===void 0?CN(this.cache):this.getDependency("material",o[c].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(c){let l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let f=0,p=h.length;f<p;f++){let g=h[f],A=o[f],m,b=l[f];if(A.mode===Ni.TRIANGLES||A.mode===Ni.TRIANGLE_STRIP||A.mode===Ni.TRIANGLE_FAN||A.mode===void 0)m=r.isSkinnedMesh===!0?new oh(g,b):new Ke(g,b),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),A.mode===Ni.TRIANGLE_STRIP?m.geometry=Ug(m.geometry,Bh):A.mode===Ni.TRIANGLE_FAN&&(m.geometry=Ug(m.geometry,Ic));else if(A.mode===Ni.LINES)m=new lh(g,b);else if(A.mode===Ni.LINE_STRIP)m=new xs(g,b);else if(A.mode===Ni.LINE_LOOP)m=new hh(g,b);else if(A.mode===Ni.POINTS)m=new uh(g,b);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(m.geometry.morphAttributes).length>0&&TN(m,r),m.name=t.createUniqueName(r.name||"mesh_"+e),fr(m,r),A.extensions&&da(s,m,A),t.assignFinalMaterial(m),u.push(m)}for(let f=0,p=u.length;f<p;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return r.extensions&&da(s,u[0],r),u[0];let d=new si;r.extensions&&da(s,d,r),t.associations.set(d,{meshes:e});for(let f=0,p=u.length;f<p;f++)d.add(u[f]);return d})}loadCamera(e){let t,n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Kt(ea.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new yi(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),fr(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let s=0,r=t.joints.length;s<r;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){let r=s.pop(),o=s,a=[],c=[];for(let l=0,h=o.length;l<h;l++){let u=o[l];if(u){a.push(u);let d=new Oe;r!==null&&d.fromArray(r.array,l*16),c.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new ah(a,c)})}loadAnimation(e){let t=this.json,n=this,s=t.animations[e],r=s.name?s.name:"animation_"+e,o=[],a=[],c=[],l=[],h=[];for(let u=0,d=s.channels.length;u<d;u++){let f=s.channels[u],p=s.samplers[f.sampler],g=f.target,A=g.node,m=s.parameters!==void 0?s.parameters[p.input]:p.input,b=s.parameters!==void 0?s.parameters[p.output]:p.output;g.node!==void 0&&(o.push(this.getDependency("node",A)),a.push(this.getDependency("accessor",m)),c.push(this.getDependency("accessor",b)),l.push(p),h.push(g))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){let d=u[0],f=u[1],p=u[2],g=u[3],A=u[4],m=[];for(let b=0,x=d.length;b<x;b++){let y=d[b],_=f[b],S=p[b],C=g[b],w=A[b];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();let v=n._createAnimationTracks(y,_,S,C,w);if(v)for(let E=0;E<v.length;E++)m.push(v[E])}return new Qo(r,void 0,m)})}createNodeMesh(e){let t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(r){let o=n._getNodeRef(n.meshCache,s.mesh,r);return s.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let c=0,l=s.weights.length;c<l;c++)a.morphTargetInfluences[c]=s.weights[c]}),o})}loadNode(e){let t=this.json,n=this,s=t.nodes[e],r=n._loadNodeShallow(e),o=[],a=s.children||[];for(let l=0,h=a.length;l<h;l++)o.push(n.getDependency("node",a[l]));let c=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([r,Promise.all(o),c]).then(function(l){let h=l[0],u=l[1],d=l[2];d!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(d,BN)});for(let f=0,p=u.length;f<p;f++)h.add(u[f]);return h})}_loadNodeShallow(e){let t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let r=t.nodes[e],o=r.name?s.createUniqueName(r.name):"",a=[],c=s._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&a.push(c),r.camera!==void 0&&a.push(s.getDependency("camera",r.camera).then(function(l){return s._getNodeRef(s.cameraCache,r.camera,l)})),s._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){a.push(l)}),this.nodeCache[e]=Promise.all(a).then(function(l){let h;if(r.isBone===!0?h=new pc:l.length>1?h=new si:l.length===1?h=l[0]:h=new Ct,h!==l[0])for(let u=0,d=l.length;u<d;u++)h.add(l[u]);if(r.name&&(h.userData.name=r.name,h.name=o),fr(h,r),r.extensions&&da(n,h,r),r.matrix!==void 0){let u=new Oe;u.fromArray(r.matrix),h.applyMatrix4(u)}else r.translation!==void 0&&h.position.fromArray(r.translation),r.rotation!==void 0&&h.quaternion.fromArray(r.rotation),r.scale!==void 0&&h.scale.fromArray(r.scale);return s.associations.has(h)||s.associations.set(h,{}),s.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],s=this,r=new si;n.name&&(r.name=s.createUniqueName(n.name)),fr(r,n),n.extensions&&da(t,r,n);let o=n.nodes||[],a=[];for(let c=0,l=o.length;c<l;c++)a.push(s.getDependency("node",o[c]));return Promise.all(a).then(function(c){for(let h=0,u=c.length;h<u;h++)r.add(c[h]);let l=h=>{let u=new Map;for(let[d,f]of s.associations)(d instanceof Ln||d instanceof bt)&&u.set(d,f);return h.traverse(d=>{let f=s.associations.get(d);f!=null&&u.set(d,f)}),u};return s.associations=l(r),r})}_createAnimationTracks(e,t,n,s,r){let o=[],a=e.name?e.name:e.uuid,c=[];to[r.path]===to.weights?e.traverse(function(d){d.morphTargetInfluences&&c.push(d.name?d.name:d.uuid)}):c.push(a);let l;switch(to[r.path]){case to.weights:l=vs;break;case to.rotation:l=Es;break;case to.position:case to.scale:l=Ss;break;default:switch(n.itemSize){case 1:l=vs;break;case 2:case 3:default:l=Ss;break}break}let h=s.interpolation!==void 0?wN[s.interpolation]:tr,u=this._getArrayFromAccessor(n);for(let d=0,f=c.length;d<f;d++){let p=new l(c[d]+"."+to[r.path],t.array,u,h);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(p),o.push(p)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let n=d0(t.constructor),s=new Float32Array(t.length);for(let r=0,o=t.length;r<o;r++)s[r]=t[r]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){let s=this instanceof Es?h0:ip;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}});var sp,IS=oe(()=>{sp=class{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){let 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){let n=this.workersResolve[e];if(n&&n(t),this.queue.length){let{resolve:s,msg:r,transfer:o}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(r,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{let s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=n,this.workers[s].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}}});function RS(i){return new TextDecoder().decode(i)}function BS(i){let e=new Uint8Array(i.buffer,i.byteOffset,$n.length);if(e[0]!==$n[0]||e[1]!==$n[1]||e[2]!==$n[2]||e[3]!==$n[3]||e[4]!==$n[4]||e[5]!==$n[5]||e[6]!==$n[6]||e[7]!==$n[7]||e[8]!==$n[8]||e[9]!==$n[9]||e[10]!==$n[10]||e[11]!==$n[11])throw new Error("Missing KTX 2.0 identifier.");let t=new p0,n=17*Uint32Array.BYTES_PER_ELEMENT,s=new fa(i,$n.length,n,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32();let r=s._nextUint32();t.supercompressionScheme=s._nextUint32();let o=s._nextUint32(),a=s._nextUint32(),c=s._nextUint32(),l=s._nextUint32(),h=s._nextUint64(),u=s._nextUint64(),d=new fa(i,$n.length+n,3*r*8,!0);for(let K=0;K<r;K++)t.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});let f=new fa(i,o,a,!0),p={vendorId:f._skip(4)._nextUint16(),descriptorType:f._nextUint16(),versionNumber:f._nextUint16(),descriptorBlockSize:f._nextUint16(),colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},g=(p.descriptorBlockSize/4-6)/4;for(let K=0;K<g;K++){let z={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&z.channelType?(z.sampleLower=f._nextInt32(),z.sampleUpper=f._nextInt32()):(z.sampleLower=f._nextUint32(),z.sampleUpper=f._nextUint32()),p.samples[K]=z}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(p);let A=new fa(i,c,l,!0);for(;A._offset<l;){let K=A._nextUint32(),z=A._scan(K),ee=RS(z);if(t.keyValue[ee]=A._nextUint8Array(K-z.byteLength-1),ee.match(/^ktx/i)){let ae=RS(t.keyValue[ee]);t.keyValue[ee]=ae.substring(0,ae.lastIndexOf("\0"))}A._skip(K%4?4-K%4:0)}if(u<=0)return t;let m=new fa(i,h,u,!0),b=m._nextUint16(),x=m._nextUint16(),y=m._nextUint32(),_=m._nextUint32(),S=m._nextUint32(),C=m._nextUint32(),w=[];for(let K=0;K<r;K++)w.push({imageFlags:m._nextUint32(),rgbSliceByteOffset:m._nextUint32(),rgbSliceByteLength:m._nextUint32(),alphaSliceByteOffset:m._nextUint32(),alphaSliceByteLength:m._nextUint32()});let v=h+m._offset,E=v+y,R=E+_,F=R+S,P=new Uint8Array(i.buffer,i.byteOffset+v,y),U=new Uint8Array(i.buffer,i.byteOffset+E,_),V=new Uint8Array(i.buffer,i.byteOffset+R,S),O=new Uint8Array(i.buffer,i.byteOffset+F,C);return t.globalData={endpointCount:b,selectorCount:x,imageDescs:w,endpointsData:P,selectorsData:U,tablesData:V,extendedData:O},t}var p0,fa,Q5,$n,DS=oe(()=>{p0=class{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}},fa=class{constructor(e,t,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=s,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);let n=this._offset,s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,s)}},Q5=new Uint8Array([0]),$n=[171,75,84,88,32,50,48,187,13,10,26,10]});var m0,pr,g0,A0,rp,LS,PS=oe(()=>{A0={env:{emscripten_notify_memory_growth:function(i){g0=new Uint8Array(pr.exports.memory.buffer)}}},rp=class{init(){return m0||(m0=typeof fetch<"u"?fetch("data:application/wasm;base64,"+LS).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,A0)).then(this._init):WebAssembly.instantiate(Buffer.from(LS,"base64"),A0).then(this._init),m0)}_init(e){pr=e.instance,A0.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!pr)throw new Error("ZSTDDecoder: Await .init() before decoding.");let n=e.byteLength,s=pr.exports.malloc(n);g0.set(e,s),t=t||Number(pr.exports.ZSTD_findDecompressedSize(s,n));let r=pr.exports.malloc(t),o=pr.exports.ZSTD_decompress(r,t,s,n),a=g0.slice(r,r+o);return pr.exports.free(s),pr.exports.free(r),a}},LS="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"});var FS,OS,NS=oe(()=>{FS="display-p3",OS="display-p3-linear"});async function GN(i){let{vkFormat:e}=i;if(_0[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;i.supercompressionScheme===2&&(x0||(x0=new Promise(async r=>{let o=new rp;await o.init(),r(o)})),t=await x0);let n=[];for(let r=0;r<i.levels.length;r++){let o=Math.max(1,i.pixelWidth>>r),a=Math.max(1,i.pixelHeight>>r),c=i.pixelDepth?Math.max(1,i.pixelDepth>>r):0,l=i.levels[r],h;if(i.supercompressionScheme===0)h=l.levelData;else if(i.supercompressionScheme===2)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;v0[e]===Ot?u=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):v0[e]===Lt?u=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):u=h,n.push({data:u,width:o,height:a,depth:c})}let s;if(kN.has(_0[e]))s=i.pixelDepth===0?new bs(n[0].data,i.pixelWidth,i.pixelHeight):new hc(n[0].data,i.pixelWidth,i.pixelHeight,i.pixelDepth);else{if(i.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new Fi(n,i.pixelWidth,i.pixelHeight),s.minFilter=n.length===1?qe:rn,s.magFilter=qe}return s.mipmaps=n,s.type=v0[e],s.format=_0[e],s.colorSpace=ew(i),s.needsUpdate=!0,Promise.resolve(s)}function ew(i){let e=i.dataFormatDescriptor[0];return e.colorPrimaries===1?e.transferFunction===2?at:st:e.colorPrimaries===10?e.transferFunction===2?FS:OS:e.colorPrimaries===0?Fn:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Fn)}var y0,b0,x0,mr,kN,_0,v0,tw=oe(()=>{Xe();IS();DS();PS();NS();y0=new WeakMap,b0=0,mr=class i extends ln{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new sp,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){let e=new En(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);let t=e.loadAsync("basis_transcoder.js"),n=new En(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);let s=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([r,o])=>{let a=i.BasisWorker.toString(),c=["/* constants */","let _EngineFormat = "+JSON.stringify(i.EngineFormat),"let _EngineType = "+JSON.stringify(i.EngineType),"let _TranscoderFormat = "+JSON.stringify(i.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(i.BasisFormat),"/* basis_transcoder.js */",r,"/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([c])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{let l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),b0>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),b0++}return this.transcoderPending}load(e,t,n,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let r=new En(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,o=>{this.parse(o,t,s)},n,s)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(y0.has(e))return y0.get(e).promise.then(t).catch(n);this._createTexture(e).then(s=>t?t(s):null).catch(n)}_createTextureFrom(e,t){let{type:n,error:s,data:{faces:r,width:o,height:a,format:c,type:l,dfdFlags:h}}=e;if(n==="error")return Promise.reject(s);let u;if(t.faceCount===6)u=new ph(r,c,l);else{let d=r[0].mipmaps;u=t.layerCount>1?new fh(d,o,a,t.layerCount,c,l):new Fi(d,o,a,c,l)}return u.minFilter=r[0].mipmaps.length===1?qe:rn,u.magFilter=qe,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=ew(t),u.premultiplyAlpha=!!(h&1),u}async _createTexture(e,t={}){let n=BS(new Uint8Array(e)),s=n.vkFormat===1000066e3&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===0||s&&!this.workerConfig.astcHDRSupported))return GN(n);let o=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(c=>this._createTextureFrom(c.data,n));return y0.set(e,{promise:a}),a}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),b0--,this}};mr.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};mr.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,BC6H:22,RGB_HALF:24,RGBA_HALF:25};mr.EngineFormat={RGBAFormat:vt,RGBA_ASTC_4x4_Format:Yo,RGB_BPTC_UNSIGNED_Format:Tc,RGBA_BPTC_Format:Jo,RGBA_ETC2_EAC_Format:Mc,RGBA_PVRTC_4BPPV1_Format:Sc,RGBA_S3TC_DXT5_Format:Xo,RGB_ETC1_Format:wc,RGB_ETC2_Format:Cc,RGB_PVRTC_4BPPV1_Format:Ec,RGBA_S3TC_DXT1_Format:$o};mr.EngineType={UnsignedByteType:kt,HalfFloatType:Lt,FloatType:Ot};mr.BasisWorker=function(){let i,e,t,n=_EngineFormat,s=_EngineType,r=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(p){let g=p.data;switch(g.type){case"init":i=g.config,a(g.transcoderBinary);break;case"transcode":e.then(()=>{try{let{faces:A,buffers:m,width:b,height:x,hasAlpha:y,format:_,type:S,dfdFlags:C}=c(g.buffer);self.postMessage({type:"transcode",id:g.id,data:{faces:A,width:b,height:x,hasAlpha:y,format:_,type:S,dfdFlags:C}},m)}catch(A){console.error(A),self.postMessage({type:"error",id:g.id,error:A.message})}});break}});function a(p){e=new Promise(g=>{t={wasmBinary:p,onRuntimeInitialized:g},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(p){let g=new t.KTX2File(new Uint8Array(p));function A(){g.close(),g.delete()}if(!g.isValid())throw A(),new Error("THREE.KTX2Loader:	Invalid or unsupported .ktx2 file");let m;if(g.isUASTC())m=o.UASTC;else if(g.isETC1S())m=o.ETC1S;else if(g.isHDR())m=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");let b=g.getWidth(),x=g.getHeight(),y=g.getLayers()||1,_=g.getLevels(),S=g.getFaces(),C=g.getHasAlpha(),w=g.getDFDFlags(),{transcoderFormat:v,engineFormat:E,engineType:R}=u(m,b,x,C);if(!b||!x||!_)throw A(),new Error("THREE.KTX2Loader:	Invalid texture");if(!g.startTranscoding())throw A(),new Error("THREE.KTX2Loader: .startTranscoding failed");let F=[],P=[];for(let U=0;U<S;U++){let V=[];for(let O=0;O<_;O++){let K=[],z,ee;for(let he=0;he<y;he++){let ve=g.getImageLevelInfo(O,he,U);U===0&&O===0&&he===0&&(ve.origWidth%4!==0||ve.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),_>1?(z=ve.origWidth,ee=ve.origHeight):(z=ve.width,ee=ve.height);let Le=new Uint8Array(g.getImageTranscodedSizeInBytes(O,he,0,v)),X=g.transcodeImage(Le,O,he,U,v,0,-1,-1);if(R===s.HalfFloatType&&(Le=new Uint16Array(Le.buffer,Le.byteOffset,Le.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!X)throw A(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Le)}let ae=f(K);V.push({data:ae,width:z,height:ee}),P.push(ae.buffer)}F.push({mipmaps:V,width:b,height:x,format:E,type:R})}return A(),{faces:F,buffers:P,width:b,height:x,hasAlpha:C,dfdFlags:w,format:E,type:R}}let l=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.BC1,r.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.ETC1],engineFormat:[n.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[o.UASTC_HDR],transcoderFormat:[r.BC6H],engineFormat:[n.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[r.RGBA32,r.RGBA32],engineFormat:[n.RGBAFormat,n.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[r.RGBA_HALF],engineFormat:[n.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[o.ETC1S]:l.filter(p=>p.basisFormat.includes(o.ETC1S)).sort((p,g)=>p.priorityUASTC-g.priorityUASTC),[o.UASTC]:l.filter(p=>p.basisFormat.includes(o.UASTC)).sort((p,g)=>p.priorityUASTC-g.priorityUASTC),[o.UASTC_HDR]:l.filter(p=>p.basisFormat.includes(o.UASTC_HDR)).sort((p,g)=>p.priorityHDR-g.priorityHDR)};function u(p,g,A,m){let b=h[p];for(let x=0;x<b.length;x++){let y=b[x];if(y.if&&!i[y.if]||!y.basisFormat.includes(p)||m&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(d(g)&&d(A)))continue;let _=y.transcoderFormat[m?1:0],S=y.engineFormat[m?1:0],C=y.engineType[0];return{transcoderFormat:_,engineFormat:S,engineType:C}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(p){return p<=2?!0:(p&p-1)===0&&p!==0}function f(p){if(p.length===1)return p[0];let g=0;for(let b=0;b<p.length;b++){let x=p[b];g+=x.byteLength}let A=new Uint8Array(g),m=0;for(let b=0;b<p.length;b++){let x=p[b];A.set(x,m),m+=x.byteLength}return A}};kN=new Set([vt,hr,Ms]),_0={109:vt,97:vt,37:vt,43:vt,103:hr,83:hr,16:hr,22:hr,100:Ms,76:Ms,15:Ms,9:Ms,1000066e3:Yo,166:jo,165:jo},v0={109:Ot,97:Lt,37:kt,43:kt,103:Ot,83:Lt,16:kt,22:kt,100:Ot,76:Lt,15:kt,9:kt,1000066e3:Lt,166:kt,165:kt}});var nw,iw,ss,Ar,op,Hh,S0,ap,sw=oe(()=>{ss=Symbol("retainerCount"),Ar=Symbol("recentlyUsed"),op=Symbol("evict"),Hh=Symbol("evictionThreshold"),S0=Symbol("cache"),ap=class{constructor(e,t=5){this[nw]=new Map,this[iw]=[],this[S0]=e,this[Hh]=t}set evictionThreshold(e){this[Hh]=e,this[op]()}get evictionThreshold(){return this[Hh]}get cache(){return this[S0]}retainerCount(e){return this[ss].get(e)||0}reset(){this[ss].clear(),this[Ar]=[]}retain(e){this[ss].has(e)||this[ss].set(e,0),this[ss].set(e,this[ss].get(e)+1);let t=this[Ar].indexOf(e);t!==-1&&this[Ar].splice(t,1),this[Ar].unshift(e),this[op]()}release(e){this[ss].has(e)&&this[ss].set(e,Math.max(this[ss].get(e)-1,0)),this[op]()}[(nw=ss,iw=Ar,op)](){if(!(this[Ar].length<this[Hh]))for(let e=this[Ar].length-1;e>=this[Hh];--e){let t=this[Ar][e];this[ss].get(t)===0&&(this[S0].delete(t),this[Ar].splice(e,1))}}}});var QN,zN,Vh,rw=oe(()=>{QN=i=>{let e=[],t=new Set;for(let n of i){let s=n,r=0;for(;t.has(s);)s=n+"."+ ++r;t.add(s),e.push(s)}return e},zN=i=>{let e=new Map;for(let t of i.mappings)for(let n of t.variants)e.set(n,{material:null,gltfMaterialIndex:t.material});return e},Vh=class{constructor(e){this.parser=e,this.name="KHR_materials_variants"}afterRoot(e){let t=this.parser,n=t.json;if(n.extensions===void 0||n.extensions[this.name]===void 0)return null;let r=n.extensions[this.name].variants||[],o=QN(r.map(a=>a.name));for(let a of e.scenes)a.traverse(c=>{let l=c;if(!l.material)return;let h=t.associations.get(l);if(h==null||h.meshes==null||h.primitives==null)return;let p=n.meshes[h.meshes].primitives[h.primitives].extensions;!p||!p[this.name]||(l.userData.variantMaterials=zN(p[this.name]))});return e.userData.variants=o,Promise.resolve()}}});var uw,ow,HN,VN,gr,w0,aw,cw,lw,C0,M0,T0,no,yr,hw,on,cp=oe(()=>{Xe();xS();_S();TS();tw();sw();rw();bt.DEFAULT_ANISOTROPY=4;HN=(i,e,t=()=>{})=>{let n=s=>{let r=s.loaded/s.total;t(Math.max(0,Math.min(1,isFinite(r)?r:1)))};return new Promise((s,r)=>{e.load(i,s,n,r)})},VN=i=>new Promise((e,t)=>{let n=document.createElement("script");document.body.appendChild(n),n.onload=e,n.onerror=t,n.async=!0,n.src=i}),gr=new Map,w0=new Map,cw=new tp,C0=new mr,no=Symbol("loader"),yr=Symbol("evictionPolicy"),hw=Symbol("GLTFInstance"),on=class extends xn{static setDRACODecoderLocation(e){aw=e,cw.setDecoderPath(e)}static getDRACODecoderLocation(){return aw}static setKTX2TranscoderLocation(e){lw=e,C0.setTranscoderPath(e)}static getKTX2TranscoderLocation(){return lw}static setMeshoptDecoderLocation(e){M0!==e&&(M0=e,T0=VN(e).then(()=>Og.ready).then(()=>Og))}static getMeshoptDecoderLocation(){return M0}static initializeKTX2Loader(e){C0.detectSupport(e)}static get cache(){return gr}static clearCache(){gr.forEach((e,t)=>{this.delete(t)}),this[yr].reset()}static has(e){return gr.has(e)}static async delete(e){if(!this.has(e))return;let t=gr.get(e);w0.delete(e),gr.delete(e),(await t).dispose()}static hasFinishedLoading(e){return!!w0.get(e)}constructor(e){super(),this[ow]=new np().register(t=>new Vh(t)),this[hw]=e,this[no].setDRACOLoader(cw),this[no].setKTX2Loader(C0)}get[(uw=yr,ow=no,yr)](){return this.constructor[yr]}async preload(e,t,n=()=>{}){if(this[no].setWithCredentials(t.withCredentials),this.dispatchEvent({type:"preload",element:t,src:e}),!gr.has(e)){T0!=null&&this[no].setMeshoptDecoder(await T0);let s=HN(e,this[no],a=>{n(a*.8)}),r=this[hw],o=s.then(a=>r.prepare(a)).then(a=>(n(.9),new r(a))).catch((a=>(console.error(a),new r)));gr.set(e,o)}await gr.get(e),w0.set(e,!0),n&&n(1)}async load(e,t,n=()=>{}){await this.preload(e,t,n);let r=await(await gr.get(e)).clone();return this[yr].retain(e),r.dispose=()=>{this[yr].release(e)},r}};on[uw]=new ap(on)});var lp,Hc,dw,fw,pw,mw,hp,I0=oe(()=>{Xe();lp=class extends Ct{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Fe(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}},Hc=new D,dw=new Oe,fw=new Oe,pw=new D,mw=new D,hp=class{constructor(e={}){let t=this,n,s,r,o,a={objects:new WeakMap},c=e.element!==void 0?e.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.getSize=function(){return{width:n,height:s}},this.render=function(p,g){p.matrixWorldAutoUpdate===!0&&p.updateMatrixWorld(),g.parent===null&&g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),dw.copy(g.matrixWorldInverse),fw.multiplyMatrices(g.projectionMatrix,dw),h(p,p,g),f(p)},this.setSize=function(p,g){n=p,s=g,r=n/2,o=s/2,c.style.width=p+"px",c.style.height=g+"px"};function l(p){p.isCSS2DObject&&(p.element.style.display="none");for(let g=0,A=p.children.length;g<A;g++)l(p.children[g])}function h(p,g,A){if(p.visible===!1){l(p);return}if(p.isCSS2DObject){Hc.setFromMatrixPosition(p.matrixWorld),Hc.applyMatrix4(fw);let m=Hc.z>=-1&&Hc.z<=1&&p.layers.test(A.layers)===!0,b=p.element;b.style.display=m===!0?"":"none",m===!0&&(p.onBeforeRender(t,g,A),b.style.transform="translate("+-100*p.center.x+"%,"+-100*p.center.y+"%)translate("+(Hc.x*r+r)+"px,"+(-Hc.y*o+o)+"px)",b.parentNode!==c&&c.appendChild(b),p.onAfterRender(t,g,A));let x={distanceToCameraSquared:u(A,p)};a.objects.set(p,x)}for(let m=0,b=p.children.length;m<b;m++)h(p.children[m],g,A)}function u(p,g){return pw.setFromMatrixPosition(p.matrixWorld),mw.setFromMatrixPosition(g.matrixWorld),pw.distanceToSquared(mw)}function d(p){let g=[];return p.traverseVisible(function(A){A.isCSS2DObject&&g.push(A)}),g}function f(p){let g=d(p).sort(function(m,b){if(m.renderOrder!==b.renderOrder)return b.renderOrder-m.renderOrder;let x=a.objects.get(m).distanceToCameraSquared,y=a.objects.get(b).distanceToCameraSquared;return x-y}),A=g.length;for(let m=0,b=g.length;m<b;m++)g[m].element.style.zIndex=A-m}}}});function Wh(i,e,t){let n=t,s=new D;return i.updateWorldMatrix(!0,!0),i.traverseVisible(r=>{let{geometry:o}=r;if(o!==void 0){let{position:a}=o.attributes;if(a!==void 0)for(let c=0,l=a.count;c<l;c++)r.isMesh?r.getVertexPosition(c,s):s.fromBufferAttribute(a,c),r.isSkinnedMesh||s.applyMatrix4(r.matrixWorld),n=e(n,s)}}),n}var Aw=oe(()=>{Xe()});function qh(i,e){return i.length===e.length&&i.every(function(t,n){return t===e[n]})}function YN(i){return new TextEncoder().encode(i).buffer}function jN(i){return qh(i.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function JN(i,e,t){let n={min:new Array(i.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(i.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=e;s<e+t;s++)for(let r=0;r<i.itemSize;r++){let o;i.itemSize>4?o=i.array[s*i.itemSize+r]:(r===0?o=i.getX(s):r===1?o=i.getY(s):r===2?o=i.getZ(s):r===3&&(o=i.getW(s)),i.normalized===!0&&(o=ea.normalize(o,i.array))),n.min[r]=Math.min(n.min[r],o),n.max[r]=Math.max(n.max[r],o)}return n}function Ew(i){return Math.ceil(i/4)*4}function B0(i,e=0){let t=Ew(i.byteLength);if(t!==i.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(i)),e!==0)for(let s=i.byteLength;s<t;s++)n[s]=e;return n.buffer}return i}function _w(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function vw(i,e){if(i.toBlob!==void 0)return new Promise(n=>i.toBlob(n,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),i.convertToBlob({type:e,quality:t})}var gw,pa,lt,R0,_i,yw,WN,bw,qN,KN,xw,$N,XN,D0,L0,P0,F0,O0,N0,U0,k0,G0,Q0,z0,H0,V0,W0,q0,Sw=oe(()=>{Xe();gw={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},pa=class{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new L0(e)}),this.register(function(e){return new P0(e)}),this.register(function(e){return new U0(e)}),this.register(function(e){return new k0(e)}),this.register(function(e){return new G0(e)}),this.register(function(e){return new Q0(e)}),this.register(function(e){return new F0(e)}),this.register(function(e){return new O0(e)}),this.register(function(e){return new N0(e)}),this.register(function(e){return new z0(e)}),this.register(function(e){return new H0(e)}),this.register(function(e){return new V0(e)}),this.register(function(e){return new W0(e)}),this.register(function(e){return new q0(e)})}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}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,n,s){let r=new D0,o=[];for(let a=0,c=this.pluginCallbacks.length;a<c;a++)o.push(this.pluginCallbacks[a](r));r.setPlugins(o),r.setTextureUtils(this.textureUtils),r.writeAsync(e,t,s).catch(n)}parseAsync(e,t){let n=this;return new Promise(function(s,r){n.parse(e,s,r,t)})}},lt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},R0="KHR_mesh_quantization",_i={};_i[Ft]=lt.NEAREST;_i[lr]=lt.NEAREST_MIPMAP_NEAREST;_i[Oi]=lt.NEAREST_MIPMAP_LINEAR;_i[qe]=lt.LINEAR;_i[ts]=lt.LINEAR_MIPMAP_NEAREST;_i[rn]=lt.LINEAR_MIPMAP_LINEAR;_i[Bt]=lt.CLAMP_TO_EDGE;_i[Dn]=lt.REPEAT;_i[es]=lt.MIRRORED_REPEAT;yw={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},WN=new Ce,bw=12,qN=1179937895,KN=2,xw=8,$N=1313821514,XN=5130562;D0=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r172"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);let s=this,r=s.buffers,o=s.json;n=s.options;let a=s.extensionsUsed,c=s.extensionsRequired,l=new Blob(r,{type:"application/octet-stream"}),h=Object.keys(a),u=Object.keys(c);if(h.length>0&&(o.extensionsUsed=h),u.length>0&&(o.extensionsRequired=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=l.size),n.binary===!0){let d=new FileReader;d.readAsArrayBuffer(l),d.onloadend=function(){let f=B0(d.result),p=new DataView(new ArrayBuffer(xw));p.setUint32(0,f.byteLength,!0),p.setUint32(4,XN,!0);let g=B0(YN(JSON.stringify(o)),32),A=new DataView(new ArrayBuffer(xw));A.setUint32(0,g.byteLength,!0),A.setUint32(4,$N,!0);let m=new ArrayBuffer(bw),b=new DataView(m);b.setUint32(0,qN,!0),b.setUint32(4,KN,!0);let x=bw+A.byteLength+g.byteLength+p.byteLength+f.byteLength;b.setUint32(8,x,!0);let y=new Blob([m,A,g,p,f],{type:"application/octet-stream"}),_=new FileReader;_.readAsArrayBuffer(y),_.onloadend=function(){t(_.result)}}}else if(o.buffers&&o.buffers.length>0){let d=new FileReader;d.readAsDataURL(l),d.onloadend=function(){let f=d.result;o.buffers[0].uri=f,t(o)}}else t(o)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,s=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&r.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in r.gltfExtensions)t.extensions[o]=r.gltfExtensions[o],s[o]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(t.extras=r)}catch(r){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+r.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let s=new Map;s.set(!0,this.uid++),s.set(!1,this.uid++),this.uids.set(e,s)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new D;for(let s=0,r=e.count;s<r;s++)if(Math.abs(n.fromBufferAttribute(e,s).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),s=new D;for(let r=0,o=n.count;r<o;r++)s.fromBufferAttribute(n,r),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),n.setXYZ(r,s.x,s.y,s.z);return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1,s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),n=!0),t.rotation!==0&&(s.rotation=t.rotation,n=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function n(f){return f.colorSpace===at?function(g){return g<.04045?g*.0773993808:Math.pow(g*.9478672986+.0521327014,2.4)}:function(g){return g}}e instanceof Fi&&(e=await this.decompressTextureAsync(e)),t instanceof Fi&&(t=await this.decompressTextureAsync(t));let s=e?e.image:null,r=t?t.image:null,o=Math.max(s?s.width:0,r?r.width:0),a=Math.max(s?s.height:0,r?r.height:0),c=_w();c.width=o,c.height=a;let l=c.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,o,a);let h=l.getImageData(0,0,o,a);if(s){l.drawImage(s,0,0,o,a);let f=n(e),p=l.getImageData(0,0,o,a).data;for(let g=2;g<p.length;g+=4)h.data[g]=f(p[g]/256)*256}if(r){l.drawImage(r,0,0,o,a);let f=n(t),p=l.getImageData(0,0,o,a).data;for(let g=1;g<p.length;g+=4)h.data[g]=f(p[g]/256)*256}l.putImageData(h,0,0);let d=(e||t).clone();return d.source=new Uo(c),d.colorSpace=Fn,d.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),d}async decompressTextureAsync(e,t=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){let t=this.json,n=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,t,n,s,r){let o=this.json;o.bufferViews||(o.bufferViews=[]);let a;switch(t){case lt.BYTE:case lt.UNSIGNED_BYTE:a=1;break;case lt.SHORT:case lt.UNSIGNED_SHORT:a=2;break;default:a=4}let c=e.itemSize*a;r===lt.ARRAY_BUFFER&&(c=Math.ceil(c/4)*4);let l=Ew(s*c),h=new DataView(new ArrayBuffer(l)),u=0;for(let p=n;p<n+s;p++){for(let g=0;g<e.itemSize;g++){let A;e.itemSize>4?A=e.array[p*e.itemSize+g]:(g===0?A=e.getX(p):g===1?A=e.getY(p):g===2?A=e.getZ(p):g===3&&(A=e.getW(p)),e.normalized===!0&&(A=ea.normalize(A,e.array))),t===lt.FLOAT?h.setFloat32(u,A,!0):t===lt.INT?h.setInt32(u,A,!0):t===lt.UNSIGNED_INT?h.setUint32(u,A,!0):t===lt.SHORT?h.setInt16(u,A,!0):t===lt.UNSIGNED_SHORT?h.setUint16(u,A,!0):t===lt.BYTE?h.setInt8(u,A):t===lt.UNSIGNED_BYTE&&h.setUint8(u,A),u+=a}u%c!==0&&(u+=c-u%c)}let d={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return r!==void 0&&(d.target=r),r===lt.ARRAY_BUFFER&&(d.byteStride=c),this.byteOffset+=l,o.bufferViews.push(d),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(s){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let o=B0(r.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,s(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,s){let r=this.json,o={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},a;if(e.array.constructor===Float32Array)a=lt.FLOAT;else if(e.array.constructor===Int32Array)a=lt.INT;else if(e.array.constructor===Uint32Array)a=lt.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=lt.SHORT;else if(e.array.constructor===Uint16Array)a=lt.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=lt.BYTE;else if(e.array.constructor===Uint8Array)a=lt.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;let c=JN(e,n,s),l;t!==void 0&&(l=e===t.index?lt.ELEMENT_ARRAY_BUFFER:lt.ARRAY_BUFFER);let h=this.processBufferView(e,a,n,s,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:a,count:s,max:c.max,min:c.min,type:o[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),r.accessors||(r.accessors=[]),r.accessors.push(u)-1}processImage(e,t,n,s="image/png"){if(e!==null){let r=this,o=r.cache,a=r.json,c=r.options,l=r.pending;o.images.has(e)||o.images.set(e,{});let h=o.images.get(e),u=s+":flipY/"+n.toString();if(h[u]!==void 0)return h[u];a.images||(a.images=[]);let d={mimeType:s},f=_w();f.width=Math.min(e.width,c.maxTextureSize),f.height=Math.min(e.height,c.maxTextureSize);let p=f.getContext("2d",{willReadFrequently:!0});if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){t!==vt&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>c.maxTextureSize||e.height>c.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let A=new Uint8ClampedArray(e.height*e.width*4);for(let m=0;m<A.length;m+=4)A[m+0]=e.data[m+0],A[m+1]=e.data[m+1],A[m+2]=e.data[m+2],A[m+3]=e.data[m+3];p.putImageData(new ImageData(A,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)p.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");c.binary===!0?l.push(vw(f,s).then(A=>r.processBufferViewImage(A)).then(A=>{d.bufferView=A})):f.toDataURL!==void 0?d.uri=f.toDataURL(s):l.push(vw(f,s).then(A=>new FileReader().readAsDataURL(A)).then(A=>{d.uri=A}));let g=a.images.push(d)-1;return h[u]=g,g}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let n={magFilter:_i[e.magFilter],minFilter:_i[e.minFilter],wrapS:_i[e.wrapS],wrapT:_i[e.wrapT]};return t.samplers.push(n)-1}async processTextureAsync(e){let n=this.options,s=this.cache,r=this.json;if(s.textures.has(e))return s.textures.get(e);r.textures||(r.textures=[]),e instanceof Fi&&(e=await this.decompressTextureAsync(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");let a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(a.name=e.name),await this._invokeAllAsync(async function(l){l.writeTexture&&await l.writeTexture(e,a)});let c=r.textures.push(a)-1;return s.textures.set(e,c),c}async processMaterialAsync(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);let s={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(qh(r,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=r),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){let a=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),c={index:await this.processTextureAsync(a),texCoord:a.channel};this.applyTextureTransform(c,a),s.pbrMetallicRoughness.metallicRoughnessTexture=c}if(e.map){let a={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),s.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){let a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(s.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let l={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),s.emissiveTexture=l}}if(e.normalMap){let a={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),s.normalTexture=a}if(e.aoMap){let a={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),s.occlusionTexture=a}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===Ut&&(s.doubleSided=!0),e.name!==""&&(s.name=e.name),this.serializeUserData(e,s),await this._invokeAllAsync(async function(a){a.writeMaterialAsync&&await a.writeMaterialAsync(e,s)});let o=n.materials.push(s)-1;return t.materials.set(e,o),o}async processMeshAsync(e){let t=this.cache,n=this.json,s=[e.geometry.uuid];if(Array.isArray(e.material))for(let y=0,_=e.material.length;y<_;y++)s.push(e.material[y].uuid);else s.push(e.material.uuid);let r=s.join(":");if(t.meshes.has(r))return t.meshes.get(r);let o=e.geometry,a;e.isLineSegments?a=lt.LINES:e.isLineLoop?a=lt.LINE_LOOP:e.isLine?a=lt.LINE_STRIP:e.isPoints?a=lt.POINTS:a=e.material.wireframe?lt.LINES:lt.TRIANGLES;let c={},l={},h=[],u=[],d={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=o.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),o.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let p=null;for(let y in o.attributes){if(y.slice(0,5)==="morph")continue;let _=o.attributes[y];if(y=d[y]||y.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(y)||(y="_"+y),t.attributes.has(this.getUID(_))){l[y]=t.attributes.get(this.getUID(_));continue}p=null;let C=_.array;y==="JOINTS_0"&&!(C instanceof Uint16Array)&&!(C instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new yt(new Uint16Array(C),_.itemSize,_.normalized)):(C instanceof Uint32Array||C instanceof Int32Array)&&!y.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${y}" converted to type FLOAT.`),p=pa.Utils.toFloat32BufferAttribute(_));let w=this.processAccessor(p||_,o);w!==null&&(y.startsWith("_")||this.detectMeshQuantization(y,_),l[y]=w,t.attributes.set(this.getUID(_),w))}if(f!==void 0&&o.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let y=[],_=[],S={};if(e.morphTargetDictionary!==void 0)for(let C in e.morphTargetDictionary)S[e.morphTargetDictionary[C]]=C;for(let C=0;C<e.morphTargetInfluences.length;++C){let w={},v=!1;for(let E in o.morphAttributes){if(E!=="position"&&E!=="normal"){v||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),v=!0);continue}let R=o.morphAttributes[E][C],F=E.toUpperCase(),P=o.attributes[E];if(t.attributes.has(this.getUID(R,!0))){w[F]=t.attributes.get(this.getUID(R,!0));continue}let U=R.clone();if(!o.morphTargetsRelative)for(let V=0,O=R.count;V<O;V++)for(let K=0;K<R.itemSize;K++)K===0&&U.setX(V,R.getX(V)-P.getX(V)),K===1&&U.setY(V,R.getY(V)-P.getY(V)),K===2&&U.setZ(V,R.getZ(V)-P.getZ(V)),K===3&&U.setW(V,R.getW(V)-P.getW(V));w[F]=this.processAccessor(U,o),t.attributes.set(this.getUID(P,!0),w[F])}u.push(w),y.push(e.morphTargetInfluences[C]),e.morphTargetDictionary!==void 0&&_.push(S[C])}c.weights=y,_.length>0&&(c.extras={},c.extras.targetNames=_)}let g=Array.isArray(e.material);if(g&&o.groups.length===0)return null;let A=!1;if(g&&o.index===null){let y=[];for(let _=0,S=o.attributes.position.count;_<S;_++)y[_]=_;o.setIndex(y),A=!0}let m=g?e.material:[e.material],b=g?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let y=0,_=b.length;y<_;y++){let S={mode:a,attributes:l};if(this.serializeUserData(o,S),u.length>0&&(S.targets=u),o.index!==null){let w=this.getUID(o.index);(b[y].start!==void 0||b[y].count!==void 0)&&(w+=":"+b[y].start+":"+b[y].count),t.attributes.has(w)?S.indices=t.attributes.get(w):(S.indices=this.processAccessor(o.index,o,b[y].start,b[y].count),t.attributes.set(w,S.indices)),S.indices===null&&delete S.indices}let C=await this.processMaterialAsync(m[b[y].materialIndex]);C!==null&&(S.material=C),h.push(S)}A===!0&&o.setIndex(null),c.primitives=h,n.meshes||(n.meshes=[]),await this._invokeAllAsync(function(y){y.writeMesh&&y.writeMesh(e,c)});let x=n.meshes.push(c)-1;return t.meshes.set(r,x),x}detectMeshQuantization(e,t){if(this.extensionsUsed[R0])return;let n;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}t.normalized&&(n+=" normalized");let s=e.split("_",1)[0];gw[s]&&gw[s].includes(n)&&(this.extensionsUsed[R0]=!0,this.extensionsRequired[R0]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,s={type:n?"orthographic":"perspective"};return n?s.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:ea.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){let n=this.json,s=this.nodeMap;n.animations||(n.animations=[]),e=pa.Utils.mergeMorphTargetTracks(e.clone(),t);let r=e.tracks,o=[],a=[];for(let c=0;c<r.length;++c){let l=r[c],h=gt.parseTrackName(l.name),u=gt.findNode(t,h.nodeName),d=yw[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}let f=1,p=l.values.length/l.times.length;d===yw.morphTargetInfluences&&(p/=u.morphTargetInfluences.length);let g;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(g="CUBICSPLINE",p/=3):l.getInterpolation()===er?g="STEP":g="LINEAR",a.push({input:this.processAccessor(new yt(l.times,f)),output:this.processAccessor(new yt(l.values,p)),interpolation:g}),o.push({sampler:a.length-1,target:{node:s.get(u),path:d}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:a,channels:o}),n.animations.length-1}processSkin(e){let t=this.json,n=this.nodeMap,s=t.nodes[n.get(e)],r=e.skeleton;if(r===void 0)return null;let o=e.skeleton.bones[0];if(o===void 0)return null;let a=[],c=new Float32Array(r.bones.length*16),l=new Oe;for(let u=0;u<r.bones.length;++u)a.push(n.get(r.bones[u])),l.copy(r.boneInverses[u]),l.multiply(e.bindMatrix).toArray(c,u*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new yt(c,16)),joints:a,skeleton:n.get(o)}),s.skin=t.skins.length-1}async processNodeAsync(e){let t=this.json,n=this.options,s=this.nodeMap;t.nodes||(t.nodes=[]);let r={};if(n.trs){let a=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();qh(a,[0,0,0,1])||(r.rotation=a),qh(c,[0,0,0])||(r.translation=c),qh(l,[1,1,1])||(r.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),jN(e.matrix)===!1&&(r.matrix=e.matrix.elements);if(e.name!==""&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let a=await this.processMeshAsync(e);a!==null&&(r.mesh=a)}else e.isCamera&&(r.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let a=[];for(let c=0,l=e.children.length;c<l;c++){let h=e.children[c];if(h.visible||n.onlyVisible===!1){let u=await this.processNodeAsync(h);u!==null&&a.push(u)}}a.length>0&&(r.children=a)}await this._invokeAllAsync(function(a){a.writeNode&&a.writeNode(e,r)});let o=t.nodes.push(r)-1;return s.set(e,o),o}async processSceneAsync(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);let r=[];for(let o=0,a=e.children.length;o<a;o++){let c=e.children[o];if(c.visible||n.onlyVisible===!1){let l=await this.processNodeAsync(c);l!==null&&r.push(l)}}r.length>0&&(s.nodes=r),this.serializeUserData(e,s)}async processObjectsAsync(e){let t=new Pn;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);await this.processSceneAsync(t)}async processInputAsync(e){let t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(s){s.beforeParse&&s.beforeParse(e)});let n=[];for(let s=0;s<e.length;s++)e[s]instanceof Pn?await this.processSceneAsync(e[s]):n.push(e[s]);n.length>0&&await this.processObjectsAsync(n);for(let s=0;s<this.skins.length;++s)this.processSkin(this.skins[s]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);await this._invokeAllAsync(function(s){s.afterParse&&s.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,n=this.plugins.length;t<n;t++)await e(this.plugins[t])}},L0=class{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,s=n.json,r=n.extensionsUsed,o={};e.name&&(o.name=e.name),o.color=e.color.toArray(),o.intensity=e.intensity,e.isDirectionalLight?o.type="directional":e.isPointLight?(o.type="point",e.distance>0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(1-e.penumbra)*e.angle,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),r[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},r[this.name]=!0);let a=s.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},P0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;let s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},F0=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,s=n.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let o={index:await n.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(o,e.clearcoatMap),r.clearcoatTexture=o}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let o={index:await n.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){let o={index:await n.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(o.scale=e.clearcoatNormalScale.x),n.applyTextureTransform(o,e.clearcoatNormalMap),r.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},O0=class{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;let s=this.writer.extensionsUsed,r={};r.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},N0=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,s=n.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let o={index:await n.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(o,e.iridescenceMap),r.iridescenceTexture=o}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let o={index:await n.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(o,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},U0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,s=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let o={index:await n.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(o,e.transmissionMap),r.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},k0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,s=n.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let o={index:await n.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(o,e.thicknessMap),r.thicknessTexture=o}e.attenuationDistance!==1/0&&(r.attenuationDistance=e.attenuationDistance),r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},G0=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let s=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},Q0=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(WN)&&!e.specularIntensityMap&&!e.specularColorMap)return;let n=this.writer,s=n.extensionsUsed,r={};if(e.specularIntensityMap){let o={index:await n.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(o,e.specularIntensityMap),r.specularTexture=o}if(e.specularColorMap){let o={index:await n.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(o,e.specularColorMap),r.specularColorTexture=o}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},z0=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,s=n.extensionsUsed,r={};if(e.sheenRoughnessMap){let o={index:await n.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(o,e.sheenRoughnessMap),r.sheenRoughnessTexture=o}if(e.sheenColorMap){let o={index:await n.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(o,e.sheenColorMap),r.sheenColorTexture=o}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,s=n.extensionsUsed,r={};if(e.anisotropyMap){let o={index:await n.processTextureAsync(e.anisotropyMap)};n.applyTextureTransform(o,e.anisotropyMap),r.anisotropyTexture=o}r.anisotropyStrength=e.anisotropy,r.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let s=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let n=this.writer,s=n.extensionsUsed,r={};if(e.bumpMap){let o={index:await n.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};n.applyTextureTransform(o,e.bumpMap),r.bumpTexture=o}r.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}},q0=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;let n=this.writer,s=e,r=new Float32Array(s.count*3),o=new Float32Array(s.count*4),a=new Float32Array(s.count*3),c=new Oe,l=new D,h=new $t,u=new D;for(let f=0;f<s.count;f++)s.getMatrixAt(f,c),c.decompose(l,h,u),l.toArray(r,f*3),h.toArray(o,f*4),u.toArray(a,f*3);let d={TRANSLATION:n.processAccessor(new yt(r,3)),ROTATION:n.processAccessor(new yt(o,4)),SCALE:n.processAccessor(new yt(a,3))};s.instanceColor&&(d._COLOR_0=n.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},n.extensionsUsed[this.name]=!0,n.extensionsRequired[this.name]=!0}};pa.Utils={insertKeyframe:function(i,e){let n=i.getValueSize(),s=new i.TimeBufferType(i.times.length+1),r=new i.ValueBufferType(i.values.length+n),o=i.createInterpolant(new i.ValueBufferType(n)),a;if(i.times.length===0){s[0]=e;for(let c=0;c<n;c++)r[c]=0;a=0}else if(e<i.times[0]){if(Math.abs(i.times[0]-e)<.001)return 0;s[0]=e,s.set(i.times,1),r.set(o.evaluate(e),0),r.set(i.values,n),a=0}else if(e>i.times[i.times.length-1]){if(Math.abs(i.times[i.times.length-1]-e)<.001)return i.times.length-1;s[s.length-1]=e,s.set(i.times,0),r.set(i.values,0),r.set(o.evaluate(e),i.values.length),a=s.length-1}else for(let c=0;c<i.times.length;c++){if(Math.abs(i.times[c]-e)<.001)return c;if(i.times[c]<e&&i.times[c+1]>e){s.set(i.times.slice(0,c+1),0),s[c+1]=e,s.set(i.times.slice(c+1),c+2),r.set(i.values.slice(0,(c+1)*n),0),r.set(o.evaluate(e),(c+1)*n),r.set(i.values.slice((c+1)*n),(c+2)*n),a=c+1;break}}return i.times=s,i.values=r,a},mergeMorphTargetTracks:function(i,e){let t=[],n={},s=i.tracks;for(let r=0;r<s.length;++r){let o=s[r],a=gt.parseTrackName(o.name),c=gt.findNode(e,a.nodeName);if(a.propertyName!=="morphTargetInfluences"||a.propertyIndex===void 0){t.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),o=o.clone(),o.setInterpolation(tr)}let l=c.morphTargetInfluences.length,h=c.morphTargetDictionary[a.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);let u;if(n[c.uuid]===void 0){u=o.clone();let f=new u.ValueBufferType(l*u.times.length);for(let p=0;p<u.times.length;p++)f[p*l+h]=u.values[p];u.name=(a.nodeName||"")+".morphTargetInfluences",u.values=f,n[c.uuid]=u,t.push(u);continue}let d=o.createInterpolant(new o.ValueBufferType(1));u=n[c.uuid];for(let f=0;f<u.times.length;f++)u.values[f*l+h]=d.evaluate(u.times[f]);for(let f=0;f<o.times.length;f++){let p=this.insertKeyframe(u,o.times[f]);u.values[p*l+h]=o.values[f]}}return i.tracks=t,i},toFloat32BufferAttribute:function(i){let e=new yt(new Float32Array(i.count*i.itemSize),i.itemSize,!1);if(!i.normalized&&!i.isInterleavedBufferAttribute)return e.array.set(i.array),e;for(let t=0,n=i.count;t<n;t++)for(let s=0;s<i.itemSize;s++)e.setComponent(t,s,i.getComponent(t,s));return e}}});var ww,up,Kh,Cw=oe(()=>{ww=i=>i.material!==void 0&&i.userData&&i.userData.variantMaterials&&!!Array.from(i.userData.variantMaterials.values()).filter(e=>up(e.material)),up=i=>i&&i.isMaterial&&!Array.isArray(i),Kh=class{constructor(e){this.writer=e,this.name="KHR_materials_variants",this.variantNames=[]}beforeParse(e){let t=new Set,n=s=>{if(!ww(s))return;let r=s.userData.variantMaterials,o=s.userData.variantData;for(let[a,c]of o){let l=r.get(c.index);l&&up(l.material)&&t.add(a)}};if(Array.isArray(e))for(let s of e)s.traverse(n);else e.traverse(n);t.forEach(s=>this.variantNames.push(s))}async writeMesh(e,t){if(!ww(e))return;let n=e.userData,s=n.variantMaterials,r=n.variantData,o=new Map,a=new Map,c=Array.from(r.values()).sort((u,d)=>u.index-d.index);for(let[u,d]of c.entries())a.set(d.index,u);for(let u of r.values()){let d=s.get(u.index);if(!d||!up(d.material))continue;let f=await this.writer.processMaterialAsync(d.material);o.has(f)||o.set(f,{material:f,variants:[]}),o.get(f).variants.push(a.get(u.index))}let l=Array.from(o.values()).map((u=>u.variants.sort((d,f)=>d-f)&&u)).sort((u,d)=>u.material-d.material);if(l.length===0)return;let h=up(n.originalMaterial)?await this.writer.processMaterialAsync(n.originalMaterial):-1;for(let u of t.primitives)h>=0&&(u.material=h),u.extensions=u.extensions||{},u.extensions[this.name]={mappings:l}}afterParse(){if(this.variantNames.length===0)return;let e=this.writer.json;e.extensions=e.extensions||{};let t=this.variantNames.map(n=>({name:n}));e.extensions[this.name]={variants:t},this.writer.extensionsUsed[this.name]=!0}}});var K0,dp,Mw=oe(()=>{Xe();K0=class{constructor(e,t,n,s,r){this.xrLight=e,this.renderer=t,this.lightProbe=n,this.xrWebGLBinding=null,this.estimationStartCallback=r,this.frameCallback=this.onXRFrame.bind(this);let o=t.xr.getSession();if(s&&"XRWebGLBinding"in window){let a=new $r(16);e.environment=a.texture;let c=t.getContext();switch(o.preferredReflectionFormat){case"srgba8":c.getExtension("EXT_sRGB");break;case"rgba16f":c.getExtension("OES_texture_half_float");break}this.xrWebGLBinding=new XRWebGLBinding(o,c),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}o.requestAnimationFrame(this.frameCallback)}updateReflection(){let e=this.renderer.properties.get(this.xrLight.environment);if(e){let t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);let s=t.getLightEstimate(this.lightProbe);if(s){this.xrLight.lightProbe.sh.fromArray(s.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;let r=Math.max(1,Math.max(s.primaryLightIntensity.x,Math.max(s.primaryLightIntensity.y,s.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(s.primaryLightIntensity.x/r,s.primaryLightIntensity.y/r,s.primaryLightIntensity.z/r),this.xrLight.directionalLight.intensity=r,this.xrLight.directionalLight.position.copy(s.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}},dp=class extends si{constructor(e,t=!0){super(),this.lightProbe=new vh,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new Wo,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let n=null,s=!1;e.xr.addEventListener("sessionstart",()=>{let r=e.xr.getSession();"requestLightProbe"in r&&r.requestLightProbe({reflectionFormat:r.preferredReflectionFormat}).then(o=>{n=new K0(this,e,o,t,()=>{s=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{n&&(n.dispose(),n=null),s&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{n&&(n.dispose(),n=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}});var tn,Vc=oe(()=>{tn=class{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,n,s){let r=2e-4*this.naturalFrequency;if(e==null||s===0||e===t&&this.velocity===0)return t;if(n<0)return e;let o=e-t,a=this.velocity+this.naturalFrequency*o,c=o+n*a,l=Math.exp(-this.naturalFrequency*n),h=(a-this.naturalFrequency*c)*l,u=-this.naturalFrequency*(h+a*l);return Math.abs(h)<r*Math.abs(s)&&u*o>=0?(this.velocity=0,t):(this.velocity=h,t+c*l)}}});var Is,Tw,ZN,Rw,eU,Iw,fp,$h,Bw=oe(()=>{Xe();Vc();Is=.2,Tw=.03,ZN=.75,Rw=12,eU=Math.PI/(2*Rw),Iw=new Fe,fp=(i,e,t)=>{let n=e>0?t>0?0:-Math.PI/2:t>0?Math.PI/2:Math.PI;for(let s=0;s<=Rw;++s)i.push(e+(Is-Tw)*Math.cos(n),t+(Is-Tw)*Math.sin(n),0,e+Is*Math.cos(n),t+Is*Math.sin(n),0),n+=eU},$h=class extends Ke{constructor(e,t){let n=new Zt,s=[],r=[],{size:o,boundingBox:a}=e,c=o.x/2,l=(t==="back"?o.y:o.z)/2;fp(r,c,l),fp(r,-c,l),fp(r,-c,-l),fp(r,c,-l);let h=r.length/3;for(let f=0;f<h-2;f+=2)s.push(f,f+1,f+3,f,f+3,f+2);let u=h-2;s.push(u,u+1,1,u,1,0),n.setAttribute("position",new bn(r,3)),n.setIndex(s),super(n),this.side=t;let d=this.material;switch(d.side=Ut,d.transparent=!0,d.opacity=0,this.goalOpacity=0,this.opacityDamper=new tn,this.hitPlane=new Ke(new ri(2*(c+Is),2*(l+Is))),this.hitPlane.visible=!1,this.hitPlane.material.side=Ut,this.add(this.hitPlane),this.hitBox=new Ke(new ii(o.x+2*Is,o.y+Is,o.z+2*Is)),this.hitBox.visible=!1,this.hitBox.material.side=Ut,this.add(this.hitBox),a.getCenter(this.position),t){case"bottom":this.rotateX(-Math.PI/2),this.shadowHeight=a.min.y,this.position.y=this.shadowHeight;break;case"back":this.shadowHeight=a.min.z,this.position.z=this.shadowHeight}e.target.add(this),this.hitBox.position.y=(o.y+Is)/2+a.min.y,e.target.add(this.hitBox),this.offsetHeight=0}getHit(e,t,n){Iw.set(t,-n),this.hitPlane.visible=!0;let s=e.positionAndNormalFromPoint(Iw,this.hitPlane);return this.hitPlane.visible=!1,s==null?null:s.position}getExpandedHit(e,t,n){this.hitPlane.scale.set(1e3,1e3,1e3),this.hitPlane.updateMatrixWorld();let s=this.getHit(e,t,n);return this.hitPlane.scale.set(1,1,1),s}controllerIntersection(e,t){this.hitBox.visible=!0;let n=e.hitFromController(t,this.hitBox);return this.hitBox.visible=!1,n}set offsetHeight(e){e-=.001,this.side==="back"?this.position.z=this.shadowHeight+e:this.position.y=this.shadowHeight+e}get offsetHeight(){return this.side==="back"?this.position.z-this.shadowHeight:this.position.y-this.shadowHeight}set show(e){this.goalOpacity=e?ZN:0}updateOpacity(e){let t=this.material;t.opacity=this.opacityDamper.update(t.opacity,this.goalOpacity,e,1),this.visible=t.opacity>0}dispose(){let{geometry:e,material:t}=this.hitPlane;e.dispose(),t.dispose(),this.hitBox.geometry.dispose(),this.hitBox.material.dispose(),this.geometry.dispose(),this.material.dispose(),this.hitBox.removeFromParent(),this.removeFromParent()}}});var dn,ci,Pw,tU,nU,iU,Dw,Lw,pp,Rs,Bs=oe(()=>{dn=(i,e)=>({type:"number",number:i,unit:e}),ci=(()=>{let i={};return t=>{let n=t;if(n in i)return i[n];let s=[],r=0;for(;t;){if(++r>1e3){t="";break}let o=Pw(t),a=o.nodes[0];if(a==null||a.terms.length===0)break;s.push(a),t=o.remainingInput}return i[n]=s}})(),Pw=(()=>{let i=/^(\-\-|[a-z\u0240-\uffff])/i,e=/^([\*\+\/]|[\-]\s)/i,t=/^[\),]/;return r=>{let o=[];for(;r.length&&(r=r.trim(),!t.test(r));)if(r[0]==="("){let{nodes:a,remainingInput:c}=Dw(r);r=c,o.push({type:"function",name:{type:"ident",value:"calc"},arguments:a})}else if(i.test(r)){let a=tU(r),c=a.nodes[0];if(r=a.remainingInput,r[0]==="("){let{nodes:l,remainingInput:h}=Dw(r);o.push({type:"function",name:c,arguments:l}),r=h}else o.push(c)}else if(e.test(r))o.push({type:"operator",value:r[0]}),r=r.slice(1);else{let{nodes:a,remainingInput:c}=r[0]==="#"?iU(r):nU(r);if(a.length===0)break;o.push(a[0]),r=c}return{nodes:[{type:"expression",terms:o}],remainingInput:r}}})(),tU=(()=>{let i=/[^a-z0-9_\-\u0240-\uffff]/i;return e=>{let t=e.match(i),n=t==null?e:e.substr(0,t.index),s=t==null?"":e.substr(t.index);return{nodes:[{type:"ident",value:n}],remainingInput:s}}})(),nU=(()=>{let i=/[\+\-]?(\d+[\.]\d+|\d+|[\.]\d+)([eE][\+\-]?\d+)?/,e=/^[a-z%]+/i,t=/^(m|mm|cm|rad|deg|[%])$/;return n=>{let s=n.match(i),r=s==null?"0":s[0];n=r==null?n:n.slice(r.length);let o=n.match(e),a=o!=null&&o[0]!==""?o[0]:null,c=o==null?n:n.slice(a.length);return a!=null&&!t.test(a)&&(a=null),{nodes:[{type:"number",number:parseFloat(r)||0,unit:a}],remainingInput:c}}})(),iU=(()=>{let i=/^[a-f0-9]*/i;return e=>{e=e.slice(1).trim();let t=e.match(i);return{nodes:t==null?[]:[{type:"hex",value:t[0]}],remainingInput:t==null?e:e.slice(t[0].length)}}})(),Dw=i=>{let e=[];for(i=i.slice(1).trim();i.length;){let t=Pw(i);if(e.push(t.nodes[0]),i=t.remainingInput.trim(),i[0]===",")i=i.slice(1).trim();else if(i[0]===")"){i=i.slice(1);break}}return{nodes:e,remainingInput:i}},Lw=Symbol("visitedTypes"),pp=class{constructor(e){this[Lw]=e}walk(e,t){let n=e.slice();for(;n.length;){let s=n.shift();switch(this[Lw].indexOf(s.type)>-1&&t(s),s.type){case"expression":n.unshift(...s.terms);break;case"function":n.unshift(s.name,...s.arguments);break}}}},Rs=Object.freeze({type:"number",number:0,unit:null})});var Wc,Fw,li,qc=oe(()=>{Bs();Wc=(i,e=0)=>{let{number:t,unit:n}=i;if(!isFinite(t))t=e,n="rad";else if(i.unit==="rad"||i.unit==null)return i;return{type:"number",number:(n==="deg"&&t!=null?t:0)*Math.PI/180,unit:"rad"}},Fw=(i,e=0)=>{let{number:t,unit:n}=i;if(!isFinite(t))t=e,n="m";else if(i.unit==="m")return i;let s;switch(n){default:s=1;break;case"cm":s=1/100;break;case"mm":s=1/1e3;break}return{type:"number",number:s*t,unit:"m"}},li=(()=>{let i=t=>t,e={rad:i,deg:Wc,m:i,mm:Fw,cm:Fw};return(t,n=Rs)=>{isFinite(t.number)||(t.number=n.number,t.unit=n.unit);let{unit:s}=t;if(s==null)return t;let r=e[s];return r==null?n:r(t)}})()});var Qw,Ow,Nw,Xc,Ap,Xt,Uw,$0,J0,mp,Z0,sU,Kc,ey,kw,X0,Y0,gp,j0,Gw,$c,ty=oe(()=>{qc();Bs();Xc=Symbol("evaluate"),Ap=Symbol("lastValue"),Xt=class i{constructor(){this[Qw]=null}static evaluatableFor(e,t=Rs){if(e instanceof i)return e;if(e.type==="number")return e.unit==="%"?new J0(e,t):e;switch(e.name.value){case"calc":return new ey(e,t);case"env":return new Z0(e)}return Rs}static evaluate(e){return e instanceof i?e.evaluate():e}static isConstant(e){return e instanceof i?e.isConstant:!0}static applyIntrinsics(e,t){let{basis:n,keywords:s}=t,{auto:r}=s;return n.map((o,a)=>{let c=r[a]==null?o:r[a],l=e[a]?e[a]:c;if(l.type==="ident"){let h=l.value;h in s&&(l=s[h][a])}return(l==null||l.type==="ident")&&(l=c),l.unit==="%"?dn(l.number/100*o.number,o.unit):(l=li(l,o),l.unit!==o.unit?o:l)})}get isConstant(){return!1}evaluate(){return(!this.isConstant||this[Ap]==null)&&(this[Ap]=this[Xc]()),this[Ap]}};Qw=Ap;Uw=Symbol("percentage"),$0=Symbol("basis"),J0=class extends Xt{constructor(e,t){super(),this[Uw]=e,this[$0]=t}get isConstant(){return!0}[Xc](){return dn(this[Uw].number/100*this[$0].number,this[$0].unit)}},mp=Symbol("identNode"),Z0=class extends Xt{constructor(e){super(),this[Ow]=null;let t=e.arguments.length?e.arguments[0].terms[0]:null;t!=null&&t.type==="ident"&&(this[mp]=t)}get isConstant(){return!1}[(Ow=mp,Xc)](){if(this[mp]!=null)switch(this[mp].value){case"window-scroll-y":let e=window.pageYOffset,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight);return{type:"number",number:e/(t-window.innerHeight)||0,unit:null}}return Rs}},sU=/[\*\/]/,Kc=Symbol("evaluator"),ey=class extends Xt{constructor(e,t=Rs){if(super(),this[Nw]=null,e.arguments.length!==1)return;let n=e.arguments[0].terms.slice(),s=[];for(;n.length;){let r=n.shift();if(s.length>0){let o=s[s.length-1];if(o.type==="operator"&&sU.test(o.value)){let a=s.pop(),c=s.pop();if(c==null)return;s.push(new gp(a,Xt.evaluatableFor(c,t),Xt.evaluatableFor(r,t)));continue}}s.push(r.type==="operator"?r:Xt.evaluatableFor(r,t))}for(;s.length>2;){let[r,o,a]=s.splice(0,3);if(o.type!=="operator")return;s.unshift(new gp(o,Xt.evaluatableFor(r,t),Xt.evaluatableFor(a,t)))}s.length===1&&(this[Kc]=s[0])}get isConstant(){return this[Kc]==null||Xt.isConstant(this[Kc])}[(Nw=Kc,Xc)](){return this[Kc]!=null?Xt.evaluate(this[Kc]):Rs}},kw=Symbol("operator"),X0=Symbol("left"),Y0=Symbol("right"),gp=class extends Xt{constructor(e,t,n){super(),this[kw]=e,this[X0]=t,this[Y0]=n}get isConstant(){return Xt.isConstant(this[X0])&&Xt.isConstant(this[Y0])}[Xc](){let e=li(Xt.evaluate(this[X0])),t=li(Xt.evaluate(this[Y0])),{number:n,unit:s}=e,{number:r,unit:o}=t;if(o!=null&&s!=null&&o!=s)return Rs;let a=s||o,c;switch(this[kw].value){case"+":c=n+r;break;case"-":c=n-r;break;case"/":c=n/r;break;case"*":c=n*r;break;default:return Rs}return{type:"number",number:c,unit:a}}},j0=Symbol("evaluatables"),Gw=Symbol("intrinsics"),$c=class extends Xt{constructor(e,t){super(),this[Gw]=t;let n=e[0],s=n!=null?n.terms:[];this[j0]=t.basis.map((r,o)=>{let a=s[o];return a==null?{type:"ident",value:"auto"}:a.type==="ident"?a:Xt.evaluatableFor(a,r)})}get isConstant(){for(let e of this[j0])if(!Xt.isConstant(e))return!1;return!0}[Xc](){let e=this[j0].map(t=>Xt.evaluate(t));return Xt.applyIntrinsics(e,this[Gw]).map(t=>t.number)}}});var Kw,$w,Xw,Yw,Yc,zw,Hw,ny,Vw,Ww,yp,qw,jw,Xh,Jw,bp,Zw=oe(()=>{Bs();Yc=Symbol("instances"),zw=Symbol("activateListener"),Hw=Symbol("deactivateListener"),ny=Symbol("notifyInstances"),Vw=Symbol("notify"),Ww=Symbol("callback"),yp=class i{static[ny](){for(let e of i[Yc])e[Vw]()}static[(Kw=Yc,zw)](){window.addEventListener("scroll",this[ny],{passive:!0})}static[Hw](){window.removeEventListener("scroll",this[ny])}constructor(e){this[Ww]=e}observe(){i[Yc].size===0&&i[zw](),i[Yc].add(this)}disconnect(){i[Yc].delete(this),i[Yc].size===0&&i[Hw]()}[Vw](){this[Ww]()}};yp[Kw]=new Set;qw=Symbol("computeStyleCallback"),jw=Symbol("astWalker"),Xh=Symbol("dependencies"),Jw=Symbol("onScroll"),bp=class{constructor(e){this[$w]={},this[Xw]=new pp(["function"]),this[Yw]=()=>{this[qw]({relatedState:"window-scroll"})},this[qw]=e}observeEffectsFor(e){let t={},n=this[Xh];this[jw].walk(e,s=>{let{name:r}=s,a=s.arguments[0].terms[0];if(!(r.value!=="env"||a==null||a.type!=="ident"))switch(a.value){case"window-scroll-y":if(t["window-scroll"]==null){let c="window-scroll"in n?n["window-scroll"]:new yp(this[Jw]);c.observe(),delete n["window-scroll"],t["window-scroll"]=c}break}});for(let s in n)n[s].disconnect();this[Xh]=t}dispose(){for(let e in this[Xh])this[Xh][e].disconnect()}};$w=Xh,Xw=jw,Yw=Jw});var Ds,iy=oe(()=>{ty();Bs();Zw();Ds=i=>{let e=i.observeEffects||!1,t=i.intrinsics instanceof Function?i.intrinsics:(()=>i.intrinsics);return(n,s)=>{let r=n.updated,o=n.connectedCallback,a=n.disconnectedCallback,c=Symbol(`${s}StyleEffector`),l=Symbol(`${s}StyleEvaluator`),h=Symbol(`${s}UpdateEvaluator`),u=Symbol(`${s}EvaluateAndSync`);Object.defineProperties(n,{[c]:{value:null,writable:!0},[l]:{value:null,writable:!0},[h]:{value:function(){let d=ci(this[s]);this[l]=new $c(d,t(this)),this[c]==null&&e&&(this[c]=new bp(()=>this[u]())),this[c]!=null&&this[c].observeEffectsFor(d)}},[u]:{value:function(){if(this[l]==null)return;let d=this[l].evaluate();this[i.updateHandler](d)}},updated:{value:function(d){d.has(s)&&(this[h](),this[u]()),r.call(this,d)}},connectedCallback:{value:function(){o.call(this),this.requestUpdate(s,this[s])}},disconnectedCallback:{value:function(){a.call(this),this[c]!=null&&(this[c].dispose(),this[c]=null)}}})}}});var eC,rU,oU,ma,tC=oe(()=>{ns();eC=i=>i<.5?2*i*i:-1+(4-2*i)*i,rU=(i,e,t=eC)=>n=>i+(e-i)*t(n),oU=(i,e)=>{let t=(s=>r=>s+=r),n=e.map(t(0));return s=>{s=Nn(s,0,1),s*=n[n.length-1];let r=n.findIndex(c=>c>=s),o=r<1?0:n[r-1],a=n[r];return i[r]((s-o)/(a-o))}},ma=i=>{let e=[],t=[],n=i.initialValue;for(let s=0;s<i.keyframes.length;++s){let r=i.keyframes[s],{value:o,frames:a}=r,c=r.ease||eC,l=rU(n,o,c);e.push(l),t.push(a),n=o}return oU(e,t)}});var an,cU,lU,hU,uU,dU,fC,fU,pU,mU,AU,gU,yU,bU,xp,sy,xU,nC,_U,pC,vU,EU,SU,mC,wU,CU,MU,Rt,nu,ry,_p,oy,vp,iC,br,sC,rC,jc,ay,Yh,Aa,Ep,Jc,jh,Sp,cy,Jh,ly,Zh,oC,aC,cC,lC,hC,uC,dC,AC,hy=oe(()=>{Vs();Xe();iy();ai();qc();ty();Bs();Vc();uy();tC();an=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},cU=5e3,lU=ma({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),hU=ma({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),uU=30,dU=12,fC="0deg 75deg 105%",fU="auto auto auto",pU="auto",mU=2.2,AU=["front","right","back","left"],gU=["upper-","","lower-"],yU=3e3,bU=". Use mouse, touch or arrow keys to move.",xp={AUTO:"auto",NONE:"none"},sy={BASIC:"basic",WIGGLE:"wiggle"},xU={PAN_Y:"pan-y",PAN_X:"pan-x",NONE:"none"},nC=()=>({basis:[Wc(dn(uU,"deg"))],keywords:{auto:[null]}}),_U=()=>({basis:[Wc(dn(dU,"deg"))],keywords:{auto:[null]}}),pC=(()=>{let i=ci(fC)[0].terms,e=li(i[0]),t=li(i[1]);return n=>{let s=n[ne].idealCameraDistance();return{basis:[e,t,dn(s,"m")],keywords:{auto:[null,null,dn(105,"%")]}}}})(),vU=i=>{let e=mU*i[ne].boundingSphere.radius;return{basis:[dn(-1/0,"rad"),dn(0,"rad"),dn(e,"m")],keywords:{auto:[null,null,null]}}},EU=i=>{let e=pC(i),n=new $c([],e).evaluate()[2];return{basis:[dn(1/0,"rad"),dn(Math.PI,"rad"),dn(n,"m")],keywords:{auto:[null,null,null]}}},SU=i=>{let e=i[ne].boundingBox.getCenter(new D);return{basis:[dn(e.x,"m"),dn(e.y,"m"),dn(e.z,"m")],keywords:{auto:[null,null,null]}}},mC=Math.PI/2,wU=Math.PI/3,CU=mC/2,MU=2*Math.PI,Rt=Symbol("controls"),nu=Symbol("panElement"),ry=Symbol("promptElement"),_p=Symbol("promptAnimatedContainer"),oy=Symbol("fingerAnimatedContainers"),vp=Symbol("deferInteractionPrompt"),iC=Symbol("updateAria"),br=Symbol("a11y"),sC=Symbol("updateA11y"),rC=Symbol("updateCameraForRadius"),jc=Symbol("cancelPrompts"),ay=Symbol("onChange"),Yh=Symbol("onPointerChange"),Aa=Symbol("waitingToPromptUser"),Ep=Symbol("userHasInteracted"),Jc=Symbol("promptElementVisibleTime"),jh=Symbol("lastPromptOffset"),Sp=Symbol("cancellationSource"),cy=Symbol("lastSpherical"),Jh=Symbol("jumpCamera"),ly=Symbol("initialized"),Zh=Symbol("maintainThetaPhi"),oC=Symbol("syncCameraOrbit"),aC=Symbol("syncFieldOfView"),cC=Symbol("syncCameraTarget"),lC=Symbol("syncMinCameraOrbit"),hC=Symbol("syncMaxCameraOrbit"),uC=Symbol("syncMinFieldOfView"),dC=Symbol("syncMaxFieldOfView"),AC=i=>{var e,t,n,s,r,o,a,c,l,h,u,d,f,p,g,A,m,b;class x extends i{constructor(){super(...arguments),this.cameraControls=!1,this.cameraOrbit=fC,this.cameraTarget=fU,this.fieldOfView=pU,this.minCameraOrbit="auto",this.maxCameraOrbit="auto",this.minFieldOfView="auto",this.maxFieldOfView="auto",this.interactionPromptThreshold=yU,this.interactionPrompt=xp.AUTO,this.interactionPromptStyle=sy.WIGGLE,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.touchAction=xU.NONE,this.disableZoom=!1,this.disablePan=!1,this.disableTap=!1,this.interpolationDecay=50,this.a11y=null,this[e]=this.shadowRoot.querySelector(".interaction-prompt"),this[t]=this.shadowRoot.querySelector("#prompt"),this[n]=[this.shadowRoot.querySelector("#finger0"),this.shadowRoot.querySelector("#finger1")],this[s]=this.shadowRoot.querySelector(".pan-target"),this[r]=0,this[o]=1/0,this[a]=!1,this[c]=!1,this[l]=Gt.AUTOMATIC,this[h]=new wp(this[ne].camera,this[vi],this[ne]),this[u]=new or,this[d]=!1,this[f]=!1,this[p]=!1,this[g]={},this[A]=()=>{let _=this[Rt].changeSource;this[Sp]=_,_===Gt.USER_INTERACTION&&(this[Ep]=!0,this[vp]())},this[m]=()=>{this[iC](),this[Wt]();let _=this[Rt].changeSource;this.dispatchEvent(new CustomEvent("camera-change",{detail:{source:_}}))},this[b]=_=>{this[iu].classList.toggle("pointer-tumbling",_.type==="pointer-change-start")}}get inputSensitivity(){return this[Rt].inputSensitivity}set inputSensitivity(_){this[Rt].inputSensitivity=_}getCameraOrbit(){let{theta:_,phi:S,radius:C}=this[cy];return{theta:_,phi:S,radius:C,toString(){return`${this.theta}rad ${this.phi}rad ${this.radius}m`}}}getCameraTarget(){return os(this[ut].isPresenting?this[ut].arRenderer.target:this[ne].getDynamicTarget())}getFieldOfView(){return this[Rt].getFieldOfView()}getMinimumFieldOfView(){return this[Rt].options.minimumFieldOfView}getMaximumFieldOfView(){return this[Rt].options.maximumFieldOfView}getIdealAspect(){return this[ne].idealAspect}jumpCameraToGoal(){this[Jh]=!0,this.requestUpdate(Jh,!1)}resetInteractionPrompt(){this[jh]=0,this[Jc]=1/0,this[Ep]=!1,this[Aa]=this.interactionPrompt===xp.AUTO&&this.cameraControls}zoom(_){let S=new WheelEvent("wheel",{deltaY:-30*_});this[vi].dispatchEvent(S)}connectedCallback(){super.connectedCallback(),this[Rt].addEventListener("user-interaction",this[jc]),this[Rt].addEventListener("pointer-change-start",this[Yh]),this[Rt].addEventListener("pointer-change-end",this[Yh])}disconnectedCallback(){super.disconnectedCallback(),this[Rt].removeEventListener("user-interaction",this[jc]),this[Rt].removeEventListener("pointer-change-start",this[Yh]),this[Rt].removeEventListener("pointer-change-end",this[Yh])}updated(_){super.updated(_);let S=this[Rt],C=this[ne];if(_.has("cameraControls")&&(this.cameraControls?(S.enableInteraction(),this.interactionPrompt===xp.AUTO&&(this[Aa]=!0)):(S.disableInteraction(),this[vp]()),this[vi].setAttribute("aria-label",this[ga])),_.has("disableZoom")&&(S.disableZoom=this.disableZoom),_.has("disablePan")&&(S.enablePan=!this.disablePan),_.has("disableTap")&&(S.enableTap=!this.disableTap),(_.has("interactionPrompt")||_.has("cameraControls")||_.has("src"))&&(this.interactionPrompt===xp.AUTO&&this.cameraControls&&!this[Ep]?this[Aa]=!0:this[vp]()),_.has("interactionPromptStyle")&&(this[_p].style.opacity=this.interactionPromptStyle==sy.BASIC?"1":"0"),_.has("touchAction")){let w=this.touchAction;S.applyOptions({touchAction:w}),S.updateTouchActionStyle()}_.has("orbitSensitivity")&&(S.orbitSensitivity=this.orbitSensitivity),_.has("zoomSensitivity")&&(S.zoomSensitivity=this.zoomSensitivity),_.has("panSensitivity")&&(S.panSensitivity=this.panSensitivity),_.has("interpolationDecay")&&(S.setDamperDecayTime(this.interpolationDecay),C.setTargetDamperDecayTime(this.interpolationDecay)),_.has("a11y")&&this[sC](),this[Jh]===!0&&Promise.resolve().then(()=>{S.jumpToGoal(),C.jumpToGoal(),this[ay](),this[Jh]=!1})}async updateFraming(){let _=this[ne],S=_.adjustedFoV(_.framedFoVDeg);await _.updateFraming();let C=_.adjustedFoV(_.framedFoVDeg),w=this[Rt].getFieldOfView()/S;this[Rt].setFieldOfView(C*w),this[Zh]=!0,this.requestUpdate("maxFieldOfView"),this.requestUpdate("fieldOfView"),this.requestUpdate("minCameraOrbit"),this.requestUpdate("maxCameraOrbit"),this.requestUpdate("cameraOrbit"),await this.updateComplete}interact(_,S,C){let w=this[vi],v=this[oy];if(v[0].style.opacity==="1"){console.warn("interact() failed because an existing interaction is running.");return}let E=new Array;E.push({x:ma(S.x),y:ma(S.y)});let R=[{x:E[0].x(0),y:E[0].y(0)}];C!=null&&(E.push({x:ma(C.x),y:ma(C.y)}),R.push({x:E[1].x(0),y:E[1].y(0)}));let F=performance.now(),{width:P,height:U}=this[ne],V=this.getBoundingClientRect(),O=ee=>{for(let[ae,he]of R.entries()){let{style:ve}=v[ae];ve.transform=`translateX(${P*he.x}px) translateY(${U*he.y}px)`,ee==="pointerdown"?ve.opacity="1":ee==="pointerup"&&(ve.opacity="0");let Le={pointerId:ae-5678,pointerType:"touch",target:w,clientX:P*he.x+V.x,clientY:U*he.y+V.y,altKey:!0};w.dispatchEvent(new PointerEvent(ee,Le))}},K=()=>{let ee=this[Sp];if(ee!==Gt.AUTOMATIC||!w.isConnected){for(let he of this[oy])he.style.opacity="0";O("pointercancel"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:ee}})),document.removeEventListener("visibilitychange",z);return}let ae=Math.min(1,(performance.now()-F)/_);for(let[he,ve]of R.entries())ve.x=E[he].x(ae),ve.y=E[he].y(ae);O("pointermove"),ae<1?requestAnimationFrame(K):(O("pointerup"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:Gt.AUTOMATIC}})),document.removeEventListener("visibilitychange",z))},z=()=>{let ee=0;document.visibilityState==="hidden"?ee=performance.now()-F:F=performance.now()-ee};document.addEventListener("visibilitychange",z),O("pointerdown"),this[Sp]=Gt.AUTOMATIC,requestAnimationFrame(K)}[(e=ry,t=_p,n=oy,s=nu,r=jh,o=Jc,a=Ep,c=Aa,l=Sp,h=Rt,u=cy,d=Jh,f=ly,p=Zh,g=br,aC)](_){let S=this[Rt],C=this[ne];C.framedFoVDeg=_[0]*180/Math.PI,S.changeSource=Gt.NONE,S.setFieldOfView(C.adjustedFoV(C.framedFoVDeg)),this[jc]()}[oC](_){let S=this[Rt];if(this[Zh]){let{theta:C,phi:w}=this.getCameraOrbit();_[0]=C,_[1]=w,this[Zh]=!1}S.changeSource=Gt.NONE,S.setOrbit(_[0],_[1],_[2]),this[jc]()}[lC](_){this[Rt].applyOptions({minimumAzimuthalAngle:_[0],minimumPolarAngle:_[1],minimumRadius:_[2]}),this.jumpCameraToGoal()}[hC](_){this[Rt].applyOptions({maximumAzimuthalAngle:_[0],maximumPolarAngle:_[1],maximumRadius:_[2]}),this[rC](_[2]),this.jumpCameraToGoal()}[uC](_){this[Rt].applyOptions({minimumFieldOfView:_[0]*180/Math.PI}),this.jumpCameraToGoal()}[dC](_){let S=this[ne].adjustedFoV(_[0]*180/Math.PI);this[Rt].applyOptions({maximumFieldOfView:S}),this.jumpCameraToGoal()}[cC](_){let[S,C,w]=_;this[ut].arRenderer.isPresenting||this[ne].setTarget(S,C,w),this[Rt].changeSource=Gt.NONE,this[ut].arRenderer.updateTarget(),this[jc]()}[Xn](_,S){if(super[Xn](_,S),this[ut].isPresenting||!this[rs]())return;let C=this[Rt],w=this[ne],v=performance.now();if(this[Aa]&&this.loaded&&v>this[Zc]+this.interactionPromptThreshold&&(this[Aa]=!1,this[Jc]=v,this[ry].classList.add("visible")),isFinite(this[Jc])&&this.interactionPromptStyle===sy.WIGGLE){let F=(v-this[Jc])/cU%1,P=lU(F),U=hU(F);if(this[_p].style.opacity=`${U}`,P!==this[jh]){let V=P*w.width*.05,O=(P-this[jh])*Math.PI/16;this[_p].style.transform=`translateX(${V}px)`,C.changeSource=Gt.AUTOMATIC,C.adjustOrbit(O,0,0),this[jh]=P}}let E=C.update(_,S),R=w.updateTarget(S);(E||R)&&this[ay]()}[vp](){this[Aa]=!1,this[ry].classList.remove("visible"),this[Jc]=1/0}[rC](_){let S=Math.max(this[ne].farRadius(),_),C=0,w=Math.abs(2*S);this[Rt].updateNearFar(C,w)}[iC](){let{theta:_,phi:S}=this[Rt].getCameraSpherical(this[cy]),C=(4+Math.floor((_%MU+CU)/mC))%4,w=Math.floor(S/wU),v=AU[C],R=`${gU[w]}${v}`,F=R;F in this[br]?this[eu](this[br][F]):this[eu](`View from stage ${R}`)}get[ga](){let _=bU;return"interaction-prompt"in this[br]&&(_=`. ${this[br]["interaction-prompt"]}`),super[ga].replace(/\.$/,"")+(this.cameraControls?_:"")}async[tu](_){let S=this[Rt],C=this[ne],w=C.adjustedFoV(C.framedFoVDeg);super[tu](_);let v=C.adjustedFoV(C.framedFoVDeg)/w,E=S.getFieldOfView()*(isFinite(v)?v:1);S.updateAspect(this[ne].aspect),this.requestUpdate("maxFieldOfView",this.maxFieldOfView),await this.updateComplete,this[Rt].setFieldOfView(E),this.jumpCameraToGoal()}[hi](){super[hi](),this[ly]?this[Zh]=!0:this[ly]=!0,this.requestUpdate("maxFieldOfView",this.maxFieldOfView),this.requestUpdate("fieldOfView",this.fieldOfView),this.requestUpdate("minCameraOrbit",this.minCameraOrbit),this.requestUpdate("maxCameraOrbit",this.maxCameraOrbit),this.requestUpdate("cameraOrbit",this.cameraOrbit),this.requestUpdate("cameraTarget",this.cameraTarget),this.jumpCameraToGoal()}[(A=jc,m=ay,b=Yh,sC)](){if(typeof this.a11y=="string")if(this.a11y.startsWith("{"))try{this[br]=JSON.parse(this.a11y)}catch(_){console.warn("Error parsing a11y JSON:",_)}else this.a11y.length>0?console.warn("Error not supported format, should be a JSON string:",this.a11y):this[br]={};else typeof this.a11y=="object"&&this.a11y!=null?this[br]=Object.assign({},this.a11y):this[br]={};this[vi].setAttribute("aria-label",this[ga])}}return an([Be({type:Boolean,attribute:"camera-controls"})],x.prototype,"cameraControls",void 0),an([Ds({intrinsics:pC,observeEffects:!0,updateHandler:oC}),Be({type:String,attribute:"camera-orbit",hasChanged:()=>!0})],x.prototype,"cameraOrbit",void 0),an([Ds({intrinsics:SU,observeEffects:!0,updateHandler:cC}),Be({type:String,attribute:"camera-target",hasChanged:()=>!0})],x.prototype,"cameraTarget",void 0),an([Ds({intrinsics:nC,observeEffects:!0,updateHandler:aC}),Be({type:String,attribute:"field-of-view",hasChanged:()=>!0})],x.prototype,"fieldOfView",void 0),an([Ds({intrinsics:vU,updateHandler:lC}),Be({type:String,attribute:"min-camera-orbit",hasChanged:()=>!0})],x.prototype,"minCameraOrbit",void 0),an([Ds({intrinsics:EU,updateHandler:hC}),Be({type:String,attribute:"max-camera-orbit",hasChanged:()=>!0})],x.prototype,"maxCameraOrbit",void 0),an([Ds({intrinsics:_U,updateHandler:uC}),Be({type:String,attribute:"min-field-of-view",hasChanged:()=>!0})],x.prototype,"minFieldOfView",void 0),an([Ds({intrinsics:nC,updateHandler:dC}),Be({type:String,attribute:"max-field-of-view",hasChanged:()=>!0})],x.prototype,"maxFieldOfView",void 0),an([Be({type:Number,attribute:"interaction-prompt-threshold"})],x.prototype,"interactionPromptThreshold",void 0),an([Be({type:String,attribute:"interaction-prompt"})],x.prototype,"interactionPrompt",void 0),an([Be({type:String,attribute:"interaction-prompt-style"})],x.prototype,"interactionPromptStyle",void 0),an([Be({type:Number,attribute:"orbit-sensitivity"})],x.prototype,"orbitSensitivity",void 0),an([Be({type:Number,attribute:"zoom-sensitivity"})],x.prototype,"zoomSensitivity",void 0),an([Be({type:Number,attribute:"pan-sensitivity"})],x.prototype,"panSensitivity",void 0),an([Be({type:String,attribute:"touch-action"})],x.prototype,"touchAction",void 0),an([Be({type:Boolean,attribute:"disable-zoom"})],x.prototype,"disableZoom",void 0),an([Be({type:Boolean,attribute:"disable-pan"})],x.prototype,"disablePan",void 0),an([Be({type:Boolean,attribute:"disable-tap"})],x.prototype,"disableTap",void 0),an([Be({type:Number,attribute:"interpolation-decay"})],x.prototype,"interpolationDecay",void 0),an([Be()],x.prototype,"a11y",void 0),x}});var TU,gC,IU,RU,yC,bC,Cp,Mp,Tp,Gt,wp,uy=oe(()=>{Xe();hy();ns();Vc();TU=.018,gC=2,IU=300,RU=new Fe,yC=new D,bC=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:0,maximumPolarAngle:Math.PI,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),Cp=Math.PI/8,Mp=.04,Tp=10,Gt={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"},wp=class extends xn{constructor(e,t,n){super(),this.camera=e,this.element=t,this.scene=n,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.inputSensitivity=1,this.changeSource=Gt.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new Qe,this.panPerPixel=0,this.spherical=new or,this.goalSpherical=new or,this.thetaDamper=new tn,this.phiDamper=new tn,this.radiusDamper=new tn,this.logFov=Math.log(bC.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new tn,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=s=>{if(this.enablePan)s.preventDefault();else for(let r of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:r.id})))},this.touchModeZoom=(s,r)=>{if(!this._disableZoom){let o=this.twoTouchDistance(this.pointers[0],this.pointers[1]),a=Mp*this.zoomSensitivity*(this.lastSeparation-o)*50/this.scene.height;this.lastSeparation=o,this.userAdjustOrbit(0,0,a)}this.panPerPixel>0&&this.movePan(s,r)},this.disableScroll=s=>{s.preventDefault()},this.touchModeRotate=(s,r)=>{let{touchAction:o}=this._options;if(!this.touchDecided&&o!=="none"){this.touchDecided=!0;let a=Math.abs(s),c=Math.abs(r);if(this.changeSource===Gt.USER_INTERACTION&&(o==="pan-y"&&c>a||o==="pan-x"&&a>c)){this.touchMode=null;return}else this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(s,r)},this.onPointerDown=s=>{if(this.pointers.length>2)return;let{element:r}=this;this.pointers.length===0&&(r.addEventListener("pointermove",this.onPointerMove),r.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=s.clientX,this.startPointerPosition.clientY=s.clientY,this.startTime=performance.now());try{r.setPointerCapture(s.pointerId)}catch{}this.pointers.push({clientX:s.clientX,clientY:s.clientY,id:s.pointerId}),this.isUserPointing=!1,s.pointerType==="touch"?(this.changeSource=s.altKey?Gt.AUTOMATIC:Gt.USER_INTERACTION,this.onTouchChange(s)):(this.changeSource=Gt.USER_INTERACTION,this.onMouseDown(s)),this.changeSource===Gt.USER_INTERACTION&&this.dispatchEvent({type:"user-interaction"})},this.onPointerMove=s=>{let r=this.pointers.find(l=>l.id===s.pointerId);if(r==null)return;if(s.pointerType==="mouse"&&s.buttons===0){this.onPointerUp(s);return}let o=this.pointers.length,a=(s.clientX-r.clientX)/o,c=(s.clientY-r.clientY)/o;a===0&&c===0||(r.clientX=s.clientX,r.clientY=s.clientY,s.pointerType==="touch"?(this.changeSource=s.altKey?Gt.AUTOMATIC:Gt.USER_INTERACTION,this.touchMode!==null&&this.touchMode(a,c)):(this.changeSource=Gt.USER_INTERACTION,this.panPerPixel>0?this.movePan(a,c):this.handleSinglePointerMove(a,c)))},this.onPointerUp=s=>{let{element:r}=this,o=this.pointers.findIndex(a=>a.id===s.pointerId);o!==-1&&this.pointers.splice(o,1),this.panPerPixel>0&&!s.altKey&&this.resetRadius(),this.pointers.length===0?(r.removeEventListener("pointermove",this.onPointerMove),r.removeEventListener("pointerup",this.onPointerUp),r.removeEventListener("touchmove",this.disableScroll),this.enablePan&&this.enableTap&&this.recenter(s)):this.touchMode!==null&&this.onTouchChange(s),this.scene.element[nu].style.opacity=0,r.style.cursor="grab",this.panPerPixel=0,this.isUserPointing&&this.dispatchEvent({type:"pointer-change-end"})},this.onWheel=s=>{this.changeSource=Gt.USER_INTERACTION;let r=s.deltaY*(s.deltaMode==1?18:1)*Mp*this.zoomSensitivity/30;this.userAdjustOrbit(0,0,r),s.preventDefault(),this.dispatchEvent({type:"user-interaction"})},this.onKeyDown=s=>{let{changeSource:r}=this;this.changeSource=Gt.USER_INTERACTION,(s.shiftKey&&this.enablePan?this.panKeyCodeHandler(s):this.orbitZoomKeyCodeHandler(s))?(s.preventDefault(),this.dispatchEvent({type:"user-interaction"})):this.changeSource=r},this._options=Object.assign({},bC),this.setOrbit(0,Math.PI/2,1),this.setFieldOfView(100),this.jumpToGoal()}get interactionEnabled(){return this._interactionEnabled}enableInteraction(){if(this._interactionEnabled===!1){let{element:e}=this;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointercancel",this.onPointerUp),this._disableZoom||e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown),e.addEventListener("touchmove",()=>{},{passive:!1}),e.addEventListener("contextmenu",this.onContext),this.element.style.cursor="grab",this._interactionEnabled=!0,this.updateTouchActionStyle()}}disableInteraction(){if(this._interactionEnabled===!0){let{element:e}=this;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("contextmenu",this.onContext),e.style.cursor="",this.touchMode=null,this._interactionEnabled=!1,this.updateTouchActionStyle()}}get options(){return this._options}set disableZoom(e){this._disableZoom!=e&&(this._disableZoom=e,e===!0?this.element.removeEventListener("wheel",this.onWheel):this.element.addEventListener("wheel",this.onWheel),this.updateTouchActionStyle())}getCameraSpherical(e=new or){return e.copy(this.spherical)}getFieldOfView(){return this.camera.fov}applyOptions(e){Object.assign(this._options,e),this.setOrbit(),this.setFieldOfView(Math.exp(this.goalLogFov))}updateNearFar(e,t){this.camera.far=t===0?2:t,this.camera.near=Math.max(e,this.camera.far/1e3),this.camera.updateProjectionMatrix()}updateAspect(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}setOrbit(e=this.goalSpherical.theta,t=this.goalSpherical.phi,n=this.goalSpherical.radius){let{minimumAzimuthalAngle:s,maximumAzimuthalAngle:r,minimumPolarAngle:o,maximumPolarAngle:a,minimumRadius:c,maximumRadius:l}=this._options,{theta:h,phi:u,radius:d}=this.goalSpherical,f=Nn(e,s,r);!isFinite(s)&&!isFinite(r)&&(this.spherical.theta=this.wrapAngle(this.spherical.theta-f)+f);let p=Nn(t,o,a),g=Nn(n,c,l);return f===h&&p===u&&g===d||!isFinite(f)||!isFinite(p)||!isFinite(g)?!1:(this.goalSpherical.theta=f,this.goalSpherical.phi=p,this.goalSpherical.radius=g,this.goalSpherical.makeSafe(),!0)}setRadius(e){this.goalSpherical.radius=e,this.setOrbit()}setFieldOfView(e){let{minimumFieldOfView:t,maximumFieldOfView:n}=this._options;e=Nn(e,t,n),this.goalLogFov=Math.log(e)}setDamperDecayTime(e){this.thetaDamper.setDecayTime(e),this.phiDamper.setDecayTime(e),this.radiusDamper.setDecayTime(e),this.fovDamper.setDecayTime(e)}adjustOrbit(e,t,n){let{theta:s,phi:r,radius:o}=this.goalSpherical,{minimumRadius:a,maximumRadius:c,minimumFieldOfView:l,maximumFieldOfView:h}=this._options,u=this.spherical.theta-s,d=Math.PI-.001,f=s-Nn(e,-d-u,d-u),p=r-t,g=n===0?0:((n>0?c:a)-o)/(Math.log(n>0?h:l)-this.goalLogFov),A=o+n*(isFinite(g)?g:(c-a)*2);if(this.setOrbit(f,p,A),n!==0){let m=this.goalLogFov+n;this.setFieldOfView(Math.exp(m))}}jumpToGoal(){this.update(0,1e4)}update(e,t){if(this.isStationary())return!1;let{maximumPolarAngle:n,maximumRadius:s}=this._options,r=this.spherical.theta-this.goalSpherical.theta;return Math.abs(r)>Math.PI&&!isFinite(this._options.minimumAzimuthalAngle)&&!isFinite(this._options.maximumAzimuthalAngle)&&(this.spherical.theta-=Math.sign(r)*2*Math.PI),this.spherical.theta=this.thetaDamper.update(this.spherical.theta,this.goalSpherical.theta,t,Math.PI),this.spherical.phi=this.phiDamper.update(this.spherical.phi,this.goalSpherical.phi,t,n),this.spherical.radius=this.radiusDamper.update(this.spherical.radius,this.goalSpherical.radius,t,s),this.logFov=this.fovDamper.update(this.logFov,this.goalLogFov,t,1),this.moveCamera(),!0}updateTouchActionStyle(){let{style:e}=this.element;if(this._interactionEnabled){let{touchAction:t}=this._options;this._disableZoom&&t!=="none"?e.touchAction="manipulation":e.touchAction=t}else e.touchAction=""}isStationary(){return this.goalSpherical.theta===this.spherical.theta&&this.goalSpherical.phi===this.spherical.phi&&this.goalSpherical.radius===this.spherical.radius&&this.goalLogFov===this.logFov}moveCamera(){this.spherical.makeSafe(),this.camera.position.setFromSpherical(this.spherical),this.camera.setRotationFromEuler(new Kn(this.spherical.phi-Math.PI/2,this.spherical.theta,0,"YXZ")),this.camera.fov!==Math.exp(this.logFov)&&(this.camera.fov=Math.exp(this.logFov),this.camera.updateProjectionMatrix())}userAdjustOrbit(e,t,n){this.adjustOrbit(e*this.orbitSensitivity*this.inputSensitivity,t*this.orbitSensitivity*this.inputSensitivity,n*this.inputSensitivity)}wrapAngle(e){let t=(e+Math.PI)/(2*Math.PI);return(t-Math.floor(t))*2*Math.PI-Math.PI}pixelLengthToSphericalAngle(e){return 2*Math.PI*e/this.scene.height}twoTouchDistance(e,t){let{clientX:n,clientY:s}=e,{clientX:r,clientY:o}=t,a=r-n,c=o-s;return Math.sqrt(a*a+c*c)}handleSinglePointerMove(e,t){let n=this.pixelLengthToSphericalAngle(e),s=this.pixelLengthToSphericalAngle(t);this.isUserPointing===!1&&(this.isUserPointing=!0,this.dispatchEvent({type:"pointer-change-start"})),this.userAdjustOrbit(n,s,0)}initializePan(){let{theta:e,phi:t}=this.spherical,n=e-this.scene.yaw;this.panPerPixel=TU*this.panSensitivity/this.scene.height,this.panProjection.set(-Math.cos(n),-Math.cos(t)*Math.sin(n),0,0,Math.sin(t),0,Math.sin(n),-Math.cos(t)*Math.cos(n),0)}movePan(e,t){let{scene:n}=this,s=yC.set(e,t,0).multiplyScalar(this.inputSensitivity),r=this.spherical.radius*Math.exp(this.logFov)*this.panPerPixel;s.multiplyScalar(r);let o=n.getTarget();o.add(s.applyMatrix3(this.panProjection)),n.boundingSphere.clampPoint(o,o),n.setTarget(o.x,o.y,o.z)}recenter(e){if(performance.now()>this.startTime+IU||Math.abs(e.clientX-this.startPointerPosition.clientX)>gC||Math.abs(e.clientY-this.startPointerPosition.clientY)>gC)return;let{scene:t}=this,n=t.positionAndNormalFromPoint(t.getNDC(e.clientX,e.clientY));if(n==null){let{cameraTarget:s}=t.element;t.element.cameraTarget="",t.element.cameraTarget=s,this.userAdjustOrbit(0,0,1)}else t.target.worldToLocal(n.position),t.setTarget(n.position.x,n.position.y,n.position.z)}resetRadius(){let{scene:e}=this,t=e.positionAndNormalFromPoint(RU.set(0,0));if(t==null)return;e.target.worldToLocal(t.position);let n=e.getTarget(),{theta:s,phi:r}=this.spherical,o=s-e.yaw,a=yC.set(Math.sin(r)*Math.sin(o),Math.cos(r),Math.sin(r)*Math.cos(o)),c=a.dot(t.position.sub(n));n.add(a.multiplyScalar(c)),e.setTarget(n.x,n.y,n.z),this.setOrbit(void 0,void 0,this.goalSpherical.radius-c)}onTouchChange(e){if(this.pointers.length===1)this.touchMode=this.touchModeRotate;else{if(this._disableZoom){this.touchMode=null,this.element.removeEventListener("touchmove",this.disableScroll);return}this.touchMode=this.touchDecided&&this.touchMode===null?null:this.touchModeZoom,this.touchDecided=!0,this.element.addEventListener("touchmove",this.disableScroll,{passive:!1}),this.lastSeparation=this.twoTouchDistance(this.pointers[0],this.pointers[1]),this.enablePan&&this.touchMode!=null&&(this.initializePan(),e.altKey||(this.scene.element[nu].style.opacity=1))}}onMouseDown(e){this.panPerPixel=0,this.enablePan&&(e.button===2||e.ctrlKey||e.metaKey||e.shiftKey)&&(this.initializePan(),this.scene.element[nu].style.opacity=1),this.element.style.cursor="grabbing"}orbitZoomKeyCodeHandler(e){let t=!0;switch(e.key){case"PageUp":this.userAdjustOrbit(0,0,Mp*this.zoomSensitivity);break;case"PageDown":this.userAdjustOrbit(0,0,-1*Mp*this.zoomSensitivity);break;case"ArrowUp":this.userAdjustOrbit(0,-Cp,0);break;case"ArrowDown":this.userAdjustOrbit(0,Cp,0);break;case"ArrowLeft":this.userAdjustOrbit(-Cp,0,0);break;case"ArrowRight":this.userAdjustOrbit(Cp,0,0);break;default:t=!1;break}return t}panKeyCodeHandler(e){this.initializePan();let t=!0;switch(e.key){case"ArrowUp":this.movePan(0,-1*Tp);break;case"ArrowDown":this.movePan(0,Tp);break;case"ArrowLeft":this.movePan(-1*Tp,0);break;case"ArrowRight":this.movePan(Tp,0);break;default:t=!1;break}return t}}});var BU,xC,_C,DU,LU,PU,FU,el,vC,OU,xr,Ip,su,tl,NU,UU,kU,EC,GU,Rp,fy=oe(()=>{Xe();Mw();Qh();ns();Vc();Bw();uy();BU=30,xC=.8,_C=1.5,DU=20,LU=.2,PU=.25,FU=10,el=150,vC=5,OU=.1,xr={NOT_PRESENTING:"not-presenting",SESSION_STARTED:"session-started",OBJECT_PLACED:"object-placed",FAILED:"failed"},Ip={TRACKING:"tracking",NOT_TRACKING:"not-tracking"},su=new D,tl=new $t,NU=new Oe,UU=new D,kU=new Kt(45,1,.1,100),EC=new Zt().setFromPoints([new D(0,0,0),new D(0,0,-1)]),GU=new ii,Rp=class extends xn{constructor(e){super(),this.renderer=e,this.currentSession=null,this.placeOnWall=!1,this.placementBox=null,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.initialHitSource=null,this.transientHitTestSource=null,this.inputSource=null,this._presentedScene=null,this.resolveCleanup=null,this.exitWebXRButtonContainer=null,this.overlay=null,this.xrLight=null,this.xrMode=null,this.controller1=null,this.controller2=null,this.selectedController=null,this.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new D,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.lastDragPosition=new D,this.relativeOrientation=new $t,this.scaleLine=new xs(EC),this.firstRatio=0,this.lastAngle=0,this.goalPosition=new D,this.goalYaw=0,this.goalScale=1,this.xDamper=new tn,this.yDamper=new tn,this.zDamper=new tn,this.yawDamper=new tn,this.pitchDamper=new tn,this.rollDamper=new tn,this.scaleDamper=new tn,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onControllerSelectStart=t=>{let n=this.presentedScene,s=t.target;if(this.placementBox.controllerIntersection(n,s)!=null)this.selectedController!=null&&(this.selectedController.userData.line.visible=!1,n.canScale&&(this.isTwoFingering=!0,this.firstRatio=this.controllerSeparation()/n.pivot.scale.x,this.scaleLine.visible=!0)),s.attach(n.pivot),this.selectedController=s,n.setShadowIntensity(.01);else{let r=s===this.controller1?this.controller2:this.controller1;this.relativeOrientation.copy(s.quaternion).invert().multiply(n.pivot.getWorldQuaternion(tl)),r.userData.turning=!1,s.userData.turning=!0,s.userData.line.visible=!1}},this.onControllerSelectEnd=t=>{let n=t.target;if(n.userData.turning=!1,n.userData.line.visible=!0,this.isTwoFingering=!1,this.scaleLine.visible=!1,this.selectedController!=null&&this.selectedController!=n)return;let s=this.presentedScene;s.attach(s.pivot),this.selectedController=null,this.goalYaw=Math.atan2(s.pivot.matrix.elements[8],s.pivot.matrix.elements[10]),this.goalPosition.x=s.pivot.position.x,this.goalPosition.z=s.pivot.position.z},this.onUpdateScene=()=>{this.placementBox!=null&&this.isPresenting&&(this.placementBox.dispose(),this.placementBox=new $h(this.presentedScene,this.placeOnWall?"back":"bottom"))},this.onSelectStart=t=>{let n=this.transientHitTestSource;if(n==null)return;let s=this.frame.getHitTestResultsForTransientInput(n),r=this.presentedScene,o=this.placementBox;if(s.length===1){this.inputSource=t.inputSource;let{axes:a}=this.inputSource.gamepad,c=o.getHit(this.presentedScene,a[0],a[1]);o.show=!0,c!=null?(this.isTranslating=!0,this.lastDragPosition.copy(c)):this.placeOnWall===!1&&(this.isRotating=!0,this.lastAngle=a[0]*_C)}else if(s.length===2){o.show=!0,this.isTwoFingering=!0;let{separation:a}=this.fingerPolar(s);this.firstRatio=a/r.pivot.scale.x}},this.onSelectEnd=()=>{this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.inputSource=null,this.goalPosition.y+=this.placementBox.offsetHeight*this.presentedScene.scale.x,this.placementBox.show=!1},this.threeRenderer=e.threeRenderer,this.threeRenderer.xr.enabled=!0}async resolveARSession(){Lg();let e=await navigator.xr.requestSession("immersive-ar",{requiredFeatures:[],optionalFeatures:["hit-test","dom-overlay","light-estimation"],domOverlay:this.overlay?{root:this.overlay}:void 0});return this.threeRenderer.xr.setReferenceSpaceType("local"),await this.threeRenderer.xr.setSession(e),this.threeRenderer.xr.cameraAutoUpdate=!1,e}get presentedScene(){return this._presentedScene}async supportsPresentation(){try{return Lg(),await navigator.xr.isSessionSupported("immersive-ar")}catch(e){return console.warn("Request to present in WebXR denied:"),console.warn(e),console.warn("Falling back to next ar-mode"),!1}}async present(e,t=!1){this.isPresenting&&console.warn("Cannot present while a model is already presenting");let n=new Promise((l,h)=>{requestAnimationFrame(()=>l())});e.setHotspotsVisibility(!1),e.queueRender(),await n,this._presentedScene=e,this.overlay=e.element.shadowRoot.querySelector("div.default"),t===!0&&(this.xrLight=new dp(this.threeRenderer),this.xrLight.addEventListener("estimationstart",()=>{if(!this.isPresenting||this.xrLight==null)return;let l=this.presentedScene;l.add(this.xrLight),l.environment=this.xrLight.environment}));let s=await this.resolveARSession();s.addEventListener("end",()=>{this.postSessionCleanup()},{once:!0});let r=e.element.shadowRoot.querySelector(".slot.exit-webxr-ar-button");r.classList.add("enabled"),r.addEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=r;let o=await s.requestReferenceSpace("viewer");this.xrMode=s.interactionMode,this.tracking=!0,this.frames=0,this.initialized=!1,this.turntableRotation=e.yaw,this.goalYaw=e.yaw,this.goalScale=1,e.setBackground(null),this.oldShadowIntensity=e.shadowIntensity,e.setShadowIntensity(.01),this.oldTarget.copy(e.getTarget()),e.element.addEventListener("load",this.onUpdateScene);let a=DU*Math.PI/180,c=this.placeOnWall===!0?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(a),z:-Math.cos(a)});s.requestHitTestSource({space:o,offsetRay:c}).then(l=>{this.initialHitSource=l}),this.xrMode!=="screen-space"&&(this.setupControllers(),this.xDamper.setDecayTime(el),this.yDamper.setDecayTime(el),this.zDamper.setDecayTime(el),this.yawDamper.setDecayTime(el),this.pitchDamper.setDecayTime(el),this.rollDamper.setDecayTime(el)),this.currentSession=s,this.placementBox=new $h(e,this.placeOnWall?"back":"bottom"),this.placementComplete=!1,this.lastTick=performance.now(),this.dispatchEvent({type:"status",status:xr.SESSION_STARTED})}setupControllers(){this.controller1=this.threeRenderer.xr.getController(0),this.controller1.addEventListener("selectstart",this.onControllerSelectStart),this.controller1.addEventListener("selectend",this.onControllerSelectEnd),this.controller2=this.threeRenderer.xr.getController(1),this.controller2.addEventListener("selectstart",this.onControllerSelectStart),this.controller2.addEventListener("selectend",this.onControllerSelectEnd);let e=this.presentedScene;if(e.add(this.controller1),e.add(this.controller2),!this.controller1.userData.line){let t=new xs(EC);t.name="line",t.scale.z=vC,this.controller1.userData.turning=!1,this.controller1.userData.line=t,this.controller1.add(t),this.controller2.userData.turning=!1;let n=t.clone();this.controller2.userData.line=n,this.controller2.add(n),this.scaleLine.name="scale line",this.scaleLine.visible=!1,this.controller1.add(this.scaleLine);let{size:s}=e,r=OU/Math.max(s.x,s.y,s.z),o=new Ke(GU);o.name="box",o.scale.copy(s).multiplyScalar(r),o.visible=!1,this.controller1.userData.box=o,e.add(o);let a=o.clone();this.controller2.userData.box=a,e.add(a)}}hover(e){if(this.xrMode==="screen-space"||this.selectedController==e)return!1;let t=this.presentedScene,n=this.placementBox.controllerIntersection(t,e);return e.userData.box.visible=(n==null||e.userData.turning)&&!this.isTwoFingering,e.userData.line.scale.z=n==null?vC:n.distance,n!=null}controllerSeparation(){return this.controller1.position.distanceTo(this.controller2.position)}async stopPresenting(){if(!this.isPresenting)return;let e=new Promise(t=>{this.resolveCleanup=t});try{await this.currentSession.end(),await e}catch(t){console.warn("Error while trying to end WebXR AR session"),console.warn(t),this.postSessionCleanup()}}get isPresenting(){return this.presentedScene!=null}get target(){return this.oldTarget}updateTarget(){let e=this.presentedScene;if(e!=null){let t=e.getTarget();this.oldTarget.copy(t),this.placeOnWall?t.z=e.boundingBox.min.z:t.y=e.boundingBox.min.y,e.setTarget(t.x,t.y,t.z)}}postSessionCleanup(){let e=this.currentSession;e!=null&&(e.removeEventListener("selectstart",this.onSelectStart),e.removeEventListener("selectend",this.onSelectEnd),this.currentSession=null);let t=this.presentedScene;if(this._presentedScene=null,t!=null){let{element:o}=t;this.xrLight!=null&&(t.remove(this.xrLight),this.xrLight.dispose(),this.xrLight=null),t.add(t.pivot),t.pivot.quaternion.set(0,0,0,1),t.pivot.position.set(0,0,0),t.pivot.scale.set(1,1,1),t.setShadowOffset(0);let a=this.turntableRotation;a!=null&&(t.yaw=a);let c=this.oldShadowIntensity;c!=null&&t.setShadowIntensity(c),t.setEnvironmentAndSkybox(o[kc],o[Gc]);let l=this.oldTarget;t.setTarget(l.x,l.y,l.z),t.xrCamera=null,t.element.removeEventListener("load",this.onUpdateScene),t.orientHotspots(0);let{width:h,height:u}=o.getBoundingClientRect();t.setSize(h,u),requestAnimationFrame(()=>{t.element.dispatchEvent(new CustomEvent("camera-change",{detail:{source:Gt.NONE}}))})}this.renderer.height=0;let n=this.exitWebXRButtonContainer;n!=null&&(n.classList.remove("enabled"),n.removeEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=null);let s=this.transientHitTestSource;s!=null&&(s.cancel(),this.transientHitTestSource=null);let r=this.initialHitSource;r!=null&&(r.cancel(),this.initialHitSource=null),this.placementBox!=null&&(this.placementBox.dispose(),this.placementBox=null),this.xrMode!=="screen-space"&&(this.controller1!=null&&(this.controller1.userData.turning=!1,this.controller1.userData.box.visible=!1,this.controller1.userData.line.visible=!0,this.controller1.removeEventListener("selectstart",this.onControllerSelectStart),this.controller1.removeEventListener("selectend",this.onControllerSelectEnd),this.controller1.removeFromParent(),this.controller1=null),this.controller2!=null&&(this.controller2.userData.turning=!1,this.controller2.userData.box.visible=!1,this.controller2.userData.line.visible=!0,this.controller2.removeEventListener("selectstart",this.onControllerSelectStart),this.controller2.removeEventListener("selectend",this.onControllerSelectEnd),this.controller2.removeFromParent(),this.controller2=null),this.selectedController=null,this.scaleLine.visible=!1),this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.inputSource=null,this.overlay=null,this.resolveCleanup!=null&&this.resolveCleanup(),this.dispatchEvent({type:"status",status:xr.NOT_PRESENTING})}updateView(e){let t=this.presentedScene,n=this.threeRenderer.xr;n.updateCamera(kU),t.xrCamera=n.getCamera();let{elements:s}=t.getCamera().matrixWorld;if(t.orientHotspots(Math.atan2(s[1],s[5])),this.initialized||(this.placeInitially(),this.initialized=!0),e.requestViewportScale&&e.recommendedViewportScale){let o=e.recommendedViewportScale;e.requestViewportScale(Math.max(o,PU))}let r=n.getBaseLayer();if(r!=null){let o=r instanceof XRWebGLLayer?r.getViewport(e):n.getBinding().getViewSubImage(r,e).viewport;this.threeRenderer.setViewport(o.x,o.y,o.width,o.height)}}placeInitially(){let e=this.presentedScene,{pivot:t,element:n}=e,{position:s}=t,r=e.getCamera(),{width:o,height:a}=this.overlay.getBoundingClientRect();e.setSize(o,a),r.projectionMatrixInverse.copy(r.projectionMatrix).invert();let{theta:c}=n.getCameraOrbit(),l=r.getWorldDirection(su);e.yaw=Math.atan2(-l.x,-l.z)-c,this.goalYaw=e.yaw;let h=Math.max(1,2*e.boundingSphere.radius);s.copy(r.position).add(l.multiplyScalar(h)),this.updateTarget();let u=e.getTarget();if(s.add(u).sub(this.oldTarget),this.goalPosition.copy(s),e.setHotspotsVisibility(!0),this.xrMode==="screen-space"){let{session:d}=this.frame;d.addEventListener("selectstart",this.onSelectStart),d.addEventListener("selectend",this.onSelectEnd),d.requestHitTestSourceForTransientInput({profile:"generic-touchscreen"}).then(f=>{this.transientHitTestSource=f})}}getTouchLocation(){let{axes:e}=this.inputSource.gamepad,t=this.placementBox.getExpandedHit(this.presentedScene,e[0],e[1]);return t!=null&&(su.copy(t).sub(this.presentedScene.getCamera().position),su.length()>FU)?null:t}getHitPoint(e){let t=this.threeRenderer.xr.getReferenceSpace(),n=e.getPose(t);if(n==null)return null;let s=NU.fromArray(n.transform.matrix);return this.placeOnWall===!0&&(this.goalYaw=Math.atan2(s.elements[4],s.elements[6])),s.elements[5]>.75!==this.placeOnWall?UU.setFromMatrixPosition(s):null}moveToFloor(e){let t=this.initialHitSource;if(t==null)return;let n=e.getHitTestResults(t);if(n.length==0)return;let s=n[0],r=this.getHitPoint(s);r!=null&&(this.placementBox.show=!0,this.isTranslating||(this.placeOnWall?this.goalPosition.copy(r):this.goalPosition.y=r.y),t.cancel(),this.initialHitSource=null,this.dispatchEvent({type:"status",status:xr.OBJECT_PLACED}))}fingerPolar(e){let t=e[0].inputSource.gamepad.axes,n=e[1].inputSource.gamepad.axes,s=n[0]-t[0],r=n[1]-t[1],o=Math.atan2(r,s),a=this.lastAngle-o;return a>Math.PI?a-=2*Math.PI:a<-Math.PI&&(a+=2*Math.PI),this.lastAngle=o,{separation:Math.sqrt(s*s+r*r),deltaYaw:a}}setScale(e){let t=e/this.firstRatio;this.goalScale=Math.abs(t-1)<LU?1:t}processInput(e){let t=this.transientHitTestSource;if(t==null||!this.isTranslating&&!this.isTwoFingering&&!this.isRotating)return;let n=e.getHitTestResultsForTransientInput(t),s=this.presentedScene,r=s.pivot.scale.x;if(this.isTwoFingering){if(n.length<2)this.isTwoFingering=!1;else{let{separation:o,deltaYaw:a}=this.fingerPolar(n);this.placeOnWall===!1&&(this.goalYaw+=a),s.canScale&&this.setScale(o)}return}else if(n.length===2){this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!0;let{separation:o}=this.fingerPolar(n);this.firstRatio=o/r;return}if(this.isRotating){let o=this.inputSource.gamepad.axes[0]*_C;this.goalYaw+=o-this.lastAngle,this.lastAngle=o}else this.isTranslating&&n.forEach(o=>{if(o.inputSource!==this.inputSource)return;let a=null;if(o.results.length>0&&(a=this.getHitPoint(o.results[0])),a==null&&(a=this.getTouchLocation()),a!=null){if(this.goalPosition.sub(this.lastDragPosition),this.placeOnWall===!1){let c=a.y-this.lastDragPosition.y;if(c<0){this.placementBox.offsetHeight=c/r,this.presentedScene.setShadowOffset(c);let l=su.copy(s.getCamera().position),h=-c/(l.y-a.y);l.multiplyScalar(h),a.multiplyScalar(1-h).add(l)}}this.goalPosition.add(a),this.lastDragPosition.copy(a)}})}moveScene(e){let t=this.presentedScene,{pivot:n}=t,s=this.placementBox;if(s.updateOpacity(e),this.controller1&&(this.controller1.userData.turning&&(n.quaternion.copy(this.controller1.quaternion).multiply(this.relativeOrientation),this.selectedController&&this.selectedController===this.controller2&&n.quaternion.premultiply(tl.copy(this.controller2.quaternion).invert())),this.controller1.userData.box.position.copy(this.controller1.position),n.getWorldQuaternion(this.controller1.userData.box.quaternion)),this.controller2&&(this.controller2.userData.turning&&(n.quaternion.copy(this.controller2.quaternion).multiply(this.relativeOrientation),this.selectedController&&this.selectedController===this.controller1&&n.quaternion.premultiply(tl.copy(this.controller1.quaternion).invert())),this.controller2.userData.box.position.copy(this.controller2.position),n.getWorldQuaternion(this.controller2.userData.box.quaternion)),this.controller1&&this.controller2&&this.isTwoFingering){let d=this.controllerSeparation();this.setScale(d),this.scaleLine.scale.z=-d,this.scaleLine.lookAt(this.controller2.position)}let r=t.pivot.scale.x;if(this.goalScale!==r){let d=this.scaleDamper.update(r,this.goalScale,e,1);t.pivot.scale.set(d,d,d)}if(n.parent!==t)return;let{position:o}=n,a=t.boundingSphere.radius,c=this.goalPosition,l=Gt.NONE;if(!c.equals(o)){l=Gt.USER_INTERACTION;let{x:d,y:f,z:p}=o;if(d=this.xDamper.update(d,c.x,e,a),f=this.yDamper.update(f,c.y,e,a),p=this.zDamper.update(p,c.z,e,a),o.set(d,f,p),this.xrMode==="screen-space"&&!this.isTranslating){let g=c.y-f;this.placementComplete&&this.placeOnWall===!1?(s.offsetHeight=g/t.pivot.scale.x,t.setShadowOffset(g)):g===0&&(this.placementComplete=!0,s.show=!1,t.setShadowIntensity(xC))}this.xrMode!=="screen-space"&&c.equals(o)&&t.setShadowIntensity(xC)}t.updateTarget(e),tl.setFromAxisAngle(su.set(0,1,0),this.goalYaw);let h=t.pivot.quaternion.angleTo(tl),u=h-this.yawDamper.update(h,0,e,Math.PI);t.pivot.quaternion.rotateTowards(tl,u),t.element.dispatchEvent(new CustomEvent("camera-change",{detail:{source:l}}))}onWebXRFrame(e,t){if(this.xrMode!=="screen-space"){let a=this.hover(this.controller1),c=this.hover(this.controller2);this.placementBox.show=(a||c)&&!this.isTwoFingering}this.frame=t,++this.frames;let n=this.threeRenderer.xr.getReferenceSpace(),s=t.getViewerPose(n);s==null&&this.tracking===!0&&this.frames>BU&&(this.tracking=!1,this.dispatchEvent({type:"tracking",status:Ip.NOT_TRACKING}));let r=this.presentedScene;if(s==null||r==null||!r.element.loaded){this.threeRenderer.clear();return}this.tracking===!1&&(this.tracking=!0,this.dispatchEvent({type:"tracking",status:Ip.TRACKING}));let o=!0;for(let a of s.views){if(this.updateView(a),o){this.moveToFloor(t),this.processInput(t);let c=e-this.lastTick;this.moveScene(c),this.renderer.preRender(r,e,c),this.lastTick=e,r.renderShadow(this.threeRenderer)}this.threeRenderer.render(r,r.getCamera()),o=!1}}}});function SC(i){let e=new Map,t=new Map,n=i.clone();return wC(i,n,function(s,r){e.set(r,s),t.set(s,r)}),n.traverse(function(s){if(!s.isSkinnedMesh)return;let r=s,o=e.get(s),a=o.skeleton.bones;r.skeleton=o.skeleton.clone(),r.bindMatrix.copy(o.bindMatrix),r.skeleton.bones=a.map(function(c){return t.get(c)}),r.bind(r.skeleton,r.bindMatrix)}),n}function wC(i,e,t){t(i,e);for(let n=0;n<i.children.length;n++)wC(i.children[n],e.children[n],t)}var CC=oe(()=>{});var MC,ru,as,ou,Bp,zU,TC,IC=oe(()=>{Xe();CC();MC=Symbol("prepared"),ru=Symbol("prepare"),as=Symbol("preparedGLTF"),ou=Symbol("clone"),Bp=class{static prepare(e){if(e.scene==null)throw new Error("Model does not have a scene");if(e[MC])return e;let t=this[ru](e);return t[MC]=!0,t}static[ru](e){let{scene:t}=e,n=[t];return Object.assign(Object.assign({},e),{scene:t,scenes:n})}get parser(){return this[as].parser}get animations(){return this[as].animations}get scene(){return this[as].scene}get scenes(){return this[as].scenes}get cameras(){return this[as].cameras}get asset(){return this[as].asset}get userData(){return this[as].userData}constructor(e){this[as]=e}clone(){let e=this.constructor,t=this[ou]();return new e(t)}dispose(){this.scenes.forEach(e=>{e.traverse(t=>{let n=t;if(!n.material)return;(Array.isArray(n.material)?n.material:[n.material]).forEach(r=>{for(let o in r){let a=r[o];if(a instanceof bt){let c=a.source.data;c.close!=null&&c.close(),a.dispose()}}r.dispose()}),n.geometry.dispose()})})}[ou](){let e=this[as],t=SC(this.scene);zU(t,this.scene);let n=[t],s=e.userData?Object.assign({},e.userData):{};return Object.assign(Object.assign({},e),{scene:t,scenes:n,userData:s})}},zU=(i,e)=>{TC(i,e,(t,n)=>{n.userData.variantMaterials!==void 0&&(t.userData.variantMaterials=new Map(n.userData.variantMaterials)),n.userData.variantData!==void 0&&(t.userData.variantData=n.userData.variantData),n.userData.originalMaterial!==void 0&&(t.userData.originalMaterial=n.userData.originalMaterial)})},TC=(i,e,t)=>{t(i,e);for(let n=0;n<i.children.length;n++)TC(i.children[n],e.children[n],t)}});var RC,BC,DC,LC,PC,FC,OC,au,NC=oe(()=>{Xe();RC=Symbol("threeGLTF"),BC=Symbol("gltf"),DC=Symbol("gltfElementMap"),LC=Symbol("threeObjectMap"),PC=Symbol("parallelTraverseThreeScene"),FC=Symbol("correlateOriginalThreeGLTF"),OC=Symbol("correlateCloneThreeGLTF"),au=class i{static from(e,t){return t!=null?this[OC](e,t):this[FC](e)}static[FC](e){let t=e.parser.json,n=e.parser.associations,s=new Map,r={name:"Default"},o={type:"materials",index:-1};for(let a of n.keys())a instanceof Ln&&n.get(a)==null&&(o.index<0&&(t.materials==null&&(t.materials=[]),o.index=t.materials.length,t.materials.push(r)),a.name=r.name,n.set(a,{materials:o.index}));for(let[a,c]of n){c&&(a.userData=a.userData||{},a.userData.associations=c);for(let l in c)if(l!=null&&l!=="primitives"){let h=l,d=(t[h]||[])[c[h]];if(d==null)continue;let f=s.get(d);f==null&&(f=new Set,s.set(d,f)),f.add(a)}}return new i(e,t,n,s)}static[OC](e,t){let n=t.threeGLTF,s=t.gltf,r=JSON.parse(JSON.stringify(s)),o=new Map,a=new Map;for(let c=0;c<n.scenes.length;c++)this[PC](n.scenes[c],e.scenes[c],(l,h)=>{let u=t.threeObjectMap.get(l);if(u!=null){for(let d in u)if(d!=null&&d!=="primitives"){let f=d,p=u[f],g=r[f][p],A=o.get(h)||{};A[f]=p,o.set(h,A);let m=a.get(g)||new Set;m.add(h),a.set(g,m)}}});return new i(e,r,o,a)}static[PC](e,t,n){let s=(r,o)=>{if(n(r,o),r.isObject3D){let a=r,c=o;if(a.material)if(Array.isArray(a.material))for(let l=0;l<a.material.length;++l)n(a.material[l],c.material[l]);else n(a.material,c.material);for(let l=0;l<r.children.length;++l)s(r.children[l],o.children[l])}};s(e,t)}get threeGLTF(){return this[RC]}get gltf(){return this[BC]}get gltfElementMap(){return this[DC]}get threeObjectMap(){return this[LC]}constructor(e,t,n,s){this[RC]=e,this[BC]=t,this[DC]=s,this[LC]=n}}});var cu,Dp,UC=oe(()=>{Xe();IC();NC();cu=Symbol("correlatedSceneGraph"),Dp=class extends Bp{static[ru](e){let t=super[ru](e);t[cu]==null&&(t[cu]=au.from(t));let{scene:n}=t,s=new vn(void 0,1/0);return n.traverse(r=>{r.renderOrder=1e3,r.frustumCulled=!1,r.name||(r.name=r.uuid);let o=r;if(o.material){let{geometry:a}=o;o.castShadow=!0,o.isSkinnedMesh&&(a.boundingSphere=s,a.boundingBox=null);let c=o.material;if(c.isMeshBasicMaterial===!0&&(c.toneMapped=!1),c.shadowSide=qn,c.aoMap){let{gltf:l,threeObjectMap:h}=t[cu],u=h.get(c);if(l.materials!=null&&u!=null&&u.materials!=null){let d=l.materials[u.materials];d.occlusionTexture&&d.occlusionTexture.texCoord===0&&a.attributes.uv!=null&&a.setAttribute("uv2",a.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[as][cu]}[ou](){let e=super[ou](),t=new Map;return e.scene.traverse(n=>{let s=n;if(s.material){let o=s.material;if(o!=null){if(t.has(o.uuid)){s.material=t.get(o.uuid);return}s.material=o.clone(),t.set(o.uuid,s.material)}}let r=n;r.target!==void 0&&r.add(r.target)}),e[cu]=au.from(e,this.correlatedSceneGraph),e}}});var kC,Lp,HU,lu,GC=oe(()=>{Xe();kC=(i,e,t)=>{let n;switch(i){case kt:n=new Uint8ClampedArray(e*t*4);break;case Lt:n=new Uint16Array(e*t*4);break;case Cs:n=new Uint32Array(e*t*4);break;case Mh:n=new Int8Array(e*t*4);break;case Th:n=new Int16Array(e*t*4);break;case vc:n=new Int32Array(e*t*4);break;case Ot:n=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return n},HU=(i,e,t,n)=>{if(Lp!==void 0)return Lp;let s=new _n(1,1,n);e.setRenderTarget(s);let r=new Ke(new ri,new Jt({color:16777215}));e.render(r,t),e.setRenderTarget(null);let o=kC(i,s.width,s.height);return e.readRenderTargetPixels(s,0,0,s.width,s.height,o),s.dispose(),r.geometry.dispose(),r.material.dispose(),Lp=o[0]!==0,Lp},lu=class i{constructor(e){Vt(this,"_renderer");Vt(this,"_rendererIsDisposable",!1);Vt(this,"_material");Vt(this,"_scene");Vt(this,"_camera");Vt(this,"_quad");Vt(this,"_renderTarget");Vt(this,"_width");Vt(this,"_height");Vt(this,"_type");Vt(this,"_colorSpace");Vt(this,"_supportsReadPixels",!0);Vt(this,"render",()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)});this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;let t={format:vt,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0?e.renderTargetOptions?.generateMipmaps:!1,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:qe,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:qe,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:Bt,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:Bt};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=i.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Pn,this._camera=new yi,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!HU(this._type,this._renderer,this._camera,t)){let n;switch(this._type){case Lt:n=this._renderer.extensions.has("EXT_color_buffer_float")?Ot:void 0;break}n!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Ot}`),this._type=n):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Ke(new ri,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new _n(this.width,this.height,t),this._renderTarget.texture.mapping=e.renderTargetOptions?.mapping!==void 0?e.renderTargetOptions?.mapping:cr}static instantiateRenderer(){let e=new Jr;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");let e=kC(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new bs(this.toArray(),this.width,this.height,vt,this._type,e?.mapping||cr,e?.wrapS||Bt,e?.wrapT||Bt,e?.magFilter||qe,e?.minFilter||qe,e?.anisotropy||1,st);return t.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof sn&&Object.values(this.material.uniforms).forEach(t=>{t.value instanceof bt&&t.value.dispose()}),Object.values(this.material).forEach(t=>{t instanceof bt&&t.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}});function zC(i){return e=>{let{sdr:t,gainMap:n,renderer:s}=e;t.colorSpace!==at&&(console.warn("SDR Colorspace needs to be *SRGBColorSpace*, setting it automatically"),t.colorSpace=at),t.needsUpdate=!0,n.colorSpace!==st&&(console.warn("Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically"),n.colorSpace=st),n.needsUpdate=!0;let r=i.createMaterial({...e,sdr:t,gainMap:n});return i.createQuadRenderer({width:t.image.width,height:t.image.height,type:Lt,colorSpace:st,material:r,renderer:s,renderTargetOptions:e.renderTargetOptions})}}var uu,du,hu,VU,py,HC,QC,Pp,VC=oe(()=>{Xe();uu=class extends Error{},du=class extends Error{},hu=(i,e,t)=>{let n=new RegExp(`${e}="([^"]*)"`,"i").exec(i);if(n)return n[1];let s=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(i);if(s){let r=s[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return r&&r.length===3?r.map(o=>o.replace(/<\/?rdf:li>/g,"")):s[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},VU=i=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(i):e=i.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){let n=e.indexOf("x:xmpmeta>",t),s=e.slice(t,n+10);try{let r=hu(s,"hdrgm:GainMapMin","0"),o=hu(s,"hdrgm:GainMapMax"),a=hu(s,"hdrgm:Gamma","1"),c=hu(s,"hdrgm:OffsetSDR","0.015625"),l=hu(s,"hdrgm:OffsetHDR","0.015625"),h=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(s),u=h?h[1]:"0",d=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(s);if(!d)throw new Error("Incomplete gainmap metadata");let f=d[1];return{gainMapMin:Array.isArray(r)?r.map(p=>parseFloat(p)):[parseFloat(r),parseFloat(r),parseFloat(r)],gainMapMax:Array.isArray(o)?o.map(p=>parseFloat(p)):[parseFloat(o),parseFloat(o),parseFloat(o)],gamma:Array.isArray(a)?a.map(p=>parseFloat(p)):[parseFloat(a),parseFloat(a),parseFloat(a)],offsetSdr:Array.isArray(c)?c.map(p=>parseFloat(p)):[parseFloat(c),parseFloat(c),parseFloat(c)],offsetHdr:Array.isArray(l)?l.map(p=>parseFloat(p)):[parseFloat(l),parseFloat(l),parseFloat(l)],hdrCapacityMin:parseFloat(u),hdrCapacityMax:parseFloat(f)}}catch{}t=e.indexOf("<x:xmpmeta",n)}},py=class{constructor(e){Vt(this,"options");this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,n)=>{let s=this.options.debug,r=new DataView(e.buffer);if(r.getUint16(0)!==65496){n(new Error("Not a valid jpeg"));return}let o=r.byteLength,a=2,c=0,l;for(;a<o;){if(++c>250){n(new Error(`Found no marker after ${c} loops \u{1F635}`));return}if(r.getUint8(a)!==255){n(new Error(`Not a valid marker at offset 0x${a.toString(16)}, found: 0x${r.getUint8(a).toString(16)}`));return}if(l=r.getUint8(a+1),s&&console.log(`Marker: ${l.toString(16)}`),l===226){s&&console.log("Found APP2 marker (0xffe2)");let h=a+4;if(r.getUint32(h)===1297106432){let u=h+4,d;if(r.getUint16(u)===18761)d=!1;else if(r.getUint16(u)===19789)d=!0;else{n(new Error("No valid endianness marker found in TIFF header"));return}if(r.getUint16(u+2,!d)!==42){n(new Error("Not valid TIFF data! (no 0x002A marker)"));return}let f=r.getUint32(u+4,!d);if(f<8){n(new Error("Not valid TIFF data! (First offset less than 8)"));return}let p=u+f,g=r.getUint16(p,!d),A=p+2,m=0;for(let _=A;_<A+12*g;_+=12)r.getUint16(_,!d)===45057&&(m=r.getUint32(_+8,!d));let x=p+2+g*12+4,y=[];for(let _=x;_<x+m*16;_+=16){let S={MPType:r.getUint32(_,!d),size:r.getUint32(_+4,!d),dataOffset:r.getUint32(_+8,!d),dependantImages:r.getUint32(_+12,!d),start:-1,end:-1,isFII:!1};S.dataOffset?(S.start=u+S.dataOffset,S.isFII=!1):(S.start=0,S.isFII=!0),S.end=S.start+S.size,y.push(S)}if(this.options.extractNonFII&&y.length){let _=new Blob([r]),S=[];for(let C of y){if(C.isFII&&!this.options.extractFII)continue;let w=_.slice(C.start,C.end+1,"image/jpeg");S.push(w)}t(S)}}}a+=2+r.getUint16(a+2)}})}},HC=async i=>{let e=VU(i);if(!e)throw new du("Gain map XMP metadata not found");let n=await new py({extractFII:!0,extractNonFII:!0}).extract(i);if(n.length!==2)throw new uu("Gain map recovery image not found");return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:e}},QC=i=>new Promise((e,t)=>{let n=document.createElement("img");n.onload=()=>{e(n)},n.onerror=s=>{t(s)},n.src=URL.createObjectURL(i)}),Pp=class extends ln{constructor(t,n){super(n);Vt(this,"_renderer");Vt(this,"_renderTargetOptions");Vt(this,"_internalLoadingManager");Vt(this,"_config");this._config=t,t.renderer&&(this._renderer=t.renderer),this._internalLoadingManager=new bc}setRenderer(t){return this._renderer=t,this}setRenderTargetOptions(t){return this._renderTargetOptions=t,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");let t=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new bt,sdr:new bt});return this._config.createQuadRenderer({width:16,height:16,type:Lt,colorSpace:st,material:t,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(t,n,s){let r=n?new Blob([n],{type:"image/jpeg"}):void 0,o=new Blob([t],{type:"image/jpeg"}),a,c,l=!1;if(typeof createImageBitmap>"u"){let h=await Promise.all([r?QC(r):Promise.resolve(void 0),QC(o)]);c=h[0],a=h[1],l=s==="flipY"}else{let h=await Promise.all([r?createImageBitmap(r,{imageOrientation:s||"flipY"}):Promise.resolve(void 0),createImageBitmap(o,{imageOrientation:s||"flipY"})]);c=h[0],a=h[1]}return{sdrImage:a,gainMapImage:c,needsFlip:l}}createTextures(t,n,s){let r=new bt(n||new ImageData(2,2),cr,Bt,Bt,qe,Af,vt,kt,1,st);r.flipY=s,r.needsUpdate=!0;let o=new bt(t,cr,Bt,Bt,qe,Af,vt,kt,1,at);return o.flipY=s,o.needsUpdate=!0,{gainMap:r,sdr:o}}updateQuadRenderer(t,n,s,r,o){t.width=n.width,t.height=n.height,t.material.gainMap=s,t.material.sdr=r,t.material.gainMapMin=o.gainMapMin,t.material.gainMapMax=o.gainMapMax,t.material.offsetHdr=o.offsetHdr,t.material.offsetSdr=o.offsetSdr,t.material.gamma=o.gamma,t.material.hdrCapacityMin=o.hdrCapacityMin,t.material.hdrCapacityMax=o.hdrCapacityMax,t.material.maxDisplayBoost=Math.pow(2,o.hdrCapacityMax),t.material.needsUpdate=!0}}});var WU,qU,Fp,_6,my,Op,WC=oe(()=>{GC();VC();Xe();WU=`
varying vec2 vUv;

void main() {
  vUv = uv;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,qU=`
// min half float value
#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
// max half float value
#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )

uniform sampler2D sdr;
uniform sampler2D gainMap;
uniform vec3 gamma;
uniform vec3 offsetHdr;
uniform vec3 offsetSdr;
uniform vec3 gainMapMin;
uniform vec3 gainMapMax;
uniform float weightFactor;

varying vec2 vUv;

void main() {
  vec3 rgb = texture2D( sdr, vUv ).rgb;
  vec3 recovery = texture2D( gainMap, vUv ).rgb;
  vec3 logRecovery = pow( recovery, gamma );
  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
  gl_FragColor = vec4( clampedHdrColor , 1.0 );
}
`,Fp=class extends sn{constructor({gamma:t,offsetHdr:n,offsetSdr:s,gainMapMin:r,gainMapMax:o,maxDisplayBoost:a,hdrCapacityMin:c,hdrCapacityMax:l,sdr:h,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:WU,fragmentShader:qU,uniforms:{sdr:{value:h},gainMap:{value:u},gamma:{value:new D(1/t[0],1/t[1],1/t[2])},offsetHdr:{value:new D().fromArray(n)},offsetSdr:{value:new D().fromArray(s)},gainMapMin:{value:new D().fromArray(r)},gainMapMax:{value:new D().fromArray(o)},weightFactor:{value:(Math.log2(a)-c)/(l-c)}},blending:bi,depthTest:!1,depthWrite:!1});Vt(this,"_maxDisplayBoost");Vt(this,"_hdrCapacityMin");Vt(this,"_hdrCapacityMax");this._maxDisplayBoost=a,this._hdrCapacityMin=c,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(t){this.uniforms.sdr.value=t}get gainMap(){return this.uniforms.gainMap.value}set gainMap(t){this.uniforms.gainMap.value=t}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(t){this.uniforms.offsetHdr.value.fromArray(t)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(t){this.uniforms.offsetSdr.value.fromArray(t)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(t){this.uniforms.gainMapMin.value.fromArray(t)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(t){this.uniforms.gainMapMax.value.fromArray(t)}get gamma(){let t=this.uniforms.gamma.value;return[1/t.x,1/t.y,1/t.z]}set gamma(t){let n=this.uniforms.gamma.value;n.x=1/t[0],n.y=1/t[1],n.z=1/t[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(t){this._hdrCapacityMin=t,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(t){this._hdrCapacityMax=t,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(t){this._maxDisplayBoost=Math.max(1,Math.min(65504,t)),this.calculateWeight()}calculateWeight(){let t=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,t))}},_6=zC({renderer:Jr,createMaterial:i=>new Fp(i),createQuadRenderer:i=>new lu(i)}),my=class extends Pp{constructor(e,t){super({renderer:e,createMaterial:n=>new Fp(n),createQuadRenderer:n=>new lu(n)},t)}async render(e,t,n,s){let{sdrImage:r,gainMapImage:o,needsFlip:a}=await this.processImages(n,s,"flipY"),{gainMap:c,sdr:l}=this.createTextures(r,o,a);this.updateQuadRenderer(e,r,c,l,t),e.render()}},Op=class extends my{load(e,t,n,s){let r=this.prepareQuadRenderer(),o=new En(this._internalLoadingManager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(this.withCredentials),this.manager.itemStart(e),o.load(e,async a=>{if(typeof a=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let c=new Uint8Array(a),l,h,u;try{let d=await HC(c);l=d.sdr,h=d.gainMap,u=d.metadata}catch(d){if(d instanceof du||d instanceof uu)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),u={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},l=c;else throw d}try{await this.render(r,u,l.buffer,h?.buffer)}catch(d){this.manager.itemError(e),typeof s=="function"&&s(d),r.disposeOnDemandRenderer();return}typeof t=="function"&&t(r),this.manager.itemEnd(e),r.disposeOnDemandRenderer()},n,a=>{this.manager.itemError(e),typeof s=="function"&&s(a)}),r}}});var Np,qC=oe(()=>{Xe();Np=class extends bh{constructor(e){super(e),this.type=Lt}parse(e){let o=function(w,v){switch(w){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(v||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(v||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(v||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(v||""))}},u=function(w,v,E){v=v||1024;let F=w.pos,P=-1,U=0,V="",O=String.fromCharCode.apply(null,new Uint16Array(w.subarray(F,F+128)));for(;0>(P=O.indexOf(`
`))&&U<v&&F<w.byteLength;)V+=O,U+=O.length,F+=128,O+=String.fromCharCode.apply(null,new Uint16Array(w.subarray(F,F+128)));return-1<P?(E!==!1&&(w.pos+=U+P+1),V+O.slice(0,P)):!1},d=function(w){let v=/^#\?(\S+)/,E=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,F=/^\s*FORMAT=(\S+)\s*$/,P=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,U={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0},V,O;for((w.pos>=w.byteLength||!(V=u(w)))&&o(1,"no header found"),(O=V.match(v))||o(3,"bad initial token"),U.valid|=1,U.programtype=O[1],U.string+=V+`
`;V=u(w),V!==!1;){if(U.string+=V+`
`,V.charAt(0)==="#"){U.comments+=V+`
`;continue}if((O=V.match(E))&&(U.gamma=parseFloat(O[1])),(O=V.match(R))&&(U.exposure=parseFloat(O[1])),(O=V.match(F))&&(U.valid|=2,U.format=O[1]),(O=V.match(P))&&(U.valid|=4,U.height=parseInt(O[1],10),U.width=parseInt(O[2],10)),U.valid&2&&U.valid&4)break}return U.valid&2||o(3,"missing format specifier"),U.valid&4||o(3,"missing image size specifier"),U},f=function(w,v,E){let R=v;if(R<8||R>32767||w[0]!==2||w[1]!==2||w[2]&128)return new Uint8Array(w);R!==(w[2]<<8|w[3])&&o(3,"wrong scanline width");let F=new Uint8Array(4*v*E);F.length||o(4,"unable to allocate buffer space");let P=0,U=0,V=4*R,O=new Uint8Array(4),K=new Uint8Array(V),z=E;for(;z>0&&U<w.byteLength;){U+4>w.byteLength&&o(1),O[0]=w[U++],O[1]=w[U++],O[2]=w[U++],O[3]=w[U++],(O[0]!=2||O[1]!=2||(O[2]<<8|O[3])!=R)&&o(3,"bad rgbe scanline format");let ee=0,ae;for(;ee<V&&U<w.byteLength;){ae=w[U++];let ve=ae>128;if(ve&&(ae-=128),(ae===0||ee+ae>V)&&o(3,"bad scanline data"),ve){let Le=w[U++];for(let X=0;X<ae;X++)K[ee++]=Le}else K.set(w.subarray(U,U+ae),ee),ee+=ae,U+=ae}let he=R;for(let ve=0;ve<he;ve++){let Le=0;F[P]=K[ve+Le],Le+=R,F[P+1]=K[ve+Le],Le+=R,F[P+2]=K[ve+Le],Le+=R,F[P+3]=K[ve+Le],P+=4}z--}return F},p=function(w,v,E,R){let F=w[v+3],P=Math.pow(2,F-128)/255;E[R+0]=w[v+0]*P,E[R+1]=w[v+1]*P,E[R+2]=w[v+2]*P,E[R+3]=1},g=function(w,v,E,R){let F=w[v+3],P=Math.pow(2,F-128)/255;E[R+0]=Rc.toHalfFloat(Math.min(w[v+0]*P,65504)),E[R+1]=Rc.toHalfFloat(Math.min(w[v+1]*P,65504)),E[R+2]=Rc.toHalfFloat(Math.min(w[v+2]*P,65504)),E[R+3]=Rc.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;let m=d(A),b=m.width,x=m.height,y=f(A.subarray(A.pos),b,x),_,S,C;switch(this.type){case Ot:C=y.length/4;let w=new Float32Array(C*4);for(let E=0;E<C;E++)p(y,E*4,w,E*4);_=w,S=Ot;break;case Lt:C=y.length/4;let v=new Uint16Array(C*4);for(let E=0;E<C;E++)g(y,E*4,v,E*4);_=v,S=Lt;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:b,height:x,data:_,header:m.string,gamma:m.gamma,exposure:m.exposure,type:S}}setDataType(e){return this.type=e,this}load(e,t,n,s){function r(o,a){switch(o.type){case Ot:case Lt:o.colorSpace=st,o.minFilter=qe,o.magFilter=qe,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,a)}return super.load(e,r,n,s)}}});var KU,$U,nl,KC=oe(()=>{Xe();KU={topLight:{intensity:500,position:[.418,16.199,.3]},room:{position:[-.757,13.219,.717],scale:[31.713,28.305,28.591]},boxes:[{position:[-10.906,2.009,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,.857,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:50,position:[-16.116,14.37,8.208],scale:[.1,2.428,2.739]},{intensity:50,position:[-16.109,18.021,-8.207],scale:[.1,2.425,2.751]},{intensity:17,position:[14.904,12.198,-1.832],scale:[.15,4.265,6.331]},{intensity:43,position:[-.462,8.89,14.52],scale:[4.38,5.441,.088]},{intensity:20,position:[3.235,11.486,-12.541],scale:[2.5,2,.1]},{intensity:100,position:[0,20,0],scale:[1,.1,1]}]},$U={topLight:{intensity:400,position:[.5,14,.5]},room:{position:[0,13.2,0],scale:[31.5,28.5,31.5]},boxes:[{position:[-10.906,-1,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,-.16,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:80,position:[-14,10,8],scale:[.1,2.5,2.5]},{intensity:80,position:[-14,14,-4],scale:[.1,2.5,2.5]},{intensity:23,position:[14,12,0],scale:[.1,5,5]},{intensity:16,position:[0,9,14],scale:[5,5,.1]},{intensity:80,position:[7,8,-14],scale:[2.5,2.5,.1]},{intensity:80,position:[-7,16,-14],scale:[2.5,2.5,.1]},{intensity:1,position:[0,20,0],scale:[.1,.1,.1]}]},nl=class extends Pn{constructor(e){super(),this.position.y=-3.5;let t=new ii;t.deleteAttribute("uv");let n=new _s({metalness:0,side:en}),s=new _s({metalness:0}),r=e=="legacy"?KU:$U,o=new Vo(16777215,r.topLight.intensity,28,2);o.position.set(...r.topLight.position),this.add(o);let a=new Ke(t,n);a.position.set(...r.room.position),a.scale.set(...r.room.scale),this.add(a);for(let c of r.boxes){let l=new Ke(t,s);l.position.set(...c.position),l.rotation.set(0,c.rotation,0),l.scale.set(...c.scale),this.add(l)}for(let c of r.lights){let l=new Ke(t,this.createAreaLightMaterial(c.intensity));l.position.set(...c.position),l.scale.set(...c.scale),this.add(l)}}createAreaLightMaterial(e){let t=new Jt;return t.color.setScalar(e),t}}});var XU,il,YU,sl,$C=oe(()=>{WC();Xe();qC();ns();KC();XU=.04,il=20,YU=/\.hdr(\.js)?$/,sl=class{constructor(e){this.threeRenderer=e,this.lottieLoaderUrl="",this._ldrLoader=null,this._imageLoader=null,this._hdrLoader=null,this._lottieLoader=null,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}ldrLoader(e){return this._ldrLoader==null&&(this._ldrLoader=new zo),this._ldrLoader.setWithCredentials(e),this._ldrLoader}imageLoader(e){return this._imageLoader==null&&(this._imageLoader=new Op(this.threeRenderer)),this._imageLoader.setWithCredentials(e),this._imageLoader}hdrLoader(e){return this._hdrLoader==null&&(this._hdrLoader=new Np,this._hdrLoader.setDataType(Lt)),this._hdrLoader.setWithCredentials(e),this._hdrLoader}async getLottieLoader(e){if(this._lottieLoader==null){let{LottieLoader:t}=await import(this.lottieLoaderUrl);this._lottieLoader=new t}return this._lottieLoader.setWithCredentials(e),this._lottieLoader}async loadImage(e,t){let n=await new Promise((s,r)=>this.ldrLoader(t).load(e,s,()=>{},r));return n.name=e,n.flipY=!1,n}async loadLottie(e,t,n){let s=await this.getLottieLoader(n);s.setQuality(t);let r=await new Promise((o,a)=>s.load(e,o,()=>{},a));return r.name=e,r}async loadEquirect(e,t=!1,n=()=>{}){try{let s=YU.test(e),r=s?this.hdrLoader(t):this.imageLoader(t),o=await new Promise((a,c)=>r.load(e,l=>{let{renderTarget:h}=l;if(h!=null){let{texture:u}=h;l.dispose(!1),a(u)}else a(l)},l=>{n(l.loaded/l.total*.9)},c));return n(1),o.name=e,o.mapping=xc,s||(o.colorSpace=at),o}finally{n&&n(1)}}async generateEnvironmentMapAndSkybox(e=null,t=null,n=()=>{},s=!1){let r=t!=="legacy";(t==="legacy"||t==="neutral")&&(t=null),t=Zf(t);let o=Promise.resolve(null),a;e&&(o=this.loadEquirectFromUrl(e,s,n)),t?a=this.loadEquirectFromUrl(t,s,n):e?a=this.loadEquirectFromUrl(e,s,n):a=r?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();let[c,l]=await Promise.all([a,o]);if(c==null)throw new Error("Failed to load environment map.");return{environmentMap:c,skybox:l}}async loadEquirectFromUrl(e,t,n){if(!this.skyboxCache.has(e)){let s=this.loadEquirect(e,t,n);this.skyboxCache.set(e,s)}return this.skyboxCache.get(e)}async GenerateEnvironmentMap(e,t){await lS();let n=this.threeRenderer,s=new $r(256,{generateMipmaps:!1,type:Lt,format:vt,colorSpace:st,depthBuffer:!0}),r=new ko(.1,100,s),o=r.renderTarget.texture;o.name=t;let a=n.outputColorSpace,c=n.toneMapping;return n.toneMapping=xi,n.outputColorSpace=st,r.update(n,e),this.blurCubemap(s,XU),n.toneMapping=c,n.outputColorSpace=a,o}async loadGeneratedEnvironmentMap(){return this.generatedEnvironmentMap==null&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new nl("legacy"),"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return this.generatedEnvironmentMapAlt==null&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new nl("neutral"),"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(e,t){if(this.blurMaterial==null){this.blurMaterial=this.getBlurShader(il);let s=new ii,r=new Ke(s,this.blurMaterial);this.blurScene=new Pn,this.blurScene.add(r)}let n=e.clone();this.halfblur(e,n,t,"latitudinal"),this.halfblur(n,e,t,"longitudinal")}halfblur(e,t,n,s){let o=e.width,a=isFinite(n)?Math.PI/(2*o):2*Math.PI/(2*il-1),c=n/a,l=isFinite(n)?1+Math.floor(3*c):il;l>il&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${l} samples when the maximum is set to ${il}`);let h=[],u=0;for(let p=0;p<il;++p){let g=p/c,A=Math.exp(-g*g/2);h.push(A),p==0?u+=A:p<l&&(u+=2*A)}for(let p=0;p<h.length;p++)h[p]=h[p]/u;let d=this.blurMaterial.uniforms;d.envMap.value=e.texture,d.samples.value=l,d.weights.value=h,d.latitudinal.value=s==="latitudinal",d.dTheta.value=a,new ko(.1,100,t).update(this.threeRenderer,this.blurScene)}getBlurShader(e){let t=new Float32Array(e),n=new D(0,1,0);return new sn({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:n}},vertexShader:`
      
      varying vec3 vOutputDirection;
  
      void main() {
  
        vOutputDirection = vec3( position );
        gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  
      }
    `,fragmentShader:`
        varying vec3 vOutputDirection;
  
        uniform samplerCube envMap;
        uniform int samples;
        uniform float weights[ n ];
        uniform bool latitudinal;
        uniform float dTheta;
        uniform vec3 poleAxis;
  
        vec3 getSample( float theta, vec3 axis ) {
  
          float cosTheta = cos( theta );
          // Rodrigues' axis-angle rotation
          vec3 sampleDirection = vOutputDirection * cosTheta
            + cross( axis, vOutputDirection ) * sin( theta )
            + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
  
          return vec3( textureCube( envMap, sampleDirection ) );
  
        }
  
        void main() {
  
          vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
  
          if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
  
            axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
  
          }
  
          axis = normalize( axis );
  
          gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
          gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
  
          for ( int i = 1; i < n; i++ ) {
  
            if ( i >= samples ) {
  
              break;
  
            }
  
            float theta = dTheta * float( i );
            gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
            gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
  
          }
        }
      `,blending:bi,depthTest:!1,depthWrite:!1,side:en})}async dispose(){for(let[,e]of this.skyboxCache)(await e).dispose();this.generatedEnvironmentMap!=null&&((await this.generatedEnvironmentMap).dispose(),this.generatedEnvironmentMap=null),this.generatedEnvironmentMapAlt!=null&&((await this.generatedEnvironmentMapAlt).dispose(),this.generatedEnvironmentMapAlt=null),this.blurMaterial!=null&&this.blurMaterial.dispose()}}});var jU,Ay,gy,XC,rl,JU,YC,ZU,Ei,Up=oe(()=>{Xe();Qh();ai();ns();fy();cp();UC();$C();jU=.2,Ay=40,gy=60,XC=5,rl=[1,.79,.62,.5,.4,.31,.25],JU=3,YC="high-performance",ZU=1.3,Ei=class i extends xn{static get singleton(){return this._singleton||(this._singleton=new i({powerPreference:(self.ModelViewerElement||{}).powerPreference||YC,debug:Fg()})),this._singleton}static resetSingleton(){let e=this._singleton.dispose();for(let t of e)t.disconnectedCallback();this._singleton=new i({powerPreference:(self.ModelViewerElement||{}).powerPreference||YC,debug:Fg()});for(let t of e)t.connectedCallback()}get canRender(){return this.threeRenderer!=null}get scaleFactor(){return rl[this.scaleStep]}set minScale(e){let t=1;for(;t<rl.length&&!(rl[t]<e);)++t;this.lastStep=t-1}constructor(e){super(),this.loader=new on(Dp),this.width=0,this.height=0,this.dpr=1,this.scenes=new Set,this.multipleScenesVisible=!1,this.lastTick=performance.now(),this.renderedLastFrame=!1,this.scaleStep=0,this.lastStep=JU,this.avgFrameDuration=(gy+Ay)/2,this.onWebGLContextLost=t=>{this.dispatchEvent({type:"contextlost",sourceEvent:t})},this.onWebGLContextRestored=()=>{var t;(t=this.textureUtils)===null||t===void 0||t.dispose(),this.textureUtils=new sl(this.threeRenderer);for(let n of this.scenes)n.element[Qc]()},this.dpr=window.devicePixelRatio,this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new Jr({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:e.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.setPixelRatio(1),this.threeRenderer.debug={checkShaderErrors:!!e.debug,onShaderError:null},this.threeRenderer.toneMapping=ar}catch(t){console.warn(t)}this.arRenderer=new Rp(this),this.textureUtils=this.canRender?new sl(this.threeRenderer):null,on.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}registerScene(e){this.scenes.add(e),e.forceRescale();let t=new Fe;this.threeRenderer.getSize(t),e.canvas.width=t.x,e.canvas.height=t.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop((n,s)=>this.render(n,s))}unregisterScene(e){this.scenes.delete(e),this.canvas3D.parentElement===e.canvas.parentElement&&e.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&this.scenes.size===0&&this.threeRenderer.setAnimationLoop(null)}displayCanvas(e){return e.element.modelIsVisible&&!this.multipleScenesVisible?this.canvas3D:e.element[kp]}countVisibleScenes(){let{canvas3D:e}=this,t=0,n=null;for(let r of this.scenes){let{element:o}=r;o.modelIsVisible&&r.externalRenderer==null&&++t,e.parentElement===r.canvas.parentElement&&(n=r)}let s=t>1;if(n!=null){let r=s&&!this.multipleScenesVisible,o=!n.element.modelIsVisible;if(r||o){let{width:a,height:c}=this.sceneSize(n);this.copyPixels(n,a,c),e.parentElement.removeChild(e)}}this.multipleScenesVisible=s}updateRendererSize(){var e;let t=window.devicePixelRatio;if(t!==this.dpr)for(let r of this.scenes){let{element:o}=r;o[ya](o.getBoundingClientRect())}let n=0,s=0;for(let r of this.scenes)n=Math.max(n,r.width),s=Math.max(s,r.height);if(!(n===this.width&&s===this.height&&t===this.dpr)){this.width=n,this.height=s,this.dpr=t,n=Math.ceil(n*t),s=Math.ceil(s*t),this.canRender&&this.threeRenderer.setSize(n,s,!1);for(let r of this.scenes){let{canvas:o}=r;o.width=n,o.height=s,r.forceRescale(),(e=r.effectRenderer)===null||e===void 0||e.setSize(n,s)}}}updateRendererScale(e){let t=this.scaleStep;this.avgFrameDuration+=Nn(jU*(e-this.avgFrameDuration),-XC,XC),this.avgFrameDuration>gy?++this.scaleStep:this.avgFrameDuration<Ay&&this.scaleStep>0&&--this.scaleStep,this.scaleStep=Math.min(this.scaleStep,this.lastStep),t!==this.scaleStep&&(this.avgFrameDuration=(gy+Ay)/2)}shouldRender(e){if(e.shouldRender())e.scaleStep!=this.scaleStep&&(e.scaleStep=this.scaleStep,this.rescaleCanvas(e));else if(e.scaleStep!=0)e.scaleStep=0,this.rescaleCanvas(e);else return!1;return!0}rescaleCanvas(e){let t=rl[e.scaleStep],n=Math.ceil(this.width/t),s=Math.ceil(this.height/t),{style:r}=e.canvas;r.width=`${n}px`,r.height=`${s}px`,this.canvas3D.style.width=`${n}px`,this.canvas3D.style.height=`${s}px`;let o=this.dpr*t,a=t<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";e.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:o,minimumDpr:this.dpr*rl[this.lastStep],pixelWidth:Math.ceil(e.width*o),pixelHeight:Math.ceil(e.height*o),reason:a}}))}sceneSize(e){let{dpr:t}=this,n=rl[e.scaleStep],s=Math.min(Math.ceil(e.width*n*t),this.canvas3D.width),r=Math.min(Math.ceil(e.height*n*t),this.canvas3D.height);return{width:s,height:r}}copyPixels(e,t,n){let s=e.context;if(s==null){console.log("could not acquire 2d context");return}s.clearRect(0,0,t,n),s.drawImage(this.canvas3D,0,0,t,n,0,0,t,n),e.canvas.classList.add("show")}orderedScenes(){let e=[];for(let t of[!1,!0])for(let n of this.scenes)n.element.modelIsVisible===t&&e.push(n);return e}get isPresenting(){return this.arRenderer.isPresenting}preRender(e,t,n){let{element:s,exposure:r,toneMapping:o}=e;s[Xn](t,n);let a=typeof r=="number"&&!Number.isNaN(r),c=s.environmentImage,l=s.skyboxImage,h=o===ar&&(c==="neutral"||c==="legacy"||!c&&!l);this.threeRenderer.toneMappingExposure=(a?r:1)*(h?ZU:1)}render(e,t){if(t!=null){this.arRenderer.onWebXRFrame(e,t);return}let n=e-this.lastTick;if(this.lastTick=e,!this.canRender||this.isPresenting)return;this.countVisibleScenes(),this.updateRendererSize(),this.renderedLastFrame&&(this.updateRendererScale(n),this.renderedLastFrame=!1);let{canvas3D:s}=this;for(let r of this.orderedScenes()){let{element:o}=r;if(!o.loaded||!o.modelIsVisible&&r.renderCount>0||(this.preRender(r,e,n),!this.shouldRender(r)))continue;if(r.externalRenderer!=null){let l=r.getCamera();l.updateMatrix();let{matrix:h,projectionMatrix:u}=l,d=h.elements.slice(),f=r.getTarget();d[12]+=f.x,d[13]+=f.y,d[14]+=f.z,r.externalRenderer.render({viewMatrix:d,projectionMatrix:u.elements});continue}if(!o.modelIsVisible&&!this.multipleScenesVisible)for(let l of this.scenes)l.element.modelIsVisible&&l.queueRender();let{width:a,height:c}=this.sceneSize(r);r.renderShadow(this.threeRenderer),this.threeRenderer.setRenderTarget(null),this.threeRenderer.setViewport(0,Math.ceil(this.height*this.dpr)-c,a,c),r.effectRenderer!=null?r.effectRenderer.render(n):(this.threeRenderer.autoClear=!0,this.threeRenderer.toneMapping=r.toneMapping,this.threeRenderer.render(r,r.camera)),this.multipleScenesVisible||!r.element.modelIsVisible&&r.renderCount===0?this.copyPixels(r,a,c):s.parentElement!==r.canvas.parentElement&&(r.canvas.parentElement.appendChild(s),r.canvas.classList.remove("show")),r.hasRendered(),++r.renderCount,this.renderedLastFrame=!0}}dispose(){this.textureUtils!=null&&this.textureUtils.dispose(),this.threeRenderer!=null&&this.threeRenderer.dispose(),this.textureUtils=null,this.threeRenderer=null;let e=[];for(let t of this.scenes)e.push(t.element);return this.canvas3D.removeEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.removeEventListener("webglcontextrestored",this.onWebGLContextRestored),e}}});var ze,mt,Ui,io=oe(()=>{ze=Symbol("correlatedObjects"),mt=Symbol("onUpdate"),Ui=class{constructor(e,t){this[mt]=e,this[ze]=t}}});var jC,ek,tk,Un,JC,$6,Gp,yy=oe(()=>{Xe();ai();Up();io();jC=new Jt,ek=new ri(2,2),tk=0,Un=Symbol("threeTexture"),JC=Symbol("threeTextures"),$6=Symbol("applyTexture"),Gp=class extends Ui{get[Un](){var e;return(e=this[ze])===null||e===void 0?void 0:e.values().next().value}get[JC](){return this[ze]}constructor(e,t){super(e,new Set(t?[t]:[])),this[Un].image.src||(this[Un].image.src=t.name?t.name:"adhoc_image"+tk++),this[Un].image.name||(this[Un].image.name=t&&t.image&&t.image.src?t.image.src.split("/").pop():"adhoc_image")}get name(){return this[Un].image.name||""}get uri(){return this[Un].image.src}get bufferView(){return this[Un].image.bufferView}get element(){let e=this[Un];if(e&&(e.isCanvasTexture||e.isVideoTexture))return e.image}get animation(){let e=this[Un];if(e&&e.isCanvasTexture&&e.animation)return e.animation}get type(){return this.uri!=null?"external":"embedded"}set name(e){for(let t of this[JC])t.image.name=e}update(){let e=this[Un];e&&e.isCanvasTexture&&!e.animation&&(this[Un].needsUpdate=!0,this[mt]())}async createThumbnail(e,t){let n=new Pn;jC.map=this[Un];let s=new Ke(ek,jC);n.add(s);let r=new yi(-1,1,1,-1,0,1),{threeRenderer:o}=Ei.singleton,a=new _n(e,t);o.setRenderTarget(a),o.render(n,r),o.setRenderTarget(null);let c=new Uint8Array(e*t*4);o.readRenderTargetPixels(a,0,0,e,t,c),_r.width=e,_r.height=t;let l=_r.getContext("2d"),h=l.createImageData(e,t);return h.data.set(c),l.putImageData(h,0,0),new Promise(async(u,d)=>{_r.toBlob(f=>{if(!f)return d("Failed to capture thumbnail.");u(URL.createObjectURL(f))},"image/png")})}}});var fn,vr,ZC=oe(()=>{(function(i){i[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.NearestMipmapNearest=9984]="NearestMipmapNearest",i[i.LinearMipmapNearest=9985]="LinearMipmapNearest",i[i.NearestMipmapLinear=9986]="NearestMipmapLinear",i[i.LinearMipmapLinear=9987]="LinearMipmapLinear"})(fn||(fn={}));(function(i){i[i.ClampToEdge=33071]="ClampToEdge",i[i.MirroredRepeat=33648]="MirroredRepeat",i[i.Repeat=10497]="Repeat"})(vr||(vr={}))});var eM,by,nk,nM,ik,iM,sk,rk,ok,ak,Er,tM,so,Qp,sM=oe(()=>{Xe();ai();ZC();io();eM=new Map([[vr.Repeat,Dn],[vr.ClampToEdge,Bt],[vr.MirroredRepeat,es]]),by=new Map([[Dn,vr.Repeat],[Bt,vr.ClampToEdge],[es,vr.MirroredRepeat]]),nk=new Map([[fn.Nearest,Ft],[fn.Linear,qe],[fn.NearestMipmapNearest,lr],[fn.LinearMipmapNearest,ts],[fn.NearestMipmapLinear,Oi],[fn.LinearMipmapLinear,rn]]),nM=new Map([[Ft,fn.Nearest],[qe,fn.Linear],[lr,fn.NearestMipmapNearest],[ts,fn.LinearMipmapNearest],[Oi,fn.NearestMipmapLinear],[rn,fn.LinearMipmapLinear]]),ik=new Map([[fn.Nearest,Ft],[fn.Linear,qe]]),iM=new Map([[Ft,fn.Nearest],[qe,fn.Linear]]),sk=i=>nM.has(i),rk=i=>iM.has(i),ok=i=>by.has(i),ak=(i,e)=>{switch(i){case"minFilter":return sk(e);case"magFilter":return rk(e);case"wrapS":case"wrapT":return ok(e);case"rotation":case"repeat":case"offset":return!0;default:throw new Error(`Cannot configure property "${i}" on Sampler`)}},Er=Symbol("threeTexture"),tM=Symbol("threeTextures"),so=Symbol("setProperty"),Qp=class extends Ui{get[Er](){var e;return(e=this[ze])===null||e===void 0?void 0:e.values().next().value}get[tM](){return this[ze]}constructor(e,t){super(e,new Set(t?[t]:[]))}get name(){return this[Er].name||""}get minFilter(){return nM.get(this[Er].minFilter)}get magFilter(){return iM.get(this[Er].magFilter)}get wrapS(){return by.get(this[Er].wrapS)}get wrapT(){return by.get(this[Er].wrapT)}get rotation(){return this[Er].rotation}get scale(){return fu(this[Er].repeat)}get offset(){return fu(this[Er].offset)}setMinFilter(e){this[so]("minFilter",nk.get(e))}setMagFilter(e){this[so]("magFilter",ik.get(e))}setWrapS(e){this[so]("wrapS",eM.get(e))}setWrapT(e){this[so]("wrapT",eM.get(e))}setRotation(e){e==null&&(e=0),this[so]("rotation",e)}setScale(e){e==null&&(e={u:1,v:1}),this[so]("repeat",new Fe(e.u,e.v))}setOffset(e){e==null&&(e={u:0,v:0}),this[so]("offset",new Fe(e.u,e.v))}[so](e,t){if(ak(e,t))for(let n of this[tM])n[e]=t,n.needsUpdate=!0;this[mt]()}}});var rM,oM,aM,ol,xy=oe(()=>{yy();sM();io();rM=Symbol("image"),oM=Symbol("sampler"),aM=Symbol("threeTexture"),ol=class extends Ui{get[aM](){var e;return(e=this[ze])===null||e===void 0?void 0:e.values().next().value}constructor(e,t){super(e,new Set(t?[t]:[])),this[oM]=new Qp(e,t),this[rM]=new Gp(e,t)}get name(){return this[aM].name||""}set name(e){for(let t of this[ze])t.name=e}get sampler(){return this[oM]}get source(){return this[rM]}}});var lM,hM,uM,ba,xa,_y,cM,al,pu,ke,Ls,vy=oe(()=>{Xe();yy();xy();ba=Symbol("texture"),xa=Symbol("transform"),_y=Symbol("materials"),cM=Symbol("usage"),al=Symbol("onUpdate"),pu=Symbol("activeVideo");(function(i){i[i.Base=0]="Base",i[i.MetallicRoughness=1]="MetallicRoughness",i[i.Normal=2]="Normal",i[i.Occlusion=3]="Occlusion",i[i.Emissive=4]="Emissive",i[i.Clearcoat=5]="Clearcoat",i[i.ClearcoatRoughness=6]="ClearcoatRoughness",i[i.ClearcoatNormal=7]="ClearcoatNormal",i[i.SheenColor=8]="SheenColor",i[i.SheenRoughness=9]="SheenRoughness",i[i.Transmission=10]="Transmission",i[i.Thickness=11]="Thickness",i[i.Specular=12]="Specular",i[i.SpecularColor=13]="SpecularColor",i[i.Iridescence=14]="Iridescence",i[i.IridescenceThickness=15]="IridescenceThickness",i[i.Anisotropy=16]="Anisotropy"})(ke||(ke={}));Ls=class{constructor(e,t,n,s){this[lM]=null,this[hM]={rotation:0,scale:new Fe(1,1),offset:new Fe(0,0)},this[uM]=!1,n&&(this[xa].rotation=n.rotation,this[xa].scale.copy(n.repeat),this[xa].offset.copy(n.offset),this[ba]=new ol(e,n)),this[al]=e,this[_y]=s,this[cM]=t}get texture(){return this[ba]}setTexture(e){var t,n;let s=e!=null?e.source[Un]:null,r=(t=this[ba])===null||t===void 0?void 0:t.source[Un];if(r!=null&&r.isVideoTexture?this[pu]=!1:!((n=this[ba])===null||n===void 0)&&n.source.animation&&this[ba].source.animation.removeEventListener("enterFrame",this[al]),this[ba]=e,s!=null&&s.isVideoTexture){let a=s.image;if(this[pu]=!0,a.requestVideoFrameCallback!=null){let c=()=>{this[pu]&&(this[al](),a.requestVideoFrameCallback(c))};a.requestVideoFrameCallback(c)}else{let c=()=>{this[pu]&&(this[al](),requestAnimationFrame(c))};requestAnimationFrame(c)}}else e?.source.animation!=null&&e.source.animation.addEventListener("enterFrame",this[al]);let o=at;if(this[_y])for(let a of this[_y]){switch(this[cM]){case ke.Base:a.map=s;break;case ke.MetallicRoughness:o=st,a.metalnessMap=s,a.roughnessMap=s;break;case ke.Normal:o=st,a.normalMap=s;break;case ke.Occlusion:o=st,a.aoMap=s;break;case ke.Emissive:a.emissiveMap=s;break;case ke.Clearcoat:a.clearcoatMap=s;break;case ke.ClearcoatRoughness:a.clearcoatRoughnessMap=s;break;case ke.ClearcoatNormal:a.clearcoatNormalMap=s;break;case ke.SheenColor:a.sheenColorMap=s;break;case ke.SheenRoughness:a.sheenRoughnessMap=s;break;case ke.Transmission:a.transmissionMap=s;break;case ke.Thickness:a.thicknessMap=s;break;case ke.Specular:a.specularIntensityMap=s;break;case ke.SpecularColor:a.specularColorMap=s;break;case ke.Iridescence:a.iridescenceMap=s;break;case ke.IridescenceThickness:a.iridescenceThicknessMap=s;break;case ke.Anisotropy:a.anisotropyMap=s;break;default:}a.needsUpdate=!0}s&&(s.colorSpace=o,s.rotation=this[xa].rotation,s.repeat=this[xa].scale,s.offset=this[xa].offset),this[al]()}};lM=ba,hM=xa,uM=pu});var mu,zp,dM,fM,Hp,pM=oe(()=>{Xe();vy();io();mu=Symbol("threeMaterial"),zp=Symbol("threeMaterials"),dM=Symbol("baseColorTexture"),fM=Symbol("metallicRoughnessTexture"),Hp=class extends Ui{get[zp](){return this[ze]}get[mu](){var e;return(e=this[ze])===null||e===void 0?void 0:e.values().next().value}constructor(e,t){super(e,t);let{map:n,metalnessMap:s}=t.values().next().value;this[dM]=new Ls(e,ke.Base,n,t),this[fM]=new Ls(e,ke.MetallicRoughness,s,t)}get baseColorFactor(){let e=[0,0,0,this[mu].opacity];return this[mu].color.toArray(e),e}get metallicFactor(){return this[mu].metalness}get roughnessFactor(){return this[mu].roughness}get baseColorTexture(){return this[dM]}get metallicRoughnessTexture(){return this[fM]}setBaseColorFactor(e){let t=new Ce;e instanceof Array?t.fromArray(e):t.set(e);for(let n of this[zp])n.color.set(t),e instanceof Array&&e.length>3?n.opacity=e[3]:(e=[0,0,0,n.opacity],t.toArray(e));this[mt]()}setMetallicFactor(e){for(let t of this[zp])t.metalness=e;this[mt]()}setRoughnessFactor(e){for(let t of this[zp])t.roughness=e;this[mt]()}}});var mM,AM,gM,yM,bM,xM,Qt,_M,Ey,cl,Sy,Vp,we,vM,hl,ro,wy,EM,Cy,ui,ll,My=oe(()=>{Xe();pM();vy();io();gM=Symbol("pbrMetallicRoughness"),yM=Symbol("normalTexture"),bM=Symbol("occlusionTexture"),xM=Symbol("emissiveTexture"),Qt=Symbol("backingThreeMaterial"),_M=Symbol("applyAlphaCutoff"),Ey=Symbol("getAlphaMode"),cl=Symbol("lazyLoadGLTFInfo"),Sy=Symbol("initialize"),Vp=Symbol("getLoadedMaterial"),we=Symbol("ensureMaterialIsLoaded"),vM=Symbol("gltfIndex"),hl=Symbol("setActive"),ro=Symbol("variantIndices"),wy=Symbol("isActive"),EM=Symbol("modelVariants"),Cy=Symbol("name"),ui=Symbol("pbrTextures"),ll=class extends Ui{get[(mM=ro,AM=ui,Qt)](){return this[ze].values().next().value}constructor(e,t,n,s,r,o,a=void 0){super(e,r),this[mM]=new Set,this[AM]=new Map,this[vM]=t,this[wy]=n,this[EM]=s,this[Cy]=o,a==null?this[Sy]():this[cl]=a}[Sy](){let e=this[mt],t=this[ze];this[gM]=new Hp(e,t);let{normalMap:n,aoMap:s,emissiveMap:r}=t.values().next().value;this[yM]=new Ls(e,ke.Normal,n,t),this[bM]=new Ls(e,ke.Occlusion,s,t),this[xM]=new Ls(e,ke.Emissive,r,t);let o=a=>{this[ui].set(a,new Ls(e,a,null,t))};o(ke.Clearcoat),o(ke.ClearcoatRoughness),o(ke.ClearcoatNormal),o(ke.SheenColor),o(ke.SheenRoughness),o(ke.Transmission),o(ke.Thickness),o(ke.Specular),o(ke.SpecularColor),o(ke.Iridescence),o(ke.IridescenceThickness),o(ke.Anisotropy)}async[Vp](){if(this[cl]!=null){let e=await this[cl].doLazyLoad();return this[Sy](),this[cl]=void 0,this.ensureLoaded=async()=>{},e}return null}colorFromRgb(e){let t=new Ce;return e instanceof Array?t.fromArray(e):t.set(e),t}[we](){if(this[cl]!=null)throw new Error(`Material "${this.name}" has not been loaded, call 'await
    myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[Vp]()}get isLoaded(){return this[cl]==null}get isActive(){return this[wy]}[hl](e){this[wy]=e}get name(){return this[Cy]||""}set name(e){if(this[Cy]=e,this[ze]!=null)for(let t of this[ze])t.name=e}get pbrMetallicRoughness(){return this[we](),this[gM]}get normalTexture(){return this[we](),this[yM]}get occlusionTexture(){return this[we](),this[bM]}get emissiveTexture(){return this[we](),this[xM]}get emissiveFactor(){return this[we](),this[Qt].emissive.toArray()}get index(){return this[vM]}hasVariant(e){let t=this[EM].get(e);return t!=null&&this[ro].has(t.index)}setEmissiveFactor(e){this[we]();let t=this.colorFromRgb(e);for(let n of this[ze])n.emissive.set(t);this[mt]()}[Ey](){return this[Qt].transparent?"BLEND":this[Qt].alphaTest>0?"MASK":"OPAQUE"}[_M](){this[we]();for(let e of this[ze])this[Ey]()==="MASK"?e.alphaTest==null&&(e.alphaTest=.5):e.alphaTest=void 0,e.needsUpdate=!0}setAlphaCutoff(e){this[we]();for(let t of this[ze])t.alphaTest=e,t.needsUpdate=!0;this[_M](),this[mt]()}getAlphaCutoff(){return this[we](),this[Qt].alphaTest}setDoubleSided(e){this[we]();for(let t of this[ze])t.side=e?Ut:qn,t.needsUpdate=!0;this[mt]()}getDoubleSided(){return this[we](),this[Qt].side==Ut}setAlphaMode(e){this[we]();let t=(n,s)=>{n.transparent=s,n.depthWrite=!s};for(let n of this[ze])t(n,e==="BLEND"),e==="MASK"?n.alphaTest=.5:n.alphaTest=void 0,n.needsUpdate=!0;this[mt]()}getAlphaMode(){return this[we](),this[Ey]()}get emissiveStrength(){return this[we](),this[Qt].emissiveIntensity}setEmissiveStrength(e){this[we]();for(let t of this[ze])t.emissiveIntensity=e;this[mt]()}get clearcoatFactor(){return this[we](),this[Qt].clearcoat}get clearcoatRoughnessFactor(){return this[we](),this[Qt].clearcoatRoughness}get clearcoatTexture(){return this[we](),this[ui].get(ke.Clearcoat)}get clearcoatRoughnessTexture(){return this[we](),this[ui].get(ke.ClearcoatRoughness)}get clearcoatNormalTexture(){return this[we](),this[ui].get(ke.ClearcoatNormal)}get clearcoatNormalScale(){return this[we](),this[Qt].clearcoatNormalScale.x}setClearcoatFactor(e){this[we]();for(let t of this[ze])t.clearcoat=e;this[mt]()}setClearcoatRoughnessFactor(e){this[we]();for(let t of this[ze])t.clearcoatRoughness=e;this[mt]()}setClearcoatNormalScale(e){this[we]();for(let t of this[ze])t.clearcoatNormalScale=new Fe(e,e);this[mt]()}get ior(){return this[we](),this[Qt].ior}setIor(e){this[we]();for(let t of this[ze])t.ior=e;this[mt]()}get sheenColorFactor(){return this[we](),this[Qt].sheenColor.toArray()}get sheenColorTexture(){return this[we](),this[ui].get(ke.SheenColor)}get sheenRoughnessFactor(){return this[we](),this[Qt].sheenRoughness}get sheenRoughnessTexture(){return this[we](),this[ui].get(ke.SheenRoughness)}setSheenColorFactor(e){this[we]();let t=this.colorFromRgb(e);for(let n of this[ze])n.sheenColor.set(t),n.sheen=1;this[mt]()}setSheenRoughnessFactor(e){this[we]();for(let t of this[ze])t.sheenRoughness=e,t.sheen=1;this[mt]()}get transmissionFactor(){return this[we](),this[Qt].transmission}get transmissionTexture(){return this[we](),this[ui].get(ke.Transmission)}setTransmissionFactor(e){this[we]();for(let t of this[ze])t.transmission=e;this[mt]()}get thicknessFactor(){return this[we](),this[Qt].thickness}get thicknessTexture(){return this[we](),this[ui].get(ke.Thickness)}get attenuationDistance(){return this[we](),this[Qt].attenuationDistance}get attenuationColor(){return this[we](),this[Qt].attenuationColor.toArray()}setThicknessFactor(e){this[we]();for(let t of this[ze])t.thickness=e;this[mt]()}setAttenuationDistance(e){this[we]();for(let t of this[ze])t.attenuationDistance=e;this[mt]()}setAttenuationColor(e){this[we]();let t=this.colorFromRgb(e);for(let n of this[ze])n.attenuationColor.set(t);this[mt]()}get specularFactor(){return this[we](),this[Qt].specularIntensity}get specularTexture(){return this[we](),this[ui].get(ke.Specular)}get specularColorFactor(){return this[we](),this[Qt].specularColor.toArray()}get specularColorTexture(){return this[we](),this[ui].get(ke.SheenColor)}setSpecularFactor(e){this[we]();for(let t of this[ze])t.specularIntensity=e;this[mt]()}setSpecularColorFactor(e){this[we]();let t=this.colorFromRgb(e);for(let n of this[ze])n.specularColor.set(t);this[mt]()}get iridescenceFactor(){return this[we](),this[Qt].iridescence}get iridescenceTexture(){return this[we](),this[ui].get(ke.Iridescence)}get iridescenceIor(){return this[we](),this[Qt].iridescenceIOR}get iridescenceThicknessMinimum(){return this[we](),this[Qt].iridescenceThicknessRange[0]}get iridescenceThicknessMaximum(){return this[we](),this[Qt].iridescenceThicknessRange[1]}get iridescenceThicknessTexture(){return this[we](),this[ui].get(ke.IridescenceThickness)}setIridescenceFactor(e){this[we]();for(let t of this[ze])t.iridescence=e;this[mt]()}setIridescenceIor(e){this[we]();for(let t of this[ze])t.iridescenceIOR=e;this[mt]()}setIridescenceThicknessMinimum(e){this[we]();for(let t of this[ze])t.iridescenceThicknessRange[0]=e;this[mt]()}setIridescenceThicknessMaximum(e){this[we]();for(let t of this[ze])t.iridescenceThicknessRange[1]=e;this[mt]()}get anisotropyStrength(){return this[we](),this[Qt].anisotropy}get anisotropyRotation(){return this[we](),this[Qt].anisotropyRotation}get anisotropyTexture(){return this[we](),this[ui].get(ke.Anisotropy)}setAnisotropyStrength(e){this[we]();for(let t of this[ze])t.anisotropy=e;this[mt]()}setAnisotropyRotation(e){this[we]();for(let t of this[ze])t.anisotropyRotation=e;this[mt]()}}});var Au,ul,SM=oe(()=>{My();io();Au=class{constructor(e){this.name="",this.children=new Array,this.name=e}},ul=class extends Au{constructor(e,t,n,s){super(e.name),this.materials=new Map,this.variantToMaterialMap=new Map,this.initialMaterialIdx=0,this.activeMaterialIdx=0,this.mesh=e;let{gltf:r,threeGLTF:o,threeObjectMap:a}=s;this.parser=o.parser,this.modelVariants=n,this.mesh.userData.variantData=n;let c=a.get(e.material);c.materials!=null?this.initialMaterialIdx=this.activeMaterialIdx=c.materials:console.error(`Primitive (${e.name}) missing initial material reference.`);let l=e.userData.associations||{};if(l.meshes==null){console.error("Mesh is missing primitive index association");return}let d=((r.meshes||[])[l.meshes].primitives||[])[l.primitives];if(d==null){console.error("Mesh primitive definition is missing.");return}if(d.material!=null)this.materials.set(d.material,t[d.material]);else{let f=t.findIndex(p=>p.name==="Default");f>=0?this.materials.set(f,t[f]):console.warn("gltfPrimitive has no material!")}if(d.extensions&&d.extensions.KHR_materials_variants){let f=d.extensions.KHR_materials_variants,g=o.parser.json.extensions.KHR_materials_variants.variants;for(let A of f.mappings){let m=t[A.material];this.materials.set(A.material,m);for(let b of A.variants){let{name:x}=g[b];this.variantToMaterialMap.set(b,m),m[ro].add(b),n.has(x)||n.set(x,{name:x,index:b})}}}}async setActiveMaterial(e){let t=this.materials.get(e);if(e!==this.activeMaterialIdx){let n=t[ze],s=await t[Vp]();s!=null?this.mesh.material=s:this.mesh.material=n.values().next().value,this.parser.assignFinalMaterial(this.mesh),n.add(this.mesh.material),this.activeMaterialIdx=e}return this.mesh.material}getActiveMaterial(){return this.materials.get(this.activeMaterialIdx)}getMaterial(e){return this.materials.get(e)}async enableVariant(e){if(e==null)return this.setActiveMaterial(this.initialMaterialIdx);if(this.variantToMaterialMap!=null&&this.modelVariants.has(e)){let t=this.modelVariants.get(e);return this.enableVariantHelper(t.index)}return null}async enableVariantHelper(e){if(this.variantToMaterialMap!=null&&e!=null){let t=this.variantToMaterialMap.get(e);if(t!=null)return this.setActiveMaterial(t.index)}return null}async instantiateVariants(){if(this.variantToMaterialMap!=null)for(let e of this.variantToMaterialMap.keys()){let t=this.mesh.userData.variantMaterials.get(e);if(t.material!=null)continue;let n=await this.enableVariantHelper(e);n!=null&&(t.material=n)}}get variantInfo(){return this.variantToMaterialMap}addVariant(e,t){if(!this.ensureVariantIsUnused(t))return!1;this.modelVariants.has(t)||this.modelVariants.set(t,{name:t,index:this.modelVariants.size});let s=this.modelVariants.get(t).index;return e[ro].add(s),this.variantToMaterialMap.set(s,e),this.materials.set(e.index,e),this.updateVariantUserData(s,e),!0}deleteVariant(e){if(this.variantInfo.has(e)){this.variantInfo.delete(e);let t=this.mesh.userData.variantMaterials;t?.delete(e)}}updateVariantUserData(e,t){t[ro].add(e),this.mesh.userData.variantData=this.modelVariants,this.mesh.userData.variantMaterials=this.mesh.userData.variantMaterials||new Map,this.mesh.userData.variantMaterials.set(e,{material:t[ze].values().next().value,gltfMaterialIndex:t.index})}ensureVariantIsUnused(e){let t=this.modelVariants.get(e);return t!=null&&this.variantInfo.has(t.index)?(console.warn(`Primitive cannot add variant '${e}' for this material, it already exists.`),!1):!0}}});var wM,CM,MM,TM,IM,RM,_a,Wp,BM,Sr,CW,Ry,By,Dy,qp,Ly,kn,Kp,Ty,DM,Iy,$p,Py=oe(()=>{Xe();My();SM();io();_a=Symbol("materials"),Wp=Symbol("hierarchy"),BM=Symbol("roots"),Sr=Symbol("primitives"),CW=Symbol("loadVariant"),Ry=Symbol("prepareVariantsForExport"),By=Symbol("switchVariant"),Dy=Symbol("materialFromPoint"),qp=Symbol("nodeFromPoint"),Ly=Symbol("nodeFromIndex"),kn=Symbol("variantData"),Kp=Symbol("availableVariants"),Ty=Symbol("modelOnUpdate"),DM=Symbol("cloneMaterial"),Iy=class{constructor(e,t,n,s){this.gltf=e,this.gltfElementMap=t,this.mapKey=n,this.doLazyLoad=s}},$p=class{constructor(e,t=()=>{}){this[wM]=new Array,this[CM]=new Array,this[MM]=new Array,this[TM]=new Array,this[IM]=()=>{},this[RM]=new Map,this[Ty]=t;let{gltf:n,threeGLTF:s,gltfElementMap:r}=e;for(let[c,l]of n.materials.entries()){let h=r.get(l);if(h!=null)this[_a].push(new ll(t,c,!0,this[kn],h,l.name));else{let d=(n.materials||[])[c],f=new Set;r.set(d,f);let p=async()=>{let g=await s.parser.getDependency("material",c);return f.add(g),g};this[_a].push(new ll(t,c,!1,this[kn],f,l.name,new Iy(n,r,d,p)))}}let o=new Map,a=new Array;for(let c of s.scene.children)a.push(c);for(;a.length>0;){let c=a.pop(),l=null;c instanceof Ke?(l=new ul(c,this.materials,this[kn],e),this[Sr].push(l)):l=new Au(c.name);let h=o.get(c);h!=null?h.children.push(l):this[BM].push(l),this[Wp].push(l);for(let u of c.children)a.push(u),o.set(c,l)}}get materials(){return this[_a]}[(wM=_a,CM=Wp,MM=BM,TM=Sr,IM=Ty,RM=kn,Kp)](){let e=Array.from(this[kn].values());return e.sort((t,n)=>t.index-n.index),e.map(t=>t.name)}getMaterialByName(e){let t=this[_a].filter(n=>n.name===e);return t.length>0?t[0]:null}[Ly](e,t){let n=this[Wp].find(s=>{if(s instanceof ul){let{meshes:r,primitives:o}=s.mesh.userData.associations;if(r==e&&o==t)return!0}return!1});return n??null}[qp](e){return this[Wp].find(t=>t instanceof ul&&t.mesh===e.object)}[Dy](e){return this[qp](e).getActiveMaterial()}async[By](e){for(let t of this[Sr])await t.enableVariant(e);for(let t of this.materials)t[hl](!1);for(let t of this[Sr])this.materials[t.getActiveMaterial().index][hl](!0)}async[Ry](){let e=new Array;for(let t of this[Sr])e.push(t.instantiateVariants());await Promise.all(e)}[DM](e,t){let n=this.materials[e];n.isLoaded||console.error(`Cloning an unloaded material,
           call 'material.ensureLoaded() before cloning the material.`);let s=n[ze],r=new Set;for(let[a,c]of s.entries()){let l=c.clone();l.name=t+(s.size>1?"_inst"+a:""),r.add(l)}let o=new ll(this[Ty],this[_a].length,!1,this[kn],r,t);return this[_a].push(o),o}createMaterialInstanceForVariant(e,t,n,s=!0){let r=null;for(let o of this[Sr]){let a=this[kn].get(n);a!=null&&o.variantInfo.has(a.index)||o.getMaterial(e)!=null&&(this.hasVariant(n)||this.createVariant(n),r==null&&(r=this[DM](e,t)),o.addVariant(r,n))}if(s&&r!=null){r[hl](!0),this.materials[e][hl](!1);for(let o of this[Sr])o.enableVariant(n)}return r}createVariant(e){this[kn].has(e)?console.warn(`Variant '${e}'' already exists`):this[kn].set(e,{name:e,index:this[kn].size})}hasVariant(e){return this[kn].has(e)}setMaterialToVariant(e,t){if(this[Kp]().find(n=>n===t)==null){console.warn(`Can't add material to '${t}', the variant does not exist.'`);return}if(e<0||e>=this.materials.length){console.error("setMaterialToVariant(): materialIndex is out of bounds.");return}for(let n of this[Sr]){let s=n.getMaterial(e);s!=null&&n.addVariant(s,t)}}updateVariantName(e,t){let n=this[kn].get(e);n!=null&&(n.name=t,this[kn].set(t,n),this[kn].delete(e))}deleteVariant(e){let t=this[kn].get(e);if(t!=null){for(let n of this.materials)n.hasVariant(e)&&n[ro].delete(t.index);for(let n of this[Sr])n.deleteVariant(t.index);this[kn].delete(e)}}}});var Fy,yu,bu,oo,Oy,gu,LM,Ny=oe(()=>{Vs();Xe();Sw();ai();Cw();Py();xy();Fy=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},yu=Symbol("currentGLTF"),bu=Symbol("originalGltfJson"),oo=Symbol("model"),Oy=Symbol("getOnUpdateMethod"),gu=Symbol("buildTexture"),LM=i=>{var e,t,n;class s extends i{constructor(){super(...arguments),this[e]=void 0,this[t]=null,this[n]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[oo]}get availableVariants(){return this.model?this.model[Kp]():[]}get originalGltfJson(){return this[bu]}[(e=oo,t=yu,n=bu,Oy)](){return()=>{this[Wt]()}}[gu](o){return o.colorSpace=at,o.wrapS=Dn,o.wrapT=Dn,new ol(this[Oy](),o)}async createTexture(o,a="image/png"){let{textureUtils:c}=this[ut],l=await c.loadImage(o,this.withCredentials);return l.userData.mimeType=a,this[gu](l)}async createLottieTexture(o,a=1){let{textureUtils:c}=this[ut],l=await c.loadLottie(o,a,this.withCredentials);return this[gu](l)}createVideoTexture(o){let a=document.createElement("video");a.crossOrigin=this.withCredentials?"use-credentials":"anonymous",a.src=o,a.muted=!0,a.playsInline=!0,a.loop=!0,a.play();let c=new dh(a);return this[gu](c)}createCanvasTexture(){let o=document.createElement("canvas"),a=new Go(o);return this[gu](a)}async updated(o){if(super.updated(o),o.has("variantName")){let a=this[is].beginActivity("variant-update");a(.1);let c=this[oo],{variantName:l}=this;c!=null&&(await c[By](l),this[Wt](),this.dispatchEvent(new CustomEvent("variant-applied"))),a(1)}if(o.has("orientation")||o.has("scale")){if(!this.loaded)return;let a=this[ne];a.applyTransform(),a.updateBoundingBox(),a.updateShadow(),this[ut].arRenderer.onUpdateScene(),this[Wt]()}}[hi](){super[hi]();let{currentGLTF:o}=this[ne];if(o!=null){let{correlatedSceneGraph:a}=o;a!=null&&o!==this[yu]&&(this[oo]=new $p(a,this[Oy]()),this[bu]=JSON.parse(JSON.stringify(a.gltf))),"variants"in o.userData&&this.requestUpdate("variantName")}this[yu]=o}async exportScene(o){let a=this[ne];return new Promise(async(c,l)=>{let h={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(h,o),h.animations=a.animations,h.truncateDrawRange=!0;let u=a.shadow,d=!1;u!=null&&(d=u.visible,u.visible=!1),await this[oo][Ry](),new pa().register(p=>new Kh(p)).parse(a.model,p=>c(new Blob([h.binary?p:JSON.stringify(p)],{type:h.binary?"application/octet-stream":"application/json"})),()=>l("glTF export failed"),h),u!=null&&(u.visible=d)})}materialFromPoint(o,a){let c=this[oo];if(c==null)return null;let l=this[ne],h=l.getNDC(o,a),u=l.hitFromPoint(h);return u==null||u.face==null?null:c[Dy](u)}}return Fy([Be({type:String,attribute:"variant-name"})],s.prototype,"variantName",void 0),Fy([Be({type:String,attribute:"orientation"})],s.prototype,"orientation",void 0),Fy([Be({type:String,attribute:"scale"})],s.prototype,"scale",void 0),s}});function ck(i,e,t){let n=new Ah(e,2*t,t);n.scale(1,1,-1);let s=n.getAttribute("position"),r=new D;for(let o=0;o<s.count;++o)if(r.fromBufferAttribute(s,o),r.y<0){let a=-i*3/2,c=r.y<a?-i/r.y:1-r.y*r.y/(3*a*a);r.multiplyScalar(c),r.toArray(s.array,3*o)}return s.needsUpdate=!0,n}var Xp,PM=oe(()=>{Xe();Xp=class extends Ke{constructor(){super(void 0,new Jt({depthWrite:!1})),this.height=0,this.radius=0,this.resolution=0,this.userData.noHit=!0}get map(){return this.material.map}set map(e){this.material.map=e}isUsable(){return this.height>0&&this.radius>0&&this.geometry!=null&&this.map!=null}updateGeometry(e=this.height,t=this.radius,n=128){(e!=this.height||t!=this.radius||n!=this.resolution)&&(this.height=e,this.radius=t,this.resolution=n,e>0&&t>0&&(this.geometry.dispose(),this.geometry=ck(e,t,n)))}}});var Yp,Uy,ky,jp,FM,OM,dl,Gy=oe(()=>{Xe();I0();qc();Bs();Yp=new D,Uy=new D,ky=new D,jp=new Qe,FM=new Pi,OM=new $t,dl=class extends lp{constructor(e){super(document.createElement("div")),this.normal=new D(0,1,0),this.initialized=!1,this.referenceCount=1,this.pivot=document.createElement("div"),this.slot=document.createElement("slot"),this.element.classList.add("annotation-wrapper"),this.slot.name=e.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(e.position),this.updateNormal(e.normal),this.surface=e.surface}get facingCamera(){return!this.element.classList.contains("hide")}show(){(!this.facingCamera||!this.initialized)&&this.updateVisibility(!0)}hide(){(this.facingCamera||!this.initialized)&&this.updateVisibility(!1)}increment(){this.referenceCount++}decrement(){return this.referenceCount>0&&--this.referenceCount,this.referenceCount===0}updatePosition(e){if(e==null)return;let t=ci(e)[0].terms;for(let n=0;n<3;++n)this.position.setComponent(n,li(t[n]).number);this.updateMatrixWorld()}updateNormal(e){if(e==null)return;let t=ci(e)[0].terms;for(let n=0;n<3;++n)this.normal.setComponent(n,t[n].number)}updateSurface(){let{mesh:e,tri:t,bary:n}=this;if(e==null||t==null||n==null)return;e.getVertexPosition(t.x,Yp),e.getVertexPosition(t.y,Uy),e.getVertexPosition(t.z,ky),Yp.toArray(jp.elements,0),Uy.toArray(jp.elements,3),ky.toArray(jp.elements,6),this.position.copy(n).applyMatrix3(jp);let s=this.parent;s.worldToLocal(e.localToWorld(this.position)),FM.set(Yp,Uy,ky),FM.getNormal(this.normal).transformDirection(e.matrixWorld);let r=s.parent;OM.setFromAxisAngle(Yp.set(0,1,0),-r.rotation.y),this.normal.applyQuaternion(OM)}orient(e){this.pivot.style.transform=`rotate(${e}rad)`}updateVisibility(e){this.element.classList.toggle("hide",!e),this.slot.assignedNodes().forEach(t=>{if(t.nodeType!==Node.ELEMENT_NODE)return;let n=t,s=n.dataset.visibilityAttribute;if(s!=null){let r=`data-${s}`;n.toggleAttribute(r,e)}n.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:e}}))}),this.initialized=!0}}});var NM,UM=oe(()=>{NM={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:.001953125}},vertexShader:`

		varying vec2 vUv;

		void main() {

			vUv = uv;
			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

		}`,fragmentShader:`

		uniform sampler2D tDiffuse;
		uniform float h;

		varying vec2 vUv;

		void main() {

			vec4 sum = vec4( 0.0 );

			sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
			sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
			sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
			sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
			sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
			sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
			sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
			sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;

			gl_FragColor = sum;

		}`}});var kM,GM=oe(()=>{kM={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:.001953125}},vertexShader:`

		varying vec2 vUv;

		void main() {

			vUv = uv;
			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

		}`,fragmentShader:`

		uniform sampler2D tDiffuse;
		uniform float v;

		varying vec2 vUv;

		void main() {

			vec4 sum = vec4( 0.0 );

			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;

			gl_FragColor = sum;

		}`}});function Qy(i,e,t){return(1-t)*i+t*e}var WW,qW,QM=oe(()=>{WW=Math.PI/180,qW=180/Math.PI});var zM,lk,zy,hk,Jp,HM=oe(()=>{Xe();UM();GM();QM();zM=9,lk=6,zy=2,hk=.3,Jp=class extends Ct{constructor(e,t,n){super(),this.camera=new yi,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new yc,this.horizontalBlurMaterial=new sn(NM),this.verticalBlurMaterial=new sn(kM),this.intensity=0,this.softness=1,this.boundingBox=new jt,this.size=new D,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;let{camera:s}=this;s.rotation.x=Math.PI/2,s.left=-.5,s.right=.5,s.bottom=-.5,s.top=.5,this.add(s);let r=new ri,o=new Jt({opacity:1,transparent:!0,side:en});this.floor=new Ke(r,o),this.floor.userData.noHit=!0,s.add(this.floor),this.blurPlane=new Ke(r),this.blurPlane.visible=!1,s.add(this.blurPlane),e.target.add(this),this.depthMaterial.onBeforeCompile=function(a){a.fragmentShader=a.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * opacity );")},this.depthMaterial.side=Ut,this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(e,t,n)}setScene(e,t,n){let{boundingBox:s,size:r,rotation:o,position:a}=this;if(this.isAnimated=e.animationNames.length>0,this.boundingBox.copy(e.boundingBox),this.size.copy(e.size),this.maxDimension=Math.max(r.x,r.y,r.z)*(this.isAnimated?zy:1),this.boundingBox.getCenter(a),n==="back"){let{min:c,max:l}=s;[c.y,c.z]=[c.z,c.y],[l.y,l.z]=[l.z,l.y],[r.y,r.z]=[r.z,r.y],o.x=Math.PI/2,o.y=Math.PI}else o.x=0,o.y=0;if(this.isAnimated){let c=s.min.y,l=s.max.y;r.y=this.maxDimension,s.expandByVector(r.subScalar(this.maxDimension).multiplyScalar(-.5)),s.min.y=c,s.max.y=l,r.set(this.maxDimension,l-c,this.maxDimension)}n==="bottom"?a.y=s.min.y:a.z=s.min.y,this.setSoftness(t)}setSoftness(e){this.softness=e;let{size:t,camera:n}=this,s=this.isAnimated?zy:1,r=s*Math.pow(2,zM-e*(zM-lk));this.setMapSize(r);let o=t.y/2,a=t.y*s;n.near=0,n.far=Qy(a,o,e),this.depthMaterial.opacity=1/e,n.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(e){let{size:t}=this;this.isAnimated&&(e*=zy);let n=Math.floor(t.x>t.z?e:e*t.x/t.z),s=Math.floor(t.x>t.z?e*t.z/t.x:e),r=10,o=r+n,a=r+s;if(this.renderTarget!=null&&(this.renderTarget.width!==o||this.renderTarget.height!==a)&&(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),this.renderTarget==null){let c={format:vt};this.renderTarget=new _n(o,a,c),this.renderTargetBlur=new _n(o,a,c),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(t.x*(1+r/n),t.z*(1+r/s),1),this.needsUpdate=!0}setIntensity(e){this.intensity=e,e>0?(this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=e*Qy(hk,1,this.softness*this.softness)):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.intensity}setOffset(e){this.floor.position.z=-e+this.gap()}gap(){return .001*this.maxDimension}render(e,t){t.overrideMaterial=this.depthMaterial;let n=e.getClearAlpha();e.setClearAlpha(0),this.floor.visible=!1;let s=e.xr.enabled;e.xr.enabled=!1;let r=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.render(t,this.camera),t.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(e),e.xr.enabled=s,e.setRenderTarget(r),e.setClearAlpha(n)}blurShadow(e){let{camera:t,horizontalBlurMaterial:n,verticalBlurMaterial:s,renderTarget:r,renderTargetBlur:o,blurPlane:a}=this;a.visible=!0,a.material=n,n.uniforms.h.value=1/this.renderTarget.width,n.uniforms.tDiffuse.value=this.renderTarget.texture,e.setRenderTarget(o),e.render(a,t),a.material=s,s.uniforms.v.value=1/this.renderTarget.height,s.uniforms.tDiffuse.value=this.renderTargetBlur.texture,e.setRenderTarget(r),e.render(a,t),a.visible=!1}dispose(){this.renderTarget!=null&&this.renderTarget.dispose(),this.renderTargetBlur!=null&&this.renderTargetBlur.dispose(),this.depthMaterial.dispose(),this.horizontalBlurMaterial.dispose(),this.verticalBlurMaterial.dispose(),this.floor.material.dispose(),this.floor.geometry.dispose(),this.blurPlane.geometry.dispose(),this.removeFromParent()}}});var VM,Hy,Vy,WM,qM,Zp,uk,xu,em,KM=oe(()=>{Xe();I0();Aw();Ny();Py();ai();qc();Bs();Vc();PM();Gy();HM();VM=10,Hy=100,Vy=new D,WM=new D,qM=new D,Zp=new wh,uk=new D,xu=new Fe,em=class extends Pn{constructor({canvas:e,element:t,width:n,height:s}){super(),this.annotationRenderer=new hp,this.effectRenderer=null,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.appendedAnimations=[],this.markedAnimations=[],this.camera=new Kt(45,1,.1,100),this.xrCamera=null,this.url=null,this.pivot=new Ct,this.target=new Ct,this.animationNames=[],this.boundingBox=new jt,this.boundingSphere=new vn,this.size=new D,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.toneMapping=ar,this.canScale=!0,this.isDirty=!1,this.goalTarget=new D,this.targetDamperX=new tn,this.targetDamperY=new tn,this.targetDamperZ=new tn,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.groundedSkybox=new Xp,this.name="ModelScene",this.element=t,this.canvas=e,this.camera=new Kt(45,1,.1,100),this.camera.name="MainCamera",this.add(this.pivot),this.pivot.name="Pivot",this.pivot.add(this.target),this.setSize(n,s),this.target.name="Target",this.mixer=new Sh(this.target);let{domElement:r}=this.annotationRenderer,{style:o}=r;o.display="none",o.pointerEvents="none",o.position="absolute",o.top="0",this.element.shadowRoot.querySelector(".default").appendChild(r),this.schemaElement.setAttribute("type","application/ld+json")}get context(){return this.canvas.getContext("2d")}getCamera(){return this.xrCamera!=null?this.xrCamera:this.camera}queueRender(){this.isDirty=!0}shouldRender(){return this.isDirty}hasRendered(){this.isDirty=!1}forceRescale(){this.scaleStep=-1,this.queueRender()}async setObject(e){this.reset(),this._model=e,this.target.add(e),await this.setupScene()}async setSource(e,t=()=>{}){if(!e||e===this.url){t(1);return}if(this.reset(),this.url=e,this.externalRenderer!=null){let a=await this.externalRenderer.load(t);this.boundingSphere.radius=a.framedRadius,this.idealAspect=a.fieldOfViewAspect;return}this.cancelPendingSourceChange!=null&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);let n;try{n=await new Promise(async(a,c)=>{this.cancelPendingSourceChange=()=>c();try{let l=await this.element[ut].loader.load(e,this.element,t);a(l)}catch(l){c(l)}})}catch(a){if(a==null)return;throw a}this.cancelPendingSourceChange=null,this.reset(),this.url=e,this._currentGLTF=n,n!=null&&(this._model=n.scene,this.target.add(n.scene));let{animations:s}=n,r=new Map,o=[];for(let a of s)r.set(a.name,a),o.push(a.name);this.animations=s,this.animationsByName=r,this.animationNames=o,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity),this.setGroundedSkybox()}reset(){this.url=null,this.renderCount=0,this.queueRender(),this.shadow!=null&&this.shadow.setIntensity(0),this.bakedShadows.clear();let{_model:e}=this;e!=null&&(e.removeFromParent(),this._model=null);let t=this._currentGLTF;t!=null&&(t.dispose(),this._currentGLTF=null),this.currentAnimationAction!=null&&(this.currentAnimationAction.stop(),this.currentAnimationAction=null),this.mixer.stopAllAction(),this.mixer.uncacheRoot(this)}dispose(){this.reset(),this.shadow!=null&&(this.shadow.dispose(),this.shadow=null),this.element[yu]=null,this.element[bu]=null,this.element[oo]=null}get currentGLTF(){return this._currentGLTF}setSize(e,t){if(!(this.width===e&&this.height===t)){if(this.width=Math.max(e,1),this.height=Math.max(t,1),this.annotationRenderer.setSize(e,t),this.aspect=this.width/this.height,this.externalRenderer!=null){let n=window.devicePixelRatio;this.externalRenderer.resize(e*n,t*n)}this.queueRender()}}markBakedShadow(e){e.userData.noHit=!0,this.bakedShadows.add(e)}unmarkBakedShadow(e){e.userData.noHit=!1,e.visible=!0,this.bakedShadows.delete(e),this.boundingBox.expandByObject(e)}findBakedShadows(e){let t=new jt;e.traverse(n=>{let s=n;if(!s.material||!s.material.transparent)return;t.setFromObject(s);let o=t.getSize(uk),a=Math.min(o.x,o.y,o.z);Math.max(o.x,o.y,o.z)<Hy*a||this.markBakedShadow(s)})}checkBakedShadows(){let{min:e,max:t}=this.boundingBox,n=new jt;this.boundingBox.getSize(this.size);for(let s of this.bakedShadows)n.setFromObject(s),!(n.min.y<e.y+this.size.y/Hy&&n.min.x<=e.x&&n.max.x>=t.x&&n.min.z<=e.z&&n.max.z>=t.z)&&(n.min.z<e.z+this.size.z/Hy&&n.min.x<=e.x&&n.max.x>=t.x&&n.min.y<=e.y&&n.max.y>=t.y||this.unmarkBakedShadow(s))}applyTransform(){let{model:e}=this;if(e==null)return;let t=ci(this.element.orientation)[0].terms,n=li(t[0]).number,s=li(t[1]).number,r=li(t[2]).number;e.quaternion.setFromEuler(new Kn(s,r,n,"YXZ"));let o=ci(this.element.scale)[0].terms;e.scale.set(o[0].number,o[1].number,o[2].number)}updateBoundingBox(){let{model:e}=this;if(e==null)return;this.target.remove(e),this.findBakedShadows(e);let t=(n,s)=>n.expandByPoint(s);this.setBakedShadowVisibility(!1),this.boundingBox=Wh(e,t,new jt),this.boundingBox.isEmpty()&&(this.setBakedShadowVisibility(!0),this.bakedShadows.forEach(n=>this.unmarkBakedShadow(n)),this.boundingBox=Wh(e,t,new jt)),this.checkBakedShadows(),this.setBakedShadowVisibility(),this.boundingBox.getSize(this.size),this.target.add(e)}async updateFraming(){let{model:e}=this;if(e==null)return;this.target.remove(e),this.setBakedShadowVisibility(!1);let{center:t}=this.boundingSphere;this.element.requestUpdate("cameraTarget"),await this.element.updateComplete,t.copy(this.getTarget());let n=(r,o)=>Math.max(r,t.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(Wh(e,n,0));let s=(r,o)=>{o.sub(t);let a=Math.sqrt(o.x*o.x+o.z*o.z);return Math.max(r,a/(this.idealCameraDistance()-Math.abs(o.y)))};this.idealAspect=Wh(e,s,0)/Math.tan(this.framedFoVDeg/2*Math.PI/180),this.setBakedShadowVisibility(),this.target.add(e)}setBakedShadowVisibility(e=this.shadowIntensity<=0){for(let t of this.bakedShadows)t.visible=e}idealCameraDistance(){let e=this.framedFoVDeg/2*Math.PI/180;return this.boundingSphere.radius/Math.sin(e)}adjustedFoV(e){let t=Math.tan(e/2*Math.PI/180)*Math.max(1,this.idealAspect/this.aspect);return 2*Math.atan(t)*180/Math.PI}getNDC(e,t){if(this.xrCamera!=null)xu.set(e/window.screen.width,t/window.screen.height);else{let n=this.element.getBoundingClientRect();xu.set((e-n.x)/this.width,(t-n.y)/this.height)}return xu.multiplyScalar(2).subScalar(1),xu.y*=-1,xu}getSize(){return{width:this.width,height:this.height}}setEnvironmentAndSkybox(e,t){this.element[ut].arRenderer.presentedScene!==this&&(this.environment=e,this.setBackground(t),this.queueRender())}setBackground(e){this.groundedSkybox.map=e,this.groundedSkybox.isUsable()?(this.target.add(this.groundedSkybox),this.background=null):(this.target.remove(this.groundedSkybox),this.background=e)}farRadius(){return this.boundingSphere.radius*(this.groundedSkybox.parent!=null?VM:1)}setGroundedSkybox(){let e=ci(this.element.skyboxHeight)[0].terms[0],t=li(e).number,n=VM*this.boundingSphere.radius;this.groundedSkybox.updateGeometry(t,n),this.groundedSkybox.position.y=t-(this.shadow?2*this.shadow.gap():0),this.setBackground(this.groundedSkybox.map)}setTarget(e,t,n){this.goalTarget.set(-e,-t,-n)}setTargetDamperDecayTime(e){this.targetDamperX.setDecayTime(e),this.targetDamperY.setDecayTime(e),this.targetDamperZ.setDecayTime(e)}getTarget(){return this.goalTarget.clone().multiplyScalar(-1)}getDynamicTarget(){return this.target.position.clone().multiplyScalar(-1)}jumpToGoal(){this.updateTarget(1e4)}updateTarget(e){let t=this.goalTarget,n=this.target.position;if(t.equals(n))return!1;{let s=this.boundingSphere.radius/10,{x:r,y:o,z:a}=n;return r=this.targetDamperX.update(r,t.x,e,s),o=this.targetDamperY.update(o,t.y,e,s),a=this.targetDamperZ.update(a,t.z,e,s),this.groundedSkybox.position.x=-r,this.groundedSkybox.position.z=-a,this.target.position.set(r,o,a),this.target.updateMatrixWorld(),this.queueRender(),!0}}pointTowards(e,t){let{x:n,z:s}=this.position;this.yaw=Math.atan2(e-n,t-s)}get model(){return this._model}set yaw(e){this.pivot.rotation.y=e,this.groundedSkybox.rotation.y=-e,this.queueRender()}get yaw(){return this.pivot.rotation.y}set animationTime(e){this.mixer.setTime(e),this.queueShadowRender()}get animationTime(){if(this.currentAnimationAction!=null){let e=Math.max(this.currentAnimationAction._loopCount,0);return this.currentAnimationAction.loop===Zo&&(e&1)===1?this.duration-this.currentAnimationAction.time:this.currentAnimationAction.time}return 0}set animationTimeScale(e){this.mixer.timeScale=e}get animationTimeScale(){return this.mixer.timeScale}get duration(){return this.currentAnimationAction!=null&&this.currentAnimationAction.getClip()?this.currentAnimationAction.getClip().duration:0}get hasActiveAnimation(){return this.currentAnimationAction!=null}playAnimation(e=null,t=0,n=ur,s=1/0){if(this._currentGLTF==null)return;let{animations:r}=this;if(r==null||r.length===0)return;let o=null;if(e!=null&&(o=this.animationsByName.get(e),o==null)){let a=parseInt(e);!isNaN(a)&&a>=0&&a<r.length&&(o=r[a])}o==null&&(o=r[0]);try{let{currentAnimationAction:a}=this,c=this.mixer.clipAction(o,this);c.timeScale!=this.element.timeScale&&(c.timeScale=this.element.timeScale),this.currentAnimationAction=c,this.element.paused?this.mixer.stopAllAction():(c.paused=!1,a!=null&&c!==a?c.crossFadeFrom(a,t,!1):this.animationTimeScale>0&&this.animationTime==this.duration&&(this.animationTime=0)),c.setLoop(n,s),c.enabled=!0,c.clampWhenFinished=!0,c.play()}catch(a){console.error(a)}}appendAnimation(e="",t=ur,n=1/0,s=1,r=1,o=!1,a=!1,c=!0,l=null,h=!1){if(this._currentGLTF==null||e===this.element.animationName)return;let{animations:u}=this;if(u==null||u.length===0)return;let d=null,f=1.25;if(e&&(d=this.animationsByName.get(e)),d!=null){typeof n=="string"?isNaN(n)?(n=1/0,console.warn("Invalid repetitionCount value, repetitionCount is set to Infinity")):n=Math.max(parseInt(n),1):typeof n=="number"&&n<1&&(n=1),n===1&&t!==jr&&(t=jr),typeof s=="string"&&(isNaN(s)?(s=1,console.warn("Invalid weight value, weight is set to 1")):s=parseFloat(s)),typeof r=="string"&&(isNaN(r)?(r=1,console.warn("Invalid timeScale value, timeScale is set to 1")):r=parseFloat(r)),typeof o=="string"&&(o.toLowerCase().trim()==="true"?o=!0:o.toLowerCase().trim()==="false"?o=!1:isNaN(o)?(o=!1,console.warn("Invalid fade value, fade is set to false")):o=parseFloat(o)),typeof a=="string"&&(a.toLowerCase().trim()==="true"?a=!0:a.toLowerCase().trim()==="false"?a=!1:isNaN(a)?(a=!1,console.warn("Invalid warp value, warp is set to false")):a=parseFloat(a)),typeof l=="string"&&(isNaN(l)||(l=parseFloat(l)));try{let p=this.mixer.existingAction(d)||this.mixer.clipAction(d,this),g=p.timeScale;h&&this.appendedAnimations.includes(e)&&(this.markedAnimations.map(A=>A.name).includes(e)||this.markedAnimations.push({name:e,loopMode:t,repetitionCount:n})),typeof l=="number"&&(p.time=Math.min(Math.max(l,0),d.duration)),typeof o=="boolean"&&o?p.fadeIn(f):typeof o=="number"?p.fadeIn(Math.max(o,0)):s>=0&&(p.weight=Math.min(Math.max(s,0),1)),typeof a=="boolean"&&a?p.warp(c?g:0,r,f):typeof a=="number"?p.warp(c?g:0,r,Math.max(a,0)):p.timeScale=r,p.isRunning()||(p.time==d.duration&&p.stop(),p.setLoop(t,n),p.paused=!1,p.enabled=!0,p.clampWhenFinished=!0,p.play()),this.appendedAnimations.includes(e)||this.element[ne].appendedAnimations.push(e)}catch(p){console.error(p)}}}detachAnimation(e="",t=!0){if(this._currentGLTF==null||e===this.element.animationName)return;let{animations:n}=this;if(n==null||n.length===0)return;let s=null,r=1.5;if(e&&(s=this.animationsByName.get(e)),s!=null){typeof t=="string"&&(t.toLowerCase().trim()==="true"?t=!0:t.toLowerCase().trim()==="false"?t=!1:isNaN(t)?(t=!0,console.warn("Invalid fade value, fade is set to true")):t=parseFloat(t));try{let o=this.mixer.existingAction(s)||this.mixer.clipAction(s,this);typeof t=="boolean"&&t?o.fadeOut(r):typeof t=="number"?o.fadeOut(Math.max(t,0)):o.stop();let a=this.element[ne].appendedAnimations.filter(c=>c!==e);this.element[ne].appendedAnimations=a}catch(o){console.error(o)}}}updateAnimationLoop(e="",t=ur,n=1/0){if(this._currentGLTF==null||e===this.element.animationName)return;let{animations:s}=this;if(s==null||s.length===0)return;let r=null;if(e&&(r=this.animationsByName.get(e)),r!=null)try{let o=this.mixer.existingAction(r)||this.mixer.clipAction(r,this);o.stop(),o.setLoop(t,n),o.play()}catch(o){console.error(o)}}stopAnimation(){this.currentAnimationAction=null,this.mixer.stopAllAction()}updateAnimation(e){this.mixer.update(e),this.queueShadowRender()}subscribeMixerEvent(e,t){this.mixer.addEventListener(e,t)}updateShadow(){let e=this.shadow;if(e!=null){let t=this.element.arPlacement==="wall"?"back":"bottom";e.setScene(this,this.shadowSoftness,t),e.needsUpdate=!0}}renderShadow(e){let t=this.shadow;t!=null&&t.needsUpdate==!0&&(t.render(e,this),t.needsUpdate=!1)}queueShadowRender(){this.shadow!=null&&(this.shadow.needsUpdate=!0)}setShadowIntensity(e){if(this.shadowIntensity=e,this._currentGLTF!=null&&(this.setBakedShadowVisibility(),!(e<=0&&this.shadow==null))){if(this.shadow==null){let t=this.element.arPlacement==="wall"?"back":"bottom";this.shadow=new Jp(this,this.shadowSoftness,t)}this.shadow.setIntensity(e)}}setShadowSoftness(e){this.shadowSoftness=e;let t=this.shadow;t?.setSoftness(e)}setShadowOffset(e){let t=this.shadow;t?.setOffset(e)}getHit(e=this){return Zp.intersectObject(e,!0).find(n=>n.object.visible&&!n.object.userData.noHit)}hitFromController(e,t=this){return Zp.setFromXRController(e),this.getHit(t)}hitFromPoint(e,t=this){return Zp.setFromCamera(e,this.getCamera()),this.getHit(t)}positionAndNormalFromPoint(e,t=this){var n;let s=this.hitFromPoint(e,t);if(s==null)return null;let r=s.point,o=s.face!=null?s.face.normal.clone().applyNormalMatrix(new Qe().getNormalMatrix(s.object.matrixWorld)):Zp.ray.direction.clone().multiplyScalar(-1),a=(n=s.uv)!==null&&n!==void 0?n:null;return{position:r,normal:o,uv:a}}surfaceFromPoint(e,t=this){let n=this.element.model;if(n==null)return null;let s=this.hitFromPoint(e,t);if(s==null||s.face==null)return null;let r=n[qp](s),{meshes:o,primitives:a}=r.mesh.userData.associations,c=new D,l=new D,h=new D,{a:u,b:d,c:f}=s.face,p=s.object;p.getVertexPosition(u,c),p.getVertexPosition(d,l),p.getVertexPosition(f,h);let g=new Pi(c,l,h),A=new D;return g.getBarycoord(p.worldToLocal(s.point),A),`${o} ${a} ${u} ${d} ${f} ${A.x.toFixed(3)} ${A.y.toFixed(3)} ${A.z.toFixed(3)}`}addHotspot(e){this.target.add(e),this.annotationRenderer.domElement.appendChild(e.element),this.updateSurfaceHotspot(e)}removeHotspot(e){this.target.remove(e)}forHotspots(e){let{children:t}=this.target;for(let n=0,s=t.length;n<s;n++){let r=t[n];r instanceof dl&&e(r)}}updateSurfaceHotspot(e){if(e.surface==null||this.element.model==null)return;let t=ci(e.surface)[0].terms;if(t.length!=8){console.warn(e.surface+" does not have exactly 8 numbers.");return}let n=this.element.model[Ly](t[0].number,t[1].number);if(n==null){console.warn(e.surface+" does not match a node/primitive in this glTF! Skipping this hotspot.");return}let s=n.mesh.geometry.attributes.position.count,r=new D(t[2].number,t[3].number,t[4].number);if(r.x>=s||r.y>=s||r.z>=s){console.warn(e.surface+" vertex indices out of range in this glTF! Skipping this hotspot.");return}let o=new D(t[5].number,t[6].number,t[7].number);e.mesh=n.mesh,e.tri=r,e.bary=o,e.updateSurface()}animateSurfaceHotspots(){this.element.paused||this.forHotspots(e=>{e.updateSurface()})}updateHotspotsVisibility(e){this.forHotspots(t=>{Vy.copy(e),WM.setFromMatrixPosition(t.matrixWorld),Vy.sub(WM),qM.copy(t.normal).transformDirection(this.target.matrixWorld),Vy.dot(qM)<0?t.hide():t.show()})}orientHotspots(e){this.forHotspots(t=>{t.orient(e)})}setHotspotsVisibility(e){this.forHotspots(t=>{t.visible=e})}updateSchema(e){var t;let{schemaElement:n,element:s}=this,{alt:r,poster:o,iosSrc:a}=s;if(e!=null){let c=[{"@type":"MediaObject",contentUrl:e,encodingFormat:((t=e.split(".").pop())===null||t===void 0?void 0:t.toLowerCase())==="gltf"?"model/gltf+json":"model/gltf-binary"}];a&&c.push({"@type":"MediaObject",contentUrl:a,encodingFormat:"model/vnd.usdz+zip"});let l={"@context":"http://schema.org/","@type":"3DModel",image:o??void 0,name:r??void 0,encoding:c};n.textContent=JSON.stringify(l),document.head.appendChild(n)}else n.parentElement!=null&&n.parentElement.removeChild(n)}}});var tm,$M=oe(()=>{ns();tm=class extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(e){let t={progress:0,completed:!1};return this.ongoingActivities.add(t),this.ongoingActivityCount===1&&this.announceTotalProgress(t,0,e),n=>{let s;return s=Math.max(Nn(n,0,1),t.progress),s!==t.progress&&this.announceTotalProgress(t,s,e),t.progress}}announceTotalProgress(e,t,n){let s=0,r=0;t==1&&(e.completed=!0);for(let c of this.ongoingActivities){let{progress:l}=c;s+=1-l,c.completed&&r++}let o=e.progress;e.progress=t,this.totalProgress+=(t-o)*(1-this.totalProgress)/s;let a=r===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:a,reason:n}})),r===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}});var rm,XM,YM,jM,JM,ZM,eT,tT,nT,iT,sT,rT,oT,aT,dk,fk,pk,mk,Ak,_r,Wy,cT,nm,fl,qy,pl,Ky,$y,Xy,ya,im,ao,vu,ga,sm,_u,eu,Zc,co,lT,iu,vi,kp,ne,Wt,Xn,hi,tu,ut,is,hT,rs,dr,os,fu,wr,ai=oe(()=>{Uc();Vs();Jf();Qh();bS();cp();KM();Up();ns();$M();rm=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},dk=10,fk=50,pk=0,mk=300,Ak=150,_r=document.createElement("canvas"),Wy=Symbol("fallbackResizeHandler"),cT=Symbol("defaultAriaLabel"),nm=Symbol("resizeObserver"),fl=Symbol("clearModelTimeout"),qy=Symbol("onContextLost"),pl=Symbol("loaded"),Ky=Symbol("status"),$y=Symbol("onFocus"),Xy=Symbol("onBlur"),ya=Symbol("updateSize"),im=Symbol("intersectionObserver"),ao=Symbol("isElementInViewport"),vu=Symbol("announceModelVisibility"),ga=Symbol("ariaLabel"),sm=Symbol("altDefaulted"),_u=Symbol("statusElement"),eu=Symbol("updateStatus"),Zc=Symbol("loadedTime"),co=Symbol("updateSource"),lT=Symbol("markLoaded"),iu=Symbol("container"),vi=Symbol("input"),kp=Symbol("canvas"),ne=Symbol("scene"),Wt=Symbol("needsRender"),Xn=Symbol("tick"),hi=Symbol("onModelLoad"),tu=Symbol("onResize"),ut=Symbol("renderer"),is=Symbol("progressTracker"),hT=Symbol("getLoaded"),rs=Symbol("getModelIsVisible"),dr=Symbol("shouldAttemptPreload"),os=i=>({x:i.x,y:i.y,z:i.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),fu=i=>({u:i.x,v:i.y,toString(){return`${this.u} ${this.v}`}}),wr=class extends $i{static get is(){return"model-viewer"}static set modelCacheSize(e){on[yr].evictionThreshold=e}static get modelCacheSize(){return on[yr].evictionThreshold}static set minimumRenderScale(e){e>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),e<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),Ei.singleton.minScale=e}static get minimumRenderScale(){return Ei.singleton.minScale}get loaded(){return this[hT]()}get[(XM=ao,YM=pl,jM=Zc,JM=Ky,ZM=fl,eT=Wy,tT=vu,nT=nm,iT=im,sT=is,ut)](){return Ei.singleton}get modelIsVisible(){return this[rs]()}constructor(){super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[XM]=!1,this[YM]=!1,this[jM]=0,this[JM]="",this[ZM]=null,this[eT]=Pg(()=>{let s=this.getBoundingClientRect();this[ya](s)},fk),this[tT]=Pg(s=>{let r=this.modelIsVisible;r!==s&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:r}}))},pk),this[nT]=null,this[iT]=null,this[sT]=new tm,this[rT]=()=>{this[_u].textContent=this[Ky]},this[oT]=()=>{this[_u].textContent=""},this[aT]=s=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:s.sourceEvent}}))},this.attachShadow({mode:"open"});let e=this.shadowRoot;yS(e),this[iu]=e.querySelector(".container"),this[vi]=e.querySelector(".userInput"),this[kp]=e.querySelector("canvas"),this[_u]=e.querySelector("#status"),this[cT]=this[vi].getAttribute("aria-label");let t,n;if(this.isConnected){let s=this.getBoundingClientRect();t=s.width,n=s.height}else t=mk,n=Ak;this[ne]=new em({canvas:this[kp],element:this,width:t,height:n}),Promise.resolve().then(()=>{this[ya](this.getBoundingClientRect())}),Xf&&(this[nm]=new ResizeObserver(s=>{if(!this[ut].isPresenting)for(let r of s)r.target===this&&this[ya](r.contentRect)})),Yf?this[im]=new IntersectionObserver(s=>{for(let r of s)if(r.target===this){let o=this.modelIsVisible;this[ao]=r.isIntersecting,this[vu](o),this[ao]&&!this.loaded&&this[co]()}},{root:null,rootMargin:"0px",threshold:1e-5}):this[ao]=!0}connectedCallback(){super.connectedCallback&&super.connectedCallback(),Xf?this[nm].observe(this):self.addEventListener("resize",this[Wy]),Yf&&this[im].observe(this),this.addEventListener("focus",this[$y]),this.addEventListener("blur",this[Xy]);let e=this[ut];e.addEventListener("contextlost",this[qy]),e.registerScene(this[ne]),this[fl]!=null&&(self.clearTimeout(this[fl]),this[fl]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),Xf?this[nm].unobserve(this):self.removeEventListener("resize",this[Wy]),Yf&&this[im].unobserve(this),this.removeEventListener("focus",this[$y]),this.removeEventListener("blur",this[Xy]);let e=this[ut];e.removeEventListener("contextlost",this[qy]),e.unregisterScene(this[ne]),this[fl]=self.setTimeout(()=>{this[ne].dispose(),this[fl]=null},dk)}updated(e){super.updated(e),e.has("src")&&(this.src==null?(this[pl]=!1,this[Zc]=0,this[ne].reset()):this.src!==this[ne].url&&(this[pl]=!1,this[Zc]=0,this[co]())),e.has("alt")&&this[vi].setAttribute("aria-label",this[ga]),e.has("generateSchema")&&(this.generateSchema?this[ne].updateSchema(this.src):this[ne].updateSchema(null))}toDataURL(e,t){return this[ut].displayCanvas(this[ne]).toDataURL(e,t)}async toBlob(e){let t=e?e.mimeType:void 0,n=e?e.qualityArgument:void 0,s=e?e.idealAspect:void 0,{width:r,height:o,idealAspect:a,aspect:c}=this[ne],{dpr:l,scaleFactor:h}=this[ut],u=r*h*l,d=o*h*l,f=0,p=0;if(s===!0)if(a>c){let g=d;d=Math.round(u/a),p=(g-d)/2}else{let g=u;u=Math.round(d*a),f=(g-u)/2}_r.width=u,_r.height=d;try{return new Promise(async(g,A)=>{_r.getContext("2d").drawImage(this[ut].displayCanvas(this[ne]),f,p,u,d,0,0,u,d),_r.toBlob(m=>{if(!m)return A(new Error("Unable to retrieve canvas blob"));g(m)},t,n)})}finally{this[ya]({width:r,height:o})}}registerEffectComposer(e){e.setRenderer(this[ut].threeRenderer),e.setMainCamera(this[ne].getCamera()),e.setMainScene(this[ne]),this[ne].effectRenderer=e}unregisterEffectComposer(){this[ne].effectRenderer=null}registerRenderer(e){this[ne].externalRenderer=e}unregisterRenderer(){this[ne].externalRenderer=null}get[ga](){return this[sm]}get[sm](){return this.alt==null||this.alt==="null"?this[cT]:this.alt}[hT](){return this[pl]}[rs](){return this.loaded&&this[ao]}[dr](){return!!this.src&&this[ao]}[ya]({width:e,height:t}){e===0||t===0||(this[iu].style.width=`${e}px`,this[iu].style.height=`${t}px`,this[tu]({width:e,height:t}))}[Xn](e,t){var n;(n=this[ne].effectRenderer)===null||n===void 0||n.beforeRender(e,t)}[lT](){this[pl]||(this[pl]=!0,this[Zc]=performance.now())}[Wt](){this[ne].queueRender()}[hi](){}[eu](e){this[Ky]=e;let t=this.getRootNode();t!=null&&t.activeElement===this&&this[_u].textContent!=e&&(this[_u].textContent=e)}[(rT=$y,oT=Xy,tu)](e){this[ne].setSize(e.width,e.height)}async[(aT=qy,co)](){let e=this[ne];if(this.loaded||!this[dr]()||this.src===e.url)return;this.generateSchema&&e.updateSchema(this.src),this[eu]("Loading"),e.stopAnimation();let t=this[is].beginActivity("model-load"),n=this.src;try{let s=e.setSource(n,o=>t(Nn(o,0,1)*.95)),r=this[Qc]();await Promise.all([s,r]),this[lT](),this[hi](),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("before-render"))}),await new Promise(o=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("load",{detail:{url:n}})),o()})})})}catch(s){this.dispatchEvent(new CustomEvent("error",{detail:{type:"loadfailure",sourceError:s}}))}finally{t(1)}}};rm([Be({type:String})],wr.prototype,"alt",void 0);rm([Be({type:String})],wr.prototype,"src",void 0);rm([Be({type:Boolean,attribute:"with-credentials"})],wr.prototype,"withCredentials",void 0);rm([Be({type:Boolean,attribute:"generate-schema"})],wr.prototype,"generateSchema",void 0)});var Yy,uT,om,dT,fT,Si,gk,yk,bk,pT,mT=oe(()=>{Vs();Xe();ai();Yy=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},uT=1e3,om=Symbol("changeAnimation"),dT=Symbol("appendAnimation"),fT=Symbol("detachAnimation"),Si=Symbol("paused"),gk={repetitions:1/0,pingpong:!1},yk={pingpong:!1,repetitions:null,weight:1,timeScale:1,fade:!1,warp:!1,relativeWarp:!0,time:null},bk={fade:!0},pT=i=>{var e;class t extends i{constructor(...s){super(s),this.autoplay=!1,this.animationName=void 0,this.animationCrossfadeDuration=300,this[e]=!0,this[ne].subscribeMixerEvent("loop",r=>{let o=r.action._loopCount,a=r.action._clip.name,c=r.action._clip.uuid,l=this[ne].markedAnimations.find(h=>h.name===a);if(l){this[ne].updateAnimationLoop(l.name,l.loopMode,l.repetitionCount);let h=this[ne].markedAnimations.filter(u=>u.name!==a);this[ne].markedAnimations=h}this.dispatchEvent(new CustomEvent("loop",{detail:{count:o,name:a,uuid:c}}))}),this[ne].subscribeMixerEvent("finished",r=>{if(!this[ne].appendedAnimations.includes(r.action._clip.name))this[Si]=!0;else{let o=this[ne].appendedAnimations.filter(a=>a!==r.action._clip.name);this[ne].appendedAnimations=o}this.dispatchEvent(new CustomEvent("finished"))})}get availableAnimations(){return this.loaded?this[ne].animationNames:[]}get duration(){return this[ne].duration}get paused(){return this[Si]}get currentTime(){return this[ne].animationTime}get appendedAnimations(){return this[ne].appendedAnimations}set currentTime(s){this[ne].animationTime=s,this[Wt]()}get timeScale(){return this[ne].animationTimeScale}set timeScale(s){this[ne].animationTimeScale=s}pause(){this[Si]||(this[Si]=!0,this.dispatchEvent(new CustomEvent("pause")))}play(s){this.availableAnimations.length>0&&(this[Si]=!1,this[om](s),this.dispatchEvent(new CustomEvent("play")))}appendAnimation(s,r){this.availableAnimations.length>0&&(this[Si]=!1,this[dT](s,r),this.dispatchEvent(new CustomEvent("append-animation")))}detachAnimation(s,r){this.availableAnimations.length>0&&(this[Si]=!1,this[fT](s,r),this.dispatchEvent(new CustomEvent("detach-animation")))}[(e=Si,hi)](){super[hi](),this[Si]=!0,this.animationName!=null&&this[om](),this.autoplay&&this.play()}[Xn](s,r){super[Xn](s,r),!(this[Si]||!this[rs]()&&!this[ut].isPresenting)&&(this[ne].updateAnimation(r/uT),this[Wt]())}updated(s){super.updated(s),s.has("autoplay")&&this.autoplay&&this.play(),s.has("animationName")&&this[om]()}[om](s=gk){var r;let o=(r=s.repetitions)!==null&&r!==void 0?r:1/0,a=s.pingpong?Zo:o===1?jr:ur;this[ne].playAnimation(this.animationName,this.animationCrossfadeDuration/uT,a,o),this[Si]&&(this[ne].updateAnimation(0),this[Wt]())}[dT](s="",r=yk){var o;let a=(o=r.repetitions)!==null&&o!==void 0?o:1/0,c=r.pingpong?Zo:a===1?jr:ur,l=!!r.repetitions||"pingpong"in r;this[ne].appendAnimation(s||this.animationName,c,a,r.weight,r.timeScale,r.fade,r.warp,r.relativeWarp,r.time,l),this[Si]&&(this[ne].updateAnimation(0),this[Wt]())}[fT](s="",r=bk){this[ne].detachAnimation(s||this.animationName,r.fade),this[Si]&&(this[ne].updateAnimation(0),this[Wt]())}}return Yy([Be({type:Boolean})],t.prototype,"autoplay",void 0),Yy([Be({type:String,attribute:"animation-name"})],t.prototype,"animationName",void 0),Yy([Be({type:Number,attribute:"animation-crossfade-duration"})],t.prototype,"animationCrossfadeDuration",void 0),t}});var va,jy,Eu,Jy,AT,Zy,gT,yT=oe(()=>{Xe();ai();Gy();va=Symbol("hotspotMap"),jy=Symbol("mutationCallback"),Eu=Symbol("observer"),Jy=Symbol("addHotspot"),AT=Symbol("removeHotspot"),Zy=new Oe,gT=i=>{var e,t,n;class s extends i{constructor(){super(...arguments),this[e]=new Map,this[t]=o=>{o.forEach(a=>{(!(a instanceof MutationRecord)||a.type==="childList")&&(a.addedNodes.forEach(c=>{this[Jy](c)}),a.removedNodes.forEach(c=>{this[AT](c)}),this[Wt]())})},this[n]=new MutationObserver(this[jy])}connectedCallback(){super.connectedCallback();for(let a=0;a<this.children.length;++a)this[Jy](this.children[a]);let{ShadyDOM:o}=self;o==null?this[Eu].observe(this,{childList:!0}):this[Eu]=o.observeChildren(this,this[jy])}disconnectedCallback(){super.disconnectedCallback();let{ShadyDOM:o}=self;o==null?this[Eu].disconnect():o.unobserveChildren(this[Eu])}[(e=va,t=jy,n=Eu,hi)](){super[hi]();let o=this[ne];o.forHotspots(a=>{o.updateSurfaceHotspot(a)})}[Xn](o,a){super[Xn](o,a);let c=this[ne],{annotationRenderer:l}=c,h=c.getCamera();c.shouldRender()&&(c.animateSurfaceHotspots(),c.updateHotspotsVisibility(h.position),l.domElement.style.display="",l.render(c,h))}updateHotspot(o){let a=this[va].get(o.name);a!=null&&(a.updatePosition(o.position),a.updateNormal(o.normal),a.surface=o.surface,this[ne].updateSurfaceHotspot(a),this[Wt]())}queryHotspot(o){let a=this[va].get(o);if(a==null)return null;let c=os(a.position),l=os(a.normal),h=a.facingCamera,u=this[ne],d=u.getCamera(),f=new D;f.setFromMatrixPosition(a.matrixWorld),f.project(d);let p=u.width/2,g=u.height/2;f.x=f.x*p+p,f.y=-(f.y*g)+g;let A=os(new D(f.x,f.y,f.z));return!Number.isFinite(A.x)||!Number.isFinite(A.y)?null:{position:c,normal:l,canvasPosition:A,facingCamera:h}}positionAndNormalFromPoint(o,a){let c=this[ne],l=c.getNDC(o,a),h=c.positionAndNormalFromPoint(l);if(h==null)return null;Zy.copy(c.target.matrixWorld).invert();let u=os(h.position.applyMatrix4(Zy)),d=os(h.normal.transformDirection(Zy)),f=null;return h.uv!=null&&(f=fu(h.uv)),{position:u,normal:d,uv:f}}surfaceFromPoint(o,a){let c=this[ne],l=c.getNDC(o,a);return c.surfaceFromPoint(l)}[Jy](o){if(!(o instanceof HTMLElement&&o.slot.indexOf("hotspot")===0))return;let a=this[va].get(o.slot);a!=null?a.increment():(a=new dl({name:o.slot,position:o.dataset.position,normal:o.dataset.normal,surface:o.dataset.surface}),this[va].set(o.slot,a),this[ne].addHotspot(a)),this[ne].queueRender()}[AT](o){if(!(o instanceof HTMLElement))return;let a=this[va].get(o.slot);a&&(a.decrement()&&(this[ne].removeHotspot(a),this[va].delete(o.slot)),this[ne].queueRender())}}return s}});function Ik(i,e){return Tk(i,e||{},0,0)}function Mu(i,e){if(e){for(var t=new Cn(i.length),n=0;n<i.length;++n)t[n]=i.charCodeAt(n);return t}if(ET)return ET.encode(i);for(var s=i.length,r=new Cn(i.length+(i.length>>1)),o=0,a=function(h){r[o++]=h},n=0;n<s;++n){if(o+5>r.length){var c=new Cn(o+8+(s-n<<1));c.set(r),r=c}var l=i.charCodeAt(n);l<128||e?a(l):l<2048?(a(192|l>>6),a(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|i.charCodeAt(++n)&1023,a(240|l>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|l&63)):(a(224|l>>12),a(128|l>>6&63),a(128|l&63))}return IT(r,0,o)}function PT(i,e){e||(e={});var t={},n=[];LT(i,"",t,e);var s=0,r=0;for(var o in t){var a=t[o],c=a[0],l=a[1],h=l.level==0?0:8,u=Mu(o),d=u.length,f=l.comment,p=f&&Mu(f),g=p&&p.length,A=sb(l.extra);d>65535&&cm(11);var m=h?Ik(c,l):c,b=m.length,x=Mk();x.p(c),n.push(DT(l,{size:c.length,crc:x.d(),c:m,f:u,m:p,u:d!=o.length||p&&f.length!=g,o:s,compression:h})),s+=30+d+A+b,r+=76+2*(d+A)+(g||0)+b}for(var y=new Cn(r+22),_=s,S=r-s,C=0;C<n.length;++C){var u=n[C];ST(y,u.o,u,u.f,u.u,u.c.length);var w=30+u.f.length+sb(u.extra);y.set(u.c,u.o+w),ST(y,s,u,u.f,u.u,u.c.length,u.o,u.m),s+=16+w+(u.m?u.m.length:0)}return Dk(y,s,n.length,S,_),y}var Cn,wi,rb,ob,ab,bT,wT,CT,xk,tb,MT,Lq,xT,nb,Cr,wt,Cu,Ea,wt,wt,wt,wt,am,wt,_k,vk,TT,IT,Ek,cm,Mr,Su,eb,ib,_T,wu,RT,vT,Sk,BT,wk,Ck,Mk,Tk,DT,wn,LT,ET,Rk,Bk,sb,ST,Dk,FT=oe(()=>{Cn=Uint8Array,wi=Uint16Array,rb=Int32Array,ob=new Cn([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,0,0,0]),ab=new Cn([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,0,0]),bT=new Cn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wT=function(i,e){for(var t=new wi(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var s=new rb(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)s[r]=r-t[n]<<5|n;return{b:t,r:s}},CT=wT(ob,2),xk=CT.b,tb=CT.r;xk[28]=258,tb[258]=28;MT=wT(ab,0),Lq=MT.b,xT=MT.r,nb=new wi(32768);for(wt=0;wt<32768;++wt)Cr=(wt&43690)>>1|(wt&21845)<<1,Cr=(Cr&52428)>>2|(Cr&13107)<<2,Cr=(Cr&61680)>>4|(Cr&3855)<<4,nb[wt]=((Cr&65280)>>8|(Cr&255)<<8)>>1;Cu=(function(i,e,t){for(var n=i.length,s=0,r=new wi(e);s<n;++s)i[s]&&++r[i[s]-1];var o=new wi(e);for(s=1;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;var a;if(t){a=new wi(1<<e);var c=15-e;for(s=0;s<n;++s)if(i[s])for(var l=s<<4|i[s],h=e-i[s],u=o[i[s]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)a[nb[u]>>c]=l}else for(a=new wi(n),s=0;s<n;++s)i[s]&&(a[s]=nb[o[i[s]-1]++]>>15-i[s]);return a}),Ea=new Cn(288);for(wt=0;wt<144;++wt)Ea[wt]=8;for(wt=144;wt<256;++wt)Ea[wt]=9;for(wt=256;wt<280;++wt)Ea[wt]=7;for(wt=280;wt<288;++wt)Ea[wt]=8;am=new Cn(32);for(wt=0;wt<32;++wt)am[wt]=5;_k=Cu(Ea,9,0),vk=Cu(am,5,0),TT=function(i){return(i+7)/8|0},IT=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new Cn(i.subarray(e,t))},Ek=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],cm=function(i,e,t){var n=new Error(e||Ek[i]);if(n.code=i,Error.captureStackTrace&&Error.captureStackTrace(n,cm),!t)throw n;return n},Mr=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},Su=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},eb=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var s=t.length,r=t.slice();if(!s)return{t:BT,l:0};if(s==1){var o=new Cn(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(_,S){return _.f-S.f}),t.push({s:-1,f:25001});var a=t[0],c=t[1],l=0,h=1,u=2;for(t[0]={s:-1,f:a.f+c.f,l:a,r:c};h!=s-1;)a=t[t[l].f<t[u].f?l++:u++],c=t[l!=h&&t[l].f<t[u].f?l++:u++],t[h++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=r[0].s,n=1;n<s;++n)r[n].s>d&&(d=r[n].s);var f=new wi(d+1),p=ib(t[h-1],f,0);if(p>e){var n=0,g=0,A=p-e,m=1<<A;for(r.sort(function(S,C){return f[C.s]-f[S.s]||S.f-C.f});n<s;++n){var b=r[n].s;if(f[b]>e)g+=m-(1<<p-f[b]),f[b]=e;else break}for(g>>=A;g>0;){var x=r[n].s;f[x]<e?g-=1<<e-f[x]++-1:++n}for(;n>=0&&g;--n){var y=r[n].s;f[y]==e&&(--f[y],++g)}p=e}return{t:new Cn(f),l:p}},ib=function(i,e,t){return i.s==-1?Math.max(ib(i.l,e,t+1),ib(i.r,e,t+1)):e[i.s]=t},_T=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new wi(++e),n=0,s=i[0],r=1,o=function(c){t[n++]=c},a=1;a<=e;++a)if(i[a]==s&&a!=e)++r;else{if(!s&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(s),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(s);r=1,s=i[a]}return{c:t.subarray(0,n),n:e}},wu=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},RT=function(i,e,t){var n=t.length,s=TT(e+2);i[s]=n&255,i[s+1]=n>>8,i[s+2]=i[s]^255,i[s+3]=i[s+1]^255;for(var r=0;r<n;++r)i[s+r+4]=t[r];return(s+4+n)*8},vT=function(i,e,t,n,s,r,o,a,c,l,h){Mr(e,h++,t),++s[256];for(var u=eb(s,15),d=u.t,f=u.l,p=eb(r,15),g=p.t,A=p.l,m=_T(d),b=m.c,x=m.n,y=_T(g),_=y.c,S=y.n,C=new wi(19),w=0;w<b.length;++w)++C[b[w]&31];for(var w=0;w<_.length;++w)++C[_[w]&31];for(var v=eb(C,7),E=v.t,R=v.l,F=19;F>4&&!E[bT[F-1]];--F);var P=l+5<<3,U=wu(s,Ea)+wu(r,am)+o,V=wu(s,d)+wu(r,g)+o+14+3*F+wu(C,E)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&P<=U&&P<=V)return RT(e,h,i.subarray(c,c+l));var O,K,z,ee;if(Mr(e,h,1+(V<U)),h+=2,V<U){O=Cu(d,f,0),K=d,z=Cu(g,A,0),ee=g;var ae=Cu(E,R,0);Mr(e,h,x-257),Mr(e,h+5,S-1),Mr(e,h+10,F-4),h+=14;for(var w=0;w<F;++w)Mr(e,h+3*w,E[bT[w]]);h+=3*F;for(var he=[b,_],ve=0;ve<2;++ve)for(var Le=he[ve],w=0;w<Le.length;++w){var X=Le[w]&31;Mr(e,h,ae[X]),h+=E[X],X>15&&(Mr(e,h,Le[w]>>5&127),h+=Le[w]>>12)}}else O=_k,K=Ea,z=vk,ee=am;for(var w=0;w<a;++w){var se=n[w];if(se>255){var X=se>>18&31;Su(e,h,O[X+257]),h+=K[X+257],X>7&&(Mr(e,h,se>>23&31),h+=ob[X]);var le=se&31;Su(e,h,z[le]),h+=ee[le],le>3&&(Su(e,h,se>>5&8191),h+=ab[le])}else Su(e,h,O[se]),h+=K[se]}return Su(e,h,O[256]),h+K[256]},Sk=new rb([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),BT=new Cn(0),wk=function(i,e,t,n,s,r){var o=r.z||i.length,a=new Cn(n+o+5*(1+Math.ceil(o/7e3))+s),c=a.subarray(n,a.length-s),l=r.l,h=(r.r||0)&7;if(e){h&&(c[0]=r.r>>3);for(var u=Sk[e-1],d=u>>13,f=u&8191,p=(1<<t)-1,g=r.p||new wi(32768),A=r.h||new wi(p+1),m=Math.ceil(t/3),b=2*m,x=function(L){return(i[L]^i[L+1]<<m^i[L+2]<<b)&p},y=new rb(25e3),_=new wi(288),S=new wi(32),C=0,w=0,v=r.i||0,E=0,R=r.w||0,F=0;v+2<o;++v){var P=x(v),U=v&32767,V=A[P];if(g[U]=V,A[P]=U,R<=v){var O=o-v;if((C>7e3||E>24576)&&(O>423||!l)){h=vT(i,c,0,y,_,S,w,E,F,v-F,h),E=C=w=0,F=v;for(var K=0;K<286;++K)_[K]=0;for(var K=0;K<30;++K)S[K]=0}var z=2,ee=0,ae=f,he=U-V&32767;if(O>2&&P==x(v-he))for(var ve=Math.min(d,O)-1,Le=Math.min(32767,v),X=Math.min(258,O);he<=Le&&--ae&&U!=V;){if(i[v+z]==i[v+z-he]){for(var se=0;se<X&&i[v+se]==i[v+se-he];++se);if(se>z){if(z=se,ee=he,se>ve)break;for(var le=Math.min(he,se-2),pe=0,K=0;K<le;++K){var ye=v-he+K&32767,Ue=g[ye],Me=ye-Ue&32767;Me>pe&&(pe=Me,V=ye)}}}U=V,V=g[U],he+=U-V&32767}if(ee){y[E++]=268435456|tb[z]<<18|xT[ee];var xt=tb[z]&31,$e=xT[ee]&31;w+=ob[xt]+ab[$e],++_[257+xt],++S[$e],R=v+z,++C}else y[E++]=i[v],++_[i[v]]}}for(v=Math.max(v,R);v<o;++v)y[E++]=i[v],++_[i[v]];h=vT(i,c,l,y,_,S,w,E,F,v-F,h),l||(r.r=h&7|c[h/8|0]<<3,h-=7,r.h=A,r.p=g,r.i=v,r.w=R)}else{for(var v=r.w||0;v<o+l;v+=65535){var pt=v+65535;pt>=o&&(c[h/8|0]=l,pt=o),h=RT(c,h+1,i.subarray(v,pt))}r.i=o}return IT(a,0,n+TT(h)+s)},Ck=(function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i})(),Mk=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Ck[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},Tk=function(i,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Cn(r.length+i.length);o.set(r),o.set(i,r.length),i=o,s.w=r.length}return wk(i,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,s)},DT=function(i,e){var t={};for(var n in i)t[n]=i[n];for(var n in e)t[n]=e[n];return t},wn=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8};LT=function(i,e,t,n){for(var s in i){var r=i[s],o=e+s,a=n;Array.isArray(r)&&(a=DT(n,r[1]),r=r[0]),r instanceof Cn?t[o]=[r,a]:(t[o+="/"]=[new Cn(0),a],LT(r,o,t,n))}},ET=typeof TextEncoder<"u"&&new TextEncoder,Rk=typeof TextDecoder<"u"&&new TextDecoder,Bk=0;try{Rk.decode(BT,{stream:!0}),Bk=1}catch{}sb=function(i){var e=0;if(i)for(var t in i){var n=i[t].length;n>65535&&cm(9),e+=n+4}return e},ST=function(i,e,t,n,s,r,o,a){var c=n.length,l=t.extra,h=a&&a.length,u=sb(l);wn(i,e,o!=null?33639248:67324752),e+=4,o!=null&&(i[e++]=20,i[e++]=t.os),i[e]=20,e+=2,i[e++]=t.flag<<1|(r<0&&8),i[e++]=s&&8,i[e++]=t.compression&255,i[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),f=d.getFullYear()-1980;if((f<0||f>119)&&cm(10),wn(i,e,f<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,r!=-1&&(wn(i,e,t.crc),wn(i,e+4,r<0?-r-2:r),wn(i,e+8,t.size)),wn(i,e+12,c),wn(i,e+14,u),e+=16,o!=null&&(wn(i,e,h),wn(i,e+6,t.attrs),wn(i,e+10,o),e+=14),i.set(n,e),e+=c,u)for(var p in l){var g=l[p],A=g.length;wn(i,e,+p),wn(i,e+2,A),i.set(g,e+4),e+=4+A}return h&&(i.set(a,e),e+=h),e},Dk=function(i,e,t,n,s){wn(i,e,101010256),wn(i,e+8,t),wn(i,e+10,t),wn(i,e+12,n),wn(i,e+16,s)}});function Lk(i,e,t){if(typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&i instanceof ImageBitmap){let n=t/Math.max(i.width,i.height),s=document.createElement("canvas");s.width=i.width*Math.min(1,n),s.height=i.height*Math.min(1,n);let r=s.getContext("2d");return e===!0&&(r.translate(0,s.height),r.scale(1,-1)),r.drawImage(i,0,0,s.width,s.height),s}else throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}function UT(){return`#usda 1.0
(
	customLayerData = {
		string creator = "Three.js USDZExporter"
	}
	defaultPrim = "Root"
	metersPerUnit = 1
	upAxis = "Y"
)

`}function Pk(i){return`def Xform "Root"
{
	def Scope "Scenes" (
		kind = "sceneLibrary"
	)
	{
		def Xform "Scene" (
			customData = {
				bool preliminary_collidesWithEnvironment = 0
				string sceneName = "Scene"
			}
			sceneName = "Scene"
		)
		{${i.includeAnchoringProperties===!0?`
		token preliminary:anchoring:type = "${i.ar.anchoring.type}"
		token preliminary:planeAnchoring:alignment = "${i.ar.planeAnchoring.alignment}"
	`:""}
`}function Fk(){return`
		}
	}
}

`}function Ok(i){let e=UT();return e+=i,Mu(e)}function Nk(i,e,t){let n="Object_"+i.id,s=kT(i.matrixWorld);return i.matrixWorld.determinant()<0&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",i),`def Xform "${n}" (
	prepend references = @./geometries/Geometry_${e.id}.usda@</Geometry>
	prepend apiSchemas = ["MaterialBindingAPI"]
)
{
	matrix4d xformOp:transform = ${s}
	uniform token[] xformOpOrder = ["xformOp:transform"]

	rel material:binding = </Materials/Material_${t.id}>
}

`}function kT(i){let e=i.elements;return`( ${lm(e,0)}, ${lm(e,4)}, ${lm(e,8)}, ${lm(e,12)} )`}function lm(i,e){return`(${i[e+0]}, ${i[e+1]}, ${i[e+2]}, ${i[e+3]})`}function Uk(i){return`
def "Geometry"
{
${kk(i)}
}
`}function kk(i){let e="Geometry",t=i.attributes,n=t.position.count;return`
	def Mesh "${e}"
	{
		int[] faceVertexCounts = [${Gk(i)}]
		int[] faceVertexIndices = [${Qk(i)}]
		normal3f[] normals = [${cb(t.normal,n)}] (
			interpolation = "vertex"
		)
		point3f[] points = [${cb(t.position,n)}]
${Hk(t)}
		uniform token subdivisionScheme = "none"
	}
`}function Gk(i){let e=i.index!==null?i.index.count:i.attributes.position.count;return Array(e/3).fill(3).join(", ")}function Qk(i){let e=i.index,t=[];if(e!==null)for(let n=0;n<e.count;n++)t.push(e.getX(n));else{let n=i.attributes.position.count;for(let s=0;s<n;s++)t.push(s)}return t.join(", ")}function cb(i,e){if(i===void 0)return console.warn("USDZExporter: Normals missing."),Array(e).fill("(0, 0, 0)").join(", ");let t=[];for(let n=0;n<i.count;n++){let s=i.getX(n),r=i.getY(n),o=i.getZ(n);t.push(`(${s.toPrecision(Gn)}, ${r.toPrecision(Gn)}, ${o.toPrecision(Gn)})`)}return t.join(", ")}function zk(i){let e=[];for(let t=0;t<i.count;t++){let n=i.getX(t),s=i.getY(t);e.push(`(${n.toPrecision(Gn)}, ${1-s.toPrecision(Gn)})`)}return e.join(", ")}function Hk(i){let e="";for(let n=0;n<4;n++){let s=n>0?n:"",r=i["uv"+s];r!==void 0&&(e+=`
		texCoord2f[] primvars:st${s} = [${zk(r)}] (
			interpolation = "vertex"
		)`)}let t=i.color;if(t!==void 0){let n=t.count;e+=`
	color3f[] primvars:displayColor = [${cb(t,n)}] (
		interpolation = "vertex"
		)`}return e}function Vk(i,e,t=!1){let n=[];for(let s in i){let r=i[s];n.push(Wk(r,e,t))}return`def "Materials"
{
${n.join("")}
}

`}function Wk(i,e,t=!1){let s=[],r=[];function o(a,c,l){let h=a.source.id+"_"+a.flipY;e[h]=a;let u=a.channel>0?"st"+a.channel:"st",d={1e3:"repeat",1001:"clamp",1002:"mirror"},f=a.repeat.clone(),p=a.offset.clone(),g=a.rotation,A=Math.sin(g),m=Math.cos(g);return p.y=1-p.y-f.y,t?(p.x=p.x/f.x,p.y=p.y/f.y,p.x+=A/f.x,p.y+=m-1):(p.x+=A*f.x,p.y+=(1-m)*f.y),`
		def Shader "PrimvarReader_${c}"
		{
			uniform token info:id = "UsdPrimvarReader_float2"
			float2 inputs:fallback = (0.0, 0.0)
			token inputs:varname = "${u}"
			float2 outputs:result
		}

		def Shader "Transform2d_${c}"
		{
			uniform token info:id = "UsdTransform2d"
			token inputs:in.connect = </Materials/Material_${i.id}/PrimvarReader_${c}.outputs:result>
			float inputs:rotation = ${(g*(180/Math.PI)).toFixed(Gn)}
			float2 inputs:scale = ${NT(f)}
			float2 inputs:translation = ${NT(p)}
			float2 outputs:result
		}

		def Shader "Texture_${a.id}_${c}"
		{
			uniform token info:id = "UsdUVTexture"
			asset inputs:file = @textures/Texture_${h}.png@
			float2 inputs:st.connect = </Materials/Material_${i.id}/Transform2d_${c}.outputs:result>
			${l!==void 0?"float4 inputs:scale = "+qk(l):""}
			token inputs:sourceColorSpace = "${a.colorSpace===Fn?"raw":"sRGB"}"
			token inputs:wrapS = "${d[a.wrapS]}"
			token inputs:wrapT = "${d[a.wrapT]}"
			float outputs:r
			float outputs:g
			float outputs:b
			float3 outputs:rgb
			${i.transparent||i.alphaTest>0?"float outputs:a":""}
		}`}return i.side===Ut&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",i),i.map!==null?(s.push(`			color3f inputs:diffuseColor.connect = </Materials/Material_${i.id}/Texture_${i.map.id}_diffuse.outputs:rgb>`),i.transparent?s.push(`			float inputs:opacity.connect = </Materials/Material_${i.id}/Texture_${i.map.id}_diffuse.outputs:a>`):i.alphaTest>0&&(s.push(`			float inputs:opacity.connect = </Materials/Material_${i.id}/Texture_${i.map.id}_diffuse.outputs:a>`),s.push(`			float inputs:opacityThreshold = ${i.alphaTest}`)),r.push(o(i.map,"diffuse",i.color))):s.push(`			color3f inputs:diffuseColor = ${OT(i.color)}`),i.emissiveMap!==null?(s.push(`			color3f inputs:emissiveColor.connect = </Materials/Material_${i.id}/Texture_${i.emissiveMap.id}_emissive.outputs:rgb>`),r.push(o(i.emissiveMap,"emissive",new Ce(i.emissive.r*i.emissiveIntensity,i.emissive.g*i.emissiveIntensity,i.emissive.b*i.emissiveIntensity)))):i.emissive.getHex()>0&&s.push(`			color3f inputs:emissiveColor = ${OT(i.emissive)}`),i.normalMap!==null&&(s.push(`			normal3f inputs:normal.connect = </Materials/Material_${i.id}/Texture_${i.normalMap.id}_normal.outputs:rgb>`),r.push(o(i.normalMap,"normal"))),i.aoMap!==null&&(s.push(`			float inputs:occlusion.connect = </Materials/Material_${i.id}/Texture_${i.aoMap.id}_occlusion.outputs:r>`),r.push(o(i.aoMap,"occlusion",new Ce(i.aoMapIntensity,i.aoMapIntensity,i.aoMapIntensity)))),i.roughnessMap!==null?(s.push(`			float inputs:roughness.connect = </Materials/Material_${i.id}/Texture_${i.roughnessMap.id}_roughness.outputs:g>`),r.push(o(i.roughnessMap,"roughness",new Ce(i.roughness,i.roughness,i.roughness)))):s.push(`			float inputs:roughness = ${i.roughness}`),i.metalnessMap!==null?(s.push(`			float inputs:metallic.connect = </Materials/Material_${i.id}/Texture_${i.metalnessMap.id}_metallic.outputs:b>`),r.push(o(i.metalnessMap,"metallic",new Ce(i.metalness,i.metalness,i.metalness)))):s.push(`			float inputs:metallic = ${i.metalness}`),i.alphaMap!==null?(s.push(`			float inputs:opacity.connect = </Materials/Material_${i.id}/Texture_${i.alphaMap.id}_opacity.outputs:r>`),s.push("			float inputs:opacityThreshold = 0.0001"),r.push(o(i.alphaMap,"opacity"))):s.push(`			float inputs:opacity = ${i.opacity}`),i.isMeshPhysicalMaterial&&(i.clearcoatMap!==null?(s.push(`			float inputs:clearcoat.connect = </Materials/Material_${i.id}/Texture_${i.clearcoatMap.id}_clearcoat.outputs:r>`),r.push(o(i.clearcoatMap,"clearcoat",new Ce(i.clearcoat,i.clearcoat,i.clearcoat)))):s.push(`			float inputs:clearcoat = ${i.clearcoat}`),i.clearcoatRoughnessMap!==null?(s.push(`			float inputs:clearcoatRoughness.connect = </Materials/Material_${i.id}/Texture_${i.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`),r.push(o(i.clearcoatRoughnessMap,"clearcoatRoughness",new Ce(i.clearcoatRoughness,i.clearcoatRoughness,i.clearcoatRoughness)))):s.push(`			float inputs:clearcoatRoughness = ${i.clearcoatRoughness}`),s.push(`			float inputs:ior = ${i.ior}`)),`
	def Material "Material_${i.id}"
	{
		def Shader "PreviewSurface"
		{
			uniform token info:id = "UsdPreviewSurface"
${s.join(`
`)}
			int inputs:useSpecularWorkflow = 0
			token outputs:surface
		}

		token outputs:surface.connect = </Materials/Material_${i.id}/PreviewSurface.outputs:surface>

${r.join(`
`)}

	}
`}function OT(i){return`(${i.r}, ${i.g}, ${i.b})`}function qk(i){return`(${i.r}, ${i.g}, ${i.b}, 1.0)`}function NT(i){return`(${i.x}, ${i.y})`}function Kk(i){let e=i.name?i.name:"Camera_"+i.id,t=kT(i.matrixWorld);return i.matrixWorld.determinant()<0&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",i),i.isOrthographicCamera?`def Camera "${e}"
		{
			matrix4d xformOp:transform = ${t}
			uniform token[] xformOpOrder = ["xformOp:transform"]

			float2 clippingRange = (${i.near.toPrecision(Gn)}, ${i.far.toPrecision(Gn)})
			float horizontalAperture = ${((Math.abs(i.left)+Math.abs(i.right))*10).toPrecision(Gn)}
			float verticalAperture = ${((Math.abs(i.top)+Math.abs(i.bottom))*10).toPrecision(Gn)}
			token projection = "orthographic"
		}
	
	`:`def Camera "${e}"
		{
			matrix4d xformOp:transform = ${t}
			uniform token[] xformOpOrder = ["xformOp:transform"]

			float2 clippingRange = (${i.near.toPrecision(Gn)}, ${i.far.toPrecision(Gn)})
			float focalLength = ${i.getFocalLength().toPrecision(Gn)}
			float focusDistance = ${i.focus.toPrecision(Gn)}
			float horizontalAperture = ${i.getFilmWidth().toPrecision(Gn)}
			token projection = "perspective"
			float verticalAperture = ${i.getFilmHeight().toPrecision(Gn)}
		}
	
	`}var hm,Gn,GT=oe(()=>{Xe();FT();hm=class{constructor(){this.textureUtils=null}setTextureUtils(e){this.textureUtils=e}parse(e,t,n,s){this.parseAsync(e,s).then(t).catch(n)}async parseAsync(e,t={}){t=Object.assign({ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}},includeAnchoringProperties:!0,quickLookCompatible:!1,maxTextureSize:1024},t);let n={},s="model.usda";n[s]=null;let r=UT();r+=Pk(t);let o={},a={};e.traverseVisible(l=>{if(l.isMesh){let h=l.geometry,u=l.material;if(u.isMeshStandardMaterial){let d="geometries/Geometry_"+h.id+".usda";if(!(d in n)){let f=Uk(h);n[d]=Ok(f)}u.uuid in o||(o[u.uuid]=u),r+=Nk(l,h,u)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",l)}else l.isCamera&&(r+=Kk(l))}),r+=Fk(),r+=Vk(o,a,t.quickLookCompatible),n[s]=Mu(r),r=null;for(let l in a){let h=a[l];if(h.isCompressedTexture===!0){if(this.textureUtils===null)throw new Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");h=await this.textureUtils.decompress(h)}let u=Lk(h.image,h.flipY,t.maxTextureSize),d=await new Promise(f=>u.toBlob(f,"image/png",1));n[`textures/Texture_${l}.png`]=new Uint8Array(await d.arrayBuffer())}let c=0;for(let l in n){let h=n[l],u=34+l.length;c+=u;let d=c&63;if(d!==4){let f=64-d,p=new Uint8Array(f);n[l]=[h,{extra:{12345:p}}]}c=h.length}return PT(n,{level:0})}};Gn=7});var QT,zT=oe(()=>{Bs();QT=i=>e=>{try{let t=ci(e),n=(t.length?t[0].terms:[]).filter(s=>s&&s.type==="ident").map(s=>s.value).filter(s=>i.indexOf(s)>-1);return new Set(n)}catch{}return new Set}});var Sa,HT,VT,WT,$k,Xk,ki,Tr,qT,KT,$T,Yk,um,lb,ml,dm,fm,hb,ub,db,Tu,fb,XT,YT=oe(()=>{Vs();GT();Jf();ai();zT();fy();ns();Sa=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},HT=!1,VT=!1,WT="#model-viewer-no-ar-fallback",$k=QT(["quick-look","scene-viewer","webxr","none"]),Xk="webxr scene-viewer quick-look",ki={QUICK_LOOK:"quick-look",SCENE_VIEWER:"scene-viewer",WEBXR:"webxr",NONE:"none"},Tr=Symbol("arButtonContainer"),qT=Symbol("enterARWithWebXR"),KT=Symbol("openSceneViewer"),$T=Symbol("openIOSARQuickLook"),Yk=Symbol("canActivateAR"),um=Symbol("arMode"),lb=Symbol("arModes"),ml=Symbol("arAnchor"),dm=Symbol("preload"),fm=Symbol("onARButtonContainerClick"),hb=Symbol("onARStatus"),ub=Symbol("onARTracking"),db=Symbol("onARTap"),Tu=Symbol("selectARMode"),fb=Symbol("triggerLoad"),XT=i=>{var e,t,n,s,r,o,a,c,l,h;class u extends i{constructor(){super(...arguments),this.ar=!1,this.arScale="auto",this.arUsdzMaxTextureSize="auto",this.arPlacement="floor",this.arModes=Xk,this.iosSrc=null,this.xrEnvironment=!1,this[e]=!1,this[t]=this.shadowRoot.querySelector(".ar-button"),this[n]=document.createElement("a"),this[s]=new Set,this[r]=ki.NONE,this[o]=!1,this[a]=f=>{f.preventDefault(),this.activateAR()},this[c]=({status:f})=>{(f===xr.NOT_PRESENTING||this[ut].arRenderer.presentedScene===this[ne])&&(this.setAttribute("ar-status",f),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:f}})),f===xr.NOT_PRESENTING?this.removeAttribute("ar-tracking"):f===xr.SESSION_STARTED&&this.setAttribute("ar-tracking",Ip.TRACKING))},this[l]=({status:f})=>{this.setAttribute("ar-tracking",f),this.dispatchEvent(new CustomEvent("ar-tracking",{detail:{status:f}}))},this[h]=f=>{f.data=="_apple_ar_quicklook_button_tapped"&&this.dispatchEvent(new CustomEvent("quick-look-button-tapped"))}}get canActivateAR(){return this[um]!==ki.NONE}connectedCallback(){super.connectedCallback(),this[ut].arRenderer.addEventListener("status",this[hb]),this.setAttribute("ar-status",xr.NOT_PRESENTING),this[ut].arRenderer.addEventListener("tracking",this[ub]),this[ml].addEventListener("message",this[db])}disconnectedCallback(){super.disconnectedCallback(),this[ut].arRenderer.removeEventListener("status",this[hb]),this[ut].arRenderer.removeEventListener("tracking",this[ub]),this[ml].removeEventListener("message",this[db])}update(f){super.update(f),f.has("arScale")&&(this[ne].canScale=this.arScale!=="fixed"),f.has("arPlacement")&&(this[ne].updateShadow(),this[Wt]()),f.has("arModes")&&(this[lb]=$k(this.arModes)),(f.has("ar")||f.has("arModes")||f.has("src")||f.has("iosSrc")||f.has("arUsdzMaxTextureSize"))&&this[Tu]()}async activateAR(){switch(this[um]){case ki.QUICK_LOOK:await this[$T]();break;case ki.WEBXR:await this[qT]();break;case ki.SCENE_VIEWER:this[KT]();break;default:console.warn("No AR Mode can be activated. This is probably due to missing configuration or device capabilities");break}}async[(e=Yk,t=Tr,n=ml,s=lb,r=um,o=dm,a=fm,c=hb,l=ub,h=db,Tu)](){var f;let p=ki.NONE;if(this.ar){if(this.src!=null)for(let g of this[lb]){if(g==="webxr"&&jf&&!HT&&await this[ut].arRenderer.supportsPresentation()){p=ki.WEBXR;break}if(g==="scene-viewer"&&!VT&&(aS||navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues&&(!((f=(await navigator.userAgentData.getHighEntropyValues(["formFactor"])).formFactor)===null||f===void 0)&&f.includes("XR")))){p=ki.SCENE_VIEWER;break}if(g==="quick-look"&&Dg){p=ki.QUICK_LOOK;break}}p===ki.NONE&&this.iosSrc!=null&&Dg&&(p=ki.QUICK_LOOK)}if(p!==ki.NONE)this[Tr].classList.add("enabled"),this[Tr].addEventListener("click",this[fm]);else if(this[Tr].classList.contains("enabled")){this[Tr].removeEventListener("click",this[fm]),this[Tr].classList.remove("enabled");let g=xr.FAILED;this.setAttribute("ar-status",g),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:g}}))}this[um]=p}async[qT](){console.log("Attempting to present in AR with WebXR..."),await this[fb]();try{this[Tr].removeEventListener("click",this[fm]);let{arRenderer:f}=this[ut];f.placeOnWall=this.arPlacement==="wall",await f.present(this[ne],this.xrEnvironment)}catch(f){console.warn("Error while trying to present in AR with WebXR"),console.error(f),await this[ut].arRenderer.stopPresenting(),HT=!0,console.warn("Falling back to next ar-mode"),await this[Tu](),this.activateAR()}finally{this[Tu]()}}async[fb](){this.loaded||(this[dm]=!0,this[co](),await hS(this,"load"),this[dm]=!1)}[dr](){return super[dr]()||this[dm]}[KT](){let f=self.location.toString(),p=new URL(f),g=new URL(this.src,f);g.hash&&(g.hash="");let A=new URLSearchParams(g.search);if(p.hash=WT,A.set("mode","ar_preferred"),A.has("disable_occlusion")||A.set("disable_occlusion","true"),this.arScale==="fixed"&&A.set("resizable","false"),this.arPlacement==="wall"&&A.set("enable_vertical_placement","true"),A.has("sound")){let x=new URL(A.get("sound"),f);A.set("sound",x.toString())}if(A.has("link")){let x=new URL(A.get("link"),f);A.set("link",x.toString())}let m=`intent://arvr.google.com/scene-viewer/1.2?${A.toString()+"&file="+encodeURIComponent(g.toString())}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(p.toString())};end;`,b=()=>{self.location.hash===WT&&(VT=!0,self.history.back(),console.warn("Error while trying to present in AR with Scene Viewer"),console.warn("Falling back to next ar-mode"),this[Tu]())};self.addEventListener("hashchange",b,{once:!0}),this[ml].setAttribute("href",m),console.log("Attempting to present in AR with Scene Viewer..."),this[ml].click()}async[$T](){let f=!this.iosSrc;this[Tr].classList.remove("enabled");let p=f?await this.prepareUSDZ():this.iosSrc,g=new URL(p,self.location.toString());if(f){let b=self.location.toString(),x=new URL(b),y=new URL(this.src,x);y.hash&&(g.hash=y.hash)}this.arScale==="fixed"&&(g.hash&&(g.hash+="&"),g.hash+="allowsContentScaling=0");let A=this[ml];A.setAttribute("rel","ar");let m=document.createElement("img");A.appendChild(m),A.setAttribute("href",g.toString()),f&&A.setAttribute("download","model.usdz"),A.style.display="none",A.isConnected||this.shadowRoot.appendChild(A),console.log("Attempting to present in AR with Quick Look..."),A.click(),A.removeChild(m),f&&URL.revokeObjectURL(p),this[Tr].classList.add("enabled")}async prepareUSDZ(){let f=this[is].beginActivity("usdz-conversion");await this[fb]();let{model:p,shadow:g,target:A}=this[ne];if(p==null)return"";let m=!1;g!=null&&(m=g.visible,g.visible=!1),f(.2);let b=new hm;A.remove(p),p.position.copy(A.position),p.updateWorldMatrix(!1,!0);let x=await b.parseAsync(p,{maxTextureSize:isNaN(this.arUsdzMaxTextureSize)?1/0:Math.max(parseInt(this.arUsdzMaxTextureSize),16)});p.position.set(0,0,0),A.add(p);let y=new Blob([x],{type:"model/vnd.usdz+zip"}),_=URL.createObjectURL(y);return f(1),g!=null&&(g.visible=m),_}}return Sa([Be({type:Boolean,attribute:"ar"})],u.prototype,"ar",void 0),Sa([Be({type:String,attribute:"ar-scale"})],u.prototype,"arScale",void 0),Sa([Be({type:String,attribute:"ar-usdz-max-texture-size"})],u.prototype,"arUsdzMaxTextureSize",void 0),Sa([Be({type:String,attribute:"ar-placement"})],u.prototype,"arPlacement",void 0),Sa([Be({type:String,attribute:"ar-modes"})],u.prototype,"arModes",void 0),Sa([Be({type:String,attribute:"ios-src"})],u.prototype,"iosSrc",void 0),Sa([Be({type:Boolean,attribute:"xr-environment"})],u.prototype,"xrEnvironment",void 0),u}});var pb,jk,Jk,Zk,e3,mb,jT,Al,Ab,gl,Iu,gb,pm,yb,t3,bb,JT,ZT=oe(()=>{Vs();Xe();ai();cp();Up();ns();pb=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},jk=100,Jk="https://www.gstatic.com/draco/versioned/decoders/1.5.6/",Zk="https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/",e3="https://cdn.jsdelivr.net/npm/three@0.149.0/examples/jsm/loaders/LottieLoader.js",mb={AUTO:"auto",MANUAL:"manual"},jT={AUTO:"auto",LAZY:"lazy",EAGER:"eager"},Al=Symbol("defaultProgressBarElement"),Ab=Symbol("posterContainerElement"),gl=Symbol("defaultPosterElement"),Iu=Symbol("shouldDismissPoster"),gb=Symbol("hidePoster"),pm=Symbol("modelIsRevealed"),yb=Symbol("updateProgressBar"),t3=Symbol("ariaLabelCallToAction"),bb=Symbol("onProgress"),JT=i=>{var e,t,n,s,r,o,a,c;class l extends i{static set dracoDecoderLocation(u){on.setDRACODecoderLocation(u)}static get dracoDecoderLocation(){return on.getDRACODecoderLocation()}static set ktx2TranscoderLocation(u){on.setKTX2TranscoderLocation(u)}static get ktx2TranscoderLocation(){return on.getKTX2TranscoderLocation()}static set meshoptDecoderLocation(u){on.setMeshoptDecoderLocation(u)}static get meshoptDecoderLocation(){return on.getMeshoptDecoderLocation()}static set lottieLoaderLocation(u){Ei.singleton.textureUtils.lottieLoaderUrl=u}static get lottieLoaderLocation(){return Ei.singleton.textureUtils.lottieLoaderUrl}static mapURLs(u){Ei.singleton.loader[no].manager.setURLModifier(u)}dismissPoster(){this.loaded?this[gb]():(this[Iu]=!0,this[co]())}showPoster(){let u=this[Ab];if(u.classList.contains("show"))return;u.classList.add("show"),this[vi].classList.remove("show");let d=this[gl];d.removeAttribute("tabindex"),d.removeAttribute("aria-hidden");let f=this.modelIsVisible;this[pm]=!1,this[vu](f)}getDimensions(){return os(this[ne].size)}getBoundingBoxCenter(){return os(this[ne].boundingBox.getCenter(new D))}constructor(...u){super(...u),this.poster=null,this.reveal=mb.AUTO,this.loading=jT.AUTO,this[e]=!1,this[t]=!1,this[n]=this.shadowRoot.querySelector(".slot.poster"),this[s]=this.shadowRoot.querySelector("#default-poster"),this[r]=this.shadowRoot.querySelector("#default-progress-bar > .bar"),this[o]=this[gl].getAttribute("aria-label"),this[a]=cS(A=>{let m=this[Al].parentNode;requestAnimationFrame(()=>{this[Al].style.transform=`scaleX(${A})`,A===0&&(m.removeChild(this[Al]),m.appendChild(this[Al])),this[Al].classList.toggle("hide",A===1)})},jk),this[c]=A=>{let m=A.detail.totalProgress,b=A.detail.reason;m===1&&(this[yb].flush(),this.loaded&&(this[Iu]||this.reveal===mb.AUTO)&&this[gb]()),this[yb](m),this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:m,reason:b}}))};let d=self.ModelViewerElement||{},f=d.dracoDecoderLocation||Jk;on.setDRACODecoderLocation(f);let p=d.ktx2TranscoderLocation||Zk;on.setKTX2TranscoderLocation(p),d.meshoptDecoderLocation&&on.setMeshoptDecoderLocation(d.meshoptDecoderLocation);let g=d.lottieLoaderLocation||e3;Ei.singleton.textureUtils.lottieLoaderUrl=g}connectedCallback(){super.connectedCallback(),this.loaded||this.showPoster(),this[is].addEventListener("progress",this[bb])}disconnectedCallback(){super.disconnectedCallback(),this[is].removeEventListener("progress",this[bb])}async updated(u){super.updated(u),u.has("poster")&&this.poster!=null&&(this[gl].style.backgroundImage=`url(${this.poster})`),u.has("alt")&&this[gl].setAttribute("aria-label",this[sm]),(u.has("reveal")||u.has("loading"))&&this[co]()}[(e=pm,t=Iu,n=Ab,s=gl,r=Al,o=t3,a=yb,c=bb,dr)](){return!!this.src&&(this[Iu]||this.loading===jT.EAGER||this.reveal===mb.AUTO&&this[ao])}[gb](){this[Iu]=!1;let u=this[Ab];if(!u.classList.contains("show"))return;u.classList.remove("show"),this[vi].classList.add("show");let d=this.modelIsVisible;this[pm]=!0,this[vu](d);let f=this.getRootNode();f&&f.activeElement===this&&this[vi].focus();let p=this[gl];p.setAttribute("aria-hidden","true"),p.tabIndex=-1,this.dispatchEvent(new CustomEvent("poster-dismissed"))}[rs](){return super[rs]()&&this[pm]}}return pb([Be({type:String})],l.prototype,"poster",void 0),pb([Be({type:String})],l.prototype,"reveal",void 0),pb([Be({type:String})],l.prototype,"loading",void 0),l}});var xb,n3,i3,s3,yl,_b,eI,vb,tI,nI=oe(()=>{Vs();iy();ai();qc();Bs();xb=function(i,e,t,n){var s=arguments.length,r=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},n3=Math.PI/32,i3=3e3,s3={basis:[Wc(dn(n3,"rad"))],keywords:{auto:[null]}},yl=Symbol("autoRotateStartTime"),_b=Symbol("radiansPerSecond"),eI=Symbol("syncRotationRate"),vb=Symbol("onCameraChange"),tI=i=>{var e,t,n;class s extends i{constructor(){super(...arguments),this.autoRotate=!1,this.autoRotateDelay=i3,this.rotationPerSecond="auto",this[e]=performance.now(),this[t]=0,this[n]=o=>{this.autoRotate&&o.detail.source==="user-interaction"&&(this[yl]=performance.now())}}connectedCallback(){super.connectedCallback(),this.addEventListener("camera-change",this[vb]),this[yl]=performance.now()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("camera-change",this[vb]),this[yl]=performance.now()}updated(o){super.updated(o),o.has("autoRotate")&&(this[yl]=performance.now())}[(e=yl,t=_b,eI)](o){this[_b]=o[0]}[Xn](o,a){if(super[Xn](o,a),!this.autoRotate||!this[rs]()||this[ut].isPresenting)return;let c=Math.min(a,o-this[yl]-this.autoRotateDelay);c>0&&(this[ne].yaw=this.turntableRotation+this[_b]*c*.001)}get turntableRotation(){return this[ne].yaw}resetTurntableRotation(o=0){this[ne].yaw=o}}return n=vb,xb([Be({type:Boolean,attribute:"auto-rotate"})],s.prototype,"autoRotate",void 0),xb([Be({type:Number,attribute:"auto-rotate-delay"})],s.prototype,"autoRotateDelay",void 0),xb([Ds({intrinsics:s3,updateHandler:eI}),Be({type:String,attribute:"rotation-per-second"})],s.prototype,"rotationPerSecond",void 0),s}});var sI={};ZR(sI,{CanvasTexture:()=>Go,FileLoader:()=>En,Loader:()=>ln,ModelViewerElement:()=>iI,NearestFilter:()=>Ft});var iI,rI=oe(()=>{mT();yT();YT();hy();Qh();ZT();Ny();nI();ai();Xe();iI=gT(LM(tI(uS(AC(XT(JT(pT(wr))))))));customElements.define("model-viewer",iI)});var OR=Gs((fj,FR)=>{FR.exports={AED:"\u062F.\u0625",AFN:"\u060B",ALL:"L",AMD:"\u058F",ANG:"\u0192",AOA:"Kz",ARS:"$",AUD:"$",AWG:"\u0192",AZN:"\u20BC",BAM:"KM",BBD:"$",BDT:"\u09F3",BGN:"\u043B\u0432",BHD:".\u062F.\u0628",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"\u20BF",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"\xA5",CNY:"\xA5",COP:"$",COU:"COU",CRC:"\u20A1",CUC:"$",CUP:"\u20B1",CVE:"$",CZK:"K\u010D",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"\u062F\u062C",EEK:"kr",EGP:"\xA3",ERN:"Nfk",ETB:"Br",ETH:"\u039E",EUR:"\u20AC",FJD:"$",FKP:"\xA3",GBP:"\xA3",GEL:"\u20BE",GGP:"\xA3",GHC:"\u20B5",GHS:"GH\u20B5",GIP:"\xA3",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"\u20AA",IMP:"\xA3",INR:"\u20B9",IQD:"\u0639.\u062F",IRR:"\uFDFC",ISK:"kr",JEP:"\xA3",JMD:"J$",JOD:"JD",JPY:"\xA5",KES:"KSh",KGS:"\u043B\u0432",KHR:"\u17DB",KMF:"CF",KPW:"\u20A9",KRW:"\u20A9",KWD:"KD",KYD:"$",KZT:"\u20B8",LAK:"\u20AD",LBP:"\xA3",LKR:"\u20A8",LRD:"$",LSL:"M",LTC:"\u0141",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"\u0434\u0435\u043D",MMK:"K",MNT:"\u20AE",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"\u20A8",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"\u20A6",NIO:"C$",NOK:"kr",NPR:"\u20A8",NZD:"$",OMR:"\uFDFC",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"\u20B1",PKR:"\u20A8",PLN:"z\u0142",PYG:"Gs",QAR:"\uFDFC",RMB:"\uFFE5",RON:"lei",RSD:"\u0414\u0438\u043D.",RUB:"\u20BD",RWF:"R\u20A3",SAR:"\uFDFC",SBD:"$",SCR:"\u20A8",SDG:"\u062C.\u0633.",SEK:"kr",SGD:"S$",SHP:"\xA3",SLL:"Le",SOS:"S",SRD:"$",SSP:"\xA3",STD:"Db",STN:"Db",SVC:"$",SYP:"\xA3",SZL:"E",THB:"\u0E3F",TJS:"SM",TMT:"T",TND:"\u062F.\u062A",TOP:"T$",TRL:"\u20A4",TRY:"\u20BA",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"\u20B4",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"\u043B\u0432",VEF:"Bs",VES:"Bs.S",VND:"\u20AB",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"\u0243",XCD:"$",XOF:"CFA",XPF:"\u20A3",XSU:"Sucre",XUA:"XUA",YER:"\uFDFC",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"}});var NR=Gs((pj,px)=>{var fx=OR();px.exports=function(e){if(typeof e!="string")return;let t=e.toUpperCase();if(Object.prototype.hasOwnProperty.call(fx,t))return fx[t]};px.exports.currencySymbolMap=fx});var kR=Gs((mj,UR)=>{var EQ={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AN:"ANG",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYR",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"HRK",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"LTL",LU:"EUR",LV:"LVL",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRO",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLL",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",ST:"STD",SV:"SVC",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",UM:"USD",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VEF",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMK",ZW:"ZWL"};UR.exports=EQ});var GR=Gs(mx=>{var wm=kR(),SQ=function(i){var e=i.split("_");return e.length==2||(e=i.split("-"),e.length==2)?e.pop():i};mx.getCurrency=function(i){var e=SQ(i).toUpperCase();return e in wm?wm[e]:null};mx.getLocales=function(i){i=i.toUpperCase();var e=[];for(countryCode in wm)wm[countryCode]===i&&e.push(countryCode);return e}});var n1=mo(vx(),1),i1="experience/hotspots",s1="experience/mosaic",r1="experience/power-page";var o1="framework/spworld",a1="site/anchor/inline",c1="site/pageid";var l1="site/tracking/addtocart",Hn={mosaic:"mosaic",powerpage:"powerpage",logoprogram:"logoprogram"},Dt={urlPattern:"urlPattern",urlParameter:"urlParameter",windowVariable:"windowVariable",domElement:"domElement",property:"property",attribute:"attribute",addToCartButton:"addToCartButton",addToCartButtons:"addToCartButtons",price:"price",qty:"qty",brand:"brand",name:"name",category:"category",replacement:"replacement",casing:"casing",upper:"upper"},Ao=(i,e)=>{let t={};try{t=i[e]||t}catch{}return t},Ex=i=>{let e=Ao(i,a1);if(e.isReady)return e;let t=[];try{t=JSON.parse(e.rules)}catch{}return t.push({selector:"#wc-power-page:not(script)",position:"beforeend"}),window.Webcollage&&window.Webcollage.powerPageTargetSelector&&window.Webcollage.powerPageTargetSelector!=="#wc-power-page"&&t.push({selector:window.Webcollage.powerPageTargetSelector,position:"beforeend"}),t.push({selector:"#sp_inline_product",position:"beforeend"}),t.unshift({selector:"#sp_inline",position:"beforeend"}),t.unshift({selector:"#SP_ACPage",position:"beforeend"}),t.push({selector:"#syndi_inline",position:"beforeend"}),t.push({selector:"#ccs-syndi-inline",position:"afterbegin",condition:()=>document.querySelector("#ccs-syndi-inline")&&!document.querySelector("syndigo-powerpage")?.hasContent}),e.rules=t,e.isReady=!0,e};var Sx=i=>{let e=Ao(i,c1);if(e.isReady)return e;let t=[];try{t=JSON.parse(e.rules)}catch{}let n=[{type:"windowVariable",selector:"Webcollage.cpi",modifiers:[]},{type:"windowVariable",selector:"vsr_sku",modifiers:[]},{type:"windowVariable",selector:"sp_sku[0]",modifiers:[]},{type:"windowVariable",selector:"sp_sku",modifiers:[]},{type:"domElement",selector:"syndigo-powerpage",location:{type:"attribute",name:"pageid"},modifiers:[]},{type:"domElement",selector:"syndigo-mosaic",location:{type:"attribute",name:"pageid"},modifiers:[]},{type:"domElement",selector:"syndigo-hotspots",location:{type:"attribute",name:"pageid"},modifiers:[]}];return t=t.filter(s=>!s.selector||s.type==="domElement"&&!s.location?!1:(Array.isArray(s.modifiers)||(s.modifiers=[]),!0)),e.rules=t.concat(n),e.isReady=!0,e};var ds=i=>{let e=Ao(i,o1);if(e.isReady)return e;e.urlTarget=e.urlTarget==="_top"||e.urlTarget==="_self"?e.urlTarget:"_blank";let t={enabled:!1};try{t=JSON.parse(e.linkGate)}catch{}return e.linkGate=t,e.linkGate.enabled&&(e.linkGate.title=e.linkGate.title||"Visit External Link",e.linkGate.message=e.linkGate.message||"You are leaving the site to visit an external link",e.linkGate.actions=e.linkGate.actions||{},e.linkGate.actions.close={iconFgColor:"white"},e.linkGate.actions.ok=e.linkGate.actions.ok||{},e.linkGate.actions.ok.label=e.linkGate.actions.ok.label||"Visit External Link",e.linkGate.actions.ok.bgColor=e.linkGate.actions.ok.bgColor||"#3071a9",e.linkGate.actions.ok.fgColor=e.linkGate.actions.ok.fgColor||"white",e.linkGate.actions.cancel=e.linkGate.actions.cancel||{},e.linkGate.actions.cancel.label=e.linkGate.actions.cancel.label||"Cancel",e.linkGate.actions.cancel.bgColor=e.linkGate.actions.cancel.bgColor||"#eaeaea",e.linkGate.actions.cancel.fgColor=e.linkGate.actions.cancel.fgColor||"#0060a9"),delete e.enableBeacon,e.isReady=!0,e},wx=i=>{let e=Ao(i,r1);if(e.isReady)return e;try{e.disclaimerSetting=JSON.parse(e.disclaimerSetting)}catch{}return e.isReady=!0,e},Cx=i=>{let e=Ao(i,i1);return e.isReady||(e.isReady=!0),e},go=i=>{let e=Ao(i,s1);if(e.isReady)return e;let t={};try{t=JSON.parse(e.widgetIcons)}catch{}return e.widgetIcons=t,e.iconHeight=e.iconHeight||40,e.iconWidth=e.iconWidth||40,e.calloutContent=e.calloutContent||"",e.calloutStyle=e.calloutStyle||"",delete e.calloutSelector,delete e.useCustomElement,e.mosaicPosition=e.mosaicPosition||"top-left",e.icon=e.icon||"eye-circle",e.scrollWhenItemSelected=e.scrollWhenItemSelected||!1,e.fixedScrollPosition=e.fixedScrollPosition||0,e.defaultOpen=e.defaultOpen||!1,e.isReady=!0,e};var Mx=i=>{let e=Ao(i,l1);if(e.isReady)return e;let t={mutationObserver:{enabled:!1},rules:[]};try{t=JSON.parse(e.config)}catch{}return e.config=t,e.isReady=!0,e};var Xu;function Mm(){if(Xu===void 0)try{let i=window.top.innerWidth;Xu=!1}catch{Xu=!0}return Xu}function Wi(){return Mm()?window:window.top}function ei(i){return typeof i=="function"}function Tm(i){i=i.substr(0,4089);let e=new window.Image;e.width=1,e.border=0,e.src=i}var Yu;function ju(i){if(Yu===void 0){let e;try{e=window[i];let t="__syndigo_storage_test__";e.setItem(t,t),e.removeItem(t),Yu=!0}catch(t){Yu=t instanceof DOMException&&(t.code===22||t.code===1014||t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}return Yu}function Ii(){let i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",e=i.split(""),t=new Array(36),n=0;for(let s=0;s<36;s++)if(s===8||s===13||s===18||s===23)t[s]="-";else if(s===14)t[s]="4";else{n<=2&&(n=33554432+Math.random()*16777216|0);let r=n&15;n=n>>4,t[s]=e[s===19?r&3|8:r]}return t.join("")}var Dl={OPT_IN:"opt-in",OPT_OUT:"opt-out",OFF:"off"},An={local_storage:"localStorage",sp_ssid:"sp_ssid",spid:"spid",syndi_holdout:"syndi_holdout",syndi_abtesting:"syndi_abtesting",syndi_pageid_timestamps:"syndi_pageid_timestamps",syndi_analytics_user_consent:"syndi_analytics_user_consent"},Ju={haciao_module:"haciao",add_to_cart:"a2ctracking",event_tracking:"eventTracking",framework:"framework"},Fr={addToCart:{button_missing:"did not find addToCart button",price_missing:"price not found",qty_missing:"qty not found",unknown_rule_type:"unknown rule type:",unknown_rule_name:"unknown rule name:",caught_exception:"caught exception"},eventBus:{missing_parameter:"Missing mandatory parameter for the pixel"},framework:{timeout_document_ready:"timed out waiting for document ready",import_failure:"syndi failed to load dependencies"},tracking:{consent_choice_bool:"Syndigo: analytics consent choice MUST be a boolean"}};var Tx={track:"track"},Ix={addToCart:"addToCart",transaction:"transaction",transactionItem:"transactionItem"};function Or(i){return!i.analyticsCollection||i.analyticsCollection===Dl.OFF?!1:typeof i.analyticsUserConsent=="boolean"?i.analyticsUserConsent:i.analyticsCollection===Dl.OPT_OUT?!0:(i.analyticsCollection===Dl.OPT_IN,!1)}function h1(i){window.localStorage.removeItem(An.sp_ssid),window.localStorage.removeItem(An.spid),window.localStorage.removeItem(An.syndi_holdout),window.localStorage.removeItem(An.syndi_abtesting),window.localStorage.removeItem(An.syndi_pageid_timestamps);for(let e in window.localStorage)e.startsWith("cpt_")&&window.localStorage.removeItem(e);i.tracking.sessionId=void 0,i.tracking.visitId=void 0,i.tracking.spid=void 0}function Rx(i){i.tracking.timestamp=Date.now();let e=ds(i.moduleParameters);i.tracking.analyticsCollection=e.analyticsCollection||Dl.OPT_OUT;let t=window.localStorage.getItem(An.syndi_analytics_user_consent);(t==="true"||t==="false")&&(i.tracking.analyticsUserConsent=t==="true"),Bx(i.tracking),i.mediator.subscribe("content","new",function(){i.tracking.timestamp=Date.now(),qi(i,"p")})}function Bx(i){Or(i)&&(i.spid=i.spid||Rm(An.spid,"^[0-9a-zA-Z-]{36}$")||Ii(),Ll(An.spid,i.spid),u1(i)||(i.sessionId=Date.now(),Ll(An.sp_ssid,i.sessionId)),i.visitId=i.visitId||Ii())}function Dx(i){let r,o=!1,a=function(){let c=Date.now()-r;c>66e4||(o&&f1(i,{t:Math.round(c/1e3,0)}),setTimeout(a,c<12e4?6e3:3e4))};r=Date.now(),a(),i.mediator.subscribe("heartbeat","start",function(){o=!0}),i.mediator.subscribe("heartbeat","stop",function(){o=!1}),i.mediator.subscribe("content","new",function(){r=Date.now()})}function Im(i,e){typeof e!="boolean"?console.warn(Fr.tracking.consent_choice_bool):(i.tracking.analyticsUserConsent=e,Ll(An.syndi_analytics_user_consent,""+e),i.tracking.analyticsUserConsent?Bx(i.tracking):h1(i))}function Lx(i,e){if(!Or(i))return;let t={};try{t=JSON.parse(window.localStorage.getItem(An.syndi_pageid_timestamps))||{}}catch{}t[e]||(t[e]=Date.now(),Ll(An.syndi_pageid_timestamps,JSON.stringify(t)))}function u1(i){return i.sessionId=i.sessionId||Rm(An.sp_ssid,"^[0-9]+$"),(i.sessionId==="undefined"||Date.now()-i.sessionId>36e5)&&(i.sessionId=void 0),i.sessionId}function Ll(i,e){ju(An.local_storage)&&window.localStorage.setItem(i,e)}function Rm(i,e){if(!ju(An.local_storage))return;let t=window.localStorage.getItem(i);if(t===null&&(t=void 0),t!==!1)return e&&new RegExp(e).test(t)===!1&&(t=void 0),t}function qi(i,e,t={}){if(!Or(i.tracking))return;t.dt===void 0&&(t.dt=(Date.now()-i.tracking.timestamp)/1e3),t.pt=i.pagetype,t.acm=i.tracking.analyticsCollection===Dl.OPT_IN?"oi":"oo";let n=d1(i,`${i.trackingRoot}${e}.gif`,t);e==="a"&&(t.a==="vcp"||t.a==="click-more")?fetch(n,{method:"GET",keepalive:!0}):Tm(n)}function Px(i,e){let t=new URL(e);if(!Or(i.tracking))return t.toString();t.searchParams.set("u",i.tracking.spid),t.searchParams.set("siteid",i.siteid),t.searchParams.set("pageid",i.pageid),t.searchParams.set("s",i.tracking.sessionId),t.searchParams.set("v","v1.0.569"),t.searchParams.set("visitid",i.tracking.visitId);let n=Fx(i),s=Ox({...n,...i.tracking.customParams});for(let o of Object.keys(s))t.searchParams.set(o,s[o]);let r=Wi();return t.searchParams.set("ref",r.document.referrer),t.searchParams.set("pageurl",r.document.location.href),t.toString()}function d1(i,e,t={}){let n=new URL(e);n.searchParams.set("u",i.tracking.spid),n.searchParams.set("siteid",i.siteid),n.searchParams.set("pageid",i.pageid),n.searchParams.set("s",i.tracking.sessionId),n.searchParams.set("v","v1.0.569"),n.searchParams.set("visitid",i.tracking.visitId);let s=Fx(i),r=Ox({...t,...s,...i.tracking.customParams});for(let a of Object.keys(r))n.searchParams.set(a,r[a]);let o=Wi();return n.searchParams.set("ref",o.document.referrer),n.searchParams.set("r",Math.random()),n.searchParams.set("pageurl",o.document.location.href),n.toString()}function Fx(i){if(!i.captureUrlParams)return{};if(i.tracking.capturedUrlParams)return i.tracking.capturedUrlParams;let e=i.captureUrlParams.split(","),t={},n=Wi();return e.forEach(function(s){let r=s.trim(),o=new URL(n.location).searchParams.get(r),a="cpt_"+r;o?Ll(a,o):o=Rm(a,o),t[a]=o}),i.tracking.capturedUrlParams=t,t}function Ox(i={}){let e={};for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&i[t]!==void 0&&!ei(i[t])&&(e[t]=i[t]);return e}function Ua(i,e,t,n){return n.dt=performance.now()/1e3,n.xt=i,n.epci=e,n.ci=t,n}function ka(i,e){qi(i,"a",e)}function Nx(i,e){qi(i,"ab",e)}function pi(i,e){qi(i,"e",e)}function f1(i,e){qi(i,"h",e)}function Ux(i,e){qi(i,"k",e)}function kx(i,e){qi(i,"x",e)}function p1(i,e){return document.createElement(i,e)}function m1(i,e,t){return document.createElementNS(i,e,t)}function A1(){return yo(document.createDocumentFragment())}function g1(i){return document.createTextNode(i)}function y1(i){return document.createComment(i)}function b1(i,e,t){if(Qs(i)){let n=i;for(;n&&Qs(n);)n=yo(n).parent;i=n??i}Qs(e)&&(e=yo(e,i)),t&&Qs(t)&&(t=yo(t).firstChildNode),i.insertBefore(e,t)}function x1(i,e){i.removeChild(e)}function _1(i,e){Qs(e)&&(e=yo(e,i)),i.appendChild(e)}function Gx(i){if(Qs(i)){for(;i&&Qs(i);)i=yo(i).parent;return i??null}return i.parentNode}function v1(i){var e;if(Qs(i)){let t=yo(i),n=Gx(t);if(n&&t.lastChildNode){let s=Array.from(n.childNodes),r=s.indexOf(t.lastChildNode);return(e=s[r+1])!==null&&e!==void 0?e:null}return null}return i.nextSibling}function E1(i){return i.tagName}function S1(i,e){i.textContent=e}function w1(i){return i.textContent}function C1(i){return i.nodeType===1}function M1(i){return i.nodeType===3}function T1(i){return i.nodeType===8}function Qs(i){return i.nodeType===11}function yo(i,e){var t,n,s;let r=i;return(t=r.parent)!==null&&t!==void 0||(r.parent=e??null),(n=r.firstChildNode)!==null&&n!==void 0||(r.firstChildNode=i.firstChild),(s=r.lastChildNode)!==null&&s!==void 0||(r.lastChildNode=i.lastChild),r}var Zu={createElement:p1,createElementNS:m1,createTextNode:g1,createDocumentFragment:A1,createComment:y1,insertBefore:b1,removeChild:x1,appendChild:_1,parentNode:Gx,nextSibling:v1,tagName:E1,setTextContent:S1,getTextContent:w1,isElement:C1,isText:M1,isComment:T1,isDocumentFragment:Qs};function Ri(i,e,t,n,s){let r=e===void 0?void 0:e.key;return{sel:i,data:e,children:t,text:n,elm:s,key:r}}var Ga=Array.isArray;function Qa(i){return typeof i=="string"||typeof i=="number"||i instanceof String||i instanceof Number}function ed(i){return i===void 0}function ti(i){return i!==void 0}var Bm=Ri("",{},[],void 0,void 0);function Pl(i,e){var t,n;let s=i.key===e.key,r=((t=i.data)===null||t===void 0?void 0:t.is)===((n=e.data)===null||n===void 0?void 0:n.is),o=i.sel===e.sel,a=!i.sel&&i.sel===e.sel?typeof i.text==typeof e.text:!0;return o&&s&&r&&a}function I1(){throw new Error("The document fragment is not supported on this platform.")}function R1(i,e){return i.isElement(e)}function B1(i,e){return i.isDocumentFragment(e)}function D1(i,e,t){var n;let s={};for(let r=e;r<=t;++r){let o=(n=i[r])===null||n===void 0?void 0:n.key;o!==void 0&&(s[o]=r)}return s}var L1=["create","update","remove","destroy","pre","post"];function Dm(i,e,t){let n={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=e!==void 0?e:Zu;for(let p of L1)for(let g of i){let A=g[p];A!==void 0&&n[p].push(A)}function r(p){let g=p.id?"#"+p.id:"",A=p.getAttribute("class"),m=A?"."+A.split(" ").join("."):"";return Ri(s.tagName(p).toLowerCase()+g+m,{},[],void 0,p)}function o(p){return Ri(void 0,{},[],void 0,p)}function a(p,g){return function(){if(--g===0){let m=s.parentNode(p);m!==null&&s.removeChild(m,p)}}}function c(p,g){var A,m,b,x;let y,_=p.data;if(_!==void 0){let w=(A=_.hook)===null||A===void 0?void 0:A.init;ti(w)&&(w(p),_=p.data)}let S=p.children,C=p.sel;if(C==="!")ed(p.text)&&(p.text=""),p.elm=s.createComment(p.text);else if(C==="")p.elm=s.createTextNode(p.text);else if(C!==void 0){let w=C.indexOf("#"),v=C.indexOf(".",w),E=w>0?w:C.length,R=v>0?v:C.length,F=w!==-1||v!==-1?C.slice(0,Math.min(E,R)):C,P=p.elm=ti(_)&&ti(y=_.ns)?s.createElementNS(y,F,_):s.createElement(F,_);for(E<R&&P.setAttribute("id",C.slice(E+1,R)),v>0&&P.setAttribute("class",C.slice(R+1).replace(/\./g," ")),y=0;y<n.create.length;++y)n.create[y](Bm,p);if(Qa(p.text)&&(!Ga(S)||S.length===0)&&s.appendChild(P,s.createTextNode(p.text)),Ga(S))for(y=0;y<S.length;++y){let V=S[y];V!=null&&s.appendChild(P,c(V,g))}let U=p.data.hook;ti(U)&&((m=U.create)===null||m===void 0||m.call(U,Bm,p),U.insert&&g.push(p))}else if(!((b=t?.experimental)===null||b===void 0)&&b.fragments&&p.children){for(p.elm=((x=s.createDocumentFragment)!==null&&x!==void 0?x:I1)(),y=0;y<n.create.length;++y)n.create[y](Bm,p);for(y=0;y<p.children.length;++y){let w=p.children[y];w!=null&&s.appendChild(p.elm,c(w,g))}}else p.elm=s.createTextNode(p.text);return p.elm}function l(p,g,A,m,b,x){for(;m<=b;++m){let y=A[m];y!=null&&s.insertBefore(p,c(y,x),g)}}function h(p){var g,A;let m=p.data;if(m!==void 0){(A=(g=m?.hook)===null||g===void 0?void 0:g.destroy)===null||A===void 0||A.call(g,p);for(let b=0;b<n.destroy.length;++b)n.destroy[b](p);if(p.children!==void 0)for(let b=0;b<p.children.length;++b){let x=p.children[b];x!=null&&typeof x!="string"&&h(x)}}}function u(p,g,A,m){for(var b,x;A<=m;++A){let y,_,S=g[A];if(S!=null)if(ti(S.sel)){h(S),y=n.remove.length+1,_=a(S.elm,y);for(let w=0;w<n.remove.length;++w)n.remove[w](S,_);let C=(x=(b=S?.data)===null||b===void 0?void 0:b.hook)===null||x===void 0?void 0:x.remove;ti(C)?C(S,_):_()}else S.children?(h(S),u(p,S.children,0,S.children.length-1)):s.removeChild(p,S.elm)}}function d(p,g,A,m){let b=0,x=0,y=g.length-1,_=g[0],S=g[y],C=A.length-1,w=A[0],v=A[C],E,R,F,P;for(;b<=y&&x<=C;)_==null?_=g[++b]:S==null?S=g[--y]:w==null?w=A[++x]:v==null?v=A[--C]:Pl(_,w)?(f(_,w,m),_=g[++b],w=A[++x]):Pl(S,v)?(f(S,v,m),S=g[--y],v=A[--C]):Pl(_,v)?(f(_,v,m),s.insertBefore(p,_.elm,s.nextSibling(S.elm)),_=g[++b],v=A[--C]):Pl(S,w)?(f(S,w,m),s.insertBefore(p,S.elm,_.elm),S=g[--y],w=A[++x]):(E===void 0&&(E=D1(g,b,y)),R=E[w.key],ed(R)?(s.insertBefore(p,c(w,m),_.elm),w=A[++x]):ed(E[v.key])?(s.insertBefore(p,c(v,m),s.nextSibling(S.elm)),v=A[--C]):(F=g[R],F.sel!==w.sel?s.insertBefore(p,c(w,m),_.elm):(f(F,w,m),g[R]=void 0,s.insertBefore(p,F.elm,_.elm)),w=A[++x]));x<=C&&(P=A[C+1]==null?null:A[C+1].elm,l(p,P,A,x,C,m)),b<=y&&u(p,g,b,y)}function f(p,g,A){var m,b,x,y,_,S,C,w;let v=(m=g.data)===null||m===void 0?void 0:m.hook;(b=v?.prepatch)===null||b===void 0||b.call(v,p,g);let E=g.elm=p.elm;if(p===g)return;if(g.data!==void 0||ti(g.text)&&g.text!==p.text){(x=g.data)!==null&&x!==void 0||(g.data={}),(y=p.data)!==null&&y!==void 0||(p.data={});for(let P=0;P<n.update.length;++P)n.update[P](p,g);(C=(S=(_=g.data)===null||_===void 0?void 0:_.hook)===null||S===void 0?void 0:S.update)===null||C===void 0||C.call(S,p,g)}let R=p.children,F=g.children;ed(g.text)?ti(R)&&ti(F)?R!==F&&d(E,R,F,A):ti(F)?(ti(p.text)&&s.setTextContent(E,""),l(E,null,F,0,F.length-1,A)):ti(R)?u(E,R,0,R.length-1):ti(p.text)&&s.setTextContent(E,""):p.text!==g.text&&(ti(R)&&u(E,R,0,R.length-1),s.setTextContent(E,g.text)),(w=v?.postpatch)===null||w===void 0||w.call(v,p,g)}return function(g,A){let m,b,x,y=[];for(m=0;m<n.pre.length;++m)n.pre[m]();for(R1(s,g)?g=r(g):B1(s,g)&&(g=o(g)),Pl(g,A)?f(g,A,y):(b=g.elm,x=s.parentNode(b),c(A,y),x!==null&&(s.insertBefore(x,A.elm,s.nextSibling(b)),u(x,[g],0,0))),m=0;m<y.length;++m)y[m].data.hook.insert(y[m]);for(m=0;m<n.post.length;++m)n.post[m]();return A}}function za(i,e,t){if(i.ns="http://www.w3.org/2000/svg",t!=="foreignObject"&&e!==void 0)for(let n=0;n<e.length;++n){let s=e[n];if(typeof s=="string")continue;let r=s.data;r!==void 0&&za(r,s.children,s.sel)}}function bo(i,e,t){let n={},s,r,o;if(t!==void 0?(e!==null&&(n=e),Ga(t)?s=t:Qa(t)?r=t.toString():t&&t.sel&&(s=[t])):e!=null&&(Ga(e)?s=e:Qa(e)?r=e.toString():e&&e.sel?s=[e]:n=e),s!==void 0)for(o=0;o<s.length;++o)Qa(s[o])&&(s[o]=Ri(void 0,void 0,void 0,s[o],void 0));return i.startsWith("svg")&&(i.length===3||i[3]==="."||i[3]==="#")&&za(n,s,i),Ri(i,n,s,r,void 0)}function td(i,e){var t;let n=(t=e.data)===null||t===void 0?void 0:t.ns;i.data.fn=e.data.fn,i.data.args=e.data.args,e.data=i.data,e.children=i.children,e.text=i.text,e.elm=i.elm,n&&za(e.data,e.children,e.sel)}function P1(i){let e=i.data,t=e.fn(...e.args);td(t,i)}function F1(i,e){let t,n=i.data,s=e.data,r=n.args,o=s.args;if(n.fn!==s.fn||r.length!==o.length){td(s.fn(...o),e);return}for(t=0;t<o.length;++t)if(r[t]!==o[t]){td(s.fn(...o),e);return}td(i,e)}var Lm=function(e,t,n,s){return s===void 0&&(s=n,n=t,t=void 0),bo(e,{key:t,hook:{init:P1,prepatch:F1},fn:n,args:s})};function ps(i,e){let t=e!==void 0?e:Zu,n;if(t.isElement(i)){let s=i.id?"#"+i.id:"",r=i.getAttribute("class"),o=r?"."+r.split(" ").join("."):"",a=t.tagName(i).toLowerCase()+s+o,c={},l={},h={},u=[],d,f,p,g=i.attributes,A=i.childNodes;for(f=0,p=g.length;f<p;f++)d=g[f].nodeName,d.startsWith("data-")?l[d.slice(5)]=g[f].nodeValue||"":d!=="id"&&d!=="class"&&(c[d]=g[f].nodeValue);for(f=0,p=A.length;f<p;f++)u.push(ps(A[f],e));return Object.keys(c).length>0&&(h.attrs=c),Object.keys(l).length>0&&(h.dataset=l),a.startsWith("svg")&&(a.length===3||a[3]==="."||a[3]==="#")&&za(h,u,a),Ri(a,h,u,void 0,i)}else return t.isText(i)?(n=t.getTextContent(i),Ri(void 0,void 0,void 0,n,i)):t.isComment(i)?(n=t.getTextContent(i),Ri("!",{},[],n,i)):Ri("",{},[],void 0,i)}var O1="http://www.w3.org/1999/xlink",N1="http://www.w3.org/2000/xmlns/",U1="http://www.w3.org/XML/1998/namespace";function zx(i,e){let t,n=e.elm,s=i.data.attrs,r=e.data.attrs;if(!(!s&&!r)&&s!==r){s=s||{},r=r||{};for(t in r){let o=r[t];s[t]!==o&&(o===!0?n.setAttribute(t,""):o===!1?n.removeAttribute(t):t.charCodeAt(0)!==120?n.setAttribute(t,o):t.charCodeAt(3)===58?n.setAttributeNS(U1,t,o):t.charCodeAt(5)===58?t.charCodeAt(1)===109?n.setAttributeNS(N1,t,o):n.setAttributeNS(O1,t,o):n.setAttribute(t,o))}for(t in s)t in r||n.removeAttribute(t)}}var Pm={create:zx,update:zx};function Hx(i,e){let t,n,s=e.elm,r=i.data.class,o=e.data.class;if(!(!r&&!o)&&r!==o){r=r||{},o=o||{};for(n in r)r[n]&&!Object.prototype.hasOwnProperty.call(o,n)&&s.classList.remove(n);for(n in o)t=o[n],t!==r[n]&&s.classList[t?"add":"remove"](n)}}var Fm={create:Hx,update:Hx};function Vx(i,e,t){if(typeof i=="function")i.call(e,t,e);else if(typeof i=="object")for(let n=0;n<i.length;n++)Vx(i[n],e,t)}function k1(i,e){let t=i.type,n=e.data.on;n&&n[t]&&Vx(n[t],e,i)}function G1(){return function i(e){k1(e,i.vnode)}}function Om(i,e){let t=i.data.on,n=i.listener,s=i.elm,r=e&&e.data.on,o=e&&e.elm,a;if(t!==r){if(t&&n)if(r)for(a in t)r[a]||s.removeEventListener(a,n,!1);else for(a in t)s.removeEventListener(a,n,!1);if(r){let c=e.listener=i.listener||G1();if(c.vnode=e,t)for(a in r)t[a]||o.addEventListener(a,c,!1);else for(a in r)o.addEventListener(a,c,!1)}}}var Nm={create:Om,update:Om,destroy:Om};function Wx(i,e){let t,n,s,r=e.elm,o=i.data.props,a=e.data.props;if(!(!o&&!a)&&o!==a){o=o||{},a=a||{};for(t in a)n=a[t],s=o[t],s!==n&&(t!=="value"||r[t]!==n)&&(r[t]=n)}}var Um={create:Wx,update:Wx};var qx=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Q1=function(i){qx(function(){qx(i)})},km=!1;function z1(i,e,t){Q1(function(){i[e]=t})}function Kx(i,e){let t,n,s=e.elm,r=i.data.style,o=e.data.style;if(!r&&!o||r===o)return;r=r||{},o=o||{};let a="delayed"in r;for(n in r)n in o||(n[0]==="-"&&n[1]==="-"?s.style.removeProperty(n):s.style[n]="");for(n in o)if(t=o[n],n==="delayed"&&o.delayed)for(let c in o.delayed)t=o.delayed[c],(!a||t!==r.delayed[c])&&z1(s.style,c,t);else n!=="remove"&&t!==r[n]&&(n[0]==="-"&&n[1]==="-"?s.style.setProperty(n,t):s.style[n]=t)}function H1(i){let e,t,n=i.elm,s=i.data.style;if(!(!s||!(e=s.destroy)))for(t in e)n.style[t]=e[t]}function V1(i,e){let t=i.data.style;if(!t||!t.remove){e();return}km||(i.elm.offsetLeft,km=!0);let n,s=i.elm,r=0,o=t.remove,a=0,c=[];for(n in o)c.push(n),s.style[n]=o[n];let h=getComputedStyle(s)["transition-property"].split(", ");for(;r<h.length;++r)c.indexOf(h[r])!==-1&&a++;s.addEventListener("transitionend",function(u){u.target===s&&--a,a===0&&e()})}function W1(){km=!1}var Gm={pre:W1,create:Kx,update:Kx,destroy:H1,remove:V1};var t_=mo(Jx(),1),zm=mo(e_(),1);function Hm(i,e={}){let t=e.directive||"@";function n(o,a,c){if(o==="!--")return bo("!",a.comment);c&&c.length&&(c.length===1?c=c[0]:c=[].concat.apply([],c));let l=Object.keys(a);if(!l||!l.length)return bo(o,c);let h={};for(let u=0,d=l.length;d>u;u++){let f=l[u];if(f.indexOf(t)===0){let g=f.slice(1).split(":");(g[0]!=="attrs"||(0,zm.default)(g[1]))&&a[f]==="false"&&(a[f]=!1);let A=h;for(let m=0,b=g.length,x=b-1;m<b;m++){let y=g[m];m===x?A[y]=a[f]:A[y]?A=A[y]:A=A[y]={}}}else(0,zm.default)(f)&&a[f]==="false"&&(a[f]=!1),h.attrs||(h.attrs={}),h.attrs[f]=a[f]}return bo(o,h,c)}let s=Dm(i||[]),r=(0,t_.default)(n,{comments:!0,attrToProp:!1});return r.update=function(a,c){return s(a,c)},r.thunk=Lm,r}var Je=Hm([Pm,Nm,Fm,Um,Gm]);var n_=":host{--content-z-index:var(--syndiMosaicContentZIndex, 99999)}.mosaic-position{position:relative;inline-size:1px;block-size:1px;--ribbon-z-index:var(--syndiMosaicRibbonZIndex, var(--content-z-index));--ribbon-inset-inline-start:var(--syndiMosaicRibbonInsetInlineStart, 0px);--ribbon-inset-block-start:var(--syndiMosaicRibbonInsetBlockStart, 0px)}.mosaic-ribbon{display:block;position:absolute;inset-inline-start:var(--ribbon-inset-inline-start);inset-block-start:var(--ribbon-inset-block-start);min-inline-size:min(95vi,320px);block-size:46px;border-radius:100px;overflow:hidden;z-index:var(--ribbon-z-index)}.mosaic-ribbon-stationary{position:absolute;display:flex;inset-inline-start:0;z-index:1}button.mosaic-ribbon-eye>syndigo-svg-icon{color:var(--syndiMosaicBoardStyleMenuIconBackgroundColor,#3071a9)}.mosaic-content{position:absolute;inset-block-start:0px;inset-inline-start:0px}button.mosaic-iconbutton{border:0;border-radius:var(--syndiMosaicMenuIconBorderRadius,50%);outline:0;margin:0;padding:0;background-color:transparent;transition:transform .3s}button.mosaic-ribbon-internal.mosaic-iconbutton syndigo-svg-icon{fill:#565758;color:transparent}button.mosaic-ribbon-internal.mosaic-iconbutton:focus,button.mosaic-ribbon-internal.mosaic-iconbutton:hover{position:relative;transform:translateY(2px)}button.mosaic-ribbon-internal :is(.mosaic-iconbutton:hover syndigo-svg-icon,.mosaic-iconbutton:focus syndigo-svg-icon,.mosaic-iconbutton:active syndigo-svg-icon,.mosaic-iconbutton.mosaic-selected syndigo-svg-icon){fill:#3047ac}button.mosaic-ribbon-eye{z-index:1;inline-size:var(--syndiMosaicMenuIconWidth,40px);block-size:var(--syndiMosaicMenuIconHeight,40px);inset-inline-start:0;box-shadow:var(--syndiMosaicMenuIconBoxShadow,0 1px 4px 0 rgba(0,0,0,.5));-webkit-tap-highlight-color:rgba(255,255,255,0);margin-block-start:3px;transition:all .3s ease-in-out}button.mosaic-ribbon-eye:focus,button.mosaic-ribbon-eye:hover{margin-inline-start:3px;outline:solid 3px}button.mosaic-ribbon-eye:active{outline:0}.mosaic-ribbon-stripe-menu{display:block;position:absolute;padding-inline-start:20px;text-align:start;z-index:0;inset-block-start:6px;inset-inline-start:-360px;background-color:#f0f0f0;border:1px solid transparent;block-size:30px;box-shadow:0 1px 4px 0 rgba(0,0,0,.5);font-size:10px;transition:left .7s cubic-bezier(.4, 0, .2, 1);overflow:hidden}button.mosaic-ribbon-internal{inline-size:28px;block-size:28px}.mosaic-ribbon-popover{position:absolute;inline-size:960px;inset-block-start:48px;min-inline-size:min(95vi,320px);max-inline-size:85vi;padding:12px;background-color:#fff;box-shadow:0 2px 5px 0 rgba(0,0,0,.5);border:solid 1px #ccc;z-index:var(--content-z-index);display:grid;grid-template-rows:32px 1fr 32px}.mosaic-header-button{background-color:transparent;border:none;padding-block-start:2px;margin:0;inline-size:26px;block-size:26px;display:flex;justify-content:center;align-items:center}button.mosaic-header-button:focus,button.mosaic-header-button:hover{border:solid 1px}.mosaic-ribbon-popover:fullscreen .mosaic-header-button.close-button{display:none}.mosaic-ribbon-popover-footer,.mosaic-ribbon-popover-header{display:flex;flex-direction:row;justify-content:flex-end}.mosaic-ribbon-popover-header{block-size:25px;inline-size:100%;align-items:center}.mosaic-ribbon-popover-footer{align-items:flex-end}.mosaic-ribbon-popover-scrollable{inline-size:100%;max-inline-size:calc(100% - 12px);overflow-y:auto}.mosaic-ribbon-popover-triangle{block-size:14px;inline-size:29px;overflow:hidden;position:absolute;inset-block-start:-14px;margin-inline-start:-29px}.mosaic-ribbon-popover-triangle::after{content:'';display:block;inline-size:20px;block-size:20px;border:solid 1px #ccc;box-shadow:-1px 0 1px 0 rgba(0,0,0,.1);transform:rotate(45deg);margin:auto;margin-block-start:5px;background-color:#fff}syndigo-mosaic{z-index:var(--content-z-index)}.mosaic-overlay{position:fixed;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;background:rgba(255,255,255,.6);z-index:var(--content-z-index)}";var ms=":host{--syndiDefaultFontFamily:'wcOpenSans',Arial,Verdana,Helvetica,sans-serif;font-family:var(--syndiDefaultFontFamily)}:host *{box-sizing:border-box}*,:after,:before{box-sizing:inherit}p.ql-indent-1{padding-inline-start:3em!important}li.ql-indent-1{margin-inline-start:3em!important}.ql-align-center{text-align:center!important}.ql-align-justify{text-align:justify!important}.ql-align-right{text-align:end!important}.ql-inline-block{display:inline-block!important}.syndigo-powerpage-grid-widget:fullscreen{inline-size:100%;block-size:100%;background-color:#fff}button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation}img,picture{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none;-webkit-tap-highlight-color:transparent}button.syndigo-iconbutton{display:flex;justify-content:center;align-items:center;margin:0;padding:0;color:var(--syndiCommonElementControlsColor)}.syndigo-visually-hidden{border:0;clip:rect(0 0 0 0);clip:rect(0,0,0,0);block-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;inline-size:1px;white-space:nowrap;display:block}";function Di(i,e){return i.modules["experience/widget-catalog"][e]}function Ka(i,e,t){if(!e.fullscreen)return;let n=0,s=0;if(i===Hn.mosaic){let r=t?.querySelector(".mosaic-ribbon-popover-scrollable");r&&(n=r.offsetWidth,s=r.offsetHeight)}else if(i===Hn.powerpage&&t){n=window.innerWidth;let r=getComputedStyle(t).paddingBlockStart||"";r=r?parseInt(r):0,s=window.screen.height-r}e.fullscreen={...e.fullscreen,maxWidth:n,maxHeight:s}}function vo(i){let e=i.translations.Common["powered-by-text"].replace("%s","");return Je`<div class="syndigo-watermark" style="display: flex; align-items: center;">       
        <span style="font-family: sans-serif; font-size: 10px; font-style: italic; padding-inline-end: 4px; padding-block-start: 3px;">${e}</span>
        <img style="inline-size: 80px; block-size: auto;" loading="lazy" src="${window.SYNDI.getContentDomain()}/asset/icons/syndigo.svg" alt="syndigo" />
    </div>`}function Eo(i){let e=ds(i.moduleParameters);return e.fullscreenSupport==="true"?!0:e.fullscreenSupport==="false"?!1:window.document.fullscreenEnabled}function zs(i){let e={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};return e.hasOwnProperty(i)?e[i]:i}var eB=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Vm=eB.join(","),r_=typeof Element>"u",Ol=r_?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,id=!r_&&Element.prototype.getRootNode?function(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}:function(i){return i?.ownerDocument},sd=function i(e,t){var n;t===void 0&&(t=!0);var s=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert"),r=s===""||s==="true",o=r||t&&e&&i(e.parentNode);return o},tB=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},nB=function(e,t,n){if(sd(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(Vm));return t&&Ol.call(e,Vm)&&s.unshift(e),s=s.filter(n),s},iB=function i(e,t,n){for(var s=[],r=Array.from(e);r.length;){var o=r.shift();if(!sd(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),c=a.length?a:o.children,l=i(c,!0,n);n.flatten?s.push.apply(s,l):s.push({scopeParent:o,candidates:l})}else{var h=Ol.call(o,Vm);h&&n.filter(o)&&(t||!e.includes(o))&&s.push(o);var u=o.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(o),d=!sd(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(u&&d){var f=i(u===!0?o.children:u.children,!0,n);n.flatten?s.push.apply(s,f):s.push({scopeParent:o,candidates:f})}else r.unshift.apply(r,o.children)}}return s},o_=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},a_=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||tB(e))&&!o_(e)?0:e.tabIndex},sB=function(e,t){var n=a_(e);return n<0&&t&&!o_(e)?0:n},rB=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},c_=function(e){return e.tagName==="INPUT"},oB=function(e){return c_(e)&&e.type==="hidden"},aB=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},cB=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},lB=function(e){if(!e.name)return!0;var t=e.form||id(e),n=function(a){return t.querySelectorAll('input[type="radio"][name="'+a+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=n(window.CSS.escape(e.name));else try{s=n(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var r=cB(s,e.form);return!r||r===e},hB=function(e){return c_(e)&&e.type==="radio"},uB=function(e){return hB(e)&&!lB(e)},dB=function(e){var t,n=e&&id(e),s=(t=n)===null||t===void 0?void 0:t.host,r=!1;if(n&&n!==e){var o,a,c;for(r=!!((o=s)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(s)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!r&&s;){var l,h,u;n=id(s),s=(l=n)===null||l===void 0?void 0:l.host,r=!!((h=s)!==null&&h!==void 0&&(u=h.ownerDocument)!==null&&u!==void 0&&u.contains(s))}}return r},i_=function(e){var t=e.getBoundingClientRect(),n=t.width,s=t.height;return n===0&&s===0},fB=function(e,t){var n=t.displayCheck,s=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var r=Ol.call(e,"details>summary:first-of-type"),o=r?e.parentElement:e;if(Ol.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof s=="function"){for(var a=e;e;){var c=e.parentElement,l=id(e);if(c&&!c.shadowRoot&&s(c)===!0)return i_(e);e.assignedSlot?e=e.assignedSlot:!c&&l!==e.ownerDocument?e=l.host:e=c}e=a}if(dB(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return i_(e);return!1},pB=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var s=t.children.item(n);if(s.tagName==="LEGEND")return Ol.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},mB=function(e,t){return!(t.disabled||sd(t)||oB(t)||fB(t,e)||aB(t)||pB(t))},s_=function(e,t){return!(uB(t)||a_(t)<0||!mB(e,t))},AB=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},gB=function i(e){var t=[],n=[];return e.forEach(function(s,r){var o=!!s.scopeParent,a=o?s.scopeParent:s,c=sB(a,o),l=o?i(s.candidates):a;c===0?o?t.push.apply(t,l):t.push(a):n.push({documentOrder:r,tabIndex:c,item:s,isScope:o,content:l})}),n.sort(rB).reduce(function(s,r){return r.isScope?s.push.apply(s,r.content):s.push(r.content),s},[]).concat(t)},l_=function(e,t){t=t||{};var n;return t.getShadowRoot?n=iB([e],t.includeContainer,{filter:s_.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:AB}):n=nB(e,t.includeContainer,s_.bind(null,t)),gB(n)};var yB=({ev:i,callback:e,preventDefault:t,key:n})=>{t&&i.preventDefault(),e(n)},h_=({ev:i,callback:e,preventDefault:t,keyStrings:n=[]})=>{let s=zs(i.key),r;for(let o of n)if(s===o){r=!0;break}r&&yB({ev:i,callback:e,preventDefault:t,key:s})};function Wm(i,e,t=!1){h_({ev:e,callback:()=>{let n=l_(i,{getShadowRoot:t}),s=e.target;t&&(s=e.composedPath()?.[0]),s===n[n.length-1]&&(e.preventDefault(),n[0]?.focus())},preventDefault:!1,keyStrings:["Tab"]})}function Nl(i){return new DOMParser().parseFromString(i,"text/html").body.textContent||""}var bB={Carousel:"wc-carousel",ComparisonTable:"wc-comparison-table",FreeFormHtml:"wc-document-gallery",DocumentGallery:"wc-document-gallery",FeatureSet:"wc-feature-set",InlineFrame:"wc-inline-frame",ImageGallery:"wc-image-gallery",InteractiveTour:"wc-interactive-tour",SpecificationTable:"wc-comparison-table",ThreeSixty:"wc-three-sixty",VideoGallery:"wc-video-gallery"},d_=".mosaic-ribbon-eye.mosaic-iconbutton",xB=".mosaic-ribbon-popover-header .mosaic-header-button",_B=".mosaic-ribbon-internal.mosaic-iconbutton.mosaic-selected",f_=".mosaic-ribbon-internal.mosaic-iconbutton.mosaic-last",As={buttons:{close:{bgColor:"transparent",fgColor:"black",height:18,width:18},fullscreen:{bgColor:"transparent",fgColor:"black",height:14,width:14}},ribbonIcons:{height:24,width:24}};function Ul(i,e){i?.querySelector(e)?.focus()}function u_(i,e,t){i&&zs(e.key)==="Tab"&&(e.shiftKey?t===f_&&(e.preventDefault(),Ul(i,t)):(e.preventDefault(),Ul(i,t)))}function vB(){let i=window.SYNDI.getFramework(),e=go(i.moduleParameters);return{config:{displayMode:"ribbon",showWatermark:!0,icon:e.icon,widgetIcons:e.widgetIcons,scrollWhenItemSelected:e.scrollWhenItemSelected,fixedScrollPosition:e.fixedScrollPosition,ribbonMainIcon:{width:e.iconWidth,height:e.iconHeight,fgColor:"white"},isFullscreenDisabled:!Eo(i),mosaicWidgetIds:[],widgets:{}},state:{intersectionObserver:void 0,framework:i,ribbonVisible:e.defaultOpen,selectedWidgetId:void 0,maximized:!1,fullscreenObserver:void 0,fullscreenEnableTime:void 0,resizeObserver:void 0,track:void 0,widgetOpenTime:void 0,closeOnEscape:void 0,widgets:{},contentElement:void 0,fullscreenElement:void 0,uuid:Ii()}}}function EB(i,e){let{framework:t}=i.state,{componentId:n,enhancedProductContentId:s}=e;i.config={...i.config,...e.experiences.hero};let o=ds(t.moduleParameters).showHeroWatermark!=="false";i.config.showWatermark=o&&e.experiences.hero.showWatermark;let a=function(c){c=Ua("mosaic",s,n,c),ka(t,c)};i.state.track=a;for(let c of e.experiences.hero.mosaicWidgetIds){let l=e.experiences.hero.widgets[c],{widgetType:h}=l,u=Di(t,h);u&&(i.state.widgets[c]=u.init({...l,framework:t,track:a,experience:Hn.mosaic,localize:d=>t.localize(h,d),fullscreen:{isEnabled:!1,isFeatureDisabled:!0,maxWidth:0,maxHeight:0}}))}a({a:"load"}),i.state.ribbonVisible&&i.state.track({a:"open-ribbon"})}function SB(i,e){let s=-(30*i.config.mosaicWidgetIds.length),r=Math.min(-270,s),o=i.config.ribbonMainIcon.width-18,a=function(f){if(i.state.selectedWidgetId!==f){Km(i),i.state.widgetOpenTime=Date.now();let p=i.state.widgets[f]?.widgetType;i.state.track({a:"open",wi:f,wt:p})}i.state.selectedWidgetId=f,e(),i.config.scrollWhenItemSelected&&window.scrollTo({top:i.config.fixedScrollPosition,left:0,behavior:"smooth"}),Ul(i.state.contentElement,xB)},c=()=>{let f=[];for(let p=0;p<i.config.mosaicWidgetIds.length;p++){let g=i.config.mosaicWidgetIds[p],A=i.config.widgets[g],m=i.config.widgetIcons[A.widgetType]||bB[A.widgetType],b=p+1===i.config.mosaicWidgetIds.length,x=i.state.selectedWidgetId===g,y=`${A.widgetType} ${i.state.framework.translations.Common["see-more-open"]}`;f.push(Je`<button id="${g}" class="mosaic-ribbon-internal mosaic-iconbutton"
                    @attrs:tabindex=${i.state.ribbonVisible?0:-1}
                    @attrs:aria-hidden=${!i.state.ribbonVisible}
                    
                    @class:mosaic-selected=${x}
                    @class:mosaic-last=${b}
                    @on:click="${()=>a(g)}"
                    @on:keydown="${b&&!x?_=>u_(i.state.contentElement,_,d_):""}">

                    <syndigo-svg-icon icon="${m}" data-title="${y}"
                        width="${As.ribbonIcons.width}"
                        height="${As.ribbonIcons.height}" />
                </button>`)}return f},l=i.state.ribbonVisible,h=l?"close":"open",u=i.state.framework.translations.Common[`see-more-${h}`],d="mosaic-ribbon-stripe-menu";return Je`<div class="mosaic-ribbon">
        <div class="mosaic-ribbon-stationary">
            <button class="mosaic-ribbon-eye mosaic-iconbutton"

                @attrs:aria-controls="${d}"
                @attrs:aria-expanded="${l}"
                @on:click=${()=>p_(i,e)}
                @on:keydown="${l?f=>f.shiftKey?u_(i.state.contentElement,f,f_):"":null}">

                <syndigo-svg-icon id="mosaic-menu-icon" icon="${i.config.icon}" data-title="${u}"
                    width="${i.config.ribbonMainIcon.width}"
                    height="${i.config.ribbonMainIcon.height}"
                    fill="${i.config.ribbonMainIcon.fgColor}" />
            </button>
        </div>
        <div id="${d}" class="mosaic-ribbon-stripe-menu"
            @attrs:aria-hidden=${!l}
            @style:inset-inline-start=${l?`${o}px`:`${r}px`}>
            ${c()}
            
        </div>
    </div>`}function wB(i,e){let t=42;if(i.state.contentElement){let l=`button[id="${i.state.selectedWidgetId}"]`,h=i.state.contentElement.querySelector(l);h&&(t+=h.offsetLeft)}let n=function(l){i.state.fullscreenElement=l.elm,setTimeout(e,0),i.state.resizeObserver=new ResizeObserver(function(){i.displayWidth=l.elm.offsetWidth-38,e()}),i.state.resizeObserver.observe(l.elm),i.state.fullscreenObserver=function(){if(i.state.maximized)if(window.document.fullscreenElement){let h=i.state.widgets[i.state.selectedWidgetId];Ka(Hn.mosaic,h,i.state.fullscreenElement)}else{let h=i.state.widgets[i.state.selectedWidgetId];i.state.maximized=!1;let u=(Date.now()-i.state.fullscreenEnableTime)/1e3;i.state.track({a:"full-screen-close",wt:h?.widgetType||null,wi:h?.widgetId||null,t:u}),h.fullscreen.isEnabled=!1}e()},window.document.addEventListener("fullscreenchange",i.state.fullscreenObserver)},s=function(l,h){if(l.shiftKey)return;let u=h.state.contentElement.querySelector(".mosaic-ribbon-popover");Wm(u,l)},r="display: none;",o,a,c;return i.state.selectedWidgetId&&(a=i.state.widgets[i.state.selectedWidgetId],o=Di(i.state.framework,a.widgetType),a.displayWidth=i.displayWidth,c=`${Nl(a.headerText||a.widgetType)}`,r=i.state.maximized?"inline-size: 97vi !important; max-inline-size: 97vi !important; block-size: 90vb":""),Je`<div class="mosaic-ribbon-popover" style="${r}"
        @key="mosaic-ribbon-popover-${i.state.uuid}"
        @hook:insert=${n}
        role="dialog"
        aria-label="${c}"
        @on:keydown=${l=>s(l,i)}>

        <div class="mosaic-ribbon-popover-triangle"
            @style:left="${t}px">
        </div>

        ${o?CB(i,e):""}

        <div class="mosaic-ribbon-popover-scrollable">${o?o.view(a,e):""}</div>

        <footer class="mosaic-ribbon-popover-footer">
            ${i.config.showWatermark?vo(i.state.framework):""}
        </footer>
    </div>`}function CB(i,e){let n=`${i.state.widgets[i.state.selectedWidgetId].widgetType} ${i.state.framework.translations.Common["see-more-close"]}`;return Je`<div class="mosaic-ribbon-popover-header">
        
        ${MB(i,e)}

        <button class="mosaic-header-button close-button"
            @on:click=${()=>qm(i,e)} >
            <syndigo-svg-icon icon="close-thin" data-title="${n}"
                width="${As.buttons.close.width}"
                height="${As.buttons.close.height}"
                fill="${As.buttons.close.fgColor}"
                color="${As.buttons.close.bgColor}" />
        </button>
    </div>`}function MB(i,e){let t=i.state.maximized?i.state.framework.translations.Common["minimize-tooltip"]:i.state.framework.translations.Common["fullscreen-tooltip"];return Je`<button class="mosaic-header-button"
            @style:display=${i.config.isFullscreenDisabled?"none":""}
            @on:click=${n=>{BB(n,i,e)}}>
            <syndigo-svg-icon icon="${i.state.maximized?"fullscreen-exit":"expand"}"
                data-title="${t}"
                width="${As.buttons.fullscreen.width}"
                height="${As.buttons.fullscreen.height}"
                fill="${As.buttons.fullscreen.fgColor}"
                color="${As.buttons.fullscreen.bgColor}" />
    </button>`}function TB(i,e){return Je`<div class="mosaic-overlay"
                     @on:click=${()=>qm(i,e)}
                     @style:display=${i.state.selectedWidgetId?"":"none"}></div>`}function p_(i,e){i.state.ribbonVisible?RB(i):IB(i),e()}function qm(i,e){Ul(i.state.contentElement,_B),Km(i),i.state.contentElement?.dispatchEvent(new CustomEvent("close-popover",{bubbles:!0,composed:!0})),e()}function IB(i){i.state.ribbonVisible=!0,i.state.track({a:"open-ribbon"}),document.addEventListener("keydown",i.state.closeOnEscape,{capture:!0}),i.state.contentElement?.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))}function RB(i){i.state.ribbonVisible=!1,Km(i),i.state.widgetOpenTime=void 0,document.removeEventListener("keydown",i.state.closeOnEscape,{capture:!0}),Ul(i.state.contentElement,d_),i.state.contentElement?.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}function BB(i,e,t){let n=i.currentTarget,s=e.state.widgets[e.state.selectedWidgetId];!window.document.fullscreenElement&&n?(s.fullscreen.isEnabled=!0,e.state.fullscreenEnableTime=Date.now(),e.state.track({a:"full-screen-open",wt:s.widgetType,wi:s.widgetId}),e.state.fullscreenElement.requestFullscreen(),e.state.maximized=!0):window.document.exitFullscreen&&document.exitFullscreen(),t()}function Km(i){if(i.state.selectedWidgetId===void 0)return;let e=(Date.now()-i.state.widgetOpenTime)/1e3;i.state.track({a:"close",t:e}),i.state.selectedWidgetId=void 0}function DB(i,e){i.state.closeOnEscape=i.state.closeOnEscape||function(s){if(zs(s.key)==="Escape"){if(i.state.selectedWidgetId)return qm(i,e);if(i.state.ribbonVisible)return p_(i,e)}};let t=function(s){i.state.contentElement=s.elm},n="";return i.state.widgets&&(n=Je`<div class="mosaic-position">
            ${TB(i,e)}
            ${SB(i,e)}
            ${wB(i,e)}
        </div>`),Je`<div class="mosaic-content"
                     @key=${i.state.uuid}
                     @hook:insert=${t}>

        <style>
            :host {
                --syndiThemeNoGap: 30px;
            }
        </style>
        <style>${ms}</style>
        <style>${n_}</style>
        

        ${n}
    </div>`}function LB(i){i.state.widgets&&(Object.keys(i.state.widgets).map(e=>{let t=i.state.widgets[e];Di(i.state.framework,t.widgetType).destroy(t)}),i.state.widgets=void 0),i.state.fullscreenObserver&&(window.document.removeEventListener("fullscreenchange",i.state.fullscreenObserver),i.state.fullscreenObserver=void 0),i.state.resizeObserver&&(i.state.resizeObserver.disconnect(),i.state.resizeObserver=void 0),i.state.closeOnEscape&&document.removeEventListener("keydown",i.state.closeOnEscape,{capture:!0})}var Nr={init:vB,view:DB,destroy:LB,loadContent:EB};function m_(i,e){e()}var __=mo(Xm(),1);var x_=":host([open]){z-index:var(--syndiMosaicContentFullScreenZIndex,99999)}.mosaic-content{inset-block-start:0px;inset-inline-start:0px}.mosaic-position{position:relative;inline-size:1px;block-size:1px}.mosaic-modal{position:relative;display:grid;grid-template-rows:32px 1fr 32px;background-color:#fff;padding:0}.mosaic-content:fullscreen .mosaic-modal{inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%}.mosaic-content:not(:fullscreen) .mosaic-modal{inline-size:95%;block-size:auto;max-inline-size:960px;max-block-size:660px}button.mosaic-ribbon-eye>syndigo-svg-icon{color:var(--syndiMosaicBoardStyleMenuIconBackgroundColor,#3071a9)}.flex-centered{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;display:flex;align-items:center;justify-content:center}button.mosaic-iconbutton{border:0;border-radius:50%;outline:0;margin:0;padding:0;background-color:transparent;z-index:calc(var(--syndiMosaicContentZIndex,99999) - 1)}button.mosaic-ribbon-eye{position:absolute;inline-size:var(--syndiMosaicMenuIconWidth,40px);block-size:var(--syndiMosaicMenuIconHeight,40px);inset-inline-start:0;box-shadow:0 1px 4px 0 rgba(0,0,0,.5);-webkit-tap-highlight-color:rgba(255,255,255,0)}button.mosaic-external-callout:focus{position:relative;transform:translateY(2px);color:#3071a9}.mosaic-modal-header-controls{position:absolute;inset-block-start:4px;inset-inline-end:4px;display:flex}.mosaic-ribbon-stripe-menu{font-size:10px}button.mosaic-ribbon-internal{inline-size:28px;block-size:28px}button.mosaic-ribbon-internal:focus{transform:translateY(2px)}.mosaic-header-button{background-color:transparent;border:none;padding:0;margin:0;inline-size:26px;block-size:26px;display:flex;justify-content:center;align-items:center}.mosaic-ribbon-popover-footer{justify-content:flex-end;padding-block:0px;padding-inline:12px}.mosaic-ribbon-popover-header{justify-content:space-between;align-items:center;background-color:#f0f0f0;padding-block:0px;padding-inline:12px}.mosaic-ribbon-popover-footer,.mosaic-ribbon-popover-header{display:flex;flex-direction:row}.mosaic-ribbon-popover-scrollable{padding-block:0px;padding-inline:12px;max-inline-size:100%;overflow-y:auto}.mosaic-content:fullscreen .mosaic-ribbon-popover-scrollable{padding:0;max-inline-size:100%}.mosaic-overlay{background-color:rgba(0,0,0,.4);z-index:var(--syndiMosaicContentZIndex,99999)}";var ZB={Carousel:"wc-carousel",ComparisonTable:"wc-comparison-table",FreeFormHtml:"wc-document-gallery",DocumentGallery:"wc-document-gallery",FeatureSet:"wc-feature-set",InlineFrame:"wc-inline-frame",ImageGallery:"wc-image-gallery",InteractiveTour:"wc-interactive-tour",SpecificationTable:"wc-comparison-table",ThreeSixty:"wc-three-sixty",VideoGallery:"wc-video-gallery"},v_="button.mosaic-external-callout",eD=".mosaic-ribbon-internal.mosaic-iconbutton",E_=".mosaic-ribbon-popover-scrollable";function ad(i,e){i?.querySelector(e)?.focus()}function tD(i,e,t){i&&zs(e.key)==="Tab"&&!e.shiftKey&&(e.preventDefault(),ad(i,t))}function nD(){let i=window.SYNDI.getFramework(),e=go(i.moduleParameters);return{config:{displayMode:"modal",showWatermark:!0,icon:e.icon,widgetIcons:e.widgetIcons,ribbonMainIcon:{mosaicIconHeight:e.iconHeight,mosaicIconWidth:e.iconWidth},isFullscreenDisabled:!Eo(i)},state:{framework:i,open:!1,selectedWidgetId:void 0,maximized:!1,resizer:void 0,fullscreenObserver:void 0,fullscreenEnableTime:void 0,track:void 0,widgetOpenTime:void 0,closeOnEscape:void 0,widgets:{},contentElement:void 0,uuid:Ii()}}}function iD(i,e){let{framework:t}=i.state,{componentId:n,enhancedProductContentId:s}=e;i.config={...i.config,...e.experiences.hero};let o=ds(t.moduleParameters).showHeroWatermark!=="false";i.config.showWatermark=o&&e.experiences.hero.showWatermark;let a=function(c){c=Ua("mosaic",s,n,c),ka(t,c)};i.state.selectedWidgetId=e.experiences.hero.mosaicWidgetIds[0],i.state.track=a;for(let c of e.experiences.hero.mosaicWidgetIds){let l=e.experiences.hero.widgets[c],{widgetType:h}=l,u=Di(t,h);u&&(i.state.widgets[c]=u.init({...l,framework:t,track:a,experience:Hn.mosaic,localize:d=>t.localize(h,d),fullscreen:{isEnabled:!1,isFeatureDisabled:!0,maxWidth:0,maxHeight:0}}))}a({a:"load"}),i.state.open&&i.state.track({a:"open-modal"})}function sD(i,e){let t=i.config.ribbonMainIcon.mosaicIconWidth,n=i.config.ribbonMainIcon.mosaicIconHeight,s="white",r=function(){i.state.open?od(i):oD(i,e),e()},o=i.state.open?"close":"open",a=i.state.framework.translations.Common[`see-more-${o}`],c=go(i.state.framework.moduleParameters);return c.calloutContent?Je`<button class="mosaic-external-callout"
                         style="${c.calloutStyle}"
                         @on:click=${l=>r(l)}
                         @attrs:aria-label=${a}
                         @props:innerHTML=${c.calloutContent}> </button>`:(v_=".mosaic-ribbon-eye.mosaic-iconbutton",Je`<button class="mosaic-ribbon-eye mosaic-iconbutton"
                        @on:click=${l=>r(l)}
                        @attrs:aria-label=${a}>
            <syndigo-svg-icon icon="${i.config.icon}" width="${t}" height="${n}" fill="${s}" />
        </button>`)}function rD(i,e){let t=function(s){if(i.state.selectedWidgetId!==s){S_(i),i.state.widgetOpenTime=Date.now();let r=i.state.widgets[s]?.widgetType;i.state.track({a:"open",wi:s,wt:r})}i.state.selectedWidgetId=s,e(),ad(i.state.contentElement,E_)},n=[];for(let s=0;s<i.config.mosaicWidgetIds.length;s++){let r=i.config.mosaicWidgetIds[s],o=i.state.widgets[r],a=i.state.selectedWidgetId===r?"#3071a9":"#565758",c=i.config.widgetIcons[o.widgetType]||ZB[o.widgetType],l=i.state.selectedWidgetId===r;n.push(Je`<button class="mosaic-ribbon-internal mosaic-iconbutton"
            aria-label="${o.widgetType} ${i.state.framework.translations.Common["see-more-open"]}"
            @class:mosaic-selected=${l}
            @on:click=${h=>t(r,h)} >
            <syndigo-svg-icon icon="${c}" width="24" height="24" fill="${a}" color="transparent" />
        </button>`)}return Je`<div class="mosaic-ribbon-popover-header">
        <div class="mosaic-ribbon-stripe-menu"
            @style:inset-inline-start=${i.state.open?"20px":"-270px"}>
            ${n}
        </div>
    </div>`}function od(i){S_(i),i.state.widgetOpenTime=void 0,i.state.open=!1,document.removeEventListener("keydown",i.state.closeOnEscape,{capture:!0}),i.state.maximized&&document.exitFullscreen(),ad(i.state.contentElement,v_),i.state.contentElement.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}function oD(i){i.state.open=!0,i.state.selectedWidgetId=i.config.mosaicWidgetIds[0],i.state.widgetOpenTime=Date.now(),i.state.widgetOpenTime=Date.now(),document.addEventListener("keydown",i.state.closeOnEscape,{capture:!0}),i.state.track({a:"open-modal"}),i.state.contentElement.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),ad(i.state.contentElement,E_)}function aD(i,e){if(!i.state.track)return;let t=i.state.widgets[i.state.selectedWidgetId],n=Di(i.state.framework,t.widgetType);t.displayWidth=i.displayWidth;let s=function(l){i.displayWidth=l.elm.offsetWidth,setTimeout(e,0),i.state.resizer=(0,__.default)(function(){i.displayWidth=l.elm.offsetWidth,setTimeout(e,0)},200),window.addEventListener("resize",i.state.resizer),i.state.fullscreenObserver=function(){if(i.state.maximized)if(window.document.fullscreenElement){let h=i.state.widgets[i.state.selectedWidgetId];Ka(Hn.mosaic,h,i.state.contentElement)}else{let h=i.state.widgets[i.state.selectedWidgetId];i.state.maximized=!1;let u=(Date.now()-i.state.fullscreenEnableTime)/1e3;i.state.track({a:"full-screen-close",wt:h?.widgetType||null,wi:h?.widgetId||null,t:u}),h.fullscreen.isEnabled=!1}e()},window.document.addEventListener("fullscreenchange",i.state.fullscreenObserver)},r=function(l){i.displayWidth=l.elm.offsetWidth},o=function(l){l.target.classList.contains("flex-centered")&&(od(i),e())},a="black",c="transparent";return Je`<div class="flex-centered mosaic-overlay"
                     @on:click=${o}
                     @style:display=${i.state.open?"":"none"}>
        <div class="mosaic-modal"
             @class:mosaic-modal-maximized=${i.state.maximized}
             @hook:insert=${s}
             @hook:update=${r}
             @key="mosaic-ribbon-popover-${i.state.uuid}"
             @style:display=${i.state.open?"":"none"}>
            ${rD(i,e)}
            <div class="mosaic-ribbon-popover-scrollable">
                ${n.view(t,e)}
            </div>

            <div class="mosaic-modal-header-controls">
                <button class="mosaic-header-button"
                        @style:display=${i.config.isFullscreenDisabled?"none":""}
                        @attrs:aria-label="${i.state.maximized?i.state.framework.translations.Common["minimize-tooltip"]:i.state.framework.translations.Common["fullscreen-tooltip"]}"
                        @on:click=${l=>{cD(l,i,e)}}>
                    <syndigo-svg-icon icon="${i.state.maximized?"fullscreen-exit":"expand"}"
                                      width="14" height="14" fill="${a}" color="${c}" />
                </button>
                <button class="mosaic-header-button"
                        @on:click=${()=>{od(i),e()}}
                        @on:keydown="${l=>tD(i.state.contentElement,l,eD)}"
                        aria-label="${i.state.framework.translations.Common["see-more-close"]}">
                        <syndigo-svg-icon icon="close-thin" width="18" height="18" fill="${a}" color="${c}" />
                </button>
            </div>

            <div class="mosaic-ribbon-popover-footer">
                ${i.config.showWatermark?vo(i.state.framework):""}
            </div>
        </div>
    </div>`}function cD(i,e,t){let n=i.currentTarget,s=e.state.widgets[e.state.selectedWidgetId];!window.document.fullscreenElement&&n?(s.fullscreen.isEnabled=!0,e.state.fullscreenEnableTime=Date.now(),e.state.track({a:"full-screen-open",wt:s.widgetType,wi:s.widgetId}),e.state.contentElement.requestFullscreen(),e.state.maximized=!0):window.document.exitFullscreen&&document.exitFullscreen(),t()}function S_(i){if(!i.state.track)return;let e=(Date.now()-i.state.widgetOpenTime)/1e3;i.state.track({a:"close",t:e})}function lD(i,e){i.state.closeOnEscape=i.state.closeOnEscape||function(r){zs(r.key)==="Escape"&&(od(i),e())};let t=function(r){i.state.contentElement=r.elm},n="absolute";i.state.maximized?n="fixed":i.state.open&&(n="");let s="";return i.state.widgets&&(s=Je`<div>
            ${sD(i,e)}
            ${aD(i,e)}
        </div>`),Je`<div class="mosaic-content"
                     @key=${i.state.uuid}
                     @style:position=${n}
                     @hook:insert=${t}>

        <style>${ms}</style>
        <style>${x_}</style>

        ${s}

    </div>`}function hD(i){i.state.widgets&&(Object.keys(i.state.widgets).map(e=>{let t=i.state.widgets[e];Di(i.state.framework,t.widgetType).destroy(t)}),i.state.widgets=void 0),i.state.resizer&&(window.removeEventListener("resize",i.state.resizer),i.state.resizer=void 0),i.state.fullscreenObserver&&(window.document.removeEventListener("fullscreenchange",i.state.fullscreenObserver),i.state.fullscreenObserver=void 0),i.state.closeOnEscape&&document.removeEventListener("keydown",i.state.closeOnEscape,{capture:!0})}var Ur={init:nD,view:lD,destroy:hD,loadContent:iD};function w_(i,e){e()}function C_(i){i?.modal?Ur.destroy(i.modal):i?.ribbon&&Nr.destroy(i.ribbon)}function dD(i,e){let t=document.createElement("style");return e.appendChild(t),t.type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),t}function Ym(i){let{el:e,styleId:t,type:n}=i,s=(e.shadowRoot||document).getElementById(t);if((e.shadowRoot||document).getElementById(t))return s;let r=e.shadowRoot||document.head||document.getElementsByTagName("head")[0],o;return n==="external"?(o=document.createElement("link"),o.href=i.href,o.type="text/css",o.rel="stylesheet",r.appendChild(o)):n==="inline"&&(o=dD(i.css.replace(/\n/g," "),r)),o.classList.add("syndigo-widget-style"),o.setAttribute("id",t),o}function So(i){let e=document.createElement("textarea");return e.innerHTML=i,e.value}function M_(i,e){if(!e)return;let t=s=>({DarkMode:`
                
            --syndiThemeDarkModeBackgroundColor: #000000;
            --syndiThemeDarkModeColor: #FFFFFF;
            --syndiThemeDarkModeSectionBackgroundColor: #1D1D1D;
        
                
            --syndiThemeDarkModeInteractiveTourHotspotColor: #2279d4;
            --syndiThemeDarkModeInteractiveTourHotspotBorderColor: rgb(34, 121, 212);
            --syndiThemeDarkModeInteractiveTourHotspotBackgroundColor: #00478F;
        
                
            --syndiThemeDarkModeElementControlsBorderColor: #A6A6A6;
            --syndiThemeDarkModeElementControlsSelectedBorderColor: #4D84E6;
            --syndiThemeDarkModeElementControlsColor: #A6A6A6;
            --syndiThemeDarkModeMoreInfoTooltipBorderColor: #A6a6a6;
        
                
            --syndiThemeDarkModeOddRowBackgroundColor: #2F2F2F;
            --syndiThemeDarkModeHeaderCellTextColor: #FFFFFF;
            --syndiThemeDarkModeHeaderCellTextColorHover: #FFFFFF;

            --syndiThemeDarkModeDataCellBackgroundColor: #000000;
            --syndiThemeDarkModeDataCellTextColor: #FFFFFF;
            --syndiThemeDarkModeDataCellBorderColor: #B7B7B8;
            --syndiThemeDarkModeDataCellBackgroundColorHover: #484747;
            --syndiThemeDarkModeDataCellTextColorHover: #FFFFFF;

            --syndiThemeDarkModeCompTablePinnableBackgroundColor: #454545;
            --syndiThemeDarkModeCompTablePinnableTextColor: #FFFFFF;
            --syndiThemeDarkModeCompTableActionColor: #4d99f9;

            --syndiThemeDarkModeCompTableHeaderCellBackgroundColor: #000000;
            --syndiThemeDarkModeCompTableThisProductBackgroundColor: #454545;
            --syndiThemeDarkModeCompThisProductColor: #FFFFFF;
            --syndiComparisonTableFeatureLabelBackgroundColor:  #ededee;

            --syndiThemeDarkModeSpecTableGroupHeaderBackgroundColor: #2F2F2F;
            --syndiThemeDarkModeSpecTableTextColor: #A0A0A0;
            
        
            `.replace(/\s/g,""),NoGap:"--syndiThemeNoGap: 0;",RoundWidgetMediaCorners:"--syndiThemeRoundWidgetMediaCorners: clamp(8px, 1.5vw, 16px);",RoundWidgetCorners:"--syndiThemeRoundWidgetCorners: clamp(8px, 1.5vw, 16px);",RoundOuterCorners:"--syndiThemeRoundOuterCorners: clamp(12px, 2vw, 24px);"})[s]||"";e.siteThemeProperties="";let n=e.theme||[];for(let s of n)e.siteThemeProperties+=t(s)}function Hs(i){let e=i.rawSiteCssProperties;if(!e)return;let t={hero:{},mosaic:{},powerpage:{},widget:{},common:{}};for(let s of Object.keys(e))s.startsWith("Hero")?t.hero[`--syndi${s}`]=So(e[s]):s.startsWith("Mosaic")?t.mosaic[`--syndi${s}`]=So(e[s]):s.startsWith("PowerPage")?t.powerpage[`--syndi${s}`]=So(e[s]):pD(s)?t.widget[`--syndi${s}`]=So(e[s]):t.common[`--syndi${s}`]=So(e[s]);let n={hero:Object.keys(t.hero).map(s=>`${s} : ${t.hero[s]};`).join(""),mosaic:Object.keys(t.mosaic).map(s=>`${s} : ${t.mosaic[s]};`).join(""),powerpage:Object.keys(t.powerpage).map(s=>`${s} : ${t.powerpage[s]};`).join(""),widget:Object.keys(t.widget).map(s=>`${s} : ${t.widget[s]};`).join(""),common:Object.keys(t.common).map(s=>`${s} : ${t.common[s]};`).join("")};i.siteCssProperties=n,Ym({el:document.head,styleId:"syndigo-hero-styles",type:"inline",css:`syndigo-hotspots, syndigo-hotspots-overlay, .syndigo-popover {
            ${n.hero}
        }
        syndigo-mosaic, syndigo-mosaic-ribbon, syndigo-mosaic-modal {
            ${n.mosaic}
            ${n.widget}
        }
        syndigo-hotspots, syndigo-hotspots-overlay, syndigo-mosaic,
        syndigo-mosaic-ribbon, syndigo-mosaic-modal {
            ${n.common}
        }`}),i.rawSiteCssProperties=void 0}var fD=["Carousel","ComparisonTable","DocumentGallery","FeatureSet","InteractiveTour","ThreeSixty","VideoGallery"];function pD(i){for(let e of fD)if(i.startsWith(e))return!0;return!1}async function T_(i,e){try{let t=i.ecJson,n=window.SYNDI.getFramework();Hs(n),await window.SYNDI.importDynamic("experience/widget-catalog"),i.modal?(i.modal=Ur.init(),Ur.loadContent(i.modal,t)):(i.ribbon=Nr.init(),Nr.loadContent(i.ribbon,t)),Vn("LOAD_SUCCESS",i,e)}catch(t){console.warn("failed to load syndigo mosaic data:",t),Vn("LOAD_FAILURE",i,e)}}function I_(i,e){i.ecJson&&Vn("LOAD",i,e)}var gD={unmounted:{CONNECT:"mounted"},mounted:{VIEWPORT_INTERSECT:"visible"},visible:{LOAD:"loading"},loading:{LOAD_SUCCESS:"loaded",LOAD_FAILURE:"failed"},loaded:{LOAD:"loading",DISCONNECT:"unmounted",LOAD_FAILURE:"failed"},failed:{LOAD:"loading"}},yD={failed:m_,loaded:w_,loading:T_,visible:I_},bD={loaded:C_};function Vn(i,e,t,n){let s=e.state,r=gD[s][i];if(!r||s===r)return;let o=bD[s];e.state=r,o&&o(e,t,i,n);let a=yD[r];a&&a(e,t,i,n)}var cd=An.syndi_abtesting,xD=31536e6,R_=100,_D=function(i){if(Object.keys(i).length<=R_)return i;let e=Date.now(),t=Object.keys(i).filter(s=>i[s].date>e).sort((s,r)=>i[s].date<i[r].date?1:i[s].date>i[r].date?-1:0).slice(0,R_),n={};return t.map(s=>n[s]=i[s]),n},B_=function(i){try{let e=JSON.parse(window.localStorage.getItem(cd));e&&(e[i]&&delete e[i],window.localStorage.setItem(cd,JSON.stringify(e)))}catch{}};function jm(i,e,t){let n=e.experiences||{},s,r,o,a=Object.keys(n);if(!Or(i.tracking))return n[a[0]];if(a.length<2)return B_(t),n[a[0]];if(e.duration&&vD(e.duration))return B_(t),n.main;try{o=JSON.parse(window.localStorage.getItem(cd)),o&&o[t]&&(s=o[t].ecId,r=o[t].date)}catch{}s&&!n[s]&&(s=void 0);let c=Date.now();if(r&&r<c&&(s=void 0,r=void 0),r||(r=e.duration?.EndDate?new Date(e.duration.EndDate).getTime():c+xD),!s){let h=a.map(f=>n[f].weight).reduce((f,p)=>p+f),u=Math.random(),d=0;a.sort().map(f=>{d+=n[f].weight/h,d>=u&&!s&&(s=f)})}if(o=o||{},o[t]={ecId:s,date:r},o=_D(o),window.localStorage.setItem(cd,JSON.stringify(o)),!!(e.experimentId||e.duration)){let h;try{h=(JSON.parse(window.localStorage.getItem(An.syndi_pageid_timestamps))||{})[t]}catch{}Nx(i,{ci:e.experiences[s].componentId,epci:e.experiences[s].enhancedProductContentId,vi:s,fv:h,experiment:a.map(u=>u+":"+n[u].weight).join("|"),decisionExpires:r})}else{let h=a.map(u=>u+":"+n[u].weight).join("|");kx(i,{ci:s,epci:n[s].enhancedProductContentId,experiment:h,decisionExpires:r})}return n[s]}function vD(i){return!!(i?.EndDate&&new Date(i.EndDate).getTime()<Date.now()||new Date(i.StartDate).getTime()>Date.now())}function ld(i,e){let t=e.experienceType==="power-page",n=0,s={},r=function(l){if(!l)return"";let u=new DOMParser().parseFromString(l,"text/html"),d=u.querySelectorAll("markup\\:footnote");for(let f of d){let p;try{p=f.children[0].textContent}catch{}t&&p?(n++,s[n]=p,f.outerHTML=`<span aria-label="${i.Common["footnote-index"].replace("%1",n)}" class="syndigo-footnote-index" role="note"></span>`):f.outerHTML='<span class="syndigo-unsuported-footnote"></span>'}return u.body.innerHTML},o=function(l){let h="footnotes";for(let u of l.layouts){let d=u.areas[0].split(" "),p=`${h}`.repeat(d.length).trim();u.areas.push(p)}l.widgets[h]={widgetType:"Footnotes",widgetId:"",headerText:"",counter:n,footnotesDict:s}},a=function(l){if(t&&l.footnotes&&l.footnotes.length>0)for(let h=0;h<l.footnotes.length;h++)n+=1,s[n]=l.footnotes[h],l.footnotes[h]=n},c={};if(e.layouts)for(let l of e.layouts)for(let h of l.areas.join(" ").split(" "))h.trim().length>0&&(c[h]=!0);else!e.layouts&&!t&&(c=e.widgets);for(let l of Object.keys(c)){let h=e.widgets[l];switch(h.widgetType){case"FreeFormHtml":h.html=r(h.html);break;case"FeatureSet":for(let u of h.items)for(let d of u.features)d.description&&(d.description=r(d.description)),d.relatedItem?.description&&(d.relatedItem.description=r(d.relatedItem.description));break;case"ComparisonTable":for(let[u,d]of Object.entries(h.features)){a(d),d.caption=r(d.caption);for(let f of h.products){let p=f.featureDetails?.[u];p&&(a(p),p.text=r(p.text))}}break;case"SpecificationTable":for(let u of h.rows){a(u),u.caption=r(u.caption);for(let d of u.cells)a(d),d.text=r(d.text)}break;case"Carousel":for(let u of h.items)u.description=r(u.description);break}}return n>0&&o(e),e}var Jm="syndi_holdout";function Zm(i,e,t){if(!Or(i.tracking))return[!0,!1,!1];let n,s,r,o=i.abTestingExperiments.holdout;if(!o||window.location.host.includes("syndigo"))return[!0,!1,!1];try{let h={userExcludeGroup:n,bucketExpires:s,experimentExpires:r}=JSON.parse(window.localStorage.getItem(Jm))}catch{}let a=Date.now();n=n!==void 0?n:Math.random()>=o.threshold?1:0,s=s!==void 0?s:a+o.bucketDuration,r=r!==void 0?r:a+o.experimentDuration;let c;if(s<=a||r<=a?c=!0:c=n===1,r<=a)return window.localStorage.removeItem(Jm),[c,o.applyToHero,o.applyToPowerPage];let l={userExcludeGroup:n,bucketExpires:s,experimentExpires:r};return window.localStorage.setItem(Jm,JSON.stringify(l)),qi(i,"x",{ci:t,epci:e,display:c,...l}),[c,o.applyToHero,o.applyToPowerPage]}function wo(i){return typeof i=="number"}function Eb(i){let e=JSON.parse(JSON.stringify(i));return e["power-page"]&&(oI("PowerPage",e["power-page"]),aI(e["power-page"],e.contentURL),c3(e["power-page"])),e.hero&&(oI("Hero",e.hero),aI(e.hero),r3(e.hero),o3(e.hero),a3(e.hero)),e}function r3(i){for(let e=0;e<i.heroImages.length;e++){let t=i.heroImages[e];for(let n in t.callouts)i.widgets[n]||delete t.callouts[n]}return i}function o3(i){i.mosaicWidgetIds=i.mosaicWidgetIds||[];for(let e=i.mosaicWidgetIds.length-1;e>=0;e--){let t=i.mosaicWidgetIds[e];i.widgets[t]||i.mosaicWidgetIds.splice(e,1)}return i}function a3(i){return i.calloutStyle&&delete i.calloutStyle,i.navigationStyle&&(i.navigationStyle.svgPrimaryFill&&delete i.navigationStyle.svgPrimaryFill,i.navigationStyle.svgSecondaryFill&&delete i.navigationStyle.svgSecondaryFill),i}function c3(i){let e=[];return i.layouts.forEach(t=>{let s=t.areas.map(r=>r.split(" ").map(o=>{if(o=o.trim(),!o.length)return"";if(i.widgets[o])return o;let a=e.indexOf(o);return a<0&&(e.push(o),a=e.length-1),`MISSING-${a}`}).join(" ")).filter(r=>r.split(" ").filter(c=>!c.trim().includes("MISSING-")).length>0);t.areas=s}),i}function l3(i){return i||""}function Mt(i){let e=/\s/g,t=l3(i),n=t.replace(e,"").includes("<img");return t=Nl(t),t=t.replace(e,""),t.length!==0||n?i:""}function cI(i){i.styleOverrides=i.styleOverrides||{},i.styleOverrides.customStyles=i.styleOverrides.customStyles||{};let e="";Object.keys(i.styleOverrides.customStyles).forEach(t=>{let n=i.styleOverrides.customStyles[t],s=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`);e+=` ${s}: ${n};`,i.styleOverrides.customStyles[s]=n}),i.styleOverrides.styleString=e}function oI(i,e){if(e.styleOverrides=e.styleOverrides||{},e.styleOverrides.applyTheme=e.styleOverrides.applyTheme||{},e.styleOverrides.siteThemeProperties="",!!e.styleOverrides?.theme?.length){M_(i,e.styleOverrides);for(let t of e.styleOverrides.theme)e.styleOverrides.applyTheme[t]=!0}}function h3(i){let e=function(t){let n,s="",r=240,o=t.match(/\/([0-9]+\.[a-z]+)$/);o&&(r=o[1].split(".")[0]);let a=t.match(/asset\/([a-f0-9-]*)/);return a&&(s=a[1]),t.includes(".{1}")||(n=lI(t),t=t.replace(`.${n}`,".{1}")),{assetType:"Image",assetId:s,alt:"",originalWidth:r,originalHeight:r,url:t,availableWidths:[r],availableTypes:[n]}};i.tableImageUrl&&(i.tableImage=e(i.tableImageUrl),i.tableImage.alt=Mt(i.tableImageAltText)),i.tableImage||(i.tableImage=null),delete i.tableImageUrl,delete i.tableImageAltText;for(let t of i.products){t.imageUrl&&(t.image=e(t.imageUrl),t.image.alt=Mt(t.imageAltText)),t.image||(t.image=null),delete t.imageUrl,delete t.imageAltText;for(let n of t.featureDetails)n.imageUrl&&(n.image=e(n.imageUrl),n.image.alt=n.imageAltText||"",n.image.assetId=n.assetId||""),n.image||(n.image=null),delete n.imageUrl,delete n.imageAltText,delete n.assetId}}function u3(i){switch(i.widgetType){case"Carousel":i.items=i.items.filter(t=>(cI(t),i.layout==="StepByStep"&&(Object.keys(t.styleOverrides.customStyles||{}).length||i.styleOverrides.applyTheme.DarkMode)&&(t.imageBackgroundColor=t.styleOverrides.customStyles.backgroundColor||"#000000",t.colorOption="Custom",t.fontColor=t.styleOverrides.customStyles.color||"#ffffff",t.fontBackgroundColor=t.styleOverrides.customStyles.backgroundColor||"#000000"),!t.asset&&(t.assetType?.includes("Video")||t.assetType==="Image")&&(t.assetType="None"),t.assetType==="None"?t.caption||t.description:t.assetType?.includes("Video")?(bl(t.asset),!0):t.assetType==="Image"?(Gi(t.asset),!0):!1));break;case"DocumentGallery":for(let t of i.items)Gi(t.image);break;case"FeatureSet":for(let t of i.items)for(let n of t.features){n.assetType?.includes("Video")?bl(n.asset):n.assetType==="Image"&&(Gi(n.asset),t.layout==="WideImages"&&(n.imageSizeType="Large"));let{relatedItem:s}=n;s&&(s.assetType?.includes("Video")?bl(s.asset):s.assetType==="Image"&&Gi(s.asset))}break;case"ImageGallery":for(let t of i.items)Gi(t.image);break;case"ThreeSixty":for(let t of i.items)Gi(t);break;case"VideoGallery":for(let t of i.items)bl(t.video);break;case"InteractiveTour":for(let t of i.items){Gi(t.productImage);for(let n of t.features)n.assetType?.includes("Video")?bl(n.asset):n.assetType==="Image"&&Gi(n.asset),n.image&&Gi(n.image),n.video&&bl(n.video)}break;case"InlineFrame":d3(i),Gi(i.poster);break}}function d3(i){i.allow||(i.allow={camera:!1,microphone:!1})}function Gi(i,e=!0){if(!i)return;if(i.assetType==="ArtDirectedImage"&&i.artDirectedAssets)for(let c of i.artDirectedAssets)Gi(c.asset,e);i.assetType==="Image"&&i.artDirectedAssets&&delete i.artDirectedAssets;let t=i.availableWidths||[],s=[...[240,480,960,1920],...t];e&&s.push(i.originalWidth);let r={};for(let c of s)r[c]=!0;let o=1920,a=1;if(i.availableWidths=Object.keys(r).map(c=>parseInt(c,10)).filter(c=>c<=i.originalWidth&&c>=a&&c<=o).sort((c,l)=>c-l),!i.url.includes(".{1}")){let c=lI(i.url);i.availableTypes=[c],i.url=i.url.replace(`.${c}`,".{1}")}}function lI(i){return i.split(".").pop()}function bl(i){i.videoApi=i?.sources?.[0].mimeType==="video/youtube"?"YouTube":"NativeVideo",i&&i.poster&&Gi(i.poster,!1),i&&!wo(i.duration)&&(i.duration=0)}function aI(i,e=""){let t=i.widgets;return Object.keys(t).forEach(async n=>{let s=t[n];if(s.styleOverrides=s.styleOverrides||{},s.styleOverrides.applyTheme=i.styleOverrides.applyTheme,s.headerText=Mt(s.headerText),u3(s),["Carousel","VideoGallery","FeatureSet","DocumentGallery","ImageGallery","ThreeSixty","InteractiveTour"].includes(s.widgetType)&&!s.items.length){delete t[n];return}switch(s.widgetType){case"Carousel":s.items.forEach(a=>{a.caption=Mt(a.caption),a.description=Mt(a.description)});break;case"VideoGallery":s.items.forEach(a=>{a.caption=Mt(a.caption),a.description=Mt(a.description)});break;case"FeatureSet":cI(s),s.items.forEach(a=>{Object.keys(a.features).forEach(c=>{a.features[c].caption=Mt(a.features[c].caption),a.features[c].description=Mt(a.features[c].description),a.features[c].link=Mt(a.features[c].link),a.features[c].linkLabel=Mt(a.features[c].linkLabel),a.features[c].relatedItem&&(a.features[c].relatedItem.caption=Mt(a.features[c].relatedItem.caption),a.features[c].relatedItem.description=Mt(a.features[c].relatedItem.description),a.features[c].relatedItem.link=Mt(a.features[c].relatedItem.link),a.features[c].relatedItem.linkLabel=Mt(a.features[c].relatedItem.linkLabel)),a.features[c].captionAndDescriptionPlacement==="Overlaid"&&!a.features[c].caption&&!a.features[c].description&&(a.features[c].captionAndDescriptionPlacement="None")})});break;case"ImageGallery":s.layout||(s.layout="focused"),s.items.forEach(a=>{a.caption=Mt(a.caption),a.description=Mt(a.description)});break;case"DocumentGallery":s.items.forEach(a=>{a.caption=Mt(a.caption),a.description=Mt(a.description)});break;case"ComparisonTable":s.productsData=i.productsData,s.currentProductId==="00000000-0000-0000-0000-000000000000"&&delete s.currentProductId;for(let a of s.features)a.caption=Mt(a.caption),a.additionalInformation=Mt(a.additionalInformation);for(let a of s.products)if(a.description=Mt(a.description),a.columnTitle=Mt(a.columnTitle),a.featureDetails)for(let c of a.featureDetails)c.text=Mt(c.text);h3(s);break;case"SpecificationTable":for(let a of s.rows){a.caption=Mt(a.caption);for(let c of a.cells)c.text=Mt(c.text)}break;case"InteractiveTour":for(let a of s.items)for(let c of a.features)c.caption=Mt(c.caption),c.description=Mt(c.description);break;case"ThreeDimension":if(s.contentURL=e,s.environmentUrl=Mt(s.environmentUrl),s.overlayText=Mt(s.overlayText),!customElements.get("model-viewer"))try{await Promise.resolve().then(()=>(rI(),sI)).catch(()=>{})}catch{}break;case"FreeFormHtml":s.html=s.isTrustedSource?`<div class="syndigo-playbook">${s.html}</div>`:s.html;break}}),t}function Sb(i){let e=JSON.parse(JSON.stringify(i)),{experience:t}=e;if(!!t){let s={};s.main={componentId:t.componentId,enhancedProductContentId:t.enhancedProductContentId,experiences:t.experiences,weight:t.weight};for(let r in t.experimentCollections?.variations){let o=t.experimentCollections.variations[r];s[r]={componentId:t.componentId,enhancedProductContentId:t.enhancedProductContentId,variationId:r,experiences:o.experiences,weight:o.weight}}e.experimentId=t.experimentCollections?.experimentId,e.duration=t.experimentCollections?.duration,e.experiences=s,delete e.experience}return e}function Qi(i){return i!==null&&typeof i=="object"}function f3(i){return Object.prototype.toString.call(i)==="[object Date]"}function p3(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function hI(i,e,t){let n,s,r,o,a,c,l,h;for(n=0,s=e.length;n<s;++n)if(r=e[n],!(!Qi(r)&&!ei(r))){o=[];for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&o.push(l);for(a=0,c=o.length;a<c;a++)l=o[a],h=r[l],t&&Qi(h)?f3(h)?i[l]=new Date(h.valueOf()):p3(h)?i[l]=new RegExp(h):(Qi(i[l])||(i[l]=Array.isArray(h)?[]:{}),hI(i[l],[h],!0)):i[l]=h}return i}function wa(i){return hI(i,Array.prototype.slice.call(arguments,1),!1)}function Ca(i){return typeof i=="string"}function wb(i){try{new URL(i)}catch{return!1}return!0}function lo(i){return Ca(i)?i.toLowerCase():i}function cs(){}function uI(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=Array(e);t<e;t++)n[t]=i[t];return n}function m3(i){if(Array.isArray(i))return i}function A3(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,s,r,o,a=[],c=!0,l=!1;try{if(r=(t=t.call(i)).next,e!==0)for(;!(c=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(h){l=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(l)throw s}}return a}}function g3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y3(i,e){return m3(i)||A3(i,e)||b3(i,e)||g3()}function b3(i,e){if(i){if(typeof i=="string")return uI(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?uI(i,e):void 0}}var SI=Object.entries,dI=Object.setPrototypeOf,x3=Object.isFrozen,_3=Object.getPrototypeOf,v3=Object.getOwnPropertyDescriptor,jn=Object.freeze,zi=Object.seal,El=Object.create,wI=typeof Reflect<"u"&&Reflect,Bb=wI.apply,Db=wI.construct;jn||(jn=function(e){return e});zi||(zi=function(e){return e});Bb||(Bb=function(e,t){for(var n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];return e.apply(t,s)});Db||(Db=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return new e(...n)});var Ma=cn(Array.prototype.forEach),E3=cn(Array.prototype.lastIndexOf),fI=cn(Array.prototype.pop),xl=cn(Array.prototype.push),S3=cn(Array.prototype.splice),Yn=Array.isArray,Bu=cn(String.prototype.toLowerCase),Cb=cn(String.prototype.toString),pI=cn(String.prototype.match),_l=cn(String.prototype.replace),mI=cn(String.prototype.indexOf),w3=cn(String.prototype.trim),C3=cn(Number.prototype.toString),M3=cn(Boolean.prototype.toString),AI=typeof BigInt>"u"?null:cn(BigInt.prototype.toString),gI=typeof Symbol>"u"?null:cn(Symbol.prototype.toString),Yt=cn(Object.prototype.hasOwnProperty),Ru=cn(Object.prototype.toString),Mn=cn(RegExp.prototype.test),vl=T3(TypeError);function cn(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Bb(i,e,n)}}function T3(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Db(i,t)}}function Ye(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bu;if(dI&&dI(i,null),!Yn(e))return i;let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){let r=t(s);r!==s&&(x3(e)||(e[n]=r),s=r)}i[s]=!0}return i}function I3(i){for(let e=0;e<i.length;e++)Yt(i,e)||(i[e]=null);return i}function Qn(i){let e=El(null);for(let n of SI(i)){var t=y3(n,2);let s=t[0],r=t[1];Yt(i,s)&&(Yn(r)?e[s]=I3(r):r&&typeof r=="object"&&r.constructor===Object?e[s]=Qn(r):e[s]=r)}return e}function R3(i){switch(typeof i){case"string":return i;case"number":return C3(i);case"boolean":return M3(i);case"bigint":return AI?AI(i):"0";case"symbol":return gI?gI(i):"Symbol()";case"undefined":return Ru(i);case"function":case"object":{if(i===null)return Ru(i);let e=i,t=Fs(e,"toString");if(typeof t=="function"){let n=t(e);return typeof n=="string"?n:Ru(n)}return Ru(i)}default:return Ru(i)}}function Fs(i,e){for(;i!==null;){let n=v3(i,e);if(n){if(n.get)return cn(n.get);if(typeof n.value=="function")return cn(n.value)}i=_3(i)}function t(){return null}return t}function B3(i){try{return Mn(i,""),!0}catch{return!1}}var yI=jn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Mb=jn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Tb=jn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),D3=jn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ib=jn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),L3=jn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bI=jn(["#text"]),xI=jn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Rb=jn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_I=jn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mm=jn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P3=zi(/{{[\w\W]*|^[\w\W]*}}/g),F3=zi(/<%[\w\W]*|^[\w\W]*%>/g),O3=zi(/\${[\w\W]*/g),N3=zi(/^data-[\-\w.\u00B7-\uFFFF]+$/),U3=zi(/^aria-[\-\w]+$/),vI=zi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),k3=zi(/^(?:\w+script|data):/i),G3=zi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q3=zi(/^html$/i),z3=zi(/^[a-z][.\w]*(-[.\w]+)+$/i),Ps={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},H3=function(){return typeof window>"u"?null:window},V3=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null,s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));let r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},EI=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function CI(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H3(),e=Y=>CI(Y);if(e.version="3.4.8",e.removed=[],!i||!i.document||i.document.nodeType!==Ps.document||!i.Element)return e.isSupported=!1,e;let t=i.document,n=t,s=n.currentScript;i.DocumentFragment;let r=i.HTMLTemplateElement,o=i.Node,a=i.Element,c=i.NodeFilter,l=i.NamedNodeMap;l===void 0&&(i.NamedNodeMap||i.MozNamedAttrMap),i.HTMLFormElement;let h=i.DOMParser,u=i.trustedTypes,d=a.prototype,f=Fs(d,"cloneNode"),p=Fs(d,"remove"),g=Fs(d,"nextSibling"),A=Fs(d,"childNodes"),m=Fs(d,"parentNode"),b=Fs(d,"shadowRoot"),x=Fs(d,"attributes"),y=o&&o.prototype?Fs(o.prototype,"nodeType"):null,_=o&&o.prototype?Fs(o.prototype,"nodeName"):null;if(typeof r=="function"){let Y=t.createElement("template");Y.content&&Y.content.ownerDocument&&(t=Y.content.ownerDocument)}let S,C="",w=0,v=function(I){if(w>0)throw vl('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');w++;try{return S.createHTML(I)}finally{w--}},E=t,R=E.implementation,F=E.createNodeIterator,P=E.createDocumentFragment,U=E.getElementsByTagName,V=n.importNode,O=EI();e.isSupported=typeof SI=="function"&&typeof m=="function"&&R&&R.createHTMLDocument!==void 0;let K=P3,z=F3,ee=O3,ae=N3,he=U3,ve=k3,Le=G3,X=z3,se=vI,le=null,pe=Ye({},[...yI,...Mb,...Tb,...Ib,...bI]),ye=null,Ue=Ye({},[...xI,...Rb,..._I,...mm]),Me=Object.seal(El(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xt=null,$e=null,pt=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),L=!0,Tn=!0,rt=!1,ot=!0,Te=!1,Et=!0,Ie=!1,B=!1,M=!1,H=!1,Z=!1,ie=!1,J=!0,Re=!1,Ae="user-content-",Ee=!0,tt=!1,ce={},ge=null,Ne=Ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ge=null,Se=Ye({},["audio","video","img","source","image","track"]),nt=null,We=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",N="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml",$=de,te=!1,be=null,_e=Ye({},[St,N,de],Cb),He=Ye({},["mi","mo","mn","ms","mtext"]),Pt=Ye({},["annotation-xml"]),mn=Ye({},["title","style","font","a","script"]),dt=null,di=["application/xhtml+xml","text/html"],Hi="text/html",zt=null,Us=null,ks=t.createElement("form"),La=function(I){return I instanceof RegExp||I instanceof Function},Pa=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Us&&Us===I)return;(!I||typeof I!="object")&&(I={}),I=Qn(I),dt=di.indexOf(I.PARSER_MEDIA_TYPE)===-1?Hi:I.PARSER_MEDIA_TYPE,zt=dt==="application/xhtml+xml"?Cb:Bu,le=Yt(I,"ALLOWED_TAGS")&&Yn(I.ALLOWED_TAGS)?Ye({},I.ALLOWED_TAGS,zt):pe,ye=Yt(I,"ALLOWED_ATTR")&&Yn(I.ALLOWED_ATTR)?Ye({},I.ALLOWED_ATTR,zt):Ue,be=Yt(I,"ALLOWED_NAMESPACES")&&Yn(I.ALLOWED_NAMESPACES)?Ye({},I.ALLOWED_NAMESPACES,Cb):_e,nt=Yt(I,"ADD_URI_SAFE_ATTR")&&Yn(I.ADD_URI_SAFE_ATTR)?Ye(Qn(We),I.ADD_URI_SAFE_ATTR,zt):We,Ge=Yt(I,"ADD_DATA_URI_TAGS")&&Yn(I.ADD_DATA_URI_TAGS)?Ye(Qn(Se),I.ADD_DATA_URI_TAGS,zt):Se,ge=Yt(I,"FORBID_CONTENTS")&&Yn(I.FORBID_CONTENTS)?Ye({},I.FORBID_CONTENTS,zt):Ne,xt=Yt(I,"FORBID_TAGS")&&Yn(I.FORBID_TAGS)?Ye({},I.FORBID_TAGS,zt):Qn({}),$e=Yt(I,"FORBID_ATTR")&&Yn(I.FORBID_ATTR)?Ye({},I.FORBID_ATTR,zt):Qn({}),ce=Yt(I,"USE_PROFILES")?I.USE_PROFILES&&typeof I.USE_PROFILES=="object"?Qn(I.USE_PROFILES):I.USE_PROFILES:!1,L=I.ALLOW_ARIA_ATTR!==!1,Tn=I.ALLOW_DATA_ATTR!==!1,rt=I.ALLOW_UNKNOWN_PROTOCOLS||!1,ot=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=I.SAFE_FOR_TEMPLATES||!1,Et=I.SAFE_FOR_XML!==!1,Ie=I.WHOLE_DOCUMENT||!1,H=I.RETURN_DOM||!1,Z=I.RETURN_DOM_FRAGMENT||!1,ie=I.RETURN_TRUSTED_TYPE||!1,M=I.FORCE_BODY||!1,J=I.SANITIZE_DOM!==!1,Re=I.SANITIZE_NAMED_PROPS||!1,Ee=I.KEEP_CONTENT!==!1,tt=I.IN_PLACE||!1,se=B3(I.ALLOWED_URI_REGEXP)?I.ALLOWED_URI_REGEXP:vI,$=typeof I.NAMESPACE=="string"?I.NAMESPACE:de,He=Yt(I,"MATHML_TEXT_INTEGRATION_POINTS")&&I.MATHML_TEXT_INTEGRATION_POINTS&&typeof I.MATHML_TEXT_INTEGRATION_POINTS=="object"?Qn(I.MATHML_TEXT_INTEGRATION_POINTS):Ye({},["mi","mo","mn","ms","mtext"]),Pt=Yt(I,"HTML_INTEGRATION_POINTS")&&I.HTML_INTEGRATION_POINTS&&typeof I.HTML_INTEGRATION_POINTS=="object"?Qn(I.HTML_INTEGRATION_POINTS):Ye({},["annotation-xml"]);let Q=Yt(I,"CUSTOM_ELEMENT_HANDLING")&&I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING=="object"?Qn(I.CUSTOM_ELEMENT_HANDLING):El(null);if(Me=El(null),Yt(Q,"tagNameCheck")&&La(Q.tagNameCheck)&&(Me.tagNameCheck=Q.tagNameCheck),Yt(Q,"attributeNameCheck")&&La(Q.attributeNameCheck)&&(Me.attributeNameCheck=Q.attributeNameCheck),Yt(Q,"allowCustomizedBuiltInElements")&&typeof Q.allowCustomizedBuiltInElements=="boolean"&&(Me.allowCustomizedBuiltInElements=Q.allowCustomizedBuiltInElements),Te&&(Tn=!1),Z&&(H=!0),ce&&(le=Ye({},bI),ye=El(null),ce.html===!0&&(Ye(le,yI),Ye(ye,xI)),ce.svg===!0&&(Ye(le,Mb),Ye(ye,Rb),Ye(ye,mm)),ce.svgFilters===!0&&(Ye(le,Tb),Ye(ye,Rb),Ye(ye,mm)),ce.mathMl===!0&&(Ye(le,Ib),Ye(ye,_I),Ye(ye,mm))),pt.tagCheck=null,pt.attributeCheck=null,Yt(I,"ADD_TAGS")&&(typeof I.ADD_TAGS=="function"?pt.tagCheck=I.ADD_TAGS:Yn(I.ADD_TAGS)&&(le===pe&&(le=Qn(le)),Ye(le,I.ADD_TAGS,zt))),Yt(I,"ADD_ATTR")&&(typeof I.ADD_ATTR=="function"?pt.attributeCheck=I.ADD_ATTR:Yn(I.ADD_ATTR)&&(ye===Ue&&(ye=Qn(ye)),Ye(ye,I.ADD_ATTR,zt))),Yt(I,"ADD_URI_SAFE_ATTR")&&Yn(I.ADD_URI_SAFE_ATTR)&&Ye(nt,I.ADD_URI_SAFE_ATTR,zt),Yt(I,"FORBID_CONTENTS")&&Yn(I.FORBID_CONTENTS)&&(ge===Ne&&(ge=Qn(ge)),Ye(ge,I.FORBID_CONTENTS,zt)),Yt(I,"ADD_FORBID_CONTENTS")&&Yn(I.ADD_FORBID_CONTENTS)&&(ge===Ne&&(ge=Qn(ge)),Ye(ge,I.ADD_FORBID_CONTENTS,zt)),Ee&&(le["#text"]=!0),Ie&&Ye(le,["html","head","body"]),le.table&&(Ye(le,["tbody"]),delete xt.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let j=S;S=I.TRUSTED_TYPES_POLICY;try{C=v("")}catch(ue){throw S=j,ue}}else S===void 0&&I.TRUSTED_TYPES_POLICY!==null&&(S=V3(u,s)),S&&typeof C=="string"&&(C=v(""));(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&le===pe&&(le=Qn(le)),O.uponSanitizeAttribute.length>0&&ye===Ue&&(ye=Qn(ye)),jn&&jn(I),Us=I},Tl=Ye({},[...Mb,...Tb,...D3]),fo=Ye({},[...Ib,...L3]),qu=function(I){let Q=m(I);(!Q||!Q.tagName)&&(Q={namespaceURI:$,tagName:"template"});let j=Bu(I.tagName),ue=Bu(Q.tagName);return be[I.namespaceURI]?I.namespaceURI===N?Q.namespaceURI===de?j==="svg":Q.namespaceURI===St?j==="svg"&&(ue==="annotation-xml"||He[ue]):!!Tl[j]:I.namespaceURI===St?Q.namespaceURI===de?j==="math":Q.namespaceURI===N?j==="math"&&Pt[ue]:!!fo[j]:I.namespaceURI===de?Q.namespaceURI===N&&!Pt[ue]||Q.namespaceURI===St&&!He[ue]?!1:!fo[j]&&(mn[j]||!Tl[j]):!!(dt==="application/xhtml+xml"&&be[I.namespaceURI]):!1},In=function(I){xl(e.removed,{element:I});try{m(I).removeChild(I)}catch{p(I)}},us=function(I,Q){try{xl(e.removed,{attribute:Q.getAttributeNode(I),from:Q})}catch{xl(e.removed,{attribute:null,from:Q})}if(Q.removeAttribute(I),I==="is")if(H||Z)try{In(Q)}catch{}else try{Q.setAttribute(I,"")}catch{}},Il=function(I){let Q=null,j=null;if(M)I="<remove></remove>"+I;else{let De=pI(I,/^[\r\n\t ]+/);j=De&&De[0]}dt==="application/xhtml+xml"&&$===de&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");let ue=S?v(I):I;if($===de)try{Q=new h().parseFromString(ue,dt)}catch{}if(!Q||!Q.documentElement){Q=R.createDocument($,"template",null);try{Q.documentElement.innerHTML=te?C:ue}catch{}}let xe=Q.body||Q.documentElement;return I&&j&&xe.insertBefore(t.createTextNode(j),xe.childNodes[0]||null),$===de?U.call(Q,Ie?"html":"body")[0]:Ie?Q.documentElement:xe},Ku=function(I){return F.call(I.ownerDocument||I,I,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Rl=function(I){var Q,j;I.normalize();let ue=F.call(I.ownerDocument||I,I,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),xe=ue.nextNode();for(;xe;){let je=xe.data;Ma([K,z,ee],ft=>{je=_l(je,ft," ")}),xe.data=je,xe=ue.nextNode()}let De=(Q=(j=I.querySelectorAll)===null||j===void 0?void 0:j.call(I,"template"))!==null&&Q!==void 0?Q:[];Ma(Array.from(De),je=>{Pr(je.content)&&Rl(je.content)})},Fa=function(I){let Q=_?_(I):null;return typeof Q!="string"||zt(Q)!=="form"?!1:typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||I.attributes!==x(I)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function"||I.nodeType!==y(I)||I.childNodes!==A(I)},Pr=function(I){if(!y||typeof I!="object"||I===null)return!1;try{return y(I)===Ps.documentFragment}catch{return!1}},Oa=function(I){if(!y||typeof I!="object"||I===null)return!1;try{return typeof y(I)=="number"}catch{return!1}};function Vi(Y,I,Q){Ma(Y,j=>{j.call(e,I,Q,Us)})}let T=function(I){let Q=null;if(Vi(O.beforeSanitizeElements,I,null),Fa(I))return In(I),!0;let j=zt(_?_(I):I.nodeName);if(Vi(O.uponSanitizeElement,I,{tagName:j,allowedTags:le}),Et&&I.hasChildNodes()&&!Oa(I.firstElementChild)&&Mn(/<[/\w!]/g,I.innerHTML)&&Mn(/<[/\w!]/g,I.textContent)||Et&&I.namespaceURI===de&&j==="style"&&Oa(I.firstElementChild)||I.nodeType===Ps.progressingInstruction||Et&&I.nodeType===Ps.comment&&Mn(/<[/\w]/g,I.data))return In(I),!0;if(xt[j]||!(pt.tagCheck instanceof Function&&pt.tagCheck(j))&&!le[j]){if(!xt[j]&&q(j)&&(Me.tagNameCheck instanceof RegExp&&Mn(Me.tagNameCheck,j)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(j)))return!1;if(Ee&&!ge[j]){let xe=m(I),De=A(I);if(De&&xe){let je=De.length;for(let ft=je-1;ft>=0;--ft){let Ve=f(De[ft],!0);xe.insertBefore(Ve,g(I))}}}return In(I),!0}return(y?y(I):I.nodeType)===Ps.element&&!qu(I)||(j==="noscript"||j==="noembed"||j==="noframes")&&Mn(/<\/no(script|embed|frames)/i,I.innerHTML)?(In(I),!0):(Te&&I.nodeType===Ps.text&&(Q=I.textContent,Ma([K,z,ee],xe=>{Q=_l(Q,xe," ")}),I.textContent!==Q&&(xl(e.removed,{element:I.cloneNode()}),I.textContent=Q)),Vi(O.afterSanitizeElements,I,null),!1)},k=function(I,Q,j){if($e[Q]||J&&(Q==="id"||Q==="name")&&(j in t||j in ks))return!1;let ue=ye[Q]||pt.attributeCheck instanceof Function&&pt.attributeCheck(Q,I);if(!(Tn&&!$e[Q]&&Mn(ae,Q))){if(!(L&&Mn(he,Q))){if(!ue||$e[Q]){if(!(q(I)&&(Me.tagNameCheck instanceof RegExp&&Mn(Me.tagNameCheck,I)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(I))&&(Me.attributeNameCheck instanceof RegExp&&Mn(Me.attributeNameCheck,Q)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(Q,I))||Q==="is"&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&Mn(Me.tagNameCheck,j)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(j))))return!1}else if(!nt[Q]){if(!Mn(se,_l(j,Le,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&I!=="script"&&mI(j,"data:")===0&&Ge[I])){if(!(rt&&!Mn(ve,_l(j,Le,"")))){if(j)return!1}}}}}}return!0},W=Ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),q=function(I){return!W[Bu(I)]&&Mn(X,I)},G=function(I){Vi(O.beforeSanitizeAttributes,I,null);let Q=I.attributes;if(!Q||Fa(I))return;let j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ye,forceKeepAttr:void 0},ue=Q.length;for(;ue--;){let xe=Q[ue],De=xe.name,je=xe.namespaceURI,ft=xe.value,Ve=zt(De),Pe=ft,ht=De==="value"?Pe:w3(Pe);if(j.attrName=Ve,j.attrValue=ht,j.keepAttr=!0,j.forceKeepAttr=void 0,Vi(O.uponSanitizeAttribute,I,j),ht=j.attrValue,Re&&(Ve==="id"||Ve==="name")&&mI(ht,Ae)!==0&&(us(De,I),ht=Ae+ht),Et&&Mn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ht)){us(De,I);continue}if(Ve==="attributename"&&pI(ht,"href")){us(De,I);continue}if(j.forceKeepAttr)continue;if(!j.keepAttr){us(De,I);continue}if(!ot&&Mn(/\/>/i,ht)){us(De,I);continue}Te&&Ma([K,z,ee],Jn=>{ht=_l(ht,Jn," ")});let At=zt(I.nodeName);if(!k(At,Ve,ht)){us(De,I);continue}if(S&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!je)switch(u.getAttributeType(At,Ve)){case"TrustedHTML":{ht=v(ht);break}case"TrustedScriptURL":{ht=S.createScriptURL(ht);break}}if(ht!==Pe)try{je?I.setAttributeNS(je,De,ht):I.setAttribute(De,ht),Fa(I)?In(I):fI(e.removed)}catch{us(De,I)}}Vi(O.afterSanitizeAttributes,I,null)},re=function(I){let Q=null,j=Ku(I);for(Vi(O.beforeSanitizeShadowDOM,I,null);Q=j.nextNode();)if(Vi(O.uponSanitizeShadowNode,Q,null),T(Q),G(Q),Pr(Q.content)&&re(Q.content),(y?y(Q):Q.nodeType)===Ps.element){let xe=b?b(Q):Q.shadowRoot;Pr(xe)&&(fe(xe),re(xe))}Vi(O.afterSanitizeShadowDOM,I,null)},fe=function(I){let Q=y?y(I):I.nodeType;if(Q===Ps.element){let xe=b?b(I):I.shadowRoot;Pr(xe)&&(fe(xe),re(xe))}let j=A?A(I):I.childNodes;if(!j)return;let ue=[];Ma(j,xe=>{xl(ue,xe)});for(let xe of ue)fe(xe);if(Q===Ps.element){let xe=_?_(I):null;if(typeof xe=="string"&&zt(xe)==="template"){let De=I.content;Pr(De)&&fe(De)}}};return e.sanitize=function(Y){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,j=null,ue=null,xe=null;if(te=!Y,te&&(Y="<!-->"),typeof Y!="string"&&!Oa(Y)&&(Y=R3(Y),typeof Y!="string"))throw vl("dirty is not a string, aborting");if(!e.isSupported)return Y;if(B||Pa(I),e.removed=[],typeof Y=="string"&&(tt=!1),tt){let ft=_?_(Y):Y.nodeName;if(typeof ft=="string"){let Ve=zt(ft);if(!le[Ve]||xt[Ve])throw vl("root node is forbidden and cannot be sanitized in-place")}if(Fa(Y))throw vl("root node is clobbered and cannot be sanitized in-place");fe(Y)}else if(Oa(Y))Q=Il("<!---->"),j=Q.ownerDocument.importNode(Y,!0),j.nodeType===Ps.element&&j.nodeName==="BODY"||j.nodeName==="HTML"?Q=j:Q.appendChild(j),fe(j);else{if(!H&&!Te&&!Ie&&Y.indexOf("<")===-1)return S&&ie?v(Y):Y;if(Q=Il(Y),!Q)return H?null:ie?C:""}Q&&M&&In(Q.firstChild);let De=Ku(tt?Y:Q);for(;ue=De.nextNode();)T(ue),G(ue),Pr(ue.content)&&re(ue.content);if(tt)return Te&&Rl(Y),Y;if(H){if(Te&&Rl(Q),Z)for(xe=P.call(Q.ownerDocument);Q.firstChild;)xe.appendChild(Q.firstChild);else xe=Q;return(ye.shadowroot||ye.shadowrootmode)&&(xe=V.call(n,xe,!0)),xe}let je=Ie?Q.outerHTML:Q.innerHTML;return Ie&&le["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&Mn(Q3,Q.ownerDocument.doctype.name)&&(je="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
`+je),Te&&Ma([K,z,ee],ft=>{je=_l(je,ft," ")}),S&&ie?v(je):je},e.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pa(Y),B=!0},e.clearConfig=function(){Us=null,B=!1},e.isValidAttribute=function(Y,I,Q){Us||Pa({});let j=zt(Y),ue=zt(I);return k(j,ue,Q)},e.addHook=function(Y,I){typeof I=="function"&&xl(O[Y],I)},e.removeHook=function(Y,I){if(I!==void 0){let Q=E3(O[Y],I);return Q===-1?void 0:S3(O[Y],Q,1)[0]}return fI(O[Y])},e.removeHooks=function(Y){O[Y]=[]},e.removeAllHooks=function(){O=EI()},e}var MI=CI();var W3=/url\(([^)]+)\)/gi,TI=["color","font","font-family","font-size","font-style","font-weight","font-variant","line-height","letter-spacing","word-spacing","text-align","text-decoration","text-decoration-line","text-decoration-style","text-decoration-color","text-decoration-thickness","text-indent","text-transform","white-space","direction","font-stretch","hyphens","text-rendering","text-shadow","text-underline-offset","word-break","writing-mode","background","background-color","background-image","background-position","background-repeat","background-size","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","border-radius","border-collapse","border-spacing","box-shadow","box-sizing","width","height","min-width","min-height","max-width","max-height","list-style","list-style-type","list-style-position","list-style-image","display","float","clear","overflow","vertical-align","opacity","overflow-wrap","overflow-x","overflow-y","tab-size","table-layout","visibility","column-count","column-gap","column-rule","-webkit-animation","-webkit-animation-duration","-webkit-animation-fill-mode","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-timing-function","-webkit-keyframes","-webkit-transform","-webkit-transition","-webkit-appearance","-webkit-border-radius","-webkit-box-shadow","-webkit-box-sizing","-webkit-filter","-webkit-font-smoothing","-webkit-hyphens","-webkit-gradient","-webkit-linear-gradient","-webkit-media-controls-overlay-play-button","-webkit-min-device-pixel-ratio","-webkit-tap-highlight-color","-webkit-overflow-scrolling","-webkit-scrollbar","-webkit-scrollbar-corner","-webkit-scrollbar-thumb","-webkit-scrollbar-track","-webkit-user-drag"];function q3(i){let e=document.implementation.createHTMLDocument(""),t=document.createElement("style");return t.textContent=`:root { ${i} }`,e.body.appendChild(t),t.sheet?.cssRules}function K3(i,e){let t;try{t=new URL(i,"http://_invalid_base_uri/")}catch{return!1}return t.hostname==="_invalid_base_uri"||t.protocol!=="http:"&&t.protocol!=="https:"?!1:!Du(t.toString(),e).includes("unsafe-default")}function $3(i,e){if(/[<>]|expression\s*\(|javascript:|vbscript:|livescript:|mocha:/i.test(i))return!1;for(let[,t]of i.matchAll(W3)){let n=t.trim().replace(/^['"]|['"]$/g,"");if(!K3(n,e))return!1}return!0}function X3(i){if(!i)return"";function e(c,l){for(let h=0;h<l.length;h++){let u=l[h],d=l.getPropertyValue(u).trim();if(!TI.includes(u))continue;let f=l.getPropertyPriority(u);c.push(`${u}: ${d}${f?" !important":""}`)}}let t=MI(window);t.addHook("afterSanitizeAttributes",function(c){if(!c.ownerDocument.baseURI){let h=document.createElement("base");h.href=document.baseURI,c.ownerDocument.head.appendChild(h)}let l=[];e(l,c.style),l.length?c.setAttribute("style",l.join("; ")):c.removeAttribute("style")});let n=`<div id="temp-element" style="${i}"></div>`,s=t.sanitize(n),a=new DOMParser().parseFromString(s,"text/html")?.getElementById("temp-element")?.getAttribute("style")||"";return a=a.replaceAll('"',"'"),a}function Lb(i,e){if(typeof i!="string"||!i.trim().length)return"";let t;try{t=q3(i)}catch{return""}if(t?.length!==1)return"";let n=t[0];if(n.type!==CSSRule.STYLE_RULE||n.selectorText!==":root")return"";let s=n.style,r=[];for(let c=0;c<s.length;c++){let l=s[c],h=s.getPropertyValue(l).trim();if(TI.includes(l)){if(!$3(h,e))continue}else continue;let u=s.getPropertyPriority(l);r.push(`${l}: ${h}${u?" !important":""}`)}let o=r.join("; ");return o=o.replaceAll('"',"'"),X3(o)}function Am(i){let e=document.createElement("a");return e.href=i,e}var II=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,RI=/^<\/\s*([\w:-]+)[^>]*>/,Y3=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,j3=/^</,J3=/^<\//,Z3=/<!--(.*?)-->/g,BI=/<!DOCTYPE([^>]*?)>/i,eG=/<!\[CDATA\[(.*?)\]\]>/g,tG=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nG=/([^#-~| |!])/g;function Os(i,e){let t={},n=i.split(","),s;for(s=0;s<n.length;s++)t[e?lo(n[s]):n[s]]=!0;return t}var FI=Os("area,br,col,hr,img,wbr"),OI=Os("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),NI=Os("rp,rt"),UI=wa({},NI,OI),kI=wa({},OI,Os("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),GI=wa({},NI,Os("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),iG=Os("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan,use"),QI=Os("script,style"),DI=wa({},FI,kI,GI,UI,iG),zI=Os("background,cite,href,longdesc,src,usemap,xlink:href"),sG=Os("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width,aria-label,role,data-syndi-id,style"),rG=Os("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),oG=wa({},zI,rG,sG),gm;function Pb(i){return i?(gm||(gm=document.createElement("pre")),gm.innerHTML=i.replace(/</g,"&lt;"),gm.textContent):""}function aG(i,e){typeof i!="string"&&(i==null?i="":i=Object.prototype.toString.call(i));let t,n,s,r=[],o=i,a;r.last=function(){return r[r.length-1]};function c(h,u){let d=0,f;if(u=lo(u),u)for(d=r.length-1;d>=0&&r[d]!==u;d--);if(d>=0){for(f=r.length-1;f>=d;f--)e.end&&e.end(r[f]);r.length=d}}function l(h,u,d,f){if(u=lo(u),kI[u])for(;r.last()&&GI[r.last()];)c("",r.last());UI[u]&&r.last()===u&&c("",u),f=FI[u]||!!f,f||r.push(u);let p={};d.replace(Y3,function(g,A,m,b,x){let y=m||b||x||"";p[A]=Pb(y)}),e.start&&e.start(u,p,f)}for(;i;){if(a="",n=!0,!r.last()||!QI[r.last()]?(i.indexOf("<!--")===0?(t=i.indexOf("--",4),t>=0&&i.lastIndexOf("-->",t)===t&&(e.comment&&e.comment(i.substring(4,t)),i=i.substring(t+3),n=!1)):BI.test(i)?(s=i.match(BI),s&&(i=i.replace(s[0],""),n=!1)):J3.test(i)?(s=i.match(RI),s&&(i=i.substring(s[0].length),s[0].replace(RI,c),n=!1)):j3.test(i)&&(s=i.match(II),s?(s[4]&&(i=i.substring(s[0].length),s[0].replace(II,l)),n=!1):(a+="<",i=i.substring(1))),n&&(t=i.indexOf("<"),a+=t<0?i:i.substring(0,t),i=t<0?"":i.substring(t),e.chars&&e.chars(Pb(a)))):(i=i.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+r.last()+"[^>]*>","i"),function(h,u){return u=u.replace(Z3,"$1").replace(eG,"$1"),e.chars&&e.chars(Pb(u)),""}),c("",r.last())),i===o)throw new Error("The sanitizer was unable to parse the following block of html: "+i);o=i}c()}function LI(i){return i.replace(/&/g,"&amp;").replace(tG,function(e){let t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+((t-55296)*1024+(n-56320)+65536)+";"}).replace(nG,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cG({buf:i,uriValidator:e=cs,cssUrlsAllowList:t=[]}){let n=!1;return{start:function(s,r,o){s=lo(s),!n&&QI[s]&&(n=s),!n&&DI[s]===!0&&(i.push("<"),i.push(s),Object.keys(r).forEach(function(a){let c=r[a],l=lo(a);if(l==="style"){let h=Lb(c,t);h&&(i.push(" "),i.push(a),i.push('="'),i.push(h),i.push('"'))}else{let h=s==="img"&&l==="src"||l==="background";oG[l]===!0&&(zI[l]!==!0||e(c,h))&&(i.push(" "),i.push(a),i.push('="'),i.push(LI(c)),i.push('"'))}}),i.push(o?"/>":">"))},end:function(s){s=lo(s),!n&&DI[s]===!0&&(i.push("</"),i.push(s),i.push(">")),s===n&&(n=!1)},chars:function(s){n||(wb(s)?i.push(s):i.push(LI(s)))}}}function Du(i,e=[]){if(i.indexOf("#")===0)return i;let t=Am(i);if(t.hostname===window.location.hostname)return i;let n=["a.sellpoint.net","qa.syndigo.cloud","uat.syndigo.cloud","content.syndigo.com","syndi.webcollage.net","cdn.cs.1worldsync.com","content.cs.1worldsync.com"];for(let r of n)if(t.hostname===r)return t.pathname.indexOf("preview.html")>-1?`unsafe-preview:${r}:${i}`:i;return!!e.find(function(r){return PI(r)===PI(t.hostname)})?i:`unsafe-default:${i}`}function PI(i){i.startsWith("https://")?i=i.replace("https://",""):i.startsWith("http://")&&(i=i.replace("http://",""));let{hostname:e}=Am(`https://${i}`);return e.startsWith("www.")&&(e=e.replace("www.","")),e}function Ta(i,e){let t=[],n=i.domainAllowList;return aG(e,cG({buf:t,uriValidator:function(s){return!/^unsafe/.test(Du(s,i.domainAllowList))},cssUrlsAllowList:n})),t.join("")}function ym(i,e,t=!0){if(e!=null){if(e===!0||e===!1)return e;if(Ca(e))return t?Ta(i,e):e;if(wo(e))return e;if(Array.isArray(e)){for(let n=e.length-1;n>=0;n--)e[n]=ym(i,e[n],t);return e}if(Qi(e)){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ym(i,e[n],t));return e}}}function Fb(i,e){let t=JSON.parse(JSON.stringify(e));return t["power-page"]&&HI(i,t["power-page"]),t.hero&&HI(i,t.hero),t}function HI(i,e){let t=e.widgets,n=function(r){try{return Ta(i,r)}catch{return i.tracking.sanitizeErrorRecorded||(i.tracking.sanitizeErrorRecorded=!0,pi(i,{type:"santizer",message:"invalid HTML in ec json"})),""}},s=function(r){return r?Du(r,i.domainAllowList):""};if(e.productData)for(let r of e.productData)r.url=s(r.url);return Object.keys(t).forEach(r=>{let o=t[r];switch(o.headerText=n(o.headerText),o.widgetType){case"Carousel":o.items.forEach(a=>{a.caption=n(a.caption),a.description=n(a.description),a.link=s(a.link)});break;case"DocumentGallery":o.items.forEach(a=>{a.caption=n(a.caption),a.description=n(a.description)});break;case"FeatureSet":o.items.forEach(a=>{Object.keys(a.features).forEach(c=>{a.features[c].caption=n(a.features[c].caption),a.features[c].description=n(a.features[c].description),a.features[c].link=s(a.features[c].link),a.features[c].relatedItem&&(a.features[c].relatedItem.caption=n(a.features[c].relatedItem.caption),a.features[c].relatedItem.description=n(a.features[c].relatedItem.description),a.features[c].relatedItem.link=s(a.features[c].relatedItem.link))})});break;case"ImageGallery":o.items.forEach(a=>{a.caption=n(a.caption),a.description=n(a.description),a.link=s(a.link)});break;case"VideoGallery":o.items.forEach(a=>{a.caption=n(a.caption),a.description=n(a.description),a.link=s(a.link)});break;case"ComparisonTable":for(let a of o.features)a.caption=n(a.caption),a.additionalInformation=n(a.additionalInformation);for(let a of o.products)if(a.columnTitle=n(a.columnTitle),a.url=s(a.url),a.featureDetails)for(let c of a.featureDetails)c.text=n(c.text);break;case"SpecificationTable":for(let a of o.rows){a.caption=n(a.caption);for(let c of a.cells)c.text=n(c.text)}break;case"InteractiveTour":for(let a of o.items)for(let c of a.features)c.caption=n(c.caption),c.description=n(c.description);break;case"FreeFormHtml":o.isTrustedSource?o.loadOutsideSyndi=!0:o.html=n(o.html);break}}),t}async function Lu(i,e,t=!0,n){!e.startsWith("blob:")&&!e.startsWith("data:")&&(i.tracking.timestamp&&(e=Px(i,e)),e=e.replace(/^\/\//,location.protocol.indexOf("https")===0?"https://":"http://"));let s=n?await fetch(e,{signal:n.signal}):await fetch(e),r;if(e.startsWith("data:")){let o=await s.text();r=JSON.parse(decodeURIComponent(o))}else r=await s.json();return ym(i,r,t)}async function ho({url:i,model:e,update:t,pageid:n,validateContent:s,contextName:r,raiseEvent:o}){try{let a=window.SYNDI.getFramework(),c=i||a.uriDataRoot+encodeURIComponent(n)+".json";if(e.ecJsonURL===c){e.contentElement.dispatchEvent(new CustomEvent("content",{bubbles:!0,detail:{hasContent:e.contentElement.hasContent},widgetCount:e.widgetCount}));return}e.ecJsonURL=c,e.controller&&(e.controller.abort(),e.controller=void 0);let l=VI({framework:a,pageid:n,url:i,contextName:r});e.controller=l.controller;let{pageJson:h,holdoutChoices:u}=await l.promise;if(s(h,e,a),lG(h,u,r))e.ecJson=h,e.contentElement.hasContent=!0,o("LOAD",e,t);else throw new Error(`Holdout testing will not display ${r} content`)}catch{e.ecJson=void 0,e.contentElement.hasContent=!1,e.widgetCount=0,o("LOAD_FAILURE",e,t)}e.contentElement.dispatchEvent(new CustomEvent("content",{bubbles:!0,detail:{hasContent:e.contentElement.hasContent,widgetCount:e.widgetCount}}))}function lG(i,e,t){if(t!=="logo-program"){let[n,s,r]=e;return!{hotspots:s,mosaic:s,powerpage:r}[t]||n}else return!0}function Ob({framework:i,pageid:e,url:t}){return VI({framework:i,pageid:e,url:t})}function VI({framework:i,pageid:e,url:t,contextName:n}){let s=new AbortController;return{controller:s,promise:hG(i,s,e,t,n)}}async function hG(i,e,t,n,s){let r=n||i.uriDataRoot+encodeURIComponent(t)+".json",a=await Lu(i,r,!1,e);return t=t||a?.pageId,s!=="logo-program"?dG(i,a,t):uG(i,a,t)}async function uG(i,e){return{pageJson:e}}async function dG(i,e,t){e=Sb(e);let n;if(t&&(Lx(i.tracking,t),n=`${i.uriDataRoot}${t}.json`),!(e?.enhancedProductContentId&&e?.componentId))e=jm(i,e,t);else{let s=e?.state,r=i.uriDataRoot.split("page"),o=`${e?.enhancedProductContentId}/${e?.componentId}`;n=`${r[0]}content/${o}${r[1]}${s}.json`}return e.experiences.contentURL=n,e.experiences=Eb(e.experiences),e.experiences?.["power-page"]&&ld(i.translations,e.experiences["power-page"]),e.experiences?.hero&&ld(i.translations,e.experiences.hero),e.experiences=Fb(i,e.experiences),{pageJson:e,holdoutChoices:Zm(i,e.enhancedProductContentId,e.componentId)}}async function Ia(i,e,t,n){await ho({url:i,model:e,update:t,pageid:n,validateContent:fG,contextName:"mosaic",raiseEvent:Vn})}function fG(i,e){if(!i?.experiences?.hero)throw new Error("No Hero content in the experience");if(!i?.experiences?.hero?.mosaicWidgetIds.length)throw new Error("No Mosaic widgets found in hero experience");e.widgetCount=i.experiences.hero.mosaicWidgetIds.length}function pn({el:i,innerHtml:e,serializable:t}){if(!i.shadowRoot){let n=i.attachShadow({mode:"open",serializable:t}),s=i.querySelector("template");s?(n.innerHTML=s.innerHTML,i.innerHTML=""):n.innerHTML=e}return i.shadowRoot}function Ir(i,e,t={}){let{threshold:n,rootMargin:s}=t,r={root:null,rootMargin:s||"100px",threshold:n||0},o=new IntersectionObserver(function(a){a[0].isIntersecting&&(o.disconnect(),e())},r);return o.observe(i),o}var Nb=class extends HTMLElement{constructor(){super(),pn({el:this,innerHtml:"<div></div>",serializable:!0});let e={state:"unmounted",controller:void 0,ecJson:void 0,ecJsonURL:void 0,currentVnode:ps(this.shadowRoot.querySelector("div")),intersectionObserver:void 0,contentElement:this,ribbon:Nr.init()};this._model=e;let t=function(){let n=Nr.view(e.ribbon,()=>t());e.currentVnode=Je.update(e.currentVnode,n)};this._update=t}connectedCallback(){this.addEventListener("open",function(){this.setAttribute("open","")}),this.addEventListener("close",function(){this.removeAttribute("open")});let e=this._model,t=this._update;this._model.intersectionObserver=Ir(this,function(){Vn("VIEWPORT_INTERSECT",e,t)}),Vn("CONNECT",this._model,this._update)}disconnectedCallback(){this._model.intersectionObserver.disconnect(),this._model.intersectionObserver=void 0,Vn("DISCONNECT",this._model,this._update)}attributeChangedCallback(e,t,n){if(e==="ecjsonurl")Ia(n,this._model,this._update);else if(e==="pageid"&&n?.trim())Ia("",this._model,this._update,n);else if(e==="open"){let s=n!==null;this._model.ribbon.state.ribbonVisible=s,this._update()}}static get observedAttributes(){return["ecjsonurl","pageid","open"]}};customElements.get("syndigo-mosaic-ribbon")||customElements.define("syndigo-mosaic-ribbon",Nb);var Ub=class extends HTMLElement{constructor(){super(),pn({el:this,innerHtml:"<div></div>",serializable:!0});let e={state:"unmounted",controller:void 0,ecJson:void 0,ecJsonURL:void 0,currentVnode:ps(this.shadowRoot.querySelector("div")),intersectionObserver:void 0,contentElement:this,modal:Ur.init()};this._model=e;let t=function(){let n=Ur.view(e.modal,()=>t());e.currentVnode=Je.update(e.currentVnode,n)};this._update=t}connectedCallback(){let e=this._model,t=this._update;this._model.intersectionObserver=Ir(this,function(){Vn("VIEWPORT_INTERSECT",e,t)}),Vn("CONNECT",this._model,this._update)}disconnectedCallback(){this._model.intersectionObserver.disconnect(),this._model.intersectionObserver=void 0,Vn("DISCONNECT",this._model,this._update)}attributeChangedCallback(e,t,n){if(e==="ecjsonurl")Ia(n,this._model,this._update);else if(e==="pageid"&&n?.trim())Ia("",this._model,this._update,n);else if(e==="open"){let s=n!==null;this._model.modal.state.open=s,this._update()}}static get observedAttributes(){return["ecjsonurl","pageid","open"]}};customElements.get("syndigo-mosaic-modal")||customElements.define("syndigo-mosaic-modal",Ub);function Sl(i){let e=i.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function Ci(i){if(i==null)return window;if(i.toString()!=="[object Window]"){let e=i.ownerDocument;return e&&e.defaultView||window}return i}function Pu(i){let e=Ci(i),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function WI(i){let e=Ci(i).Element;return i instanceof e||i instanceof Element}function Rr(i){let e=Ci(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function qI(i){if(typeof ShadowRoot>"u")return!1;let e=Ci(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function kb(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function Gb(i){return i===Ci(i)||!Rr(i)?Pu(i):kb(i)}function ls(i){return i?(i.nodeName||"").toLowerCase():null}function Ra(i){return((WI(i)?i.ownerDocument:i.document)||window.document).documentElement}function Qb(i){return Sl(Ra(i)).left+Pu(i).scrollLeft}function Br(i){return Ci(i).getComputedStyle(i)}function zb(i){let e=Br(i),t=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+n)}function Hb(i,e,t){t===void 0&&(t=!1);let n=Ra(e),s=Sl(i),r=Rr(e),o={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((ls(e)!=="body"||zb(n))&&(o=Gb(e)),Rr(e)?(a=Sl(e),a.x+=e.clientLeft,a.y+=e.clientTop):n&&(a.x=Qb(n))),{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}function Vb(i){return["table","td","th"].indexOf(ls(i))>=0}function Wb(i){return ls(i)==="html"?i:i.assignedSlot||i.parentNode||(qI(i)?i.host:null)||Ra(i)}function KI(i){return!Rr(i)||Br(i).position==="fixed"?null:i.offsetParent}function pG(i){let e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1;if(navigator.userAgent.indexOf("Trident")!==-1&&Rr(i)&&Br(i).position==="fixed")return null;let n=Wb(i);for(;Rr(n)&&["html","body"].indexOf(ls(n))<0;){let s=Br(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function qb(i){let e=Ci(i),t=KI(i);for(;t&&Vb(t)&&Br(t).position==="static";)t=KI(t);return t&&(ls(t)==="html"||ls(t)==="body"&&Br(t).position==="static")?e:t||pG(i)||e}var $I=mo(Xm(),1);function mG({parentElm:i,referenceElm:e,callbackFn:t}){let n={rect:{x:void 0,y:void 0,width:void 0,height:void 0},referenceElm:e,handlers:{rafId:void 0,reposition:void 0,resize:void 0}},s=(0,$I.default)(function(){let c=Hb(i,qb(e),!1);(n.rect.x!==c.x||n.rect.y!==c.y||n.rect.width!==c.width||n.rect.height!==c.height)&&(n.rect.x=c.x,n.rect.y=c.y,n.rect.width=c.width,n.rect.height=c.height,t(c))},10),r=new window.ResizeObserver(s);r.observe(e),n.handlers.resize=r,n.handlers.reposition=s;let o=(e?e.ownerDocument:document)||document;return window.addEventListener("resize",s,{passive:!0}),o.addEventListener("scroll",s,{passive:!0}),o.addEventListener("mousewheel",s,{passive:!0}),n.handlers.rafId=requestAnimationFrame(function a(){s(),setTimeout(function(){n.handlers.rafId=requestAnimationFrame(a)},1e3)}),n}function AG(i){let e=i.referenceElm.ownerDocument||document;window.removeEventListener("resize",i.handlers.reposition,{passive:!0}),e.removeEventListener("scroll",i.handlers.reposition,{passive:!0}),e.removeEventListener("mousewheel",i.handlers.reposition,{passive:!0}),i.handlers.reposition=void 0,i.handlers.resize.disconnect(),i.handlers.resize=void 0,cancelAnimationFrame(i.handlers.rafId),i.handlers.rafId=void 0}var Ba={init:mG,destroy:AG};var Fu=class extends HTMLElement{constructor(){super(),pn({el:this,innerHtml:"",serializable:!0}),this.displaymode="ribbon"}connectedCallback(){let e=document.createElement(`syndigo-mosaic-${this.displaymode}`);this.elm=e;let t=this;if(e?.addEventListener("content",function(s){t.hasContent=s.detail.hasContent,t.dispatchEvent(new CustomEvent("content",{bubbles:!0,detail:{hasContent:t.hasContent}}))}),this.ecjsonurl&&e.setAttribute("ecjsonurl",this.ecjsonurl),this.pageid&&e.setAttribute("pageid",this.pageid),this.open&&e.setAttribute("open",""),this.hoist){document.body.appendChild(e),e.style.position="absolute";let s=window.SYNDI.getFramework(),r=go(s.moduleParameters);this.po=Ba.init({parentElm:this,referenceElm:e,callbackFn:function(o){if(r.mosaicPosition==="top-left")e.style.left=`${Math.floor(o.x)}px`,e.style.top=`${Math.floor(o.y)}px`;else if(r.mosaicPosition==="bottom-left"){e.style.left=`${Math.floor(o.x)}px`;let a=40;e.style.top=Math.floor(o.height+o.y-a)+"px"}}})}else this.shadowRoot.appendChild(e);let n=this;e.addEventListener("open",function(){n.setAttribute("open","")}),e.addEventListener("close",function(){n.removeAttribute("open")})}disconnectedCallback(){this.hoist&&(Ba.destroy(this.po),this.po=void 0,document.body.removeChild(this.elm)),this.elm=void 0}attributeChangedCallback(e,t,n){if(e==="displaymode")(n==="ribbon"||n==="modal")&&(this.displaymode=n);else if(e==="ecjsonurl")this.ecjsonurl=n,this.elm&&this.elm.setAttribute("ecjsonurl",n);else if(e==="hoist"){let s=n!==null;this.hoist=s}else if(e==="open"){let s=n!==null;this.open=s,this.elm&&(s?this.elm.setAttribute("open",""):this.elm.removeAttribute("open"))}else if(e==="pageid")this.pageid=n,this.elm&&this.elm.setAttribute("pageid",n);else if(e==="hidden"){let s=n!==null;this.elm&&(s?this.elm.style.display="none":this.elm.style.display="")}}static get observedAttributes(){return["displaymode","ecjsonurl","hoist","pageid","open","hidden"]}};var XI="button.syndigo-hotspots-callout-button syndigo-svg-icon::part(guts){fill:var(--syndiHeroCalloutUnselectedPrimaryColor,#e6e7e8);color:var(--syndiHeroCalloutUnselectedSecondaryColor,rgba(0,0,0,.5))}button.syndigo-hotspots-callout-button-selected syndigo-svg-icon::part(guts){fill:var(--syndiHeroCalloutSelectedPrimaryColor,#cb2c90);color:var(--syndiHeroCalloutSelectedSecondaryColor,#e6e7e8)}";function YI(i,e){e()}function jI(i,e){e()}function JI(i){i.hotspots&&(i.hotspots.destroy(i),i.hotspots=null)}async function ZI(i,e){e();try{let t=window.SYNDI.getFramework();Hs(t),await window.SYNDI.importDynamic("experience/hotspots-element/hotspots/hotspots");let n=t.modules["experience/hotspots-element/hotspots/hotspots"];i.hotspots=i.hotspots||n(t);let s=JSON.parse(JSON.stringify(i.ecJson.experiences.hero)),r=i.hotspots.init({componentId:i.ecJson.componentId,enhancedProductContentId:i.ecJson.enhancedProductContentId,...s}),o=i.contentElement.shadowRoot.querySelector("div");o.innerHTML="",o.appendChild(r),hs("LOAD_SUCCESS",i,e)}catch(t){console.warn("failed to load syndigo hotspots data: ",t),hs("LOAD_FAILURE",i,e)}}function eR(i,e){i.ecJson&&hs("LOAD",i,e)}var vG={unmounted:{CONNECT:"mounted"},mounted:{VIEWPORT_INTERSECT:"visible"},visible:{LOAD:"loading"},loading:{LOAD_SUCCESS:"loaded",LOAD_FAILURE:"failed"},loaded:{LOAD:"loading",DISCONNECT:"unmounted",LOAD_FAILURE:"failed"},failed:{LOAD:"loading"}},EG={failed:YI,loading:ZI,loaded:jI,visible:eR},SG={loaded:JI};function hs(i,e,t,n){let s=e.state,r=vG[s][i];if(!r||r===s)return;e.state=r;let o=SG[s];o&&o(e,t,i,n);let a=EG[r];a&&a(e,t,i,n)}var tR="button.syndigo-hotspots-callout-button{position:absolute;border-radius:50%;animation:var(--syndiHeroCalloutHaloAnimation,syndigo-hotspots-animated-halo-single-pulse 5s);width:44px;height:44px;line-height:0;background-color:transparent;border:none;opacity:1;transition:opacity .28s ease;z-index:3;pointer-events:initial}button.syndigo-hotspots-callout-button syndigo-svg-icon::part(guts){display:inline;border:var(--syndiHeroCalloutIconBorder);border-radius:var(--syndiHeroCalloutIconBorderRadius)}button.syndigo-hotspots-callout-button syndigo-svg-icon{position:absolute;left:0;top:0}@keyframes syndigo-hotspots-animated-halo-infinite-alternate-pulse{from{box-shadow:0 0 6px 4px var(--syndiHeroCalloutHaloColor,rgba(0,0,0,.5))}to{box-shadow:0 0 6px 4px transparent}}@keyframes syndigo-hotspots-animated-halo-single-pulse{0%{box-shadow:0 0 0 0 var(--syndiHeroCalloutHaloColor,rgba(0,0,0,.5))}70%{box-shadow:0 0 0 10px transparent}to{box-shadow:0 0 0 0 transparent}}";var nR=".syndigo-hotspot-detail{display:flex;height:100%;flex-direction:column;width:420px;color:#000;align-items:center}.syndigo-hotspot-detail-in-popover{justify-content:center}.syndigo-hotspot-detail .ql-indent-1{padding-left:3em}.syndigo-hotspot-detail .free-form-html ul li{list-style-type:disc;margin-left:1.2em;margin-top:4px}.syndigo-hotspot-description{width:100%;text-align:left}.syndigo-hotspot-description>ul{padding-left:18px;margin-bottom:0}.syndigo-hotspot-detail-close{position:absolute;top:12px;right:14px;background-color:transparent;border:none;padding:0;margin:0}h3.syndigo-hotspot-detail-header{display:flex;flex-direction:row;align-items:flex-start;margin-top:0;margin-bottom:15px;width:100%;min-height:22px;font-size:20px;font-weight:400}svg.syndigo-hotspot-header-svg{width:26px;height:26px;flex-shrink:0}a.syndigo-hotspot-detail-link{padding:10px;border-radius:4px;border:none;cursor:pointer;color:#fff;background-color:#000;font-size:1.1em;margin:14px 0}img.syndigo-hotspot-detail-image{display:block;width:100%;min-height:1px;height:auto;width:auto;max-width:350px}";var iR="button.syndigo-hotspots-callout-toggle{background-color:transparent;border:none;position:absolute;z-index:1;pointer-events:initial}button.syndigo-hotspots-callout-toggle svg{width:32px;background-color:rgba(255,255,255,.5)}.syndigo-hotspots-holder{width:100%;height:100%;overflow:visible;position:absolute;background-color:transparent!important}";var bm=class extends HTMLElement{constructor(){super(),pn({el:this,serializable:!0,innerHtml:`<style>${ms}</style>
            <style>${XI}</style>
            <style>${iR}</style>
            <style>${nR}</style>
            <style>${tR}</style>
            
            <div id="syndi_hotspots" style="width: 100%; height: 100%;"></div>`});let e={state:"unmounted",controller:void 0,ecJson:void 0,ecJsonURL:void 0,intersectionObserver:void 0,contentElement:this,hotspots:void 0},t=()=>{};this._model=e,this._update=t}connectedCallback(){let e=this._model,t=this._update,n=window.SYNDI.getFramework(),s=Cx(n.moduleParameters);e.intersectionObserver=Ir(this,function(){hs("VIEWPORT_INTERSECT",e,t)},{rootMargin:s.intersectionRootMargin}),hs("CONNECT",e,t)}disconnectedCallback(){this._model.intersectionObserver.disconnect(),this._model.intersectionObserver=null,hs("DISCONNECT",this._model,this._update)}attributeChangedCallback(e,t,n){e==="ecjsonurl"?ho({url:n,model:this._model,update:this._update,pageid:"",validateContent:sR,contextName:"hotspots",raiseEvent:hs}):e==="pageid"&&n?.trim()&&ho({url:"",model:this._model,update:this._update,pageid:n,validateContent:sR,contextName:"hotspots",raiseEvent:hs})}static get observedAttributes(){return["ecjsonurl","pageid"]}};function sR(i,e){if(!i?.experiences?.hero)throw new Error("No Hero content in the experience");if(!i?.experiences?.hero?.heroImages.length)throw new Error("No Hotspot hero imagesx found in hero experience");if(e.widgetCount=Object.keys(i?.experiences?.hero?.heroImages[0].callouts).length,!e.widgetCount)throw new Error("No Hotspot widgets found in hero experience")}customElements.get("syndigo-hotspots-overlay")||customElements.define("syndigo-hotspots-overlay",bm);var Ou=class extends HTMLElement{constructor(){super(),pn({el:this,innerHtml:`<style>${ms}</style>`,serializable:!0}),this.positionObserver=void 0,this.elem=document.createElement("syndigo-hotspots-overlay");let e=window.SYNDI.getFramework();this.elem.id=`${e.hotspotsElementId}-overlay`,this._minContainerImageWidth=void 0}getMinContainerImageWidth(e,t){if(this._minContainerImageWidth)return this._minContainerImageWidth;let n=this.elem._model?.ecJson?.experiences?.hero?.heroImages[0].callouts;if(!n)return;let s=Object.values(n).map(d=>[d.x,d.y]);if(s.length<2)return;n=Object.values(n).map(d=>[Math.round(d.x*e),Math.round(d.y*t)]);let r=1/0,o,a;for(let d=0;d<n.length;d++)for(let f=0;f<n.length;f++)d<f&&Kb(n[d],n[f])<r&&(r=Kb(n[d],n[f]),o=d,a=f);let c=36,l=1,h=1024,u=t/e;for(;h-l>1;){let d=h-l,f=l+Math.floor(d/2),p=f*u,g=s.map(A=>[Math.round(A[0]*f),Math.round(A[1]*p)]);Kb(g[o],g[a])>=c?h=f:l=f}return this._minContainerImageWidth=l,this._minContainerImageWidth}connectedCallback(){let e=this.elem;e.style.position="absolute",e.style.height="100%",e.style.width="100%",e.style.left="0px",e.style.top="0px",e.style.zIndex=getComputedStyle(this).zIndex||1;let t=this;e.addEventListener("content",function(n){t.hasContent=n.detail.hasContent,t.dispatchEvent(new CustomEvent("content"),{bubbles:!0,detail:{hasContent:t.hasContent}})}),this.ecjsonurl&&e.setAttribute("ecjsonurl",this.ecjsonurl),this.pageid&&e.setAttribute("pageid",this.pageid),e.style.display=this.hidden?"none":"",rR(this.hoist,this)}disconnectedCallback(){this.positionObserver&&(Ba.destroy(this.positionObserver),this.positionObserver=null),this.hoist&&document.body.removeChild(this.elem)}attributeChangedCallback(e,t,n){if(e==="ecjsonurl")this.elem&&this.elem.setAttribute("ecjsonurl",n);else if(e==="pageid")this.elem&&this.elem.setAttribute("pageid",n);else if(e==="hidden"){let s=n!==null;this.elem&&(this.elem.style.display=s?"none":"")}else if(e==="hoist"){let s=n!==null;this.hoist=s,rR(this.hoist,this)}}static get observedAttributes(){return["ecjsonurl","pageid","hidden","hoist"]}};function rR(i,e){i?(document.body.append(e.elem),TG(e)):e.shadowRoot.append(e.elem)}function TG(i){i.positionObserver&&(Ba.destroy(i.positionObserver),i.positionObserver=null);let e=i,t=i.elem;i.positionObserver=Ba.init({parentElm:e,referenceElm:t,callbackFn:function(n){t.style.left=`${Math.floor(n.x)}px`,t.style.top=`${Math.floor(n.y)}px`,t.style.height=`${n.height}px`,t.style.width=`${n.width}px`}})}function Kb(i,e){let t=e[0]-i[0],n=e[1]-i[1];return Math.hypot(t,n)}var oR=":host{color:var(--syndiCommonBodyTextColor)}.syndigo-widget-section-header{margin-block-start:10px;margin-block-end:5px;background-color:transparent;font-family:var(--syndiCommonHeaderFontFamily),var(--syndiDefaultFontFamily);color:var(--syndiCommonHeaderColor,#565758);font-size:var(--syndiCommonHeaderFontSize, 19px);font-weight:var(--syndiCommonHeaderFontWeight,bold)}.syndigo-powerpage-grid-widget{position:relative;display:flex;flex-direction:column}.syndigo-powerpage-grid-widget.noheader .syndigo-widget-section-header{display:none}.syndigo-powerpage-grid-widget.noheader.has-fullscreen .syndigo-widget-section-header{display:block;block-size:32px;margin:0}.syndigo-powerpage-grid-widget.has-fullscreen:is(:hover) .syndigo-widget-section-header{inline-size:calc(100% - 47px)}.syndigo-powerpage-grid-widget .syndigo-fullscreen-button{inset-block-start:5px}.syndigo-powerpage-grid-widget:fullscreen .syndigo-fullscreen-button,.syndigo-powerpage-grid-widget:hover .syndigo-fullscreen-button{opacity:1}.syndigo-powerpage-grid-widget.noheader.has-fullscreen .syndigo-fullscreen-button,.syndigo-powerpage-grid-widget.noheader.has-fullscreen:is(:hover) .syndigo-fullscreen-button{inset-block-start:-5px}.syndigo-powerpage-grid-widget.has-fullscreen:fullscreen .syndigo-fullscreen-button,.syndigo-powerpage-grid-widget.noheader.has-fullscreen:fullscreen .syndigo-fullscreen-button,.syndigo-powerpage-grid-widget.noheader.has-fullscreen:fullscreen:hover .syndigo-fullscreen-button,.syndigo-powerpage-grid-widget:fullscreen:hover .syndigo-fullscreen-button{inset-block-start:5px}.syndigo-powerpage-grid-widget:fullscreen.noheader.has-fullscreen .syndigo-widget-section-header,.syndigo-powerpage-grid-widget:fullscreen>.syndigo-widget-section-header{display:none}.syndigo-powerpage-grid-widget:fullscreen,.syndigo-powerpage-grid-widget:fullscreen.noheader{padding-block-start:42px}.syndigo-powerpage-grid{display:grid;grid-gap:10px;grid-template-columns:minmax(10px,1fr);inline-size:100%}.syndigo-powerpage-grid sub,.syndigo-powerpage-grid sup{font-size:9px}.syndigo-powerpage-grid{counter-reset:footnote-index}.syndigo-powerpage-grid-widget span.syndigo-footnote-index{counter-increment:footnote-index}.syndigo-powerpage-grid-widget span.syndigo-footnote-index::after{display:inline-block;font-size:9px;content:counter(footnote-index);vertical-align:super;margin-inline-start:.25em}.syndigo-powerpage-grid-widget .syndigo-footnotes{line-height:normal;color:var(--syndiPowerPageMainHeaderColor);font-family:var(--syndiPowerPageMainHeaderFontFamily),var(--syndiDefaultFontFamily);font-weight:var(--syndiPowerPageMainHeaderFontWeight);font-size:var(--syndiPowerPageMainHeaderFontSize);background-color:transparent;border:0 none #000;inline-size:auto;block-size:auto}.syndigo-powerpage-grid-widget .syndigo-footnotes li{background-color:transparent;border:0 none #000;inline-size:auto;block-size:auto;font-weight:var(--syndiPowerPageMainHeaderFontWeight)}.syndigo-powerpage-grid-widget:fullscreen{overflow-y:auto}.syndi_powerpage :is(h1,h2,h3,h4,h5,h6){inline-size:100%}.syndi_powerpage{position:var(--syndiPowerPageGridPositionStrategy,static);z-index:var(--syndiPowerPageGridZIndex,auto);margin:var(--syndiPowerPageGridMargin,0)}.syndigo-powerpage-grid.ThemeNoGap{row-gap:var(--syndiThemeNoGap,0)}.syndi_powerpage.ThemeRoundOuterCorners{border-radius:var(--syndiThemeRoundOuterCorners,24px)}.syndi_powerpage.ThemeRoundOuterCorners .syndigo-detail-disclaimer{padding-block-start:15px}.syndi_powerpage.ThemeDarkMode .syndigo-detail-disclaimer,.syndi_powerpage.ThemeDarkMode .syndigo-widget-section-header,.syndi_powerpage.ThemeRoundOuterCorners .syndigo-detail-disclaimer,.syndi_powerpage.ThemeRoundOuterCorners .syndigo-widget-section-header{margin-inline-start:15px}.syndi_powerpage.ThemeDarkMode,.syndi_powerpage.ThemeRoundOuterCorners{padding-block-end:24px}.syndi_powerpage.ThemeDarkMode{background-color:var(--syndiThemeDarkModeBackgroundColor,#000)}.syndi_powerpage.ThemeDarkMode .syndigo-detail-disclaimer,.syndi_powerpage.ThemeDarkMode .syndigo-widget-section-header{color:var(--syndiThemeDarkModeColor,#fff)}";var aR=".syndigo-fullscreen-button{position:absolute;inset-block-start:10px;inset-inline-end:10px;z-index:16;transform:translateZ(0);opacity:0;transition:opacity .1s linear;padding:0;margin:0;inline-size:32px;block-size:32px;background-color:var(--syndiCommonElementControlsBackgroundColor,#000);border-radius:4px}.syndigo-fullscreen-button:focus{opacity:1}";var lR=600,cR=1440,BG=1080,Yb=900,$b=600,DG={THUMBSTRIP_VERTICAL_WIDTH:106,THUMBSTRIP_HORIZONTAL_HEIGHT:110,THUMB_CONTAINER_SIZE:90,THUMB_SIZE:104,THUMB_SLIDE_SIZE:100,THUMB_SCROLL_BUTTON_SIZE:80,AVOID_THUMB_CONTROLS:30,TARGET_THUMB_SIZE:70,GRID_GAP:3},Nu={BlackOverWhite:"BlackOverWhite",WhiteOverBlack:"WhiteOverBlack",BlackNoBackground:"BlackNoBackground",WhiteNoBackground:"WhiteNoBackground",Custom:"Custom"};function LG({colorOption:i,fontColor:e,fontBackgroundColor:t}){let n="#ffffff",s="#000000",r={fontColor:e,fontBackgroundColor:t};switch(i){case Nu.BlackOverWhite:r.fontColor=s,r.fontBackgroundColor=n;break;case Nu.WhiteOverBlack:r.fontColor=n,r.fontBackgroundColor=s;break;case Nu.BlackNoBackground:r.fontColor=s,r.fontBackgroundColor="transparent";break;case Nu.WhiteNoBackground:r.fontColor=n,r.fontBackgroundColor="transparent";break;case Nu.Custom:r.fontColor=r.fontColor||e,r.fontBackgroundColor=r.fontBackgroundColor||t;break;default:break}return r}function Xb({isFullscreen:i,dimension:e,experience:t,isNarrowDevice:n}){return e==="width"?i?document.documentElement.clientWidth>window.innerWidth?window.innerWidth:document.documentElement.clientWidth:window.outerWidth>cR?cR:window.outerWidth:t===Hn.mosaic||window.outerHeight<BG&&n?$b:Yb}function hR(i){return i<=lR}function PG(i,e){if(i&&i.isEnabled)return i.maxHeight||Yb;let t=hR(Xb({isFullscreen:!1,dimension:"width"}));return Xb({dimension:"height",experience:e,isNarrowDevice:t})}function uR(i){return Xb({isFullscreen:i,dimension:"width"})}function FG(i){let e=i.fullscreen.isEnabled;return e?uR(e):i.displayWidth}var dR={isNarrow:hR,maxHeight:PG,maxWidth:uR,getRealWidgetWidth:FG,getColorPresets:LG,NARROW_WIDTH:lR,MEDIA_HEIGHT_WIDE:Yb,MEDIA_HEIGHT_NARROW:$b,THUMBNAIL_DIMENSIONS:DG};function jb(){return window.self!==window.top}function OG(i){let{framework:e,componentId:t,enhancedProductContentId:n,experienceType:s,displayWidth:r}=i,o=function(p){p=Ua(s,n,t,p),ka(e,p)},c=ds(e.moduleParameters).showInlineWatermark!=="false",l=wx(e.moduleParameters),u=JSON.stringify(i.widgets).includes('"video/hls"')&&l.clearParentTransform==="true",d={intersectionObservers:[],resizeObserver:void 0,fullscreenObserver:void 0,fullscreenWidgetId:void 0,fullscreenEnableTime:void 0,track:o,displayWidth:r,siteWatermarkEnabled:c,everIntersectedViewport:!1,disclaimerSetting:l.disclaimerSetting,clearParentTransform:u,htmlOutsideSyndi:"",...i};if(!d.enhancedProductContentId)throw new Error("missing required parameter: enhancedProductContentId");let f=!Eo(e);for(let p in d.widgets){let g=d.widgets[p],{widgetType:A}=g,m=Di(e,A);if(!m)throw new Error(`unknown widget type: '${A}'`);if(g.isTrustedSource&&g.loadOutsideSyndi){d.htmlWidget={...m,model:m.init({...g,track:o,displayWidth:r,experience:Hn.powerpage})},delete d.widgets[p];continue}d.widgets[p]=m.init({...g,framework:e,track:o,displayWidth:r,experience:Hn.powerpage,localize:b=>e.localize(A,b),fullscreen:{isEnabled:!1,isFeatureDisabled:f,maxWidth:0,maxHeight:0}})}return d}function NG(i){i.fullscreenObserver&&(window.document.removeEventListener("fullscreenchange",i.fullscreenObserver),i.fullscreenObserver=void 0),i.resizeObserver&&i.resizeObserver.disconnect(),i.intersectionObservers.forEach(e=>{e.disconnect()}),i.intersectionObservers.length=0,Object.keys(i.widgets).map(e=>{let t=i.widgets[e];Di(i.framework,t.widgetType).destroy(t)}),i.htmlWidget?.destroy&&i.htmlWidget.destroy(i.htmlWidget.model)}function UG(i){return Je`
        <div class="syndigo-detail-disclaimer"
             style="${i.style?i.style:""}"
             @props:textContent="${i.text}"></div>`}function kG(i,e,t){let n=function(l,h){let u=Ir(l.elm,function(){let{widgetId:d,widgetType:f}=i.widgets[h];i.everIntersectedViewport||(i.everIntersectedViewport=!0,i.track({a:"intersect"})),i.track({a:"intersect",wt:f,wi:d}),t()},{rootMargin:"0px"});i.intersectionObservers.push(u)},s=i.widgets[e];s.displayWidth=i.displayWidth;let r=Di(i.framework,s.widgetType),o=function(l){let h=l.currentTarget;!window.document.fullscreenElement&&h?(s.fullscreen.isEnabled=!0,i.fullscreenWidgetId=e,i.fullScreenRequesterRef=h.parentElement,i.fullscreenEnableTime=Date.now(),i.track({a:"full-screen-open",wt:s.widgetType,wi:s.widgetId}),h.parentElement.requestFullscreen()):window.document.exitFullscreen&&(s.fullscreen.isEnabled=!1,document.exitFullscreen())},a=dR.isNarrow(i.displayWidth),c=!s.headerText.length;return Je`<div class="syndigo-powerpage-grid-widget"
        @key=syndigo-${i.enhancedProductContentId}-grid-${e}
        @hook:insert=${l=>n(l,e)}
        @class:noheader=${c}
        @class:has-fullscreen=${!s.fullscreen.isFeatureDisabled}
        @class:narrow=${a}>

        <h2 class="syndigo-widget-section-header"
                @style:display=${c?"none":""}
                @props:innerHTML=${c?"":s.headerText}></h2>

        <button class="syndigo-fullscreen-button" style="fill: white;"
            @style:display=${s.fullscreen.isFeatureDisabled?"none":""}
            data-text="fullscreenTooltip"
            title=""
            type="button"
            @attrs:aria-expanded=${i.isEnabled}
            aria-label="${i.isEnabled?"Close full screen":"Open in full screen"}"
            @on:click=${o}>

            <style>${aR}</style>

            <syndigo-svg-icon icon="expand2" width="28" height="28" fill="white" color="red" />
        </button>

        ${r.view(s,t)}

    </div>`}function GG(i){for(;i;){try{let e=window.getComputedStyle(i);if(e&&e.getPropertyValue("transform")!=="none"){i.style.transform="none";break}if(e&&e.getPropertyValue("will-change")&&e.getPropertyValue("will-change").includes("transform")){i.style.willChange="auto";break}if(e&&e.getPropertyValue("content-visibility")&&e.getPropertyValue("content-visibility").includes("auto")){i.style["content-visibility"]="visible";break}}catch{}i=i.parentElement}}function QG(i,e){let t=function(s){i.clearParentTransform&&GG(s.elm.parentElement),i.resizeObserver=new ResizeObserver(function(r){let o=r[0];i.displayWidth=Math.round(o.contentRect.width),jb()&&window.parent.postMessage(JSON.stringify({messageType:"powerpageHeightUpdateRequest",params:{id:i.enhancedProductContentId,height:Math.round(o.contentRect.height),docHeight:window.document.body.scrollHeight}}),"*"),e()}),i.fullscreenObserver=function(){if(i.fullscreenWidgetId)if(window.document.fullscreenElement){let r=i.widgets[i.fullscreenWidgetId];Ka(Hn.powerpage,r,i.fullScreenRequesterRef)}else{let r=i.widgets[i.fullscreenWidgetId];i.fullscreenWidgetId=null;let o=(Date.now()-i.fullscreenEnableTime)/1e3;i.track({a:"full-screen-close",wt:r.widgetType,wi:r.widgetId,t:o}),r.fullscreen.isEnabled=!1}},window.document.addEventListener("fullscreenchange",i.fullscreenObserver),i.resizeObserver.observe(s.elm)};return Je`<div class="syndi_powerpage"
                     @key=syndigo-${i.enhancedProductContentId}-grid
                     @hook:insert=${t}
                     style="max-inline-size: 1440px; inline-size: 100%;"
                     @class:ThemeRoundOuterCorners=${i.styleOverrides.applyTheme.RoundOuterCorners}
                     @class:ThemeRoundWidgetCorners=${i.styleOverrides.applyTheme.RoundWidgetCorners}
                     @class:ThemeRoundWidgetMediaCorners=${i.styleOverrides.applyTheme.RoundWidgetMediaCorners}
                     @class:ThemeDarkMode=${i.styleOverrides.applyTheme.DarkMode}>

                <style>
                :host {
                    ${i.framework.siteCssProperties.powerpage}
                    ${i.framework.siteCssProperties.widget}
                    ${i.framework.siteCssProperties.common}
                    ${i.styleOverrides.siteThemeProperties}
                }
                </style>
                <style>${ms}</style>
                <style>${oR}</style>
                
                <div style="padding-block-end: 10px;" @style:display=${"none"}>
                    ${vo(i.framework)}
                </div>

                ${i.disclaimerSetting?UG(i.disclaimerSetting):""}
                
                <div class="syndigo-powerpage-grid"
                    @class:ThemeNoGap=${i.styleOverrides.applyTheme.NoGap}>
                    ${Object.keys(i.widgets).map(s=>kG(i,s,e))}
                </div>
        </div>`}var wl={init:OG,view:QG,destroy:NG};function fR(i,e){e()}function pR(i,e){e()}function mR(i){i.powerpage&&(wl.destroy(i.powerpage),i.powerpage=void 0)}async function AR(i,e){if(e(),!i.ecJson){Dr("LOAD_FAILURE",i,e);return}try{let t=window.SYNDI.getFramework();Hs(t);let n=i.ecJson,s=n.experiences["power-page"],r=n.componentId,o=n.enhancedProductContentId;await window.SYNDI.importDynamic("experience/widget-catalog"),i.powerpage=wl.init({framework:t,enhancedProductContentId:o,componentId:r,...s}),Dr("LOAD_SUCCESS",i,e)}catch(t){console.warn("failed to load syndigo power page data:",t),Dr("LOAD_FAILURE",i,e)}}var WG={unmounted:{CONNECT:"loading"},loading:{LOAD_SUCCESS:"loaded",LOAD_FAILURE:"failed"},loaded:{LOAD:"loading",DISCONNECT:"unmounted"},failed:{LOAD:"loading"}},qG={failed:fR,loading:AR,loaded:pR},KG={loaded:mR};function Dr(i,e,t,n){let s=e.state,r=WG[s][i];if(!r||s===r)return;let o=KG[s];e.state=r,o&&o(e,t,i,n);let a=qG[r];a&&a(e,t,i,n)}function gR(i,e,t){if(!i?.experiences?.["power-page"])throw new Error("No power page content in the experience");if(t.retailerwebsite?.publishrules&&!e.contentElement?.classList.contains("syndigo-standalone"))for(let n in i.experiences["power-page"].widgets){let s=i.experiences["power-page"].widgets[n];t.retailerwebsite?.publishrules(s)||delete i.experiences["power-page"].widgets[n]}if(e.widgetCount=Object.keys(i.experiences["power-page"].widgets).length,!e.widgetCount)throw new Error("No power page widgets found in power page experience")}var Uu=class extends HTMLElement{constructor(){super(),pn({el:this,serializable:!0,innerHtml:`<style>
                :host { display: block }

                :host([hidden]) { display: none; }
            </style>

            <div></div>`});let e={state:"unmounted",controller:void 0,ecJson:void 0,ecJsonURL:void 0,currentVnode:ps(this.shadowRoot.querySelector("div")),powerpage:void 0,contentElement:this};this._model=e;let t=function(){let n;e.powerpage?(e.powerpage.htmlWidget&&!e.hasLoadedHtmlWidget&&(e.hasLoadedHtmlWidget=!0,e.powerpage.htmlWidget.viewOutsideTargetElement(e.powerpage.htmlWidget.model,e.contentElement)),n=wl.view(e.powerpage,()=>t())):n=Je`<div style="display: flex; justify-content: center;"
                                     @style:visibility=${e.state==="loading"?"visible":"hidden"}>
                                    <syndigo-svg-icon icon="loader"
                                                      width="32" height="32"
                                                      @style:display=${e.state==="failed"?"none":""}/>
                                </div>`,e.currentVnode=Je.update(e.currentVnode,n)};this._update=t,this.addEventListener("click",function(n){n.stopPropagation()})}connectedCallback(){Dr("CONNECT",this._model,this._update)}disconnectedCallback(){Dr("DISCONNECT",this._model,this._update)}attributeChangedCallback(e,t,n){e==="ecjsonurl"?ho({url:n,model:this._model,update:this._update,pageid:"",validateContent:gR,contextName:"powerpage",raiseEvent:Dr}):e==="pageid"&&n?.trim()&&ho({url:"",model:this._model,update:this._update,pageid:n,validateContent:gR,contextName:"powerpage",raiseEvent:Dr})}static get observedAttributes(){return["ecjsonurl","pageid"]}};function yR(i,e){let{asset:t,track:n,shouldPlay:s,videoTag:r}=i,o=t.assetId,a=t.duration,c=t.videoApi,l=h=>{h.ai=o,h["media-api"]=c,n(h)};r.onloadstart=function(){l({a:"load"})},r.onloadedmetadata=function(){l({a:"loadmeta"})},r.onplay=function(){i.windowScrollY=window.visualViewport.pageTop,i.lastRatio=0,i.playTimestamp=+new Date,l({a:"play"}),Nt("PLAY",i,e)},r.onpause=function(){Nt("PAUSE",i,e),r.ended||l({a:"pause",t:(+new Date-i.playTimestamp)/1e3})},r.onended=function(){l({a:"complete",ad:a,t:(+new Date-i.playTimestamp)/1e3}),i.shouldPlay=!1,Nt("ENDED",i,e),e()},r.ontimeupdate=function(){let h=Math.floor(r.currentTime/r.duration*4);if(h>i.lastRatio){i.lastRatio=h;let u=h*25,d=(+new Date-i.playTimestamp)/1e3;l({a:"update",ad:a,duration:u,t:d})}},r.onerror=function(){l({a:"error",code:r.error?r.error.code:""})},r.onfullscreenchange=r.onwebkitfullscreenchange=r.onmozfullscreenchange=function(){!document.fullScreenElement&&!document.webkitFullscreenElement&&!document.mozFullscreenElement?setTimeout(()=>{window.scrollTo(0,i.windowScrollY)},500):window.visualViewport.pageTop>0&&(i.windowScrollY=window.visualViewport.pageTop)},s&&Nt("PLAY",i,e)}var Jb;function ku(){if(Jb===void 0){let i=document.createElement("video");Jb=i.canPlayType('application/x-mpegURL codecs="avc1.42E01E"')||i.canPlayType("application/vnd.apple.mpegurl")}return Jb}async function bR(i,e){if(!i.hlsSources.length&&!i.nonHlsSources.length)return Nt("MEDIA-ATTACHED",i,e);if(!i.hlsSources.length&&i.nonHlsSources.length)return i.videoTag.src=i.nonHlsSources[0].url,Nt("MEDIA-ATTACHED",i,e);let t=!!window.chrome;if(ku()&&!t)return Nt("MEDIA-ATTACHED",i,e);let n=window.SYNDI.getFramework();if(!i.hls){await window.SYNDI.importDynamic("lib/ponyfill-hls");let r=n.modules["lib/ponyfill-hls"];r?.isSupported()&&(i.hls=new r({maxMaxBufferLength:15}))}if(!i.hls)return;i.hls.attachMedia(i.videoTag);let s=n.modules["lib/ponyfill-hls"];i.hls.on(s.Events.MEDIA_ATTACHED,function(){i.hls.loadSource(i.hlsSources[0].url,"hls"),Nt("MEDIA-ATTACHED",i,e)})}function xR(i,e){e(),i.shouldPlay&&Nt("PLAY",i,e)}function _R(i,e){let t=i.videoTag.parentNode.querySelector("button");t.style.display="none";let n=i.videoTag?.play();n!==void 0?n.then(()=>{Nt("STARTED",i,e)}).catch(()=>{i.shouldPlay=!1,Nt("FAILED",i,e)}):Nt("STARTED",i,e)}function vR(i,e){i.shouldPlay=!0,e()}function ER(i,e){i.videoTag.pause(),i.shouldPlay=!1,e()}var eQ={unmounted:{"VIDEO-TAG-INSERTED":"mounted"},mounted:{PLAY:"mediaAttaching"},mediaAttaching:{"MEDIA-ATTACHED":"starting"},ready:{PLAY:"starting"},starting:{STARTED:"playing",FAILED:"ready"},playing:{ENDED:"ready",PAUSE:"paused"},paused:{ENDED:"ready",PLAY:"starting"}},tQ={mounted:yR,mediaAttaching:bR,ready:xR,starting:_R,playing:vR,paused:ER};function Nt(i,e,t){let n=eQ[e.state][i];!n||e.state===n||(e.state=n,tQ[n]?.(e,t))}var SR="*{box-sizing:border-box}.syndigo-video{position:relative;max-block-size:100%;max-inline-size:100%;block-size:100%;inline-size:100%}.syndigo-video>video{max-block-size:100%;max-inline-size:100%;inline-size:100%;block-size:100%;background-color:#000}.syndigo-video-big-play-button{position:absolute;inline-size:76px;block-size:66px;inset-block-start:calc(50% - 33px);inset-inline-start:calc(50% - 38px);margin:initial;z-index:15;background:0 0;border:none}.syndigo-video-big-play-button>svg{color:rgba(43,51,63,.7);transition:color .25s linear}.syndigo-video-big-play-button>svg:hover{color:#000}button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation}:host(.ThemeRoundWidgetMediaCorners) .syndigo-video>video{border-radius:var(--syndiThemeRoundWidgetMediaCorners,0);border:solid .2px #00000030}";function wR(i,e,t="jpeg"){let{url:n,availableWidths:s}=i,r;for(let o of s)if(r=o,e<=r)break;return n.replace("{0}",r).replace("{1}",t)}function Zb(i,e){let{url:t,availableWidths:n}=i;return n.map(s=>`${t.replace("{0}",s).replace("{1}",e)} ${s}w`).join(`,
`)}var iQ={avif:"image/avif",webp:"image/webp",jpg:"image/jpg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",svg:"image/svg+xml"};function CR(i){let e=["webp","jpg","jpeg","png","gif","svg"],t=[],n="";for(let r of e)if(i.availableTypes.includes(r)){let o=iQ[r];t.push({ext:r,srcset:Zb(i,r),mimeType:o}),n||(n=r)}return{sources:t.map(({ext:r,mimeType:o})=>Je`<source srcset="${Zb(i,r)}" type="${o}">`),sourcesData:t,fallbackImageType:n}}var ex="syndi-is-playing";function sQ(i){return i&&i.currentTime>0&&!i.paused&&!i.ended&&i.readyState>2}function rQ(i){return i?.getAttribute(ex)!=null}function Lr(i){return i?sQ(i)||rQ(i):!1}function MR(i){i.setAttribute(ex,"")}function tx(i){i.removeAttribute(ex)}var nx="syndigo-video-play";function xm(i){document.body.addEventListener(nx,i)}function Gu(i){document.body.removeEventListener(nx,i)}function Da(i){i.dispatchEvent(new CustomEvent(nx,{bubbles:!0,composed:!0}))}function oQ(i,e){return!i.composedPath().includes(e)}function _m(i,e){return Lr(e)&&oQ(i,e)}function ix(){return/Android/i.test(navigator.userAgent)}var sx=[960,1920];function aQ(i,e){for(let t of sx)if(t>e)return i.replace("{0}",t);return i.replace("{0}",sx[sx.length-1])}function cQ(i){let{asset:e,track:t,shouldPlay:n,fsmEvents:s,videoLoop:r,ariaVideoLabel:o}=i;return{asset:e,track:t,shouldPlay:n||!1,videoLoop:r,lastRatio:0,playTimestamp:0,state:"unmounted",uniqueVideoKey:`vid-${Ii()}-${e.assetId}`,hlsSources:e.sources.filter(a=>a.mimeType==="video/hls"),nonHlsSources:e.sources.filter(a=>a.mimeType!=="video/hls"),hls:void 0,videoTag:void 0,videoPlayListener:void 0,windowScrollY:0,fsmEvents:s||{pause:void 0,play:void 0},ariaVideoLabel:o||"Video player"}}function lQ(i,e){let{asset:t,hlsSources:n,videoLoop:s}=i;i.fsmEvents.play=function(){Nt("PLAY",i,e)},i.fsmEvents.pause=function(){Nt("PAUSE",i,e)};let r=function(m){m.elm&&(i.state="unmounted",i.videoTag=m.elm,i.videoPlayListener=function(b){_m(b,i.videoTag)&&Nt("PAUSE",i,e)},xm(i.videoPlayListener),Nt("VIDEO-TAG-INSERTED",i,e))},o=function(){i.hls&&(i.hls.destroy(),i.hls=void 0),i.videoPlayListener&&(Gu(i.videoPlayListener),i.videoPlayListener=void 0)},a=function(){Lr(i.videoTag)&&!i.shouldPlay?Nt("PAUSE",i,e):!Lr(i.videoTag)&&i.shouldPlay&&Nt("PLAY",i,e)},c=(ku()?n:[]).map(m=>{let b=m.mimeType==="video/hls"?m.url:aQ(m.url,window.visualViewport.width);return Je`<source src="${b}" type="application/x-mpegURL"></source>`}),l=t.tracks.map(m=>Je`<track kind="${m.kind}" srclang="${m.srcLang}" label="${m.srcLang}" src="${m.url}"/>`),{fallbackImageType:h}=CR(t.poster),u=wR(t.poster,window.visualViewport.width||720,h),d="contain";if(t.poster){let m=t.originalWidth/t.originalHeight,b=(t.poster.originalWidth||16)/(t.poster.originalHeight||9);m===b&&(d="cover")}let f=function(m,b){m.preventDefault();let x=Lr(b.videoTag)?"PAUSE":"PLAY";Nt(x,b,e)},p=function(){Da(i.videoTag)},g=function(){Da(i.videoTag)},A=ix()||i.shouldPlay;return Je`
        <div class="syndigo-video"
             @on:click=${m=>f(m,i)}>

            <style>${SR}</style>

            <video id="${t.assetId}"
               @key=${i.uniqueVideoKey}
               @attrs:poster="${u}"
               @attrs:loop=${s}
               
               aria-label="${i.ariaVideoLabel}"
               
               playsinline="true"
               webkit-playsinline="true"
               crossorigin="anonymous"
               @attrs:controls=""
               @style:objectFit=${d}
               @style:aspectRatio=${`auto ${t.originalWidth}/${t.originalHeight}`}

               @on:play=${p}
               @on:playing=${g}
               
               preload="none"
               @hook:insert=${r}
               @hook:update=${a}
               @hook:destroy=${o}
               @attrs:disablePictureInPicture="">
               ${c}
               ${l}
            </video>

            <button class="syndigo-video-big-play-button"
                    @style:display=${A?"none":""}
                    type="button"
                    aria-live="polite"
                    title="Play"
                    aria-label="Play">

                <syndigo-svg-icon icon="play-circle" width="60" height="60" fill="white" />
            </button>
        </div>`}function hQ(i){i.hls&&(i.hls.destroy(),i.hls=void 0),i.videoPlayListener&&(Gu(i.videoPlayListener),i.videoPlayListener=void 0)}var TR={init:cQ,view:lQ,destroy:hQ};var IR=".syndigo-video-youtube{position:relative;max-block-size:100%;max-inline-size:100%;block-size:100%;inline-size:100%}.syndigo-video>iframe{min-block-size:200px;max-block-size:100%;max-inline-size:100%;inline-size:100%;block-size:100%;background-color:#000}";var Cl,dQ="YouTube";function fQ(i){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function)return i(null,window.YT);let e=window.onYouTubeIframeAPIReady;if(Cl=Cl||document.querySelector('script[src="https://www.youtube.com/iframe_api"]'),!Cl){Cl=document.createElement("script"),Cl.src="https://www.youtube.com/iframe_api";let t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(Cl,t)}window.onYouTubeIframeAPIReady=()=>{e&&e(),i(null,window.YT)}}function rx(i){let e,t,{track:n,video:s}=i,r,o=document.createElement("iframe");o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("frameborder",0),s.autoplay=!1;let a=window.SYNDI.getFramework().locale;a=(a||"").replace("_","-").split("-")[0];let c={destroy:cs,close:cs,pause:cs,play:cs,open:cs,dom:o,hasBegunPlaying:void 0},l=function(){h()},h=function(){e?.pauseVideo&&e.pauseVideo()},u=function(){e?.playVideo&&c.hasBegunPlaying&&e.playVideo()};c.destroy=l,c.close=h,c.pause=h,c.play=u,c.open=function(){t()};let d=function(_){_.assethash=s.assetHash,_.ai=s.assetId,_["media-api"]=dQ,_["media-url"]=s.src,n(_)},f=()=>{d({a:"error"})},p=()=>{d({a:"loadmeta"})},g=()=>{d({a:"load"})},A=()=>{d({a:"play"})},m=_=>{d({a:"pause",t:(+new Date-_)/1e3})},b=(_,S)=>{d({a:"complete",ad:S,t:(+new Date-_)/1e3})},x=(_,S,C)=>{d({a:"update",ad:C,duration:_,t:S})},y=_=>{try{if(_.origin==="https://www.youtube.com"){let S=_.data?JSON.parse(_.data):{};if(S.event==="infoDelivery"&&S.id===e?.id){let C=S.info;if(C?.currentTime){r=r||e.getDuration();let w=Math.floor(C.currentTime/r*4);if(w>i.lastRatio){i.lastRatio=w;let v=w*25,E=(+new Date-i.playTimestamp)/1e3;x(v,E,r)}}}}}catch{}};return t=function(){t=function(){},window.addEventListener("message",y),fQ(function(_,S){g();let C=function(){r=e.getDuration(),p()},w=function(){f()},v=function(F){F.data===S.PlayerState.PLAYING?(Da(o),MR(o),c.hasBegunPlaying=!0,i.playTimestamp=+new Date,i.lastRatio=0,A()):F.data===S.PlayerState.PAUSED?(tx(o),m(i.playTimestamp)):F.data===S.PlayerState.ENDED&&(tx(o),b(i.playTimestamp,r))},E=new URL(s.src);E.searchParams.append("enablejsapi","1"),s.autoplay&&(o.setAttribute("allow","autoplay"),E.searchParams.append("autoplay","1")),a&&(E.searchParams.append("cc_load_policy","1"),E.searchParams.append("cc_lang_pref",a)),E.searchParams.append("origin",window.location.origin),o.setAttribute("src",E.toString());let R=s.src.split("embed/")?.[1]?.split("?")?.[0]||void 0;e=new S.Player(o,{videoId:R,playerVars:{autoplay:s.autoplay?1:0,rel:0},events:{onError:w,onReady:C,onStateChange:v}})})},c}function RR(i){i.fsmEvents=i.fsmEvents||{},i.fsmEvents.play=function(){Da(i.videoTag.dom),i.videoTag.play()},i.fsmEvents.pause=i.videoTag.pause}var pQ=i=>{let{asset:e,track:t}=i,n=i.asset.sources[0].url,s=rx({video:{assetId:i.asset.assetId,src:n},track:i.track,lastRatio:0,playTimestamp:0}),r={asset:e,track:t,videoTag:s,uniqueVideoKey:`vid-${Ii()}-${i.asset.assetId}`,videoPlayListener:void 0,ariaVideoLabel:i.ariaVideoLabel||"Video player",...i};return RR(r),r},mQ=i=>{RR(i);let e=n=>{i.videoPlayListener=function(s){_m(s,i.videoTag.dom)&&i.videoTag.pause()},xm(i.videoPlayListener),i.videoTag.dom.style.aspectRatio=`auto ${i.asset.originalWidth}/${i.asset.originalHeight}`,n.elm.insertAdjacentElement("afterbegin",i.videoTag.dom),i.videoTag.open()},t=()=>{BR(i)};return Je`<div id="${i.uniqueVideoKey}" class="syndigo-video-youtube" style="min-block-size: 200px;"
        @key=${i.uniqueVideoKey}
        @hook:insert=${e} 
        @hook:destroy=${t} >
        <style>${IR}</style>
    </div>`},BR=i=>{Lr(i.videoTag.dom)&&i.videoTag.destroy(),i.videoPlayListener&&(Gu(i.videoPlayListener),i.videoPlayListener=void 0)},DR={init:pQ,view:mQ,destroy:BR};var AQ={YouTube:DR,NativeVideo:TR};function vm(i){return AQ[i.asset.videoApi]}var Qu=class extends HTMLElement{constructor(){super(),pn({el:this,serializable:!0,innerHtml:`<style>
                :host { display: block }

                :host([hidden]) { display: none; }
            </style>

            <div></div>`});let e={currentVnode:ps(this.shadowRoot.querySelector("div")),video:void 0};this._model=e;let t=function(){let{video:n}=e,s=vm(n).view(n,()=>t());e.currentVnode=Je.update(e.currentVnode,s)};this._update=t}connectedCallback(){}disconnectedCallback(){this._model.video&&vm(this._model.video).destroy(this._model.video)}set model(e){this._model.video&&vm(this._model.video).destroy(this._model.video),this._model.video=vm(e).init(e),this._update()}attributeChangedCallback(e,t,n){e==="paused"&&n!==null&&this._model.video&&Nt("PAUSE",this._model.video,this._update)}static get observedAttributes(){return["paused"]}};var zu=class extends HTMLElement{constructor(){super();let s=pn({el:this,serializable:!1,innerHtml:`<style>
                :host { display: block }
                :host([hidden]) { display: none; }
                * { box-sizing: border-box; }
            </style>

            <svg width=16
                 height=16
                 aria-hidden="true"
                 focusable="false"
                 part="guts"
                 xmlns="http://www.w3.org/2000/svg"></svg>`}).querySelector("svg");s.focusable=!1}connectedCallback(){}disconnectedCallback(){}attributeChangedCallback(e,t,n){if(e==="icon")n!==null&&gQ(this.shadowRoot.querySelector("svg"),n);else if(e==="width")this.shadowRoot.querySelector("svg").setAttribute("width",n);else if(e==="height")this.shadowRoot.querySelector("svg").setAttribute("height",n);else if(e==="fill")this.shadowRoot.querySelector("svg").setAttribute("fill",n);else if(e==="color")this.shadowRoot.querySelector("svg").setAttribute("color",n);else if(e==="data-title"){let s=this.getAttribute("data-title"),r=this.shadowRoot.querySelector("svg");if(s){let o=this.shadowRoot.querySelector("svg > title");o||(o=document.createElementNS("http://www.w3.org/2000/svg","title"),r.insertAdjacentElement("afterbegin",o)),o.textContent=s;let a="a11y-"+Math.ceil(Math.random()*999999);o.setAttribute("id",a),r.removeAttribute("aria-hidden"),r.setAttribute("aria-labelledby",a)}}}static get observedAttributes(){return["icon","width","height","fill","color","data-title","border-radius"]}};function gQ(i,e){let n=new XMLHttpRequest;n.open("GET",`${window.SYNDI.getContentDomain()}/asset/icons/${e}.svg`,!0),n.onload=function(){if(this.status>=200&&this.status<400){let o=new DOMParser().parseFromString(this.response,"text/xml").getElementsByTagName("svg")[0],a=i.querySelector("svg > title")?.textContent,c=i.querySelector("svg > title")?.id;if(i.innerHTML=o.innerHTML,a){let h=document.createElementNS("http://www.w3.org/2000/svg","title");h.textContent=a,h.id=c,i.insertAdjacentElement("afterbegin",h)}i.setAttribute("viewBox",o.getAttribute("viewBox")),i.setAttribute("style",o.getAttribute("style")||"");let l=i.getRootNode().host.getAttribute("border-radius");l&&i.style.setProperty("border-radius",l,"important")}},n.send()}var Hu=class extends HTMLElement{constructor(){super(),pn({el:this,serializable:!0,innerHtml:`<style>
                * { box-sizing: border-box; }

                button {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    margin: 0;
                    padding: 0;
                    border: none;
                    inline-size: 100%;
                    block-size: 100%;
                }
            </style>
            <button part="button" class="syndigo-iconbutton" >
                <syndigo-svg-icon part="syndisvgicon" fill="" color="" height="16" width="16" />
            </button>`})}connectedCallback(){}disconnectedCallback(){}attributeChangedCallback(e,t,n){let s=this.shadowRoot.querySelector("button");if(e.includes("btn")&&(e==="data-btnariacontrols"?s.setAttribute("aria-controls",n):e==="data-btnariaexpanded"?s.setAttribute("aria-expanded",n):e==="data-btnarialabel"&&s.setAttribute("aria-label",n)),e.includes("icon")){let r=s.querySelector("syndigo-svg-icon");e==="data-icon"?r.setAttribute("icon",n):e==="data-iconcolor"?r.setAttribute("color",n):e==="data-iconfill"?r.setAttribute("fill",n):e==="data-iconheight"?r.setAttribute("height",n):e==="data-iconwidth"?r.setAttribute("width",n):e==="data-icontitle"&&r.setAttribute("data-title",n)}}static get observedAttributes(){return["data-icon","data-iconcolor","data-iconfill","data-iconheight","data-iconwidth","data-icontitle","data-btnariacontrols","data-btnariaexpanded","data-btnarialabel"]}};var LR=["ar-dz","ar-eg","ar-iq","ar-jo","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sy","ar-tn","ar-ye","cs-cz","da-dk","de","de-lu","en","en-za","es","es-419","es-ar","es-cu","es-es","es-gt","es-la","es-pe","es-ve","fi-fi","fr","fr-ca","fr-mc","hu","it-it","iw","ja","ko-kr","nb-no","nl","pl-pl","pt","pt-ao","pt-br","ru-ru","sv-se","tr-tr","zh-cn","zh-tw"];function ox(){let i={},e={},t=[],n=function(){e={}},s=function(h,u,...d){if(!Object.prototype.hasOwnProperty.call(i,h)||!Object.prototype.hasOwnProperty.call(i[h],u))return!1;for(let f=t.length-1;f>=0;f--){let p=t[f];p.namespace===h&&p.topic===u&&(a(p),p.callback(...d),p.splice(f,1))}return i[h][u].map(f=>f(...d))},r=function(h,u,...d){return s(h,u,...d),typeof e[h+"-"+u]!="object"&&(e[h+"-"+u]=[]),e[h+"-"+u].push({namespace:h,topic:u,args:d}),!0},o=function(h,u,d){let f=l(h,u,d);for(let p in e){if(e.hasOwnProperty(p)===!1)continue;let g=e[p];for(let A=g.length-1;A>=0;A--)g[A].namespace===f.namespace&&g[A].topic===f.topic&&d.apply(null,g[A].args)}return f},a=function(h){if(!Object.prototype.hasOwnProperty.call(i,h.namespace)||!Object.prototype.hasOwnProperty.call(i[h.namespace],h.topic))return!1;for(let u=0;u<i[h.namespace][h.topic].length;u++)if(i[h.namespace][h.topic][u]===h.callback)return i[h.namespace][h.topic].splice(u,1),!0;return!1},c=function(){i={},e={}},l=function(h,u,d){return Object.prototype.hasOwnProperty.call(i,h)||(i[h]=[]),Object.prototype.hasOwnProperty.call(i[h],u)||(i[h][u]=[]),i[h][u].push(d),{namespace:h,topic:u,callback:d}};return{clearPersistentEvents:()=>{n()},publish:(h,u,...d)=>s(h,u,...d),publishPersist:(h,u,...d)=>r(h,u,...d),subscribe:(h,u,d)=>o(h,u,d),unsubscribe:h=>a(h),unsubscribeAll:()=>{c()}}}async function Em(i,e){if(!e.length)return;e=e.filter(n=>!i.modules[n]);let t=e.map(n=>import(i.root+n+".min.mjs"));return Promise.all(t)}function Sm(i){}var yQ={uninitialized:0,loading:1,loaded:2,interactive:3,complete:4},uo=yQ;async function Vu(i){return new Promise(function(e){setTimeout(e,i)})}async function Ns({conditions:i,timeout:e,retryDelay:t}){let n=Date.now();e=e||2e4,t=t||100;do{if(i())return!0;await Vu(t)}while(Date.now()-n<=e);return!1}function bQ(){switch(document.readyState){case"uninitialized":return uo.uninitialized;case"loading":return uo.loading;case"loaded":return uo.loaded;case"interactive":return uo.interactive;case"complete":return uo.complete;default:return-1}}function xQ(i){return document.readyState!=="complete"&&i.waitForReadyState===void 0?!0:bQ()>=i.waitForReadyState}async function ax(i){return Ns({conditions:()=>xQ(i),timeout:i.loadTimeout})}function Ml(i){if(!i.retailerwebsite||!i.retailerwebsite.pageType)return"MAYBE";let e=i.retailerwebsite.pageType();return e==="product"||e==="multi-product"?"YES":"NO"}function cx(i){return{destroy:function(){let n=document.querySelector("#syndi_powerpage");n&&(n.innerHTML="")},init:async function(n){let s;try{if(await Ns({conditions:()=>(s=document.querySelector(n.domSelector||"#syndi_powerpage"),!!s),timeout:i.loadTimeout}),!s)throw new Error}catch{!document.querySelector("syndigo-powerpage")&&(Ml(i)==="YES"||Ml(i)==="MAYBE")&&pi(i,{type:"haciao",message:"power-page: did not find target div"});return}let r=document.createElement("syndigo-powerpage");i.ecJsonURL?r.setAttribute("ecjsonurl",i.ecJsonURL):r.setAttribute("pageid",i.pageid),s.appendChild(r)}}}function lx(){return{destroy:function(){},init:async()=>{}}}function hx(){return{init:async()=>{},destroy:()=>{}}}function _Q(i){if(i!==void 0&&!(i instanceof Array)&&i?.registerModule!==void 0)return;let e={abTestingExperiments:{},captureUrlParams:void 0,domainAllowList:[],contentPresence:{hotspots:!1,mosaic:!1,powerpage:!1},experienceInstances:{brandcontent:void 0,powerpage:void 0,hotspots:void 0,mosaic:void 0},css:{},customModules:[],environment:"",hasContent:void 0,loadTimeout:5e3,locale:void 0,rawSiteCssProperties:void 0,siteCssProperties:void 0,translations:{},localize:cs,modules:{},moduleParameters:{},retryDelay:100,root:"https://content.syndigo.com/site/common/",trackingRoot:"https://event.syndigo.cloud/event/",tracking:{sessionId:void 0,spid:void 0,visitId:void 0,customParams:{},options:{},timestamp:void 0,transactionRecorded:!1,cartProductsRecorded:!1,capturedUrlParams:void 0,sanitizeErrorRecorded:!1,analyticsCollection:void 0,analyticsUserConsent:void 0},contentDomain:"https://content.syndigo.com",uriDataRoot:"./",uriDataRootBrand:"./",waitForReadyState:uo.loaded,loadingPageid:void 0},t=[];async function n(p){let g=[];return p.forEach(function(A){let m=e.modules[A];if(!m)return;let b=new m(e);b.init!==void 0&&g.push(b.init())}),Promise.all(g)}function s(p,g,A){if(Object.prototype.hasOwnProperty.call(p,g))if(g==="abTestingExperiments")e.abTestingExperiments=p[g]||{};else if(g==="moduleParameters")e.moduleParameters=p[g]||{};else if(g==="contentCallback"){let m=e.contentCallback;e.contentCallback=b=>{ei(m)&&m(b),ei(p[g])&&p[g](b)}}else if(g==="noContentCallback"){let m=e.noContentCallback;e.noContentCallback=b=>{ei(m)&&m(b),ei(p[g])&&p[g](b)}}else e[g]=p[g];else A!==void 0&&(e[g]=A)}function r(p){let g=["abTestingExperiments","cacheBuster","captureUrlParams","domainAllowList","contentCallback","noContentCallback","customModules","environment","loadTimeout","locale","pageIdModule","moduleParameters","ecJsonURL","prtnid","siteid","retryDelay","root","staticWidgets","trackingRoot","contentDomain","uriDataRoot","waitForReadyState","widgethash"];for(let A=0;A<g.length;A++)s(p,g[A]);e.uriDataRoot.endsWith("/")||(e.uriDataRoot+="/")}function o(p,g){if(p=(p||"").toLowerCase().trim(),g.includes(p))return`translations/${p}`;if(p.includes("-")){let A=p.split("-")[0];if(g.includes(A))return`translations/${A}`}return p==="he-il"?"translations/iw":"translations/en"}async function a(p){let A=Math.floor(Date.now()/864e5),m=p.uriDataRoot.replace("page","site")+"styles.json?cv="+A;p.rawSiteCssProperties=await Lu(p,m)}async function c(){i instanceof Array&&i.filter(_=>typeof _=="object").map(_=>r(_)),e.siteid=e.siteid||e.prtnid||0;let[p]=await Promise.all([ax(e),a(e)]),g=[];e.customModules.includes("tracking/event/event")||e.customModules.push("tracking/event/event"),g=g.concat(e.customModules);let A=o(e.locale,LR);g.push(A),e.pageIdModule&&(g=g.concat(e.pageIdModule));let m;try{await Em(e,g)}catch(_){m=_}e.translations=e.modules[A](),e.localize=(_,S)=>e.translations[_]?.[S]||"",e.mediator=ox("main-bus"),e.mediator.subscribe("content","new",function(){e.mediator.clearPersistentEvents()});let b=i.find(_=>Qi(_)&&_.type==="analytics-consent");b&&Im(e,b.choice),Rx(e),Dx(e),m&&pi(e,{message:`syndi failed to load dependencies ${m}`,type:"framework"}),p||pi(e,{msg:"timed out waiting for document ready"}),e.pageIdModule!==void 0&&(e.retailerwebsite=new e.modules[e.pageIdModule](e),e.retailerwebsite.pageType!==void 0&&(e.pagetype=e.retailerwebsite.pageType()));let x=i.concat(t),y=x.filter(_=>typeof _=="string");if(e.pageid=y.pop(),!e.pageid&&e.retailerwebsite&&(e.pageid=await e.retailerwebsite.pageidentifier()),await n(e.customModules),customElements.get("syndigo-mosaic")||customElements.define("syndigo-mosaic",Fu),customElements.get("syndigo-hotspots")||customElements.define("syndigo-hotspots",Ou),customElements.get("syndigo-powerpage")||customElements.define("syndigo-powerpage",Uu),customElements.get("syndigo-video")||customElements.define("syndigo-video",Qu),customElements.get("syndigo-svg-icon")||customElements.define("syndigo-svg-icon",zu),customElements.get("syndigo-icon-button")||customElements.define("syndigo-icon-button",Hu),Sm("Syndigo version: 2026-11-11_v1.0.569"),x=i.concat(t),await f(x.filter(_=>_&&_.type!==void 0)),!(e.pageid||e.widgethash||e.staticWidgets||e.ecJsonURL)){Sm("ERROR: No content published");return}if(e.ecJsonURL===void 0)await u(e.pageid?.trim());else if(e.ecJsonURL){let _=await l({ecJsonURL:e.ecJsonURL});await h(_)}setTimeout(()=>{e.hasContent===void 0&&ei(e.contentCallback)&&e.contentCallback(!1)},e.loadTimeout)}let l=async function({pageid:p,ecJsonURL:g}){return await Ob({framework:e,pageid:p,url:g}).promise},h=async function(p){let g=!1,A=p.pageJson,[m,b,x]=p.holdoutChoices;return A.experiences&&(A.experiences["power-page"]&&(e.contentPresence.powerpage=!0,g=!0,(!x||m)&&(e.experienceInstances.powerpage=new cx(e),e.experienceInstances.powerpage.init({componentId:A.componentId,enhancedProductContentId:A.enhancedProductContentId,...A.experiences["power-page"]}))),A.experiences.hero&&(A.experiences.hero.heroImages.length&&((!b||m)&&(e.contentPresence.hotspots=!0,e.experienceInstances.hotspots=new hx(e),e.experienceInstances.hotspots.init({componentId:A.componentId,enhancedProductContentId:A.enhancedProductContentId,...A.experiences.hero})),g=!0),A.experiences.hero.mosaicWidgetIds.length&&((!b||m)&&(e.contentPresence.mosaic=!0,e.experienceInstances.mosaic=new lx(e),e.experienceInstances.mosaic.init({componentId:A.componentId,enhancedProductContentId:A.enhancedProductContentId,...A.experiences.hero})),g=!0)),g&&(Hs(e),e.mediator.publish("heartbeat","start")),e.mediator.publish("contentPresence","changed",{...e.contentPresence})),g},u=async function(p){if(e.loadingPageid||!p)return;e.loadingPageid=p,e.hasContent=void 0;let g={pageJson:{},holdoutChoices:[]};e.mediator.publish("content","new");try{g=await l({pageid:p})}catch{g.pageJson={},g.holdoutChoices=[]}g.pageJson.siteid?e.siteid=g.pageJson.siteid:g.pageJson.retailerid?e.siteid=g.pageJson.retailerid:g.pageJson.prtnid&&(e.siteid=g.pageJson.prtnid),g.pageJson.retailerwebsitepagetype&&g.pageJson.retailerwebsitepagetype.name?e.pagetype=g.pageJson.retailerwebsitepagetype.name.toLowerCase():e.retailerwebsite&&e.retailerwebsite.pageType&&(e.pagetype=e.retailerwebsite.pageType()),e.hasContent=await h(g),e.loadingPageid=void 0,ei(e.contentCallback)&&e.contentCallback(e.hasContent)},d=function(){e.experienceInstances.powerpage&&e.experienceInstances.powerpage.destroy(),e.experienceInstances.mosaic&&e.experienceInstances.mosaic.destroy(),e.experienceInstances.hotspots&&e.experienceInstances.hotspots.destroy(),e.experienceInstances.brandcontent&&e.experienceInstances.brandcontent.destroy(),e.experienceInstances.powerpage=null,e.experienceInstances.mosaic=null,e.experienceInstances.hotspots=null,e.experienceInstances.brandcontent=null,e.contentPresence.hotspots=!1,e.contentPresence.mosaic=!1,e.contentPresence.powerpage=!1,e.pageid="",e.mediator&&(e.mediator.publish("heartbeat","stop"),e.mediator.publish("anchor","reset"),e.mediator.publish("contentPresence","changed",{...e.contentPresence}))},f=async function(...p){let g=[];if(p.map(A=>A instanceof Array?g.push(...A):g.push(A)),e.mediator===void 0){t=t.concat(g);return}for(let A=0;A<g.length;A++)if(wo(g[A]))console.warn("Syndigo: pageid MUST be a string when calling SYNDI.push(pageid);");else if(Ca(g[A])){let m=Ta(e,g[A].trim());m&&m!==e.pageid&&(d(),e.pageid=m,await u(g[A]))}else if(Qi(g[A])){if(g[A].type==="track")e.mediator.publishPersist("tracking","event",g[A]);else if(g[A].type==="analytics-consent")Im(e,g[A].choice);else if(ei(g[A].contentCallback)){let m=ei(e.contentCallback)?e.contentCallback:void 0;e.contentCallback=b=>{m&&m(b),g[A].contentCallback(b)},e.hasContent!==void 0&&g[A].contentCallback(e.hasContent)}}};setTimeout(c,1),window.SYNDI={push:f,importDynamic:async function(p){return await Em(e,[p]),e.modules[p]},version:()=>"v1.0.569",registerModule:function(p){e.modules[p.type]===void 0&&(e.modules[p.type]=p.moduleclass)},getContentDomain:()=>e.contentDomain.replace(/\/$/,""),reset:d,getFramework:()=>e,updateSiteid:async function(p){if(!p||e.siteid===p)return;e.uriDataRoot=e.uriDataRoot.replace(e.siteid,p),e.siteid=p,await a(e);let g=e.pageid;g&&(d(),f(g))}}}_Q(window.SYNDI);window.SYNDI.registerModule({type:"tracking/event/event",moduleclass:function(i){let e={addToCart:"k",transaction:"t",transactionItem:"tp",default:"cd"},t={k:["qty","sku","price"],t:["orderid","total"],tp:["orderid","sku","price","count"]};function n(o,a){if(t.hasOwnProperty(o)){for(let c=0;c<t[o].length;c++)if(a.hasOwnProperty(t[o][c])===!1)return!1}return!0}function s(o,a){if(o==="t"&&a.hasOwnProperty("items")&&a.items instanceof Array){for(let c=0;c<a.items.length;c++){let l=a.items[c];l.orderid=a.orderid,l.event="transactionItem",r(l)}delete a.items}return a}function r(o){let a=e[o.event]||e.default;if(n(a,o)===!1)return pi(i,{type:"eventTracking",message:"Missing mandatory parameter for the pixel "+a+" ["+JSON.stringify(t[a])+"]"});o=s(a,o),o!==void 0&&qi(i,a,o)}return{init:function(){i.mediator.subscribe("tracking","event",r)}}}});function ux(i,e,t=400,n,s="inline"){let r=i==="in",o=r?0:1,a=50;t==="fast"?t=200:t==="slow"&&(t=600);let c=a/t;e&&r&&(e.style.display=s,e.style.opacity=o);function l(){o=r?o+c:o-c,e&&(e.style.opacity=o),e&&o<=0&&(e.style.display="none"),(o<=0||o>=1)&&(window.clearInterval(h),e&&(e.style.opacity=""),n&&n())}let h=window.setInterval(l,a)}window.SYNDI.registerModule({type:"specific/microcenter/anchor/producthero",moduleclass:function(i){let e,t="syndi_hotspots",n=function(){e=document.createElement("div"),e.id=t;let r=document.querySelector(".slides-container img");e.setAttribute("style",`
                display: none;
                position: absolute;
                width: ${r?r.offsetWidth:0}px;
                height: ${r?r.offsetHeight:0}px;
                z-index: 6;
            `);let o=document.querySelector(".slides-container");o&&o.insertBefore(e,o.firstChild)},s=function(){ux("in",e,void 0,void 0,"inline-block")};return{init:function(){i.pageid&&(n(),i.mediator.subscribe(`#${t}_to_parent`,"display",function(){s()}))}}}});function PR(i,e,t){let n=document.querySelector(t.selector);if(!n)return;t.parentStyle&&n.setAttribute("style",t.parentStyle);let s="syndi_powerpage";if(t.html){let a=t.html.replace("sp_inline_product",s).replace(/\sid=/g," data-syndi-id=");a=Ta(i,a),a=a.replace(/ data-syndi-id=/g," id="),n.insertAdjacentHTML(t.position,a);return}let r=document.createElement("div");r.id=s,e.style&&r.setAttribute("style",e.style),t.style&&r.setAttribute("style",t.style+r.getAttribute("style")),n.insertAdjacentElement(t.position,r)}function vQ(i,e){return e.filter(t=>t.pagetype&&i.pagetype&&t.pagetype!==i.pagetype||t.pageid&&i.pageid&&t.pageid!==i.pageid?!1:typeof t.condition=="function"?t.condition():!!document.querySelector(t.selector))}async function dx({framework:i,siteConfig:e}){let t=[],n;return await Ns({conditions:function(){return t=vQ(i,e.rules),t.length>0}}),n=t[0],n&&(PR(i,e,n),i.mediator.subscribe("anchor","reset",async()=>{let s="syndi_powerpage",r=document.querySelector(".syndi_powerpage.syndigo-shadowed-powerpage");r&&r.shadowRoot&&(r.shadowRoot.innerHTML="");let o=document.querySelector(`#${s}`);o?o.innerHTML="":(r&&r.parentNode.removeChild(r),await Ns({conditions:()=>!!document.querySelector(n.selector),timeout:i.timeout,retryDelay:50}),PR(i,e,n))})),!!n}window.SYNDI.registerModule({type:"site/anchor/inline",moduleclass:function(i){return{init:function(){let e=Ex(i.moduleParameters);dx({framework:i,siteConfig:e})}}}});window.SYNDI.registerModule({type:"tracking/storage/local",moduleclass:function(){return{init:function(){}}}});var VR=mo(NR(),1),Ax=mo(GR(),1);var wQ=new Set(["__proto__","prototype","constructor"]),CQ=i=>!i.some(e=>wQ.has(e));function MQ(i){i=i.replace(/\[(\d+)]/g,".$1");let e=i.split("."),t=[];for(let n=0;n<e.length;n++){let s=e[n];for(;s[s.length-1]==="\\"&&e[n+1]!==void 0;)s=s.slice(0,-1)+".",s+=e[++n];t.push(s)}return CQ(t)?t:[]}function Wu(i,e,t){if(!Qi(i)||typeof e!="string")return t===void 0?i:t;let n=MQ(e);if(n.length!==0){try{n.forEach(s=>{i=i[s]})}catch{return t}return i===void 0?t:i}}var QR="site/tracking/addtocart";function TQ(i){return typeof i=="string"&&(i=i.trim()),Number(i)}function zR(i,e){pi(i,{type:Ju.add_to_cart,message:e})}function IQ(i){let e=Fr.addToCart.button_missing;pi(i,{type:Ju.haciao_module,message:e})}function WR(i,e){let t=`${Fr.addToCart.caught_exception} ${e?.message||""}`;pi(i,{type:Ju.add_to_cart,message:t})}function RQ(i,e){let t={sku:i.pageid,qty:"null",...e};return t.type=Tx.track,t.event=Ix.addToCart,t}function BQ(i,e){let t=new Intl.NumberFormat(i).formatToParts(12345.6),n=[...new Intl.NumberFormat(i,{useGrouping:!1}).format(9876543210)].reverse(),s=new Map(n.map((d,f)=>[d,f])),r=t.find(d=>d.type==="group").value,o=/\s/.test(typeof r=="number"?String.fromCodePoint(r):r.charAt(0)),a=new RegExp(`[${o?"\\s":r}]`,"g"),c=new RegExp(`[${t.find(d=>d.type==="decimal").value}]`),l=new RegExp(`[${n.join("")}]`,"g"),h=d=>s.get(d);return e=e.trim().replace(a,"").replace(c,".").replace(l,h).replace(/\s/g,""),e?+e:NaN}function DQ(i,e,t=""){if(e==null)return{rawPrice:void 0,price:void 0};e=e.toString().trim();let n=t||i.locale,s=Ax.default.getCurrency(t)||Ax.default.getCurrency(i.locale),r=(0,VR.default)(s),o=e.replace(r,""),a=BQ(n,o),c=""+(Number.isNaN(a)?"":a);return c&&!c.includes(".")&&(c+=".0"),{rawPrice:""+e||void 0,price:c||void 0}}function HR(i){let e=[],t=Wi(),n=i.rules.filter(s=>s.name.startsWith(Dt.addToCartButton));for(let s of n)if(s.name===Dt.addToCartButton){let r=t.document.querySelector(s.selector);r&&!e.includes(r)&&e.push(r)}else if(s.name===Dt.addToCartButtons){let r=t.document.querySelectorAll(s.selector);for(let o of[...r])e.includes(o)||e.push(o)}return e}function LQ(i,e){try{let t=RQ(i);t[Dt.qty]=void 0;let n=e.rules.filter(c=>!c.name.startsWith(Dt.addToCartButton)),s=[Dt.price,Dt.qty,Dt.brand,Dt.name,Dt.category],r=Wi();for(let c of n){if(!s.includes(c.name))throw new Error(`${Fr.addToCart.unknown_rule_name} '${c.name}' ${QR}`);if(t[c.name]!==void 0)continue;let l="";if(c.type===Dt.windowVariable)l=Wu(r,c.selector);else if(c.type===Dt.domElement){let h=r.document.querySelector(c.selector);h&&(l=c.location.type===Dt.property?h[c.location.name]:h.getAttribute(c.location.name))}else throw new Error(`${Fr.addToCart.unknown_rule_type} '${c.type}' ${QR}`);if(l&&c.name===Dt.price){let{rawPrice:h,price:u}=DQ(i,l,c.locale);l=u,t.rawPrice=h}l&&c.name===Dt.qty&&(l=TQ(l)),l&&(t[c.name]=l)}!!n.find(c=>c.name===Dt.qty)&&!t.qty&&zR(i,Fr.addToCart.qty_missing),t.qty||(t.qty="null"),!!n.find(c=>c.name===Dt.price)&&!t.price&&zR(i,Fr.addToCart.price_missing),Ux(i,t)}catch(t){WR(i,t)}}async function gx({framework:i,siteConfig:e,moduleFn:t}){let n=[],s=function(){LQ(i,e)};typeof t=="function"&&(s=function(){t()});let r=Wi();if(e.mutationObserver.enabled){let o=r.document.querySelector(e.mutationObserver.selector);if(o){let a=new MutationObserver(()=>{for(let c of n)c.removeEventListener("click",s);n=HR(e);for(let c of n)c.addEventListener("click",s)});try{a.observe(o,{childList:!0,subtree:!0})}catch(c){WR(i,c)}}}await Ns({conditions:function(){return n=HR(e),n.length>0}});for(let o of n)o.addEventListener("click",s);!n.length&&Ml(i)==="YES"&&IQ(i)}window.SYNDI.registerModule({type:"site/tracking/addtocart",moduleclass:function(i){return{init:function(){let e=Mx(i.moduleParameters).config;gx({framework:i,siteConfig:e})}}}});function yx(){let i=window.SYNDI.getFramework(),e=i.pageid||"no-pageid";return i.hasContent&&(window.SyndiMigration?.migratedPageId===e||window.SyndiMigration?.upc===e||window.SyndiMigration?.customerPartNumber===e)}function bx(i){if(window.SYNDI.PAGEID_POLLING_ACTIVE)return;window.SYNDI.PAGEID_POLLING_ACTIVE=!0;let e=20,t=2,s=e*20,r="",o=()=>{window.Webcollage||(window.Webcollage={}),!yx()&&(window.Webcollage.Url!==document.location.href?(window.Webcollage.Url=document.location.href,window.Webcollage.terminatePowerPage?.(),r=i(),r?window.SYNDI.push(r):window.SYNDI.reset()):r||(r=i(),r&&window.SYNDI.push(r)))},a=function(){o();let c=s>0?e:t,l=Math.round(1e3/c);s>0&&s--,setTimeout(requestAnimationFrame,l,a)};requestAnimationFrame(a)}async function xx(i,e=2e4){if(!(i.rules.filter(o=>o.requiresPolling).length>0))return qR(i.rules);bx(()=>qR(i.rules));let n=Date.now(),s=50,r=window.SYNDI.getFramework();for(;!r.pageid&&Date.now()-n<e;)await Vu(s);return r.pageid||""}function qR(i){let e=Wi(),t;for(let n of i){if(n.type===Dt.windowVariable)t=Wu(e,n.selector);else if(n.type===Dt.domElement){let s=e.document.querySelector(n.selector);s&&(t=n.location.type===Dt.property?s[n.location.name]:s.getAttribute(n.location.name))}else if(n.type===Dt.urlPattern){let s=new RegExp(n.selector),r=e.location.href.match(s);r&&(t=r[1])}else if(n.type===Dt.urlParameter)t=new URL(e.location).searchParams.get(n.selector);else throw new Error(`unknown site/pageid rule type: '${n.type}'`);if(t)return t=""+t,n.modifiers.forEach(s=>{if(s.type===Dt.replacement){let r=new RegExp(s.regexSelector,s.regexFlags);t=t.replace(r,s.replace)}else s.type===Dt.casing&&(t=s.value===Dt.upper?t.toUpperCase():t.toLowerCase())}),t.trim()}}window.SYNDI.registerModule({type:"site/pageid",moduleclass:function(i){return{pageidentifier:async function(){let e=Sx(i.moduleParameters);return xx(e)}}}});
/*! Bundled license information:

@lit/reactive-element/decorators/custom-element.js:
@lit/reactive-element/reactive-element.js:
@lit/reactive-element/decorators/property.js:
@lit/reactive-element/decorators/state.js:
@lit/reactive-element/decorators/event-options.js:
@lit/reactive-element/decorators/base.js:
@lit/reactive-element/decorators/query.js:
@lit/reactive-element/decorators/query-all.js:
@lit/reactive-element/decorators/query-async.js:
@lit/reactive-element/decorators/query-assigned-nodes.js:
lit-html/lit-html.js:
lit-element/lit-element.js:
  (**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   *)

@lit/reactive-element/css-tag.js:
  (**
   * @license
   * Copyright 2019 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   *)

@lit/reactive-element/decorators/query-assigned-elements.js:
  (**
   * @license
   * Copyright 2021 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   *)

three/build/three.core.js:
three/build/three.module.js:
  (**
   * @license
   * Copyright 2010-2024 Three.js Authors
   * SPDX-License-Identifier: MIT
   *)

lit-html/is-server.js:
  (**
   * @license
   * Copyright 2022 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   *)

@google/model-viewer/lib/constants.js:
@google/model-viewer/lib/utilities.js:
@google/model-viewer/lib/features/environment.js:
@google/model-viewer/lib/assets/close-material-svg.js:
@google/model-viewer/lib/assets/controls-svg.js:
@google/model-viewer/lib/assets/view-in-ar-material-svg.js:
@google/model-viewer/lib/template.js:
@google/model-viewer/lib/utilities/cache-eviction-policy.js:
@google/model-viewer/lib/three-components/CachingGLTFLoader.js:
@google/model-viewer/lib/styles/parsers.js:
@google/model-viewer/lib/styles/conversions.js:
@google/model-viewer/lib/styles/evaluators.js:
@google/model-viewer/lib/styles/style-effector.js:
@google/model-viewer/lib/decorators.js:
@google/model-viewer/lib/utilities/animation.js:
@google/model-viewer/lib/features/controls.js:
@google/model-viewer/lib/three-components/ARRenderer.js:
@google/model-viewer/lib/three-components/TextureUtils.js:
@google/model-viewer/lib/three-components/Renderer.js:
@google/model-viewer/lib/three-components/ModelScene.js:
@google/model-viewer/lib/utilities/progress-tracker.js:
@google/model-viewer/lib/model-viewer-base.js:
@google/model-viewer/lib/features/animation.js:
@google/model-viewer/lib/features/annotation.js:
@google/model-viewer/lib/styles/deserializers.js:
@google/model-viewer/lib/features/ar.js:
@google/model-viewer/lib/features/loading.js:
@google/model-viewer/lib/features/staging.js:
@google/model-viewer/lib/model-viewer.js:
  (* @license
   * Copyright 2019 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@google/model-viewer/lib/three-components/gltf-instance/VariantMaterialLoaderPlugin.js:
@google/model-viewer/lib/three-components/gltf-instance/VariantMaterialExporterPlugin.js:
@google/model-viewer/lib/three-components/EnvironmentScene.js:
  (* @license
   * Copyright 2021 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@google/model-viewer/lib/three-components/Damper.js:
@google/model-viewer/lib/three-components/PlacementBox.js:
@google/model-viewer/lib/three-components/GLTFInstance.js:
@google/model-viewer/lib/three-components/gltf-instance/ModelViewerGLTFInstance.js:
@google/model-viewer/lib/features/scene-graph/three-dom-element.js:
@google/model-viewer/lib/features/scene-graph/image.js:
@google/model-viewer/lib/features/scene-graph/sampler.js:
@google/model-viewer/lib/features/scene-graph/texture.js:
@google/model-viewer/lib/features/scene-graph/texture-info.js:
@google/model-viewer/lib/features/scene-graph/pbr-metallic-roughness.js:
@google/model-viewer/lib/features/scene-graph/material.js:
@google/model-viewer/lib/features/scene-graph/model.js:
@google/model-viewer/lib/features/scene-graph.js:
@google/model-viewer/lib/three-components/Hotspot.js:
  (* @license
   * Copyright 2020 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@google/model-viewer/lib/three-components/SmoothControls.js:
  (* @license
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@google/model-viewer/lib/three-components/GroundedSkybox.js:
  (* @license
   * Copyright 2023 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@google/model-viewer/lib/three-components/Shadow.js:
  (* @license
   * Copyright 2022 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the 'License');
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an 'AS IS' BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

three/examples/jsm/libs/fflate.module.js:
  (*!
  fflate - fast JavaScript compression/decompression
  <https://101arrowz.github.io/fflate>
  Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
  version 0.8.2
  *)

tabbable/dist/index.esm.js:
  (*!
  * tabbable 6.2.0
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
  *)

dompurify/dist/purify.es.mjs:
  (*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE *)
*/
